@clearlydev/nx-archweave 0.4.4 → 0.5.0

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 (35) hide show
  1. package/README.md +13 -13
  2. package/dist/bin/review-verdict.js +2 -1
  3. package/dist/generators/_chunks/{chunk-3AE7MQPM.js → chunk-3ZHRZK5M.js} +5 -2
  4. package/dist/generators/_chunks/{chunk-FQHFT5IH.js → chunk-5Z7VZPES.js} +8 -1
  5. package/dist/generators/_chunks/{chunk-PB4CFJD5.js → chunk-624F6DEP.js} +11 -6
  6. package/dist/generators/_chunks/{chunk-HGEMEXKF.js → chunk-AON4KGZT.js} +6 -2
  7. package/dist/generators/_chunks/{chunk-GPZEZVPN.js → chunk-ILICA6LC.js} +5 -4
  8. package/dist/generators/_chunks/chunk-JPS6XKYK.js +12 -0
  9. package/dist/generators/_chunks/{chunk-JEQQCSOB.js → chunk-L3T4H7OF.js} +19 -15
  10. package/dist/generators/_chunks/{chunk-AFAORV5O.js → chunk-M7OQWSNF.js} +1 -1
  11. package/dist/generators/_chunks/{chunk-L2RZ2LBO.js → chunk-N6B6VBHG.js} +32 -8
  12. package/dist/generators/_chunks/{chunk-SNM66KYS.js → chunk-Q7IYHKT3.js} +9 -3
  13. package/dist/generators/_chunks/{chunk-AEAL4ICT.js → chunk-SEUY3OCQ.js} +3 -3
  14. package/dist/generators/_chunks/{chunk-5HMB6HYW.js → chunk-TJ6SCQLI.js} +21 -10
  15. package/dist/generators/_chunks/{chunk-QQNDYJTR.js → chunk-WNO3ZGBB.js} +3 -2
  16. package/dist/generators/_chunks/{chunk-B55SAIUS.js → chunk-WVMTOWLM.js} +1 -1
  17. package/dist/generators/_chunks/{chunk-2V5LX5NK.js → chunk-ZNTGYYLU.js} +7 -6
  18. package/dist/generators/add-agent-rules/generator.js +5 -4
  19. package/dist/generators/add-backend/generator.js +4 -4
  20. package/dist/generators/add-fsd-lite/generator.js +7 -5
  21. package/dist/generators/add-github-templates/generator.js +4 -3
  22. package/dist/generators/add-integration/generator.js +5 -5
  23. package/dist/generators/add-review/generator.js +6 -5
  24. package/dist/generators/allow-builds/generator.js +1 -1
  25. package/dist/generators/doctor/generator.js +235 -30
  26. package/dist/generators/entity/generator.js +5 -4
  27. package/dist/generators/feature/generator.js +5 -4
  28. package/dist/generators/init/generator.js +306 -63
  29. package/dist/generators/install-integration/generator.js +5 -5
  30. package/dist/generators/page/generator.js +5 -4
  31. package/dist/generators/shared/generator.js +5 -4
  32. package/dist/generators/widget/generator.js +5 -4
  33. package/package.json +1 -1
  34. package/src/generators/add-fsd-lite/schema.json +1 -1
  35. package/src/generators/init/schema.json +3 -3
package/README.md CHANGED
@@ -44,20 +44,20 @@ bun nx g @clearlydev/nx-archweave:doctor # bun
44
44
  Preview the full run first. This writes nothing:
45
45
 
46
46
  ```bash
47
- pnpm nx g @clearlydev/nx-archweave:init --preset=solo --frontend=next --review=false --applyEslint --dryRun
47
+ pnpm nx g @clearlydev/nx-archweave:init --preset=quick-start --frontend=next --applyEslint --dryRun
48
48
  ```
49
49
 
50
50
  Then run it for real:
51
51
 
52
52
  ```bash
53
- pnpm nx g @clearlydev/nx-archweave:init --preset=solo --frontend=next --review=false --applyEslint
53
+ pnpm nx g @clearlydev/nx-archweave:init --preset=quick-start --frontend=next --applyEslint
54
54
  ```
55
55
 
