@elliemae/pui-cli 7.0.0-alpha.2 → 7.0.0-alpha.20
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/dist/cjs/babel.config.cjs +97 -0
- package/dist/cjs/cli.js +14 -12
- package/dist/cjs/{cli-commands → commands}/build.js +0 -0
- package/dist/cjs/{cli-commands → commands}/codemod.js +0 -0
- package/dist/cjs/{cli-commands → commands}/gendoc.js +1 -1
- package/dist/cjs/{cli-commands → commands}/lint.js +2 -2
- package/dist/cjs/{cli-commands → commands}/pack.js +2 -2
- package/dist/cjs/{cli-commands → commands}/start.js +0 -0
- package/dist/cjs/{cli-commands → commands}/storybook.js +0 -0
- package/dist/cjs/{cli-commands → commands}/test.js +13 -5
- package/dist/cjs/{cli-commands/tsc.js → commands/tscheck.js} +26 -44
- package/dist/cjs/{cli-commands → commands}/utils.js +0 -0
- package/dist/cjs/{cli-commands → commands}/version.js +0 -0
- package/dist/cjs/{cli-commands → commands}/vitest.js +4 -1
- package/dist/cjs/index.cjs +25 -0
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/{docgen/jsdoc.conf.json → jsdoc.conf.json} +0 -0
- package/dist/cjs/lint-config/commitlint.config.cjs +1 -0
- package/dist/cjs/lint-config/eslint/common.cjs +160 -0
- package/dist/cjs/lint-config/eslint/non-react.cjs +14 -0
- package/dist/cjs/lint-config/eslint/react.cjs +26 -0
- package/dist/cjs/lint-config/eslint/typescript/common.cjs +43 -0
- package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +12 -0
- package/dist/cjs/lint-config/eslint/typescript/react.cjs +19 -0
- package/dist/cjs/{lint → lint-config}/lint-staged.config.js +1 -6
- package/dist/cjs/lint-config/prettier.config.cjs +8 -0
- package/dist/cjs/lint-config/stylelint.config.cjs +19 -0
- package/dist/cjs/monorepo/set-registry-version.js +1 -1
- package/dist/cjs/monorepo/set-workspace-version.js +1 -1
- package/dist/cjs/monorepo/utils.cjs +30 -0
- package/dist/cjs/{pui-config/index.js → pui-config.js} +0 -0
- package/dist/cjs/release.config.cjs +31 -0
- package/dist/cjs/server/app-routes.cjs +42 -0
- package/dist/cjs/server/index.js +6 -5
- package/dist/cjs/server/{middlewares/index.js → middlewares.js} +18 -7
- package/dist/cjs/{typescript/util.js → server/utils.js} +11 -7
- package/dist/cjs/testing/jest.config.cjs +103 -0
- package/dist/cjs/testing/jest.node.config.cjs +8 -0
- package/dist/cjs/{typescript/tsc-files/utils.js → testing/mocks/axios.js} +18 -12
- package/dist/cjs/{scripts/helpers/checkmark.js → testing/mocks/cssModule.js} +5 -14
- package/dist/cjs/testing/mocks/html.js +23 -0
- package/dist/cjs/testing/mocks/image.js +23 -0
- package/dist/cjs/testing/mocks/matchMedia.js +43 -0
- package/dist/cjs/testing/mocks/pui-app-loader.js +24 -0
- package/dist/cjs/testing/mocks/pui-diagnostics.js +68 -0
- package/dist/cjs/testing/mocks/pui-user-monitoring.js +30 -0
- package/dist/cjs/testing/mocks/retry-axios.js +27 -0
- package/dist/cjs/{scripts/helpers/xmark.js → testing/mocks/svg.js} +8 -10
- package/dist/cjs/testing/mocks/webpack-hmr.js +24 -0
- package/dist/cjs/testing/resolver.cjs +47 -0
- package/dist/cjs/{scripts/helpers/get-npm-config.js → testing/setup-test-env.js} +4 -12
- package/dist/cjs/testing/setup-tests.js +3 -3
- package/dist/cjs/testing/vitest.config.js +20 -6
- package/dist/cjs/transpile/.swcrc +11 -0
- package/dist/cjs/transpile/esbuild.js +2 -1
- package/dist/cjs/transpile/swcrc.config.cjs +13 -0
- package/dist/cjs/{scripts/update-notifier.js → update-notifier.js} +2 -2
- package/dist/cjs/utils.cjs +23 -0
- package/dist/cjs/webpack/helpers.js +1 -1
- package/dist/cjs/webpack/webpack.base.babel.js +2 -2
- package/dist/cjs/webpack/webpack.dev.babel.js +10 -6
- package/dist/cjs/webpack/webpack.lib.base.babel.js +6 -6
- package/dist/cjs/webpack/webpack.lib.prod.babel.js +2 -2
- package/dist/cjs/webpack/webpack.prod.babel.js +2 -2
- package/dist/cjs/webpack/webpack.storybook.js +122 -0
- package/dist/esm/babel.config.cjs +97 -0
- package/dist/esm/cli.js +13 -11
- package/dist/esm/{cli-commands → commands}/build.js +0 -0
- package/dist/esm/{cli-commands → commands}/codemod.js +0 -0
- package/dist/esm/{cli-commands → commands}/gendoc.js +1 -1
- package/dist/esm/{cli-commands → commands}/lint.js +1 -1
- package/dist/esm/{cli-commands → commands}/pack.js +1 -1
- package/dist/esm/{cli-commands → commands}/start.js +0 -0
- package/dist/esm/{cli-commands → commands}/storybook.js +0 -0
- package/dist/esm/{cli-commands → commands}/test.js +13 -5
- package/dist/esm/commands/tscheck.js +65 -0
- package/dist/esm/{cli-commands → commands}/utils.js +0 -0
- package/dist/esm/{cli-commands → commands}/version.js +0 -0
- package/dist/esm/{cli-commands → commands}/vitest.js +4 -1
- package/dist/esm/index.cjs +25 -0
- package/dist/esm/index.js +8 -8
- package/dist/esm/{docgen/jsdoc.conf.json → jsdoc.conf.json} +0 -0
- package/dist/esm/lint-config/commitlint.config.cjs +1 -0
- package/dist/esm/lint-config/eslint/common.cjs +160 -0
- package/dist/esm/lint-config/eslint/non-react.cjs +14 -0
- package/dist/esm/lint-config/eslint/react.cjs +26 -0
- package/dist/esm/lint-config/eslint/typescript/common.cjs +43 -0
- package/dist/esm/lint-config/eslint/typescript/non-react.cjs +12 -0
- package/dist/esm/lint-config/eslint/typescript/react.cjs +19 -0
- package/dist/esm/{lint → lint-config}/lint-staged.config.js +1 -5
- package/dist/esm/lint-config/prettier.config.cjs +8 -0
- package/dist/esm/lint-config/stylelint.config.cjs +19 -0
- package/dist/esm/monorepo/set-registry-version.js +1 -1
- package/dist/esm/monorepo/set-workspace-version.js +1 -1
- package/dist/esm/monorepo/utils.cjs +30 -0
- package/dist/esm/{pui-config/index.js → pui-config.js} +0 -0
- package/dist/esm/release.config.cjs +31 -0
- package/dist/esm/server/app-routes.cjs +42 -0
- package/dist/esm/server/index.js +3 -2
- package/dist/esm/server/middlewares.js +46 -0
- package/dist/esm/server/utils.js +10 -0
- package/dist/esm/testing/jest.config.cjs +103 -0
- package/dist/esm/testing/jest.node.config.cjs +8 -0
- package/dist/esm/testing/mocks/axios.js +18 -0
- package/dist/esm/testing/mocks/cssModule.js +4 -0
- package/dist/esm/testing/mocks/html.js +4 -0
- package/dist/esm/testing/mocks/image.js +4 -0
- package/dist/esm/testing/mocks/matchMedia.js +24 -0
- package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
- package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
- package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
- package/dist/esm/testing/mocks/retry-axios.js +8 -0
- package/dist/esm/testing/mocks/svg.js +7 -0
- package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
- package/dist/esm/testing/resolver.cjs +47 -0
- package/dist/esm/testing/setup-test-env.js +4 -0
- package/dist/esm/testing/setup-tests.js +2 -2
- package/dist/esm/testing/vitest.config.js +18 -5
- package/dist/esm/transpile/.swcrc +11 -0
- package/dist/esm/transpile/esbuild.js +2 -1
- package/dist/esm/transpile/swcrc.config.cjs +13 -0
- package/dist/esm/{scripts/update-notifier.js → update-notifier.js} +2 -2
- package/dist/esm/utils.cjs +23 -0
- package/dist/esm/webpack/helpers.js +1 -1
- package/dist/esm/webpack/webpack.base.babel.js +3 -3
- package/dist/esm/webpack/webpack.dev.babel.js +8 -5
- package/dist/esm/webpack/webpack.lib.base.babel.js +6 -11
- package/dist/esm/webpack/webpack.lib.prod.babel.js +1 -1
- package/dist/esm/webpack/webpack.prod.babel.js +2 -2
- package/dist/esm/webpack/webpack.storybook.js +102 -0
- package/dist/types/{babel/babel.config.d.cts → babel.config.d.cts} +0 -0
- package/dist/types/{cli-commands → commands}/build.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/codemod.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/gendoc.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/lint.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/pack.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/start.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/storybook.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/test.d.ts +10 -6
- package/dist/types/commands/tscheck.d.ts +14 -0
- package/dist/types/{cli-commands → commands}/utils.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/version.d.ts +0 -0
- package/dist/types/{cli-commands → commands}/vitest.d.ts +0 -0
- package/dist/types/index.d.cts +10 -0
- package/dist/types/index.d.ts +8 -8
- package/dist/types/{lint → lint-config}/commitlint.config.d.cts +0 -0
- package/dist/types/{lint → lint-config}/eslint/common.d.cts +15 -12
- package/dist/types/{lint → lint-config}/eslint/non-react.d.cts +6 -1
- package/dist/types/{lint → lint-config}/eslint/react.d.cts +6 -1
- package/dist/types/{lint → lint-config}/eslint/typescript/common.d.cts +2 -2
- package/dist/types/{lint → lint-config}/eslint/typescript/non-react.d.cts +1 -1
- package/dist/types/{lint → lint-config}/eslint/typescript/react.d.cts +1 -1
- package/dist/types/{lint → lint-config}/lint-staged.config.d.ts +0 -0
- package/dist/types/{lint → lint-config}/prettier.config.d.cts +0 -0
- package/dist/types/{lint → lint-config}/stylelint.config.d.cts +1 -0
- package/dist/types/monorepo/utils.d.cts +1 -0
- package/dist/types/{pui-config/index.d.ts → pui-config.d.ts} +0 -0
- package/dist/types/{release/release.config.d.cts → release.config.d.cts} +0 -0
- package/dist/types/server/app-routes.d.cts +1 -0
- package/dist/types/server/{middlewares/index.d.ts → middlewares.d.ts} +1 -1
- package/dist/types/server/{util/index.d.ts → utils.d.ts} +0 -1
- package/dist/types/testing/jest.config.d.cts +3 -3
- package/dist/types/testing/jest.node.config.d.cts +4 -4
- package/dist/types/testing/mocks/axios.d.ts +17 -0
- package/dist/types/testing/mocks/cssModule.d.ts +2 -0
- package/dist/types/testing/mocks/html.d.ts +2 -0
- package/dist/types/testing/mocks/image.d.ts +2 -0
- package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
- package/dist/types/testing/mocks/{pui-app-loader.d.cts → pui-app-loader.d.ts} +0 -0
- package/dist/types/testing/mocks/{pui-diagnostics.d.cts → pui-diagnostics.d.ts} +0 -0
- package/dist/types/testing/mocks/{pui-user-monitoring.d.cts → pui-user-monitoring.d.ts} +0 -0
- package/dist/types/testing/mocks/{retry-axios.d.cts → retry-axios.d.ts} +0 -0
- package/dist/types/testing/mocks/{svg.d.cts → svg.d.ts} +1 -1
- package/dist/types/testing/mocks/{webpack-hmr.d.cts → webpack-hmr.d.ts} +0 -0
- package/dist/types/testing/setup-test-env.d.ts +2 -0
- package/dist/types/testing/vitest.config.d.ts +1 -1
- package/dist/types/transpile/swcrc.config.d.cts +1 -1
- package/dist/types/update-notifier.d.ts +1 -0
- package/dist/types/utils.d.cts +2 -1
- package/dist/types/webpack/helpers.d.ts +1 -1
- package/dist/types/webpack/webpack.dev.babel.d.ts +2 -1
- package/dist/types/webpack/webpack.lib.dev.babel.d.ts +1 -1
- package/dist/types/webpack/webpack.lib.prod.babel.d.ts +20 -4
- package/dist/types/webpack/webpack.prod.babel.d.ts +1 -1
- package/dist/types/webpack/{webpack.storybook.d.cts → webpack.storybook.d.ts} +0 -0
- package/package.json +92 -87
- package/dist/cjs/monorepo/utils.js +0 -34
- package/dist/cjs/scripts/helpers/progress.js +0 -35
- package/dist/cjs/scripts/npmcheckversion.js +0 -8
- package/dist/cjs/server/middlewares/addProdMiddlewares.js +0 -44
- package/dist/cjs/server/util/index.js +0 -68
- package/dist/cjs/testing/vitest.setup.js +0 -0
- package/dist/cjs/typescript/tsc-files/index.js +0 -68
- package/dist/esm/cli-commands/tsc.js +0 -83
- package/dist/esm/monorepo/utils.js +0 -12
- package/dist/esm/scripts/helpers/checkmark.js +0 -10
- package/dist/esm/scripts/helpers/get-npm-config.js +0 -5
- package/dist/esm/scripts/helpers/progress.js +0 -13
- package/dist/esm/scripts/helpers/xmark.js +0 -9
- package/dist/esm/scripts/npmcheckversion.js +0 -8
- package/dist/esm/server/middlewares/addProdMiddlewares.js +0 -22
- package/dist/esm/server/middlewares/index.js +0 -35
- package/dist/esm/server/util/index.js +0 -46
- package/dist/esm/testing/vitest.setup.js +0 -0
- package/dist/esm/typescript/tsc-files/index.js +0 -55
- package/dist/esm/typescript/tsc-files/utils.js +0 -12
- package/dist/esm/typescript/util.js +0 -6
- package/dist/types/cli-commands/tsc.d.ts +0 -20
- package/dist/types/monorepo/utils.d.ts +0 -1
- package/dist/types/scripts/helpers/checkmark.d.ts +0 -7
- package/dist/types/scripts/helpers/get-npm-config.d.ts +0 -2
- package/dist/types/scripts/helpers/progress.d.ts +0 -7
- package/dist/types/scripts/helpers/xmark.d.ts +0 -6
- package/dist/types/scripts/npmcheckversion.d.ts +0 -1
- package/dist/types/scripts/update-notifier.d.ts +0 -2
- package/dist/types/server/middlewares/addProdMiddlewares.d.ts +0 -1
- package/dist/types/testing/mocks/axios.d.cts +0 -14
- package/dist/types/testing/mocks/cssModule.d.cts +0 -2
- package/dist/types/testing/mocks/html.d.cts +0 -2
- package/dist/types/testing/mocks/image.d.cts +0 -2
- package/dist/types/testing/mocks/matchMedia.d.cts +0 -2
- package/dist/types/testing/vitest.setup.d.ts +0 -0
- package/dist/types/typescript/tsc-files/index.d.ts +0 -1
- package/dist/types/typescript/tsc-files/utils.d.ts +0 -3
- package/dist/types/typescript/util.d.ts +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const { isApp } = require('./utils.cjs');
|
|
2
|
+
|
|
3
|
+
const nodeEnvPreset = {
|
|
4
|
+
modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
|
|
5
|
+
targets: {
|
|
6
|
+
node: 'current',
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const webEnvPreset = {
|
|
11
|
+
modules: process.env.ES_MODULES === 'false' ? 'commonjs' : false,
|
|
12
|
+
useBuiltIns: 'usage',
|
|
13
|
+
corejs: { version: '3.22', proposals: true },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const presetEnvOptions =
|
|
17
|
+
process.env.TARGET_ENV === 'node' ? nodeEnvPreset : webEnvPreset;
|
|
18
|
+
|
|
19
|
+
const config = {
|
|
20
|
+
ignore: [/\/core-js/],
|
|
21
|
+
sourceType: 'unambiguous',
|
|
22
|
+
presets: [
|
|
23
|
+
['@babel/preset-env', presetEnvOptions],
|
|
24
|
+
['@babel/preset-react', { runtime: 'automatic' }],
|
|
25
|
+
'@babel/preset-typescript',
|
|
26
|
+
],
|
|
27
|
+
plugins: [
|
|
28
|
+
[
|
|
29
|
+
'babel-plugin-module-resolver',
|
|
30
|
+
{
|
|
31
|
+
alias: {
|
|
32
|
+
'@': isApp() ? './app' : './lib',
|
|
33
|
+
},
|
|
34
|
+
stripExtensions: [],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
['babel-plugin-styled-components', { displayName: true }],
|
|
38
|
+
['@babel/plugin-transform-runtime', { regenerator: true }],
|
|
39
|
+
'@babel/plugin-proposal-class-properties',
|
|
40
|
+
'@babel/plugin-syntax-dynamic-import',
|
|
41
|
+
'@babel/plugin-proposal-export-default-from',
|
|
42
|
+
'lodash',
|
|
43
|
+
'date-fns',
|
|
44
|
+
],
|
|
45
|
+
env: {
|
|
46
|
+
development: {
|
|
47
|
+
plugins: [
|
|
48
|
+
['babel-plugin-styled-components', { displayName: true }],
|
|
49
|
+
'@babel/plugin-transform-react-jsx-source',
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
production: {
|
|
53
|
+
plugins: [
|
|
54
|
+
['babel-plugin-styled-components', { displayName: false, pure: true }],
|
|
55
|
+
['transform-remove-console', { exclude: ['error', 'warn'] }],
|
|
56
|
+
'transform-react-remove-prop-types',
|
|
57
|
+
'@babel/plugin-transform-react-inline-elements',
|
|
58
|
+
'@babel/plugin-transform-react-constant-elements',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
test: {
|
|
62
|
+
plugins: [
|
|
63
|
+
['babel-plugin-styled-components', { displayName: true }],
|
|
64
|
+
'@babel/plugin-transform-modules-commonjs',
|
|
65
|
+
'dynamic-import-node',
|
|
66
|
+
[
|
|
67
|
+
'babel-plugin-transform-strip-block',
|
|
68
|
+
{
|
|
69
|
+
requireDirective: true,
|
|
70
|
+
identifiers: [{ start: 'block:start', end: 'block:end' }],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
'babel-plugin-import-remove-resource-query',
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
process.env.STORYBOOK_BUILD !== 'true' &&
|
|
81
|
+
process.env.TARGET_ENV !== 'node'
|
|
82
|
+
) {
|
|
83
|
+
config.env?.development?.plugins?.push?.('react-refresh/babel');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ToDo: Once ECC team migrates from webpack 3 to webpack 5 remove this strip-block plugin from commonjs output. without this they are receiving error when import.meta is used in app sdk
|
|
87
|
+
if (process.env.ES_MODULES === 'false') {
|
|
88
|
+
config.plugins.push([
|
|
89
|
+
'babel-plugin-transform-strip-block',
|
|
90
|
+
{
|
|
91
|
+
requireDirective: true,
|
|
92
|
+
identifiers: [{ start: 'block:start', end: 'block:end' }],
|
|
93
|
+
},
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
exports.babelConfig = config;
|
package/dist/esm/cli.js
CHANGED
|
@@ -4,17 +4,18 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import yargs from "yargs";
|
|
5
5
|
import { hideBin } from "yargs/helpers";
|
|
6
6
|
import { config as envConfig } from "dotenv";
|
|
7
|
-
import notifyUpdates from "./
|
|
8
|
-
import { buildCmd } from "./
|
|
9
|
-
import { packCmd } from "./
|
|
10
|
-
import { startCmd } from "./
|
|
11
|
-
import { testCmd } from "./
|
|
12
|
-
import { lintCmd } from "./
|
|
13
|
-
import { gendocCmd } from "./
|
|
14
|
-
import { codemodCmd } from "./
|
|
15
|
-
import { storybookCmd } from "./
|
|
16
|
-
import { vitestCmd } from "./
|
|
17
|
-
import { versionCmd } from "./
|
|
7
|
+
import { notifyUpdates } from "./update-notifier.js";
|
|
8
|
+
import { buildCmd } from "./commands/build.js";
|
|
9
|
+
import { packCmd } from "./commands/pack.js";
|
|
10
|
+
import { startCmd } from "./commands/start.js";
|
|
11
|
+
import { testCmd } from "./commands/test.js";
|
|
12
|
+
import { lintCmd } from "./commands/lint.js";
|
|
13
|
+
import { gendocCmd } from "./commands/gendoc.js";
|
|
14
|
+
import { codemodCmd } from "./commands/codemod.js";
|
|
15
|
+
import { storybookCmd } from "./commands/storybook.js";
|
|
16
|
+
import { vitestCmd } from "./commands/vitest.js";
|
|
17
|
+
import { versionCmd } from "./commands/version.js";
|
|
18
|
+
import { tscheckCmd } from "./commands/tscheck.js";
|
|
18
19
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
19
20
|
envConfig();
|
|
20
21
|
process.env.PATH += path.delimiter + path.join(__dirname, "..", "node_modules", ".bin");
|
|
@@ -28,4 +29,5 @@ yargs(hideBin(process.argv)).command(codemodCmd).help().argv;
|
|
|
28
29
|
yargs(hideBin(process.argv)).command(storybookCmd).help().argv;
|
|
29
30
|
yargs(hideBin(process.argv)).command(vitestCmd).help().argv;
|
|
30
31
|
yargs(hideBin(process.argv)).command(versionCmd).help().argv;
|
|
32
|
+
yargs(hideBin(process.argv)).command(tscheckCmd).help().argv;
|
|
31
33
|
notifyUpdates();
|
|
File without changes
|
|
File without changes
|
|
@@ -8,7 +8,7 @@ const isApp = () => fs.existsSync(path.join(process.cwd(), "app"));
|
|
|
8
8
|
const generateDocs = async () => {
|
|
9
9
|
logInfo("Documentation Generation inprogress...");
|
|
10
10
|
const srcPath = path.join(process.cwd(), isApp() ? "app" : "lib");
|
|
11
|
-
await exec(`jsdoc ${srcPath} -r -c ${path.resolve(__dirname, "../
|
|
11
|
+
await exec(`jsdoc ${srcPath} -r -c ${path.resolve(__dirname, "../jsdoc.conf.json")} -d docs`);
|
|
12
12
|
};
|
|
13
13
|
const gendocCmd = {
|
|
14
14
|
handler: async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import yargs from "yargs";
|
|
3
3
|
import { exec, logError, logSuccess } from "./utils.js";
|
|
4
|
-
import { isTypeScriptEnabled } from "../
|
|
4
|
+
import { isTypeScriptEnabled } from "../utils.cjs";
|
|
5
5
|
const { CI = false } = process.env;
|
|
6
6
|
const lintCSS = async (fix = false) => {
|
|
7
7
|
const fixIssues = fix ? "--fix" : "";
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import yargs from "yargs";
|
|
4
4
|
import { exec, logInfo, logError, logSuccess } from "./utils.js";
|
|
5
|
-
import { isTypeScriptEnabled } from "../
|
|
5
|
+
import { isTypeScriptEnabled } from "../utils.cjs";
|
|
6
6
|
import { esBuild } from "../transpile/esbuild.js";
|
|
7
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
const compileTypeScript = async () => {
|
|
File without changes
|
|
File without changes
|
|
@@ -4,17 +4,18 @@ const { CI = false } = process.env;
|
|
|
4
4
|
const test = async (commandOptions) => {
|
|
5
5
|
await exec(`cross-env NODE_ENV=test jest ${commandOptions}`);
|
|
6
6
|
};
|
|
7
|
+
const debugTest = async () => {
|
|
8
|
+
await exec(`node --inspect-brk ./node_modules/jest-cli/bin/jest.js --runInBand --watch`);
|
|
9
|
+
};
|
|
7
10
|
const testCmd = {
|
|
8
11
|
handler: async (argv) => {
|
|
9
|
-
let commandOptions = "--coverage";
|
|
12
|
+
let commandOptions = "--coverage --maxWorkers=50%";
|
|
10
13
|
if (argv.fix)
|
|
11
14
|
commandOptions = "-u";
|
|
12
15
|
else if (argv.watch)
|
|
13
16
|
commandOptions = "--watchAll";
|
|
14
17
|
if (CI)
|
|
15
|
-
commandOptions += " --ci --
|
|
16
|
-
else
|
|
17
|
-
commandOptions += " --maxWorkers=50%";
|
|
18
|
+
commandOptions += " --ci --no-colors";
|
|
18
19
|
if (argv.p)
|
|
19
20
|
commandOptions += " --passWithNoTests";
|
|
20
21
|
if (argv.r)
|
|
@@ -25,7 +26,11 @@ const testCmd = {
|
|
|
25
26
|
if (CI) {
|
|
26
27
|
await exec("rimraf ./reports");
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
if (argv.debug) {
|
|
30
|
+
await debugTest();
|
|
31
|
+
} else {
|
|
32
|
+
await test(commandOptions);
|
|
33
|
+
}
|
|
29
34
|
logSuccess("Unit test execution completed");
|
|
30
35
|
} catch (err) {
|
|
31
36
|
logError("Unit test execution failed", err);
|
|
@@ -45,6 +50,9 @@ const testCmd = {
|
|
|
45
50
|
alias: "w",
|
|
46
51
|
type: "boolean"
|
|
47
52
|
},
|
|
53
|
+
debug: {
|
|
54
|
+
type: "boolean"
|
|
55
|
+
},
|
|
48
56
|
passWithNoTests: {
|
|
49
57
|
alias: "p",
|
|
50
58
|
type: "boolean"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import fs from "node:fs";
|
|
22
|
+
import yargs from "yargs";
|
|
23
|
+
import { exec, logInfo, logError } from "./utils.js";
|
|
24
|
+
const randomChars = () => Math.random().toString(36).slice(2);
|
|
25
|
+
const validateTypescript = async (files = []) => {
|
|
26
|
+
const tsconfigPath = path.join(process.cwd(), "tsconfig.json");
|
|
27
|
+
const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath));
|
|
28
|
+
const tmpTsconfigPath = path.join(process.cwd(), `tsconfig.${randomChars()}.json`);
|
|
29
|
+
const tmpTsconfig = __spreadProps(__spreadValues({}, tsconfig), {
|
|
30
|
+
compilerOptions: __spreadProps(__spreadValues({}, tsconfig.compilerOptions), {
|
|
31
|
+
skipLibCheck: true
|
|
32
|
+
}),
|
|
33
|
+
files,
|
|
34
|
+
include: ["app", "lib"]
|
|
35
|
+
});
|
|
36
|
+
fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2));
|
|
37
|
+
const tscPath = path.resolve(process.cwd(), `./node_modules/.bin/tsc${process.platform === "win32" ? ".cmd" : ""}`);
|
|
38
|
+
try {
|
|
39
|
+
await exec(`${tscPath} -p ${tmpTsconfigPath} --noEmit --emitDeclarationOnly false`);
|
|
40
|
+
} finally {
|
|
41
|
+
fs.unlinkSync(tmpTsconfigPath);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const tscheckCmd = {
|
|
45
|
+
handler: async ({ files }) => {
|
|
46
|
+
try {
|
|
47
|
+
await validateTypescript(files);
|
|
48
|
+
logInfo("Typescript validation completed");
|
|
49
|
+
} catch (err) {
|
|
50
|
+
logError("Typescript validation failed", err);
|
|
51
|
+
yargs().exit(-1, err);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
command: "tscheck [options]",
|
|
55
|
+
describe: "validate typescript file(s)",
|
|
56
|
+
builder: {
|
|
57
|
+
files: {
|
|
58
|
+
type: "array",
|
|
59
|
+
default: []
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
tscheckCmd
|
|
65
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
1
3
|
import yargs from "yargs";
|
|
2
4
|
import { exec, logError, logSuccess } from "./utils.js";
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
3
6
|
const { CI = false } = process.env;
|
|
4
|
-
const configPath =
|
|
7
|
+
const configPath = path.resolve(__dirname, "../testing/vitest.config.js");
|
|
5
8
|
const test = async (commandOptions) => {
|
|
6
9
|
await exec(`cross-env FORCE_COLOR=true vitest --config ${configPath} ${commandOptions}`);
|
|
7
10
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { babelConfig } = require('./babel.config.cjs');
|
|
2
|
+
const {
|
|
3
|
+
esConfig: eslintBaseConfig,
|
|
4
|
+
} = require('./lint-config/eslint/non-react.cjs');
|
|
5
|
+
const {
|
|
6
|
+
esReactConfig: eslintConfig,
|
|
7
|
+
} = require('./lint-config/eslint/react.cjs');
|
|
8
|
+
const { stylelintConfig } = require('./lint-config/stylelint.config.cjs');
|
|
9
|
+
const { prettierConfig } = require('./lint-config/prettier.config.cjs');
|
|
10
|
+
const { commitlintConfig } = require('./lint-config/commitlint.config.cjs');
|
|
11
|
+
const { jestConfig } = require('./testing/jest.config.cjs');
|
|
12
|
+
const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
|
|
13
|
+
const { loadRoutes } = require('./server/app-routes.cjs');
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
babelConfig,
|
|
17
|
+
eslintBaseConfig,
|
|
18
|
+
eslintConfig,
|
|
19
|
+
stylelintConfig,
|
|
20
|
+
prettierConfig,
|
|
21
|
+
commitlintConfig,
|
|
22
|
+
jestConfig,
|
|
23
|
+
jestNodeConfig,
|
|
24
|
+
loadRoutes,
|
|
25
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { babelConfig } from "./babel
|
|
2
|
-
import { esConfig } from "./lint/eslint/non-react.cjs";
|
|
3
|
-
import { esReactConfig } from "./lint/eslint/react.cjs";
|
|
4
|
-
import { stylelintConfig } from "./lint/stylelint.config.cjs";
|
|
5
|
-
import { prettierConfig } from "./lint/prettier.config.cjs";
|
|
6
|
-
import { commitlintConfig } from "./lint/commitlint.config.cjs";
|
|
1
|
+
import { babelConfig } from "./babel.config.cjs";
|
|
2
|
+
import { esConfig } from "./lint-config/eslint/non-react.cjs";
|
|
3
|
+
import { esReactConfig } from "./lint-config/eslint/react.cjs";
|
|
4
|
+
import { stylelintConfig } from "./lint-config/stylelint.config.cjs";
|
|
5
|
+
import { prettierConfig } from "./lint-config/prettier.config.cjs";
|
|
6
|
+
import { commitlintConfig } from "./lint-config/commitlint.config.cjs";
|
|
7
7
|
import { jestConfig } from "./testing/jest.config.cjs";
|
|
8
8
|
import { jestNodeConfig } from "./testing/jest.node.config.cjs";
|
|
9
|
-
import { lintStagedConfig } from "./lint/lint-staged.config.js";
|
|
10
|
-
import { loadRoutes } from "./server/
|
|
9
|
+
import { lintStagedConfig } from "./lint-config/lint-staged.config.js";
|
|
10
|
+
import { loadRoutes } from "./server/app-routes.cjs";
|
|
11
11
|
export {
|
|
12
12
|
babelConfig,
|
|
13
13
|
commitlintConfig,
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.commitlintConfig = { extends: ['@commitlint/config-conventional'] };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
const prettierOptions = require('../prettier.config.cjs');
|
|
3
|
+
// const webpackConfig = require('../../webpack/webpack.prod.babel');
|
|
4
|
+
|
|
5
|
+
exports.baseExtends = [
|
|
6
|
+
'plugin:eslint-comments/recommended',
|
|
7
|
+
'plugin:import/recommended',
|
|
8
|
+
'plugin:prettier/recommended',
|
|
9
|
+
'plugin:jest/recommended',
|
|
10
|
+
'plugin:jsdoc/recommended',
|
|
11
|
+
'plugin:wdio/recommended',
|
|
12
|
+
'plugin:testing-library/dom',
|
|
13
|
+
'plugin:storybook/recommended',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const basePlugins = ['testing-library', 'jest', 'jsdoc', 'wdio', 'import'];
|
|
17
|
+
exports.basePlugins = basePlugins;
|
|
18
|
+
|
|
19
|
+
exports.baseOverrides = [
|
|
20
|
+
{
|
|
21
|
+
files: ['*.func.spec.js', '*.visual.spec.js'],
|
|
22
|
+
rules: {
|
|
23
|
+
'jest/valid-expect': 'off',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const baseRules = {
|
|
29
|
+
'prettier/prettier': ['error', prettierOptions],
|
|
30
|
+
'arrow-body-style': [2, 'as-needed'],
|
|
31
|
+
'class-methods-use-this': 0,
|
|
32
|
+
'import/imports-first': 0,
|
|
33
|
+
'import/newline-after-import': 0,
|
|
34
|
+
'import/no-dynamic-require': 0,
|
|
35
|
+
'import/no-extraneous-dependencies': 0,
|
|
36
|
+
'import/no-named-as-default': 0,
|
|
37
|
+
'import/no-unresolved': [
|
|
38
|
+
2,
|
|
39
|
+
{ caseSensitive: true, caseSensitiveStrict: true },
|
|
40
|
+
], // Tip: https://github.com/import-js/eslint-plugin-import/issues/1868
|
|
41
|
+
'import/no-webpack-loader-syntax': 0,
|
|
42
|
+
'import/prefer-default-export': 0,
|
|
43
|
+
'import/extensions': [
|
|
44
|
+
2,
|
|
45
|
+
'never',
|
|
46
|
+
{
|
|
47
|
+
json: 'ignorePackages',
|
|
48
|
+
js: 'ignorePackages',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
indent: [
|
|
52
|
+
2,
|
|
53
|
+
2,
|
|
54
|
+
{
|
|
55
|
+
SwitchCase: 1,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'max-lines': ['error', { max: 120, skipComments: true }],
|
|
59
|
+
complexity: ['error', { max: 10 }],
|
|
60
|
+
'max-depth': ['error', { max: 4 }],
|
|
61
|
+
'max-lines-per-function': 0,
|
|
62
|
+
'max-nested-callbacks': ['error', { max: 3 }],
|
|
63
|
+
'max-params': ['error', { max: 3 }],
|
|
64
|
+
'max-statements': ['error', { max: 20 }],
|
|
65
|
+
'max-len': 0,
|
|
66
|
+
'newline-per-chained-call': 0,
|
|
67
|
+
'no-confusing-arrow': 0,
|
|
68
|
+
'no-console': 1,
|
|
69
|
+
'no-param-reassign': ['error', { props: false }],
|
|
70
|
+
'no-unused-vars': 2,
|
|
71
|
+
'no-use-before-define': 0,
|
|
72
|
+
'prefer-template': 2,
|
|
73
|
+
'require-yield': 0,
|
|
74
|
+
'jsdoc/require-jsdoc': 0,
|
|
75
|
+
'eslint-comments/disable-enable-pair': 0,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.baseRules = baseRules;
|
|
79
|
+
|
|
80
|
+
const reactRules = {
|
|
81
|
+
'jsx-a11y/aria-props': 2,
|
|
82
|
+
'jsx-a11y/heading-has-content': 0,
|
|
83
|
+
'jsx-a11y/label-has-associated-control': [
|
|
84
|
+
2,
|
|
85
|
+
{
|
|
86
|
+
// NOTE: If this error triggers, either disable it or add
|
|
87
|
+
// your custom components, labels and attributes via these options
|
|
88
|
+
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
|
|
89
|
+
controlComponents: ['Input'],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
'jsx-a11y/label-has-for': 0,
|
|
93
|
+
'jsx-a11y/mouse-events-have-key-events': 2,
|
|
94
|
+
'jsx-a11y/role-has-required-aria-props': 2,
|
|
95
|
+
'jsx-a11y/role-supports-aria-props': 2,
|
|
96
|
+
'react/destructuring-assignment': 0,
|
|
97
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
98
|
+
'react/jsx-closing-tag-location': 0,
|
|
99
|
+
'react/forbid-prop-types': 0,
|
|
100
|
+
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
|
101
|
+
'react/jsx-no-target-blank': 0,
|
|
102
|
+
'react/jsx-props-no-spreading': 0,
|
|
103
|
+
'react/jsx-uses-vars': 2,
|
|
104
|
+
'react/require-default-props': 0,
|
|
105
|
+
'react/require-extension': 0,
|
|
106
|
+
'react/self-closing-comp': 0,
|
|
107
|
+
'react/sort-comp': 0,
|
|
108
|
+
'react/react-in-jsx-scope': 0,
|
|
109
|
+
'react/jsx-filename-extension': [
|
|
110
|
+
1,
|
|
111
|
+
{ extensions: ['.js', '.jsx', '.tsx', '.mdx'] },
|
|
112
|
+
],
|
|
113
|
+
'react/function-component-definition': [
|
|
114
|
+
2,
|
|
115
|
+
{ namedComponents: 'arrow-function' },
|
|
116
|
+
],
|
|
117
|
+
'redux-saga/no-yield-in-race': 2,
|
|
118
|
+
'redux-saga/yield-effects': 2,
|
|
119
|
+
};
|
|
120
|
+
exports.reactRules = reactRules;
|
|
121
|
+
|
|
122
|
+
exports.baseConfig = {
|
|
123
|
+
parser: '@babel/eslint-parser',
|
|
124
|
+
plugins: basePlugins,
|
|
125
|
+
env: {
|
|
126
|
+
jest: true,
|
|
127
|
+
browser: true,
|
|
128
|
+
node: true,
|
|
129
|
+
es2021: true,
|
|
130
|
+
},
|
|
131
|
+
parserOptions: {
|
|
132
|
+
sourceType: 'module',
|
|
133
|
+
ecmaFeatures: {
|
|
134
|
+
jsx: true,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
settings: {
|
|
138
|
+
react: {
|
|
139
|
+
version: 'detect',
|
|
140
|
+
},
|
|
141
|
+
jest: {
|
|
142
|
+
version: 28,
|
|
143
|
+
},
|
|
144
|
+
'import/resolver': {
|
|
145
|
+
node: {
|
|
146
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
ignorePatterns: [
|
|
151
|
+
'/build/**/*',
|
|
152
|
+
'/dist/**/*',
|
|
153
|
+
'/reports/**/*',
|
|
154
|
+
'/coverage/**/*',
|
|
155
|
+
'/demo/**/*',
|
|
156
|
+
'/docs/**/*',
|
|
157
|
+
'/temp/**/*',
|
|
158
|
+
'**/vendor/*.js',
|
|
159
|
+
],
|
|
160
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const {
|
|
2
|
+
baseExtends,
|
|
3
|
+
baseRules,
|
|
4
|
+
baseOverrides,
|
|
5
|
+
baseConfig,
|
|
6
|
+
} = require('./common.cjs');
|
|
7
|
+
const { tsConfig } = require('./typescript/non-react.cjs');
|
|
8
|
+
|
|
9
|
+
exports.esConfig = {
|
|
10
|
+
...baseConfig,
|
|
11
|
+
extends: ['airbnb-base'].concat(baseExtends),
|
|
12
|
+
rules: baseRules,
|
|
13
|
+
overrides: baseOverrides.concat([tsConfig]),
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const {
|
|
2
|
+
baseExtends,
|
|
3
|
+
baseRules,
|
|
4
|
+
baseOverrides,
|
|
5
|
+
baseConfig,
|
|
6
|
+
reactRules,
|
|
7
|
+
} = require('./common.cjs');
|
|
8
|
+
const { tsReactConfig } = require('./typescript/react.cjs');
|
|
9
|
+
|
|
10
|
+
exports.esReactConfig = {
|
|
11
|
+
...baseConfig,
|
|
12
|
+
extends: ['airbnb', 'airbnb/hooks', 'plugin:redux-saga/recommended'].concat(
|
|
13
|
+
baseExtends,
|
|
14
|
+
),
|
|
15
|
+
rules: {
|
|
16
|
+
...baseRules,
|
|
17
|
+
...reactRules,
|
|
18
|
+
},
|
|
19
|
+
overrides: baseOverrides.concat([
|
|
20
|
+
tsReactConfig,
|
|
21
|
+
{
|
|
22
|
+
files: '*.mdx',
|
|
23
|
+
extends: 'plugin:mdx/recommended',
|
|
24
|
+
},
|
|
25
|
+
]),
|
|
26
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const { baseExtends, basePlugins } = require('../common.cjs');
|
|
2
|
+
|
|
3
|
+
exports.tsBaseExtends = [
|
|
4
|
+
'plugin:@typescript-eslint/recommended',
|
|
5
|
+
'plugin:import/typescript',
|
|
6
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
7
|
+
].concat(baseExtends);
|
|
8
|
+
|
|
9
|
+
exports.tsBaseRules = {
|
|
10
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
11
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
12
|
+
'@typescript-eslint/no-use-before-define': [
|
|
13
|
+
'error',
|
|
14
|
+
{ functions: false, classes: true, variables: true, typedefs: true },
|
|
15
|
+
],
|
|
16
|
+
'max-lines': ['error', { max: 200, skipComments: true }],
|
|
17
|
+
'@typescript-eslint/unbound-method': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
ignoreStatic: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.tsBaseConfig = {
|
|
26
|
+
files: ['*.ts', '*.tsx'],
|
|
27
|
+
parser: '@typescript-eslint/parser',
|
|
28
|
+
plugins: ['@typescript-eslint'].concat(basePlugins),
|
|
29
|
+
parserOptions: {
|
|
30
|
+
tsconfigRootDir: process.cwd(),
|
|
31
|
+
project: 'tsconfig.json',
|
|
32
|
+
},
|
|
33
|
+
settings: {
|
|
34
|
+
'import/resolver': {
|
|
35
|
+
typescript: {
|
|
36
|
+
alwaysTryTypes: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
'import/parsers': {
|
|
40
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
const { baseRules } = require('../common.cjs');
|
|
3
|
+
const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
exports.tsConfig = {
|
|
6
|
+
...tsBaseConfig,
|
|
7
|
+
extends: ['airbnb-base', 'airbnb-typescript/base'].concat(tsBaseExtends),
|
|
8
|
+
rules: {
|
|
9
|
+
...baseRules,
|
|
10
|
+
...tsBaseRules,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
const { baseRules, reactRules } = require('../common.cjs');
|
|
3
|
+
const { tsBaseExtends, tsBaseRules, tsBaseConfig } = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
exports.tsReactConfig = {
|
|
6
|
+
...tsBaseConfig,
|
|
7
|
+
extends: [
|
|
8
|
+
'airbnb',
|
|
9
|
+
'airbnb/hooks',
|
|
10
|
+
'plugin:redux-saga/recommended',
|
|
11
|
+
'airbnb-typescript',
|
|
12
|
+
].concat(tsBaseExtends),
|
|
13
|
+
rules: {
|
|
14
|
+
...baseRules,
|
|
15
|
+
...tsBaseRules,
|
|
16
|
+
...reactRules,
|
|
17
|
+
'react/prop-types': 0,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
2
|
import fs from "node:fs";
|
|
4
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
3
|
const npmClient = fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml")) ? "pnpm" : "npm";
|
|
6
4
|
const lintStagedConfig = {
|
|
7
5
|
"*.{js,ts,jsx,tsx,md,mdx,html,css,json}": ["prettier --write"],
|
|
8
|
-
"*.{ts,tsx}": [
|
|
9
|
-
`node ${path.resolve(__dirname, "../typescript/tsc-files/index.js")} --noEmit --emitDeclarationOnly false`
|
|
10
|
-
],
|
|
6
|
+
"*.{ts,tsx}": [`${npmClient} run tscheck`],
|
|
11
7
|
"*.{js,ts,jsx,tsx}": [
|
|
12
8
|
`${npmClient} run lint:fix`,
|
|
13
9
|
`${npmClient} run test:staged`,
|