Skip to content

Commit 59e20be

Browse files
authored
Merge pull request #2 from graasp/1/initAndSetup
1/init and setup
2 parents 7f6c67d + c54b185 commit 59e20be

File tree

28 files changed

+6064
-310
lines changed

28 files changed

+6064
-310
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
public
3+
coverage
4+
src/registerServiceWorker.js
5+
cypress/integration/examples

.eslintrc.json renamed to .eslintrc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
"es2021": true
55
},
66
"extends": [
7-
"plugin:react/recommended",
87
"airbnb",
98
"plugin:@typescript-eslint/recommended",
10-
"prettier"
9+
"prettier",
10+
"plugin:react/recommended",
11+
"plugin:cypress/recommended"
1112
],
13+
"globals": {
14+
"cy": true,
15+
"Cypress": true
16+
},
1217
"parser": "@typescript-eslint/parser",
1318
"parserOptions": {
1419
"ecmaFeatures": {
@@ -19,6 +24,9 @@
1924
},
2025
"plugins": ["react", "react-hooks", "@typescript-eslint", "prettier"],
2126
"rules": {
27+
"import/no-import-module-exports": "off",
28+
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
29+
"import/prefer-default-export": "off",
2230
"prettier/prettier": "error",
2331
"import/extensions": [
2432
"error",
@@ -34,6 +42,8 @@
3442
"allowExpressions": true
3543
}
3644
],
45+
"@typescript-eslint/no-var-requires": "off",
46+
"global-require": "off",
3747
"react-hooks/rules-of-hooks": "error",
3848
"react-hooks/exhaustive-deps": "warn",
3949
"comma-dangle": "off",

.github/workflows/cypress.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: cypress tests
2+
on: [push]
3+
jobs:
4+
cypress-run:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: checkout
8+
uses: actions/checkout@v2
9+
10+
- name: set up node
11+
uses: actions/setup-node@v2
12+
with:
13+
node-version: '16'
14+
cache: 'yarn'
15+
16+
- name: install yarn
17+
# avoid checksum errors with github packages
18+
run: YARN_CHECKSUM_BEHAVIOR=update yarn
19+
20+
- name: cypress run
21+
uses: cypress-io/github-action@v2
22+
env:
23+
REACT_APP_API_HOST: http://localhost:3636
24+
REACT_APP_GRAASP_DOMAIN: localhost
25+
REACT_APP_GRAASP_APP_ID: id-1234567890
26+
REACT_APP_MOCK_API: true
27+
NODE_ENV: test
28+
with:
29+
install: false
30+
config: baseUrl=http://localhost:3000
31+
start: yarn start:ci
32+
wait-on: 'http://localhost:3000'
33+
wait-on-timeout: 180
34+
browser: chrome
35+
headless: true
36+
quiet: true
37+
38+
# after the test run completes
39+
# store videos and any screenshots
40+
# NOTE: screenshots will be generated only if E2E test failed
41+
# thus we store screenshots only on failures
42+
# Alternative: create and commit an empty cypress/screenshots folder
43+
# to always have something to upload
44+
- uses: actions/upload-artifact@v2
45+
if: failure()
46+
with:
47+
name: cypress-screenshots
48+
path: cypress/screenshots
49+
# Test run video was always captured, so this action uses "always()" condition
50+
- uses: actions/upload-artifact@v2
51+
if: always()
52+
with:
53+
name: cypress-videos
54+
path: cypress/videos
55+
56+
- name: coverage report
57+
run: npx nyc report --reporter=text-summary

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# testing
99
/coverage
10+
/.nyc_output
1011

1112
# production
1213
/build
@@ -16,11 +17,27 @@
1617
.env.local
1718
.env.development.local
1819
.env.test.local
20+
.env.test
21+
.env.prod
1922
.env.production.local
2023

2124
npm-debug.log*
2225
yarn-debug.log*
2326
yarn-error.log*
2427

28+
# yarn
29+
.yarn/
30+
!.yarn/patches
31+
!.yarn/plugins
32+
!.yarn/releases
33+
!.yarn/sdks
34+
!.yarn/versions
35+
yarn-error.log
36+
2537
# editor files
2638
/.idea
39+
40+
# cypress
41+
cypress/screenshots/
42+
cypress/videos/
43+
cypress/downloads/

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn commitlint --edit $1
4+
yarn commitlint --edit ${1}

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn pretty-quick --staged && yarn lint && yarn test:once
4+
yarn pretty-quick --staged && yarn lint && yarn test

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint && yarn test:once && yarn build
4+
yarn lint && yarn build && yarn test

.prettierrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"semi": true,
32
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
45
"singleQuote": true,
56
"jsxSingleQuote": false,
6-
"printWidth": 80
7+
"importOrder": ["^react", "^@?graasp*", "^@?mui*", "^@.*", "^[./]"],
8+
"importOrderSeparation": true,
9+
"importOrderSortSpecifiers": true
710
}

.versionrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"types": [
3+
{
4+
"type": "feat",
5+
"section": "Features"
6+
},
7+
{
8+
"type": "fix",
9+
"section": "Bug Fixes"
10+
},
11+
{
12+
"type": "test",
13+
"section": "Tests"
14+
},
15+
{
16+
"type": "build",
17+
"section": "Build System"
18+
},
19+
{
20+
"type": "docs",
21+
"section": "Documentation"
22+
},
23+
{
24+
"type": "ci",
25+
"section": "Continuous Integration"
26+
},
27+
{
28+
"type": "chore",
29+
"section": "Chores",
30+
"hidden": true
31+
}
32+
]
33+
}

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 546 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)