@clearlydev/nx-archweave 0.5.2 → 0.6.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 (36) hide show
  1. package/dist/generators/_chunks/{chunk-ILICA6LC.js → chunk-23NN76E3.js} +1 -1
  2. package/dist/generators/_chunks/{chunk-VTXXW2B5.js → chunk-3HSNM6AS.js} +5 -55
  3. package/dist/generators/_chunks/{chunk-624F6DEP.js → chunk-7EDJKUY4.js} +4 -106
  4. package/dist/generators/_chunks/chunk-AMOOSD5Q.js +79 -0
  5. package/dist/generators/_chunks/{chunk-M7OQWSNF.js → chunk-C2WELXMV.js} +11 -3
  6. package/dist/generators/_chunks/{chunk-E565RG2B.js → chunk-CSJZ4PP3.js} +15 -0
  7. package/dist/generators/_chunks/{chunk-WVMTOWLM.js → chunk-FBCIELXS.js} +4 -93
  8. package/dist/generators/_chunks/chunk-FZGN5NEP.js +31 -0
  9. package/dist/generators/_chunks/{chunk-ND62HBKD.js → chunk-JNYQTW7S.js} +15 -8
  10. package/dist/generators/_chunks/chunk-LJRFVE6B.js +55 -0
  11. package/dist/generators/_chunks/{chunk-Q7IYHKT3.js → chunk-M7UBCSYL.js} +5 -3
  12. package/dist/generators/_chunks/chunk-SHKQSTV2.js +110 -0
  13. package/dist/generators/_chunks/{chunk-RDTB34IA.js → chunk-VCLVE4EQ.js} +10 -94
  14. package/dist/generators/_chunks/chunk-XSALM2IR.js +396 -0
  15. package/dist/generators/_chunks/{chunk-LBYZDAWS.js → chunk-XXXON43Z.js} +194 -3
  16. package/dist/generators/_chunks/chunk-YEMQFSL6.js +95 -0
  17. package/dist/generators/_chunks/{chunk-3ZHRZK5M.js → chunk-ZRHIFPUC.js} +4 -32
  18. package/dist/generators/add-agent-rules/generator.js +4 -3
  19. package/dist/generators/add-backend/generator.js +3 -2
  20. package/dist/generators/add-fsd-lite/generator.js +7 -5
  21. package/dist/generators/add-github-templates/generator.js +3 -2
  22. package/dist/generators/add-integration/generator.js +2 -2
  23. package/dist/generators/add-review/generator.js +3 -3
  24. package/dist/generators/doctor/generator.js +32 -19
  25. package/dist/generators/entity/generator.js +4 -3
  26. package/dist/generators/feature/generator.js +4 -3
  27. package/dist/generators/init/generator.js +32 -367
  28. package/dist/generators/install-integration/generator.js +2 -2
  29. package/dist/generators/page/generator.js +4 -3
  30. package/dist/generators/shared/generator.js +4 -3
  31. package/dist/generators/widget/generator.js +4 -3
  32. package/dist/migrations/update-0.5.3/add-toolkit-config-lint-input.js +62 -0
  33. package/migrations.json +9 -0
  34. package/package.json +7 -2
  35. package/src/generators/add-review/schema.json +4 -0
  36. package/src/generators/init/schema.json +4 -0
