@elliemae/pui-cli 7.27.0-beta.2 → 7.27.1
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/README.md +1 -0
- package/dist/cjs/cli.js +12 -14
- package/dist/cjs/commands/build.js +8 -9
- package/dist/cjs/commands/codemod.js +9 -7
- package/dist/cjs/commands/gendoc.js +2 -2
- package/dist/cjs/commands/lint.js +23 -21
- package/dist/cjs/commands/pack.js +20 -25
- package/dist/cjs/commands/start.js +10 -11
- package/dist/cjs/commands/storybook.js +18 -19
- package/dist/cjs/commands/test.js +31 -37
- package/dist/cjs/commands/tscheck.js +8 -9
- package/dist/cjs/commands/utils.js +6 -11
- package/dist/cjs/commands/version.js +19 -21
- package/dist/cjs/commands/vitest.js +28 -32
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/monorepo/delete-merged-tags.js +1 -1
- package/dist/cjs/monorepo/set-registry-version.js +2 -2
- package/dist/cjs/monorepo/set-workspace-version.js +2 -2
- package/dist/cjs/server/app-routes.cjs +42 -0
- package/dist/cjs/server/csp.js +4 -3
- package/dist/cjs/server/index.js +11 -13
- package/dist/cjs/server/middlewares.js +4 -7
- package/dist/cjs/server/utils.js +1 -1
- package/dist/cjs/testing/setup-tests.js +4 -2
- package/dist/cjs/webpack/helpers.js +3 -3
- package/dist/cjs/webpack/webpack.base.babel.js +10 -3
- package/dist/cjs/webpack/webpack.dev.babel.js +10 -13
- package/dist/cjs/webpack/webpack.lib.base.babel.js +5 -4
- package/dist/cjs/webpack/webpack.lib.dev.babel.js +0 -1
- package/dist/cjs/webpack/webpack.prod.babel.js +15 -7
- package/dist/cjs/webpack/webpack.storybook.js +20 -27
- package/dist/esm/cli.js +12 -14
- package/dist/esm/commands/build.js +8 -9
- package/dist/esm/commands/codemod.js +9 -7
- package/dist/esm/commands/gendoc.js +2 -2
- package/dist/esm/commands/lint.js +23 -27
- package/dist/esm/commands/pack.js +20 -32
- package/dist/esm/commands/start.js +10 -11
- package/dist/esm/commands/storybook.js +18 -19
- package/dist/esm/commands/test.js +31 -37
- package/dist/esm/commands/tscheck.js +8 -9
- package/dist/esm/commands/utils.js +5 -10
- package/dist/esm/commands/version.js +19 -21
- package/dist/esm/commands/vitest.js +28 -32
- package/dist/esm/index.cjs +2 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/monorepo/delete-merged-tags.js +1 -1
- package/dist/esm/monorepo/set-registry-version.js +2 -2
- package/dist/esm/monorepo/set-workspace-version.js +2 -2
- package/dist/esm/server/app-routes.cjs +42 -0
- package/dist/esm/server/csp.js +4 -3
- package/dist/esm/server/index.js +11 -13
- package/dist/esm/server/middlewares.js +4 -7
- package/dist/esm/server/utils.js +1 -1
- package/dist/esm/testing/setup-tests.js +4 -2
- package/dist/esm/webpack/helpers.js +3 -3
- package/dist/esm/webpack/webpack.base.babel.js +10 -3
- package/dist/esm/webpack/webpack.dev.babel.js +10 -13
- package/dist/esm/webpack/webpack.lib.base.babel.js +5 -4
- package/dist/esm/webpack/webpack.lib.dev.babel.js +0 -1
- package/dist/esm/webpack/webpack.prod.babel.js +15 -7
- package/dist/esm/webpack/webpack.storybook.js +20 -27
- package/dist/types/commands/build.d.ts +13 -13
- package/dist/types/commands/codemod.d.ts +6 -13
- package/dist/types/commands/gendoc.d.ts +6 -7
- package/dist/types/commands/lint.d.ts +29 -29
- package/dist/types/commands/pack.d.ts +26 -29
- package/dist/types/commands/start.d.ts +13 -17
- package/dist/types/commands/storybook.d.ts +27 -28
- package/dist/types/commands/test.d.ts +39 -47
- package/dist/types/commands/tscheck.d.ts +14 -16
- package/dist/types/commands/utils.d.ts +11 -11
- package/dist/types/commands/version.d.ts +28 -31
- package/dist/types/commands/vitest.d.ts +35 -41
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/monorepo/delete-merged-tags.d.ts +1 -1
- package/dist/types/monorepo/set-registry-version.d.ts +1 -1
- package/dist/types/monorepo/set-workspace-version.d.ts +1 -1
- package/dist/types/server/app-routes.d.cts +1 -0
- package/dist/types/server/csp.d.ts +9 -12
- package/dist/types/server/logger.d.ts +4 -7
- package/dist/types/server/middlewares.d.ts +2 -6
- package/dist/types/server/utils.d.ts +3 -3
- package/dist/types/testing/jest.config.d.cts +10 -10
- package/dist/types/testing/jest.node.config.d.cts +10 -10
- package/dist/types/webpack/helpers.d.ts +18 -19
- package/dist/types/webpack/webpack.base.babel.d.ts +106 -3
- package/dist/types/webpack/webpack.dev.babel.d.ts +1 -2
- package/dist/types/webpack/webpack.lib.base.babel.d.ts +102 -3
- package/dist/types/webpack/webpack.lib.dev.babel.d.ts +101 -3
- package/dist/types/webpack/webpack.lib.prod.babel.d.ts +101 -2
- package/dist/types/webpack/webpack.prod.babel.d.ts +2 -3
- package/dist/types/webpack/webpack.storybook.d.ts +4 -5
- package/package.json +52 -66
- package/dist/cjs/monorepo/utils.js +0 -54
- package/dist/cjs/server/appRoutes.js +0 -74
- package/dist/cjs/utils.js +0 -50
- package/dist/esm/monorepo/utils.js +0 -24
- package/dist/esm/server/appRoutes.js +0 -44
- package/dist/esm/utils.js +0 -20
- package/dist/types/monorepo/utils.d.ts +0 -1
- package/dist/types/server/appRoutes.d.ts +0 -2
- package/dist/types/utils.d.ts +0 -4
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var appRoutes_exports = {};
|
|
30
|
-
__export(appRoutes_exports, {
|
|
31
|
-
loadRoutes: () => loadRoutes
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(appRoutes_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
-
const allJS = /\.(js|ts)$/;
|
|
37
|
-
const serviceEndpoints = /\.endpoint\.(ts|js)$/;
|
|
38
|
-
const getFilesMatching = (filePattern) => {
|
|
39
|
-
const getFiles = (dir) => {
|
|
40
|
-
let routeFiles = [];
|
|
41
|
-
if (!import_node_fs.default.existsSync(dir))
|
|
42
|
-
return routeFiles;
|
|
43
|
-
import_node_fs.default.readdirSync(dir).forEach((file) => {
|
|
44
|
-
const fullPath = import_node_path.default.join(dir, file);
|
|
45
|
-
if (import_node_fs.default.lstatSync(fullPath).isDirectory()) {
|
|
46
|
-
routeFiles = routeFiles.concat(getFiles(fullPath));
|
|
47
|
-
} else if (filePattern.test(fullPath))
|
|
48
|
-
routeFiles.push(fullPath);
|
|
49
|
-
});
|
|
50
|
-
return routeFiles;
|
|
51
|
-
};
|
|
52
|
-
return getFiles;
|
|
53
|
-
};
|
|
54
|
-
const getServerRouteFiles = getFilesMatching(allJS);
|
|
55
|
-
const getServiceEndpoints = getFilesMatching(serviceEndpoints);
|
|
56
|
-
const loadRoutes = async (app) => {
|
|
57
|
-
const routeFiles = getServerRouteFiles(
|
|
58
|
-
import_node_path.default.join(process.cwd(), "server/routes")
|
|
59
|
-
);
|
|
60
|
-
routeFiles.push(...getServiceEndpoints(import_node_path.default.join(process.cwd(), "app")));
|
|
61
|
-
routeFiles.push(...getServiceEndpoints(import_node_path.default.join(process.cwd(), "lib")));
|
|
62
|
-
await Promise.all(
|
|
63
|
-
routeFiles.map(async (routeFile) => {
|
|
64
|
-
const init = await import(routeFile);
|
|
65
|
-
try {
|
|
66
|
-
init(app);
|
|
67
|
-
} catch (err) {
|
|
68
|
-
console.error(
|
|
69
|
-
`unable to load routes from ${routeFile}. ${err.message}`
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
);
|
|
74
|
-
};
|
package/dist/cjs/utils.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var utils_exports = {};
|
|
30
|
-
__export(utils_exports, {
|
|
31
|
-
basePath: () => basePath,
|
|
32
|
-
getAppConfig: () => getAppConfig,
|
|
33
|
-
isApp: () => isApp
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(utils_exports);
|
|
36
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
37
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
38
|
-
const basePath = (process.env.BASE_PATH || "/").replace(/\/?$/, "/");
|
|
39
|
-
const isApp = () => import_node_fs.default.existsSync(import_node_path.default.join(process.cwd(), "app"));
|
|
40
|
-
const getAppConfig = () => {
|
|
41
|
-
const appConfigPath = import_node_path.default.join(
|
|
42
|
-
process.cwd(),
|
|
43
|
-
isApp() ? "app" : "lib",
|
|
44
|
-
"app.config.json"
|
|
45
|
-
);
|
|
46
|
-
if (!import_node_fs.default.existsSync(appConfigPath))
|
|
47
|
-
return "{}";
|
|
48
|
-
const appConfig = import_node_fs.default.readFileSync(appConfigPath);
|
|
49
|
-
return appConfig || "{}";
|
|
50
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { execSync } from "child_process";
|
|
3
|
-
const WORKSPACE_DIR_ENV_VAR = "NPM_CONFIG_WORKSPACE_DIR";
|
|
4
|
-
const WORKSPACE_MANIFEST_FILENAME = "pnpm-workspace.yaml";
|
|
5
|
-
const getPNPMWorkspaceLocation = (cwd) => {
|
|
6
|
-
let location = null;
|
|
7
|
-
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, "pnpm-workspace.yml"]) {
|
|
8
|
-
try {
|
|
9
|
-
const result = execSync(`npx find-up ${fileName}`, { cwd });
|
|
10
|
-
location = result.toString().trim();
|
|
11
|
-
break;
|
|
12
|
-
} catch (err) {
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return location;
|
|
16
|
-
};
|
|
17
|
-
const findMonoRepoRoot = (cwd = process.cwd()) => {
|
|
18
|
-
const workspaceManifestDirEnvVar = process.env[WORKSPACE_DIR_ENV_VAR] ?? process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
19
|
-
const workspaceManifestLocation = workspaceManifestDirEnvVar ? path.join(workspaceManifestDirEnvVar, "pnpm-workspace.yaml") : getPNPMWorkspaceLocation(cwd);
|
|
20
|
-
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
findMonoRepoRoot
|
|
24
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
const allJS = /\.(js|ts)$/;
|
|
4
|
-
const serviceEndpoints = /\.endpoint\.(ts|js)$/;
|
|
5
|
-
const getFilesMatching = (filePattern) => {
|
|
6
|
-
const getFiles = (dir) => {
|
|
7
|
-
let routeFiles = [];
|
|
8
|
-
if (!fs.existsSync(dir))
|
|
9
|
-
return routeFiles;
|
|
10
|
-
fs.readdirSync(dir).forEach((file) => {
|
|
11
|
-
const fullPath = path.join(dir, file);
|
|
12
|
-
if (fs.lstatSync(fullPath).isDirectory()) {
|
|
13
|
-
routeFiles = routeFiles.concat(getFiles(fullPath));
|
|
14
|
-
} else if (filePattern.test(fullPath))
|
|
15
|
-
routeFiles.push(fullPath);
|
|
16
|
-
});
|
|
17
|
-
return routeFiles;
|
|
18
|
-
};
|
|
19
|
-
return getFiles;
|
|
20
|
-
};
|
|
21
|
-
const getServerRouteFiles = getFilesMatching(allJS);
|
|
22
|
-
const getServiceEndpoints = getFilesMatching(serviceEndpoints);
|
|
23
|
-
const loadRoutes = async (app) => {
|
|
24
|
-
const routeFiles = getServerRouteFiles(
|
|
25
|
-
path.join(process.cwd(), "server/routes")
|
|
26
|
-
);
|
|
27
|
-
routeFiles.push(...getServiceEndpoints(path.join(process.cwd(), "app")));
|
|
28
|
-
routeFiles.push(...getServiceEndpoints(path.join(process.cwd(), "lib")));
|
|
29
|
-
await Promise.all(
|
|
30
|
-
routeFiles.map(async (routeFile) => {
|
|
31
|
-
const init = await import(routeFile);
|
|
32
|
-
try {
|
|
33
|
-
init(app);
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error(
|
|
36
|
-
`unable to load routes from ${routeFile}. ${err.message}`
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
loadRoutes
|
|
44
|
-
};
|
package/dist/esm/utils.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
const basePath = (process.env.BASE_PATH || "/").replace(/\/?$/, "/");
|
|
4
|
-
const isApp = () => fs.existsSync(path.join(process.cwd(), "app"));
|
|
5
|
-
const getAppConfig = () => {
|
|
6
|
-
const appConfigPath = path.join(
|
|
7
|
-
process.cwd(),
|
|
8
|
-
isApp() ? "app" : "lib",
|
|
9
|
-
"app.config.json"
|
|
10
|
-
);
|
|
11
|
-
if (!fs.existsSync(appConfigPath))
|
|
12
|
-
return "{}";
|
|
13
|
-
const appConfig = fs.readFileSync(appConfigPath);
|
|
14
|
-
return appConfig || "{}";
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
basePath,
|
|
18
|
-
getAppConfig,
|
|
19
|
-
isApp
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const findMonoRepoRoot: (cwd?: string) => string | null;
|
package/dist/types/utils.d.ts
DELETED