@elliemae/pui-cli 8.62.2 → 9.0.0-alpha.10
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 +43 -0
- package/app.tsconfig.json +1 -1
- package/build/docs/404.html +16 -0
- package/build/docs/api/functions/loadRoutes/index.html +22 -0
- package/build/docs/api/index.html +22 -0
- package/build/docs/api/type-aliases/LIB_NAME/index.html +17 -0
- package/build/docs/api/variables/babelConfig/index.html +40 -0
- package/build/docs/api/variables/commitlintConfig/index.html +20 -0
- package/build/docs/api/variables/eslintBaseConfig/index.html +132 -0
- package/build/docs/api/variables/eslintConfig/index.html +180 -0
- package/build/docs/api/variables/eslintFlatBaseConfig/index.html +18 -0
- package/build/docs/api/variables/eslintFlatBaseConfigStrict/index.html +18 -0
- package/build/docs/api/variables/eslintFlatConfig/index.html +18 -0
- package/build/docs/api/variables/eslintFlatConfigStrict/index.html +18 -0
- package/build/docs/api/variables/jestConfig/index.html +98 -0
- package/build/docs/api/variables/jestNodeConfig/index.html +98 -0
- package/build/docs/api/variables/lintStagedConfig/index.html +24 -0
- package/build/docs/api/variables/prettierConfig/index.html +30 -0
- package/build/docs/api/variables/stylelintConfig/index.html +17 -0
- package/build/docs/api/variables/vitestConfig/index.html +17 -0
- package/build/docs/assets/css/styles.74603f39.css +1 -0
- package/build/docs/assets/js/04ee7372.eaa386ed.js +1 -0
- package/build/docs/assets/js/0551d4dd.ebb18f4f.js +1 -0
- package/build/docs/assets/js/0a1d0315.fc8f91a7.js +1 -0
- package/build/docs/assets/js/1126.fa547e9c.js +1 -0
- package/build/docs/assets/js/1127.f28430e6.js +1 -0
- package/build/docs/assets/js/1298.fb0939c9.js +1 -0
- package/build/docs/assets/js/13097d8d.c1821d28.js +1 -0
- package/build/docs/assets/js/1617.b2623271.js +1 -0
- package/build/docs/assets/js/16b7bc88.c3779e27.js +1 -0
- package/build/docs/assets/js/1700.4f7a9007.js +1 -0
- package/build/docs/assets/js/17896441.84339068.js +1 -0
- package/build/docs/assets/js/1b9df811.aaa95da1.js +1 -0
- package/build/docs/assets/js/213.e69351b3.js +1 -0
- package/build/docs/assets/js/2297.e63290f4.js +1 -0
- package/build/docs/assets/js/232a0286.33b2782b.js +1 -0
- package/build/docs/assets/js/2399.cc5803e0.js +1 -0
- package/build/docs/assets/js/242.73516ab6.js +1 -0
- package/build/docs/assets/js/247.e1522e52.js +1 -0
- package/build/docs/assets/js/2673.da75a556.js +1 -0
- package/build/docs/assets/js/2805.f0505f8c.js +1 -0
- package/build/docs/assets/js/3395.eb3dad5b.js +1 -0
- package/build/docs/assets/js/3499.2d5c6821.js +1 -0
- package/build/docs/assets/js/3552.9272c0d9.js +1 -0
- package/build/docs/assets/js/3720.8e7f36d4.js +2 -0
- package/build/docs/assets/js/3720.8e7f36d4.js.LICENSE.txt +9 -0
- package/build/docs/assets/js/37d86055.47211796.js +1 -0
- package/build/docs/assets/js/3992.0ac29b2f.js +2 -0
- package/build/docs/assets/js/3992.0ac29b2f.js.LICENSE.txt +1 -0
- package/build/docs/assets/js/4069.301f1115.js +1 -0
- package/build/docs/assets/js/4134.553b3645.js +1 -0
- package/build/docs/assets/js/4257.9afce6ac.js +1 -0
- package/build/docs/assets/js/4772.6294b364.js +1 -0
- package/build/docs/assets/js/4884.9dbe23e5.js +1 -0
- package/build/docs/assets/js/4fb6949f.369cc1b9.js +1 -0
- package/build/docs/assets/js/5196.98f7e06a.js +1 -0
- package/build/docs/assets/js/5248.ee436cea.js +1 -0
- package/build/docs/assets/js/5428.71752e9a.js +1 -0
- package/build/docs/assets/js/5964.0728ed91.js +1 -0
- package/build/docs/assets/js/5968.5f4ccba7.js +1 -0
- package/build/docs/assets/js/5befad71.5f19afb5.js +1 -0
- package/build/docs/assets/js/5d5f1db0.c5aa5afa.js +1 -0
- package/build/docs/assets/js/5e8c322a.ef3b894b.js +1 -0
- package/build/docs/assets/js/5e95c892.f550b901.js +1 -0
- package/build/docs/assets/js/5fb3c522.da5628e8.js +1 -0
- package/build/docs/assets/js/6486.68ae0007.js +1 -0
- package/build/docs/assets/js/6704.2615a5c6.js +1 -0
- package/build/docs/assets/js/6bd11e52.08b95209.js +1 -0
- package/build/docs/assets/js/6e96545e.30c1b801.js +1 -0
- package/build/docs/assets/js/7080.efd5ba6c.js +1 -0
- package/build/docs/assets/js/71f6d02b.cfd98385.js +1 -0
- package/build/docs/assets/js/7201.e90ba636.js +1 -0
- package/build/docs/assets/js/7344.95656e38.js +1 -0
- package/build/docs/assets/js/7516.b6668d60.js +1 -0
- package/build/docs/assets/js/7525.a8d0db87.js +1 -0
- package/build/docs/assets/js/7540.7a4353cf.js +1 -0
- package/build/docs/assets/js/7985.8c6943d6.js +1 -0
- package/build/docs/assets/js/8049.8ba75278.js +1 -0
- package/build/docs/assets/js/80e87108.f9507b95.js +1 -0
- package/build/docs/assets/js/8152.f2bebb2f.js +1 -0
- package/build/docs/assets/js/821.8d4e2a80.js +1 -0
- package/build/docs/assets/js/8290.a4f7a2ca.js +1 -0
- package/build/docs/assets/js/8355.864847a1.js +1 -0
- package/build/docs/assets/js/8389.26a9caca.js +1 -0
- package/build/docs/assets/js/8585.3cb09ff7.js +1 -0
- package/build/docs/assets/js/8788.03856709.js +1 -0
- package/build/docs/assets/js/9178.50ac2954.js +1 -0
- package/build/docs/assets/js/9210.1ac21da8.js +1 -0
- package/build/docs/assets/js/9354.37ad86f9.js +1 -0
- package/build/docs/assets/js/936.c151b43f.js +1 -0
- package/build/docs/assets/js/9574.b172d607.js +1 -0
- package/build/docs/assets/js/97.70eddfb5.js +1 -0
- package/build/docs/assets/js/9852.f77caf52.js +1 -0
- package/build/docs/assets/js/9953.f6278635.js +1 -0
- package/build/docs/assets/js/a7bd4aaa.30ffad02.js +1 -0
- package/build/docs/assets/js/a94703ab.f1796514.js +1 -0
- package/build/docs/assets/js/aba21aa0.3bbcf0cc.js +1 -0
- package/build/docs/assets/js/b7b585d8.6d53e73f.js +1 -0
- package/build/docs/assets/js/b8ac1d98.62684003.js +1 -0
- package/build/docs/assets/js/bde5209a.f5bca8b2.js +1 -0
- package/build/docs/assets/js/c377a04b.0f8625c6.js +1 -0
- package/build/docs/assets/js/dfd75424.51c4e2cb.js +1 -0
- package/build/docs/assets/js/e5f79924.c793a74d.js +1 -0
- package/build/docs/assets/js/f736c962.dbd0d004.js +1 -0
- package/build/docs/assets/js/main.00e13c37.js +2 -0
- package/build/docs/assets/js/main.00e13c37.js.LICENSE.txt +51 -0
- package/build/docs/assets/js/runtime~main.cb214d1a.js +1 -0
- package/build/docs/eslint-rules-migration/index.html +135 -0
- package/build/docs/img/favicon.ico +0 -0
- package/build/docs/img/logo.jpeg +0 -0
- package/build/docs/img/logo.svg +22 -0
- package/build/docs/img/readme.md +1 -0
- package/build/docs/index.html +179 -0
- package/build/docs/pui-cli-9-migration/index.html +150 -0
- package/build/docs/readme.md +1 -0
- package/build/docs/sitemap.xml +1 -0
- package/build/docs/ssl-certificate-setup/index.html +284 -0
- package/build/docs/stylelint-migration/index.html +57 -0
- package/build/docs/usage-guide/index.html +439 -0
- package/dist/cjs/cli.js +3 -13
- package/dist/cjs/commands/build.js +1 -2
- package/dist/cjs/commands/buildcdn.js +1 -2
- package/dist/cjs/commands/codemod.js +1 -12
- package/dist/cjs/commands/gendoc.js +1 -2
- package/dist/cjs/commands/lint.js +11 -9
- package/dist/cjs/commands/pack.js +1 -2
- package/dist/cjs/commands/skills.js +206 -0
- package/dist/cjs/commands/start.js +1 -2
- package/dist/cjs/commands/storybook.js +1 -12
- package/dist/cjs/commands/test.js +1 -13
- package/dist/cjs/commands/tscheck.js +1 -2
- package/dist/cjs/commands/utils.js +16 -12
- package/dist/cjs/commands/version.js +1 -12
- package/dist/cjs/commands/vitest.js +1 -13
- package/dist/cjs/index.cjs +13 -1
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/lint-config/eslint/common.cjs +1 -1
- package/dist/cjs/lint-config/eslint/flat/common.mjs +169 -0
- package/dist/cjs/lint-config/eslint/flat/compat.mjs +27 -0
- package/dist/cjs/lint-config/eslint/flat/index.mjs +21 -0
- package/dist/cjs/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/dist/cjs/lint-config/eslint/flat/non-react.mjs +6 -0
- package/dist/cjs/lint-config/eslint/flat/presets.mjs +96 -0
- package/dist/cjs/lint-config/eslint/flat/react-export.mjs +7 -0
- package/dist/cjs/lint-config/eslint/flat/react.mjs +59 -0
- package/dist/cjs/lint-config/eslint/flat/rules.mjs +185 -0
- package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +1 -1
- package/dist/cjs/lint-config/eslint/typescript/react.cjs +1 -1
- package/dist/cjs/lint-config/stylelint/config.mjs +27 -0
- package/dist/cjs/lint-config/stylelint/export.mjs +1 -0
- package/dist/cjs/lint-config/stylelint.config.cjs +3 -19
- package/dist/cjs/monorepo/utils.cjs +16 -8
- package/dist/cjs/monorepo/utils.js +5 -8
- package/dist/cjs/{release.config.cjs → release.config.mjs} +3 -2
- package/dist/cjs/{semantic-release-plugin.cjs → semantic-release-plugin.mjs} +3 -3
- package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +271 -0
- package/dist/cjs/testing/jest.config.cjs +5 -9
- package/dist/cjs/testing/resolver.cjs +1 -1
- package/dist/cjs/testing/setup-react-env.js +1 -1
- package/dist/cjs/testing/vitest.config.js +2 -1
- package/dist/cjs/transpile/esbuild.js +1 -1
- package/dist/cjs/webpack/csp-plugin.js +2 -4
- package/dist/cjs/webpack/helpers.js +2 -6
- package/dist/cjs/webpack/prop-types-shim.js +0 -1
- package/dist/cjs/webpack/webpack.dev.babel.js +1 -23
- package/dist/cjs/webpack/webpack.lib.base.babel.js +0 -8
- package/dist/esm/cli.js +3 -13
- package/dist/esm/commands/build.js +1 -2
- package/dist/esm/commands/buildcdn.js +1 -2
- package/dist/esm/commands/codemod.js +1 -2
- package/dist/esm/commands/gendoc.js +1 -2
- package/dist/esm/commands/lint.js +11 -9
- package/dist/esm/commands/pack.js +1 -2
- package/dist/esm/commands/skills.js +175 -0
- package/dist/esm/commands/start.js +1 -2
- package/dist/esm/commands/storybook.js +1 -2
- package/dist/esm/commands/test.js +1 -3
- package/dist/esm/commands/tscheck.js +1 -2
- package/dist/esm/commands/utils.js +17 -13
- package/dist/esm/commands/version.js +1 -2
- package/dist/esm/commands/vitest.js +1 -3
- package/dist/esm/index.cjs +13 -1
- package/dist/esm/index.js +13 -1
- package/dist/esm/lint-config/eslint/common.cjs +1 -1
- package/dist/esm/lint-config/eslint/flat/common.mjs +169 -0
- package/dist/esm/lint-config/eslint/flat/compat.mjs +27 -0
- package/dist/esm/lint-config/eslint/flat/index.mjs +21 -0
- package/dist/esm/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/dist/esm/lint-config/eslint/flat/non-react.mjs +6 -0
- package/dist/esm/lint-config/eslint/flat/presets.mjs +96 -0
- package/dist/esm/lint-config/eslint/flat/react-export.mjs +7 -0
- package/dist/esm/lint-config/eslint/flat/react.mjs +59 -0
- package/dist/esm/lint-config/eslint/flat/rules.mjs +185 -0
- package/dist/esm/lint-config/eslint/typescript/non-react.cjs +1 -1
- package/dist/esm/lint-config/eslint/typescript/react.cjs +1 -1
- package/dist/esm/lint-config/stylelint/config.mjs +27 -0
- package/dist/esm/lint-config/stylelint/export.mjs +1 -0
- package/dist/esm/lint-config/stylelint.config.cjs +3 -19
- package/dist/esm/monorepo/utils.cjs +16 -8
- package/dist/esm/monorepo/utils.js +5 -8
- package/dist/esm/{release.config.cjs → release.config.mjs} +3 -2
- package/dist/esm/{semantic-release-plugin.cjs → semantic-release-plugin.mjs} +3 -3
- package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +271 -0
- package/dist/esm/testing/jest.config.cjs +5 -9
- package/dist/esm/testing/resolver.cjs +1 -1
- package/dist/esm/testing/setup-react-env.js +1 -1
- package/dist/esm/testing/vitest.config.js +2 -1
- package/dist/esm/transpile/esbuild.js +1 -1
- package/dist/esm/webpack/csp-plugin.js +2 -4
- package/dist/esm/webpack/helpers.js +2 -6
- package/dist/esm/webpack/prop-types-shim.js +0 -1
- package/dist/esm/webpack/webpack.dev.babel.js +2 -26
- package/dist/esm/webpack/webpack.lib.base.babel.js +0 -8
- package/dist/types/docusaurus.config.d.ts +3 -2
- package/dist/types/lib/commands/build.d.ts +1 -1
- package/dist/types/lib/commands/buildcdn.d.ts +1 -1
- package/dist/types/lib/commands/codemod.d.ts +1 -1
- package/dist/types/lib/commands/gendoc.d.ts +1 -1
- package/dist/types/lib/commands/lint.d.ts +1 -1
- package/dist/types/lib/commands/pack.d.ts +1 -1
- package/dist/types/lib/commands/skills.d.ts +11 -0
- package/dist/types/lib/commands/start.d.ts +1 -1
- package/dist/types/lib/commands/storybook.d.ts +1 -1
- package/dist/types/lib/commands/test.d.ts +1 -1
- package/dist/types/lib/commands/tscheck.d.ts +1 -1
- package/dist/types/lib/commands/utils.d.ts +43 -2
- package/dist/types/lib/commands/version.d.ts +1 -1
- package/dist/types/lib/commands/vitest.d.ts +1 -1
- package/dist/types/lib/index.d.cts +6 -2
- package/dist/types/lib/index.d.ts +5 -1
- package/dist/types/lib/lint-config/eslint/flat/common.d.mts +6 -0
- package/dist/types/lib/lint-config/eslint/flat/compat.d.mts +9 -0
- package/dist/types/lib/lint-config/eslint/flat/index.d.mts +6 -0
- package/dist/types/lib/lint-config/eslint/flat/non-react-export.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/non-react.d.mts +3 -0
- package/dist/types/lib/lint-config/eslint/flat/presets.d.mts +34 -0
- package/dist/types/lib/lint-config/eslint/flat/react-export.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/react.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/rules.d.mts +361 -0
- package/dist/types/lib/lint-config/stylelint/config.d.mts +3 -0
- package/dist/types/lib/lint-config/stylelint/export.d.mts +1 -0
- package/dist/types/lib/lint-config/stylelint.config.d.cts +2 -10
- package/dist/types/lib/release.config.d.mts +10 -0
- package/dist/types/lib/semantic-release-plugin.d.mts +4 -0
- package/dist/types/lib/server/appRoutes.d.ts +1 -1
- package/dist/types/lib/server/csp.d.ts +1 -1
- package/dist/types/lib/server/middlewares.d.ts +1 -1
- package/dist/types/lib/webpack/csp-plugin.d.ts +3 -3
- package/dist/types/lib/webpack/helpers.d.ts +1 -6
- package/dist/types/lib/webpack/interceptor-middleware.d.ts +2 -2
- package/dist/types/lib/webpack/webpack.base.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.lib.base.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.lib.prod.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.prod.babel.d.ts +1 -1
- package/dist/types/lib/webpack/webpack.storybook.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/commitlint.config.cjs +1 -0
- package/lib/lint-config/eslint/common.cjs +164 -0
- package/lib/lint-config/eslint/flat/common.mjs +169 -0
- package/lib/lint-config/eslint/flat/compat.mjs +27 -0
- package/lib/lint-config/eslint/flat/index.mjs +21 -0
- package/lib/lint-config/eslint/flat/non-react-export.mjs +10 -0
- package/lib/lint-config/eslint/flat/non-react.mjs +6 -0
- package/lib/lint-config/eslint/flat/presets.mjs +96 -0
- package/lib/lint-config/eslint/flat/react-export.mjs +7 -0
- package/lib/lint-config/eslint/flat/react.mjs +59 -0
- package/lib/lint-config/eslint/flat/rules.mjs +185 -0
- package/lib/lint-config/eslint/non-react.cjs +14 -0
- package/lib/lint-config/eslint/react.cjs +26 -0
- package/lib/lint-config/eslint/typescript/common.cjs +49 -0
- package/lib/lint-config/eslint/typescript/non-react.cjs +12 -0
- package/lib/lint-config/eslint/typescript/react.cjs +19 -0
- package/lib/lint-config/lint-staged.config.js +15 -0
- package/lib/lint-config/prettier.config.cjs +8 -0
- package/lib/lint-config/stylelint/config.mjs +27 -0
- package/lib/lint-config/stylelint/export.mjs +1 -0
- package/lib/lint-config/stylelint.config.cjs +3 -0
- package/lib/release.config.mjs +28 -0
- package/lib/semantic-release-plugin.mjs +30 -0
- package/lib/skills/migrate-to-pui-cli-9/SKILL.md +271 -0
- package/library.tsconfig.json +1 -1
- package/package.json +103 -89
- package/dist/cjs/server/versionPathMiddleware.js +0 -44
- package/dist/cjs/testing/setup-env.js +0 -8
- package/dist/esm/server/versionPathMiddleware.js +0 -24
- package/dist/esm/testing/setup-env.js +0 -7
- package/dist/types/lib/release.config.d.cts +0 -7
- package/dist/types/lib/semantic-release-plugin.d.cts +0 -1
- package/dist/types/lib/server/versionPathMiddleware.d.ts +0 -8
- package/dist/types/lib/testing/setup-env.d.ts +0 -1
|
@@ -48,11 +48,12 @@ const vitestConfig = (0, import_config.defineConfig)({
|
|
|
48
48
|
include: ["./{app,lib}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
49
49
|
exclude: [...import_config.configDefaults.exclude, ".idea", ".git", ".cache", "e2e"],
|
|
50
50
|
coverage: {
|
|
51
|
+
provider: "v8",
|
|
51
52
|
reportsDirectory: "./reports/coverage"
|
|
52
53
|
},
|
|
53
54
|
deps: {
|
|
54
55
|
optimizer: {
|
|
55
|
-
|
|
56
|
+
client: {
|
|
56
57
|
include: ["app.config.json", "@elliemae/pui-app-sdk"]
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -65,7 +65,7 @@ const copyFiles = async ({ srcdir, outdir }) => {
|
|
|
65
65
|
const files = await (0, import_fast_glob.default)([
|
|
66
66
|
`${srcdir}/**/*.*`,
|
|
67
67
|
`${srcdir}/**/.swcrc`,
|
|
68
|
-
`!${srcdir}/**/*.{js,jsx,ts,tsx
|
|
68
|
+
`!${srcdir}/**/*.{js,jsx,ts,tsx}`
|
|
69
69
|
]);
|
|
70
70
|
await Promise.all(
|
|
71
71
|
files.map(async (srcFilePath) => {
|
|
@@ -38,14 +38,12 @@ const defaultOptions = {
|
|
|
38
38
|
};
|
|
39
39
|
class CspPlugin {
|
|
40
40
|
#options = defaultOptions;
|
|
41
|
-
#htmlWebpackPlugin;
|
|
42
41
|
/**
|
|
43
42
|
*
|
|
44
|
-
* @param
|
|
43
|
+
* @param _htmlWebpackPlugin
|
|
45
44
|
* @param {object} options Additional options for this module.
|
|
46
45
|
*/
|
|
47
|
-
constructor(
|
|
48
|
-
this.#htmlWebpackPlugin = htmlWebpackPlugin;
|
|
46
|
+
constructor(_htmlWebpackPlugin, options) {
|
|
49
47
|
this.#options = { ...this.#options, ...options ?? {} };
|
|
50
48
|
}
|
|
51
49
|
/**
|
|
@@ -42,7 +42,6 @@ __export(helpers_exports, {
|
|
|
42
42
|
htmlFilesToExclude: () => htmlFilesToExclude,
|
|
43
43
|
isAppLoaderEnabled: () => isAppLoaderEnabled,
|
|
44
44
|
isGoogleTagManagerEnabled: () => isGoogleTagManagerEnabled,
|
|
45
|
-
isVersionedDevEnabled: () => isVersionedDevEnabled,
|
|
46
45
|
mainFields: () => mainFields,
|
|
47
46
|
mapToFolder: () => mapToFolder,
|
|
48
47
|
modulesToTranspile: () => modulesToTranspile,
|
|
@@ -196,12 +195,9 @@ const getENCWLoaderFileName = () => {
|
|
|
196
195
|
};
|
|
197
196
|
const getAppVersion = () => {
|
|
198
197
|
if (!process.env.APP_VERSION) return LATEST_VERSION;
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
const shortMatch = process.env.APP_VERSION.match(/^v?(\d+\.\d+)$/);
|
|
202
|
-
return shortMatch && shortMatch[1] || LATEST_VERSION;
|
|
198
|
+
const match = process.env.APP_VERSION.match(/^v?(\d+\.\d+)\..*$/);
|
|
199
|
+
return match && match[1] || LATEST_VERSION;
|
|
203
200
|
};
|
|
204
|
-
const isVersionedDevEnabled = () => getAppVersion() !== LATEST_VERSION;
|
|
205
201
|
const getPaths = (latestVersion = true) => {
|
|
206
202
|
const version = latestVersion ? LATEST_VERSION : getAppVersion();
|
|
207
203
|
const publicPath = `${version}/`;
|
|
@@ -48,7 +48,6 @@ const shim = function noop() {
|
|
|
48
48
|
shim.isRequired = shim;
|
|
49
49
|
const createPropTypes = () => {
|
|
50
50
|
const handler = {
|
|
51
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
52
51
|
get(_target, prop) {
|
|
53
52
|
if (prop === "__esModule") return true;
|
|
54
53
|
if (prop === "default") return pt;
|
|
@@ -39,10 +39,8 @@ var import_circular_dependency_plugin = __toESM(require("circular-dependency-plu
|
|
|
39
39
|
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
|
|
40
40
|
var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"), 1);
|
|
41
41
|
var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
|
|
42
|
-
var import_copy_webpack_plugin = __toESM(require("copy-webpack-plugin"), 1);
|
|
43
42
|
var import_interceptor_middleware = require("./interceptor-middleware.js");
|
|
44
43
|
var import_middlewares = require("../server/middlewares.js");
|
|
45
|
-
var import_versionPathMiddleware = require("../server/versionPathMiddleware.js");
|
|
46
44
|
var import_appRoutes = require("../server/appRoutes.js");
|
|
47
45
|
var import_helpers = require("./helpers.js");
|
|
48
46
|
var import_webpack_base_babel = require("./webpack.base.babel.js");
|
|
@@ -62,7 +60,7 @@ const {
|
|
|
62
60
|
diagnosticsScriptPath,
|
|
63
61
|
encwLoaderScriptPath,
|
|
64
62
|
logRocketScriptPath
|
|
65
|
-
} = (0, import_helpers.getPaths)(
|
|
63
|
+
} = (0, import_helpers.getPaths)();
|
|
66
64
|
const serverOptions = {
|
|
67
65
|
type: "https",
|
|
68
66
|
options: (0, import_cert.getCertOptions)()
|
|
@@ -173,14 +171,6 @@ const devConfig = {
|
|
|
173
171
|
server: (0, import_utils2.isHttps)() ? serverOptions : {},
|
|
174
172
|
setupMiddlewares: (middlewares, devServer) => {
|
|
175
173
|
(0, import_interceptor_middleware.addCSPNonceMiddleware)(middlewares);
|
|
176
|
-
if ((0, import_helpers.isVersionedDevEnabled)()) {
|
|
177
|
-
middlewares.unshift({
|
|
178
|
-
name: "versioned-path-rewrite",
|
|
179
|
-
middleware: (0, import_versionPathMiddleware.versionedPathRewriteMiddleware)(
|
|
180
|
-
basePath
|
|
181
|
-
)
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
174
|
if (devServer.app) {
|
|
185
175
|
(0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
|
|
186
176
|
(0, import_appRoutes.loadRoutes)(devServer.app).then(() => {
|
|
@@ -210,16 +200,4 @@ const devConfig = {
|
|
|
210
200
|
};
|
|
211
201
|
const config = (0, import_webpack_base_babel.baseConfig)(devConfig);
|
|
212
202
|
config.plugins = config.plugins ? config.plugins.concat([new import_react_refresh_webpack_plugin.default({})]) : [];
|
|
213
|
-
if ((0, import_helpers.isVersionedDevEnabled)()) {
|
|
214
|
-
config.plugins = config.plugins.concat([
|
|
215
|
-
new import_copy_webpack_plugin.default({
|
|
216
|
-
patterns: (0, import_helpers.filterByFilePresence)([
|
|
217
|
-
{
|
|
218
|
-
from: "app/app.config.json",
|
|
219
|
-
to: `./${appVersion}/app.config.json`
|
|
220
|
-
}
|
|
221
|
-
])
|
|
222
|
-
})
|
|
223
|
-
]);
|
|
224
|
-
}
|
|
225
203
|
var webpack_dev_babel_default = config;
|
|
@@ -68,13 +68,11 @@ const plugins = [
|
|
|
68
68
|
new import_webpack.default.DefinePlugin({
|
|
69
69
|
APP_CONFIG: (0, import_utils.getAppConfig)()
|
|
70
70
|
}),
|
|
71
|
-
/* eslint-disable indent */
|
|
72
71
|
...copyPluginPatterns.length > 0 ? [
|
|
73
72
|
new import_copy_webpack_plugin.default({
|
|
74
73
|
patterns: copyPluginPatterns
|
|
75
74
|
})
|
|
76
75
|
] : [],
|
|
77
|
-
/* eslint-enable indent */
|
|
78
76
|
new import_webpack.default.optimize.LimitChunkCountPlugin({
|
|
79
77
|
maxChunks: 1
|
|
80
78
|
}),
|
|
@@ -96,7 +94,6 @@ const baseConfig = (options) => ({
|
|
|
96
94
|
// Merge with env dependent settings
|
|
97
95
|
optimization: options.optimization,
|
|
98
96
|
module: {
|
|
99
|
-
/* eslint-disable indent */
|
|
100
97
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
101
98
|
parser: {
|
|
102
99
|
javascript: {
|
|
@@ -104,7 +101,6 @@ const baseConfig = (options) => ({
|
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
103
|
} : {},
|
|
107
|
-
/* eslint-enable indent */
|
|
108
104
|
rules: [
|
|
109
105
|
{
|
|
110
106
|
test: /^(?!.*\.exec\.js$).*\.jsx?$/,
|
|
@@ -117,13 +113,11 @@ const baseConfig = (options) => ({
|
|
|
117
113
|
loader: "esbuild-loader",
|
|
118
114
|
options: {
|
|
119
115
|
target: (0, import_browserslist_to_esbuild.default)(),
|
|
120
|
-
/* eslint-disable indent */
|
|
121
116
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
122
117
|
supported: {
|
|
123
118
|
"import-meta": true
|
|
124
119
|
}
|
|
125
120
|
} : {}
|
|
126
|
-
/* eslint-enable indent */
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
123
|
},
|
|
@@ -138,13 +132,11 @@ const baseConfig = (options) => ({
|
|
|
138
132
|
loader: "esbuild-loader",
|
|
139
133
|
options: {
|
|
140
134
|
target: (0, import_browserslist_to_esbuild.default)(),
|
|
141
|
-
/* eslint-disable indent */
|
|
142
135
|
...process.env.KEEP_IMPORT_META === "true" ? {
|
|
143
136
|
supported: {
|
|
144
137
|
"import-meta": true
|
|
145
138
|
}
|
|
146
139
|
} : {}
|
|
147
|
-
/* eslint-enable indent */
|
|
148
140
|
}
|
|
149
141
|
}
|
|
150
142
|
},
|
package/dist/esm/cli.js
CHANGED
|
@@ -17,21 +17,11 @@ import { vitestCmd } from "./commands/vitest.js";
|
|
|
17
17
|
import { versionCmd } from "./commands/version.js";
|
|
18
18
|
import { tscheckCmd } from "./commands/tscheck.js";
|
|
19
19
|
import { buildCDNCmd } from "./commands/buildcdn.js";
|
|
20
|
+
import { skillsCmd } from "./commands/skills.js";
|
|
20
21
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
-
envConfig();
|
|
22
|
+
envConfig({ quiet: true });
|
|
22
23
|
process.env.PATH += path.delimiter + path.join(__dirname, "..", "node_modules", ".bin");
|
|
23
24
|
(async () => {
|
|
24
|
-
await yargs(hideBin(process.argv)).command(buildCmd).help().
|
|
25
|
-
await yargs(hideBin(process.argv)).command(packCmd).help().argv;
|
|
26
|
-
await yargs(hideBin(process.argv)).command(startCmd).help().argv;
|
|
27
|
-
await yargs(hideBin(process.argv)).command(testCmd).help().argv;
|
|
28
|
-
await yargs(hideBin(process.argv)).command(lintCmd).help().argv;
|
|
29
|
-
await yargs(hideBin(process.argv)).command(gendocCmd).help().argv;
|
|
30
|
-
await yargs(hideBin(process.argv)).command(codemodCmd).help().argv;
|
|
31
|
-
await yargs(hideBin(process.argv)).command(storybookCmd).help().argv;
|
|
32
|
-
await yargs(hideBin(process.argv)).command(vitestCmd).help().argv;
|
|
33
|
-
await yargs(hideBin(process.argv)).command(versionCmd).help().argv;
|
|
34
|
-
await yargs(hideBin(process.argv)).command(tscheckCmd).help().argv;
|
|
35
|
-
await yargs(hideBin(process.argv)).command(buildCDNCmd).help().argv;
|
|
25
|
+
await yargs(hideBin(process.argv)).command(buildCmd).command(packCmd).command(startCmd).command(testCmd).command(lintCmd).command(gendocCmd).command(codemodCmd).command(storybookCmd).command(vitestCmd).command(versionCmd).command(tscheckCmd).command(buildCDNCmd).command(skillsCmd).help().parseAsync();
|
|
36
26
|
await notifyUpdates();
|
|
37
27
|
})();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import yargs from "yargs";
|
|
4
3
|
import {
|
|
5
4
|
exec,
|
|
6
5
|
logInfo,
|
|
@@ -50,7 +49,7 @@ const buildCmd = {
|
|
|
50
49
|
logSuccess("Build completed");
|
|
51
50
|
} catch (err) {
|
|
52
51
|
logError("Build failed", err);
|
|
53
|
-
|
|
52
|
+
process.exit(1);
|
|
54
53
|
}
|
|
55
54
|
},
|
|
56
55
|
command: "build",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import fg from "fast-glob";
|
|
4
|
-
import yargs from "yargs";
|
|
5
4
|
import { exec, logInfo, logError, logSuccess } from "./utils.js";
|
|
6
5
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
6
|
const buildCDN = async () => {
|
|
@@ -31,7 +30,7 @@ const buildCDNCmd = {
|
|
|
31
30
|
logSuccess("CDN Build completed");
|
|
32
31
|
} catch (err) {
|
|
33
32
|
logError("Build failed", err);
|
|
34
|
-
|
|
33
|
+
process.exit(1);
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
command: "buildCDN",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yargs from "yargs";
|
|
2
1
|
import { exec, logInfo, logError, logSuccess } from "./utils.js";
|
|
3
2
|
const transform = async (argv) => {
|
|
4
3
|
logInfo("Code modification in-progress...");
|
|
@@ -11,7 +10,7 @@ const codemodCmd = {
|
|
|
11
10
|
logSuccess("Code modifications completed. ");
|
|
12
11
|
} catch (err) {
|
|
13
12
|
logError("Code modifications failed", err);
|
|
14
|
-
|
|
13
|
+
process.exit(1);
|
|
15
14
|
}
|
|
16
15
|
},
|
|
17
16
|
command: "codemod <transform>",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import yargs from "yargs";
|
|
4
3
|
import { exec, logInfo, logSuccess, logError } from "./utils.js";
|
|
5
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
5
|
const generateDocs = async () => {
|
|
@@ -14,7 +13,7 @@ const gendocCmd = {
|
|
|
14
13
|
logSuccess("Document generation completed. ");
|
|
15
14
|
} catch (err) {
|
|
16
15
|
logError("Document generation failed", err);
|
|
17
|
-
|
|
16
|
+
process.exit(1);
|
|
18
17
|
}
|
|
19
18
|
},
|
|
20
19
|
command: "gendoc",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import fs from "node:fs";
|
|
2
3
|
import { inspect } from "node:util";
|
|
3
|
-
import yargs from "yargs";
|
|
4
4
|
import {
|
|
5
5
|
exec,
|
|
6
6
|
logInfo,
|
|
@@ -9,21 +9,23 @@ import {
|
|
|
9
9
|
getCIEnv,
|
|
10
10
|
isTypeScriptEnabled
|
|
11
11
|
} from "./utils.js";
|
|
12
|
+
const resolveStylelintConfigPath = () => {
|
|
13
|
+
const mjsPath = path.join(process.cwd(), "stylelint.config.mjs");
|
|
14
|
+
if (fs.existsSync(mjsPath)) return mjsPath;
|
|
15
|
+
return path.join(process.cwd(), "stylelint.config.cjs");
|
|
16
|
+
};
|
|
12
17
|
const lintCSS = async (args) => {
|
|
13
18
|
const fixIssues = args.fix ? "--fix" : "";
|
|
19
|
+
const configPath = resolveStylelintConfigPath();
|
|
14
20
|
if (args.debug) {
|
|
15
|
-
const configPath = path.join(process.cwd(), "stylelint.config.cjs");
|
|
16
21
|
const config = await import(configPath);
|
|
17
22
|
logInfo("stylelint version:");
|
|
18
23
|
await exec(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
|
|
19
24
|
logInfo("stylelint config:");
|
|
20
|
-
logInfo(inspect(config, { depth: null }));
|
|
25
|
+
logInfo(inspect(config.default ?? config, { depth: null }));
|
|
21
26
|
}
|
|
22
27
|
await exec(
|
|
23
|
-
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!getCIEnv() ? "--color" : "--no-color"} --allow-empty-input --config ${
|
|
24
|
-
process.cwd(),
|
|
25
|
-
"stylelint.config.cjs"
|
|
26
|
-
)}`
|
|
28
|
+
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!getCIEnv() ? "--color" : "--no-color"} --allow-empty-input --config ${configPath}`
|
|
27
29
|
);
|
|
28
30
|
};
|
|
29
31
|
const lintJS = async (args) => {
|
|
@@ -67,7 +69,7 @@ const lintCmd = {
|
|
|
67
69
|
} catch (err) {
|
|
68
70
|
logError("JS linting failed");
|
|
69
71
|
if (argv.debug) logError(err);
|
|
70
|
-
|
|
72
|
+
process.exit(1);
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
}
|
|
@@ -79,7 +81,7 @@ const lintCmd = {
|
|
|
79
81
|
} catch (err) {
|
|
80
82
|
logError("CSS linting failed");
|
|
81
83
|
if (argv.debug) logError(err);
|
|
82
|
-
|
|
84
|
+
process.exit(1);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import yargs from "yargs";
|
|
4
3
|
import {
|
|
5
4
|
exec,
|
|
6
5
|
logInfo,
|
|
@@ -73,7 +72,7 @@ const packCmd = {
|
|
|
73
72
|
logSuccess("Build completed");
|
|
74
73
|
} catch (err) {
|
|
75
74
|
logError("Build failed", err);
|
|
76
|
-
|
|
75
|
+
process.exit(1);
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
78
|
command: "pack",
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { access, copyFile, mkdir, readdir, stat } from "node:fs/promises";
|
|
5
|
+
import { constants } from "node:fs";
|
|
6
|
+
import { logError, logInfo, logSuccess, logWarning } from "./utils.js";
|
|
7
|
+
const SKILL_TARGETS = ["cursor", "claude", "copilot", "all"];
|
|
8
|
+
const TARGET_RELATIVE_DIRS = {
|
|
9
|
+
cursor: [".cursor", "skills"],
|
|
10
|
+
claude: [".claude", "skills"],
|
|
11
|
+
copilot: [".github", "skills"]
|
|
12
|
+
};
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const getPackageRoot = () => {
|
|
15
|
+
const require2 = createRequire(import.meta.url);
|
|
16
|
+
try {
|
|
17
|
+
return path.dirname(require2.resolve("@elliemae/pui-cli/package.json"));
|
|
18
|
+
} catch {
|
|
19
|
+
return path.resolve(__dirname, "..", "..");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const getBundledSkillsDir = () => path.join(getPackageRoot(), "lib", "skills");
|
|
23
|
+
const getTargetSkillsDir = (target) => path.join(process.cwd(), ...TARGET_RELATIVE_DIRS[target]);
|
|
24
|
+
const resolveTargets = (target) => {
|
|
25
|
+
const selected = target ? Array.isArray(target) ? target : [target] : ["cursor"];
|
|
26
|
+
if (selected.includes("all")) {
|
|
27
|
+
return ["cursor", "claude", "copilot"];
|
|
28
|
+
}
|
|
29
|
+
return selected;
|
|
30
|
+
};
|
|
31
|
+
const pathExists = async (targetPath) => {
|
|
32
|
+
try {
|
|
33
|
+
await access(targetPath, constants.F_OK);
|
|
34
|
+
return true;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const listSkillNames = async (skillsDir) => {
|
|
40
|
+
const entries = await readdir(skillsDir, { withFileTypes: true });
|
|
41
|
+
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
42
|
+
};
|
|
43
|
+
const copySkillDir = async (src, dest) => {
|
|
44
|
+
await mkdir(dest, { recursive: true });
|
|
45
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
46
|
+
await Promise.all(
|
|
47
|
+
entries.map(async (entry) => {
|
|
48
|
+
const srcPath = path.join(src, entry.name);
|
|
49
|
+
const destPath = path.join(dest, entry.name);
|
|
50
|
+
if (entry.isDirectory()) {
|
|
51
|
+
return copySkillDir(srcPath, destPath);
|
|
52
|
+
}
|
|
53
|
+
return copyFile(srcPath, destPath);
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
const installSkillToTarget = async (skillName, target, force) => {
|
|
58
|
+
const bundledDir = getBundledSkillsDir();
|
|
59
|
+
const src = path.join(bundledDir, skillName);
|
|
60
|
+
const dest = path.join(getTargetSkillsDir(target), skillName);
|
|
61
|
+
if (!await pathExists(src)) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`Skill "${skillName}" not found. Run "pui-cli skills list" for available skills.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
const srcStat = await stat(src);
|
|
67
|
+
if (!srcStat.isDirectory()) {
|
|
68
|
+
throw new Error(`Skill "${skillName}" is not a valid skill directory.`);
|
|
69
|
+
}
|
|
70
|
+
if (await pathExists(dest) && !force) {
|
|
71
|
+
logWarning(
|
|
72
|
+
`Skipped "${skillName}" for ${target} \u2014 already exists at ${dest}. Use --force to overwrite.`
|
|
73
|
+
);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
await copySkillDir(src, dest);
|
|
77
|
+
logSuccess(`Installed skill "${skillName}" to ${dest}`);
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
80
|
+
const installSkill = async (skillName, targets, force) => {
|
|
81
|
+
let installed = 0;
|
|
82
|
+
for (const target of targets) {
|
|
83
|
+
await mkdir(getTargetSkillsDir(target), { recursive: true });
|
|
84
|
+
if (await installSkillToTarget(skillName, target, force)) {
|
|
85
|
+
installed += 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return installed > 0;
|
|
89
|
+
};
|
|
90
|
+
const runList = async () => {
|
|
91
|
+
const bundledDir = getBundledSkillsDir();
|
|
92
|
+
if (!await pathExists(bundledDir)) {
|
|
93
|
+
throw new Error(`Bundled skills directory not found: ${bundledDir}`);
|
|
94
|
+
}
|
|
95
|
+
const skills = await listSkillNames(bundledDir);
|
|
96
|
+
if (!skills.length) {
|
|
97
|
+
logInfo("No bundled skills found.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
logInfo("Available skills:");
|
|
101
|
+
skills.forEach((name) => logInfo(` - ${name}`));
|
|
102
|
+
};
|
|
103
|
+
const logReloadHint = (targets) => {
|
|
104
|
+
const hints = [];
|
|
105
|
+
if (targets.includes("cursor")) {
|
|
106
|
+
hints.push("Cursor (.cursor/skills/)");
|
|
107
|
+
}
|
|
108
|
+
if (targets.includes("claude")) {
|
|
109
|
+
hints.push("Claude Code (.claude/skills/)");
|
|
110
|
+
}
|
|
111
|
+
if (targets.includes("copilot")) {
|
|
112
|
+
hints.push("GitHub Copilot (.github/skills/)");
|
|
113
|
+
}
|
|
114
|
+
if (hints.length) {
|
|
115
|
+
logInfo(
|
|
116
|
+
`Restart or reload your agent to pick up skills in: ${hints.join(", ")}.`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const runInstall = async (name, force, target) => {
|
|
121
|
+
const bundledDir = getBundledSkillsDir();
|
|
122
|
+
if (!await pathExists(bundledDir)) {
|
|
123
|
+
throw new Error(`Bundled skills directory not found: ${bundledDir}`);
|
|
124
|
+
}
|
|
125
|
+
const targets = resolveTargets(target);
|
|
126
|
+
const skills = name ? [name] : await listSkillNames(bundledDir);
|
|
127
|
+
if (!skills.length) {
|
|
128
|
+
logInfo("No bundled skills to install.");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
let installed = 0;
|
|
132
|
+
for (const skillName of skills) {
|
|
133
|
+
if (await installSkill(skillName, targets, force)) {
|
|
134
|
+
installed += 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (installed) {
|
|
138
|
+
logReloadHint(targets);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const skillsCmd = {
|
|
142
|
+
command: "skills <action> [name]",
|
|
143
|
+
describe: "Install bundled agent skills for Cursor, Claude Code, and GitHub Copilot",
|
|
144
|
+
builder: (yargsRef) => yargsRef.positional("action", {
|
|
145
|
+
describe: "List bundled skills or install them into the current repo",
|
|
146
|
+
choices: ["list", "install"],
|
|
147
|
+
demandOption: true
|
|
148
|
+
}).positional("name", {
|
|
149
|
+
describe: "Skill folder name (install all when omitted)",
|
|
150
|
+
type: "string"
|
|
151
|
+
}).option("target", {
|
|
152
|
+
describe: "Install destination: cursor (.cursor/skills), claude (.claude/skills), copilot (.github/skills), or all",
|
|
153
|
+
choices: [...SKILL_TARGETS],
|
|
154
|
+
default: "cursor"
|
|
155
|
+
}).option("force", {
|
|
156
|
+
describe: "Overwrite an existing skill directory",
|
|
157
|
+
type: "boolean",
|
|
158
|
+
default: false
|
|
159
|
+
}).help(),
|
|
160
|
+
handler: async (argv) => {
|
|
161
|
+
try {
|
|
162
|
+
if (argv.action === "list") {
|
|
163
|
+
await runList();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
await runInstall(argv.name, Boolean(argv.force), argv.target);
|
|
167
|
+
} catch (err) {
|
|
168
|
+
logError(err.message);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
export {
|
|
174
|
+
skillsCmd
|
|
175
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import yargs from "yargs";
|
|
4
3
|
import { exec, logError, logSuccess, isApp } from "./utils.js";
|
|
5
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
5
|
const startProdServer = async () => {
|
|
@@ -38,7 +37,7 @@ const startCmd = {
|
|
|
38
37
|
logSuccess("Server started");
|
|
39
38
|
} catch (err) {
|
|
40
39
|
logError("Server start failed", err);
|
|
41
|
-
|
|
40
|
+
process.exit(1);
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
43
|
command: "start [options]",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yargs from "yargs";
|
|
2
1
|
import { exec, logInfo, logError, logSuccess } from "./utils.js";
|
|
3
2
|
const buildStoryBook = async (outputDir = "demo", isDoc = false) => {
|
|
4
3
|
const additionalParams = isDoc ? `--docs -o ${outputDir}/docs` : `-o ${outputDir}`;
|
|
@@ -39,7 +38,7 @@ const storybookCmd = {
|
|
|
39
38
|
}
|
|
40
39
|
} catch (err) {
|
|
41
40
|
logError("Storybook execution failed", err);
|
|
42
|
-
|
|
41
|
+
process.exit(1);
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
command: "storybook [options]",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yargs from "yargs";
|
|
2
1
|
import { exec, logError, logSuccess, getCIEnv } from "./utils.js";
|
|
3
2
|
const test = async (commandOptions) => {
|
|
4
3
|
await exec(`cross-env NODE_ENV=test jest ${commandOptions}`);
|
|
@@ -41,7 +40,6 @@ const cmdArgs = {
|
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
42
|
const testCmd = {
|
|
44
|
-
// eslint-disable-next-line max-statements
|
|
45
43
|
handler: async (argv) => {
|
|
46
44
|
let commandOptions = "--coverage --maxWorkers=50%";
|
|
47
45
|
if (argv.fix) commandOptions += " -u";
|
|
@@ -62,7 +60,7 @@ const testCmd = {
|
|
|
62
60
|
logSuccess("Unit test execution completed");
|
|
63
61
|
} catch (err) {
|
|
64
62
|
logError("Unit test execution failed", err);
|
|
65
|
-
|
|
63
|
+
process.exit(1);
|
|
66
64
|
}
|
|
67
65
|
},
|
|
68
66
|
command: "test [options]",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import yargs from "yargs";
|
|
4
3
|
import { exec, logInfo, logError } from "./utils.js";
|
|
5
4
|
const randomChars = () => Math.random().toString(36).slice(2);
|
|
6
5
|
const validateTypescript = async (files = []) => {
|
|
@@ -52,7 +51,7 @@ const tscheckCmd = {
|
|
|
52
51
|
logInfo("Typescript validation completed");
|
|
53
52
|
} catch (err) {
|
|
54
53
|
logError("Typescript validation failed", err);
|
|
55
|
-
|
|
54
|
+
process.exit(1);
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
command: "tscheck [options]",
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { createGzip, createBrotliCompress } from "node:zlib";
|
|
13
13
|
import { pipeline } from "node:stream";
|
|
14
14
|
import { promisify } from "node:util";
|
|
15
|
-
import {
|
|
15
|
+
import { $ } from "execa";
|
|
16
16
|
import chalk from "chalk";
|
|
17
17
|
import fg from "fast-glob";
|
|
18
18
|
import {
|
|
@@ -30,7 +30,8 @@ const browsersMapping = {
|
|
|
30
30
|
safari: "Safari",
|
|
31
31
|
samsung: "Samsung Internet"
|
|
32
32
|
};
|
|
33
|
-
const
|
|
33
|
+
const $shell = $({ shell: true });
|
|
34
|
+
const exec = async (command, options) => $shell({ stdio: "inherit", ...options })`${command}`;
|
|
34
35
|
const logInfo = console.log;
|
|
35
36
|
const logWarning = (...args) => console.log(chalk.yellow(...args));
|
|
36
37
|
const logSuccess = (...args) => console.log(chalk.green(...args));
|
|
@@ -41,7 +42,7 @@ const readPackageLock = async () => {
|
|
|
41
42
|
const pkgLockJSON = await readFile(appPkgLockFile, "utf8");
|
|
42
43
|
const { dependencies } = JSON.parse(pkgLockJSON);
|
|
43
44
|
return (moduleName) => dependencies[moduleName]?.version || "";
|
|
44
|
-
} catch
|
|
45
|
+
} catch {
|
|
45
46
|
console.warn("Package lock file not found");
|
|
46
47
|
return () => "";
|
|
47
48
|
}
|
|
@@ -50,13 +51,16 @@ const getSupportedBrowsers = async () => {
|
|
|
50
51
|
const { stdout } = await exec("npx --no-install browserslist", {
|
|
51
52
|
stdout: "pipe"
|
|
52
53
|
});
|
|
53
|
-
const browserVersions = stdout
|
|
54
|
-
return browserVersions.reduce(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
const browserVersions = String(stdout ?? "").split("\n");
|
|
55
|
+
return browserVersions.reduce(
|
|
56
|
+
(acc, nameVersion) => {
|
|
57
|
+
const [name, version] = nameVersion.split(" ");
|
|
58
|
+
const versionRange = version.split("-");
|
|
59
|
+
acc[browsersMapping[name]] = versionRange && versionRange[0] || version;
|
|
60
|
+
return acc;
|
|
61
|
+
},
|
|
62
|
+
{}
|
|
63
|
+
);
|
|
60
64
|
};
|
|
61
65
|
const getModulesInfo = async () => {
|
|
62
66
|
try {
|
|
@@ -71,8 +75,8 @@ const getModulesInfo = async () => {
|
|
|
71
75
|
cli: getModuleVersion("@elliemae/pui-cli"),
|
|
72
76
|
dimsum: getModuleVersion("@elliemae/ds-system")
|
|
73
77
|
};
|
|
74
|
-
} catch
|
|
75
|
-
console.warn(
|
|
78
|
+
} catch {
|
|
79
|
+
console.warn("Package lock file not found");
|
|
76
80
|
return {};
|
|
77
81
|
}
|
|
78
82
|
};
|
|
@@ -176,7 +180,7 @@ const isPathExist = async (pathToCheck) => {
|
|
|
176
180
|
try {
|
|
177
181
|
await access(pathToCheck, constants.F_OK);
|
|
178
182
|
return true;
|
|
179
|
-
} catch
|
|
183
|
+
} catch {
|
|
180
184
|
return false;
|
|
181
185
|
}
|
|
182
186
|
};
|