Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: use new dev env #42

Merged
merged 38 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e6a4576
configure submodule
SKairinos May 29, 2024
e1f9c35
configure submodule
SKairinos May 29, 2024
f1a831d
Simplify the pipeline
SKairinos May 30, 2024
16d8b6b
configure
SKairinos May 30, 2024
7170d31
add scripts
SKairinos May 30, 2024
cdbdc53
ignore md files
SKairinos May 30, 2024
1b12cb5
format
SKairinos May 30, 2024
4b05e15
fix type errors
SKairinos May 30, 2024
ffff7e4
ignore scripts
SKairinos May 31, 2024
16856e6
fix inline type imports
SKairinos May 31, 2024
8446e3a
fix: types
SKairinos May 31, 2024
01be84f
fix: add general models
SKairinos May 31, 2024
6be43ac
push build files
cfl-bot May 31, 2024
d57831c
fix: update types
SKairinos May 31, 2024
dfe31b5
push build files
cfl-bot May 31, 2024
bc54aa7
add various fixes
SKairinos Jun 3, 2024
8d1b376
push build files
cfl-bot Jun 3, 2024
c706ac1
fix: check extra fields
SKairinos Jun 3, 2024
fcecd92
push build files
cfl-bot Jun 3, 2024
e37decf
fix: remove school teacher invitation
SKairinos Jun 3, 2024
8826fc5
merge from fix api helpers
SKairinos Jun 3, 2024
d593a4d
delete lib files
SKairinos Jun 3, 2024
ec11d94
merge from main
SKairinos Jun 4, 2024
81bd30b
delete lib folder
SKairinos Jun 4, 2024
e6f7039
clean up, formatting, type helpers
SKairinos Jun 4, 2024
728f4fa
fixed formatting
SKairinos Jun 4, 2024
4a1e934
fix: linting errors
SKairinos Jun 5, 2024
7262eea
fix: makeStore helper
SKairinos Jun 6, 2024
eab4e39
fix: test helpers
SKairinos Jun 6, 2024
f32903d
fix: test
SKairinos Jun 6, 2024
0726473
include dependency types
SKairinos Jun 6, 2024
e42fd6b
use correct env var
SKairinos Jun 6, 2024
b2ab47c
rename helpers to utils
SKairinos Jun 6, 2024
753ea09
imports: rename helpers to utils
SKairinos Jun 6, 2024
1b9c284
add node types as dependency
SKairinos Jun 6, 2024
ec24420
fix: type deps
SKairinos Jun 6, 2024
b3f7e43
fix: reusable deps
SKairinos Jun 6, 2024
23e7094
fix: include git ignore
SKairinos Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
"davidanson.vscode-markdownlint",
"bierner.markdown-mermaid",
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"tamasfe.even-better-toml",
"github.vscode-github-actions",
"codecov.codecov",
"ritwickdey.liveserver",
"esbenp.prettier-vscode"
]
}
},
Expand Down
69 changes: 47 additions & 22 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,61 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"standard-with-typescript"
"eslint:recommended",
"react-app",
"plugin:react/jsx-runtime",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "tsconfig.json"
"project": true,
"tsconfigRootDir": "./"
},
"plugins": [
"react"
"@typescript-eslint"
],
"root": true,
"ignorePatterns": [
"lib",
"dist",
"src/scripts"
],
"rules": {
"@typescript-eslint/semi": [
"@typescript-eslint/consistent-type-imports": [
2,
"always"
{
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/indent": "off"
}
"@typescript-eslint/no-restricted-imports": [
2,
{
"paths": [
{
"name": "react-redux",
"importNames": [
"useSelector",
"useStore",
"useDispatch"
],
"message": "Please use pre-typed versions from `src/app/hooks.ts` instead."
}
]
}
]
},
"overrides": [
{
"files": [
"*.{c,m,}{t,j}s",
"*.{t,j}sx"
]
},
{
"files": [
"*{test,spec}.{t,j}s?(x)"
],
"env": {
"jest": true
}
}
]
}
97 changes: 25 additions & 72 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,50 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Main

on:
push:
paths-ignore:
- "lib/**" # TODO: remove lib folder
- "**/*.md"
- "**/.*"
- '**/*.md'
- '**/*.code-*'
- '.vscode/**'
- '.devcontainer.json'
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [19.7]
steps:
- uses: actions/checkout@v3

- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

# TODO: cache node packages
- name: Install Node Packages
run: npm install

- name: Check Code Format
run: npm run lint

# TODO: https://www.pluralsight.com/guides/how-to-test-react-components-in-typescript
# - name: Test Code
# run: npm run test -- --watchAll=false

# TODO: remove this job
build:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: 19.7

- name: Setup Git
run: |
git config --local user.name cfl-bot
git config --local user.email [email protected]

# TODO: cache node packages
- name: Install Node Packages
run: npm install --only=dev

- name: Build Package
run: npm run build

- name: Push Build Files
run: |
git add lib/*
if ! git diff --staged --quiet; then
git commit -m "push build files"
git push
fi
uses: ocadotechnology/codeforlife-workspace/.github/workflows/test-javascript-code.yaml@main
secrets: inherit
with:
# Cannot be set with an env var. Value must match in the release job.
node-version: 18

release:
needs: [build]
concurrency: release
runs-on: ubuntu-latest
needs: [test]
if: github.ref_name == 'main'
env:
# Value must match in the test job.
NODE_VERSION: 18
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
fetch-depth: 0

- name: Pull Build Files
run: git pull

- uses: actions/setup-node@v3
- name: 🌐 Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 19.7
node-version: ${{ env.NODE_VERSION }}

# TODO: group release dependencies
- name: Install Node Packages
run: npm install --only=dev
- name: 🛠 Install Dependencies
run: |
npm install --global npm
npm install --global \
semantic-release@^20.1.1 \
@semantic-release/git@^10.0.1 \
@semantic-release/changelog@^6.0.2

- name: Publish Semantic Release
- name: 🚀 Publish Semantic Release
env:
GH_TOKEN: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: cfl-bot
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/*.json
**/*.yaml
**/*.yml
**/*.code-*
**/*.md
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"arrowParens": "avoid"
}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.rulers": [
80
],
"editor.tabSize": 2,
"typescript.preferences.quoteStyle": "single"
"javascript.format.semicolons": "remove",
"javascript.preferences.quoteStyle": "double",
"prettier.configPath": ".prettierrc.json",
"typescript.format.semicolons": "remove",
"typescript.preferences.quoteStyle": "double"
}
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage: # https://docs.codecov.com/docs/codecov-yaml
precision: 2
round: down
range: 90...90
status: # https://docs.codecov.com/docs/commit-status
project:
default:
target: 90%
threshold: 0%

comment: false
11 changes: 0 additions & 11 deletions lib/cjs/api/baseQuery.d.ts

This file was deleted.

Loading