56
- - This sets up the `solo` preset (the FSD rule as `warn`, agent rules, a PR template) without AI review.
56
+ - This sets up the `quick-start` preset (the FSD rule as `warn`, agent rules, a PR template) without AI review.
57
57
  - `--applyEslint` writes the FSD rule into the app's `eslint.config.mjs`. Without it, `init` leaves your ESLint config alone and prints the two lines to paste, so the rule isn't on until you add them. `--preset=team` is for a team repository: the FSD rule as `error`, issue templates, and AI review on (see [Presets](#presets)).
58
58
  - Only the FSD rule: add `--agentRules=false --githubTemplates=false --review=false`.
59
59
 
60
- - `init` runs the content generators below according to the preset (`quick-start` | `solo` | `team`).
60
+ - `init` runs the content generators below according to the preset (`quick-start` | `team`; `solo` is an alias of `quick-start`).
61
61
  - `init` requires a clean git working tree, so a partial run can be undone exactly: the report lists the files it modified (`git restore -- …`) and the files it created.
62
62
  - `--allowDirty` opts out of the clean-tree check. The report then warns you that the rollback scope is wider.
63
63
  - `--locale=ko|en` sets the language of generated content. Reports are always in English.
@@ -200,16 +200,16 @@ Options: `--packages`\*, `--apply`
200
200
 
201
201
  ## Presets
202
202
 
203
- | | `quick-start` | `solo` | `team` |
204
- | --- | --- | --- | --- |
205
- | FSD Lite | on | on | on |
206
- | FSD rule severity | `warn` | `warn` | `error` |
207
- | Agent rules | the AI hosts' files | the AI hosts' files | the AI hosts' files + Team Rules section |
208
- | GitHub templates | PR only | PR only | Issue + PR |
209
- | Review default | off (opt-in) | on | on |
210
- | Review mode | `fast` | `fast` | `standard` |
203
+ | | `quick-start` | `team` |
204
+ | --- | --- | --- |
205
+ | FSD Lite | on | on |
206
+ | FSD rule severity | `warn` | `error` |
207
+ | Agent rules | the AI hosts' files | the AI hosts' files + Team Rules section |
208
+ | GitHub templates | PR only | Issue + PR |
209
+ | Review default | off (opt-in) | on |
210
+ | Review mode | `fast` | `standard` |
211
211
 
212
- Explicit flags always win over preset defaults. create-nx-archweave passes `--review=false` for `quick-start` and `solo` unless you pass `--review`, so from the CLI only `team` starts with review on.
212
+ Explicit flags always win over preset defaults. `solo` is an alias of `quick-start`: it still works and gets quick-start's defaults. Turning review off never removes a review workflow a workspace already has; update it with `add-review`.
213
213
 
214
214
  ## AI PR review (optional)
215
215
 
@@ -4,7 +4,8 @@ import {
4
4
  REVIEW_WORKFLOW_CONTRACT,
5
5
  VERDICT_MARKER,
6
6
  runVerdictGate
7
- } from "../generators/_chunks/chunk-JEQQCSOB.js";
7
+ } from "../generators/_chunks/chunk-L3T4H7OF.js";
8
+ import "../generators/_chunks/chunk-JPS6XKYK.js";
8
9
 
9
10
  // src/bin/review-verdict.ts
10
11
  import { spawnSync } from "node:child_process";
@@ -2,13 +2,16 @@ import {
2
2
  generatorFilesDir,
3
3
  renderTemplateFiles
4
4
  } from "./chunk-YNMLB4DL.js";
5
+ import {
6
+ sameFileText
7
+ } from "./chunk-JPS6XKYK.js";
5
8
  import {
6
9
  resolveDryRun
7
10
  } from "./chunk-TUN34LAQ.js";
8
11
  import {
9
12
  readToolkitConfig,
10
13
  resolveLocaleOption
11
- } from "./chunk-AFAORV5O.js";
14
+ } from "./chunk-M7OQWSNF.js";
12
15
 
13
16
  // src/generators/add-github-templates/generator.ts
14
17
  import { join } from "node:path";
@@ -63,7 +66,7 @@ function runAddGithubTemplates(tree, options) {
63
66
  if (existing === null) {
64
67
  action = "created";
65
68
  if (!dryRun) tree.write(filePath, content);
66
- } else if (existing === content) {
69
+ } else if (sameFileText(existing, content)) {
67
70
  action = "unchanged";
68
71
  } else {
69
72
  action = "skipped";
@@ -42,9 +42,16 @@ function packageManagerCommands(pm, flavor = "classic") {
42
42
  return { addDevAtRoot: (spec) => `npm install -D ${spec}`, addAtRoot: (spec) => `npm install ${spec}`, runNx: "npm exec nx --", install: "npm install", workspaceRegistration: "package.json workspaces" };
43
43
  }
44
44
  }
45
+ var UNKNOWN_PM_RUN_NX = "npx nx";
46
+ function runNxCommand(pm) {
47
+ return pm === null || pm === void 0 ? UNKNOWN_PM_RUN_NX : packageManagerCommands(pm).runNx;
48
+ }
49
+ var INSTALL_ASSUMES_PNPM = "install commands assume pnpm; use your package manager's form";
45
50
 
46
51
  export {
47
52
  detectWorkspacePackageManager,
48
53
  detectYarnFlavor,
49
- packageManagerCommands
54
+ packageManagerCommands,
55
+ runNxCommand,
56
+ INSTALL_ASSUMES_PNPM
50
57
  };
@@ -3,7 +3,7 @@ import {
3
3
  addSharedTypesWorkspaceGlob,
4
4
  composeBackendWiring,
5
5
  readSharedTypesConfig
6
- } from "./chunk-QQNDYJTR.js";
6
+ } from "./chunk-WNO3ZGBB.js";
7
7
  import {
8
8
  resolveProjectType
9
9
  } from "./chunk-TXAQ2GJC.js";
@@ -24,11 +24,13 @@ import {
24
24
  readToolkitConfigFile,
25
25
  setJsonValue,
26
26
  treePackageManager
27
- } from "./chunk-AFAORV5O.js";
27
+ } from "./chunk-M7OQWSNF.js";
28
28
  import {
29
+ INSTALL_ASSUMES_PNPM,
29
30
  detectYarnFlavor,
30
- packageManagerCommands
31
- } from "./chunk-FQHFT5IH.js";
31
+ packageManagerCommands,
32
+ runNxCommand
33
+ } from "./chunk-5Z7VZPES.js";
32
34
 
33
35
  // src/generators/add-backend/generator.ts
