@elliemae/pui-cli 9.0.0-alpha.8 → 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.
Files changed (79) hide show
  1. package/README.md +1 -1
  2. package/app.tsconfig.json +1 -1
  3. package/dist/cjs/cli.js +2 -14
  4. package/dist/cjs/commands/build.js +1 -2
  5. package/dist/cjs/commands/buildcdn.js +1 -2
  6. package/dist/cjs/commands/codemod.js +1 -12
  7. package/dist/cjs/commands/gendoc.js +1 -2
  8. package/dist/cjs/commands/lint.js +11 -9
  9. package/dist/cjs/commands/pack.js +1 -2
  10. package/dist/cjs/commands/skills.js +1 -2
  11. package/dist/cjs/commands/start.js +1 -2
  12. package/dist/cjs/commands/storybook.js +1 -12
  13. package/dist/cjs/commands/test.js +1 -12
  14. package/dist/cjs/commands/tscheck.js +1 -2
  15. package/dist/cjs/commands/utils.js +12 -8
  16. package/dist/cjs/commands/version.js +1 -12
  17. package/dist/cjs/commands/vitest.js +1 -12
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/index.js +2 -2
  20. package/dist/cjs/lint-config/eslint/flat/compat.mjs +5 -130
  21. package/dist/cjs/lint-config/stylelint/config.mjs +27 -0
  22. package/dist/cjs/lint-config/stylelint/export.mjs +1 -0
  23. package/dist/cjs/lint-config/stylelint.config.cjs +3 -19
  24. package/dist/cjs/monorepo/utils.cjs +15 -7
  25. package/dist/cjs/monorepo/utils.js +5 -8
  26. package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
  27. package/dist/cjs/testing/vitest.config.js +2 -1
  28. package/dist/esm/cli.js +2 -14
  29. package/dist/esm/commands/build.js +1 -2
  30. package/dist/esm/commands/buildcdn.js +1 -2
  31. package/dist/esm/commands/codemod.js +1 -2
  32. package/dist/esm/commands/gendoc.js +1 -2
  33. package/dist/esm/commands/lint.js +11 -9
  34. package/dist/esm/commands/pack.js +1 -2
  35. package/dist/esm/commands/skills.js +1 -2
  36. package/dist/esm/commands/start.js +1 -2
  37. package/dist/esm/commands/storybook.js +1 -2
  38. package/dist/esm/commands/test.js +1 -2
  39. package/dist/esm/commands/tscheck.js +1 -2
  40. package/dist/esm/commands/utils.js +13 -9
  41. package/dist/esm/commands/version.js +1 -2
  42. package/dist/esm/commands/vitest.js +1 -2
  43. package/dist/esm/index.cjs +1 -1
  44. package/dist/esm/index.js +1 -1
  45. package/dist/esm/lint-config/eslint/flat/compat.mjs +5 -130
  46. package/dist/esm/lint-config/stylelint/config.mjs +27 -0
  47. package/dist/esm/lint-config/stylelint/export.mjs +1 -0
  48. package/dist/esm/lint-config/stylelint.config.cjs +3 -19
  49. package/dist/esm/monorepo/utils.cjs +15 -7
  50. package/dist/esm/monorepo/utils.js +5 -8
  51. package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
  52. package/dist/esm/testing/vitest.config.js +2 -1
  53. package/dist/types/lib/commands/build.d.ts +1 -1
  54. package/dist/types/lib/commands/buildcdn.d.ts +1 -1
  55. package/dist/types/lib/commands/codemod.d.ts +1 -1
  56. package/dist/types/lib/commands/gendoc.d.ts +1 -1
  57. package/dist/types/lib/commands/lint.d.ts +1 -1
  58. package/dist/types/lib/commands/pack.d.ts +1 -1
  59. package/dist/types/lib/commands/skills.d.ts +1 -1
  60. package/dist/types/lib/commands/start.d.ts +1 -1
  61. package/dist/types/lib/commands/storybook.d.ts +1 -1
  62. package/dist/types/lib/commands/test.d.ts +1 -1
  63. package/dist/types/lib/commands/tscheck.d.ts +1 -1
  64. package/dist/types/lib/commands/utils.d.ts +43 -2
  65. package/dist/types/lib/commands/version.d.ts +1 -1
  66. package/dist/types/lib/commands/vitest.d.ts +1 -1
  67. package/dist/types/lib/index.d.cts +1 -1
  68. package/dist/types/lib/index.d.ts +1 -1
  69. package/dist/types/lib/lint-config/stylelint/config.d.mts +3 -0
  70. package/dist/types/lib/lint-config/stylelint/export.d.mts +1 -0
  71. package/dist/types/lib/lint-config/stylelint.config.d.cts +2 -10
  72. package/dist/types/tsconfig.tsbuildinfo +1 -1
  73. package/lib/lint-config/eslint/flat/compat.mjs +5 -130
  74. package/lib/lint-config/stylelint/config.mjs +27 -0
  75. package/lib/lint-config/stylelint/export.mjs +1 -0
  76. package/lib/lint-config/stylelint.config.cjs +3 -19
  77. package/lib/skills/migrate-to-pui-cli-9/SKILL.md +115 -11
  78. package/library.tsconfig.json +1 -1
  79. 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`. Replace legacy `.eslintrc.cjs` with:
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
@@ -11,7 +11,7 @@
11
11
  "experimentalDecorators": true,
12
12
  "isolatedModules": true,
13
13
  "jsx": "react-jsx",
14
- "moduleResolution": "node",
14
+ "moduleResolution": "bundler",
15
15
  "noEmit": true,
16
16
  "noFallthroughCasesInSwitch": true,
17
17
  "resolveJsonModule": true,
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().argv;
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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 ${import_node_path.default.join(
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
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 exec = async (command, options = { stdio: "inherit" }) => (0, import_execa.execaCommand)(command, options);
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?.toString()?.split("\n") || [];
84
- return browserVersions.reduce((acc, nameVersion) => {
85
- const [name, version] = nameVersion.split(" ");
86
- const versionRange = version.split("-");
87
- acc[browsersMapping[name]] = versionRange && versionRange[0] || version;
88
- return acc;
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
- (0, import_yargs.default)().exit(-1, err);
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
- (0, import_yargs.default)().exit(-1, err);
71
+ process.exit(1);
83
72
  }
84
73
  },
85
74
  command: "vitest [options]",
@@ -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.config.cjs');
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: () => import_stylelint_config.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 import_stylelint_config = require("./lint-config/stylelint.config.cjs");
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,10 +1,8 @@
1
1
  /**
2
2
  * ESLint 10 removed deprecated context APIs (e.g. getSourceCode, getScope, getFilename).
3
- * Shim only plugins that still call those APIs until maintainers publish compatible releases.
4
- *
5
- * @eslint/compat fixupPluginRules assumes ESLint 9 sourceCode passthroughs that are also
6
- * unavailable in ESLint 10, so we shim legacy context methods directly on the rule context.
3
+ * Wrap legacy plugins via @eslint/compat v2 (ESLint 10–aware fixupPluginRules).
7
4
  */
5
+ import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
8
6
  import react from 'eslint-plugin-react';
9
7
  import reduxSaga from 'eslint-plugin-redux-saga';
10
8
  import storybook from 'eslint-plugin-storybook';
@@ -14,139 +12,16 @@ const storybookFlat =
14
12
  storybook.configs.recommended ??
15
13
  [];
16
14
 
17
- /** @type {WeakMap<import('eslint').ESLint.Plugin, import('eslint').ESLint.Plugin>} */
18
- const fixedPlugins = new WeakMap();
19
-
20
- /**
21
- * @param {import('eslint').Rule.RuleModule['create']} originalCreate
22
- */
23
- function wrapRuleCreateWithLegacyContext(originalCreate) {
24
- return function create(context) {
25
- if (
26
- typeof context.getScope === 'function' &&
27
- typeof context.getFilename === 'function'
28
- ) {
29
- return originalCreate(context);
30
- }
31
-
32
- const sourceCode = context.sourceCode;
33
- let currentNode = sourceCode.ast;
34
-
35
- const legacyContext = Object.assign(Object.create(context), {
36
- getFilename() {
37
- return context.filename;
38
- },
39
- getScope() {
40
- return sourceCode.getScope(currentNode);
41
- },
42
- getAncestors() {
43
- return sourceCode.getAncestors(currentNode);
44
- },
45
- getSourceCode() {
46
- return sourceCode;
47
- },
48
- });
49
-
50
- Object.freeze(legacyContext);
51
-
52
- const visitor = originalCreate(legacyContext);
53
-
54
- if (!visitor || typeof visitor !== 'object') {
55
- return visitor;
56
- }
57
-
58
- for (const [methodName, method] of Object.entries(visitor)) {
59
- if (typeof method !== 'function') {
60
- continue;
61
- }
62
-
63
- if (methodName.startsWith('on')) {
64
- visitor[methodName] = (...args) => {
65
- currentNode = args[methodName === 'onCodePathSegmentLoop' ? 2 : 1];
66
- return method.call(visitor, ...args);
67
- };
68
- continue;
69
- }
70
-
71
- visitor[methodName] = (node, ...rest) => {
72
- currentNode = node;
73
- return method.call(visitor, node, ...rest);
74
- };
75
- }
76
-
77
- return visitor;
78
- };
79
- }
80
-
81
- /**
82
- * @param {import('eslint').ESLint.Plugin} plugin
83
- * @returns {import('eslint').ESLint.Plugin}
84
- */
85
- function fixupLegacyPlugin(plugin) {
86
- const cached = fixedPlugins.get(plugin);
87
- if (cached) {
88
- return cached;
89
- }
90
-
91
- if (!plugin.rules) {
92
- fixedPlugins.set(plugin, plugin);
93
- return plugin;
94
- }
95
-
96
- const rules = {};
97
-
98
- for (const [ruleName, ruleDefinition] of Object.entries(plugin.rules)) {
99
- if (typeof ruleDefinition === 'function') {
100
- rules[ruleName] = wrapRuleCreateWithLegacyContext(ruleDefinition);
101
- continue;
102
- }
103
-
104
- rules[ruleName] = {
105
- ...ruleDefinition,
106
- create: wrapRuleCreateWithLegacyContext(
107
- ruleDefinition.create.bind(ruleDefinition),
108
- ),
109
- };
110
- }
111
-
112
- const fixed = { ...plugin, rules };
113
- fixedPlugins.set(plugin, fixed);
114
- return fixed;
115
- }
116
-
117
- /** @type {import('eslint').ESLint.Plugin} */
118
- const storybookPlugin = fixupLegacyPlugin(storybook);
119
-
120
- /**
121
- * @param {import('eslint').Linter.Config[]} configs
122
- * @returns {import('eslint').Linter.Config[]}
123
- */
124
- function fixupStorybookFlatConfigs(configs) {
125
- return configs.map((configItem) => {
126
- if (!configItem.plugins?.storybook) {
127
- return configItem;
128
- }
129
-
130
- return {
131
- ...configItem,
132
- plugins: {
133
- ...configItem.plugins,
134
- storybook: storybookPlugin,
135
- },
136
- };
137
- });
138
- }
139
-
140
15
  /** React — uses context.getFilename / getScope (eslint-plugin-react@7). */
141
16
  /** @type {import('eslint').ESLint.Plugin} */
142
- export const reactPlugin = fixupLegacyPlugin(react);
17
+ export const reactPlugin = fixupPluginRules(react);
143
18
 
144
19
  /** Redux-saga — uses context.getScope in no-yield-in-race. */
145
20
  /** @type {import('eslint').ESLint.Plugin} */
146
- export const reduxSagaPlugin = fixupLegacyPlugin(reduxSaga);
21
+ export const reduxSagaPlugin = fixupPluginRules(reduxSaga);
147
22
 
148
23
  /** Storybook flat presets — uses legacy context APIs (eslint-plugin-storybook@0.12). */
149
24
  /** @type {import('eslint').Linter.Config[]} */
150
- export const storybookFlatConfigs = fixupStorybookFlatConfigs(
25
+ export const storybookFlatConfigs = fixupConfigRules(
151
26
  Array.isArray(storybookFlat) ? storybookFlat : [storybookFlat],
152
27
  );