-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new package for Spotlight Client (#228)
- Loading branch information
1 parent
0b17ce8
commit 35b089c
Showing
28 changed files
with
736 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: "Build Status" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
lint-public-dashboard: | ||
name: Lint Public Dashboard | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: public-dashboard-client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1.1.0 | ||
with: | ||
node-version: "12.x" | ||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn lint | ||
test-public-dashboard: | ||
name: Test Public Dashboard | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: public-dashboard-client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1.1.0 | ||
with: | ||
node-version: "12.x" | ||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test --coverage | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
flag-name: public-dashboard-client | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
path-to-lcov: public-dashboard-client/coverage/lcov.info | ||
lint-spotlight-client: | ||
name: Lint Spotlight Client | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: spotlight-client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1.1.0 | ||
with: | ||
node-version: "12.x" | ||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn lint | ||
test-spotlight-client: | ||
name: Test Spotlight Client | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: spotlight-client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1.1.0 | ||
with: | ||
node-version: "12.x" | ||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test --coverage | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
flag-name: spotlight-client | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
path-to-lcov: spotlight-client/coverage/lcov.info | ||
lint-spotlight-api: | ||
name: Lint Spotlight API | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: spotlight-api | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1.1.0 | ||
with: | ||
node-version: "12.x" | ||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn lint | ||
finish-coveralls: | ||
name: Finish Coveralls | ||
runs-on: ubuntu-latest | ||
needs: [test-public-dashboard, test-spotlight-client] | ||
steps: | ||
- name: Coveralls Parallel Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ yarn-error.log* | |
|
||
# Package files | ||
package-lock.json | ||
|
||
# Typescript build artifacts | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
// explicitly extending the base config so we don't override its own "extends" field | ||
"../.eslintrc.json", | ||
// From @typescript-eslint/eslint-plugin | ||
"plugin:@typescript-eslint/recommended", | ||
// From eslint-config-prettier | ||
"prettier/@typescript-eslint" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
// This is a living list! If an eslint rule does more harm than good, just | ||
// add it below to override it. Write a comment above each rule explaining | ||
// why the exception is made, so we know whether to keep it in the future. | ||
|
||
// the bare eslint rule breaks in typescript | ||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use | ||
"no-use-before-define": "off", | ||
"@typescript-eslint/no-use-before-define": ["error"], | ||
|
||
// don't require extensions for typescript modules | ||
"import/extensions": [ | ||
"error", | ||
"always", | ||
{ "js": "never", "ts": "never", "tsx": "never" } | ||
], | ||
|
||
// support typescript as well as javascript file extensions | ||
"react/jsx-filename-extension": [ | ||
"error", | ||
{ "extensions": [".tsx", ".js"] } | ||
], | ||
|
||
// We use TypeScript props interfaces, which is mostly redundant with prop | ||
// types. | ||
"react/prop-types": "off" | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
// use <root>/tsconfig.json | ||
"typescript": { | ||
// always try to resolve types under `<root>@types` directory | ||
// even it doesn't contain any source code, like `@types/unist` | ||
"alwaysTryTypes": true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Spotlight Client | ||
|
||
This package is a React client application for the next-generation Spotlight public data publishing website (not yet launched). It was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and is written in [TypeScript](https://www.typescriptlang.org/docs). | ||
|
||
## Development | ||
|
||
### Getting set up | ||
|
||
If you have followed the [setup instructions](../README.md#getting-set-up) in the root directory, you should be ready to go. You should be able to test your development environment via: | ||
|
||
`yarn test` | ||
`yarn lint` | ||
|
||
We suggest installing a linting package for your preferred code editor that hooks into [eslint](#yarn-lint). We recommend [linter-eslint](https://atom.io/packages/linter-eslint) if you're using Atom. | ||
|
||
### Running the application locally | ||
|
||
`yarn dev` will start a Webpack development server on port `3000` and open the homepage in your browser. | ||
|
||
The development servers will remain active until you either close your terminal or shut it down using `control+c`. | ||
|
||
**Note:** The frontend server does not need to be restarted when frontend source code is modified. The assets will automatically be recompiled and the browser will be refreshed. | ||
|
||
## Deploys | ||
|
||
Not yet implemented! Instructions will be found here once a process is in place. | ||
|
||
## Available Scripts | ||
|
||
Besides the scripts mentioned above for running and deploying the app, you can also run: | ||
|
||
### `yarn test` | ||
|
||
Launches the test runner in the interactive watch mode. | ||
|
||
We use [`@testing-library/react`](https://testing-library.com/docs/react-testing-library/intro) for React component tests. | ||
|
||
See the [Create React App docs](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
||
### `yarn lint` | ||
|
||
Runs Typescript and ESLint checks against the package to check for issues in type usage or code style. | ||
|
||
Eslint rules are configurable in `.eslintrc.json`, which inherits from the root `../.eslintrc.json` and extends it with settings specific to this package. Any change to this file should be accompanied with an explanation for the change and why it should be merged. | ||
|
||
Typescript rules are configurable in `./tsconfig.json`; this file was originally created by Create React App but it is safe to edit as needed. | ||
|
||
You can also run either TS or ESLint individually; while there are not predefined scripts for this, you can inspect the definition of `lint` in `package.json` to see the individual commands that are run, and you can pass either of them to `yarn run` as needed. | ||
|
||
### `yarn eject` | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
|
||
This package was bootstrapped with Create React App, which provides the option to `eject` its build tooling and configuration, allowing for full customization. See [the Create React App docs](https://create-react-app.dev/docs/available-scripts#npm-run-eject) for more information. |
Oops, something went wrong.