34
36
  import { getProjects } from "@nx/devkit";
@@ -66,6 +68,7 @@ function renderAddBackendBody(report) {
66
68
  lines.push(" then re-run add-backend to wire it up:");
67
69
  lines.push("");
68
70
  for (const command of report.commands ?? []) lines.push(` ${command}`);
71
+ if (report.packageManagerNote !== void 0) lines.push(` note: ${report.packageManagerNote}`);
69
72
  if (report.expressRange !== void 0) {
70
73
  lines.push("");
71
74
  lines.push(` The express line declares express@${report.expressRange}, the range this workspace's @nx/react supports \u2014`);
@@ -167,7 +170,8 @@ function runAddBackend(tree, options) {
167
170
  packageManager,
168
171
  packageManager === "yarn" ? detectYarnFlavor((p) => tree.exists(p), (p) => tree.read(p, "utf-8")) : void 0
169
172
  );
170
- const packageManagerNote = detectedPm === null ? "the package manager could not be detected (no pnpm, yarn, bun or npm markers) \u2014 commands below assume pnpm." : void 0;
173
+ const runNx = runNxCommand(detectedPm);
174
+ const packageManagerNote = detectedPm === null ? `the package manager could not be detected (no pnpm, yarn, bun or npm markers) \u2014 nx commands use ${runNx}; ${INSTALL_ASSUMES_PNPM}.` : void 0;
171
175
  const baseNameOf = (root) => root.split("/").pop() ?? root;
172
176
  const entries = [...projects.entries()];
173
177
  const declaredApp = ([, config]) => config.projectType === "application";
@@ -222,8 +226,9 @@ function runAddBackend(tree, options) {
222
226
  commands: [
223
227
  pmCommands.addDevAtRoot(`@nx/${backend}${nxPin}`),
224
228
  ...quotedExpress ? [pmCommands.addAtRoot(quotedExpress)] : [],
225
- `${pmCommands.runNx} g @nx/${backend}:application ${apiDirectory} --frontendProject=${frontendProject}`
229
+ `${runNx} g @nx/${backend}:application ${apiDirectory} --frontendProject=${frontendProject}`
226
230
  ],
231
+ ...packageManagerNote !== void 0 ? { packageManagerNote } : {},
227
232
  ...refusalShape
228
233
  };
229
234
  }
@@ -1,9 +1,13 @@
1
+ import {
2
+ normalizeFileText
3
+ } from "./chunk-JPS6XKYK.js";
4
+
1
5
  // src/generators/add-review/render.ts
2
6
  var DEPENDABOT_PATH = ".github/dependabot.yml";
3
7
  var PROVIDER_STATUS_URL = "https://github.com/clearlydev/nx-archweave/blob/main/docs/pr-review.md#provider-status";
4
8
  function renderLineDiff(existing, generated) {
5
- const a = existing.split("\n");
6
- const b = generated.split("\n");
9
+ const a = normalizeFileText(existing).split("\n");
10
+ const b = normalizeFileText(generated).split("\n");
7
11
  const m = a.length;
8
12
  const n = b.length;
9
13
  const lcs = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  TOOLKIT_CONFIG_PATH,
3
3
  workspacePackageManager
4
- } from "./chunk-AFAORV5O.js";
4
+ } from "./chunk-M7OQWSNF.js";
5
5
  import {
6
- packageManagerCommands
7
- } from "./chunk-FQHFT5IH.js";
6
+ runNxCommand
7
+ } from "./chunk-5Z7VZPES.js";
8
8
 
9
9
  // src/generators/shared/run-nx.ts
10
10
  import { existsSync, readFileSync } from "node:fs";
@@ -16,7 +16,7 @@ function runNxFor(exists, read) {
16
16
  if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) config = parsed;
17
17
  } catch {
18
18
  }
19
- return packageManagerCommands(workspacePackageManager(exists, read, config) ?? "pnpm").runNx;
19
+ return runNxCommand(workspacePackageManager(exists, read, config));
20
20
  }
