@elliemae/pui-cli 7.0.0-alpha.5 → 7.0.0-alpha.8
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/cli-commands/{tsc.js → tscheck.js} +26 -44
- package/dist/cjs/cli.js +2 -0
- package/dist/cjs/lint/lint-staged.config.js +1 -6
- package/dist/cjs/monorepo/utils.cjs +2 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/cjs/server/{middlewares/index.js → middlewares.js} +18 -7
- package/dist/cjs/testing/jest.config.cjs +8 -8
- package/dist/cjs/{typescript/tsc-files/utils.js → testing/mocks/axios.js} +18 -12
- package/dist/cjs/testing/mocks/cssModule.js +23 -0
- 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/{server/middlewares/addProdMiddlewares.js → testing/mocks/svg.js} +8 -23
- package/dist/cjs/testing/mocks/webpack-hmr.js +24 -0
- package/dist/cjs/testing/setup-tests.js +3 -3
- package/dist/cjs/webpack/webpack.dev.babel.js +1 -1
- package/dist/cjs/webpack/webpack.prod.babel.js +2 -2
- package/dist/esm/cli-commands/tscheck.js +65 -0
- package/dist/esm/cli.js +2 -0
- package/dist/esm/lint/lint-staged.config.js +1 -5
- package/dist/esm/monorepo/utils.cjs +2 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/esm/server/middlewares.js +46 -0
- package/dist/esm/testing/jest.config.cjs +8 -8
- package/dist/esm/testing/mocks/{axios.cjs → axios.js} +8 -5
- 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/setup-tests.js +2 -2
- package/dist/esm/webpack/webpack.dev.babel.js +1 -1
- package/dist/esm/webpack/webpack.prod.babel.js +2 -2
- package/dist/types/cli-commands/tscheck.d.ts +14 -0
- package/dist/types/server/{middlewares/index.d.ts → middlewares.d.ts} +1 -1
- package/dist/types/testing/jest.config.d.cts +1 -1
- package/dist/types/testing/jest.node.config.d.cts +1 -1
- 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} +0 -0
- package/dist/types/testing/mocks/{webpack-hmr.d.cts → webpack-hmr.d.ts} +0 -0
- package/package.json +7 -6
- package/dist/cjs/testing/mocks/axios.cjs +0 -15
- package/dist/cjs/testing/mocks/cssModule.cjs +0 -1
- package/dist/cjs/testing/mocks/html.cjs +0 -1
- package/dist/cjs/testing/mocks/image.cjs +0 -1
- package/dist/cjs/testing/mocks/matchMedia.cjs +0 -24
- package/dist/cjs/testing/mocks/pui-app-loader.cjs +0 -1
- package/dist/cjs/testing/mocks/pui-diagnostics.cjs +0 -28
- package/dist/cjs/testing/mocks/pui-user-monitoring.cjs +0 -3
- package/dist/cjs/testing/mocks/retry-axios.cjs +0 -3
- package/dist/cjs/testing/mocks/svg.cjs +0 -5
- package/dist/cjs/testing/mocks/webpack-hmr.cjs +0 -1
- package/dist/cjs/typescript/tsc-files/index.js +0 -68
- package/dist/esm/cli-commands/tsc.js +0 -83
- package/dist/esm/server/middlewares/addProdMiddlewares.js +0 -22
- package/dist/esm/server/middlewares/index.js +0 -35
- package/dist/esm/testing/mocks/cssModule.cjs +0 -1
- package/dist/esm/testing/mocks/html.cjs +0 -1
- package/dist/esm/testing/mocks/image.cjs +0 -1
- package/dist/esm/testing/mocks/matchMedia.cjs +0 -24
- package/dist/esm/testing/mocks/pui-app-loader.cjs +0 -1
- package/dist/esm/testing/mocks/pui-diagnostics.cjs +0 -28
- package/dist/esm/testing/mocks/pui-user-monitoring.cjs +0 -3
- package/dist/esm/testing/mocks/retry-axios.cjs +0 -3
- package/dist/esm/testing/mocks/svg.cjs +0 -5
- package/dist/esm/testing/mocks/webpack-hmr.cjs +0 -1
- package/dist/esm/typescript/tsc-files/index.js +0 -55
- package/dist/esm/typescript/tsc-files/utils.js +0 -12
- package/dist/types/cli-commands/tsc.d.ts +0 -20
- 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/typescript/tsc-files/index.d.ts +0 -1
- package/dist/types/typescript/tsc-files/utils.d.ts +0 -3
|
@@ -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
|
+
};
|
package/dist/esm/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { codemodCmd } from "./cli-commands/codemod.js";
|
|
|
15
15
|
import { storybookCmd } from "./cli-commands/storybook.js";
|
|
16
16
|
import { vitestCmd } from "./cli-commands/vitest.js";
|
|
17
17
|
import { versionCmd } from "./cli-commands/version.js";
|
|
18
|
+
import { tscheckCmd } from "./cli-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();
|
|
@@ -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`,
|
|
@@ -6,9 +6,10 @@ const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
|
6
6
|
|
|
7
7
|
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
8
|
let location = null;
|
|
9
|
+
const findUpExec = path.resolve(process.cwd(), path.join('node_modules', '.bin', `find-up${process.platform === 'win32' ? '.cmd' : ''}`));
|
|
9
10
|
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']){
|
|
10
11
|
try {
|
|
11
|
-
const result = execSync(
|
|
12
|
+
const result = execSync(`${findUpExec} ${fileName}`, { cwd });
|
|
12
13
|
location = result.toString().trim();
|
|
13
14
|
break;
|
|
14
15
|
} catch (err) {
|
package/dist/esm/server/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { logger } from "./logger.js";
|
|
|
3
3
|
import {
|
|
4
4
|
setupDefaultMiddlewares,
|
|
5
5
|
setupAdditionalMiddlewars
|
|
6
|
-
} from "./middlewares
|
|
6
|
+
} from "./middlewares.js";
|
|
7
7
|
import { loadRoutes, port, host } from "./util/index.js";
|
|
8
8
|
const app = express();
|
|
9
9
|
setupDefaultMiddlewares(app);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
import compression from "compression";
|
|
4
|
+
import expressStaticGzip from "express-static-gzip";
|
|
5
|
+
import expressPinoLogger from "express-pino-logger";
|
|
6
|
+
import { csp, sendFileWithCSPNonce } from "./csp.js";
|
|
7
|
+
import { getPaths } from "../webpack/helpers.js";
|
|
8
|
+
const paths = getPaths();
|
|
9
|
+
const setupDefaultMiddlewares = (app) => {
|
|
10
|
+
const pino = expressPinoLogger({
|
|
11
|
+
transport: {
|
|
12
|
+
target: "pino-pretty",
|
|
13
|
+
options: {
|
|
14
|
+
colorize: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
pino.logger.level = "warn";
|
|
19
|
+
app.use(pino);
|
|
20
|
+
app.use(cors());
|
|
21
|
+
app.options("*", cors());
|
|
22
|
+
csp(app);
|
|
23
|
+
app.use(express.urlencoded({ extended: false }));
|
|
24
|
+
app.use(express.text({ type: "text/plain" }));
|
|
25
|
+
app.use(express.json({ type: "application/json" }));
|
|
26
|
+
app.use(express.json({ type: "application/csp-report" }));
|
|
27
|
+
};
|
|
28
|
+
const setupAdditionalMiddlewars = (app, options = {}) => {
|
|
29
|
+
const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
|
|
30
|
+
app.use(compression());
|
|
31
|
+
app.get(basePath, (req, res) => {
|
|
32
|
+
sendFileWithCSPNonce({ buildPath, res });
|
|
33
|
+
});
|
|
34
|
+
app.use(basePath, expressStaticGzip(buildPath, {
|
|
35
|
+
index: false,
|
|
36
|
+
enableBrotli: true,
|
|
37
|
+
orderPreference: ["br"]
|
|
38
|
+
}));
|
|
39
|
+
app.use(expressStaticGzip("cdn"));
|
|
40
|
+
app.get("*", (req, res) => sendFileWithCSPNonce({ buildPath, res }));
|
|
41
|
+
return app;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
setupAdditionalMiddlewars,
|
|
45
|
+
setupDefaultMiddlewares
|
|
46
|
+
};
|
|
@@ -57,15 +57,15 @@ const jestConfig = {
|
|
|
57
57
|
coverageReporters: ['lcov', 'html', 'text-summary'],
|
|
58
58
|
moduleDirectories: ['node_modules', 'app', 'lib'],
|
|
59
59
|
moduleNameMapper: {
|
|
60
|
-
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.
|
|
61
|
-
'.*\\.(css|scss)$': getMockFilePath('cssModule.
|
|
60
|
+
'.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
|
|
61
|
+
'.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
|
|
62
62
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
63
|
-
getMockFilePath('image.
|
|
64
|
-
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.
|
|
65
|
-
'.*\\.html
|
|
66
|
-
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.
|
|
67
|
-
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.
|
|
68
|
-
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.
|
|
63
|
+
getMockFilePath('image.js'),
|
|
64
|
+
'.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.js'),
|
|
65
|
+
'.*\\.html(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.js'),
|
|
66
|
+
'@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
|
|
67
|
+
'@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
|
|
68
|
+
'@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
|
|
69
69
|
'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
|
|
70
70
|
'react-spring/renderprops': getNodeModulesPath(
|
|
71
71
|
'react-spring/renderprops.cjs.js',
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
var axios_default = {
|
|
2
2
|
defaults: {},
|
|
3
3
|
interceptors: {
|
|
4
4
|
request: {
|
|
5
|
-
use: jest.fn()
|
|
5
|
+
use: jest.fn()
|
|
6
6
|
},
|
|
7
7
|
response: {
|
|
8
|
-
use: jest.fn()
|
|
9
|
-
}
|
|
8
|
+
use: jest.fn()
|
|
9
|
+
}
|
|
10
10
|
},
|
|
11
11
|
create: jest.fn().mockReturnThis(),
|
|
12
12
|
get: jest.fn().mockResolvedValue({ data: {} }),
|
|
13
13
|
post: jest.fn().mockResolvedValue({ data: {} }),
|
|
14
|
-
put: jest.fn().mockResolvedValue({ data: {} })
|
|
14
|
+
put: jest.fn().mockResolvedValue({ data: {} })
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
axios_default as default
|
|
15
18
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const addMatchMedia = () => {
|
|
2
|
+
Object.defineProperty(window, "matchMedia", {
|
|
3
|
+
writable: true,
|
|
4
|
+
value: jest.fn().mockImplementation((query) => ({
|
|
5
|
+
matches: false,
|
|
6
|
+
media: query,
|
|
7
|
+
onchange: null,
|
|
8
|
+
addListener: jest.fn(),
|
|
9
|
+
removeListener: jest.fn(),
|
|
10
|
+
addEventListener: jest.fn(),
|
|
11
|
+
removeEventListener: jest.fn(),
|
|
12
|
+
dispatchEvent: jest.fn()
|
|
13
|
+
}))
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(window, "getComputedStyle", {
|
|
16
|
+
value: () => ({
|
|
17
|
+
getPropertyValue: () => {
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
addMatchMedia
|
|
24
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const logger = () => ({
|
|
2
|
+
setLogLevel() {
|
|
3
|
+
},
|
|
4
|
+
setOptions() {
|
|
5
|
+
},
|
|
6
|
+
info() {
|
|
7
|
+
},
|
|
8
|
+
warn() {
|
|
9
|
+
},
|
|
10
|
+
error() {
|
|
11
|
+
},
|
|
12
|
+
trace() {
|
|
13
|
+
},
|
|
14
|
+
debug() {
|
|
15
|
+
},
|
|
16
|
+
audit() {
|
|
17
|
+
},
|
|
18
|
+
fatal() {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const LogLevel = {
|
|
22
|
+
info: "info",
|
|
23
|
+
debug: "debug",
|
|
24
|
+
trace: "trace",
|
|
25
|
+
warn: "warn",
|
|
26
|
+
error: "error",
|
|
27
|
+
audit: "audit",
|
|
28
|
+
fatal: "fatal"
|
|
29
|
+
};
|
|
30
|
+
const Console = () => ({
|
|
31
|
+
log: () => {
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const http = () => ({
|
|
35
|
+
log() {
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const webvitals = () => {
|
|
39
|
+
};
|
|
40
|
+
const logUnhandledErrors = () => {
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
Console,
|
|
44
|
+
LogLevel,
|
|
45
|
+
http,
|
|
46
|
+
logUnhandledErrors,
|
|
47
|
+
logger,
|
|
48
|
+
webvitals
|
|
49
|
+
};
|
|
@@ -3,8 +3,8 @@ import "regenerator-runtime/runtime";
|
|
|
3
3
|
import "@testing-library/jest-dom/extend-expect";
|
|
4
4
|
import jestAxe from "jest-axe";
|
|
5
5
|
import ResizeObserver from "resize-observer-polyfill";
|
|
6
|
-
import addMatchMedia from "./mocks/matchMedia.
|
|
7
|
-
import { logger } from "./mocks/pui-diagnostics.
|
|
6
|
+
import { addMatchMedia } from "./mocks/matchMedia.js";
|
|
7
|
+
import { logger } from "./mocks/pui-diagnostics.js";
|
|
8
8
|
const originalError = console.error;
|
|
9
9
|
console.error = (...args) => {
|
|
10
10
|
const ignoreList = [
|
|
@@ -6,7 +6,7 @@ import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
|
6
6
|
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
|
|
7
7
|
import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
|
|
8
8
|
import expressStaticGzip from "express-static-gzip";
|
|
9
|
-
import { setupDefaultMiddlewares } from "../server/middlewares
|
|
9
|
+
import { setupDefaultMiddlewares } from "../server/middlewares.js";
|
|
10
10
|
import { loadRoutes } from "../server/util/index.js";
|
|
11
11
|
import {
|
|
12
12
|
isAppLoaderEnabled,
|
|
@@ -6,7 +6,7 @@ import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
|
|
6
6
|
import { ESBuildMinifyPlugin } from "esbuild-loader";
|
|
7
7
|
import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
|
|
8
8
|
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
9
|
-
import
|
|
9
|
+
import { baseConfig } from "./webpack.base.babel.js";
|
|
10
10
|
import {
|
|
11
11
|
isAppLoaderEnabled,
|
|
12
12
|
getPaths,
|
|
@@ -104,7 +104,7 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
|
|
|
104
104
|
googleTagManager: isGoogleTagManagerEnabled()
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
const config =
|
|
107
|
+
const config = baseConfig(getProdConfig());
|
|
108
108
|
config.plugins.push(htmlWebpackPlugin);
|
|
109
109
|
const addSMPPlugin = (webpackConfig) => {
|
|
110
110
|
const smpConfig = new SpeedMeasurePlugin({
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export namespace tscheckCmd {
|
|
2
|
+
function handler({ files }: {
|
|
3
|
+
files: any;
|
|
4
|
+
}): Promise<void>;
|
|
5
|
+
const command: string;
|
|
6
|
+
const describe: string;
|
|
7
|
+
namespace builder {
|
|
8
|
+
namespace files {
|
|
9
|
+
export const type: string;
|
|
10
|
+
const _default: never[];
|
|
11
|
+
export { _default as default };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function setupDefaultMiddlewares(app: any): void;
|
|
2
|
-
export function setupAdditionalMiddlewars(app: any, options
|
|
2
|
+
export function setupAdditionalMiddlewars(app: any, options?: {}): any;
|
|
@@ -9,7 +9,7 @@ export namespace jestConfig {
|
|
|
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
11
|
'.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
|
|
12
|
-
'.*\\.html
|
|
12
|
+
'.*\\.html(?:\\?[a-zA-Z]+)?$': any;
|
|
13
13
|
'@elliemae/pui-user-monitoring': any;
|
|
14
14
|
'@elliemae/pui-app-loader': any;
|
|
15
15
|
'@elliemae/pui-diagnostics': any;
|
|
@@ -13,7 +13,7 @@ export var jestNodeConfig: {
|
|
|
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
15
|
'.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
|
|
16
|
-
'.*\\.html
|
|
16
|
+
'.*\\.html(?:\\?[a-zA-Z]+)?$': any;
|
|
17
17
|
'@elliemae/pui-user-monitoring': any;
|
|
18
18
|
'@elliemae/pui-app-loader': any;
|
|
19
19
|
'@elliemae/pui-diagnostics': any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
const defaults: {};
|
|
3
|
+
namespace interceptors {
|
|
4
|
+
namespace request {
|
|
5
|
+
const use: jest.Mock<any, any>;
|
|
6
|
+
}
|
|
7
|
+
namespace response {
|
|
8
|
+
const use_1: jest.Mock<any, any>;
|
|
9
|
+
export { use_1 as use };
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const create: jest.Mock<any, any>;
|
|
13
|
+
const get: jest.Mock<any, any>;
|
|
14
|
+
const post: jest.Mock<any, any>;
|
|
15
|
+
const put: jest.Mock<any, any>;
|
|
16
|
+
}
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function addMatchMedia(): void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.8",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"storybook:docs:build": "exit 0",
|
|
45
45
|
"test": "ts-node -r tsconfig-paths/register ./lib/cli test -p",
|
|
46
46
|
"test:staged": "jest --coverage --passWithNoTests --bail --findRelatedTests",
|
|
47
|
+
"tscheck": "ts-node -r tsconfig-paths/register ./lib/cli tscheck --files",
|
|
47
48
|
"setup": "rimraf node_modules && rimraf pnpm-lock.yaml && pnpm i",
|
|
48
49
|
"upgrade": "ncu -u && npm run setup",
|
|
49
50
|
"prepare": "[ -n \"$CI\" ] || husky install"
|
|
@@ -75,9 +76,9 @@
|
|
|
75
76
|
"@commitlint/config-conventional": "~16.2.4",
|
|
76
77
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.4.2",
|
|
77
78
|
"@faker-js/faker": "6.3.1",
|
|
78
|
-
"@nrwl/cli": "14.1.
|
|
79
|
-
"@nrwl/tao": "14.1.
|
|
80
|
-
"@nrwl/workspace": "14.1.
|
|
79
|
+
"@nrwl/cli": "14.1.2",
|
|
80
|
+
"@nrwl/tao": "14.1.2",
|
|
81
|
+
"@nrwl/workspace": "14.1.2",
|
|
81
82
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.5",
|
|
82
83
|
"@semantic-release/changelog": "~6.0.1",
|
|
83
84
|
"@semantic-release/exec": "~6.0.3",
|
|
@@ -175,7 +176,7 @@
|
|
|
175
176
|
"fast-glob": "~3.2.11",
|
|
176
177
|
"find-up": "~6.3.0",
|
|
177
178
|
"find-up-cli": "~5.0.0",
|
|
178
|
-
"happy-dom": "~3.1.
|
|
179
|
+
"happy-dom": "~3.1.1",
|
|
179
180
|
"helmet-csp": "~3.4.0",
|
|
180
181
|
"html-webpack-plugin": "~5.5.0",
|
|
181
182
|
"http-server": "~14.1.0",
|
|
@@ -244,7 +245,7 @@
|
|
|
244
245
|
"url-loader": "~4.1.1",
|
|
245
246
|
"uuid": "~8.3.2",
|
|
246
247
|
"vite": "~2.9.8",
|
|
247
|
-
"vitest": "~0.10.
|
|
248
|
+
"vitest": "~0.10.4",
|
|
248
249
|
"webpack": "~5.72.0",
|
|
249
250
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
250
251
|
"webpack-cli": "~4.9.2",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
defaults: {},
|
|
3
|
-
interceptors: {
|
|
4
|
-
request: {
|
|
5
|
-
use: jest.fn(),
|
|
6
|
-
},
|
|
7
|
-
response: {
|
|
8
|
-
use: jest.fn(),
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
create: jest.fn().mockReturnThis(),
|
|
12
|
-
get: jest.fn().mockResolvedValue({ data: {} }),
|
|
13
|
-
post: jest.fn().mockResolvedValue({ data: {} }),
|
|
14
|
-
put: jest.fn().mockResolvedValue({ data: {} }),
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = 'CSS_MODULE';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = 'HTML_MODULE';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = 'IMAGE_MOCK';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
export default () => {
|
|
5
|
-
Object.defineProperty(window, 'matchMedia', {
|
|
6
|
-
writable: true,
|
|
7
|
-
value: jest.fn().mockImplementation((query) => ({
|
|
8
|
-
matches: false,
|
|
9
|
-
media: query,
|
|
10
|
-
onchange: null,
|
|
11
|
-
addListener: jest.fn(), // Deprecated
|
|
12
|
-
removeListener: jest.fn(), // Deprecated
|
|
13
|
-
addEventListener: jest.fn(),
|
|
14
|
-
removeEventListener: jest.fn(),
|
|
15
|
-
dispatchEvent: jest.fn(),
|
|
16
|
-
})),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
Object.defineProperty(window, 'getComputedStyle', {
|
|
20
|
-
value: () => ({
|
|
21
|
-
getPropertyValue: () => {},
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const load = () => {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const logger = () => ({
|
|
2
|
-
setLogLevel() {},
|
|
3
|
-
setOptions() {},
|
|
4
|
-
info() {},
|
|
5
|
-
warn() {},
|
|
6
|
-
error() {},
|
|
7
|
-
trace() {},
|
|
8
|
-
debug() {},
|
|
9
|
-
audit() {},
|
|
10
|
-
fatal() {},
|
|
11
|
-
});
|
|
12
|
-
export const LogLevel = {
|
|
13
|
-
info: 'info',
|
|
14
|
-
debug: 'debug',
|
|
15
|
-
trace: 'trace',
|
|
16
|
-
warn: 'warn',
|
|
17
|
-
error: 'error',
|
|
18
|
-
audit: 'audit',
|
|
19
|
-
fatal: 'fatal',
|
|
20
|
-
};
|
|
21
|
-
export const Console = () => ({
|
|
22
|
-
log: () => {},
|
|
23
|
-
});
|
|
24
|
-
export const http = () => ({
|
|
25
|
-
log() {},
|
|
26
|
-
});
|
|
27
|
-
export const webvitals = () => {};
|
|
28
|
-
export const logUnhandledErrors = () => {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.enableHotReloading = () => {};
|