Skip to content

Commit

Permalink
build: make monorepo consistent, clean up and upgrade dependencies, s…
Browse files Browse the repository at this point in the history
…peed up CI

* upgradte typescript to 4.9.x
* switch to @swc/jest for esm support
* make build setup consistent across most packages
* prune unused dependencies
* fix typescript errors in related-table
* execute code mod transform-typed-imports to allow for usage of isolated modules
* make typescript config consistent across repos
* make eslint config consistent across repos
* make jest config consistent across repos
* fix typescript errors in VideoPlayer component
  • Loading branch information
diehbria committed Mar 14, 2023
1 parent bf7964a commit f8ed10f
Show file tree
Hide file tree
Showing 460 changed files with 30,130 additions and 60,187 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run integration tests
uses: cypress-io/github-action@v5
with:
command: npx turbo run test:integration --filter=packages/components
command: npx turbo run test:integration --filter=components
# after the test run completes
# store videos and any screenshots
- uses: actions/upload-artifact@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
run: npm ci --prefer-offline --no-audit --no-fund

- name: Run unit tests
run: npx turbo run test
run: npm run test

- name: Run lints
run: npx turbo run lint
run: npm run lint

- name: Run style lint
run: npm run test:stylelint
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"version": "3.0.0",
"dependencies": {
"eslint-config-turbo": "latest",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.23.0",
"eslint": "^8.2.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-config-turbo": "latest",
"eslint-plugin-chai-friendly": "0.7.2",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-formatjs": "3.0.0",
Expand All @@ -22,5 +22,8 @@
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.26.1",
"eslint-plugin-react-hooks": "^4.2.0"
}
},
"files": [
"index.js"
]
}
20 changes: 20 additions & 0 deletions configuration/jest-config/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

export default {
setupFilesAfterEnv: ['jest-extended/all'],
maxWorkers: '50%',
collectCoverageFrom: ["./src/**"],
collectCoverage: true,
moduleFileExtensions: ['js', 'ts'],
transform: {
'.*\\.(ts|js)$': [
'@swc/jest',
],
},
transformIgnorePatterns: [],
roots: ['./src'],
"coverageThreshold": {
"global": {
"lines": 50
}
}
};
4 changes: 4 additions & 0 deletions configuration/jest-config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import reactConfig from './react';
import baseConfig from './base';

export { reactConfig, baseConfig };
9 changes: 9 additions & 0 deletions configuration/jest-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@iot-app-kit/jest-config",
"version": "3.0.0",
"main": "index.ts",
"private": true,
"publishConfig": {
"access": "public"
}
}
25 changes: 25 additions & 0 deletions configuration/jest-config/react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default {
setupFilesAfterEnv: ['jest-extended/all'],
maxWorkers: '50%',
moduleFileExtensions: ['js', 'ts', 'jsx', 'tsx'],
collectCoverage: true,
testEnvironment: 'jsdom',
transform: {
'.*\\.(tsx?|jsx?)$': [
'@swc/jest',
{
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
},
transformIgnorePatterns: [],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
},
};
3 changes: 3 additions & 0 deletions configuration/ts-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `tsconfig`

These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.
23 changes: 23 additions & 0 deletions configuration/ts-config/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"composite": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"lib": ["ESNEXT"],
"module": "ESNext",
"target": "es2018"
},
"exclude": ["node_modules"]
}
10 changes: 10 additions & 0 deletions configuration/ts-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@iot-app-kit/ts-config",
"version": "3.0.0",
"type": "module",
"private": true,
"files": [
"base.json",
"react-library.json"
]
}
11 changes: 11 additions & 0 deletions configuration/ts-config/react-library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Library",
"extends": "./base.json",
"compilerOptions": {
"jsx": "react",
"lib": ["ESNEXT", "DOM"],
"module": "ESNext",
"target": "es2018"
}
}
Loading

0 comments on commit f8ed10f

Please sign in to comment.