@elliemae/pui-cli 9.0.0-next.14 → 9.0.0-next.15
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/commands/lint.js +26 -7
- package/dist/cjs/commands/utils.js +3 -1
- package/dist/cjs/lint-config/eslint/common.cjs +3 -2
- package/dist/cjs/lint-config/eslint/typescript/common.cjs +3 -3
- package/dist/cjs/lint-config/stylelint.config.cjs +14 -13
- package/dist/cjs/monorepo/delete-merged-tags.js +1 -1
- package/dist/cjs/monorepo/set-registry-version.js +1 -1
- package/dist/cjs/monorepo/set-workspace-version.js +1 -1
- package/dist/cjs/server/csp.js +1 -1
- package/dist/cjs/server/utils.js +2 -2
- package/dist/cjs/testing/jest.config.cjs +2 -0
- package/dist/cjs/testing/setup-tests.js +22 -1
- package/dist/cjs/transpile/esbuild.js +1 -1
- package/dist/cjs/update-notifier.js +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/cjs/webpack/helpers.js +6 -6
- package/dist/cjs/webpack/webpack.base.babel.js +4 -4
- package/dist/cjs/webpack/webpack.dev.babel.js +1 -1
- package/dist/cjs/webpack/webpack.lib.base.babel.js +4 -4
- package/dist/cjs/webpack/webpack.lib.dev.babel.js +1 -1
- package/dist/cjs/webpack/webpack.storybook.js +2 -2
- package/dist/esm/commands/lint.js +27 -7
- package/dist/esm/commands/utils.js +3 -1
- package/dist/esm/lint-config/eslint/common.cjs +3 -2
- package/dist/esm/lint-config/eslint/typescript/common.cjs +3 -3
- package/dist/esm/lint-config/stylelint.config.cjs +14 -13
- package/dist/esm/monorepo/delete-merged-tags.js +1 -1
- package/dist/esm/monorepo/set-registry-version.js +1 -1
- package/dist/esm/monorepo/set-workspace-version.js +1 -1
- package/dist/esm/server/csp.js +1 -1
- package/dist/esm/server/utils.js +2 -2
- package/dist/esm/testing/jest.config.cjs +2 -0
- package/dist/esm/testing/setup-tests.js +22 -1
- package/dist/esm/transpile/esbuild.js +1 -1
- package/dist/esm/update-notifier.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/webpack/helpers.js +6 -6
- package/dist/esm/webpack/webpack.base.babel.js +4 -4
- package/dist/esm/webpack/webpack.dev.babel.js +1 -1
- package/dist/esm/webpack/webpack.lib.base.babel.js +4 -4
- package/dist/esm/webpack/webpack.lib.dev.babel.js +1 -1
- package/dist/esm/webpack/webpack.storybook.js +2 -2
- package/dist/types/commands/build.d.ts +2 -2
- package/dist/types/commands/codemod.d.ts +2 -2
- package/dist/types/commands/lint.d.ts +3 -2
- package/dist/types/commands/pack.d.ts +2 -2
- package/dist/types/commands/start.d.ts +2 -2
- package/dist/types/commands/storybook.d.ts +2 -2
- package/dist/types/commands/test.d.ts +2 -2
- package/dist/types/commands/tscheck.d.ts +2 -2
- package/dist/types/commands/utils.d.ts +1 -0
- package/dist/types/commands/version.d.ts +2 -2
- package/dist/types/commands/vitest.d.ts +2 -2
- package/dist/types/lint-config/eslint/common.d.cts +8 -2
- package/dist/types/lint-config/eslint/non-react.d.cts +8 -1
- package/dist/types/lint-config/eslint/react.d.cts +8 -1
- package/dist/types/lint-config/eslint/typescript/common.d.cts +1 -1
- package/dist/types/lint-config/eslint/typescript/non-react.d.cts +9 -2
- package/dist/types/lint-config/eslint/typescript/react.d.cts +9 -2
- package/dist/types/lint-config/lint-staged.config.d.ts +3 -3
- package/dist/types/lint-config/stylelint.config.d.cts +2 -2
- package/dist/types/server/csp.d.ts +2 -2
- package/dist/types/testing/jest.config.d.cts +2 -0
- package/dist/types/testing/jest.node.config.d.cts +2 -0
- package/dist/types/webpack/helpers.d.ts +1 -1
- package/package.json +74 -74
|
@@ -32,10 +32,19 @@ __export(lint_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(lint_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
+
var import_node_util = require("node:util");
|
|
35
36
|
var import_yargs = __toESM(require("yargs"), 1);
|
|
36
37
|
var import_utils = require("./utils.js");
|
|
37
|
-
const lintCSS = async (
|
|
38
|
-
const fixIssues = fix ? "--fix" : "";
|
|
38
|
+
const lintCSS = async (args) => {
|
|
39
|
+
const fixIssues = args.fix ? "--fix" : "";
|
|
40
|
+
if (args.debug) {
|
|
41
|
+
const configPath = import_node_path.default.join(process.cwd(), "stylelint.config.cjs");
|
|
42
|
+
const config = await import(configPath);
|
|
43
|
+
(0, import_utils.logInfo)("stylelint version:");
|
|
44
|
+
await (0, import_utils.exec)(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
|
|
45
|
+
(0, import_utils.logInfo)("stylelint config:");
|
|
46
|
+
(0, import_utils.logInfo)((0, import_node_util.inspect)(config, { depth: null }));
|
|
47
|
+
}
|
|
39
48
|
await (0, import_utils.exec)(
|
|
40
49
|
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} --allow-empty-input --config ${import_node_path.default.join(
|
|
41
50
|
process.cwd(),
|
|
@@ -43,10 +52,11 @@ const lintCSS = async (fix = false) => {
|
|
|
43
52
|
)}`
|
|
44
53
|
);
|
|
45
54
|
};
|
|
46
|
-
const lintJS = async (
|
|
47
|
-
const fixIssues = fix ? "--fix" : "";
|
|
55
|
+
const lintJS = async (args) => {
|
|
56
|
+
const fixIssues = args.fix ? "--fix" : "";
|
|
57
|
+
const debugFlags = args.debug ? "--env-info --debug" : "";
|
|
48
58
|
await (0, import_utils.exec)(
|
|
49
|
-
`eslint ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} ${fixIssues}
|
|
59
|
+
`eslint ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} ${fixIssues} ${debugFlags} .`
|
|
50
60
|
);
|
|
51
61
|
};
|
|
52
62
|
const cmdArgs = {
|
|
@@ -64,6 +74,11 @@ const cmdArgs = {
|
|
|
64
74
|
boolean: true,
|
|
65
75
|
alias: "fix",
|
|
66
76
|
default: false
|
|
77
|
+
},
|
|
78
|
+
debug: {
|
|
79
|
+
boolean: true,
|
|
80
|
+
alias: "debug",
|
|
81
|
+
default: false
|
|
67
82
|
}
|
|
68
83
|
};
|
|
69
84
|
const lintCmd = {
|
|
@@ -73,10 +88,12 @@ const lintCmd = {
|
|
|
73
88
|
await (0, import_utils.exec)("tsc --noEmit --emitDeclarationOnly false");
|
|
74
89
|
try {
|
|
75
90
|
await (0, import_utils.exec)("rimraf ./reports/eslint.json");
|
|
76
|
-
await lintJS(argv
|
|
91
|
+
await lintJS({ ...argv });
|
|
77
92
|
(0, import_utils.logSuccess)("JS linting completed");
|
|
78
93
|
} catch (err) {
|
|
79
94
|
(0, import_utils.logError)("JS linting failed");
|
|
95
|
+
if (argv.debug)
|
|
96
|
+
(0, import_utils.logError)(err);
|
|
80
97
|
(0, import_yargs.default)().exit(-1, err);
|
|
81
98
|
return;
|
|
82
99
|
}
|
|
@@ -84,10 +101,12 @@ const lintCmd = {
|
|
|
84
101
|
if (argv.css) {
|
|
85
102
|
try {
|
|
86
103
|
await (0, import_utils.exec)("rimraf ./reports/stylelint.json");
|
|
87
|
-
await lintCSS(argv
|
|
104
|
+
await lintCSS({ ...argv });
|
|
88
105
|
(0, import_utils.logSuccess)("CSS linting completed");
|
|
89
106
|
} catch (err) {
|
|
90
107
|
(0, import_utils.logError)("CSS linting failed");
|
|
108
|
+
if (argv.debug)
|
|
109
|
+
(0, import_utils.logError)(err);
|
|
91
110
|
(0, import_yargs.default)().exit(-1, err);
|
|
92
111
|
}
|
|
93
112
|
}
|
|
@@ -37,6 +37,7 @@ __export(utils_exports, {
|
|
|
37
37
|
logError: () => logError,
|
|
38
38
|
logInfo: () => logInfo,
|
|
39
39
|
logSuccess: () => logSuccess,
|
|
40
|
+
logWarning: () => logWarning,
|
|
40
41
|
writeAppInfo: () => writeAppInfo
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(utils_exports);
|
|
@@ -61,6 +62,7 @@ const browsersMapping = {
|
|
|
61
62
|
};
|
|
62
63
|
const exec = async (command, options = { stdio: "inherit" }) => (0, import_execa.execaCommand)(command, options);
|
|
63
64
|
const logInfo = console.log;
|
|
65
|
+
const logWarning = (...args) => console.log(import_chalk.default.yellow(...args));
|
|
64
66
|
const logSuccess = (...args) => console.log(import_chalk.default.green(...args));
|
|
65
67
|
const logError = console.error;
|
|
66
68
|
const readPackageLock = async () => {
|
|
@@ -82,7 +84,7 @@ const getSupportedBrowsers = async () => {
|
|
|
82
84
|
return browserVersions.reduce((acc, nameVersion) => {
|
|
83
85
|
const [name, version] = nameVersion.split(" ");
|
|
84
86
|
const versionRange = version.split("-");
|
|
85
|
-
acc[browsersMapping[name]] = versionRange
|
|
87
|
+
acc[browsersMapping[name]] = versionRange?.[0] ?? version;
|
|
86
88
|
return acc;
|
|
87
89
|
}, {});
|
|
88
90
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
const
|
|
2
|
+
const { prettierConfig } = require("../prettier.config.cjs");
|
|
3
3
|
// const webpackConfig = require('../../webpack/webpack.prod.babel');
|
|
4
4
|
|
|
5
5
|
exports.baseExtends = [
|
|
@@ -26,7 +26,7 @@ exports.baseOverrides = [
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
const baseRules = {
|
|
29
|
-
"prettier/prettier": ["error",
|
|
29
|
+
"prettier/prettier": ["error", prettierConfig],
|
|
30
30
|
"arrow-body-style": [2, "as-needed"],
|
|
31
31
|
"class-methods-use-this": 0,
|
|
32
32
|
"import/imports-first": 0,
|
|
@@ -152,6 +152,7 @@ exports.baseConfig = {
|
|
|
152
152
|
},
|
|
153
153
|
ignorePatterns: [
|
|
154
154
|
"/build/**/*",
|
|
155
|
+
"/node_modules/**/*",
|
|
155
156
|
"/dist/**/*",
|
|
156
157
|
"/reports/**/*",
|
|
157
158
|
"/coverage/**/*",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { baseExtends, basePlugins } = require('../common.cjs');
|
|
2
2
|
|
|
3
3
|
exports.tsBaseExtends = [
|
|
4
|
-
'plugin:@typescript-eslint/recommended',
|
|
5
4
|
'plugin:import/typescript',
|
|
6
|
-
'plugin:@typescript-eslint/recommended-
|
|
5
|
+
'plugin:@typescript-eslint/recommended-type-checked',
|
|
6
|
+
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
7
7
|
].concat(baseExtends);
|
|
8
8
|
|
|
9
9
|
exports.tsBaseRules = {
|
|
@@ -34,7 +34,7 @@ exports.tsBaseConfig = {
|
|
|
34
34
|
plugins: ['@typescript-eslint'].concat(basePlugins),
|
|
35
35
|
parserOptions: {
|
|
36
36
|
tsconfigRootDir: process.cwd(),
|
|
37
|
-
project:
|
|
37
|
+
project: true,
|
|
38
38
|
},
|
|
39
39
|
settings: {
|
|
40
40
|
'import/resolver': {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
exports.stylelintConfig = {
|
|
2
2
|
ignoreFiles: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
"/dist/**/*",
|
|
4
|
+
"/coverage/**/*",
|
|
5
|
+
"/build/**/*",
|
|
6
|
+
"/reports/**/*",
|
|
7
|
+
"/temp/**/*",
|
|
8
|
+
"/docs/**/*",
|
|
9
|
+
"/demo/**/*",
|
|
10
|
+
"/node_modules/**/*",
|
|
11
|
+
"/vendor/**/*",
|
|
12
12
|
],
|
|
13
|
-
customSyntax:
|
|
13
|
+
customSyntax: "@stylelint/postcss-css-in-js",
|
|
14
|
+
// customSyntax: "postcss-styled-components", // '@stylelint/postcss-css-in-js' is deprecated, this may be a replacement?
|
|
14
15
|
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
"stylelint-config-recommended",
|
|
17
|
+
"stylelint-config-styled-components",
|
|
17
18
|
],
|
|
18
|
-
rules: {
|
|
19
|
+
rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
|
|
19
20
|
};
|
|
@@ -26,7 +26,7 @@ const cwd = process.cwd();
|
|
|
26
26
|
const execaOptions = { cwd, stdio: "inherit" };
|
|
27
27
|
const semVerRegEx = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
28
28
|
const isSemVersion = (tagName) => semVerRegEx.test(tagName);
|
|
29
|
-
const branchName = (process.env.BRANCH_NAME
|
|
29
|
+
const branchName = (process.env.BRANCH_NAME ?? "master").toLowerCase();
|
|
30
30
|
const branchTags = {
|
|
31
31
|
master: /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,
|
|
32
32
|
next: /^v.*-next\.(0|[1-9]\d*)/,
|
|
@@ -35,7 +35,7 @@ var import_promises = require("node:fs/promises");
|
|
|
35
35
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
36
36
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
37
37
|
var import_utils = require("./utils.js");
|
|
38
|
-
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)()
|
|
38
|
+
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() ?? "");
|
|
39
39
|
const setRegistryVersion = async () => {
|
|
40
40
|
const files = await (0, import_fast_glob.default)([
|
|
41
41
|
`${monorepoRoot}/libs/*/package.json`,
|
|
@@ -35,7 +35,7 @@ var import_promises = require("node:fs/promises");
|
|
|
35
35
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
36
36
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
37
37
|
var import_utils = require("./utils.js");
|
|
38
|
-
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)()
|
|
38
|
+
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() ?? "");
|
|
39
39
|
const setWorkspaceVersion = async () => {
|
|
40
40
|
const files = await (0, import_fast_glob.default)([
|
|
41
41
|
`${monorepoRoot}/libs/*/package.json`,
|
package/dist/cjs/server/csp.js
CHANGED
|
@@ -34,9 +34,9 @@ __export(csp_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(csp_exports);
|
|
35
35
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
36
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
37
|
+
var import_crypto = __toESM(require("crypto"), 1);
|
|
37
38
|
var import_express = __toESM(require("express"), 1);
|
|
38
39
|
var import_helmet_csp = __toESM(require("helmet-csp"), 1);
|
|
39
|
-
var import_crypto = __toESM(require("crypto"), 1);
|
|
40
40
|
const CSP_REPORT_URI = "/diagnostics/v1/csp";
|
|
41
41
|
const sources = [
|
|
42
42
|
"'self'",
|
package/dist/cjs/server/utils.js
CHANGED
|
@@ -37,7 +37,7 @@ var import_minimist = __toESM(require("minimist"), 1);
|
|
|
37
37
|
const argv = (0, import_minimist.default)(process.argv.slice(2));
|
|
38
38
|
const getCWD = () => process.cwd();
|
|
39
39
|
const port = parseInt(
|
|
40
|
-
argv.port
|
|
40
|
+
argv.port ?? process.env.port ?? process.env.PORT ?? "3000",
|
|
41
41
|
10
|
|
42
42
|
);
|
|
43
|
-
const host = argv.host
|
|
43
|
+
const host = argv.host ?? process.env.HOST ?? "localhost";
|
|
@@ -57,6 +57,8 @@ const jestConfig = {
|
|
|
57
57
|
coverageReporters: ['lcov', 'html', 'text-summary'],
|
|
58
58
|
moduleDirectories: ['node_modules', 'app', 'lib'],
|
|
59
59
|
moduleNameMapper: {
|
|
60
|
+
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
|
|
61
|
+
'^d3-(.*)$': '<rootDir>/node_modules/d3-$1/dist/d3-$1.min.js',
|
|
60
62
|
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
|
|
61
63
|
'.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
|
|
62
64
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
@@ -21,7 +21,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
|
-
var import_stable = require("core-js/stable");
|
|
25
24
|
var import_runtime = require("regenerator-runtime/runtime");
|
|
26
25
|
var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
|
|
27
26
|
var import_jest_axe = __toESM(require("jest-axe"), 1);
|
|
@@ -72,3 +71,25 @@ window.emui = {
|
|
|
72
71
|
logger: (0, import_pui_diagnostics.logger)(),
|
|
73
72
|
_BASE_PATH: new URL(document.baseURI).pathname
|
|
74
73
|
};
|
|
74
|
+
let showCorejsWarn = false;
|
|
75
|
+
afterAll(() => {
|
|
76
|
+
if (showCorejsWarn) {
|
|
77
|
+
console.warn(
|
|
78
|
+
`IMPORTANT: Try importing core-js/stable in your failed test files and retrying.
|
|
79
|
+
Some tests might have failed because of it`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const originalTest = global.test;
|
|
84
|
+
global.it = (name, fn, timeout = void 0) => {
|
|
85
|
+
const fnWrapper = async () => {
|
|
86
|
+
try {
|
|
87
|
+
await fn();
|
|
88
|
+
} catch (error) {
|
|
89
|
+
showCorejsWarn = true;
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
originalTest(name, fnWrapper, timeout);
|
|
94
|
+
};
|
|
95
|
+
global.it.skip = originalTest.skip;
|
|
@@ -34,9 +34,9 @@ __export(esbuild_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(esbuild_exports);
|
|
35
35
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
36
|
var import_node_url = require("node:url");
|
|
37
|
+
var import_promises = require("node:fs/promises");
|
|
37
38
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
38
39
|
var import_esbuild = require("esbuild");
|
|
39
|
-
var import_promises = require("node:fs/promises");
|
|
40
40
|
var import_browserslist_to_esbuild = __toESM(require("browserslist-to-esbuild"), 1);
|
|
41
41
|
var import_esbuild_plugin_lodash = __toESM(require("esbuild-plugin-lodash"), 1);
|
|
42
42
|
const import_meta = {};
|
|
@@ -31,9 +31,9 @@ __export(update_notifier_exports, {
|
|
|
31
31
|
notifyUpdates: () => notifyUpdates
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(update_notifier_exports);
|
|
34
|
-
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
35
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
35
|
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
36
|
+
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
37
37
|
const notifyUpdates = async () => {
|
|
38
38
|
const pkgFile = await import_promises.default.readFile(import_node_path.default.join(process.cwd(), "./package.json"));
|
|
39
39
|
const pkg = JSON.parse(pkgFile);
|
package/dist/cjs/utils.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(utils_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(utils_exports);
|
|
36
36
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
37
37
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
38
|
-
const basePath = (process.env.BASE_PATH
|
|
38
|
+
const basePath = (process.env.BASE_PATH ?? "/").replace(/\/?$/, "/");
|
|
39
39
|
const isApp = () => import_node_fs.default.existsSync(import_node_path.default.join(process.cwd(), "app"));
|
|
40
40
|
const getAppConfig = () => {
|
|
41
41
|
const appConfigPath = import_node_path.default.join(
|
|
@@ -48,9 +48,9 @@ __export(helpers_exports, {
|
|
|
48
48
|
module.exports = __toCommonJS(helpers_exports);
|
|
49
49
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
50
50
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
51
|
+
var import_zlib = __toESM(require("zlib"), 1);
|
|
51
52
|
var import_lodash = __toESM(require("lodash"), 1);
|
|
52
53
|
var import_compression_webpack_plugin = __toESM(require("compression-webpack-plugin"), 1);
|
|
53
|
-
var import_zlib = __toESM(require("zlib"), 1);
|
|
54
54
|
var import_utils = require("../monorepo/utils.js");
|
|
55
55
|
var import_utils2 = require("../utils.js");
|
|
56
56
|
let pathSep = import_node_path.default.sep;
|
|
@@ -64,8 +64,8 @@ const excludeNodeModulesExcept = (modules) => {
|
|
|
64
64
|
const moduleRegExps = getNodeModulesRegEx(modules);
|
|
65
65
|
return function(modulePath) {
|
|
66
66
|
if (/node_modules/.test(modulePath)) {
|
|
67
|
-
for (
|
|
68
|
-
if (
|
|
67
|
+
for (const moduleRegExp of moduleRegExps)
|
|
68
|
+
if (moduleRegExp.test(modulePath))
|
|
69
69
|
return false;
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
@@ -80,7 +80,7 @@ const getLibraryName = () => {
|
|
|
80
80
|
const modifiedLibName = `emui-${libraryName.replace("@elliemae/", "").replace("pui-", "")}`;
|
|
81
81
|
return import_lodash.default.camelCase(modifiedLibName);
|
|
82
82
|
};
|
|
83
|
-
const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME
|
|
83
|
+
const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME ?? getLibraryName()).split(".");
|
|
84
84
|
const mapToFolder = (dependencies, folder) => dependencies.reduce(
|
|
85
85
|
(acc, dependency) => ({
|
|
86
86
|
[dependency]: import_node_path.default.resolve(`${folder}/${dependency.replace("$", "")}`),
|
|
@@ -89,7 +89,7 @@ const mapToFolder = (dependencies, folder) => dependencies.reduce(
|
|
|
89
89
|
{}
|
|
90
90
|
);
|
|
91
91
|
const getAlias = () => {
|
|
92
|
-
const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd())
|
|
92
|
+
const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd()) ?? "";
|
|
93
93
|
return mapToFolder(
|
|
94
94
|
[
|
|
95
95
|
"@babel/runtime",
|
|
@@ -173,7 +173,7 @@ const getAppVersion = () => {
|
|
|
173
173
|
if (!process.env.APP_VERSION)
|
|
174
174
|
return LATEST_VERSION;
|
|
175
175
|
const match = process.env.APP_VERSION.match(/^v?(\d+\.\d+)\..*$/);
|
|
176
|
-
return match
|
|
176
|
+
return match?.[1] ?? LATEST_VERSION;
|
|
177
177
|
};
|
|
178
178
|
const getPaths = (latestVersion = true) => {
|
|
179
179
|
const version = latestVersion ? LATEST_VERSION : getAppVersion();
|
|
@@ -284,7 +284,7 @@ const baseConfig = (options) => ({
|
|
|
284
284
|
mainFields: ["browser", "module", "main"],
|
|
285
285
|
alias: {
|
|
286
286
|
...(0, import_helpers.getAlias)(),
|
|
287
|
-
...
|
|
287
|
+
...options.resolve?.alias ?? {}
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
290
|
externalsPresets: {
|
|
@@ -314,7 +314,7 @@ const baseConfig = (options) => ({
|
|
|
314
314
|
"styled-system": "emuiAppReactDependencies.styledSystem"
|
|
315
315
|
// "@xstyled/styled-components": "emuiAppReactDependencies.xstyled",
|
|
316
316
|
},
|
|
317
|
-
devtool: options.devtool
|
|
318
|
-
performance: options.performance
|
|
319
|
-
devServer: options.devServer
|
|
317
|
+
devtool: options.devtool ?? "eval-source-map",
|
|
318
|
+
performance: options.performance ?? {},
|
|
319
|
+
devServer: options.devServer ?? {}
|
|
320
320
|
});
|
|
@@ -144,7 +144,7 @@ const devConfig = {
|
|
|
144
144
|
},
|
|
145
145
|
hot: true,
|
|
146
146
|
open: [basePath],
|
|
147
|
-
port: process.env.PORT
|
|
147
|
+
port: process.env.PORT ?? "auto",
|
|
148
148
|
setupMiddlewares: (middlewares, devServer) => {
|
|
149
149
|
if (devServer.app) {
|
|
150
150
|
(0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
|
|
@@ -212,7 +212,7 @@ const baseConfig = (options) => ({
|
|
|
212
212
|
mainFields: ["browser", "module", "main"],
|
|
213
213
|
alias: {
|
|
214
214
|
...(0, import_helpers.getAlias)(),
|
|
215
|
-
...
|
|
215
|
+
...options.resolve?.alias ?? {}
|
|
216
216
|
},
|
|
217
217
|
plugins: [new import_resolve_typescript_plugin.default({})]
|
|
218
218
|
},
|
|
@@ -221,7 +221,7 @@ const baseConfig = (options) => ({
|
|
|
221
221
|
"@elliemae/pui-app-loader": "emuiAppLoader",
|
|
222
222
|
"@elliemae/pui-diagnostics": "emuiDiagnostics"
|
|
223
223
|
},
|
|
224
|
-
devtool: options.devtool
|
|
225
|
-
performance: options.performance
|
|
226
|
-
devServer: options.devServer
|
|
224
|
+
devtool: options.devtool ?? "eval-source-map",
|
|
225
|
+
performance: options.performance ?? {},
|
|
226
|
+
devServer: options.devServer ?? {}
|
|
227
227
|
});
|
|
@@ -89,7 +89,7 @@ var webpack_lib_dev_babel_default = (0, import_webpack_lib_base_babel.baseConfig
|
|
|
89
89
|
historyApiFallback: true,
|
|
90
90
|
hot: true,
|
|
91
91
|
open: [basePath],
|
|
92
|
-
port: process.env.PORT
|
|
92
|
+
port: process.env.PORT ?? "auto",
|
|
93
93
|
headers: {
|
|
94
94
|
"Access-Control-Allow-Origin": "*",
|
|
95
95
|
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS"
|
|
@@ -100,11 +100,11 @@ const webpackFinal = (config, { configType }) => {
|
|
|
100
100
|
config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
|
|
101
101
|
config.resolve.extensions?.push(".svg");
|
|
102
102
|
config.resolve.plugins = [
|
|
103
|
-
...config.resolve.plugins
|
|
103
|
+
...config.resolve.plugins ?? [],
|
|
104
104
|
new import_resolve_typescript_plugin.default({})
|
|
105
105
|
];
|
|
106
106
|
}
|
|
107
|
-
config.externals = config.externals
|
|
107
|
+
config.externals = config.externals ?? {};
|
|
108
108
|
if (config.externals) {
|
|
109
109
|
config.externals["@elliemae/pui-user-monitoring"] = "emuiUserMonitoring";
|
|
110
110
|
config.externals["@elliemae/pui-app-loader"] = "emuiAppLoader";
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { inspect } from "node:util";
|
|
2
3
|
import yargs from "yargs";
|
|
3
4
|
import {
|
|
4
5
|
exec,
|
|
6
|
+
logInfo,
|
|
5
7
|
logError,
|
|
6
8
|
logSuccess,
|
|
7
9
|
getCIEnv,
|
|
8
10
|
isTypeScriptEnabled
|
|
9
11
|
} from "./utils.js";
|
|
10
|
-
const lintCSS = async (
|
|
11
|
-
const fixIssues = fix ? "--fix" : "";
|
|
12
|
+
const lintCSS = async (args) => {
|
|
13
|
+
const fixIssues = args.fix ? "--fix" : "";
|
|
14
|
+
if (args.debug) {
|
|
15
|
+
const configPath = path.join(process.cwd(), "stylelint.config.cjs");
|
|
16
|
+
const config = await import(configPath);
|
|
17
|
+
logInfo("stylelint version:");
|
|
18
|
+
await exec(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
|
|
19
|
+
logInfo("stylelint config:");
|
|
20
|
+
logInfo(inspect(config, { depth: null }));
|
|
21
|
+
}
|
|
12
22
|
await exec(
|
|
13
23
|
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!getCIEnv() ? "--color" : "--no-color"} --allow-empty-input --config ${path.join(
|
|
14
24
|
process.cwd(),
|
|
@@ -16,10 +26,11 @@ const lintCSS = async (fix = false) => {
|
|
|
16
26
|
)}`
|
|
17
27
|
);
|
|
18
28
|
};
|
|
19
|
-
const lintJS = async (
|
|
20
|
-
const fixIssues = fix ? "--fix" : "";
|
|
29
|
+
const lintJS = async (args) => {
|
|
30
|
+
const fixIssues = args.fix ? "--fix" : "";
|
|
31
|
+
const debugFlags = args.debug ? "--env-info --debug" : "";
|
|
21
32
|
await exec(
|
|
22
|
-
`eslint ${!getCIEnv() ? "--color" : "--no-color"} ${fixIssues}
|
|
33
|
+
`eslint ${!getCIEnv() ? "--color" : "--no-color"} ${fixIssues} ${debugFlags} .`
|
|
23
34
|
);
|
|
24
35
|
};
|
|
25
36
|
const cmdArgs = {
|
|
@@ -37,6 +48,11 @@ const cmdArgs = {
|
|
|
37
48
|
boolean: true,
|
|
38
49
|
alias: "fix",
|
|
39
50
|
default: false
|
|
51
|
+
},
|
|
52
|
+
debug: {
|
|
53
|
+
boolean: true,
|
|
54
|
+
alias: "debug",
|
|
55
|
+
default: false
|
|
40
56
|
}
|
|
41
57
|
};
|
|
42
58
|
const lintCmd = {
|
|
@@ -46,10 +62,12 @@ const lintCmd = {
|
|
|
46
62
|
await exec("tsc --noEmit --emitDeclarationOnly false");
|
|
47
63
|
try {
|
|
48
64
|
await exec("rimraf ./reports/eslint.json");
|
|
49
|
-
await lintJS(argv
|
|
65
|
+
await lintJS({ ...argv });
|
|
50
66
|
logSuccess("JS linting completed");
|
|
51
67
|
} catch (err) {
|
|
52
68
|
logError("JS linting failed");
|
|
69
|
+
if (argv.debug)
|
|
70
|
+
logError(err);
|
|
53
71
|
yargs().exit(-1, err);
|
|
54
72
|
return;
|
|
55
73
|
}
|
|
@@ -57,10 +75,12 @@ const lintCmd = {
|
|
|
57
75
|
if (argv.css) {
|
|
58
76
|
try {
|
|
59
77
|
await exec("rimraf ./reports/stylelint.json");
|
|
60
|
-
await lintCSS(argv
|
|
78
|
+
await lintCSS({ ...argv });
|
|
61
79
|
logSuccess("CSS linting completed");
|
|
62
80
|
} catch (err) {
|
|
63
81
|
logError("CSS linting failed");
|
|
82
|
+
if (argv.debug)
|
|
83
|
+
logError(err);
|
|
64
84
|
yargs().exit(-1, err);
|
|
65
85
|
}
|
|
66
86
|
}
|
|
@@ -31,6 +31,7 @@ const browsersMapping = {
|
|
|
31
31
|
};
|
|
32
32
|
const exec = async (command, options = { stdio: "inherit" }) => execaCommand(command, options);
|
|
33
33
|
const logInfo = console.log;
|
|
34
|
+
const logWarning = (...args) => console.log(chalk.yellow(...args));
|
|
34
35
|
const logSuccess = (...args) => console.log(chalk.green(...args));
|
|
35
36
|
const logError = console.error;
|
|
36
37
|
const readPackageLock = async () => {
|
|
@@ -52,7 +53,7 @@ const getSupportedBrowsers = async () => {
|
|
|
52
53
|
return browserVersions.reduce((acc, nameVersion) => {
|
|
53
54
|
const [name, version] = nameVersion.split(" ");
|
|
54
55
|
const versionRange = version.split("-");
|
|
55
|
-
acc[browsersMapping[name]] = versionRange
|
|
56
|
+
acc[browsersMapping[name]] = versionRange?.[0] ?? version;
|
|
56
57
|
return acc;
|
|
57
58
|
}, {});
|
|
58
59
|
};
|
|
@@ -186,5 +187,6 @@ export {
|
|
|
186
187
|
logError,
|
|
187
188
|
logInfo,
|
|
188
189
|
logSuccess,
|
|
190
|
+
logWarning,
|
|
189
191
|
writeAppInfo
|
|
190
192
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
const
|
|
2
|
+
const { prettierConfig } = require("../prettier.config.cjs");
|
|
3
3
|
// const webpackConfig = require('../../webpack/webpack.prod.babel');
|
|
4
4
|
|
|
5
5
|
exports.baseExtends = [
|
|
@@ -26,7 +26,7 @@ exports.baseOverrides = [
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
const baseRules = {
|
|
29
|
-
"prettier/prettier": ["error",
|
|
29
|
+
"prettier/prettier": ["error", prettierConfig],
|
|
30
30
|
"arrow-body-style": [2, "as-needed"],
|
|
31
31
|
"class-methods-use-this": 0,
|
|
32
32
|
"import/imports-first": 0,
|
|
@@ -152,6 +152,7 @@ exports.baseConfig = {
|
|
|
152
152
|
},
|
|
153
153
|
ignorePatterns: [
|
|
154
154
|
"/build/**/*",
|
|
155
|
+
"/node_modules/**/*",
|
|
155
156
|
"/dist/**/*",
|
|
156
157
|
"/reports/**/*",
|
|
157
158
|
"/coverage/**/*",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { baseExtends, basePlugins } = require('../common.cjs');
|
|
2
2
|
|
|
3
3
|
exports.tsBaseExtends = [
|
|
4
|
-
'plugin:@typescript-eslint/recommended',
|
|
5
4
|
'plugin:import/typescript',
|
|
6
|
-
'plugin:@typescript-eslint/recommended-
|
|
5
|
+
'plugin:@typescript-eslint/recommended-type-checked',
|
|
6
|
+
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
7
7
|
].concat(baseExtends);
|
|
8
8
|
|
|
9
9
|
exports.tsBaseRules = {
|
|
@@ -34,7 +34,7 @@ exports.tsBaseConfig = {
|
|
|
34
34
|
plugins: ['@typescript-eslint'].concat(basePlugins),
|
|
35
35
|
parserOptions: {
|
|
36
36
|
tsconfigRootDir: process.cwd(),
|
|
37
|
-
project:
|
|
37
|
+
project: true,
|
|
38
38
|
},
|
|
39
39
|
settings: {
|
|
40
40
|
'import/resolver': {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
exports.stylelintConfig = {
|
|
2
2
|
ignoreFiles: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
"/dist/**/*",
|
|
4
|
+
"/coverage/**/*",
|
|
5
|
+
"/build/**/*",
|
|
6
|
+
"/reports/**/*",
|
|
7
|
+
"/temp/**/*",
|
|
8
|
+
"/docs/**/*",
|
|
9
|
+
"/demo/**/*",
|
|
10
|
+
"/node_modules/**/*",
|
|
11
|
+
"/vendor/**/*",
|
|
12
12
|
],
|
|
13
|
-
customSyntax:
|
|
13
|
+
customSyntax: "@stylelint/postcss-css-in-js",
|
|
14
|
+
// customSyntax: "postcss-styled-components", // '@stylelint/postcss-css-in-js' is deprecated, this may be a replacement?
|
|
14
15
|
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
"stylelint-config-recommended",
|
|
17
|
+
"stylelint-config-styled-components",
|
|
17
18
|
],
|
|
18
|
-
rules: {
|
|
19
|
+
rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
|
|
19
20
|
};
|
|
@@ -3,7 +3,7 @@ const cwd = process.cwd();
|
|
|
3
3
|
const execaOptions = { cwd, stdio: "inherit" };
|
|
4
4
|
const semVerRegEx = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
5
5
|
const isSemVersion = (tagName) => semVerRegEx.test(tagName);
|
|
6
|
-
const branchName = (process.env.BRANCH_NAME
|
|
6
|
+
const branchName = (process.env.BRANCH_NAME ?? "master").toLowerCase();
|
|
7
7
|
const branchTags = {
|
|
8
8
|
master: /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,
|
|
9
9
|
next: /^v.*-next\.(0|[1-9]\d*)/,
|
|
@@ -2,7 +2,7 @@ import { readFile, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import fg from "fast-glob";
|
|
3
3
|
import normalizePath from "normalize-path";
|
|
4
4
|
import { findMonoRepoRoot } from "./utils.js";
|
|
5
|
-
const monorepoRoot = normalizePath(findMonoRepoRoot()
|
|
5
|
+
const monorepoRoot = normalizePath(findMonoRepoRoot() ?? "");
|
|
6
6
|
const setRegistryVersion = async () => {
|
|
7
7
|
const files = await fg([
|
|
8
8
|
`${monorepoRoot}/libs/*/package.json`,
|