@webpieces/nx-webpieces-rules 0.4.853 → 0.4.855

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 (110) hide show
  1. package/README.md +14 -0
  2. package/executors.json +5 -0
  3. package/package.json +7 -7
  4. package/src/executors/generate/executor.js +31 -55
  5. package/src/executors/generate/executor.js.map +1 -1
  6. package/src/executors/runtime-wiring-check/executor.d.ts +10 -0
  7. package/src/executors/runtime-wiring-check/executor.js +42 -0
  8. package/src/executors/runtime-wiring-check/executor.js.map +1 -0
  9. package/src/executors/runtime-wiring-check/schema.json +14 -0
  10. package/src/executors/validate-api-lib-tag/executor.js +5 -3
  11. package/src/executors/validate-api-lib-tag/executor.js.map +1 -1
  12. package/src/executors/validate-api-relations/executor.js +11 -8
  13. package/src/executors/validate-api-relations/executor.js.map +1 -1
  14. package/src/executors/validate-architecture-unchanged/executor.d.ts +1 -1
  15. package/src/executors/validate-architecture-unchanged/executor.js +22 -24
  16. package/src/executors/validate-architecture-unchanged/executor.js.map +1 -1
  17. package/src/index.d.ts +1 -0
  18. package/src/index.js +5 -1
  19. package/src/index.js.map +1 -1
  20. package/src/lib/api-usage/api-contract-approval.d.ts +7 -0
  21. package/src/lib/api-usage/api-contract-approval.js +50 -0
  22. package/src/lib/api-usage/api-contract-approval.js.map +1 -0
  23. package/src/lib/api-usage/api-contract-evidence.d.ts +6 -0
  24. package/src/lib/api-usage/api-contract-evidence.js +41 -0
  25. package/src/lib/api-usage/api-contract-evidence.js.map +1 -0
  26. package/src/lib/api-usage/api-relations-validator.d.ts +13 -2
  27. package/src/lib/api-usage/api-relations-validator.js +23 -0
  28. package/src/lib/api-usage/api-relations-validator.js.map +1 -1
  29. package/src/lib/api-usage/api-relations.d.ts +3 -0
  30. package/src/lib/api-usage/api-relations.js.map +1 -1
  31. package/src/lib/api-usage/api-scanner.d.ts +40 -0
  32. package/src/lib/api-usage/api-scanner.js +7 -1
  33. package/src/lib/api-usage/api-scanner.js.map +1 -1
  34. package/src/lib/graph-comparator.js +11 -1
  35. package/src/lib/graph-comparator.js.map +1 -1
  36. package/src/lib/graph-filter.client.d.ts +40 -0
  37. package/src/lib/graph-filter.client.js +190 -0
  38. package/src/lib/graph-filter.client.js.map +1 -0
  39. package/src/lib/graph-level-bands.d.ts +0 -18
  40. package/src/lib/graph-level-bands.js +4 -3
  41. package/src/lib/graph-level-bands.js.map +1 -1
  42. package/src/lib/graph-loader.js +12 -6
  43. package/src/lib/graph-loader.js.map +1 -1
  44. package/src/lib/graph-navigation.d.ts +5 -0
  45. package/src/lib/graph-navigation.js +102 -0
  46. package/src/lib/graph-navigation.js.map +1 -0
  47. package/src/lib/graph-node-menu.d.ts +1 -0
  48. package/src/lib/graph-node-menu.js +29 -0
  49. package/src/lib/graph-node-menu.js.map +1 -1
  50. package/src/lib/graph-render-model.d.ts +32 -0
  51. package/src/lib/graph-render-model.js +76 -0
  52. package/src/lib/graph-render-model.js.map +1 -0
  53. package/src/lib/graph-sorter.d.ts +2 -0
  54. package/src/lib/graph-sorter.js.map +1 -1
  55. package/src/lib/graph-visualizer.client.d.ts +14 -73
  56. package/src/lib/graph-visualizer.client.js +71 -243
  57. package/src/lib/graph-visualizer.client.js.map +1 -1
  58. package/src/lib/graph-visualizer.d.ts +8 -15
  59. package/src/lib/graph-visualizer.js +48 -26
  60. package/src/lib/graph-visualizer.js.map +1 -1
  61. package/src/lib/runtime-details.d.ts +13 -0
  62. package/src/lib/runtime-details.js +191 -0
  63. package/src/lib/runtime-details.js.map +1 -0
  64. package/src/lib/runtime-graph-model.d.ts +4 -1
  65. package/src/lib/runtime-graph-model.js.map +1 -1
  66. package/src/lib/runtime-graph.js +10 -4
  67. package/src/lib/runtime-graph.js.map +1 -1
  68. package/src/lib/runtime-html-page.d.ts +7 -3
  69. package/src/lib/runtime-html-page.js +19 -6
  70. package/src/lib/runtime-html-page.js.map +1 -1
  71. package/src/lib/runtime-visualizer.client.d.ts +8 -19
  72. package/src/lib/runtime-visualizer.client.js +28 -41
  73. package/src/lib/runtime-visualizer.client.js.map +1 -1
  74. package/src/lib/runtime-visualizer.d.ts +3 -45
  75. package/src/lib/runtime-visualizer.js +77 -79
  76. package/src/lib/runtime-visualizer.js.map +1 -1
  77. package/src/lib/runtime-viz-theme.js +4 -3
  78. package/src/lib/runtime-viz-theme.js.map +1 -1
  79. package/src/lib/runtime-wiring/DeclarationCompileAssertions.d.ts +4 -0
  80. package/src/lib/runtime-wiring/DeclarationCompileAssertions.js +27 -0
  81. package/src/lib/runtime-wiring/DeclarationCompileAssertions.js.map +1 -0
  82. package/src/lib/runtime-wiring/approved-graph.d.ts +8 -0
  83. package/src/lib/runtime-wiring/approved-graph.js +115 -0
  84. package/src/lib/runtime-wiring/approved-graph.js.map +1 -0
  85. package/src/lib/runtime-wiring/assembler.d.ts +24 -0
  86. package/src/lib/runtime-wiring/assembler.js +116 -0
  87. package/src/lib/runtime-wiring/assembler.js.map +1 -0
  88. package/src/lib/runtime-wiring/codec.d.ts +14 -0
  89. package/src/lib/runtime-wiring/codec.js +162 -0
  90. package/src/lib/runtime-wiring/codec.js.map +1 -0
  91. package/src/lib/runtime-wiring/declaration.d.ts +68 -0
  92. package/src/lib/runtime-wiring/declaration.js +88 -0
  93. package/src/lib/runtime-wiring/declaration.js.map +1 -0
  94. package/src/lib/runtime-wiring/source-extractor.d.ts +28 -0
  95. package/src/lib/runtime-wiring/source-extractor.js +253 -0
  96. package/src/lib/runtime-wiring/source-extractor.js.map +1 -0
  97. package/src/lib/runtime-wiring/source-values.d.ts +21 -0
  98. package/src/lib/runtime-wiring/source-values.js +204 -0
  99. package/src/lib/runtime-wiring/source-values.js.map +1 -0
  100. package/src/lib/runtime-wiring/verification.d.ts +9 -0
  101. package/src/lib/runtime-wiring/verification.js +56 -0
  102. package/src/lib/runtime-wiring/verification.js.map +1 -0
  103. package/src/plugin.d.ts +0 -21
  104. package/src/plugin.js +12 -7
  105. package/src/plugin.js.map +1 -1
  106. package/src/runtime-wiring-targets.d.ts +7 -0
  107. package/src/runtime-wiring-targets.js +58 -0
  108. package/src/runtime-wiring-targets.js.map +1 -0
  109. package/src/validation-targets.js +10 -2
  110. package/src/validation-targets.js.map +1 -1
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RuntimeWiringTargets = void 0;
4
+ const rules_config_1 = require("@webpieces/rules-config");
5
+ /** Opt-in ownership tags are the migration boundary; no broad source enforcement activates silently. */
6
+ class RuntimeWiringTargets {
7
+ infer(project) {
8
+ if (!project.tags.includes('webpieces') && !project.tags.includes('webpieces-lib'))
9
+ return {};
10
+ const options = project.targets['build']?.options;
11
+ const outputPath = options !== undefined && 'outputPath' in options ? options.outputPath : undefined;
12
+ if (typeof outputPath !== 'string' || outputPath.length === 0)
13
+ throw new rules_config_1.RuleFailError('validate-runtime-architecture', `${project.name} must declare build.options.outputPath for runtime wiring candidates.`, undefined, undefined, [
14
+ new rules_config_1.Option('Declare the existing project build output directory explicitly; runtime wiring never writes candidates beside approvals.', true),
15
+ ]);
16
+ return {
17
+ build: {
18
+ ...project.targets['build'],
19
+ dependsOn: [...this.buildDependencies(project), 'runtime-wiring-check'],
20
+ },
21
+ 'runtime-wiring-check': {
22
+ executor: '@webpieces/nx-webpieces-rules:runtime-wiring-check',
23
+ cache: true,
24
+ inputs: [
25
+ 'default',
26
+ '{projectRoot}/runtime-deps.json',
27
+ '{workspaceRoot}/packages/tooling/nx-webpieces-rules/src/**/*.ts',
28
+ '^default',
29
+ '{workspaceRoot}/webpieces.config.json',
30
+ '{workspaceRoot}/tsconfig.base.json',
31
+ '{workspaceRoot}/nx.json',
32
+ { externalDependencies: ['@webpieces/nx-webpieces-rules'] },
33
+ ],
34
+ outputs: [`{workspaceRoot}/${outputPath}/runtime-deps.candidate.json`],
35
+ options: { outputPath },
36
+ },
37
+ };
38
+ }
39
+ buildDependencies(project) {
40
+ return (project.targets['build']?.dependsOn ?? []).map((dependency) => {
41
+ if (typeof dependency === 'string')
42
+ return dependency;
43
+ if (dependency.target === undefined)
44
+ throw new rules_config_1.RuleFailError('validate-runtime-architecture', `${project.name}: build dependency requires a target.`, undefined, undefined, [new rules_config_1.Option('Declare a target on each build dependsOn entry.', true)]);
45
+ return {
46
+ ...dependency,
47
+ target: dependency.target,
48
+ projects: typeof dependency.projects === 'string'
49
+ ? dependency.projects
50
+ : dependency.projects === undefined
51
+ ? undefined
52
+ : [...dependency.projects],
53
+ };
54
+ });
55
+ }
56
+ }
57
+ exports.RuntimeWiringTargets = RuntimeWiringTargets;
58
+ //# sourceMappingURL=runtime-wiring-targets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-wiring-targets.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/runtime-wiring-targets.ts"],"names":[],"mappings":";;;AACA,0DAAgE;AAGhE,wGAAwG;AACxG,MAAa,oBAAoB;IAC7B,KAAK,CAAC,OAAuB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;YAC9E,OAAO,EAAE,CAAC;QACd,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClD,MAAM,UAAU,GACZ,OAAO,KAAK,SAAS,IAAI,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QACtF,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YACzD,MAAM,IAAI,4BAAa,CACnB,+BAA+B,EAC/B,GAAG,OAAO,CAAC,IAAI,uEAAuE,EACtF,SAAS,EACT,SAAS,EACT;gBACI,IAAI,qBAAM,CACN,0HAA0H,EAC1H,IAAI,CACP;aACJ,CACJ,CAAC;QACN,OAAO;YACH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CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC;aACvC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApED,oDAoEC","sourcesContent":["import type { TargetConfiguration } from '@nx/devkit';\nimport { Option, RuleFailError } from '@webpieces/rules-config';\nimport type { RawProjectJson } from './generate-targets';\n\n/** Opt-in ownership tags are the migration boundary; no broad source enforcement activates silently. */\nexport class RuntimeWiringTargets {\n infer(project: RawProjectJson): Record<string, TargetConfiguration> {\n if (!project.tags.includes('webpieces') && !project.tags.includes('webpieces-lib'))\n return {};\n const options = project.targets['build']?.options;\n const outputPath =\n options !== undefined && 'outputPath' in options ? options.outputPath : undefined;\n if (typeof outputPath !== 'string' || outputPath.length === 0)\n throw new RuleFailError(\n 'validate-runtime-architecture',\n `${project.name} must declare build.options.outputPath for runtime wiring candidates.`,\n undefined,\n undefined,\n [\n new Option(\n 'Declare the existing project build output directory explicitly; runtime wiring never writes candidates beside approvals.',\n true,\n ),\n ],\n );\n return {\n build: {\n ...project.targets['build'],\n dependsOn: [...this.buildDependencies(project), 'runtime-wiring-check'],\n },\n 'runtime-wiring-check': {\n executor: '@webpieces/nx-webpieces-rules:runtime-wiring-check',\n cache: true,\n inputs: [\n 'default',\n '{projectRoot}/runtime-deps.json',\n '{workspaceRoot}/packages/tooling/nx-webpieces-rules/src/**/*.ts',\n '^default',\n '{workspaceRoot}/webpieces.config.json',\n '{workspaceRoot}/tsconfig.base.json',\n '{workspaceRoot}/nx.json',\n { externalDependencies: ['@webpieces/nx-webpieces-rules'] },\n ],\n outputs: [`{workspaceRoot}/${outputPath}/runtime-deps.candidate.json`],\n options: { outputPath },\n },\n };\n }\n private buildDependencies(\n project: RawProjectJson,\n ): NonNullable<TargetConfiguration['dependsOn']> {\n return (project.targets['build']?.dependsOn ?? []).map((dependency) => {\n if (typeof dependency === 'string') return dependency;\n if (dependency.target === undefined)\n throw new RuleFailError(\n 'validate-runtime-architecture',\n `${project.name}: build dependency requires a target.`,\n undefined,\n undefined,\n [new Option('Declare a target on each build dependsOn entry.', true)],\n );\n return {\n ...dependency,\n target: dependency.target,\n projects:\n typeof dependency.projects === 'string'\n ? dependency.projects\n : dependency.projects === undefined\n ? undefined\n : [...dependency.projects],\n };\n });\n }\n}\n"]}
@@ -133,8 +133,16 @@ class ValidationTargets {
133
133
  apiLibTag() {
134
134
  return {
135
135
  executor: '@webpieces/nx-webpieces-rules:validate-api-lib-tag',
136
- cache: false,
137
- inputs: ['default', '{workspaceRoot}/**/project.json'],
136
+ cache: true,
137
+ inputs: [
138
+ '{workspaceRoot}/**/*.ts',
139
+ '{workspaceRoot}/**/project.json',
140
+ '{workspaceRoot}/**/tsconfig*.json',
141
+ '{workspaceRoot}/webpieces.config.json',
142
+ '{workspaceRoot}/architecture/**/*.json',
143
+ ...branch_identity_inputs_1.BRANCH_IDENTITY_INPUTS,
144
+ { externalDependencies: ['@webpieces/nx-webpieces-rules'] },
145
+ ],
138
146
  metadata: {
139
147
  technologies: ['nx'],
140
148
  description: 'Validate role:api-lib matches the code (exports an API contract)',
@@ -1 +1 @@
1
- {"version":3,"file":"validation-targets.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/validation-targets.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAIH,qEAAkE;AAElE,MAAa,iBAAiB;IAC1B,QAAQ;QACJ,OAAO;YACH,QAAQ,EAAE,+DAA+D;YACzE,KAAK,EAAE,IAAI;YACX,MAAM,EAAE;gBACJ,iCAAiC;gBACjC,gDAAgD;gBAChD,GAAG,+CAAsB;aAC5B;YACD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EAAE,gEAAgE;aAChF;SACJ,CAAC;IACN,CAAC;IAED,WAAW;QACP,OAAO;YACH,QAAQ,EAAE,oDAAoD;YAC9D,KAAK,EAAE,IAAI;YACX,MAAM,EAAE;gBACJ,iCAAiC;gBACjC,iCAAiC;gBACjC,GAAG,+CAAsB;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ACJ,OAAO;YACH,QAAQ,EAAE,kDAAkD;YAC5D,KAAK,EAAE,KAAK,EAAE,+DAA+D;YAC7E,MAAM,EAAE,CAAC,yBAAyB,CAAC;YACnC,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EACP,kFAAkF;aACzF;SACJ,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,YAAY;QACR,OAAO;YACH,QAAQ,EAAE,sDAAsD;YAChE,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,SAAS,EAAE,iCAAiC,CAAC;YACtD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EACP,wEAAwE;aAC/E;SACJ,CAAC;IACN,CAAC;IAED,sGAAsG;IACtG,SAAS;QACL,OAAO;YACH,QAAQ,EAAE,oDAAoD;YAC9D,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,SAAS,EAAE,iCAAiC,CAAC;YACtD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EAAE,kEAAkE;aAClF;SACJ,CAAC;IACN,CAAC;CACJ;AA/ID,8CA+IC","sourcesContent":["/**\n * Workspace validation target factories\n *\n * The no-argument `architecture:*` validation target configurations, extracted\n * from plugin.ts (which is at its file-size limit). Each instance method returns\n * the nx TargetConfiguration that runs one @webpieces/nx-webpieces-rules validator.\n * Instantiate once and inject the instance where the targets are assembled (no\n * static methods — a static method can't be injected).\n */\n\nimport { TargetConfiguration } from '@nx/devkit';\n\nimport { BRANCH_IDENTITY_INPUTS } from './branch-identity-inputs';\n\nexport class ValidationTargets {\n noCycles(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-no-architecture-cycles',\n cache: true,\n inputs: [\n '{workspaceRoot}/**/project.json',\n '{workspaceRoot}/architecture/dependencies.json',\n ...BRANCH_IDENTITY_INPUTS,\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Validate the architecture has no circular project dependencies',\n },\n };\n }\n\n packageJson(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-packagejson',\n cache: true,\n inputs: [\n '{workspaceRoot}/**/project.json',\n '{workspaceRoot}/**/package.json',\n ...BRANCH_IDENTITY_INPUTS,\n ],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate package.json dependencies match project.json build dependencies',\n },\n };\n }\n\n // Validate the pr-gate checklists[] array in isolation (docs exist, reviewer agents exist, subagents\n // blockMessage on BLOCK) so a bad checklist config fails as ITS OWN check rather than as an\n // unrelated validator's banner. Depends only on webpieces.config.json + the docs it references.\n checklistDocs(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-checklist-docs',\n cache: false, // depends on files on disk (docs paths) that project.json inputs can't express\n inputs: ['{workspaceRoot}/webpieces.config.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate the pr-gate checklists[] block (docs exist, patterns compile, ids unique)',\n },\n };\n }\n\n /**\n * Combined validate-code target. Options come from webpieces.config.json at the\n * workspace root (loaded by the executor via @webpieces/rules-config — the same\n * source of truth as @webpieces/ai-hook-rules).\n */\n code(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-code',\n cache: false, // Don't cache - depends on git state\n inputs: [\n 'default',\n '{workspaceRoot}/webpieces.config.json',\n { runtime: 'node -e \"process.stdout.write(String(Math.random()))\"' },\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Execute the client-declared build policy contributions',\n },\n };\n }\n\n versionsLocked(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-versions-locked',\n cache: true,\n inputs: ['{workspaceRoot}/**/package.json', ...BRANCH_IDENTITY_INPUTS],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate package.json versions are locked (no semver ranges) and consistent across projects',\n },\n };\n }\n\n tsInSrc(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-ts-in-src',\n cache: false,\n inputs: [\n 'default',\n '{workspaceRoot}/webpieces.config.json',\n { runtime: 'node -e \"process.stdout.write(String(Math.random()))\"' },\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Validate all .ts files in projects are inside the src/ directory',\n },\n };\n }\n\n nxWiring(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-nx-wiring',\n cache: false, // Cheap; depends on nx.json + project graph, not worth caching\n inputs: ['{workspaceRoot}/nx.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate the webpieces validators are wired into the build via nx.json dependsOn',\n },\n };\n }\n\n /**\n * Validate every server/client api-lib dependency is implemented or used. Scans\n * source (addRoutes = implements, createRpcClient/createPubSubClient = uses), so\n * it depends on all source + project.json, not just the committed graph.\n */\n apiRelations(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-api-relations',\n cache: false,\n inputs: ['default', '{workspaceRoot}/**/project.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate every server/client api-lib dependency is implemented or used',\n },\n };\n }\n\n /** Validate role:api-lib ⇔ the project exports an @ApiPath/@Rpc/@PubSub contract, both directions. */\n apiLibTag(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-api-lib-tag',\n cache: false,\n inputs: ['default', '{workspaceRoot}/**/project.json'],\n metadata: {\n technologies: ['nx'],\n description: 'Validate role:api-lib matches the code (exports an API contract)',\n },\n };\n }\n}\n"]}
1
+ {"version":3,"file":"validation-targets.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/validation-targets.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAIH,qEAAkE;AAElE,MAAa,iBAAiB;IAC1B,QAAQ;QACJ,OAAO;YACH,QAAQ,EAAE,+DAA+D;YACzE,KAAK,EAAE,IAAI;YACX,MAAM,EAAE;gBACJ,iCAAiC;gBACjC,gDAAgD;gBAChD,GAAG,+CAAsB;aAC5B;YACD,QAAQ,EAAE;gBACN,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K,EAAE,KAAK;YACZ,MAAM,EAAE;gBACJ,SAAS;gBACT,uCAAuC;gBACvC,EAAE,OAAO,EAAE,uDAAuD,EAAE;aACvE;YACD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EAAE,kEAAkE;aAClF;SACJ,CAAC;IACN,CAAC;IAED,QAAQ;QACJ,OAAO;YACH,QAAQ,EAAE,kDAAkD;YAC5D,KAAK,EAAE,KAAK,EAAE,+DAA+D;YAC7E,MAAM,EAAE,CAAC,yBAAyB,CAAC;YACnC,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EACP,kFAAkF;aACzF;SACJ,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,YAAY;QACR,OAAO;YACH,QAAQ,EAAE,sDAAsD;YAChE,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,SAAS,EAAE,iCAAiC,CAAC;YACtD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EACP,wEAAwE;aAC/E;SACJ,CAAC;IACN,CAAC;IAED,sGAAsG;IACtG,SAAS;QACL,OAAO;YACH,QAAQ,EAAE,oDAAoD;YAC9D,KAAK,EAAE,IAAI;YACX,MAAM,EAAE;gBACJ,yBAAyB;gBACzB,iCAAiC;gBACjC,mCAAmC;gBACnC,uCAAuC;gBACvC,wCAAwC;gBACxC,GAAG,+CAAsB;gBACzB,EAAE,oBAAoB,EAAE,CAAC,+BAA+B,CAAC,EAAE;aAC9D;YACD,QAAQ,EAAE;gBACN,YAAY,EAAE,CAAC,IAAI,CAAC;gBACpB,WAAW,EAAE,kEAAkE;aAClF;SACJ,CAAC;IACN,CAAC;CACJ;AAvJD,8CAuJC","sourcesContent":["/**\n * Workspace validation target factories\n *\n * The no-argument `architecture:*` validation target configurations, extracted\n * from plugin.ts (which is at its file-size limit). Each instance method returns\n * the nx TargetConfiguration that runs one @webpieces/nx-webpieces-rules validator.\n * Instantiate once and inject the instance where the targets are assembled (no\n * static methods — a static method can't be injected).\n */\n\nimport { TargetConfiguration } from '@nx/devkit';\n\nimport { BRANCH_IDENTITY_INPUTS } from './branch-identity-inputs';\n\nexport class ValidationTargets {\n noCycles(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-no-architecture-cycles',\n cache: true,\n inputs: [\n '{workspaceRoot}/**/project.json',\n '{workspaceRoot}/architecture/dependencies.json',\n ...BRANCH_IDENTITY_INPUTS,\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Validate the architecture has no circular project dependencies',\n },\n };\n }\n\n packageJson(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-packagejson',\n cache: true,\n inputs: [\n '{workspaceRoot}/**/project.json',\n '{workspaceRoot}/**/package.json',\n ...BRANCH_IDENTITY_INPUTS,\n ],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate package.json dependencies match project.json build dependencies',\n },\n };\n }\n\n // Validate the pr-gate checklists[] array in isolation (docs exist, reviewer agents exist, subagents\n // blockMessage on BLOCK) so a bad checklist config fails as ITS OWN check rather than as an\n // unrelated validator's banner. Depends only on webpieces.config.json + the docs it references.\n checklistDocs(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-checklist-docs',\n cache: false, // depends on files on disk (docs paths) that project.json inputs can't express\n inputs: ['{workspaceRoot}/webpieces.config.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate the pr-gate checklists[] block (docs exist, patterns compile, ids unique)',\n },\n };\n }\n\n /**\n * Combined validate-code target. Options come from webpieces.config.json at the\n * workspace root (loaded by the executor via @webpieces/rules-config — the same\n * source of truth as @webpieces/ai-hook-rules).\n */\n code(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-code',\n cache: false, // Don't cache - depends on git state\n inputs: [\n 'default',\n '{workspaceRoot}/webpieces.config.json',\n { runtime: 'node -e \"process.stdout.write(String(Math.random()))\"' },\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Execute the client-declared build policy contributions',\n },\n };\n }\n\n versionsLocked(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-versions-locked',\n cache: true,\n inputs: ['{workspaceRoot}/**/package.json', ...BRANCH_IDENTITY_INPUTS],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate package.json versions are locked (no semver ranges) and consistent across projects',\n },\n };\n }\n\n tsInSrc(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-ts-in-src',\n cache: false,\n inputs: [\n 'default',\n '{workspaceRoot}/webpieces.config.json',\n { runtime: 'node -e \"process.stdout.write(String(Math.random()))\"' },\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Validate all .ts files in projects are inside the src/ directory',\n },\n };\n }\n\n nxWiring(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-nx-wiring',\n cache: false, // Cheap; depends on nx.json + project graph, not worth caching\n inputs: ['{workspaceRoot}/nx.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate the webpieces validators are wired into the build via nx.json dependsOn',\n },\n };\n }\n\n /**\n * Validate every server/client api-lib dependency is implemented or used. Scans\n * source (addRoutes = implements, createRpcClient/createPubSubClient = uses), so\n * it depends on all source + project.json, not just the committed graph.\n */\n apiRelations(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-api-relations',\n cache: false,\n inputs: ['default', '{workspaceRoot}/**/project.json'],\n metadata: {\n technologies: ['nx'],\n description:\n 'Validate every server/client api-lib dependency is implemented or used',\n },\n };\n }\n\n /** Validate role:api-lib ⇔ the project exports an @ApiPath/@Rpc/@PubSub contract, both directions. */\n apiLibTag(): TargetConfiguration {\n return {\n executor: '@webpieces/nx-webpieces-rules:validate-api-lib-tag',\n cache: true,\n inputs: [\n '{workspaceRoot}/**/*.ts',\n '{workspaceRoot}/**/project.json',\n '{workspaceRoot}/**/tsconfig*.json',\n '{workspaceRoot}/webpieces.config.json',\n '{workspaceRoot}/architecture/**/*.json',\n ...BRANCH_IDENTITY_INPUTS,\n { externalDependencies: ['@webpieces/nx-webpieces-rules'] },\n ],\n metadata: {\n technologies: ['nx'],\n description: 'Validate role:api-lib matches the code (exports an API contract)',\n },\n };\n }\n}\n"]}