@elliemae/pui-cli 6.0.0-beta.34 → 6.0.0-beta.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli-commands/utils.js +9 -4
- package/lib/lint/eslint/common.js +3 -1
- package/lib/lint/eslint/typescript/common.js +6 -1
- package/lib/lint/eslint/typescript/non-react.js +1 -1
- package/lib/lint/eslint/typescript/react.js +6 -1
- package/lib/testing/mocks/matchMedia.js +10 -4
- package/lib/typescript/tsc-files/index.js +16 -11
- package/lib/webpack/webpack.dev.babel.js +2 -0
- package/lib/webpack/webpack.lib.dev.babel.js +1 -0
- package/lib/webpack/webpack.lib.prod.babel.js +1 -0
- package/lib/webpack/webpack.prod.babel.js +1 -0
- package/package.json +7 -7
|
@@ -24,10 +24,15 @@ exports.logSuccess = (...args) => console.log(chalk.green(...args));
|
|
|
24
24
|
exports.logError = console.error;
|
|
25
25
|
|
|
26
26
|
const readPackageLock = async () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
try {
|
|
28
|
+
const appPkgLockFile = path.join(process.cwd(), 'package-lock.json');
|
|
29
|
+
const pkgLockJSON = await readFile(appPkgLockFile, 'utf8');
|
|
30
|
+
const { dependencies } = JSON.parse(pkgLockJSON);
|
|
31
|
+
return (moduleName) => dependencies[moduleName]?.version || '';
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.warn('Package lock file not found');
|
|
34
|
+
return () => '';
|
|
35
|
+
}
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
const getSupportedBrowsers = async () => {
|
|
@@ -4,6 +4,7 @@ const webpackConfig = require('../../webpack/webpack.prod.babel');
|
|
|
4
4
|
|
|
5
5
|
exports.baseExtends = [
|
|
6
6
|
'plugin:eslint-comments/recommended',
|
|
7
|
+
'plugin:import/recommended',
|
|
7
8
|
'plugin:prettier/recommended',
|
|
8
9
|
'plugin:jest/recommended',
|
|
9
10
|
'plugin:jsdoc/recommended',
|
|
@@ -12,7 +13,8 @@ exports.baseExtends = [
|
|
|
12
13
|
'plugin:storybook/recommended',
|
|
13
14
|
];
|
|
14
15
|
|
|
15
|
-
const basePlugins = ['testing-library', 'jest', 'jsdoc', 'wdio'];
|
|
16
|
+
const basePlugins = ['testing-library', 'jest', 'jsdoc', 'wdio', 'import'];
|
|
17
|
+
exports.basePlugins = basePlugins;
|
|
16
18
|
|
|
17
19
|
exports.baseOverrides = [
|
|
18
20
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const { baseExtends } = require('../common');
|
|
1
|
+
const { baseExtends, basePlugins } = require('../common');
|
|
2
2
|
|
|
3
3
|
exports.tsBaseExtends = [
|
|
4
4
|
'plugin:@typescript-eslint/recommended',
|
|
5
|
+
'plugin:import/typescript',
|
|
5
6
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
6
7
|
].concat(baseExtends);
|
|
7
8
|
|
|
@@ -24,6 +25,7 @@ exports.tsBaseRules = {
|
|
|
24
25
|
exports.tsBaseConfig = {
|
|
25
26
|
files: ['*.ts', '*.tsx'],
|
|
26
27
|
parser: '@typescript-eslint/parser',
|
|
28
|
+
plugins: ['@typescript-eslint'].concat(basePlugins),
|
|
27
29
|
parserOptions: {
|
|
28
30
|
tsconfigRootDir: process.cwd(),
|
|
29
31
|
project: 'tsconfig.json',
|
|
@@ -34,5 +36,8 @@ exports.tsBaseConfig = {
|
|
|
34
36
|
alwaysTryTypes: true,
|
|
35
37
|
},
|
|
36
38
|
},
|
|
39
|
+
'import/parsers': {
|
|
40
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
41
|
+
},
|
|
37
42
|
},
|
|
38
43
|
};
|
|
@@ -4,7 +4,7 @@ const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common');
|
|
|
4
4
|
|
|
5
5
|
exports.tsConfig = {
|
|
6
6
|
...tsBaseConfig,
|
|
7
|
-
extends: ['airbnb-typescript/base'].concat(tsBaseExtends),
|
|
7
|
+
extends: ['airbnb-base', 'airbnb-typescript/base'].concat(tsBaseExtends),
|
|
8
8
|
rules: {
|
|
9
9
|
...baseRules,
|
|
10
10
|
...tsBaseRules,
|
|
@@ -4,7 +4,12 @@ const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common');
|
|
|
4
4
|
|
|
5
5
|
exports.tsReactConfig = {
|
|
6
6
|
...tsBaseConfig,
|
|
7
|
-
extends: [
|
|
7
|
+
extends: [
|
|
8
|
+
'airbnb',
|
|
9
|
+
'airbnb/hooks',
|
|
10
|
+
'plugin:redux-saga/recommended',
|
|
11
|
+
'airbnb-typescript',
|
|
12
|
+
].concat(tsBaseExtends),
|
|
8
13
|
rules: {
|
|
9
14
|
...baseRules,
|
|
10
15
|
...tsBaseRules,
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default () => {
|
|
5
5
|
Object.defineProperty(window, 'matchMedia', {
|
|
6
|
-
|
|
6
|
+
writable: true,
|
|
7
|
+
value: jest.fn().mockImplementation((query) => ({
|
|
7
8
|
matches: false,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
media: query,
|
|
10
|
+
onchange: null,
|
|
11
|
+
addListener: jest.fn(), // Deprecated
|
|
12
|
+
removeListener: jest.fn(), // Deprecated
|
|
13
|
+
addEventListener: jest.fn(),
|
|
14
|
+
removeEventListener: jest.fn(),
|
|
15
|
+
dispatchEvent: jest.fn(),
|
|
16
|
+
})),
|
|
11
17
|
});
|
|
12
18
|
|
|
13
19
|
Object.defineProperty(window, 'getComputedStyle', {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const execa = require('execa');
|
|
2
2
|
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
3
4
|
|
|
4
|
-
const { randomChars,
|
|
5
|
+
const { randomChars, resolveFromRoot } = require('./utils');
|
|
5
6
|
|
|
6
7
|
const args = process.argv.slice(2);
|
|
7
8
|
const argsProjectIndex = args.findIndex((arg) =>
|
|
@@ -46,16 +47,20 @@ const tmpTsconfig = {
|
|
|
46
47
|
fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2));
|
|
47
48
|
|
|
48
49
|
// Type-check our files
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
let status = 0;
|
|
51
|
+
try {
|
|
52
|
+
execa.sync(
|
|
53
|
+
path.resolve(
|
|
54
|
+
process.cwd(),
|
|
55
|
+
`./node_modules/.bin/tsc${process.platform === 'win32' ? '.cmd' : ''}`,
|
|
56
|
+
),
|
|
57
|
+
['-p', tmpTsconfigPath, ...remainingArgsToForward],
|
|
58
|
+
{ stdio: 'inherit' },
|
|
59
|
+
);
|
|
60
|
+
} catch (ex) {
|
|
61
|
+
status = ex.exitCode;
|
|
62
|
+
}
|
|
57
63
|
|
|
58
64
|
// Delete temp config file
|
|
59
65
|
fs.unlinkSync(tmpTsconfigPath);
|
|
60
|
-
|
|
61
66
|
process.exit(status);
|
|
@@ -72,6 +72,7 @@ const devConfig = {
|
|
|
72
72
|
|
|
73
73
|
// Add development plugins
|
|
74
74
|
plugins: [
|
|
75
|
+
new webpack.ProgressPlugin(),
|
|
75
76
|
new webpack.HotModuleReplacementPlugin(), // Tell webpack we want hot reloading
|
|
76
77
|
new ReactRefreshWebpackPlugin({
|
|
77
78
|
overlay: {
|
|
@@ -79,6 +80,7 @@ const devConfig = {
|
|
|
79
80
|
},
|
|
80
81
|
}),
|
|
81
82
|
new HtmlWebpackPlugin({
|
|
83
|
+
scriptLoading: 'module',
|
|
82
84
|
inject: !isAppLoaderEnabled(), // Inject all files that are generated by webpack, e.g. bundle.js
|
|
83
85
|
template: !isAppLoaderEnabled()
|
|
84
86
|
? 'app/index.html'
|
|
@@ -28,6 +28,7 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
28
28
|
// Add development plugins
|
|
29
29
|
plugins: [
|
|
30
30
|
new HtmlWebpackPlugin({
|
|
31
|
+
scriptLoading: 'module',
|
|
31
32
|
inject: true, // Inject all files that are generated by webpack, e.g. bundle.js
|
|
32
33
|
template: 'lib/index.pug',
|
|
33
34
|
filename: 'index.html',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.38",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -83,17 +83,17 @@
|
|
|
83
83
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
84
84
|
"@svgr/webpack": "~6.1.2",
|
|
85
85
|
"@swc/cli": "~0.1.55",
|
|
86
|
-
"@swc/core": "~1.2.
|
|
86
|
+
"@swc/core": "~1.2.126",
|
|
87
87
|
"@swc/jest": "~0.2.15",
|
|
88
88
|
"@testing-library/jest-dom": "~5.16.1",
|
|
89
89
|
"@testing-library/react": "~12.1.2",
|
|
90
90
|
"@testing-library/react-hooks": "~7.0.2",
|
|
91
91
|
"@types/jest": "~27.4.0",
|
|
92
|
-
"@types/node": "~17.0.
|
|
92
|
+
"@types/node": "~17.0.8",
|
|
93
93
|
"@types/rimraf": "~3.0.2",
|
|
94
94
|
"@types/testing-library__jest-dom": "~5.14.2",
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "~5.
|
|
96
|
-
"@typescript-eslint/parser": "~5.
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "~5.9.0",
|
|
96
|
+
"@typescript-eslint/parser": "~5.9.0",
|
|
97
97
|
"autoprefixer": "~10.4.1",
|
|
98
98
|
"axe-core": "~4.3.5",
|
|
99
99
|
"babel-loader": "~8.2.3",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
147
147
|
"eslint-plugin-import": "~2.25.4",
|
|
148
148
|
"eslint-plugin-jest": "~25.3.4",
|
|
149
|
-
"eslint-plugin-jsdoc": "~37.5.
|
|
149
|
+
"eslint-plugin-jsdoc": "~37.5.1",
|
|
150
150
|
"eslint-plugin-jsx-a11y": "~6.5.1",
|
|
151
151
|
"eslint-plugin-mdx": "~1.16.0",
|
|
152
152
|
"eslint-plugin-prettier": "~4.0.0",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"imports-loader": "~3.1.1",
|
|
174
174
|
"ip": "~1.1.5",
|
|
175
175
|
"jest-axe": "~5.0.1",
|
|
176
|
-
"jest-cli": "~27.4.
|
|
176
|
+
"jest-cli": "~27.4.6",
|
|
177
177
|
"jest-sonar-reporter": "~2.0.0",
|
|
178
178
|
"jest-styled-components": "~7.0.8",
|
|
179
179
|
"jscodeshift": "~0.13.0",
|