Skip to content

Commit ef98939

Browse files
authored
Release 6.0.0 (#48)
## What's Changed * feat: ignore playwright folder in jest config by @puehringer in #45 * deps: pin @swc/core to 1.3.95 by @dvmartinweigl in #47 * feat: add ability to build ts|tsx from node_modules by @puehringer in #46 ## New Contributors * @dvmartinweigl made their first contribution in #47 **Full Changelog**: v5.1.0...v6.0.0
2 parents 16c5873 + 2339073 commit ef98939

File tree

6 files changed

+44
-23
lines changed

6 files changed

+44
-23
lines changed

bin/commands/lint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
type: 'boolean',
99
}),
1010
handler: (args) => {
11-
call('eslint', `${args.cache ? '--cache' : ''} --no-error-on-unmatched-pattern ${(args.strings || []).join(' ')} "src/**/*.ts{,x}" "tests/**/*.ts{,x}" "cypress/**/*.ts{,x}"`);
11+
// TODO: Remove --fix to ensure all linting errors are reported in CI. Disable until a codebase is fully migrated, as otherwise formatting causes merge conflicts.
12+
call('eslint', `--fix ${args.cache ? '--cache' : ''} --no-error-on-unmatched-pattern ${(args.strings || []).join(' ')} "src/**/*.ts{,x}" "tests/**/*.ts{,x}" "cypress/**/*.ts{,x}"`);
1213
},
1314
};

