@webpieces/nx-webpieces-rules 0.4.917 → 0.4.919
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/nx-webpieces-rules",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.919",
|
|
4
4
|
"description": "Nx-specific webpieces validation rules, graph tooling, executors, and inference plugin.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@webpieces/api-doc-model": "0.4.
|
|
24
|
-
"@webpieces/core-util": "0.4.
|
|
25
|
-
"@webpieces/eslint-rules": "0.4.
|
|
26
|
-
"@webpieces/rules-config": "0.4.
|
|
23
|
+
"@webpieces/api-doc-model": "0.4.919",
|
|
24
|
+
"@webpieces/core-util": "0.4.919",
|
|
25
|
+
"@webpieces/eslint-rules": "0.4.919",
|
|
26
|
+
"@webpieces/rules-config": "0.4.919",
|
|
27
27
|
"madge": "8.0.0",
|
|
28
|
-
"@webpieces/rules-sdk": "0.4.
|
|
28
|
+
"@webpieces/rules-sdk": "0.4.919"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@nx/devkit": ">=18.0.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@webpieces/tooling-testkit": "0.4.
|
|
44
|
+
"@webpieces/tooling-testkit": "0.4.919"
|
|
45
45
|
},
|
|
46
46
|
"types": "./src/index.d.ts",
|
|
47
47
|
"bin": {
|
|
@@ -21,16 +21,21 @@ class RuntimeWiringTargets {
|
|
|
21
21
|
'runtime-wiring-check': {
|
|
22
22
|
executor: '@webpieces/nx-webpieces-rules:runtime-wiring-check',
|
|
23
23
|
cache: true,
|
|
24
|
+
// PER-PROJECT inputs only (#1263). nx turns every `{workspaceRoot}/...` input of a
|
|
25
|
+
// target into an implicit dependency of the project that carries it
|
|
26
|
+
// (getImplicitlyTouchedProjects), so a workspace-wide glob here made ONE service's
|
|
27
|
+
// wiring.ts change mark EVERY webpieces-tagged project affected. The check reads only
|
|
28
|
+
// this project's src/wiring.ts, its runtime-deps.json, its project.json and the files
|
|
29
|
+
// its own TS program imports (its graph dependencies -> ^default). The cross-service
|
|
30
|
+
// half (assembling every runtime-deps.json, callers vs callees) already runs ONCE,
|
|
31
|
+
// uncached, in architecture:validate-architecture-unchanged (ApprovedWiringGraph).
|
|
32
|
+
// tsconfig.base.json is hashed into every task by nx itself (path mappings selectively)
|
|
33
|
+
// and handled by its own affected locator, so naming it here only widened `affected`.
|
|
24
34
|
inputs: [
|
|
25
35
|
'default',
|
|
36
|
+
'{projectRoot}/src/wiring.ts',
|
|
26
37
|
'{projectRoot}/runtime-deps.json',
|
|
27
|
-
'{workspaceRoot}/packages/tooling/nx-webpieces-rules/src/**/*.ts',
|
|
28
38
|
'^default',
|
|
29
|
-
'{workspaceRoot}/**/src/wiring.ts',
|
|
30
|
-
'{workspaceRoot}/**/runtime-deps.json',
|
|
31
|
-
'{workspaceRoot}/webpieces.config.json',
|
|
32
|
-
'{workspaceRoot}/tsconfig.base.json',
|
|
33
|
-
'{workspaceRoot}/nx.json',
|
|
34
39
|
{ externalDependencies: ['@webpieces/nx-webpieces-rules'] },
|
|
35
40
|
],
|
|
36
41
|
outputs: [`{workspaceRoot}/${outputPath}/runtime-deps.candidate.json`],
|
|
@@ -1 +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,KAAK,EAAE;gBACH,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC3B,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;aAC1E;YACD,sBAAsB,EAAE;gBACpB,QAAQ,EAAE,oDAAoD;gBAC9D,KAAK,EAAE,IAAI;gBACX,
|
|
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;QAC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AAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAClE,IAAI,OAAO,UAAU,KAAK,QAAQ;gBAAE,OAAO,UAAU,CAAC;YACtD,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS;gBAC/B,MAAM,IAAI,4BAAa,CACnB,+BAA+B,EAC/B,GAAG,OAAO,CAAC,IAAI,uCAAuC,EACtD,SAAS,EACT,SAAS,EACT,CAAC,IAAI,qBAAM,CAAC,iDAAiD,EAAE,IAAI,CAAC,CAAC,CACxE,CAAC;YACN,OAAO;gBACH,GAAG,UAAU;gBACb,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,QAAQ,EACJ,OAAO,UAAU,CAAC,QAAQ,KAAK,QAAQ;oBACnC,CAAC,CAAC,UAAU,CAAC,QAAQ;oBACrB,CAAC,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS;wBACjC,CAAC,CAAC,SAAS;wBACX,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC;aACvC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA3ED,oDA2EC","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 // PER-PROJECT inputs only (#1263). nx turns every `{workspaceRoot}/...` input of a\n // target into an implicit dependency of the project that carries it\n // (getImplicitlyTouchedProjects), so a workspace-wide glob here made ONE service's\n // wiring.ts change mark EVERY webpieces-tagged project affected. The check reads only\n // this project's src/wiring.ts, its runtime-deps.json, its project.json and the files\n // its own TS program imports (its graph dependencies -> ^default). The cross-service\n // half (assembling every runtime-deps.json, callers vs callees) already runs ONCE,\n // uncached, in architecture:validate-architecture-unchanged (ApprovedWiringGraph).\n // tsconfig.base.json is hashed into every task by nx itself (path mappings selectively)\n // and handled by its own affected locator, so naming it here only widened `affected`.\n inputs: [\n 'default',\n '{projectRoot}/src/wiring.ts',\n '{projectRoot}/runtime-deps.json',\n '^default',\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"]}
|