@elliemae/pui-cli 9.0.0-alpha.7 → 9.0.0-alpha.9
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 -1
- package/app.tsconfig.json +1 -1
- package/dist/cjs/cli.js +2 -14
- 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 +1 -2
- package/dist/cjs/commands/start.js +1 -2
- package/dist/cjs/commands/storybook.js +1 -12
- package/dist/cjs/commands/test.js +1 -12
- package/dist/cjs/commands/tscheck.js +1 -2
- package/dist/cjs/commands/utils.js +12 -8
- package/dist/cjs/commands/version.js +1 -12
- package/dist/cjs/commands/vitest.js +1 -12
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/lint-config/eslint/flat/compat.mjs +10 -3
- package/dist/cjs/lint-config/eslint/flat/react.mjs +2 -3
- 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 +15 -7
- package/dist/cjs/monorepo/utils.js +5 -8
- package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
- package/dist/cjs/testing/vitest.config.js +2 -1
- package/dist/esm/cli.js +2 -14
- 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 +1 -2
- package/dist/esm/commands/start.js +1 -2
- package/dist/esm/commands/storybook.js +1 -2
- package/dist/esm/commands/test.js +1 -2
- package/dist/esm/commands/tscheck.js +1 -2
- package/dist/esm/commands/utils.js +13 -9
- package/dist/esm/commands/version.js +1 -2
- package/dist/esm/commands/vitest.js +1 -2
- package/dist/esm/index.cjs +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lint-config/eslint/flat/compat.mjs +10 -3
- package/dist/esm/lint-config/eslint/flat/react.mjs +2 -3
- 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 +15 -7
- package/dist/esm/monorepo/utils.js +5 -8
- package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
- package/dist/esm/testing/vitest.config.js +2 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/lint-config/eslint/flat/compat.d.mts +7 -2
- 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/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/eslint/flat/compat.mjs +10 -3
- package/lib/lint-config/eslint/flat/react.mjs +2 -3
- 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 -19
- package/lib/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
- package/library.tsconfig.json +1 -1
- package/package.json +21 -21
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ pnpm exec pui-cli skills install migrate-to-pui-cli-9 --target all
|
|
|
20
20
|
|
|
21
21
|
### ESLint 10 flat config (alpha)
|
|
22
22
|
|
|
23
|
-
`pui-cli` ships ESLint 10 with `typescript-eslint` v8 flat configs. Legacy plugins that have not yet published ESLint 10–compatible releases (Storybook 6, redux-saga) are wrapped via `@eslint/compat
|
|
23
|
+
`pui-cli` ships ESLint 10 with `typescript-eslint` v8 flat configs. Legacy plugins that have not yet published ESLint 10–compatible releases (Storybook 6, redux-saga) are wrapped via `@eslint/compat` v2. Replace legacy `.eslintrc.cjs` with:
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
26
|
// eslint.config.mjs — React apps and libraries
|
package/app.tsconfig.json
CHANGED
package/dist/cjs/cli.js
CHANGED
|
@@ -43,21 +43,9 @@ var import_buildcdn = require("./commands/buildcdn.js");
|
|
|
43
43
|
var import_skills = require("./commands/skills.js");
|
|
44
44
|
const import_meta = {};
|
|
45
45
|
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
46
|
-
(0, import_dotenv.config)();
|
|
46
|
+
(0, import_dotenv.config)({ quiet: true });
|
|
47
47
|
process.env.PATH += import_node_path.default.delimiter + import_node_path.default.join(__dirname, "..", "node_modules", ".bin");
|
|
48
48
|
(async () => {
|
|
49
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_build.buildCmd).help().
|
|
50
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_pack.packCmd).help().argv;
|
|
51
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_start.startCmd).help().argv;
|
|
52
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_test.testCmd).help().argv;
|
|
53
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_lint.lintCmd).help().argv;
|
|
54
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_gendoc.gendocCmd).help().argv;
|
|
55
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_codemod.codemodCmd).help().argv;
|
|
56
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_storybook.storybookCmd).help().argv;
|
|
57
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_vitest.vitestCmd).help().argv;
|
|
58
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_version.versionCmd).help().argv;
|
|
59
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_tscheck.tscheckCmd).help().argv;
|
|
60
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_buildcdn.buildCDNCmd).help().argv;
|
|
61
|
-
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_skills.skillsCmd).help().argv;
|
|
49
|
+
await (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).command(import_build.buildCmd).command(import_pack.packCmd).command(import_start.startCmd).command(import_test.testCmd).command(import_lint.lintCmd).command(import_gendoc.gendocCmd).command(import_codemod.codemodCmd).command(import_storybook.storybookCmd).command(import_vitest.vitestCmd).command(import_version.versionCmd).command(import_tscheck.tscheckCmd).command(import_buildcdn.buildCDNCmd).command(import_skills.skillsCmd).help().parseAsync();
|
|
62
50
|
await (0, import_update_notifier.notifyUpdates)();
|
|
63
51
|
})();
|
|
@@ -33,7 +33,6 @@ __export(build_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(build_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_url = require("node:url");
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
36
|
var import_utils = require("./utils.js");
|
|
38
37
|
var import_esbuild = require("../transpile/esbuild.js");
|
|
39
38
|
const import_meta = {};
|
|
@@ -76,7 +75,7 @@ const buildCmd = {
|
|
|
76
75
|
(0, import_utils.logSuccess)("Build completed");
|
|
77
76
|
} catch (err) {
|
|
78
77
|
(0, import_utils.logError)("Build failed", err);
|
|
79
|
-
|
|
78
|
+
process.exit(1);
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
command: "build",
|
|
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(buildcdn_exports);
|
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_url = require("node:url");
|
|
36
36
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
37
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
38
37
|
var import_utils = require("./utils.js");
|
|
39
38
|
const import_meta = {};
|
|
40
39
|
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
@@ -65,7 +64,7 @@ const buildCDNCmd = {
|
|
|
65
64
|
(0, import_utils.logSuccess)("CDN Build completed");
|
|
66
65
|
} catch (err) {
|
|
67
66
|
(0, import_utils.logError)("Build failed", err);
|
|
68
|
-
|
|
67
|
+
process.exit(1);
|
|
69
68
|
}
|
|
70
69
|
},
|
|
71
70
|
command: "buildCDN",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,21 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var codemod_exports = {};
|
|
30
20
|
__export(codemod_exports, {
|
|
31
21
|
codemodCmd: () => codemodCmd
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(codemod_exports);
|
|
34
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
24
|
var import_utils = require("./utils.js");
|
|
36
25
|
const transform = async (argv) => {
|
|
37
26
|
(0, import_utils.logInfo)("Code modification in-progress...");
|
|
@@ -44,7 +33,7 @@ const codemodCmd = {
|
|
|
44
33
|
(0, import_utils.logSuccess)("Code modifications completed. ");
|
|
45
34
|
} catch (err) {
|
|
46
35
|
(0, import_utils.logError)("Code modifications failed", err);
|
|
47
|
-
|
|
36
|
+
process.exit(1);
|
|
48
37
|
}
|
|
49
38
|
},
|
|
50
39
|
command: "codemod <transform>",
|
|
@@ -33,7 +33,6 @@ __export(gendoc_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(gendoc_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_url = require("node:url");
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
36
|
var import_utils = require("./utils.js");
|
|
38
37
|
const import_meta = {};
|
|
39
38
|
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
@@ -48,7 +47,7 @@ const gendocCmd = {
|
|
|
48
47
|
(0, import_utils.logSuccess)("Document generation completed. ");
|
|
49
48
|
} catch (err) {
|
|
50
49
|
(0, import_utils.logError)("Document generation failed", err);
|
|
51
|
-
|
|
50
|
+
process.exit(1);
|
|
52
51
|
}
|
|
53
52
|
},
|
|
54
53
|
command: "gendoc",
|
|
@@ -32,24 +32,26 @@ __export(lint_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(lint_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
36
|
var import_node_util = require("node:util");
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
37
|
var import_utils = require("./utils.js");
|
|
38
|
+
const resolveStylelintConfigPath = () => {
|
|
39
|
+
const mjsPath = import_node_path.default.join(process.cwd(), "stylelint.config.mjs");
|
|
40
|
+
if (import_node_fs.default.existsSync(mjsPath)) return mjsPath;
|
|
41
|
+
return import_node_path.default.join(process.cwd(), "stylelint.config.cjs");
|
|
42
|
+
};
|
|
38
43
|
const lintCSS = async (args) => {
|
|
39
44
|
const fixIssues = args.fix ? "--fix" : "";
|
|
45
|
+
const configPath = resolveStylelintConfigPath();
|
|
40
46
|
if (args.debug) {
|
|
41
|
-
const configPath = import_node_path.default.join(process.cwd(), "stylelint.config.cjs");
|
|
42
47
|
const config = await import(configPath);
|
|
43
48
|
(0, import_utils.logInfo)("stylelint version:");
|
|
44
49
|
await (0, import_utils.exec)(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
|
|
45
50
|
(0, import_utils.logInfo)("stylelint config:");
|
|
46
|
-
(0, import_utils.logInfo)((0, import_node_util.inspect)(config, { depth: null }));
|
|
51
|
+
(0, import_utils.logInfo)((0, import_node_util.inspect)(config.default ?? config, { depth: null }));
|
|
47
52
|
}
|
|
48
53
|
await (0, import_utils.exec)(
|
|
49
|
-
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} --allow-empty-input --config ${
|
|
50
|
-
process.cwd(),
|
|
51
|
-
"stylelint.config.cjs"
|
|
52
|
-
)}`
|
|
54
|
+
`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} --allow-empty-input --config ${configPath}`
|
|
53
55
|
);
|
|
54
56
|
};
|
|
55
57
|
const lintJS = async (args) => {
|
|
@@ -93,7 +95,7 @@ const lintCmd = {
|
|
|
93
95
|
} catch (err) {
|
|
94
96
|
(0, import_utils.logError)("JS linting failed");
|
|
95
97
|
if (argv.debug) (0, import_utils.logError)(err);
|
|
96
|
-
|
|
98
|
+
process.exit(1);
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
101
|
}
|
|
@@ -105,7 +107,7 @@ const lintCmd = {
|
|
|
105
107
|
} catch (err) {
|
|
106
108
|
(0, import_utils.logError)("CSS linting failed");
|
|
107
109
|
if (argv.debug) (0, import_utils.logError)(err);
|
|
108
|
-
|
|
110
|
+
process.exit(1);
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
},
|
|
@@ -33,7 +33,6 @@ __export(pack_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(pack_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_url = require("node:url");
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
36
|
var import_utils = require("./utils.js");
|
|
38
37
|
var import_esbuild = require("../transpile/esbuild.js");
|
|
39
38
|
const import_meta = {};
|
|
@@ -100,7 +99,7 @@ const packCmd = {
|
|
|
100
99
|
(0, import_utils.logSuccess)("Build completed");
|
|
101
100
|
} catch (err) {
|
|
102
101
|
(0, import_utils.logError)("Build failed", err);
|
|
103
|
-
|
|
102
|
+
process.exit(1);
|
|
104
103
|
}
|
|
105
104
|
},
|
|
106
105
|
command: "pack",
|
|
@@ -36,7 +36,6 @@ var import_node_url = require("node:url");
|
|
|
36
36
|
var import_node_module = require("node:module");
|
|
37
37
|
var import_promises = require("node:fs/promises");
|
|
38
38
|
var import_node_fs = require("node:fs");
|
|
39
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
40
39
|
var import_utils = require("./utils.js");
|
|
41
40
|
const import_meta = {};
|
|
42
41
|
const SKILL_TARGETS = ["cursor", "claude", "copilot", "all"];
|
|
@@ -201,7 +200,7 @@ const skillsCmd = {
|
|
|
201
200
|
await runInstall(argv.name, Boolean(argv.force), argv.target);
|
|
202
201
|
} catch (err) {
|
|
203
202
|
(0, import_utils.logError)(err.message);
|
|
204
|
-
|
|
203
|
+
process.exit(1);
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
};
|
|
@@ -33,7 +33,6 @@ __export(start_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(start_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_url = require("node:url");
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
36
|
var import_utils = require("./utils.js");
|
|
38
37
|
const import_meta = {};
|
|
39
38
|
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
@@ -72,7 +71,7 @@ const startCmd = {
|
|
|
72
71
|
(0, import_utils.logSuccess)("Server started");
|
|
73
72
|
} catch (err) {
|
|
74
73
|
(0, import_utils.logError)("Server start failed", err);
|
|
75
|
-
|
|
74
|
+
process.exit(1);
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
77
|
command: "start [options]",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,21 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var storybook_exports = {};
|
|
30
20
|
__export(storybook_exports, {
|
|
31
21
|
storybookCmd: () => storybookCmd
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(storybook_exports);
|
|
34
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
24
|
var import_utils = require("./utils.js");
|
|
36
25
|
const buildStoryBook = async (outputDir = "demo", isDoc = false) => {
|
|
37
26
|
const additionalParams = isDoc ? `--docs -o ${outputDir}/docs` : `-o ${outputDir}`;
|
|
@@ -72,7 +61,7 @@ const storybookCmd = {
|
|
|
72
61
|
}
|
|
73
62
|
} catch (err) {
|
|
74
63
|
(0, import_utils.logError)("Storybook execution failed", err);
|
|
75
|
-
|
|
64
|
+
process.exit(1);
|
|
76
65
|
}
|
|
77
66
|
},
|
|
78
67
|
command: "storybook [options]",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,21 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var test_exports = {};
|
|
30
20
|
__export(test_exports, {
|
|
31
21
|
testCmd: () => testCmd
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(test_exports);
|
|
34
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
24
|
var import_utils = require("./utils.js");
|
|
36
25
|
const test = async (commandOptions) => {
|
|
37
26
|
await (0, import_utils.exec)(`cross-env NODE_ENV=test jest ${commandOptions}`);
|
|
@@ -94,7 +83,7 @@ const testCmd = {
|
|
|
94
83
|
(0, import_utils.logSuccess)("Unit test execution completed");
|
|
95
84
|
} catch (err) {
|
|
96
85
|
(0, import_utils.logError)("Unit test execution failed", err);
|
|
97
|
-
|
|
86
|
+
process.exit(1);
|
|
98
87
|
}
|
|
99
88
|
},
|
|
100
89
|
command: "test [options]",
|
|
@@ -33,7 +33,6 @@ __export(tscheck_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(tscheck_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
37
36
|
var import_utils = require("./utils.js");
|
|
38
37
|
const randomChars = () => Math.random().toString(36).slice(2);
|
|
39
38
|
const validateTypescript = async (files = []) => {
|
|
@@ -85,7 +84,7 @@ const tscheckCmd = {
|
|
|
85
84
|
(0, import_utils.logInfo)("Typescript validation completed");
|
|
86
85
|
} catch (err) {
|
|
87
86
|
(0, import_utils.logError)("Typescript validation failed", err);
|
|
88
|
-
|
|
87
|
+
process.exit(1);
|
|
89
88
|
}
|
|
90
89
|
},
|
|
91
90
|
command: "tscheck [options]",
|
|
@@ -60,7 +60,8 @@ const browsersMapping = {
|
|
|
60
60
|
safari: "Safari",
|
|
61
61
|
samsung: "Samsung Internet"
|
|
62
62
|
};
|
|
63
|
-
const
|
|
63
|
+
const $shell = (0, import_execa.$)({ shell: true });
|
|
64
|
+
const exec = async (command, options) => $shell({ stdio: "inherit", ...options })`${command}`;
|
|
64
65
|
const logInfo = console.log;
|
|
65
66
|
const logWarning = (...args) => console.log(import_chalk.default.yellow(...args));
|
|
66
67
|
const logSuccess = (...args) => console.log(import_chalk.default.green(...args));
|
|
@@ -80,13 +81,16 @@ const getSupportedBrowsers = async () => {
|
|
|
80
81
|
const { stdout } = await exec("npx --no-install browserslist", {
|
|
81
82
|
stdout: "pipe"
|
|
82
83
|
});
|
|
83
|
-
const browserVersions = stdout
|
|
84
|
-
return browserVersions.reduce(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
const browserVersions = String(stdout ?? "").split("\n");
|
|
85
|
+
return browserVersions.reduce(
|
|
86
|
+
(acc, nameVersion) => {
|
|
87
|
+
const [name, version] = nameVersion.split(" ");
|
|
88
|
+
const versionRange = version.split("-");
|
|
89
|
+
acc[browsersMapping[name]] = versionRange && versionRange[0] || version;
|
|
90
|
+
return acc;
|
|
91
|
+
},
|
|
92
|
+
{}
|
|
93
|
+
);
|
|
90
94
|
};
|
|
91
95
|
const getModulesInfo = async () => {
|
|
92
96
|
try {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,21 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var version_exports = {};
|
|
30
20
|
__export(version_exports, {
|
|
31
21
|
versionCmd: () => versionCmd
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(version_exports);
|
|
34
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
24
|
var import_utils = require("./utils.js");
|
|
36
25
|
var import_set_workspace_version = require("../monorepo/set-workspace-version.js");
|
|
37
26
|
var import_set_registry_version = require("../monorepo/set-registry-version.js");
|
|
@@ -73,7 +62,7 @@ const versionCmd = {
|
|
|
73
62
|
}
|
|
74
63
|
} catch (err) {
|
|
75
64
|
(0, import_utils.logError)("Monorepo versioning failed", err);
|
|
76
|
-
|
|
65
|
+
process.exit(1);
|
|
77
66
|
}
|
|
78
67
|
},
|
|
79
68
|
command: "version [options]",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,21 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var vitest_exports = {};
|
|
30
20
|
__export(vitest_exports, {
|
|
31
21
|
vitestCmd: () => vitestCmd
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(vitest_exports);
|
|
34
|
-
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
24
|
var import_utils = require("./utils.js");
|
|
36
25
|
const test = async (commandOptions) => {
|
|
37
26
|
await (0, import_utils.exec)(`vitest ${commandOptions}`);
|
|
@@ -79,7 +68,7 @@ const vitestCmd = {
|
|
|
79
68
|
(0, import_utils.logSuccess)("Unit test execution completed");
|
|
80
69
|
} catch (err) {
|
|
81
70
|
(0, import_utils.logError)("Unit test execution failed", err);
|
|
82
|
-
|
|
71
|
+
process.exit(1);
|
|
83
72
|
}
|
|
84
73
|
},
|
|
85
74
|
command: "vitest [options]",
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
const {
|
|
14
14
|
esReactConfig: eslintConfig,
|
|
15
15
|
} = require('./lint-config/eslint/react.cjs');
|
|
16
|
-
const { stylelintConfig } = require('./lint-config/stylelint.
|
|
16
|
+
const { stylelintConfig } = require('./lint-config/stylelint/export.mjs');
|
|
17
17
|
const { prettierConfig } = require('./lint-config/prettier.config.cjs');
|
|
18
18
|
const { commitlintConfig } = require('./lint-config/commitlint.config.cjs');
|
|
19
19
|
const { jestConfig } = require('./testing/jest.config.cjs');
|
package/dist/cjs/index.js
CHANGED
|
@@ -31,7 +31,7 @@ __export(index_exports, {
|
|
|
31
31
|
lintStagedConfig: () => import_lint_staged_config.lintStagedConfig,
|
|
32
32
|
loadRoutes: () => import_appRoutes.loadRoutes,
|
|
33
33
|
prettierConfig: () => import_prettier_config.prettierConfig,
|
|
34
|
-
stylelintConfig: () =>
|
|
34
|
+
stylelintConfig: () => import_export.stylelintConfig,
|
|
35
35
|
vitestConfig: () => import_vitest_config.vitestConfig
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -40,7 +40,7 @@ var import_non_react_export = require("./lint-config/eslint/flat/non-react-expor
|
|
|
40
40
|
var import_react_export = require("./lint-config/eslint/flat/react-export.mjs");
|
|
41
41
|
var import_non_react = require("./lint-config/eslint/non-react.cjs");
|
|
42
42
|
var import_react = require("./lint-config/eslint/react.cjs");
|
|
43
|
-
var
|
|
43
|
+
var import_export = require("./lint-config/stylelint/export.mjs");
|
|
44
44
|
var import_prettier_config = require("./lint-config/prettier.config.cjs");
|
|
45
45
|
var import_commitlint_config = require("./lint-config/commitlint.config.cjs");
|
|
46
46
|
var import_jest_config = require("./testing/jest.config.cjs");
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ESLint 10 removed deprecated context APIs (e.g. getSourceCode).
|
|
3
|
-
* Wrap legacy plugins
|
|
2
|
+
* ESLint 10 removed deprecated context APIs (e.g. getSourceCode, getScope, getFilename).
|
|
3
|
+
* Wrap legacy plugins via @eslint/compat v2 (ESLint 10–aware fixupPluginRules).
|
|
4
4
|
*/
|
|
5
5
|
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
6
|
+
import react from 'eslint-plugin-react';
|
|
6
7
|
import reduxSaga from 'eslint-plugin-redux-saga';
|
|
7
8
|
import storybook from 'eslint-plugin-storybook';
|
|
8
9
|
|
|
@@ -11,10 +12,16 @@ const storybookFlat =
|
|
|
11
12
|
storybook.configs.recommended ??
|
|
12
13
|
[];
|
|
13
14
|
|
|
15
|
+
/** React — uses context.getFilename / getScope (eslint-plugin-react@7). */
|
|
16
|
+
/** @type {import('eslint').ESLint.Plugin} */
|
|
17
|
+
export const reactPlugin = fixupPluginRules(react);
|
|
18
|
+
|
|
19
|
+
/** Redux-saga — uses context.getScope in no-yield-in-race. */
|
|
14
20
|
/** @type {import('eslint').ESLint.Plugin} */
|
|
15
21
|
export const reduxSagaPlugin = fixupPluginRules(reduxSaga);
|
|
16
22
|
|
|
17
|
-
/** Storybook flat presets
|
|
23
|
+
/** Storybook flat presets — uses legacy context APIs (eslint-plugin-storybook@0.12). */
|
|
24
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
18
25
|
export const storybookFlatConfigs = fixupConfigRules(
|
|
19
26
|
Array.isArray(storybookFlat) ? storybookFlat : [storybookFlat],
|
|
20
27
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
2
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
3
|
-
import react from 'eslint-plugin-react';
|
|
4
3
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
5
4
|
import { baseFlatConfigs, baseFlatConfigsStrict } from './common.mjs';
|
|
6
|
-
import { reduxSagaPlugin } from './compat.mjs';
|
|
5
|
+
import { reactPlugin, reduxSagaPlugin } from './compat.mjs';
|
|
7
6
|
import {
|
|
8
7
|
reactPresetRules,
|
|
9
8
|
storybookFiles,
|
|
@@ -13,7 +12,7 @@ import { reactRules, reactStrictRules } from './rules.mjs';
|
|
|
13
12
|
|
|
14
13
|
const reactPluginBlock = {
|
|
15
14
|
plugins: {
|
|
16
|
-
react,
|
|
15
|
+
react: reactPlugin,
|
|
17
16
|
'react-hooks': reactHooks,
|
|
18
17
|
'jsx-a11y': jsxA11y,
|
|
19
18
|
'redux-saga': reduxSagaPlugin,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @type {import('stylelint').Config} */
|
|
2
|
+
export const stylelintConfig = {
|
|
3
|
+
ignoreFiles: [
|
|
4
|
+
'/dist/**/*',
|
|
5
|
+
'/coverage/**/*',
|
|
6
|
+
'/build/**/*',
|
|
7
|
+
'/reports/**/*',
|
|
8
|
+
'/temp/**/*',
|
|
9
|
+
'/docs/**/*',
|
|
10
|
+
'/demo/**/*',
|
|
11
|
+
'/node_modules/**/*',
|
|
12
|
+
'/vendor/**/*',
|
|
13
|
+
],
|
|
14
|
+
customSyntax: 'postcss-styled-syntax',
|
|
15
|
+
extends: ['stylelint-config-recommended'],
|
|
16
|
+
rules: {
|
|
17
|
+
'selector-type-no-unknown': null,
|
|
18
|
+
'function-no-unknown': null,
|
|
19
|
+
// Formerly from stylelint-config-styled-components (unmaintained; references
|
|
20
|
+
// removed rules like no-missing-end-of-source-newline in Stylelint 17).
|
|
21
|
+
'value-no-vendor-prefix': true,
|
|
22
|
+
'property-no-vendor-prefix': true,
|
|
23
|
+
'no-empty-source': null,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default stylelintConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { stylelintConfig, default } from './config.mjs';
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"/coverage/**/*",
|
|
5
|
-
"/build/**/*",
|
|
6
|
-
"/reports/**/*",
|
|
7
|
-
"/temp/**/*",
|
|
8
|
-
"/docs/**/*",
|
|
9
|
-
"/demo/**/*",
|
|
10
|
-
"/node_modules/**/*",
|
|
11
|
-
"/vendor/**/*",
|
|
12
|
-
],
|
|
13
|
-
customSyntax: "postcss-styled-syntax",
|
|
14
|
-
extends: [
|
|
15
|
-
"stylelint-config-recommended",
|
|
16
|
-
"stylelint-config-styled-components",
|
|
17
|
-
],
|
|
18
|
-
rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
|
|
19
|
-
};
|
|
1
|
+
const { stylelintConfig } = require('./stylelint/export.mjs');
|
|
2
|
+
|
|
3
|
+
exports.stylelintConfig = stylelintConfig;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const {
|
|
2
|
+
const { execFileSync } = require('child_process');
|
|
3
3
|
|
|
4
4
|
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
5
5
|
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
6
6
|
|
|
7
|
+
const findUpCli = path.join(
|
|
8
|
+
path.dirname(require.resolve('find-up-cli/package.json')),
|
|
9
|
+
'cli.js',
|
|
10
|
+
);
|
|
11
|
+
|
|
7
12
|
const getPNPMWorkspaceLocation = (cwd) => {
|
|
8
|
-
let location = null;
|
|
9
|
-
|
|
10
13
|
for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']) {
|
|
11
14
|
try {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const location = execFileSync(
|
|
16
|
+
process.execPath,
|
|
17
|
+
[findUpCli, fileName, `--cwd=${cwd}`],
|
|
18
|
+
{ encoding: 'utf8' },
|
|
19
|
+
).trim();
|
|
20
|
+
if (location) {
|
|
21
|
+
return location;
|
|
22
|
+
}
|
|
15
23
|
} catch {
|
|
16
24
|
// ignore
|
|
17
25
|
}
|
|
18
26
|
}
|
|
19
|
-
return
|
|
27
|
+
return null;
|
|
20
28
|
};
|
|
21
29
|
|
|
22
30
|
exports.findMonoRepoRoot = (cwd = process.cwd()) => {
|