config/eslintrc.template.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ module.exports = ({ tsconfigRootDir }) => ({
4949
'no-prototype-builtins': 'warn',
5050
'no-minusminus': 'off',
5151
'no-underscore-dangle': 'off',
52+
'@typescript-eslint/no-explicit-any': 'warn',
5253
'@typescript-eslint/no-unused-expressions': [
5354
'error',
5455
{
@@ -57,6 +58,7 @@ module.exports = ({ tsconfigRootDir }) => ({
5758
allowTaggedTemplates: true,
5859
},
5960
],
61+
'@typescript-eslint/no-unused-vars': 'warn',
6062
'max-classes-per-file': 'off',
6163
'no-param-reassign': ['warn', { props: true, ignorePropertyModificationsFor: ['state'] }], // Exclude state as required by redux-toolkit: https://redux-toolkit.js.org/usage/immer-reducers#linting-state-mutations
6264
'cypress/unsafe-to-chain-command': 'off',

config/jest.config.template.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ const pluginsNotToTransform = [
33
'd3v3',
44
].join('|');
55

6-
/**
7-
* TODO check if we can process inline webpack loaders (e.g. as found in https://github.com/phovea/phovea_ui/blob/master/src/_bootstrap.ts)
8-
* see also https://jestjs.io/docs/en/webpack#mocking-css-modules
9-
*/
6+
/** @type {import('jest').Config} */
107
module.exports = {
118
testEnvironment: 'jsdom',
129
transform: {
@@ -22,6 +19,8 @@ module.exports = {
2219
'\\.xml$': 'jest-raw-loader',
2320
},
2421
testRegex: '(.*(test|spec))\\.(tsx?)$',
22+
testPathIgnorePatterns: ['playwright'],
23+
coveragePathIgnorePatterns: ['playwright'],
2524
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
2625
modulePaths: ['src'],
2726
resolver: 'visyn_scripts/config/jest_export_maps_resolver.js',
@@ -32,5 +31,7 @@ module.exports = {
3231
},
3332
moduleNameMapper: {
3433
'^.+\\.(css|less|scss|sass|png|jpg|gif|svg|html)$': 'identity-obj-proxy',
34+
// Add tslib alias as otherwise we get a TypeError: Cannot destructure property '__extends' of '_tslib.default' as it is undefined.
35+
tslib: 'tslib/tslib.es6.js',
3536
},
3637
};

config/tsconfig.template.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717
"allowSyntheticDefaultImports": true,
1818
"preserveWatchOutput": true
1919
},
20+
// Old "moduleResolution": "Node" option required for Cypress
21+
// https://github.com/cypress-io/cypress/issues/26308#issuecomment-1663592648
22+
//
23+
// TODO: Remove when issue is resolved https://github.com/cypress-io/cypress/issues/27448
2024
"ts-node": {
2125
"compilerOptions": {
22-
"module": "es2022",
23-
"moduleResolution": "node16",
24-
"sourceMap": false,
26+
"module": "ESNext",
27+
"moduleResolution": "Node"
2528
}
26-
},
29+
}
2730
}

config/webpack.config.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ module.exports = (webpackEnv, argv) => {
308308
? {
309309
static: path.resolve(workspacePath, 'bundles'),
310310
compress: true,
311-
host: 'localhost',
311+
// Listen to all interfaces, as Node 18+ resolves IPv6 first: https://github.com/cypress-io/github-action/blob/master/README.md#wait-on-with-nodejs-18
312+
host: '0.0.0.0',
312313
open: true,
313314
// Needs to be enabled to make SPAs work: https://stackoverflow.com/questions/31945763/how-to-tell-webpack-dev-server-to-serve-index-html-for-any-route
314315
historyApiFallback: historyApiFallback == null ? true : historyApiFallback,
@@ -495,6 +496,20 @@ module.exports = (webpackEnv, argv) => {
495496
},
496497
},
497498
},
499+
// Process application TS with swc-loader even if they are coming from node_modules, i.e. from non-built dependencies.
500+
{
501+
test: /\.(ts|tsx)$/,
502+
loader: 'swc-loader',
503+
options: {
504+
jsc: {
505+
parser: {
506+
syntax: 'typescript',
507+
decorators: true,
508+
// TODO: Check what other settings should be supported: https://swc.rs/docs/configuration/swcrc#compilation
509+
},
510+
},
511+
},
512+
},
498513
// "postcss" loader applies autoprefixer to our CSS.
499514
// "css" loader resolves paths in CSS and adds assets as dependencies.
500515
// "style" loader turns CSS into JS modules that inject <style> tags.

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visyn_scripts",
33
"description": "",
4-
"version": "5.1.0",
4+
"version": "6.0.0",
55
"author": {
66
"name": "datavisyn GmbH",
77
"email": "[email protected]",
@@ -34,15 +34,15 @@
3434
"dependencies": {
3535
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
3636
"@svgr/webpack": "^6.5.1",
37-
"@swc/core": "~1.3.77",
37+
"@swc/core": "1.3.95",
3838
"@swc/jest": "~0.2.24",
3939
"@types/jest": "~27.4.1",
40-
"@types/node": "^17.0.45",
40+
"@types/node": "^20.8.9",
4141
"@types/webpack": "^5.28.0",
4242
"@types/yeoman-environment": "2.10.8",
4343
"@types/yeoman-generator": "4.11.4",
44-
"@typescript-eslint/eslint-plugin": "~5.55.0",
45-
"@typescript-eslint/parser": "~5.55.0",
44+
"@typescript-eslint/eslint-plugin": "~6.9.0",
45+
"@typescript-eslint/parser": "~6.9.0",
4646
"bluebird": "3",
4747
"browserslist": "^4.18.1",
4848
"chalk": "4",
@@ -59,20 +59,20 @@
5959
"eslint-config-airbnb": "^19.0.4",
6060
"eslint-config-airbnb-base": "^15.0.0",
6161
"eslint-config-airbnb-typescript": "^17.0.0",
62-
"eslint-config-prettier": "^8.7.0",
62+
"eslint-config-prettier": "^9.0.0",
6363
"eslint-config-react-app": "^7.0.1",
6464
"eslint-plugin-chai-friendly": "^0.7.2",
6565
"eslint-plugin-cypress": "^2.12.1",
6666
"eslint-plugin-import": "^2.27.5",
67-
"eslint-plugin-jest": "^27.2.1",
67+
"eslint-plugin-jest": "^27.6.0",
6868
"eslint-plugin-jsx-a11y": "^6.7.1",
69-
"eslint-plugin-prettier": "^4.2.1",
69+
"eslint-plugin-prettier": "^5.0.1",
7070
"eslint-plugin-react": "^7.32.2",
7171
"eslint-plugin-react-hooks": "^4.6.0",
7272
"eslint-webpack-plugin": "^4.0.0",
7373
"expose-loader": "^4.1.0",
7474
"file-loader": "^6.2.0",
75-
"fork-ts-checker-webpack-plugin": "^8.0.0",
75+
"fork-ts-checker-webpack-plugin": "^9.0.0",
7676
"fs-extra": "^10.1.0",
7777
"get-tsconfig": "^4.4.0",
7878
"glob": "^8.1.0",
@@ -93,14 +93,14 @@
9393
"postcss-loader": "^7.1.0",
9494
"postcss-normalize": "^10.0.1",
9595
"postcss-preset-env": "^8.0.1",
96-
"prettier": "^2.8.4",
96+
"prettier": "^3.0.3",
9797
"raw-loader": "~4.0.2",
9898
"react-dev-utils": "^12.0.1",
9999
"react-refresh": "^0.14.0",
100100
"resolve": "^1.22.1",
101101
"resolve-url-loader": "^5.0.0",
102102
"rimraf": "~4.4.0",
103-
"sass-embedded": "~1.64.2",
103+
"sass-embedded": "~1.69.5",
104104
"sass-loader": "^13.2.0",
105105
"semver": "^7.3.8",
106106
"semver-intersect": "^1.4.0",
@@ -112,10 +112,9 @@
112112
"tailwindcss": "^3.2.7",
113113
"terser-webpack-plugin": "^5.3.7",
114114
"time-analytics-webpack-plugin": "^0.1.20",
115-
"ts-jest": "~27.1.3",
116115
"ts-node": "^10.9.1",
117116
"tslib": "~2.6.2",
118-
"typescript": "~5.1.6",
117+
"typescript": "~5.2.2",
119118
"url-loader": "~4.1.1",
120119
"util": "^0.12.5",
121120
"webpack": "^5.76.2",

0 commit comments

Comments
 (0)