21
21
  function diskRunNx(root) {
22
22
  return runNxFor(
@@ -26,5 +26,6 @@ function diskRunNx(root) {
26
26
  }
27
27
 
28
28
  export {
29
+ runNxFor,
29
30
  diskRunNx
30
31
  };
@@ -0,0 +1,12 @@
1
+ // ../shared/dist/lib/file-text.js
2
+ function normalizeFileText(text) {
3
+ return (text.startsWith("\uFEFF") ? text.slice(1) : text).replace(/\r\n/g, "\n");
4
+ }
5
+ function sameFileText(a, b) {
6
+ return normalizeFileText(a) === normalizeFileText(b);
7
+ }
8
+
9
+ export {
10
+ normalizeFileText,
11
+ sameFileText
12
+ };
@@ -1,3 +1,7 @@
1
+ import {
2
+ sameFileText
3
+ } from "./chunk-JPS6XKYK.js";
4
+
1
5
  // ../review-policy/dist/renderers/render-review-comment.js
2
6
  var COPY = {
3
7
  en: {
@@ -467,9 +471,9 @@ var ACTION_PINS = {
467
471
  "actions/setup-node": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0",
468
472
  "pnpm/action-setup": "pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0",
469
473
  "oven-sh/setup-bun": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0",
470
- "anthropics/claude-code-action": "anthropics/claude-code-action@4fa93a88de49bbef68b10eb15aabedf28ca0e1ed # v1.0.271",
474
+ "anthropics/claude-code-action": "anthropics/claude-code-action@e5812cd75691ca7bbfc57c0ecf4441db3a1ab7dd # v1.0.281",
471
475
  "google-github-actions/run-gemini-cli": "google-github-actions/run-gemini-cli@f77273f4c914e4bf38440cf36a0369cb64a37489 # v0.1.22",
472
- "openai/codex-action": "openai/codex-action@bdf19a4a223ec2549a3e2274a0cf61556bc07675 # v1.13"
476
+ "openai/codex-action": "openai/codex-action@306c6a196a99dcc6582530c396a19d2672d5e9ec # v1.14"
473
477
  };
474
478
  function pinnedUses(action) {
475
479
  return ACTION_PINS[action];
@@ -893,18 +897,6 @@ function renderReviewWorkflow(input, parts) {
893
897
  ].join("\n");
894
898
  }
895
899
 
896
- // ../template-engine/dist/review/config-snippet.js
897
- function buildReviewConfigSnippet(input) {
898
- return {
899
- enabled: true,
900
- provider: input.provider,
901
- mode: input.mode,
902
- locale: input.locale,
903
- maxRounds: input.maxRounds,
904
- blockingPriorities: ["P0", "P1"]
905
- };
906
- }
907
-
908
900
  // ../template-engine/dist/review/claude/claude-provider.js
909
901
  var SECRET_NAME = "CLAUDE_CODE_OAUTH_TOKEN";
910
902
  var ALLOWED_TOOLS = "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment ${{ github.event.pull_request.number }} --body-file -),Bash(gh pr diff:*),Bash(gh pr view:*)";
@@ -1235,6 +1227,18 @@ var REVIEW_PROVIDERS = {
1235
1227
  cursor: cursorProvider
1236
1228
  };
1237
1229
 
1230
+ // ../template-engine/dist/review/config-snippet.js
1231
+ function buildReviewConfigSnippet(input) {
1232
+ return {
1233
+ enabled: true,
1234
+ provider: input.provider,
1235
+ mode: input.mode,
1236
+ locale: input.locale,
1237
+ maxRounds: input.maxRounds,
1238
+ blockingPriorities: ["P0", "P1"]
1239
+ };
1240
+ }
1241
+
1238
1242
  // ../template-engine/dist/review/compose-review-setup.js
1239
1243
  function composeReviewSetup(input) {
1240
1244
  if (!input.enabled)
@@ -1252,7 +1256,7 @@ function composeReviewSetup(input) {
1252
1256
  function judgeReviewFileConflict(existing, generated) {
1253
1257
  if (existing === null)
1254
1258
  return { kind: "create" };
1255
- if (existing === generated)
1259
+ if (sameFileText(existing, generated))
1256
1260
  return { kind: "unchanged" };
1257
1261
  return { kind: "merge-proposal", existing, generated };
1258
1262
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  detectWorkspacePackageManager
3
- } from "./chunk-FQHFT5IH.js";
3
+ } from "./chunk-5Z7VZPES.js";
4
4
 
5
5
  // ../template-engine/dist/ai-hosts/ai-hosts.js
6
6
  var AI_HOSTS = [
@@ -37,20 +37,20 @@ var LAYER_GUIDE_KO = {
37
37
  entities: "\uBE44\uC988\uB2C8\uC2A4 \uAC1D\uCCB4 \uD558\uB098\uB2F9 \uC2AC\uB77C\uC774\uC2A4 \uD558\uB098 (user, product)",
38
38
  shared: "\uC2AC\uB77C\uC774\uC2A4\uAC00 \uC544\uB2C8\uB77C \uC138\uADF8\uBA3C\uD2B8: ui, api, lib, model, config \u2014 \uBAA9\uC801\uC73C\uB85C \uC774\uB984 \uC9D3\uAE30"
39
39
  };
40
- function buildFsdLayerGuide({ layers, directories, sourceRoot, locale }) {
40
+ function buildFsdLayerGuide({ layers, directories, sourceRoot, locale, runNx = "nx" }) {
41
41
  const guide = locale === "ko" ? LAYER_GUIDE_KO : LAYER_GUIDE_EN;
42
42
  const width = Math.max(...directories.map((d) => d.length));
43
43
  const rows = layers.map((layer, index) => ` ${sourceRoot}/${directories[index].padEnd(width)} ${guide[layer] ?? ""}`);
44
44
  const footer = locale === "ko" ? [
45
45
  "\uB808\uC774\uC5B4 \uD3F4\uB354\uB294 \uCCAB \uC2AC\uB77C\uC774\uC2A4\uAC00 \uC0DD\uAE38 \uB54C \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4 (\uC815\uC2DD FSD):",
46
- " nx g @clearlydev/nx-archweave:feature --name=<name> (page, entity, shared\uB3C4 \uAC19\uC740 \uBC29\uC2DD; --segments=ui,api)",
47
- " widgets/ \uB808\uC774\uC5B4\uB294 \uAE30\uBCF8 \uBC94\uC704 \uBC16\uC774\uC9C0\uB9CC nx g @clearlydev/nx-archweave:widget \uC73C\uB85C \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
46
+ ` ${runNx} g @clearlydev/nx-archweave:feature --name=<name> (page, entity, shared\uB3C4 \uAC19\uC740 \uBC29\uC2DD; --segments=ui,api)`,
47
+ ` widgets/ \uB808\uC774\uC5B4\uB294 \uAE30\uBCF8 \uBC94\uC704 \uBC16\uC774\uC9C0\uB9CC ${runNx} g @clearlydev/nx-archweave:widget \uC73C\uB85C \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`,
48
48
  "\uC704\uC5D0\uC11C \uC544\uB798\uB85C\uB9CC import\uD560 \uC218 \uC788\uACE0, \uAC19\uC740 \uB808\uC774\uC5B4\uC758 \uC2AC\uB77C\uC774\uC2A4\uB07C\uB9AC\uB294 import\uD558\uC9C0 \uC54A\uC73C\uBA70, \uC2AC\uB77C\uC774\uC2A4\uB294",
49
49
  "index.ts\uB97C \uD1B5\uD574\uC11C\uB9CC import\uD569\uB2C8\uB2E4 \u2014 archweave/fsd-boundaries ESLint \uADDC\uCE59\uC774 \uC704\uBC18\uC744 \uC54C\uB824 \uC90D\uB2C8\uB2E4."
50
50
  ] : [
51
51
  "Layer directories appear with their first slice (canonical FSD):",
52
- " nx g @clearlydev/nx-archweave:feature --name=<name> (page, entity and shared work the same way; --segments=ui,api)",
53
- " widgets/ is outside the default scope but one command away: nx g @clearlydev/nx-archweave:widget",
52
+ ` ${runNx} g @clearlydev/nx-archweave:feature --name=<name> (page, entity and shared work the same way; --segments=ui,api)`,
53
+ ` widgets/ is outside the default scope but one command away: ${runNx} g @clearlydev/nx-archweave:widget`,
54
54
  "Imports go downward only, slices on one layer never import each other, and a slice is",
55
55
  "imported through its index.ts \u2014 the archweave/fsd-boundaries ESLint rule reports violations."
56
56
  ];
@@ -119,14 +119,38 @@ function applyFsdEslintConfig(configText, severity, root = "src", framework = {}
119
119
  function buildFsdEslintPasteSnippet(severity, locale, root = "src", framework = {}) {
120
120
  return buildFsdEslintSnippet({ severity, locale, root, framework });
121
121
  }
122
- function composeFsdLayerGuide({ profile, sourceRoot, locale }) {
122
+ function composeFsdLayerGuide({ profile, sourceRoot, locale, runNx }) {
123
123
  const layers = [...profile.layers];
124
- return buildFsdLayerGuide({ layers, directories: layers.map((layer) => profile.layerDirs[layer] ?? layer), sourceRoot, locale });
124
+ return buildFsdLayerGuide({ layers, directories: layers.map((layer) => profile.layerDirs[layer] ?? layer), sourceRoot, locale, runNx });
125
+ }
126
+
127
+ // ../template-engine/dist/fsd/lint-cache-inputs.js
128
+ var TOOLKIT_CONFIG_INPUT = "{workspaceRoot}/toolkit.config.json";
129
+ function lintInputsTargetDefaultsSnippet(target) {
130
+ return [
131
+ "Add to nx.json:",
132
+ ` "targetDefaults": { "${target}": { "inputs": ["...", "${TOOLKIT_CONFIG_INPUT}"] } }`,
133
+ 'Keep "...": it stands for the inputs @nx/eslint/plugin infers (the sources, the ESLint config). Without it',
134
+ "they are dropped, and lint is served from the cache after a source change."
135
+ ];
136
+ }
137
+ function lintInputsProjectSnippet(input) {
138
+ if (input.ownInputs)
139
+ return [`Add "${TOOLKIT_CONFIG_INPUT}" to the inputs of the ${input.target} target in ${input.file}.`];
140
+ const inputs = ['"default"', '"^default"', ...input.eslintConfigs.map((name) => `"${name}"`), `"${TOOLKIT_CONFIG_INPUT}"`, '{ "externalDependencies": ["eslint"] }'];
141
+ return [
142
+ `Add to the ${input.target} target in ${input.file} (not to targetDefaults: a lint target written in a project file`,
143
+ "keeps only what targetDefaults lists, so its own files would drop out):",
144
+ ` "inputs": [${inputs.join(", ")}]`
145
+ ];
125
146
  }
126
147
 
127
148
  export {
128
149
  classifyFsdEslintConfig,
129
150
  applyFsdEslintConfig,
130
151
  buildFsdEslintPasteSnippet,
131
- composeFsdLayerGuide
152
+ composeFsdLayerGuide,
153
+ TOOLKIT_CONFIG_INPUT,
154
+ lintInputsTargetDefaultsSnippet,
155
+ lintInputsProjectSnippet
132
156
  };
@@ -5,17 +5,20 @@ import {
5
5
  profileById,
6
6
  resolveFrontendApp,
7
7
  resolveSlicePublicApiName
8
- } from "./chunk-B55SAIUS.js";
8
+ } from "./chunk-WVMTOWLM.js";
9
9
  import {
10
10
  generatorFilesDir,
11
11
  renderTemplateFiles
12
12
  } from "./chunk-YNMLB4DL.js";
13
+ import {
14
+ sameFileText
15
+ } from "./chunk-JPS6XKYK.js";
13
16
  import {
14
17
  RECORDED_FRONTENDS,
15
18
  readToolkitConfig,
16
19
  recordedFrontends,
17
20
  resolveLocaleOption
18
- } from "./chunk-AFAORV5O.js";
21
+ } from "./chunk-M7OQWSNF.js";
19
22
 
20
23
  // src/generators/slice/core.ts
21
24
  import { join } from "node:path";
@@ -66,7 +69,10 @@ function computeSliceAction(tree, plan) {
66
69
  if (actualNames.length !== expectedNames.length || !actualNames.every((n, i) => n === expectedNames[i])) {
67
70
  return "skipped";
68
71
  }
69
- const allMatch = plan.files.every((f) => tree.read(f.filePath, "utf-8") === f.content);
72
+ const allMatch = plan.files.every((f) => {
73
+ const existing = tree.read(f.filePath, "utf-8");
74
+ return existing !== null && sameFileText(existing, f.content);
75
+ });
70
76
  return allMatch ? "unchanged" : "skipped";
71
77
  }
72
78
  function refusal(reason, dryRun, layer, name, app, extra = {}) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  composeReviewSetup,
3
3
  judgeReviewFileConflict
4
- } from "./chunk-JEQQCSOB.js";
4
+ } from "./chunk-L3T4H7OF.js";
5
5
  import {
6
6
  DEPENDABOT_PATH,
7
7
  renderAddReviewReport,
8
8
  renderLineDiff
9
- } from "./chunk-HGEMEXKF.js";
9
+ } from "./chunk-AON4KGZT.js";
10
10
  import {
11
11
  generatorFilesDir,
12
12
  renderTemplateFiles
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  applyJsonEdits,
19
19
  treePackageManager
20
- } from "./chunk-AFAORV5O.js";
20
+ } from "./chunk-M7OQWSNF.js";
21
21
 
22
22
  // src/generators/add-review/generator.ts
23
23
  var CONFIG_PATH = "toolkit.config.json";
@@ -2,17 +2,23 @@ import {
2
2
  applyFsdEslintConfig,
3
3
  buildFsdEslintPasteSnippet,
4
4
  composeFsdLayerGuide
5
- } from "./chunk-L2RZ2LBO.js";
5
+ } from "./chunk-N6B6VBHG.js";
6
6
  import {
7
7
  profileById,
8
8
  resolveFrontendApp
9
- } from "./chunk-B55SAIUS.js";
9
+ } from "./chunk-WVMTOWLM.js";
10
10
  import {
11
11
  ESLINT_CONFIG_CANDIDATES
12
12
  } from "./chunk-6ZTIUBB2.js";
13
+ import {
14
+ sameFileText
15
+ } from "./chunk-JPS6XKYK.js";
13
16
  import {
14
17
  resolveDryRun
15
18
  } from "./chunk-TUN34LAQ.js";
19
+ import {
20
+ runNxFor
21
+ } from "./chunk-ILICA6LC.js";
16
22
  import {
17
23
  applyJsonEdits,
18
24
  readToolkitConfig,
@@ -20,11 +26,13 @@ import {
20
26
  resolveLocaleOption,
21
27
  setJsonValue,
22
28
  treePackageManager
23
- } from "./chunk-AFAORV5O.js";
29
+ } from "./chunk-M7OQWSNF.js";
24
30
  import {
31
+ INSTALL_ASSUMES_PNPM,
25
32
  detectYarnFlavor,
26
- packageManagerCommands
27
- } from "./chunk-FQHFT5IH.js";
33
+ packageManagerCommands,
34
+ runNxCommand
35
+ } from "./chunk-5Z7VZPES.js";
28
36
 
29
37
  // src/generators/add-fsd-lite/generator.ts
30
38
  import { posix } from "node:path";
@@ -138,7 +146,7 @@ function renderAddFsdLiteReport(report) {
138
146
  st.target === "added" ? ` target ${"fsd-check"}: added to ${st.targetPath}` : st.target === "present" ? ` target ${"fsd-check"}: already present in ${st.targetPath}` : " target fsd-check: NOT added \u2014 no parseable project.json / package.json for the app"
139
147
  );
140
148
  lines.push(
141
- st.dependencies === "added" ? ` devDependencies: steiger + @feature-sliced/steiger-plugin added to package.json \u2014 run \`${st.installCommand}\`` : st.dependencies === "present" ? " devDependencies: already present" : " devDependencies: NOT added \u2014 the root package.json could not be parsed"
149
+ st.dependencies === "added" ? ` devDependencies: steiger + @feature-sliced/steiger-plugin added to package.json \u2014 run \`${st.installCommand}\`${st.installAssumed ? ` (${INSTALL_ASSUMES_PNPM})` : ""}` : st.dependencies === "present" ? " devDependencies: already present" : " devDependencies: NOT added \u2014 the root package.json could not be parsed"
142
150
  );
143
151
  lines.push(` run it with: ${st.runCommand} (steiger needs Node >= 22.18)`);
144
152
  }
