@elliemae/pui-cli 7.0.0-alpha.3 → 7.0.0-alpha.6
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/index.cjs +19 -0
- package/dist/cjs/lint/stylelint.config.cjs +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/monorepo/utils.cjs +30 -0
- package/dist/cjs/server/util/app-routes.cjs +10 -0
- package/dist/cjs/server/util/index.js +2 -8
- package/dist/cjs/testing/jest.config.cjs +4 -8
- package/dist/cjs/transpile/.swcrc +11 -0
- package/dist/cjs/transpile/esbuild.js +1 -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 +7 -3
- package/dist/esm/index.cjs +19 -0
- package/dist/esm/lint/stylelint.config.cjs +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/monorepo/utils.cjs +30 -0
- package/dist/esm/server/util/app-routes.cjs +10 -0
- package/dist/esm/server/util/index.js +2 -8
- package/dist/esm/testing/jest.config.cjs +4 -8
- package/dist/esm/transpile/.swcrc +11 -0
- package/dist/esm/transpile/esbuild.js +1 -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 +6 -3
- package/dist/types/index.d.cts +9 -0
- package/dist/types/lint/stylelint.config.d.cts +1 -0
- package/dist/types/monorepo/utils.d.cts +1 -0
- package/dist/types/server/util/app-routes.d.cts +1 -0
- package/dist/types/testing/jest.config.d.cts +2 -3
- package/dist/types/testing/jest.node.config.d.cts +2 -3
- package/dist/types/webpack/webpack.dev.babel.d.ts +2 -1
- package/package.json +6 -5
- package/dist/cjs/monorepo/utils.js +0 -34
- package/dist/esm/monorepo/utils.js +0 -12
- package/dist/types/monorepo/utils.d.ts +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { babelConfig } = require('./babel/babel.config.cjs');
|
|
2
|
+
const { esConfig: eslintBaseConfig } = require('./lint/eslint/non-react.cjs');
|
|
3
|
+
const { esReactConfig: eslintConfig } = require('./lint/eslint/react.cjs');
|
|
4
|
+
const { stylelintConfig } = require('./lint/stylelint.config.cjs');
|
|
5
|
+
const { prettierConfig } = require('./lint/prettier.config.cjs');
|
|
6
|
+
const { commitlintConfig } = require('./lint/commitlint.config.cjs');
|
|
7
|
+
const { jestConfig } = require('./testing/jest.config.cjs');
|
|
8
|
+
const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
babelConfig,
|
|
12
|
+
eslintBaseConfig,
|
|
13
|
+
eslintConfig,
|
|
14
|
+
stylelintConfig,
|
|
15
|
+
prettierConfig,
|
|
16
|
+
commitlintConfig,
|
|
17
|
+
jestConfig,
|
|
18
|
+
jestNodeConfig,
|
|
19
|
+
};
|
|
@@ -15,5 +15,5 @@ exports.stylelintConfig = {
|
|
|
15
15
|
'stylelint-config-recommended',
|
|
16
16
|
'stylelint-config-styled-components',
|
|
17
17
|
],
|
|
18
|
-
rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null },
|
|
18
|
+
rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null, 'function-no-unknown': null },
|
|
19
19
|
};
|
|
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(set_registry_version_exports);
|
|
|
26
26
|
var import_promises = require("node:fs/promises");
|
|
27
27
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
28
28
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
29
|
-
var import_utils = require("./utils.
|
|
29
|
+
var import_utils = require("./utils.cjs");
|
|
30
30
|
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() || "");
|
|
31
31
|
const setRegistryVersion = async () => {
|
|
32
32
|
const files = await (0, import_fast_glob.default)([
|
|
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(set_workspace_version_exports);
|
|
|
26
26
|
var import_promises = require("node:fs/promises");
|
|
27
27
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
28
28
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
29
|
-
var import_utils = require("./utils.
|
|
29
|
+
var import_utils = require("./utils.cjs");
|
|
30
30
|
const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() || "");
|
|
31
31
|
const setWorkspaceVersion = async () => {
|
|
32
32
|
const files = await (0, import_fast_glob.default)([
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
|
|
4
|
+
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
5
|
+
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
6
|
+
|
|
7
|
+
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
|
+
let location = null;
|
|
9
|
+
const findUpExec = path.resolve(process.cwd(), path.join('node_modules', '.bin', `find-up${process.platform === 'win32' ? '.cmd' : ''}`));
|
|
10
|
+
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']){
|
|
11
|
+
try {
|
|
12
|
+
const result = execSync(`${findUpExec} ${fileName}`, { cwd });
|
|
13
|
+
location = result.toString().trim();
|
|
14
|
+
break;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
// ignore
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return location;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
23
|
+
const workspaceManifestDirEnvVar =
|
|
24
|
+
process.env[WORKSPACE_DIR_ENV_VAR] ??
|
|
25
|
+
process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
26
|
+
const workspaceManifestLocation = workspaceManifestDirEnvVar
|
|
27
|
+
? path.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml')
|
|
28
|
+
: getPNPMWorkspaceLocation(cwd);
|
|
29
|
+
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
exports.initRoute = (routeFile, app) => {
|
|
2
|
+
// eslint-disable-next-line global-require
|
|
3
|
+
const init = require(routeFile);
|
|
4
|
+
try {
|
|
5
|
+
init(app);
|
|
6
|
+
} catch (err) {
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
console.error(`unable to load routes from ${routeFile}. ${err.message}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -29,6 +29,7 @@ module.exports = __toCommonJS(util_exports);
|
|
|
29
29
|
var import_fs = __toESM(require("fs"), 1);
|
|
30
30
|
var import_path = __toESM(require("path"), 1);
|
|
31
31
|
var import_minimist = __toESM(require("minimist"), 1);
|
|
32
|
+
var import_app_routes = require("./app-routes.cjs");
|
|
32
33
|
const argv = (0, import_minimist.default)(process.argv.slice(2));
|
|
33
34
|
const getCWD = () => process.cwd();
|
|
34
35
|
const allJS = /\.js$/;
|
|
@@ -55,14 +56,7 @@ const loadRoutes = (app) => {
|
|
|
55
56
|
const routeFiles = getServerRouteFiles(import_path.default.join(getCWD(), "server/routes"));
|
|
56
57
|
routeFiles.push(...getServiceEndpoints(import_path.default.join(getCWD(), "app")));
|
|
57
58
|
routeFiles.push(...getServiceEndpoints(import_path.default.join(getCWD(), "lib")));
|
|
58
|
-
routeFiles.forEach(
|
|
59
|
-
const init = await import(routeFile);
|
|
60
|
-
try {
|
|
61
|
-
init(app);
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.error(`unable to load routes from ${routeFile}. ${err.message}`);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
59
|
+
routeFiles.forEach((routeFile) => (0, import_app_routes.initRoute)(routeFile, app));
|
|
66
60
|
};
|
|
67
61
|
const port = parseInt(argv.port || process.env.port || process.env.PORT || "3000", 10);
|
|
68
62
|
const host = argv.host || process.env.HOST;
|
|
@@ -2,11 +2,7 @@ const path = require('path');
|
|
|
2
2
|
const normalizePath = require('normalize-path');
|
|
3
3
|
const { getAppConfig, basePath } = require('../utils.cjs');
|
|
4
4
|
const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
|
|
5
|
-
|
|
6
|
-
let monorepoRoot = null;
|
|
7
|
-
import('../monorepo/utils.js').then(({ findMonoRepoRoot }) => {
|
|
8
|
-
monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
9
|
-
}).catch((ex) => console.error('Error loading monorepo utils:', ex));
|
|
5
|
+
const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
|
|
10
6
|
|
|
11
7
|
let isReactModule = true;
|
|
12
8
|
try {
|
|
@@ -22,6 +18,7 @@ const getMockFilePath = (fileName) =>
|
|
|
22
18
|
normalizePath(path.resolve(__dirname, './mocks', fileName));
|
|
23
19
|
|
|
24
20
|
const getNodeModulesPath = (fileName) => {
|
|
21
|
+
const monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
25
22
|
return normalizePath(
|
|
26
23
|
monorepoRoot
|
|
27
24
|
? path.join(monorepoRoot, 'node_modules', fileName)
|
|
@@ -64,9 +61,8 @@ const jestConfig = {
|
|
|
64
61
|
'.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
|
|
65
62
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
66
63
|
getMockFilePath('image.cjs'),
|
|
67
|
-
'.*\\.svg
|
|
68
|
-
'.*\\.(
|
|
69
|
-
'.*index.html\\?resource$': getMockFilePath('html.cjs'),
|
|
64
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
|
|
65
|
+
'.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
|
|
70
66
|
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
|
|
71
67
|
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
|
|
72
68
|
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.cjs'),
|
|
@@ -73,6 +73,7 @@ const getCommonConfig = ({ injectReactShim }) => ({
|
|
|
73
73
|
const copyFiles = async ({ srcdir, outdir }) => {
|
|
74
74
|
const files = await (0, import_fast_glob.default)([
|
|
75
75
|
`${srcdir}/**/*.*`,
|
|
76
|
+
`${srcdir}/**/.swcrc`,
|
|
76
77
|
`!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
|
|
77
78
|
]);
|
|
78
79
|
await Promise.all(files.map(async (srcFilePath) => {
|
|
@@ -59,7 +59,7 @@ var import_node_fs = __toESM(require("node:fs"), 1);
|
|
|
59
59
|
var import_lodash = __toESM(require("lodash"), 1);
|
|
60
60
|
var import_compression_webpack_plugin = __toESM(require("compression-webpack-plugin"), 1);
|
|
61
61
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
62
|
-
var import_utils = require("../monorepo/utils.
|
|
62
|
+
var import_utils = require("../monorepo/utils.cjs");
|
|
63
63
|
var import_utils2 = require("../utils.cjs");
|
|
64
64
|
let pathSep = import_node_path.default.sep;
|
|
65
65
|
if (pathSep === "\\")
|
|
@@ -60,7 +60,7 @@ const plugins = [
|
|
|
60
60
|
NODE_ENV: "development",
|
|
61
61
|
CI: "false"
|
|
62
62
|
}),
|
|
63
|
-
new import_webpack.ProvidePlugin({
|
|
63
|
+
new import_webpack.default.ProvidePlugin({
|
|
64
64
|
React: "react"
|
|
65
65
|
}),
|
|
66
66
|
new import_copy_webpack_plugin.default({
|
|
@@ -144,7 +144,7 @@ const plugins = [
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}),
|
|
147
|
-
new import_webpack.ProgressPlugin()
|
|
147
|
+
new import_webpack.default.ProgressPlugin()
|
|
148
148
|
];
|
|
149
149
|
const baseConfig = (options) => ({
|
|
150
150
|
mode: options.mode,
|
|
@@ -20,10 +20,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
21
|
var webpack_dev_babel_exports = {};
|
|
22
22
|
__export(webpack_dev_babel_exports, {
|
|
23
|
-
|
|
23
|
+
default: () => webpack_dev_babel_default
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(webpack_dev_babel_exports);
|
|
26
26
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
27
|
+
var import_node_url = require("node:url");
|
|
27
28
|
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"), 1);
|
|
28
29
|
var import_circular_dependency_plugin = __toESM(require("circular-dependency-plugin"), 1);
|
|
29
30
|
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
|
|
@@ -33,7 +34,9 @@ var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
|
|
|
33
34
|
var import_middlewares = require("../server/middlewares/index.js");
|
|
34
35
|
var import_util = require("../server/util/index.js");
|
|
35
36
|
var import_helpers = require("./helpers.js");
|
|
36
|
-
var import_webpack_base_babel =
|
|
37
|
+
var import_webpack_base_babel = require("./webpack.base.babel.js");
|
|
38
|
+
const import_meta = {};
|
|
39
|
+
const __filename = (0, import_node_url.fileURLToPath)(import_meta.url);
|
|
37
40
|
const smp = new import_speed_measure_webpack_plugin.default({ disable: !process.env.MEASURE });
|
|
38
41
|
const {
|
|
39
42
|
appVersion,
|
|
@@ -132,5 +135,6 @@ const devConfig = {
|
|
|
132
135
|
}
|
|
133
136
|
}
|
|
134
137
|
};
|
|
135
|
-
const config = smp.wrap((0, import_webpack_base_babel.
|
|
138
|
+
const config = smp.wrap((0, import_webpack_base_babel.baseConfig)(devConfig));
|
|
136
139
|
config.plugins = config.plugins.concat([new import_react_refresh_webpack_plugin.default({})]);
|
|
140
|
+
var webpack_dev_babel_default = config;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { babelConfig } = require('./babel/babel.config.cjs');
|
|
2
|
+
const { esConfig: eslintBaseConfig } = require('./lint/eslint/non-react.cjs');
|
|
3
|
+
const { esReactConfig: eslintConfig } = require('./lint/eslint/react.cjs');
|
|
4
|
+
const { stylelintConfig } = require('./lint/stylelint.config.cjs');
|
|
5
|
+
const { prettierConfig } = require('./lint/prettier.config.cjs');
|
|
6
|
+
const { commitlintConfig } = require('./lint/commitlint.config.cjs');
|
|
7
|
+
const { jestConfig } = require('./testing/jest.config.cjs');
|
|
8
|
+
const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
babelConfig,
|
|
12
|
+
eslintBaseConfig,
|
|
13
|
+
eslintConfig,
|
|
14
|
+
stylelintConfig,
|
|
15
|
+
prettierConfig,
|
|
16
|
+
commitlintConfig,
|
|
17
|
+
jestConfig,
|
|
18
|
+
jestNodeConfig,
|
|
19
|
+
};
|
|
@@ -15,5 +15,5 @@ exports.stylelintConfig = {
|
|
|
15
15
|
'stylelint-config-recommended',
|
|
16
16
|
'stylelint-config-styled-components',
|
|
17
17
|
],
|
|
18
|
-
rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null },
|
|
18
|
+
rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null, 'function-no-unknown': null },
|
|
19
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import fg from "fast-glob";
|
|
3
3
|
import normalizePath from "normalize-path";
|
|
4
|
-
import { findMonoRepoRoot } from "./utils.
|
|
4
|
+
import { findMonoRepoRoot } from "./utils.cjs";
|
|
5
5
|
const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
|
|
6
6
|
const setRegistryVersion = async () => {
|
|
7
7
|
const files = await fg([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import fg from "fast-glob";
|
|
3
3
|
import normalizePath from "normalize-path";
|
|
4
|
-
import { findMonoRepoRoot } from "./utils.
|
|
4
|
+
import { findMonoRepoRoot } from "./utils.cjs";
|
|
5
5
|
const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
|
|
6
6
|
const setWorkspaceVersion = async () => {
|
|
7
7
|
const files = await fg([
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
|
|
4
|
+
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
5
|
+
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
6
|
+
|
|
7
|
+
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
|
+
let location = null;
|
|
9
|
+
const findUpExec = path.resolve(process.cwd(), path.join('node_modules', '.bin', `find-up${process.platform === 'win32' ? '.cmd' : ''}`));
|
|
10
|
+
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']){
|
|
11
|
+
try {
|
|
12
|
+
const result = execSync(`${findUpExec} ${fileName}`, { cwd });
|
|
13
|
+
location = result.toString().trim();
|
|
14
|
+
break;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
// ignore
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return location;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
23
|
+
const workspaceManifestDirEnvVar =
|
|
24
|
+
process.env[WORKSPACE_DIR_ENV_VAR] ??
|
|
25
|
+
process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
26
|
+
const workspaceManifestLocation = workspaceManifestDirEnvVar
|
|
27
|
+
? path.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml')
|
|
28
|
+
: getPNPMWorkspaceLocation(cwd);
|
|
29
|
+
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
exports.initRoute = (routeFile, app) => {
|
|
2
|
+
// eslint-disable-next-line global-require
|
|
3
|
+
const init = require(routeFile);
|
|
4
|
+
try {
|
|
5
|
+
init(app);
|
|
6
|
+
} catch (err) {
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
console.error(`unable to load routes from ${routeFile}. ${err.message}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import minimist from "minimist";
|
|
4
|
+
import { initRoute } from "./app-routes.cjs";
|
|
4
5
|
const argv = minimist(process.argv.slice(2));
|
|
5
6
|
const getCWD = () => process.cwd();
|
|
6
7
|
const allJS = /\.js$/;
|
|
@@ -27,14 +28,7 @@ const loadRoutes = (app) => {
|
|
|
27
28
|
const routeFiles = getServerRouteFiles(path.join(getCWD(), "server/routes"));
|
|
28
29
|
routeFiles.push(...getServiceEndpoints(path.join(getCWD(), "app")));
|
|
29
30
|
routeFiles.push(...getServiceEndpoints(path.join(getCWD(), "lib")));
|
|
30
|
-
routeFiles.forEach(
|
|
31
|
-
const init = await import(routeFile);
|
|
32
|
-
try {
|
|
33
|
-
init(app);
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error(`unable to load routes from ${routeFile}. ${err.message}`);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
31
|
+
routeFiles.forEach((routeFile) => initRoute(routeFile, app));
|
|
38
32
|
};
|
|
39
33
|
const port = parseInt(argv.port || process.env.port || process.env.PORT || "3000", 10);
|
|
40
34
|
const host = argv.host || process.env.HOST;
|
|
@@ -2,11 +2,7 @@ const path = require('path');
|
|
|
2
2
|
const normalizePath = require('normalize-path');
|
|
3
3
|
const { getAppConfig, basePath } = require('../utils.cjs');
|
|
4
4
|
const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
|
|
5
|
-
|
|
6
|
-
let monorepoRoot = null;
|
|
7
|
-
import('../monorepo/utils.js').then(({ findMonoRepoRoot }) => {
|
|
8
|
-
monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
9
|
-
}).catch((ex) => console.error('Error loading monorepo utils:', ex));
|
|
5
|
+
const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
|
|
10
6
|
|
|
11
7
|
let isReactModule = true;
|
|
12
8
|
try {
|
|
@@ -22,6 +18,7 @@ const getMockFilePath = (fileName) =>
|
|
|
22
18
|
normalizePath(path.resolve(__dirname, './mocks', fileName));
|
|
23
19
|
|
|
24
20
|
const getNodeModulesPath = (fileName) => {
|
|
21
|
+
const monorepoRoot = findMonoRepoRoot(process.cwd());
|
|
25
22
|
return normalizePath(
|
|
26
23
|
monorepoRoot
|
|
27
24
|
? path.join(monorepoRoot, 'node_modules', fileName)
|
|
@@ -64,9 +61,8 @@ const jestConfig = {
|
|
|
64
61
|
'.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
|
|
65
62
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
66
63
|
getMockFilePath('image.cjs'),
|
|
67
|
-
'.*\\.svg
|
|
68
|
-
'.*\\.(
|
|
69
|
-
'.*index.html\\?resource$': getMockFilePath('html.cjs'),
|
|
64
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
|
|
65
|
+
'.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
|
|
70
66
|
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
|
|
71
67
|
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
|
|
72
68
|
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.cjs'),
|
|
@@ -48,6 +48,7 @@ const getCommonConfig = ({ injectReactShim }) => ({
|
|
|
48
48
|
const copyFiles = async ({ srcdir, outdir }) => {
|
|
49
49
|
const files = await fg([
|
|
50
50
|
`${srcdir}/**/*.*`,
|
|
51
|
+
`${srcdir}/**/.swcrc`,
|
|
51
52
|
`!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
|
|
52
53
|
]);
|
|
53
54
|
await Promise.all(files.map(async (srcFilePath) => {
|
|
@@ -22,7 +22,7 @@ import fs from "node:fs";
|
|
|
22
22
|
import _ from "lodash";
|
|
23
23
|
import CompressionPlugin from "compression-webpack-plugin";
|
|
24
24
|
import zlib from "zlib";
|
|
25
|
-
import { findMonoRepoRoot } from "../monorepo/utils.
|
|
25
|
+
import { findMonoRepoRoot } from "../monorepo/utils.cjs";
|
|
26
26
|
import { basePath, getAppConfig } from "../utils.cjs";
|
|
27
27
|
let pathSep = path.sep;
|
|
28
28
|
if (pathSep === "\\")
|
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
import path from "node:path";
|
|
18
|
-
import webpack
|
|
18
|
+
import webpack from "webpack";
|
|
19
19
|
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
20
20
|
import PostcssPresetEnv from "postcss-preset-env";
|
|
21
21
|
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
@@ -43,7 +43,7 @@ const plugins = [
|
|
|
43
43
|
NODE_ENV: "development",
|
|
44
44
|
CI: "false"
|
|
45
45
|
}),
|
|
46
|
-
new ProvidePlugin({
|
|
46
|
+
new webpack.ProvidePlugin({
|
|
47
47
|
React: "react"
|
|
48
48
|
}),
|
|
49
49
|
new CopyWebpackPlugin({
|
|
@@ -127,7 +127,7 @@ const plugins = [
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}),
|
|
130
|
-
new ProgressPlugin()
|
|
130
|
+
new webpack.ProgressPlugin()
|
|
131
131
|
];
|
|
132
132
|
const baseConfig = (options) => ({
|
|
133
133
|
mode: options.mode,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
3
4
|
import CircularDependencyPlugin from "circular-dependency-plugin";
|
|
4
5
|
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
@@ -12,7 +13,8 @@ import {
|
|
|
12
13
|
getPaths,
|
|
13
14
|
isGoogleTagManagerEnabled
|
|
14
15
|
} from "./helpers.js";
|
|
15
|
-
import
|
|
16
|
+
import { baseConfig } from "./webpack.base.babel.js";
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
18
|
const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
|
|
17
19
|
const {
|
|
18
20
|
appVersion,
|
|
@@ -111,8 +113,9 @@ const devConfig = {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
|
-
const config = smp.wrap(
|
|
116
|
+
const config = smp.wrap(baseConfig(devConfig));
|
|
115
117
|
config.plugins = config.plugins.concat([new ReactRefreshWebpackPlugin({})]);
|
|
118
|
+
var webpack_dev_babel_default = config;
|
|
116
119
|
export {
|
|
117
|
-
|
|
120
|
+
webpack_dev_babel_default as default
|
|
118
121
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { babelConfig } from "./babel/babel.config.cjs";
|
|
2
|
+
import { esConfig as eslintBaseConfig } from "./lint/eslint/non-react.cjs";
|
|
3
|
+
import { esReactConfig as eslintConfig } 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";
|
|
7
|
+
import { jestConfig } from "./testing/jest.config.cjs";
|
|
8
|
+
import { jestNodeConfig } from "./testing/jest.node.config.cjs";
|
|
9
|
+
export { babelConfig, eslintBaseConfig, eslintConfig, stylelintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function findMonoRepoRoot(cwd?: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function initRoute(routeFile: any, app: any): void;
|
|
@@ -8,9 +8,8 @@ export namespace jestConfig {
|
|
|
8
8
|
'.*\\webpack-hmr(.[t|j]s)?$': any;
|
|
9
9
|
'.*\\.(css|scss)$': any;
|
|
10
10
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$': any;
|
|
11
|
-
'.*\\.svg
|
|
12
|
-
'.*\\.(
|
|
13
|
-
'.*index.html\\?resource$': any;
|
|
11
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
|
|
12
|
+
'.*\\.html$(?:\\?[a-zA-Z]+)?$': any;
|
|
14
13
|
'@elliemae/pui-user-monitoring': any;
|
|
15
14
|
'@elliemae/pui-app-loader': any;
|
|
16
15
|
'@elliemae/pui-diagnostics': any;
|
|
@@ -12,9 +12,8 @@ export var jestNodeConfig: {
|
|
|
12
12
|
'.*\\webpack-hmr(.[t|j]s)?$': any;
|
|
13
13
|
'.*\\.(css|scss)$': any;
|
|
14
14
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$': any;
|
|
15
|
-
'.*\\.svg
|
|
16
|
-
'.*\\.(
|
|
17
|
-
'.*index.html\\?resource$': any;
|
|
15
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
|
|
16
|
+
'.*\\.html$(?:\\?[a-zA-Z]+)?$': any;
|
|
18
17
|
'@elliemae/pui-user-monitoring': any;
|
|
19
18
|
'@elliemae/pui-app-loader': any;
|
|
20
19
|
'@elliemae/pui-diagnostics': any;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default config;
|
|
2
|
+
declare const config: any;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.6",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "./dist/cjs/index.
|
|
7
|
+
"main": "./dist/cjs/index.cjs",
|
|
8
8
|
"module": "./dist/esm/index.js",
|
|
9
9
|
"types": "./dist/types/index.d.ts",
|
|
10
10
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"import": "./dist/esm/index.js",
|
|
16
|
-
"require": "./dist/cjs/index.
|
|
16
|
+
"require": "./dist/cjs/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
"favicons-webpack-plugin": "~5.0.2",
|
|
175
175
|
"fast-glob": "~3.2.11",
|
|
176
176
|
"find-up": "~6.3.0",
|
|
177
|
-
"
|
|
177
|
+
"find-up-cli": "~5.0.0",
|
|
178
|
+
"happy-dom": "~3.1.1",
|
|
178
179
|
"helmet-csp": "~3.4.0",
|
|
179
180
|
"html-webpack-plugin": "~5.5.0",
|
|
180
181
|
"http-server": "~14.1.0",
|
|
@@ -243,7 +244,7 @@
|
|
|
243
244
|
"url-loader": "~4.1.1",
|
|
244
245
|
"uuid": "~8.3.2",
|
|
245
246
|
"vite": "~2.9.8",
|
|
246
|
-
"vitest": "~0.10.
|
|
247
|
+
"vitest": "~0.10.4",
|
|
247
248
|
"webpack": "~5.72.0",
|
|
248
249
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
249
250
|
"webpack-cli": "~4.9.2",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
findMonoRepoRoot: () => findMonoRepoRoot
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(utils_exports);
|
|
26
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
27
|
-
var import_find_up = require("find-up");
|
|
28
|
-
const WORKSPACE_DIR_ENV_VAR = "NPM_CONFIG_WORKSPACE_DIR";
|
|
29
|
-
const WORKSPACE_MANIFEST_FILENAME = "pnpm-workspace.yaml";
|
|
30
|
-
const findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
31
|
-
const workspaceManifestDirEnvVar = process.env[WORKSPACE_DIR_ENV_VAR] ?? process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
32
|
-
const workspaceManifestLocation = workspaceManifestDirEnvVar ? import_node_path.default.join(workspaceManifestDirEnvVar, "pnpm-workspace.yaml") : (0, import_find_up.findUpSync)([WORKSPACE_MANIFEST_FILENAME, "pnpm-workspace.yml"], { cwd });
|
|
33
|
-
return workspaceManifestLocation && import_node_path.default.dirname(workspaceManifestLocation);
|
|
34
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { findUpSync } from "find-up";
|
|
3
|
-
const WORKSPACE_DIR_ENV_VAR = "NPM_CONFIG_WORKSPACE_DIR";
|
|
4
|
-
const WORKSPACE_MANIFEST_FILENAME = "pnpm-workspace.yaml";
|
|
5
|
-
const findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
6
|
-
const workspaceManifestDirEnvVar = process.env[WORKSPACE_DIR_ENV_VAR] ?? process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
7
|
-
const workspaceManifestLocation = workspaceManifestDirEnvVar ? path.join(workspaceManifestDirEnvVar, "pnpm-workspace.yaml") : findUpSync([WORKSPACE_MANIFEST_FILENAME, "pnpm-workspace.yml"], { cwd });
|
|
8
|
-
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
findMonoRepoRoot
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function findMonoRepoRoot(cwd?: string): string | undefined;
|