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

Upgrade to support new Typescript, vite, Vitest and NX tooling #83

Merged
merged 44 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d57c2dc
feat: scripts is dead, long live scripts! WIP!
SimeonC Aug 23, 2022
64f6f38
refactor: get the ts to js build working nicely
SimeonC Feb 16, 2023
4f2c508
feat: major upgrade
SimeonC Apr 14, 2023
791f054
chore: deps upgrade
SimeonC Apr 17, 2023
66e739f
feat: move everything except quality
SimeonC May 26, 2023
a07191e
feat: add shortest import eslint rule
SimeonC May 30, 2023
f5c4b8a
feat: build runs and quality packages function
SimeonC Jun 16, 2023
209e365
feat: add stylelint
SimeonC Jun 16, 2023
546683a
feat: remove stylelint and fix lint/ts issues
SimeonC Jun 27, 2023
9745dcd
feat: full build and passing lint via nx!!
SimeonC Jun 30, 2023
a93405c
fix: pre-commit scripts and apply formatting
SimeonC Jun 30, 2023
fc22895
fix: import esm/cjs bugs
SimeonC Jun 30, 2023
836bda7
fix: audit works and passes
SimeonC Jun 30, 2023
ba1a36b
fix: install from public npm and remove dist files
SimeonC Jun 30, 2023
2623856
ci: fix github actions to have main branch for nx
SimeonC Jun 30, 2023
ce45868
fix: tests and github_actions
SimeonC Jun 30, 2023
fc30be8
ci: skip husky in release actions install
SimeonC Jun 30, 2023
29a82db
feat: add prettier config file and bump prettier version
SimeonC Jul 7, 2023
bf6d470
ci: fix github release action
SimeonC Jul 7, 2023
ce28073
fix: add nx meta files to bundle for detection
SimeonC Jul 19, 2023
5ba2a67
fix: migrate script updates and remove dead packages
SimeonC Jul 20, 2023
8c9b792
fix: bump package versions in deps
SimeonC Jul 20, 2023
c959ccd
fix: nx requires commonjs or weird node memory errors occur
SimeonC Jul 21, 2023
8bcc020
fix: esm/cjs interop fixes
SimeonC Jul 21, 2023
91fce63
fix: remove audit project and correct paths for nx schemas
SimeonC Jul 21, 2023
649159a
fix: downgrade prettier to v2
SimeonC Jul 21, 2023
0cae89b
fix: nx quality scripts and prettier fixes
SimeonC Jul 21, 2023
4575a55
fix: quality generator and migration include file-types
SimeonC Jul 25, 2023
7413255
fix: add forcePublish to npm publish to bump all packages in next
SimeonC Jul 25, 2023
1eed4c2
ci: switch next to canary releases due to lerna issue
SimeonC Jul 25, 2023
3b7185f
ci: revert switch next to canary releases due to lerna issue
SimeonC Jul 25, 2023
3ba0eec
fix: bump packages and deps
SimeonC Jul 25, 2023
c2932a6
fix(nx): quality script should run correctly
SimeonC Jul 25, 2023
3bcfbf1
fix: quality generator bugfixes
SimeonC Jul 25, 2023
c58e32c
feat: upgrade eslint dependencies
SimeonC Jul 26, 2023
2aa346e
fix: assorted bugfixes and rule tweaks
SimeonC Jul 27, 2023
6a61092
feat: bump prettier and add lib publishing checks
SimeonC Jul 28, 2023
0cfaf66
fix(nx): quality executor should run prettier from root cwd to correc…
SimeonC Jul 28, 2023
228fea3
feat(commitlint-config): add junit formatter
SimeonC Jul 28, 2023
5455ac6
fix(commitlint-config): use correct junit format via package
SimeonC Jul 28, 2023
bf59976
feat: remove library build (use nx rollup) fixes for monorepo
SimeonC Aug 4, 2023
48bceb7
fix: prettier works with v2/v3 though v3 is preferred
SimeonC Aug 23, 2023
ae246d9
fix: remove start-case restriction in scope-case
SimeonC Sep 27, 2023
d59f1a5
fix: quality generator fixes and cleanups
SimeonC Sep 28, 2023
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
  •  
  •  
  •  
15 changes: 0 additions & 15 deletions [email protected]

This file was deleted.

2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName": "@tablecheck/tablecheck-react-system",
"projectName": "@tablecheck/frontend",
"projectOwner": "tablecheck",
"repoType": "github",
"repoHost": "https://github.com",
Expand Down
27 changes: 0 additions & 27 deletions .autorc

This file was deleted.

42 changes: 17 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
// this project is NOT typescript compatible - make sure this matches the eslint-config setup
// basically nothing this requires actually has types or they make no sense
// this is the only project that should not be in typescript.
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
extends: [
'airbnb',
'plugin:eslint-comments/recommended',
'plugin:jest/recommended',
'prettier'
],
plugins: ['eslint-comments', 'jest', 'promise'],
extends: ['./packages/eslint-config'],
env: {
node: true,
jest: true
},