@@ -194,7 +202,7 @@ function runAddFsdLite(tree, options) {
194
202
  eslint,
195
203
  eslintPath,
196
204
  snippet: eslint === "applied" || eslint === "already-applied" ? null : snippet,
197
- layerGuide: composeFsdLayerGuide({ profile, sourceRoot: app.sourceRoot, locale })
205
+ layerGuide: composeFsdLayerGuide({ profile, sourceRoot: app.sourceRoot, locale, runNx: runNxFor((path) => tree.exists(path), (path) => tree.read(path, "utf-8")) })
198
206
  };
199
207
  }
200
208
  function readJsonObject(tree, path) {
@@ -216,7 +224,7 @@ function addSteiger(tree, input) {
216
224
  configAction = "created";
217
225
  if (input.write) tree.write(configPath, configText);
218
226
  } else {
219
- configAction = existing === configText ? "unchanged" : "kept";
227
+ configAction = sameFileText(existing, configText) ? "unchanged" : "kept";
220
228
  }
221
229
  const rootPrefix = input.appRoot === "" || input.appRoot === "." ? "" : `${input.appRoot}/`;
222
230
  const sourceRootName = input.sourceRoot.startsWith(rootPrefix) ? input.sourceRoot.slice(rootPrefix.length) : "src";
@@ -256,7 +264,8 @@ function addSteiger(tree, input) {
256
264
  if (input.write) tree.write("package.json", edited);
257
265
  }
258
266
  }
