Skip to content

Commit f22f596

Browse files
SKairinoscfl-bot
andauthored
BREAKING CHANGE: use new dev env (#42)
* configure submodule * configure submodule * Simplify the pipeline * configure * add scripts * ignore md files * format * fix type errors * ignore scripts * fix inline type imports * fix: types * fix: add general models * push build files * fix: update types * push build files * add various fixes * push build files * fix: check extra fields * push build files * fix: remove school teacher invitation * delete lib files * delete lib folder * clean up, formatting, type helpers * fixed formatting * fix: linting errors * fix: makeStore helper * fix: test helpers * fix: test * include dependency types * use correct env var * rename helpers to utils * imports: rename helpers to utils * add node types as dependency * fix: type deps * fix: reusable deps * fix: include git ignore --------- Co-authored-by: cfl-bot <[email protected]>
1 parent 5490e02 commit f22f596

File tree

427 files changed

+9694
-20953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+9694
-20953
lines changed

.devcontainer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"davidanson.vscode-markdownlint",
99
"bierner.markdown-mermaid",
1010
"streetsidesoftware.code-spell-checker",
11-
"dbaeumer.vscode-eslint"
11+
"dbaeumer.vscode-eslint",
12+
"tamasfe.even-better-toml",
13+
"github.vscode-github-actions",
14+
"codecov.codecov",
15+
"ritwickdey.liveserver",
16+
"esbenp.prettier-vscode"
1217
]
1318
}
1419
},

.eslintrc.json

+47-22
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,61 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es2021": true
5-
},
62
"extends": [
7-
"plugin:react/recommended",
8-
"standard-with-typescript"
3+
"eslint:recommended",
4+
"react-app",
5+
"plugin:react/jsx-runtime",
6+
"prettier"
97
],
10-
"overrides": [],
8+
"parser": "@typescript-eslint/parser",
119
"parserOptions": {
12-
"ecmaVersion": "latest",
13-
"sourceType": "module",
14-
"project": "tsconfig.json"
10+
"project": true,
11+
"tsconfigRootDir": "./"
1512
},
1613
"plugins": [
17-
"react"
14+
"@typescript-eslint"
1815
],
16+
"root": true,
1917
"ignorePatterns": [
20-
"lib",
18+
"dist",
2119
"src/scripts"
2220
],
2321
"rules": {
24-
"@typescript-eslint/semi": [
22+
"@typescript-eslint/consistent-type-imports": [
2523
2,
26-
"always"
24+
{
25+
"fixStyle": "inline-type-imports"
26+
}
2727
],
28-
"@typescript-eslint/member-delimiter-style": "off",
29-
"@typescript-eslint/space-before-function-paren": "off",
30-
"@typescript-eslint/no-invalid-void-type": "off",
31-
"@typescript-eslint/consistent-type-imports": "off",
32-
"@typescript-eslint/strict-boolean-expressions": "off",
33-
"@typescript-eslint/dot-notation": "off",
34-
"@typescript-eslint/indent": "off"
35-
}
28+
"@typescript-eslint/no-restricted-imports": [
29+
2,
30+
{
31+
"paths": [
32+
{
33+
"name": "react-redux",
34+
"importNames": [
35+
"useSelector",
36+
"useStore",
37+
"useDispatch"
38+
],
39+
"message": "Please use pre-typed versions from `src/app/hooks.ts` instead."
40+
}
41+
]
42+
}
43+
]
44+
},
45+
"overrides": [
46+
{
47+
"files": [
48+
"*.{c,m,}{t,j}s",
49+
"*.{t,j}sx"
50+
]
51+
},
52+
{
53+
"files": [
54+
"*{test,spec}.{t,j}s?(x)"
55+
],
56+
"env": {
57+
"jest": true
58+
}
59+
}
60+
]
3661
}

.github/workflows/main.yml

+25-72
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,50 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3-
41
name: Main
52

63
on:
74
push:
85
paths-ignore:
9-
- "lib/**" # TODO: remove lib folder
10-
- "**/*.md"
11-
- "**/.*"
6+
- '**/*.md'
7+
- '**/*.code-*'
8+
- '.vscode/**'
9+
- '.devcontainer.json'
1210
workflow_dispatch:
1311

