Skip to content

Commit e3e70ea

Browse files
authored
Merge pull request #77 from nimblehq/release/2.2.0
Release 2.2.0
2 parents 25724c3 + c71c917 commit e3e70ea

File tree

27 files changed

+386
-186
lines changed

27 files changed

+386
-186
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Team Lead
2-
* @carryall
3-
4-
# Team Members
5-
* @bterone @hanam1ni @hoangmirs @malparty @rosle @tyrro
1+
# Team
2+
# @carryall is the Team Lead and the others are team members
3+
* @carryall @bterone @hanam1ni @hoangmirs @malparty @rosle @tyrro
64

75
# Engineering Leads
86
CODEOWNERS @nimblehq/engineering-leads

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
name: Bootstrap app, run linters and tests with Node ${{ matrix.node }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node: [14, 16]
12+
steps:
13+
- name: Cancel Previous Runs
14+
uses: styfle/[email protected]
15+
with:
16+
access_token: ${{ github.token }}
17+
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Setup node and restore cached dependencies
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node }}
25+
cache: 'npm'
26+
27+
- name: Bootstrap React App
28+
run: npx create-react-app test-app --template file:./
29+
30+
- name: Run linters
31+
working-directory: ./test-app
32+
run: npm run codebase:lint
33+
34+
- name: Run unit tests
35+
working-directory: ./test-app
36+
run: npm run test
37+
38+
- name: Run integration tests
39+
working-directory: ./test-app
40+
run: npm run cypress

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
# dependencies
2+
/node_modules
3+
4+
# misc
15
.idea/
6+
.DS_Store

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ To use this template, add `--template nimble` when creating a new app from the `
2929

3030
```sh
3131
npx create-react-app my-app --template nimble
32-
33-
# or
34-
35-
yarn create react-app my-app --template nimble
3632
```
3733

3834
For more information about `create-react-app`, please refer to:
@@ -67,10 +63,6 @@ To test the template locally, simply run the template install command with the p
6763

6864
```sh
6965
npx create-react-app my-app --template file:{../path/to/your/local/template/repo}
70-
71-
# or
72-
73-
yarn create react-app my-app --template file:{../path/to/your/local/template/repo}
7466
```
7567

7668
## License

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cra-template-nimble",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"keywords": [
55
"react",
66
"create-react-app",

template.json

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,68 @@
22
"package": {
33
"dependencies": {
44
"@cypress/code-coverage": "3.9.12",
5-
"@nimblehq/eslint-config-nimble": "2.2.1",
5+
"@nimblehq/eslint-config-nimble-react": "^1.0.0",
6+
"@nimblehq/stylelint-config-nimble": "^1.0.0",
67
"@testing-library/cypress": "8.0.2",
7-
"@testing-library/jest-dom": "5.11.4",
8-
"@testing-library/react": "12.1.4",
9-
"@testing-library/user-event": "13.5.0",
8+
"@testing-library/jest-dom": "5.16.4",
9+
"@testing-library/react": "13.1.1",
10+
"@testing-library/user-event": "14.1.1",
1011
"@types/jest": "27.4.1",
1112
"@types/node": "17.0.21",
1213
"@types/react": "17.0.40",
1314
"@types/react-dom": "17.0.13",
14-
"@typescript-eslint/eslint-plugin": "5.15.0",
15-
"@typescript-eslint/parser": "5.15.0",
1615
"axios": "0.21.1",
1716
"cypress": "9.5.2",
1817
"cypress-react-selector": "2.3.16",
1918
"eslint": "8.11.0",
20-
"eslint-config-prettier": "8.5.0",
21-
"eslint-import-resolver-typescript": "2.5.0",
22-
"eslint-plugin-cypress": "2.12.1",
23-
"eslint-plugin-import": "2.25.4",
24-
"eslint-plugin-jest": "26.1.1",
25-
"eslint-plugin-jsx-a11y": "6.5.1",
26-
"eslint-plugin-prettier": "4.0.0",
27-
"eslint-plugin-react": "7.29.4",
28-
"eslint-plugin-react-hooks": "4.3.0",
2919
"i18next": "21.6.14",
3020
"i18next-browser-languagedetector": "6.1.3",
3121
"i18next-http-backend": "1.4.0",
32-
"node-sass": "7.0.1",
3322
"prettier": "2.6.0",
3423
"react-i18next": "11.16.1",
24+
"react-router-dom": "6.3.0",
25+
"sass": "1.49.11",
3526
"stylelint": "14.6.0",
36-
"stylelint-config-property-sort-order-smacss": "9.0.0",
37-
"stylelint-config-sass-guidelines": "9.0.1",
38-
"stylelint-order": "5.0.0",
39-
"stylelint-scss": "4.2.0",
4027
"typescript": "4.6.2",
4128
"web-vitals": "2.1.4"
4229
},
4330
"scripts": {
4431
"start": "react-scripts -r @cypress/instrument-cra start",
45-
"test:coverage": "react-scripts test --coverage --watchAll=false && yarn cypress:run && node ./scripts/coverage-merge.js && nyc report",
32+
"test:coverage": "react-scripts test --coverage --watchAll=false && npm run cypress:run && node ./scripts/coverage-merge.js && nyc report",
33+
"test:merge-coverage": "node ./scripts/coverage-merge.js",
4634
"lint": "eslint ./src ./cypress --ext .ts,.tsx",
4735
"lint:fix": "eslint ./src ./cypress --ext .ts,.tsx --fix",
4836
"stylelint": "stylelint '**/*.scss'",
4937
"stylelint:fix": "stylelint '**/*.scss' --fix",
50-
"codebase:lint": "yarn lint && yarn stylelint",
51-
"codebase:fix": "yarn lint:fix && yarn stylelint:fix",
38+
"codebase:lint": "npm run lint && npm run stylelint",
39+
"codebase:fix": "npm run lint:fix && npm run stylelint:fix",
40+
"cypress": "start-server-and-test start 3000 cypress:run",
5241
"cypress:run": "cypress run",
5342
"cypress:open": "cypress open"
5443
},
5544
"jest": {
56-
"collectCoverageFrom": ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
57-
"coverageReporters": ["json"]
45+
"collectCoverageFrom": [
46+
"src/**/*.{js,jsx,ts,tsx}",
47+
"!src/**/*.d.ts"
48+
],
49+
"coverageReporters": [
50+
"json"
51+
]
5852
},
5953
"nyc": {
6054
"report-dir": "coverage/cypress",
61-
"exclude": ["src/reportWebVitals.ts"],
55+
"exclude": [
56+
"src/reportWebVitals.ts"
57+
],
6258
"excludeAfterRemap": true
6359
},
6460
"devDependencies": {
65-
"@cypress/instrument-cra": "1.4.0"
61+
"@cypress/instrument-cra": "1.4.0",
62+
"danger": "10.9.0",
63+
"danger-plugin-code-coverage": "1.1.9",
64+
"danger-plugin-istanbul-coverage": "1.6.2",
65+
"danger-plugin-jest-codecov": "0.0.8",
66+
"start-server-and-test": "1.14.0"
6667
}
6768
}
6869
}

template/.eslintrc.js

Lines changed: 2 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,3 @@
11
module.exports = {
2-
env: {
3-
es6: true,
4-
browser: true,
5-
node: true,
6-
jest: true,
7-
},
8-
extends: [
9-
'@nimblehq/eslint-config-nimble',
10-
'plugin:react/recommended',
11-
'plugin:react-hooks/recommended',
12-
'plugin:@typescript-eslint/recommended',
13-
'plugin:jsx-a11y/recommended',
14-
'plugin:import/errors',
15-
'plugin:prettier/recommended',
16-
],
17-
overrides: [
18-
{
19-
files: 'src/tests/**/*.test.ts',
20-
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
21-
},
22-
{
23-
files: 'cypress/**/*.ts',
24-
extends: ['plugin:cypress/recommended'],
25-
},
26-
],
27-
parser: '@typescript-eslint/parser',
28-
parserOptions: {
29-
ecmaVersion: 6,
30-
sourceType: 'module',
31-
ecmaFeatures: {
32-
jsx: true,
33-
},
34-
},
35-
rules: {
36-
'react-hooks/rules-of-hooks': 'error',
37-
'react-hooks/exhaustive-deps': 'warn',
38-
'react/jsx-filename-extension': [2, { extensions: ['.tsx'] }],
39-
'import/order': [
40-
'error',
41-
{
42-
groups: ['builtin', 'external', 'internal'],
43-
pathGroups: [
44-
{
45-
pattern: 'react*',
46-
group: 'external',
47-
position: 'before',
48-
},
49-
{
50-
pattern: 'css/*|*.scss|*.svg|.png',
51-
group: 'internal',
52-
position: 'after',
53-
},
54-
],
55-
pathGroupsExcludedImportTypes: ['react'],
56-
'newlines-between': 'always',
57-
alphabetize: {
58-
order: 'asc',
59-
caseInsensitive: true,
60-
},
61-
},
62-
],
63-
'import/extensions': [
64-
'error',
65-
'never',
66-
{
67-
scss: 'always',
68-
svg: 'always',
69-
png: 'always',
70-
json: 'always',
71-
spec: 'always',
72-
},
73-
],
74-
'no-use-before-define': 'off',
75-
'no-unused-vars': 'off',
76-
'no-shadow': 'off',
77-
'@typescript-eslint/no-shadow': 'error',
78-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
79-
'@typescript-eslint/no-use-before-define': ['error'],
80-
'prettier/prettier': ['error'],
81-
},
82-
settings: {
83-
react: {
84-
version: 'detect',
85-
},
86-
'import/resolver': {
87-
typescript: {},
88-
node: {
89-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
90-
moduleDirectory: ['node_modules', 'src/'],
91-
},
92-
},
93-
},
94-
}
2+
extends: ['@nimblehq/eslint-config-nimble-react'],
3+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to Netlify
2+
3+
on:
4+
push:
5+
branches: ['main', 'master']
6+
workflow_dispatch:
7+
inputs:
8+
deploy-msg:
9+
description: 'Deploy Message (visible in Netlify)'
10+
required: true
11+
12+
jobs:
13+
deploy:
14+
name: Build and Deploy to Netlify
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- name: Cancel Previous Runs
18+
uses: styfle/[email protected]
19+
with:
20+
access_token: ${{ github.token }}
21+
22+
- uses: actions/checkout@v2
23+
24+
- name: Install modules
25+
run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Deploy to Netlify
31+
uses: nwtgck/[email protected]
32+
with:
33+
publish-dir: './build'
34+
deploy-message: "Deploy from GitHub Actions: ${{ github.event.inputs.deploy-msg }}"
35+
production-deploy: true
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
env:
38+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
39+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
40+
timeout-minutes: 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy Preview to Netlify
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
jobs:
6+
deploy-preview:
7+
name: Build and Deploy preview on Netlify
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- name: Cancel Previous Runs
11+
uses: styfle/[email protected]
12+
with:
13+
access_token: ${{ github.token }}
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Install modules
18+
run: npm ci
19+
20+
- name: Build
21+
run: npm run build
22+
23+
- name: Deploy to Netlify
24+
uses: nwtgck/[email protected]
25+
with:
26+
publish-dir: './build'
27+
deploy-message: '#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}'
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
env:
30+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
31+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
32+
timeout-minutes: 1

0 commit comments

Comments
 (0)