259
- const pm = treePackageManager(tree, input.config) ?? "pnpm";
267
+ const known = treePackageManager(tree, input.config);
268
+ const pm = known ?? "pnpm";
260
269
  const commands = packageManagerCommands(pm, pm === "yarn" ? detectYarnFlavor((p) => tree.exists(p), (p) => tree.read(p, "utf-8")) : void 0);
261
270
  return {
262
271
  configPath,
@@ -265,7 +274,9 @@ function addSteiger(tree, input) {
265
274
  target: targetAction,
266
275
  dependencies: dependenciesAction,
267
276
  installCommand: commands.install,
268
- runCommand: `${commands.runNx} run <project>:${FSD_CHECK_TARGET}`
277
+ // nx runs through npx nx when the manager is unknown; the install command keeps pnpm's form
278
+ ...known === null ? { installAssumed: true } : {},
279
+ runCommand: `${runNxCommand(known)} run <project>:${FSD_CHECK_TARGET}`
269
280
  };
270
281
  }
271
282
  async function addFsdLiteGenerator(tree, options) {
@@ -214,7 +214,8 @@ function addSharedTypesWorkspaceGlob(yamlText, entry = DEFAULT_SHARED_TYPES_ROOT
214
214
  if (new RegExp(`^\\s*-\\s*['"]?(${escape(entry)}|${escape(parentGlob)})['"]?\\s*$`, "m").test(yamlText)) {
215
215
  return { status: "present" };
216
216
  }
217
- const lines = yamlText.split("\n");
217
+ const eol = yamlText.includes("\r\n") ? "\r\n" : "\n";
218
+ const lines = yamlText.split(/\r?\n/);
218
219
  const packagesIndex = lines.findIndex((line) => /^packages:\s*$/.test(line));
219
220
  if (packagesIndex === -1)
220
221
  return { status: "unrecognized" };
@@ -232,7 +233,7 @@ function addSharedTypesWorkspaceGlob(yamlText, entry = DEFAULT_SHARED_TYPES_ROOT
232
233
  return { status: "unrecognized" };
233
234
  const indent = /^(\s+)-/.exec(lines[lastEntry])?.[1] ?? " ";
234
235
  lines.splice(lastEntry + 1, 0, `${indent}- '${entry}'`);
235
- return { status: "added", text: lines.join("\n") };
236
+ return { status: "added", text: lines.join(eol) };
236
237
  }
237
238
 
238
239
  export {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6ZTIUBB2.js";
7
7
  import {
8
8
  readToolkitConfig
9
- } from "./chunk-AFAORV5O.js";
9
+ } from "./chunk-M7OQWSNF.js";
10
10
 
11
11
  // ../template-engine/dist/frameworks/profiles.js
12
12
  var ALL_LAYERS = ["app", "pages", "features", "entities", "shared"];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderLineDiff
3
- } from "./chunk-HGEMEXKF.js";
3
+ } from "./chunk-AON4KGZT.js";
4
4
  import {
5
5
  resolveFsdPolicy
6
6
  } from "./chunk-5MI3O4VZ.js";