@@ -126,9 +126,10 @@ function composeFsdLayerGuide({ profile, sourceRoot, locale, runNx }) {
126
126
 
127
127
  // ../template-engine/dist/fsd/lint-cache-inputs.js
128
128
  var TOOLKIT_CONFIG_INPUT = "{workspaceRoot}/toolkit.config.json";
129
+ var SPREAD_INPUT_NX_NOTE = "(Nx 23+)";
129
130
  function lintInputsTargetDefaultsSnippet(target) {
130
131
  return [
131
- "Add to nx.json:",
132
+ `Add to nx.json ${SPREAD_INPUT_NX_NOTE}:`,
132
133
  ` "targetDefaults": { "${target}": { "inputs": ["...", "${TOOLKIT_CONFIG_INPUT}"] } }`,
133
134
  'Keep "...": it stands for the inputs @nx/eslint/plugin infers (the sources, the ESLint config). Without it',
134
135
  "they are dropped, and lint is served from the cache after a source change."
@@ -139,7 +140,7 @@ function lintInputsListSnippet(target) {
139
140
  `targetDefaults.${target} in nx.json is a list of entries, each for the projects its filter picks. Add`,
140
141
  `"${TOOLKIT_CONFIG_INPUT}" to every entry that covers an FSD project:`,
141
142
  ` an entry with inputs: add it to its "inputs"`,
142
- ` an entry without inputs: "inputs": ["...", "${TOOLKIT_CONFIG_INPUT}"]`,
143
+ ` an entry without inputs ${SPREAD_INPUT_NX_NOTE}: "inputs": ["...", "${TOOLKIT_CONFIG_INPUT}"]`,
143
144
  'Keep "...": it stands for the inputs @nx/eslint/plugin infers (the sources, the ESLint config). Without it',
144
145
  "they are dropped, and lint is served from the cache after a source change. A lint target written in a",
145
146
  'project file keeps only what targetDefaults lists ("..." has nothing to keep there): give it its own inputs.'
@@ -155,6 +156,193 @@ function lintInputsProjectSnippet(input) {
155
156
  ` "inputs": [${inputs.join(", ")}]`
156
157
  ];
157
158
  }
159
+ function lintInputsKeySnippet(key, target, hasInputs) {
160
+ return [
161
+ `targetDefaults["${key}"] in nx.json is the entry Nx applies to the ${target} target (it comes before targetDefaults.${target},`,
162
+ "and Nx applies one entry only). Add the input there:",
163
+ hasInputs ? ` add "${TOOLKIT_CONFIG_INPUT}" to its "inputs"` : ` "inputs": ["...", "${TOOLKIT_CONFIG_INPUT}"] ${SPREAD_INPUT_NX_NOTE}`
164
+ ];
165
+ }
166
+
167
+ // ../template-engine/dist/fsd/lint-target-defaults.js
168
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
169
+ var inputsOf = (value) => isObject(value) && Array.isArray(value["inputs"]) ? value["inputs"] : void 0;
170
+ function readTargetDefaults(targetDefaults, key) {
171
+ const value = isObject(targetDefaults) ? targetDefaults[key] : void 0;
172
+ if (value === void 0)
173
+ return { shape: "absent" };
174
+ if (Array.isArray(value))
175
+ return { shape: "list", entries: value.map((entry) => ({ inputs: inputsOf(entry) })) };
176
+ if (isObject(value))
177
+ return { shape: "object", inputs: inputsOf(value) };
178
+ return { shape: "other" };
179
+ }
180
+ function resolveTargetDefaults(targetDefaults, targetName, ctx) {
181
+ if (!isObject(targetDefaults))
182
+ return { kind: "none" };
183
+ for (const key of orderedKeys(targetDefaults, targetName, ctx.executor)) {
184
+ if (key.kind === "unknown")
185
+ return { kind: "unknown", key: key.key };
186
+ const value = targetDefaults[key.key];
187
+ if (isObject(value))
188
+ return { kind: "found", key: key.key, inputs: inputsOf(value) };
189
+ if (!Array.isArray(value))
190
+ return { kind: "unknown", key: key.key };
191
+ let applied = false;
192
+ let inputs;
193
+ for (const entry of value) {
194
+ if (!isObject(entry))
195
+ return { kind: "unknown", key: key.key };
196
+ const matches = filterMatches(entry["filter"], ctx);
197
+ if (matches === void 0)
198
+ return { kind: "unknown", key: key.key };
199
+ if (!matches)
200
+ continue;
201
+ applied = true;
202
+ const own = inputsOf(entry);
203
+ if (own === void 0)
204
+ continue;
205
+ const earlier = inputs;
206
+ inputs = earlier !== void 0 && own.includes("...") ? own.flatMap((input) => input === "..." ? earlier : [input]) : own;
207
+ }
208
+ if (applied)
209
+ return { kind: "found", key: key.key, inputs };
210
+ }
211
+ return { kind: "none" };
212
+ }
213
+ function* orderedKeys(targetDefaults, targetName, executor) {
214
+ if (executor !== void 0 && executor in targetDefaults)
215
+ yield { kind: "key", key: executor };
216
+ if (targetName in targetDefaults && targetName !== executor)
217
+ yield { kind: "key", key: targetName };
218
+ const globs = [];
219
+ for (const key of Object.keys(targetDefaults)) {
220
+ if (key === targetName || key === executor || !isGlobPattern(key))
221
+ continue;
222
+ const matches = globMatch(key, targetName);
223
+ if (matches === void 0) {
224
+ yield { kind: "unknown", key };
225
+ return;
226
+ }
227
+ if (matches)
228
+ globs.push(key);
229
+ }
230
+ for (const key of globs.sort((a, b) => b.length - a.length))
231
+ yield { kind: "key", key };
232
+ }
233
+ function filterMatches(filter, ctx) {
234
+ if (filter === void 0)
235
+ return true;
236
+ if (!isObject(filter))
237
+ return void 0;
238
+ const results = [];
239
+ if (filter["projects"] !== void 0) {
240
+ results.push(Array.isArray(filter["projects"]) ? projectsMatch(filter["projects"].map(String), ctx.project) : void 0);
241
+ }
242
+ if (typeof filter["plugin"] === "string")
243
+ results.push(ctx.plugin === void 0 ? void 0 : filter["plugin"] === ctx.plugin);
244
+ if (typeof filter["executor"] === "string")
245
+ results.push(ctx.executor === void 0 ? void 0 : filter["executor"] === ctx.executor);
246
+ if (results.includes(false))
247
+ return false;
248
+ return results.includes(void 0) ? void 0 : true;
249
+ }
250
+ function projectsMatch(patterns, project) {
251
+ const list = patterns.filter((pattern) => pattern.length > 0);
252
+ if (list.length === 0)
253
+ return false;
254
+ let selected = list[0]?.startsWith("!") ?? false;
255
+ for (const raw of list) {
256
+ const exclude = raw.startsWith("!");
257
+ const pattern = exclude ? raw.slice(1) : raw;
258
+ if (pattern.startsWith("nx-cloud:"))
259
+ continue;
260
+ const matches = projectPatternMatch(pattern, project);
261
+ if (matches === void 0)
262
+ return void 0;
263
+ if (matches)
264
+ selected = !exclude;
265
+ }
266
+ return selected;
267
+ }
268
+ function projectPatternMatch(pattern, project) {
269
+ if (pattern === "*" || pattern === project.name)
270
+ return true;
271
+ const separator = pattern.indexOf(":");
272
+ const type = separator === -1 ? "unlabeled" : pattern.slice(0, separator);
273
+ const value = ["name", "tag", "directory", "unlabeled"].includes(type) && separator !== -1 ? pattern.slice(separator + 1) : pattern;
274
+ const byName = () => value === project.name ? true : isGlobPattern(value) ? globMatch(value, project.name) : new RegExp(`(?<![@a-zA-Z0-9-])${value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![@a-zA-Z0-9-])`, "i").test(project.name);
275
+ const byDirectory = () => globMatch(value, project.root);
276
+ switch (separator === -1 || !["name", "tag", "directory"].includes(type) ? "unlabeled" : type) {
277
+ case "name":
278
+ return byName();
279
+ case "tag":
280
+ if (project.tags.includes(value))
281
+ return true;
282
+ if (!isGlobPattern(value))
283
+ return false;
284
+ return anyOf(project.tags.map((tag) => globMatch(value, tag)));
285
+ case "directory":
286
+ return byDirectory();
287
+ default: {
288
+ const name = byName();
289
+ return name === false ? byDirectory() : name;
290
+ }
291
+ }
292
+ }
293
+ function anyOf(results) {
294
+ if (results.includes(true))
295
+ return true;
296
+ return results.includes(void 0) ? void 0 : false;
297
+ }
298
+ var GLOB_CHARACTERS = /* @__PURE__ */ new Set(["*", "|", "{", "}", "(", ")", "["]);
299
+ function isGlobPattern(pattern) {
300
+ return [...pattern].some((character) => GLOB_CHARACTERS.has(character));
301
+ }
302
+ function globMatch(pattern, subject) {
303
+ if (pattern.startsWith("!") || /[@!?+*]\(/.test(pattern) || pattern.includes("|"))
304
+ return void 0;
305
+ let source = "";
306
+ let braces = 0;
307
+ for (let index = 0; index < pattern.length; index++) {
308
+ const character = pattern.charAt(index);
309
+ if (character === "\\") {
310
+ const next = pattern[++index];
311
+ if (next === void 0)
312
+ return void 0;
313
+ source += next.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
314
+ } else if (character === "*") {
315
+ if (pattern[index + 1] === "*") {
316
+ source += ".*";
317
+ index++;
318
+ } else {
319
+ source += "[^/]*";
320
+ }
321
+ } else if (character === "?") {
322
+ source += "[^/]";
323
+ } else if (character === "[") {
324
+ const end = pattern.indexOf("]", index + 2);
325
+ if (end === -1)
326
+ return void 0;
327
+ const body = pattern.slice(index + 1, end);
328
+ source += `[${body.startsWith("!") ? `^${body.slice(1)}` : body}]`;
329
+ index = end;
330
+ } else if (character === "{") {
331
+ braces++;
332
+ source += "(?:";
333
+ } else if (character === "}" && braces > 0) {
334
+ braces--;
335
+ source += ")";
336
+ } else if (character === "," && braces > 0) {
337
+ source += "|";
338
+ } else {
339
+ source += character.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
340
+ }
341
+ }
342
+ if (braces !== 0)
343
+ return void 0;
344
+ return new RegExp(`^${source}$`).test(subject);
345
+ }
158
346
 
159
347
  export {
160
348
  classifyFsdEslintConfig,
@@ -164,5 +352,8 @@ export {
164
352
  TOOLKIT_CONFIG_INPUT,
165
353
  lintInputsTargetDefaultsSnippet,
166
354
  lintInputsListSnippet,
167
- lintInputsProjectSnippet
355
+ lintInputsProjectSnippet,
356
+ lintInputsKeySnippet,
357
+ readTargetDefaults,
358
+ resolveTargetDefaults
168
359
  };
@@ -0,0 +1,95 @@
1
+ // ../template-engine/dist/frameworks/profiles.js
2
+ var ALL_LAYERS = ["app", "pages", "features", "entities", "shared"];
3
+ var NEXT = {
4
+ id: "next",
5
+ recognised: true,
6
+ // Next.js's own app/ (App Router) directory is the composition root; FSD's Next.js guide
7
+ // names the FSD app and pages layers _app and _pages, since Next.js reads src/app and
8
+ // src/pages as its routers.
9
+ layers: ["pages", "features", "entities", "shared"],
10
+ layerDirs: { app: "_app", pages: "_pages" },
11
+ buildOutputDirs: [".next", "out"],
12
+ platformSuffixes: [],
13
+ routerDirs: ["pages"]
14
+ };
15
+ var REACT_VITE = {
16
+ id: "react-vite",
17
+ recognised: true,
18
+ layers: ALL_LAYERS,
19
+ layerDirs: {},
20
+ buildOutputDirs: ["dist"],
21
+ platformSuffixes: [],
22
+ routerDirs: []
23
+ };
24
+ var EXPO_ROUTER = {
25
+ id: "expo",
26
+ recognised: true,
27
+ layers: ALL_LAYERS,
28
+ layerDirs: { app: "_app" },
29
+ buildOutputDirs: [".expo", "dist"],
30
+ platformSuffixes: ["ios", "android", "native", "web"],
31
+ routerDirs: []
32
+ };
33
+ var EXPO = { ...EXPO_ROUTER, layerDirs: {} };
34
+ var GENERIC = {
35
+ id: "generic",
36
+ recognised: false,
37
+ layers: ALL_LAYERS,
38
+ layerDirs: {},
39
+ buildOutputDirs: ["dist", "build"],
40
+ platformSuffixes: [],
41
+ routerDirs: []
42
+ };
43
+ var PROFILES = { next: NEXT, "react-vite": REACT_VITE, expo: EXPO_ROUTER, generic: GENERIC };
44
+ function profileById(id) {
45
+ return PROFILES[id];
46
+ }
47
+ function allFrameworkProfiles() {
48
+ return Object.values(PROFILES);
49
+ }
50
+ var NEXT_CONFIGS = ["next.config.js", "next.config.mjs", "next.config.ts", "next.config.cjs"];
51
+ var VITE_CONFIGS = ["vite.config.ts", "vite.config.mts", "vite.config.js", "vite.config.mjs"];
52
+ var EXPO_CONFIGS = ["app.config.ts", "app.config.js", "app.config.mjs"];
53
+ function hasExpoKey(input, file) {
54
+ const text = input.read(file);
55
+ if (typeof text !== "string")
56
+ return false;
57
+ try {
58
+ return typeof JSON.parse(text)["expo"] === "object";
59
+ } catch {
60
+ return false;
61
+ }
62
+ }
63
+ function dependsOn(input, manifest, name) {
64
+ const text = input.read(manifest);
65
+ if (typeof text !== "string")
66
+ return false;
67
+ try {
68
+ const parsed = JSON.parse(text);
69
+ return ["dependencies", "devDependencies", "peerDependencies"].some((field) => parsed[field]?.[name] !== void 0);
70
+ } catch {
71
+ return false;
72
+ }
73
+ }
74
+ function detectFramework(input) {
75
+ const prefix = input.projectRoot === "" || input.projectRoot === "." ? "" : `${input.projectRoot}/`;
76
+ const executors = input.executors ?? [];
77
+ if (NEXT_CONFIGS.some((file) => input.exists(`${prefix}${file}`)) || executors.some((executor) => executor.startsWith("@nx/next:"))) {
78
+ return NEXT;
79
+ }
80
+ const dependsAnywhere = (name) => dependsOn(input, `${prefix}package.json`, name) || dependsOn(input, "package.json", name);
81
+ const usesExpo = executors.some((executor) => executor.startsWith("@nx/expo:")) || hasExpoKey(input, `${prefix}app.json`) || EXPO_CONFIGS.some((file) => input.exists(`${prefix}${file}`)) || dependsOn(input, `${prefix}package.json`, "expo");
82
+ if (usesExpo)
83
+ return dependsAnywhere("expo-router") ? EXPO_ROUTER : EXPO;
84
+ const usesReact = dependsAnywhere("react");
85
+ const usesVite = VITE_CONFIGS.some((file) => input.exists(`${prefix}${file}`)) || executors.some((executor) => executor.startsWith("@nx/vite:"));
86
+ if (usesVite && usesReact)
87
+ return REACT_VITE;
88
+ return GENERIC;
89
+ }
90
+
91
+ export {
92
+ profileById,
93
+ allFrameworkProfiles,
94
+ detectFramework
95
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ renderAddGithubTemplatesReport
3
+ } from "./chunk-FZGN5NEP.js";
1
4
  import {
2
5
  generatorFilesDir,
3
6
  renderTemplateFiles
@@ -11,40 +14,10 @@ import {
11
14
  import {
12
15
  readToolkitConfig,
13
16
  resolveLocaleOption
14
- } from "./chunk-M7OQWSNF.js";
17
+ } from "./chunk-C2WELXMV.js";
15
18
 
16
19
  // src/generators/add-github-templates/generator.ts
17
20
  import { join } from "node:path";
18
-
19
- // src/generators/add-github-templates/render.ts
20
- var ACTION_LINES = {
21
- created: "created",
22
- unchanged: "unchanged (already matches the generated version)",
23
- skipped: "left as-is (a different file already exists there \u2014 never overwritten)"
24
- };
25
- function renderAddGithubTemplatesReport(report) {
26
- const lines = [];
27
- if (report.files.length === 0) {
28
- lines.push("add-github-templates: nothing selected (issue/pr/codeowners all false) \u2014 no files to install.");
29
- return lines.join("\n");
30
- }
31
- if (report.dryRun) {
32
- lines.push("add-github-templates dry-run \u2014 no files were written.");
33
- lines.push("");
34
- for (const file of report.files) {
35
- lines.push(`${file.filePath}:`);
36
- lines.push(file.content);
37
- lines.push("");
38
- }
39
- lines.push("Effective decision:");
40
- }
41
- for (const file of report.files) {
42
- lines.push(` ${file.filePath}: ${ACTION_LINES[file.action]}`);
43
- }
44
- return lines.join("\n");
45
- }
46
-
47
- // src/generators/add-github-templates/generator.ts
48
21
  var BUG_REPORT_PATH = ".github/ISSUE_TEMPLATE/bug-report.yml";
49
22
  var FEATURE_REQUEST_PATH = ".github/ISSUE_TEMPLATE/feature-request.yml";
50
23
  var PULL_REQUEST_TEMPLATE_PATH = ".github/PULL_REQUEST_TEMPLATE.md";
@@ -81,7 +54,6 @@ async function addGithubTemplatesGenerator(tree, options) {
81
54
  var generator_default = addGithubTemplatesGenerator;
82
55
 
83
56
  export {
84
- renderAddGithubTemplatesReport,
85
57
  BUG_REPORT_PATH,
86
58
  FEATURE_REQUEST_PATH,
87
59
  PULL_REQUEST_TEMPLATE_PATH,
@@ -2,13 +2,14 @@ import {
2
2
  addAgentRulesGenerator,
3
3
  generator_default,
4
4
  runAddAgentRules
5
- } from "../_chunks/chunk-VTXXW2B5.js";
6
- import "../_chunks/chunk-E565RG2B.js";
5
+ } from "../_chunks/chunk-3HSNM6AS.js";
6
+ import "../_chunks/chunk-LJRFVE6B.js";
7
+ import "../_chunks/chunk-CSJZ4PP3.js";
7
8
  import "../_chunks/chunk-5MI3O4VZ.js";
8
9
  import "../_chunks/chunk-6ZTIUBB2.js";
9
10
  import "../_chunks/chunk-JPS6XKYK.js";
10
11
  import "../_chunks/chunk-TUN34LAQ.js";
11
- import "../_chunks/chunk-M7OQWSNF.js";
12
+ import "../_chunks/chunk-C2WELXMV.js";
12
13
  import "../_chunks/chunk-5Z7VZPES.js";
13
14
  export {
14
15
  addAgentRulesGenerator,
@@ -2,12 +2,13 @@ import {
2
2
  addBackendGenerator,
3
3
  generator_default,
4
4
  runAddBackend
5
- } from "../_chunks/chunk-624F6DEP.js";
5
+ } from "../_chunks/chunk-7EDJKUY4.js";
6
+ import "../_chunks/chunk-SHKQSTV2.js";
6
7
  import "../_chunks/chunk-WNO3ZGBB.js";
7
8
  import "../_chunks/chunk-TXAQ2GJC.js";
8
9
  import "../_chunks/chunk-6ZTIUBB2.js";
9
10
  import "../_chunks/chunk-TUN34LAQ.js";
10
- import "../_chunks/chunk-M7OQWSNF.js";
11
+ import "../_chunks/chunk-C2WELXMV.js";
11
12
  import "../_chunks/chunk-5Z7VZPES.js";
12
13
  export {
13
14
  addBackendGenerator,
@@ -2,15 +2,17 @@ import {
2
2
  addFsdLiteGenerator,
3
3
  generator_default,
4
4
  runAddFsdLite
5
- } from "../_chunks/chunk-RDTB34IA.js";
6
- import "../_chunks/chunk-LBYZDAWS.js";
7
- import "../_chunks/chunk-WVMTOWLM.js";
5
+ } from "../_chunks/chunk-VCLVE4EQ.js";
6
+ import "../_chunks/chunk-AMOOSD5Q.js";
7
+ import "../_chunks/chunk-XXXON43Z.js";
8
+ import "../_chunks/chunk-FBCIELXS.js";
9
+ import "../_chunks/chunk-YEMQFSL6.js";
8
10
  import "../_chunks/chunk-TXAQ2GJC.js";
9
11
  import "../_chunks/chunk-6ZTIUBB2.js";
10
12
  import "../_chunks/chunk-JPS6XKYK.js";
11
13
  import "../_chunks/chunk-TUN34LAQ.js";
12
- import "../_chunks/chunk-ILICA6LC.js";
13
- import "../_chunks/chunk-M7OQWSNF.js";
14
+ import "../_chunks/chunk-23NN76E3.js";
15
+ import "../_chunks/chunk-C2WELXMV.js";
14
16
  import "../_chunks/chunk-5Z7VZPES.js";
15
17
  export {
16
18
  addFsdLiteGenerator,
@@ -6,11 +6,12 @@ import {
6
6
  addGithubTemplatesGenerator,
7
7
  generator_default,
8
8
  runAddGithubTemplates
9
- } from "../_chunks/chunk-3ZHRZK5M.js";
9
+ } from "../_chunks/chunk-ZRHIFPUC.js";
10
+ import "../_chunks/chunk-FZGN5NEP.js";
10
11
  import "../_chunks/chunk-YNMLB4DL.js";
11
12
  import "../_chunks/chunk-JPS6XKYK.js";
12
13
  import "../_chunks/chunk-TUN34LAQ.js";
13
- import "../_chunks/chunk-M7OQWSNF.js";
14
+ import "../_chunks/chunk-C2WELXMV.js";
14
15
  import "../_chunks/chunk-5Z7VZPES.js";
15
16
  export {
16
17
  BUG_REPORT_PATH,
@@ -10,8 +10,8 @@ import {
10
10
  import "../_chunks/chunk-34V6HAJT.js";
11
11
  import {
12
12
  diskRunNx
13
- } from "../_chunks/chunk-ILICA6LC.js";
14
- import "../_chunks/chunk-M7OQWSNF.js";
13
+ } from "../_chunks/chunk-23NN76E3.js";
14
+ import "../_chunks/chunk-C2WELXMV.js";
15
15
  import "../_chunks/chunk-5Z7VZPES.js";
16
16
 
17
17
  // src/generators/add-integration/render.ts
@@ -3,13 +3,13 @@ import {
3
3
  generator_default,
4
4
  recordedReview,
5
5
  runAddReview
6
- } from "../_chunks/chunk-ND62HBKD.js";
6
+ } from "../_chunks/chunk-JNYQTW7S.js";
7
7
  import "../_chunks/chunk-2WXAGWAJ.js";
8
- import "../_chunks/chunk-E565RG2B.js";
8
+ import "../_chunks/chunk-CSJZ4PP3.js";
9
9
  import "../_chunks/chunk-YNMLB4DL.js";
10
10
  import "../_chunks/chunk-JPS6XKYK.js";
11
11
  import "../_chunks/chunk-TUN34LAQ.js";
12
- import "../_chunks/chunk-M7OQWSNF.js";
12
+ import "../_chunks/chunk-C2WELXMV.js";
13
13
  import "../_chunks/chunk-5Z7VZPES.js";
14
14
  export {
15
15
  addReviewGenerator,
@@ -3,7 +3,7 @@ import {
3
3
  } from "../_chunks/chunk-U6LAFHSF.js";
4
4
  import {
5
5
  detectUnitTestRunner
6
- } from "../_chunks/chunk-Q7IYHKT3.js";
6
+ } from "../_chunks/chunk-M7UBCSYL.js";
7
7
  import "../_chunks/chunk-ASY3CK5L.js";
8
8
  import {
9
9
  REVIEW_MODES,
@@ -25,13 +25,16 @@ import {
25
25
  import {
26
26
  TOOLKIT_CONFIG_INPUT,
27
27
  classifyFsdEslintConfig,
28
+ lintInputsKeySnippet,
28
29
  lintInputsProjectSnippet,
29
- lintInputsTargetDefaultsSnippet
30
- } from "../_chunks/chunk-LBYZDAWS.js";
30
+ lintInputsTargetDefaultsSnippet,
31
+ resolveTargetDefaults
32
+ } from "../_chunks/chunk-XXXON43Z.js";
31
33
  import {
32
34
  resolveFrontendApp,
33
35
  sourceRootOf
34
- } from "../_chunks/chunk-WVMTOWLM.js";
36
+ } from "../_chunks/chunk-FBCIELXS.js";
37
+ import "../_chunks/chunk-YEMQFSL6.js";
35
38
  import "../_chunks/chunk-TXAQ2GJC.js";
36
39
  import {
37
40
  ESLINT_CONFIG_CANDIDATES,
@@ -50,11 +53,11 @@ import {
50
53
  import "../_chunks/chunk-34V6HAJT.js";
51
54
  import {
52
55
  diskRunNx
53
- } from "../_chunks/chunk-ILICA6LC.js";
56
+ } from "../_chunks/chunk-23NN76E3.js";
54
57
  import {
55
58
  readToolkitConfig,
56
59
  recordedFrontends
57
- } from "../_chunks/chunk-M7OQWSNF.js";
60
+ } from "../_chunks/chunk-C2WELXMV.js";
58
61
  import {
59
62
  detectWorkspacePackageManager,
60
63
  runNxCommand
@@ -869,7 +872,7 @@ function buildFsdRuleAnchoredCheck(root, projects) {
869
872
  import { existsSync as existsSync6, readdirSync as readdirSync5, readFileSync as readFileSync5 } from "node:fs";
870
873
  import { join as join6 } from "node:path";
871
874
  var ESLINT_PLUGIN = "@nx/eslint/plugin";
872
- var ESLINT_EXECUTOR = "@nx/eslint:lint";
875
+ var INFERRED_EXECUTOR = "nx:run-commands";
873
876
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
874
877
  function readJson(path) {
875
878
  try {
@@ -895,7 +898,7 @@ function readLintSetup(root) {
895
898
  }
896
899
  function projectList(root, projects) {
897
900
  if (projects !== void 0)
898
- return projects.map((project) => ({ name: project.name, root: project.root }));
901
+ return projects.map((project) => ({ name: project.name, root: project.root, tags: project.tags }));
899
902
  const found = [];
900
903
  for (const folder of ["apps", "libs"]) {
901
904
  let entries = [];
@@ -909,7 +912,8 @@ function projectList(root, projects) {
909
912
  const config = readJson(join6(root, dir, "project.json")) ?? readJson(join6(root, dir, "package.json"));
910
913
  if (config === null)
911
914
  continue;
912
- found.push({ name: typeof config["name"] === "string" ? config["name"] : name, root: dir });
915
+ const tags = Array.isArray(config["tags"]) ? config["tags"] : isObject(config["nx"]) && Array.isArray(config["nx"]["tags"]) ? config["nx"]["tags"] : [];
916
+ found.push({ name: typeof config["name"] === "string" ? config["name"] : name, root: dir, tags: tags.map(String) });
913
917
  }
914
918
  }
915
919
  return found;
@@ -944,13 +948,16 @@ function configFileOf(root, projectRoot) {
944
948
  const prefix = projectPrefix(projectRoot);
945
949
  return existsSync6(join6(root, `${prefix}project.json`)) ? `${prefix}project.json` : `${prefix}package.json`;
946
950
  }
947
- function defaultsInputs(setup, executor) {
948
- for (const key of [executor ?? ESLINT_EXECUTOR, setup.target]) {
949
- const entry = setup.targetDefaults[key];
950
- if (isObject(entry) && Array.isArray(entry["inputs"]))
951
- return entry["inputs"];
952
- }
953
- return void 0;
951
+ function resolveDefaults(setup, project, own) {
952
+ const executor = own === null ? INFERRED_EXECUTOR : own.executor ?? (setup.pluginRegistered ? INFERRED_EXECUTOR : void 0);
953
+ return resolveTargetDefaults(setup.targetDefaults, setup.target, {
954
+ executor,
955
+ plugin: own === null && setup.pluginRegistered ? ESLINT_PLUGIN : void 0,
956
+ project: { name: project.name, root: project.root, tags: project.tags }
957
+ });
958
+ }
959
+ function defaultsInputs(resolved) {
960
+ return resolved.kind === "found" ? resolved.inputs : void 0;
954
961
  }
955
962
  function carriesToolkitConfig(inputs, namedInputs) {
956
963
  return inputs.some((input) => {
@@ -997,14 +1004,20 @@ function buildLintCacheCheck(root, projects) {
997
1004
  if (projectPrefix(project.root) === "")
998
1005
  return false;
999
1006
  const own = ownLintTarget(root, project, setup.target);
1000
- const inputs = own?.inputs ?? defaultsInputs(setup, own?.executor);
1007
+ const inputs = own?.inputs ?? defaultsInputs(resolveDefaults(setup, project, own));
1001
1008
  return inputs === void 0 || !carriesToolkitConfig(inputs, setup.namedInputs);
1002
1009
  });
1003
1010
  if (missing.length === 0) {
1004
1011
  return createDoctorCheck({ id, label, status: "pass", message: "toolkit.config.json is among the FSD projects' lint inputs", evidence: [] });
1005
1012
  }
1006
1013
  const ownTargets = all.map((project) => ownLintTarget(root, project, setup.target)).filter((own) => own !== null);
1007
- const lines = setup.pluginRegistered && ownTargets.length === 0 ? lintInputsTargetDefaultsSnippet(setup.target) : missing.flatMap((project) => {
1014
+ const otherKeys = /* @__PURE__ */ new Map();
1015
+ for (const project of missing) {
1016
+ const resolved = resolveDefaults(setup, project, null);
1017
+ if (resolved.kind === "found" && resolved.key !== setup.target)
1018
+ otherKeys.set(resolved.key, resolved.inputs !== void 0);
1019
+ }
1020
+ const lines = setup.pluginRegistered && ownTargets.length === 0 ? otherKeys.size > 0 ? [...otherKeys].flatMap(([key, hasInputs]) => lintInputsKeySnippet(key, setup.target, hasInputs)) : lintInputsTargetDefaultsSnippet(setup.target) : missing.flatMap((project) => {
1008
1021
  const own = ownLintTarget(root, project, setup.target);
1009
1022
  return lintInputsProjectSnippet({
1010
1023
  file: own?.file ?? configFileOf(root, project.root),
@@ -1038,7 +1051,7 @@ function buildLintInputsSpreadCheck(root, projects) {
1038
1051
  const own = ownLintTarget(root, project, setup.target);
1039
1052
  if (own === null || own.inputs !== void 0)
1040
1053
  return false;
1041
- const inputs = defaultsInputs(setup, own.executor);
1054
+ const inputs = defaultsInputs(resolveDefaults(setup, project, own));
1042
1055
  return inputs !== void 0 && inputs.includes("...") && !namesOwnFiles(inputs);
1043
1056
  });
1044
1057
  if (affected.length === 0) {
@@ -3,8 +3,9 @@ import {
3
3
  } from "../_chunks/chunk-H222FPLK.js";
4
4
  import {
5
5
  runFsdSlice
6
- } from "../_chunks/chunk-Q7IYHKT3.js";
7
- import "../_chunks/chunk-WVMTOWLM.js";
6
+ } from "../_chunks/chunk-M7UBCSYL.js";
7
+ import "../_chunks/chunk-FBCIELXS.js";
8
+ import "../_chunks/chunk-YEMQFSL6.js";
8
9
  import "../_chunks/chunk-TXAQ2GJC.js";
9
10
  import "../_chunks/chunk-6ZTIUBB2.js";
10
11
  import "../_chunks/chunk-YNMLB4DL.js";
@@ -12,7 +13,7 @@ import "../_chunks/chunk-JPS6XKYK.js";
12
13
  import {
13
14
  resolveDryRun
14
15
  } from "../_chunks/chunk-TUN34LAQ.js";
15
- import "../_chunks/chunk-M7OQWSNF.js";
16
+ import "../_chunks/chunk-C2WELXMV.js";
16
17
  import "../_chunks/chunk-5Z7VZPES.js";
17
18
 
18
19
  // src/generators/entity/generator.ts
@@ -3,8 +3,9 @@ import {
3
3
  } from "../_chunks/chunk-H222FPLK.js";
4
4
  import {
5
5
  runFsdSlice
6
- } from "../_chunks/chunk-Q7IYHKT3.js";
7
- import "../_chunks/chunk-WVMTOWLM.js";
6
+ } from "../_chunks/chunk-M7UBCSYL.js";
7
+ import "../_chunks/chunk-FBCIELXS.js";
8
+ import "../_chunks/chunk-YEMQFSL6.js";
8
9
  import "../_chunks/chunk-TXAQ2GJC.js";
9
10
  import "../_chunks/chunk-6ZTIUBB2.js";
10
11
  import "../_chunks/chunk-YNMLB4DL.js";
@@ -12,7 +13,7 @@ import "../_chunks/chunk-JPS6XKYK.js";
12
13
  import {
13
14
  resolveDryRun
14
15
  } from "../_chunks/chunk-TUN34LAQ.js";
15
- import "../_chunks/chunk-M7OQWSNF.js";
16
+ import "../_chunks/chunk-C2WELXMV.js";
16
17
  import "../_chunks/chunk-5Z7VZPES.js";
17
18
 
18
19
  // src/generators/feature/generator.ts