settings: {
jest: {
version: 26
}
parserOptions: {
project: './tsconfig.base.json',
},
overrides: [
require('@tablecheck/eslint-config/overrides/tests'),
{
files: ['./packages/codemods/scripts/*.js'],
rules: {
'no-case-declarations': 'off',
'default-case': 'off'
}
}
'default-case': 'off',
},
},
{
files: '*.json',
parser: 'jsonc-eslint-parser',
rules: {},
},
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true
}
devDependencies: true,
},
],
'import/no-dynamic-require': 'off',
'global-require': 'off',
Expand All @@ -45,7 +39,5 @@ module.exports = {
'promise/always-return': 'off',
'promise/avoid-new': 'off',
'no-underscore-dangle': 'off',
// use immer.produce for safety
'no-param-reassign': 'off'
}
},
};
40 changes: 40 additions & 0 deletions .github/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Setup git and nx
description: Set up git and nx for the job

runs:
using: 'composite'
steps:
- name: Prepare repository
shell: bash
run: git fetch --unshallow --prune --tags

- name: Set shas
uses: nrwl/nx-set-shas@v3

- name: Unset header
shell: bash
# checkout@v2 adds a header that makes branch protection report errors ):
run: git config --local --unset http.https://github.com/.extraheader

- name: Read .nvmrc
shell: bash
id: nvm
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.nvmrc }}
cache: npm

- name: Setup branch for NX
shell: bash
run: git branch --track main origin/main

- name: Install without scripts 🔧
shell: bash
run: npm ci --prefer-offline --silent --ignore-scripts

- name: Build 🔨
shell: bash
run: npm run build
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:

- name: Install and Build 🔧
run: |
npm ci
git branch --track main origin/main
npm ci --prefer-offline --silent
npm run build

- name: Deploy 🚀
Expand Down
67 changes: 7 additions & 60 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,27 @@ concurrency:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
nvmrc: ${{ steps.nvm.outputs.nvmrc }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=nvmrc::$(cat .nvmrc)
- uses: ./.github/setup

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.nvmrc }}

- name: Install 🔧
run: npm ci

lint:
checks:
needs: [setup]
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ needs.setup.outputs.nvmrc }}

- name: Restore npm installs and Lerna setup
run: npm ci
- uses: ./.github/setup

- name: Validate all commits from PR
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

- name: Run linter
run: npm run lint

audit:
needs: [setup]
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ needs.setup.outputs.nvmrc }}

- name: Restore npm installs and Lerna setup
run: npm ci

- name: Audit Dependencies
run: npm run audit:ci
env:
Expand All @@ -81,13 +46,7 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ needs.setup.outputs.nvmrc }}

- name: Restore npm installs and Lerna setup
run: npm ci
- uses: ./.github/setup

- name: Run Tests
run: npm test
Expand All @@ -100,25 +59,13 @@ jobs:

release:
runs-on: ubuntu-latest
needs: [test, audit, lint]
needs: [test, checks]
if: github.head_ref != 'next'
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=nvmrc::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.nvmrc }}

- name: Install 🔧
run: npm ci
- uses: ./.github/setup

- name: Create Canary Release ✨
env:
Expand Down
22 changes: 4 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- next

jobs:
release:
Expand All @@ -13,25 +14,10 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Prepare repository
run: git fetch --unshallow --prune --tags
- uses: ./.github/setup

- name: Unset header
# checkout@v2 adds a header that makes branch protection report errors ):
run: git config --local --unset http.https://github.com/.extraheader

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=nvmrc::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.nvmrc }}
cache: npm

- name: Install 🔧
run: npm ci
- name: Build
run: npm run build

- name: Run Tests
run: npm test
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ cache
public/static
docs
lib
dist
config/local.*
config/local-*
tsconfig.json
tsconfig.*.json
*.tsbuildinfo
storybook-static
junit
Expand All @@ -23,3 +22,8 @@ junit
.env.test.local
.env.production.local
.@tablecheck
tsconfig.compound.json
/packages/quality/build.config.ts
/packages/utils/build.config.ts
/tsconfig.eslint.json
/packages/utils/config
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run precommit
# revert this back to using nx format:check when https://github.com/nrwl/nx/issues/17990 is fixed
# echo "Running nx format:check - any files output below are formatted incorrectly"
# echo "To fix formatting, run: \`npx nx format:write\` or configure prettier in your IDE"
# npx nx format:check

echo "Running 'prettier --check .' - any files output below are formatted incorrectly"
echo "To fix formatting, run: \`npx prettier --write .\` or configure prettier in your IDE"
npx prettier -v
npx prettier --check .
8 changes: 0 additions & 8 deletions .npm-upgrade.json

This file was deleted.

3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
legacy-peer-deps=true
legacy-peer-deps=true
save-exact=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.15.0
v18.16.0
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package-lock.json
.npm-upgrade.json
.eslintignore
lerna-debug.log
coverage
build
lib
dist
.DS_Store
.gitignore
.nvmrc
Expand Down
6 changes: 1 addition & 5 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"singleQuote": true,
"arrowParens": "always",
"trailingComma": "none"
}
"@tablecheck/prettier-config"
Loading
Loading