@@ -16,7 +16,7 @@ import {
16
16
  resolveAiHostsOption,
17
17
  resolveLocaleOption,
18
18
  rulesFilesFor
19
- } from "./chunk-AFAORV5O.js";
19
+ } from "./chunk-M7OQWSNF.js";
20
20
 
21
21
  // ../templates/dist/agents/agent-sections.js
22
22
  var UNIVERSAL_AGENT_SECTION_IDS = [
@@ -144,8 +144,9 @@ var EN_SECTIONS = {
144
144
  heading: "Frontend Structure (FSD Lite)",
145
145
  body: [
146
146
  'The frontend app follows canonical Feature-Sliced Design. "Lite" means only that the default scope',
147
- "is `app`, `pages`, `features`, `entities` and `shared` (`widgets` only on request) and that Solo",
148
- "workspaces get warnings instead of errors \u2014 the rules themselves are the canonical ones:",
147
+ "is `app`, `pages`, `features`, `entities` and `shared` (`widgets` only on request) and that a",
148
+ "quick-start workspace reports violations as warnings, a team one as errors \u2014 the rules themselves",
149
+ "are the canonical ones:",
149
150
  "- A layer imports only layers below it: app > pages > widgets > features > entities > shared.",
150
151
  "- Slices on one layer (pages, widgets, features, entities) never import each other; move the",
151
152
  " shared part one layer down, or expose it through the other slice's `@x/<consumer>` public API.",
@@ -275,8 +276,8 @@ var KO_SECTIONS = {
275
276
  heading: "\uD504\uB860\uD2B8\uC5D4\uB4DC \uAD6C\uC870 (FSD Lite)",
276
277
  body: [
277
278
  '\uD504\uB860\uD2B8\uC5D4\uB4DC \uC571\uC740 \uC815\uC2DD Feature-Sliced Design\uC744 \uB530\uB978\uB2E4. "Lite"\uB294 \uAE30\uBCF8 \uBC94\uC704\uAC00 `app`, `pages`, `features`,',
278
- "`entities`, `shared`\uC774\uACE0(`widgets`\uB294 \uC694\uCCAD\uD560 \uB54C\uB9CC), Solo \uC6CC\uD06C\uC2A4\uD398\uC774\uC2A4\uC5D0\uC11C\uB294 \uC704\uBC18\uC744 \uC5D0\uB7EC\uAC00 \uC544\uB2CC",
279
- "\uACBD\uACE0\uB85C \uC54C\uB9B0\uB2E4\uB294 \uB73B\uC77C \uBFD0\uC774\uB2E4 \u2014 \uADDC\uCE59 \uC790\uCCB4\uB294 \uC815\uC2DD FSD \uADF8\uB300\uB85C\uB2E4:",
279
+ "`entities`, `shared`\uC774\uACE0(`widgets`\uB294 \uC694\uCCAD\uD560 \uB54C\uB9CC), quick-start \uC6CC\uD06C\uC2A4\uD398\uC774\uC2A4\uB294 \uC704\uBC18\uC744 \uACBD\uACE0\uB85C,",
280
+ "team \uC6CC\uD06C\uC2A4\uD398\uC774\uC2A4\uB294 \uC5D0\uB7EC\uB85C \uC54C\uB9B0\uB2E4\uB294 \uB73B\uC77C \uBFD0\uC774\uB2E4 \u2014 \uADDC\uCE59 \uC790\uCCB4\uB294 \uC815\uC2DD FSD \uADF8\uB300\uB85C\uB2E4:",
280
281
  "- \uB808\uC774\uC5B4\uB294 \uC790\uAE30\uBCF4\uB2E4 \uC544\uB798 \uB808\uC774\uC5B4\uB9CC import\uD55C\uB2E4: app > pages > widgets > features > entities > shared.",
281
282
  "- \uAC19\uC740 \uB808\uC774\uC5B4\uC758 \uC2AC\uB77C\uC774\uC2A4\uB07C\uB9AC(pages, widgets, features, entities)\uB294 import\uD558\uC9C0 \uC54A\uB294\uB2E4. \uACF5\uC720\uD560 \uCF54\uB4DC\uB294",
282
283
  " \uD55C \uB808\uC774\uC5B4 \uC544\uB798\uB85C \uB0B4\uB9AC\uAC70\uB098, \uC0C1\uB300 \uC2AC\uB77C\uC774\uC2A4\uC758 `@x/<consumer>` \uACF5\uAC1C API\uB85C\uB9CC \uB178\uCD9C\uD55C\uB2E4.",
@@ -2,13 +2,14 @@ import {
2
2
  addAgentRulesGenerator,
3
3
  generator_default,
4
4
  runAddAgentRules
5
- } from "../_chunks/chunk-2V5LX5NK.js";
6
- import "../_chunks/chunk-HGEMEXKF.js";
5
+ } from "../_chunks/chunk-ZNTGYYLU.js";
6
+ import "../_chunks/chunk-AON4KGZT.js";
7
7
  import "../_chunks/chunk-5MI3O4VZ.js";
8
8
  import "../_chunks/chunk-6ZTIUBB2.js";
9
+ import "../_chunks/chunk-JPS6XKYK.js";
9
10
  import "../_chunks/chunk-TUN34LAQ.js";
10
- import "../_chunks/chunk-AFAORV5O.js";
11
- import "../_chunks/chunk-FQHFT5IH.js";
11
+ import "../_chunks/chunk-M7OQWSNF.js";
12
+ import "../_chunks/chunk-5Z7VZPES.js";
12
13
  export {
13
14
  addAgentRulesGenerator,
14
15
  generator_default as default,
@@ -2,13 +2,13 @@ import {
2
2
  addBackendGenerator,
3
3
  generator_default,
4
4
  runAddBackend
5
- } from "../_chunks/chunk-PB4CFJD5.js";
6
- import "../_chunks/chunk-QQNDYJTR.js";
5
+ } from "../_chunks/chunk-624F6DEP.js";
6
+ import "../_chunks/chunk-WNO3ZGBB.js";
7
7
  import "../_chunks/chunk-TXAQ2GJC.js";
8
8
  import "../_chunks/chunk-6ZTIUBB2.js";
9
9
  import "../_chunks/chunk-TUN34LAQ.js";
10
- import "../_chunks/chunk-AFAORV5O.js";
11
- import "../_chunks/chunk-FQHFT5IH.js";
10
+ import "../_chunks/chunk-M7OQWSNF.js";
11
+ import "../_chunks/chunk-5Z7VZPES.js";
12
12
  export {
13
13
  addBackendGenerator,
14
14
  generator_default as default,