1412
jobs:
1513
test:
16-
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
node: [19.7]
20-
steps:
21-
- uses: actions/checkout@v3
22-
23-
- name: Set up Node ${{ matrix.node }}
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version: ${{ matrix.node }}
27-
28-
# TODO: cache node packages
29-
- name: Install Node Packages
30-
run: npm install
31-
32-
- name: Check Code Format
33-
run: npm run lint
34-
35-
# TODO: https://www.pluralsight.com/guides/how-to-test-react-components-in-typescript
36-
# - name: Test Code
37-
# run: npm run test -- --watchAll=false
38-
39-
# TODO: remove this job
40-
build:
41-
needs: [test]
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v3
45-
with:
46-
token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
47-
48-
- uses: actions/setup-node@v3
49-
with:
50-
node-version: 19.7
51-
52-
- name: Setup Git
53-
run: |
54-
git config --local user.name cfl-bot
55-
git config --local user.email [email protected]
56-
57-
# TODO: cache node packages
58-
- name: Install Node Packages
59-
run: npm install --only=dev
60-
61-
- name: Build Package
62-
run: npm run build
63-
64-
- name: Push Build Files
65-
run: |
66-
git add lib/*
67-
if ! git diff --staged --quiet; then
68-
git commit -m "push build files"
69-
git push
70-
fi
14+
uses: ocadotechnology/codeforlife-workspace/.github/workflows/test-javascript-code.yaml@main
15+
secrets: inherit
16+
with:
17+
# Cannot be set with an env var. Value must match in the release job.
18+
node-version: 18
7119

7220
release:
73-
needs: [build]
7421
concurrency: release
7522
runs-on: ubuntu-latest
23+
needs: [test]
7624
if: github.ref_name == 'main'
25+
env:
26+
# Value must match in the test job.
27+
NODE_VERSION: 18
7728
steps:
78-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
7930
with:
8031
token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
8132
fetch-depth: 0
8233

83-
- name: Pull Build Files
84-
run: git pull
85-
86-
- uses: actions/setup-node@v3
34+
- name: 🌐 Set up Node ${{ env.NODE_VERSION }}
35+
uses: actions/setup-node@v4
8736
with:
88-
node-version: 19.7
37+
node-version: ${{ env.NODE_VERSION }}
8938

90-
# TODO: group release dependencies
91-
- name: Install Node Packages
92-
run: npm install --only=dev
39+
- name: 🛠 Install Dependencies
40+
run: |
41+
npm install --global npm
42+
npm install --global \
43+
semantic-release@^20.1.1 \
44+
@semantic-release/git@^10.0.1 \
45+
@semantic-release/changelog@^6.0.2
9346
94-
- name: Publish Semantic Release
47+
- name: 🚀 Publish Semantic Release
9548
env:
9649
GH_TOKEN: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
9750
GIT_AUTHOR_NAME: cfl-bot

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/*.json
2+
**/*.yaml
3+
**/*.yml
4+
**/*.code-*
5+
**/*.md

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "avoid"
4+
}

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
"editor.codeActionsOnSave": {
1313
"source.organizeImports": "explicit"
1414
},
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
1516
"editor.formatOnSave": true,
1617
"editor.rulers": [
1718
80
1819
],
1920
"editor.tabSize": 2,
20-
"typescript.preferences.quoteStyle": "single"
21+
"javascript.format.semicolons": "remove",
22+
"javascript.preferences.quoteStyle": "double",
23+
"prettier.configPath": ".prettierrc.json",
24+
"typescript.format.semicolons": "remove",
25+
"typescript.preferences.quoteStyle": "double"
2126
}

codecov.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage: # https://docs.codecov.com/docs/codecov-yaml
2+
precision: 2
3+
round: down
4+
range: 90...90
5+
status: # https://docs.codecov.com/docs/commit-status
6+
project:
7+
default:
8+
target: 90%
9+
threshold: 0%
10+
11+
comment: false

lib/cjs/api/baseQuery.d.ts

-11
This file was deleted.

0 commit comments

Comments
 (0)