Skip to content

Commit

Permalink
Task/TUI-17 - Clean up repo (#24)
Browse files Browse the repository at this point in the history
* get HMR working

* sort out prod and dev dependencies

* resolve security vulnerabilities with packages

* install peer dependencies

* clean up repo file structure

* fix some linting and config issues

* split tapis-app tapis-ui and tapis-redux at root level

* remove react-dom alias from webpack for hotloader

* Refactor directories

* Fix tests

* Utils locations

* Fix webpack

* Readme

* Fix pipelines

* Remove duplicate tests

* fix test

* lint jest config

Co-authored-by: jchuahtacc <[email protected]>
  • Loading branch information
Strmiska and jchuahtacc authored May 19, 2021
1 parent 934dd19 commit 474f886
Show file tree
Hide file tree
Showing 213 changed files with 2,938 additions and 3,338 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion client/.eslintignore → .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
build
build
webpack.*.js
2 changes: 1 addition & 1 deletion client/.eslintrc → .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"ignorePatterns": ["*.test.js"],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/webpack.*.js", "**/*.test.js", "**/*.spec.js", "**/utils/testing.js"]}],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "**/utils/testing.js"]}],
"semi": [1, "always"],
"no-underscore-dangle": 0,
"react/jsx-props-no-spreading": [2, {
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ jobs:
- name: npm ci
run: |
cd client
npm ci
- name: Client Side Unit Tests
run: |
cd client
npm run test
# - name: Upload coverage to Codecov
Expand All @@ -55,9 +53,7 @@ jobs:
- name: npm ci
run: |
cd client
npm ci
- name: Client Side Linting
run: |
cd client
npm run lint
File renamed without changes.
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
### Requirements
# `tapis-ui`

- node.js stable
This project is a React-Redux based web client for [`https://tapis.io`](https://tapis.io).

## Requirements

### Instructions
- node.js stable

In the [`./client`](./client) directory, first install node dependencies:
## Installing and Running

First install node dependencies in the base directory:

```
```bash
npm install
```

Next, start a development server with:

```
```bash
npm run dev
```

You can then browse to you [`https://localhost:3000`](https://localhost:3000) to view the application.
Due to a self-signed certificate being used for the dev server, you will receive a security warning.

### Testing, Linting and Pipelines
## Project Structure

All of the project sources are in the [`./src`](./src) directory. There are three major components:

- [`tapis-redux`](./src/tapis-redux): Redux state management and service for accessing `tapis.io`
- [`tapis-ui`](./src/tapis-ui): UI components for interacting `tapis.io` services
- [`tapis-app`](./src/tapis-app): A sample web application built on `tapis-ui` and `tapis-redux` components

Each component is structured so that they can eventually be published as separate npm packages. They each have:

- `src` directory
- `__tests__` directory for unit tests for those components

In addition, all fixtures are available in [`./fixtures/`](./fixtures)

## Testing, Linting and Pipelines

You may run unit tests with

```
```bash
npm run test
```

You may run linting with

```
```bash
npm run lint
```

Expand Down
File renamed without changes.
14 changes: 0 additions & 14 deletions client/.github/pull_request_template.md

This file was deleted.

63 changes: 0 additions & 63 deletions client/.github/workflows/main.yml

This file was deleted.

23 changes: 0 additions & 23 deletions client/.gitignore

This file was deleted.

70 changes: 0 additions & 70 deletions client/README.md

This file was deleted.

Binary file removed client/public/favicon.ico
Binary file not shown.
Binary file removed client/public/logo192.png
Binary file not shown.
Binary file removed client/public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions client/public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions client/public/robots.txt

This file was deleted.

4 changes: 0 additions & 4 deletions client/src/constants/routes.js

This file was deleted.

9 changes: 0 additions & 9 deletions client/src/tapis-redux/fixtures/tapis-redux.fixture.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions fixtures/tapis-redux.fixture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { authenticatorStore as authenticator } from './authenticator.fixtures';
import { systemsStore as systems } from './systems.fixtures';

const tapisReduxStore = {
authenticator,
systems,
};

export default tapisReduxStore;
19 changes: 11 additions & 8 deletions client/jest.config.js → jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ module.exports = {
// A map from regular expressions to module names that allow to stub out resources with a single module
moduleNameMapper: {
'.*\\.(css|scss|sass)$': '<rootDir>/__mocks__/styleMock.js',
'^tapis-redux(.*)$': '<rootDir>/src/tapis-redux$1',
'^_common(.*)$': '<rootDir>/src/components/_common$1',
'^utils(.*)$': '<rootDir>/src/utils$1',
'^tapis-app(.*)$': '<rootDir>/src/tapis-app/src$1',
'^tapis-ui(.*)$': '<rootDir>/src/tapis-ui/src$1',
'^tapis-redux(.*)$': '<rootDir>/src/tapis-redux/src$1',
'^_common(.*)$': '<rootDir>/src/tapis-ui/src/_common$1',
'^fixtures(.*)$': '<rootDir>/fixtures$1',
},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
Expand Down Expand Up @@ -108,7 +110,11 @@ module.exports = {
// rootDir: null,

// A list of paths to directories that Jest should use to search for files in
roots: ['<rootDir>/src'],
roots: [
'<rootDir>/src/tapis-ui',
'<rootDir>/src/tapis-app',
'<rootDir>/src/tapis-redux',
],

// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
Expand All @@ -132,10 +138,7 @@ module.exports = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/src/**/?(*.)+(spec|test).[tj]s?(x)',
],
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['./node_modules/'],
Expand Down
Loading

0 comments on commit 474f886

Please sign in to comment.