@webpieces/nx-webpieces-rules 0.4.843 → 0.4.845

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 (63) hide show
  1. package/package.json +13 -8
  2. package/src/configs/api-doc-rules-config.d.ts +59 -0
  3. package/src/configs/api-doc-rules-config.js +70 -0
  4. package/src/configs/api-doc-rules-config.js.map +1 -0
  5. package/src/configs/no-root-union-config.d.ts +25 -0
  6. package/src/configs/no-root-union-config.js +33 -0
  7. package/src/configs/no-root-union-config.js.map +1 -0
  8. package/src/configs/rule-configs.d.ts +67 -0
  9. package/src/configs/rule-configs.js +147 -0
  10. package/src/configs/rule-configs.js.map +1 -0
  11. package/src/configs/tag-truth-configs.d.ts +72 -0
  12. package/src/configs/tag-truth-configs.js +98 -0
  13. package/src/configs/tag-truth-configs.js.map +1 -0
  14. package/src/executors/validate-catch-error-pattern/executor.d.ts +1 -1
  15. package/src/executors/validate-catch-error-pattern/executor.js.map +1 -1
  16. package/src/executors/validate-dtos/executor.d.ts +1 -1
  17. package/src/executors/validate-dtos/executor.js.map +1 -1
  18. package/src/executors/validate-modified-files/executor.d.ts +1 -1
  19. package/src/executors/validate-modified-files/executor.js.map +1 -1
  20. package/src/executors/validate-modified-methods/executor.d.ts +1 -1
  21. package/src/executors/validate-modified-methods/executor.js.map +1 -1
  22. package/src/executors/validate-new-methods/executor.d.ts +1 -1
  23. package/src/executors/validate-new-methods/executor.js.map +1 -1
  24. package/src/executors/validate-no-any-unknown/executor.d.ts +1 -1
  25. package/src/executors/validate-no-any-unknown/executor.js.map +1 -1
  26. package/src/executors/validate-no-destructure/executor.d.ts +1 -1
  27. package/src/executors/validate-no-destructure/executor.js.map +1 -1
  28. package/src/executors/validate-no-direct-api-resolver/executor.d.ts +1 -1
  29. package/src/executors/validate-no-direct-api-resolver/executor.js.map +1 -1
  30. package/src/executors/validate-no-implicit-any/executor.d.ts +1 -1
  31. package/src/executors/validate-no-implicit-any/executor.js.map +1 -1
  32. package/src/executors/validate-no-inline-types/executor.d.ts +1 -1
  33. package/src/executors/validate-no-inline-types/executor.js.map +1 -1
  34. package/src/executors/validate-no-unmanaged-exceptions/executor.d.ts +1 -1
  35. package/src/executors/validate-no-unmanaged-exceptions/executor.js.map +1 -1
  36. package/src/executors/validate-prisma-converters/executor.d.ts +1 -1
  37. package/src/executors/validate-prisma-converters/executor.js.map +1 -1
  38. package/src/executors/validate-return-types/executor.d.ts +1 -1
  39. package/src/executors/validate-return-types/executor.js.map +1 -1
  40. package/src/index.d.ts +6 -0
  41. package/src/index.js +25 -1
  42. package/src/index.js.map +1 -1
  43. package/src/lib/api-usage/api-doc-rules.d.ts +2 -2
  44. package/src/lib/api-usage/api-doc-rules.js +2 -2
  45. package/src/lib/api-usage/api-doc-rules.js.map +1 -1
  46. package/src/lib/api-usage/root-union-scan.d.ts +1 -1
  47. package/src/lib/api-usage/root-union-scan.js +1 -1
  48. package/src/lib/api-usage/root-union-scan.js.map +1 -1
  49. package/src/lib/api-usage/wire-closure.d.ts +1 -1
  50. package/src/lib/api-usage/wire-closure.js +2 -2
  51. package/src/lib/api-usage/wire-closure.js.map +1 -1
  52. package/src/lib/tag-truth.d.ts +1 -1
  53. package/src/lib/tag-truth.js +11 -11
  54. package/src/lib/tag-truth.js.map +1 -1
  55. package/src/rule-migrations.d.ts +3 -0
  56. package/src/rule-migrations.js +11 -0
  57. package/src/rule-migrations.js.map +1 -0
  58. package/src/rule-pack.d.ts +2 -0
  59. package/src/rule-pack.js +35 -0
  60. package/src/rule-pack.js.map +1 -0
  61. package/src/rule-settings.d.ts +5 -0
  62. package/src/rule-settings.js +210 -0
  63. package/src/rule-settings.js.map +1 -0
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FrameworkFolderConfig = exports.FrameworkFolderEntry = exports.ApiLibPathConfig = exports.ApiLibDependenciesConfig = exports.ApiClientPackagesEntry = void 0;
4
+ const rules_sdk_1 = require("@webpieces/rules-sdk");
5
+ const rule_configs_1 = require("./rule-configs");
6
+ /** One `role:api-client` project and the outside packages it may import (its SDK, inversify, …). Data-only. */
7
+ class ApiClientPackagesEntry {
8
+ /** The nx project name of the `role:api-client` library, e.g. `gmail-client`. */
9
+ project;
10
+ /** Package names (globs allowed, e.g. `@google-cloud/*`) it may import beyond `apiLibPackages`. */
11
+ packages;
12
+ static SCHEMA = {
13
+ project: new rules_sdk_1.FieldDef('string'),
14
+ packages: new rules_sdk_1.FieldDef('string[]'),
15
+ };
16
+ }
17
+ exports.ApiClientPackagesEntry = ApiClientPackagesEntry;
18
+ /**
19
+ * `api-lib-dependencies` (D2) — a `role:api-lib` may depend only on other `role:api-lib` projects plus
20
+ * the outside packages in `apiLibPackages`; a `role:api-client` may ALSO import the packages its own
21
+ * `apiClients` entry names (its SDK, `inversify`, `@webpieces/core-context`, …).
22
+ *
23
+ * - `mode` — OFF | RUN_EVERY_TIME (a graph rule: it reads every project, every run).
24
+ * - `apiLibPackages` — required; may be empty (an api library then imports nothing from outside), e.g.
25
+ * `["@webpieces/core-util", "tslib"]`. A workspace project whose name or package name is listed here
26
+ * is allowed too, so a repo whose `core-util` is a workspace project states it the same way.
27
+ * - `apiClients` — required; one entry per `role:api-client` project. A `role:api-client` with no
28
+ * entry is itself a violation: what it may talk to is stated, never inferred.
29
+ */
30
+ class ApiLibDependenciesConfig extends rules_sdk_1.BaseRuleConfig {
31
+ apiLibPackages;
32
+ apiClients;
33
+ static SCHEMA = {
34
+ mode: new rules_sdk_1.FieldDef('string', rule_configs_1.STRUCTURAL_MODES),
35
+ apiLibPackages: new rules_sdk_1.FieldDef('string[]'),
36
+ apiClients: rules_sdk_1.FieldDef.objects(ApiClientPackagesEntry.SCHEMA),
37
+ ...rules_sdk_1.BASE_RULE_SCHEMA,
38
+ };
39
+ }
40
+ exports.ApiLibDependenciesConfig = ApiLibDependenciesConfig;
41
+ /**
42
+ * `api-lib-path` (D10) — both directions: every `role:api-lib` / `role:api-client` project lives under
43
+ * one of `paths`, and every project under `paths` carries one of those two roles.
44
+ *
45
+ * - `mode` — OFF | RUN_EVERY_TIME.
46
+ * - `paths` — required, non-empty globs over project ROOTS, e.g. `["libraries/apis/**"]`.
47
+ */
48
+ class ApiLibPathConfig extends rules_sdk_1.BaseRuleConfig {
49
+ paths;
50
+ static SCHEMA = {
51
+ mode: new rules_sdk_1.FieldDef('string', rule_configs_1.STRUCTURAL_MODES),
52
+ paths: rules_sdk_1.FieldDef.nonEmptyStrings(),
53
+ ...rules_sdk_1.BASE_RULE_SCHEMA,
54
+ };
55
+ }
56
+ exports.ApiLibPathConfig = ApiLibPathConfig;
57
+ /**
58
+ * One folder of the runtime layout: the project roots it covers, the framework SETS a project there may
59
+ * carry, and the roles it may have. Data-only.
60
+ *
61
+ * A framework set is written as its tags joined by `+`, in any order: `"browser+node+react-native"`.
62
+ * Listing two sets means EITHER — `["node", "express"]` is a node library or an express one.
63
+ */
64
+ class FrameworkFolderEntry {
65
+ /** Globs over project ROOTS, e.g. `["libraries/universal/**"]`. Non-empty. */
66
+ paths;
67
+ /** The accepted framework sets, each `+`-joined, e.g. `["browser+node+react-native"]`. Non-empty. */
68
+ frameworkSets;
69
+ /** The accepted roles, e.g. `["lib", "designed-lib"]`. Non-empty. */
70
+ roles;
71
+ static SCHEMA = {
72
+ paths: rules_sdk_1.FieldDef.nonEmptyStrings(),
73
+ frameworkSets: rules_sdk_1.FieldDef.nonEmptyStrings(),
74
+ roles: rules_sdk_1.FieldDef.nonEmptyStrings(),
75
+ };
76
+ }
77
+ exports.FrameworkFolderEntry = FrameworkFolderEntry;
78
+ /**
79
+ * `framework-folder` (D9) — the folder a library lives in and the tags it carries say the same thing,
80
+ * both directions:
81
+ * - a project under an entry's `paths` (the FIRST entry whose glob matches, in `entries` order) must
82
+ * carry one of that entry's `frameworkSets`, exactly, and one of its `roles`;
83
+ * - a LIBRARY (any role but server/app/client/bundle) carrying a framework set and role that some entry
84
+ * lists must live under one of the entries that list them.
85
+ *
86
+ * - `mode` — OFF | RUN_EVERY_TIME.
87
+ * - `entries` — required, non-empty. The recommended layout is in `.claude/rules/framework-tags.md`.
88
+ */
89
+ class FrameworkFolderConfig extends rules_sdk_1.BaseRuleConfig {
90
+ entries;
91
+ static SCHEMA = {
92
+ mode: new rules_sdk_1.FieldDef('string', rule_configs_1.STRUCTURAL_MODES),
93
+ entries: rules_sdk_1.FieldDef.nonEmptyObjects(FrameworkFolderEntry.SCHEMA),
94
+ ...rules_sdk_1.BASE_RULE_SCHEMA,
95
+ };
96
+ }
97
+ exports.FrameworkFolderConfig = FrameworkFolderConfig;
98
+ //# sourceMappingURL=tag-truth-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-truth-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/configs/tag-truth-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA+F;AAC/F,iDAAkE;AAClE,+GAA+G;AAC/G,MAAa,sBAAsB;IAC/B,iFAAiF;IACjF,OAAO,CAAU;IACjB,mGAAmG;IACnG,QAAQ,CAAY;IAEpB,MAAM,CAAU,MAAM,GAAwC;QAC1D,OAAO,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QAC/B,QAAQ,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACrC,CAAC;;AATN,wDAUC;AAED;;;;;;;;;;;GAWG;AACH,MAAa,wBAAyB,SAAQ,0BAAc;IAExD,cAAc,CAAY;IAC1B,UAAU,CAA4B;IAEtC,MAAM,CAAU,MAAM,GAA0C;QAC5D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAgB,CAAC;QAC9C,cAAc,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QACxC,UAAU,EAAE,oBAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC;QAC3D,GAAG,4BAAgB;KACtB,CAAC;;AAVN,4DAWC;AAED;;;;;;GAMG;AACH,MAAa,gBAAiB,SAAQ,0BAAc;IAEhD,KAAK,CAAY;IAEjB,MAAM,CAAU,MAAM,GAAkC;QACpD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAgB,CAAC;QAC9C,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACjC,GAAG,4BAAgB;KACtB,CAAC;;AARN,4CASC;AAED;;;;;;GAMG;AACH,MAAa,oBAAoB;IAC7B,8EAA8E;IAC9E,KAAK,CAAY;IACjB,qGAAqG;IACrG,aAAa,CAAY;IACzB,qEAAqE;IACrE,KAAK,CAAY;IAEjB,MAAM,CAAU,MAAM,GAAsC;QACxD,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACjC,aAAa,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACzC,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;KACpC,CAAC;;AAZN,oDAaC;AAED;;;;;;;;;;GAUG;AACH,MAAa,qBAAsB,SAAQ,0BAAc;IAErD,OAAO,CAA0B;IAEjC,MAAM,CAAU,MAAM,GAAuC;QACzD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAgB,CAAC;QAC9C,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,oBAAoB,CAAC,MAAM,CAAC;QAC9D,GAAG,4BAAgB;KACtB,CAAC;;AARN,sDASC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig, BASE_RULE_SCHEMA } from \"@webpieces/rules-sdk\";\nimport { StructuralMode, STRUCTURAL_MODES } from \"./rule-configs\";\n/** One `role:api-client` project and the outside packages it may import (its SDK, inversify, …). Data-only. */\nexport class ApiClientPackagesEntry {\n /** The nx project name of the `role:api-client` library, e.g. `gmail-client`. */\n project!: string;\n /** Package names (globs allowed, e.g. `@google-cloud/*`) it may import beyond `apiLibPackages`. */\n packages!: string[];\n\n static readonly SCHEMA: SchemaShape<ApiClientPackagesEntry> = {\n project: new FieldDef('string'),\n packages: new FieldDef('string[]'),\n };\n}\n\n/**\n * `api-lib-dependencies` (D2) — a `role:api-lib` may depend only on other `role:api-lib` projects plus\n * the outside packages in `apiLibPackages`; a `role:api-client` may ALSO import the packages its own\n * `apiClients` entry names (its SDK, `inversify`, `@webpieces/core-context`, …).\n *\n * - `mode` — OFF | RUN_EVERY_TIME (a graph rule: it reads every project, every run).\n * - `apiLibPackages` — required; may be empty (an api library then imports nothing from outside), e.g.\n * `[\"@webpieces/core-util\", \"tslib\"]`. A workspace project whose name or package name is listed here\n * is allowed too, so a repo whose `core-util` is a workspace project states it the same way.\n * - `apiClients` — required; one entry per `role:api-client` project. A `role:api-client` with no\n * entry is itself a violation: what it may talk to is stated, never inferred.\n */\nexport class ApiLibDependenciesConfig extends BaseRuleConfig {\n declare mode?: StructuralMode;\n apiLibPackages!: string[];\n apiClients!: ApiClientPackagesEntry[];\n\n static readonly SCHEMA: SchemaShape<ApiLibDependenciesConfig> = {\n mode: new FieldDef('string', STRUCTURAL_MODES),\n apiLibPackages: new FieldDef('string[]'),\n apiClients: FieldDef.objects(ApiClientPackagesEntry.SCHEMA),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n/**\n * `api-lib-path` (D10) — both directions: every `role:api-lib` / `role:api-client` project lives under\n * one of `paths`, and every project under `paths` carries one of those two roles.\n *\n * - `mode` — OFF | RUN_EVERY_TIME.\n * - `paths` — required, non-empty globs over project ROOTS, e.g. `[\"libraries/apis/**\"]`.\n */\nexport class ApiLibPathConfig extends BaseRuleConfig {\n declare mode?: StructuralMode;\n paths!: string[];\n\n static readonly SCHEMA: SchemaShape<ApiLibPathConfig> = {\n mode: new FieldDef('string', STRUCTURAL_MODES),\n paths: FieldDef.nonEmptyStrings(),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n/**\n * One folder of the runtime layout: the project roots it covers, the framework SETS a project there may\n * carry, and the roles it may have. Data-only.\n *\n * A framework set is written as its tags joined by `+`, in any order: `\"browser+node+react-native\"`.\n * Listing two sets means EITHER — `[\"node\", \"express\"]` is a node library or an express one.\n */\nexport class FrameworkFolderEntry {\n /** Globs over project ROOTS, e.g. `[\"libraries/universal/**\"]`. Non-empty. */\n paths!: string[];\n /** The accepted framework sets, each `+`-joined, e.g. `[\"browser+node+react-native\"]`. Non-empty. */\n frameworkSets!: string[];\n /** The accepted roles, e.g. `[\"lib\", \"designed-lib\"]`. Non-empty. */\n roles!: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkFolderEntry> = {\n paths: FieldDef.nonEmptyStrings(),\n frameworkSets: FieldDef.nonEmptyStrings(),\n roles: FieldDef.nonEmptyStrings(),\n };\n}\n\n/**\n * `framework-folder` (D9) — the folder a library lives in and the tags it carries say the same thing,\n * both directions:\n * - a project under an entry's `paths` (the FIRST entry whose glob matches, in `entries` order) must\n * carry one of that entry's `frameworkSets`, exactly, and one of its `roles`;\n * - a LIBRARY (any role but server/app/client/bundle) carrying a framework set and role that some entry\n * lists must live under one of the entries that list them.\n *\n * - `mode` — OFF | RUN_EVERY_TIME.\n * - `entries` — required, non-empty. The recommended layout is in `.claude/rules/framework-tags.md`.\n */\nexport class FrameworkFolderConfig extends BaseRuleConfig {\n declare mode?: StructuralMode;\n entries!: FrameworkFolderEntry[];\n\n static readonly SCHEMA: SchemaShape<FrameworkFolderConfig> = {\n mode: new FieldDef('string', STRUCTURAL_MODES),\n entries: FieldDef.nonEmptyObjects(FrameworkFolderEntry.SCHEMA),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { CatchErrorPatternConfig } from '@webpieces/rules-config';
3
+ import { CatchErrorPatternConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: CatchErrorPatternConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-catch-error-pattern/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAkF;AAGnE,KAAK,UAAU,WAAW,CACrC,OAAgC,EAChC,OAAwB;IAExB,OAAO,IAAI,uCAA0B,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { CatchErrorPatternValidator, GateScanScope } from '@webpieces/code-rules';\nimport { CatchErrorPatternConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: CatchErrorPatternConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new CatchErrorPatternValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-catch-error-pattern/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAkF;AAGnE,KAAK,UAAU,WAAW,CACrC,OAAgC,EAChC,OAAwB;IAExB,OAAO,IAAI,uCAA0B,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { CatchErrorPatternValidator, GateScanScope } from '@webpieces/code-rules';\nimport { CatchErrorPatternConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: CatchErrorPatternConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new CatchErrorPatternValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { PrismaValidateDtosConfig } from '@webpieces/rules-config';
3
+ import { PrismaValidateDtosConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: PrismaValidateDtosConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-dtos/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAoE;AAGrD,KAAK,UAAU,WAAW,CACrC,OAAiC,EACjC,OAAwB;IAExB,OAAO,IAAI,wCAA2B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { PrismaValidateDtosValidator } from '@webpieces/code-rules';\nimport { PrismaValidateDtosConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: PrismaValidateDtosConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new PrismaValidateDtosValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-dtos/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAoE;AAGrD,KAAK,UAAU,WAAW,CACrC,OAAiC,EACjC,OAAwB;IAExB,OAAO,IAAI,wCAA2B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { PrismaValidateDtosValidator } from '@webpieces/code-rules';\nimport { PrismaValidateDtosConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: PrismaValidateDtosConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new PrismaValidateDtosValidator(options).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { MaxFileLinesConfig } from '@webpieces/rules-config';
3
+ import { MaxFileLinesConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: MaxFileLinesConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-modified-files/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8D;AAG/C,KAAK,UAAU,WAAW,CACrC,OAA2B,EAC3B,OAAwB;IAExB,OAAO,IAAI,kCAAqB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { MaxFileLinesValidator } from '@webpieces/code-rules';\nimport { MaxFileLinesConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: MaxFileLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new MaxFileLinesValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-modified-files/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8D;AAG/C,KAAK,UAAU,WAAW,CACrC,OAA2B,EAC3B,OAAwB;IAExB,OAAO,IAAI,kCAAqB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { MaxFileLinesValidator } from '@webpieces/code-rules';\nimport { MaxFileLinesConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: MaxFileLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new MaxFileLinesValidator(options).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { MaxMethodLinesConfig } from '@webpieces/rules-config';
3
+ import { MaxMethodLinesConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: MaxMethodLinesConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-modified-methods/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA2D;AAG5C,KAAK,UAAU,WAAW,CACrC,OAA6B,EAC7B,OAAwB;IAExB,OAAO,IAAA,+BAAkB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { runModifiedMethods } from '@webpieces/code-rules';\nimport { MaxMethodLinesConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: MaxMethodLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return runModifiedMethods(options, context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-modified-methods/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA2D;AAG5C,KAAK,UAAU,WAAW,CACrC,OAA6B,EAC7B,OAAwB;IAExB,OAAO,IAAA,+BAAkB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { runModifiedMethods } from '@webpieces/code-rules';\nimport { MaxMethodLinesConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: MaxMethodLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return runModifiedMethods(options, context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { MaxMethodLinesConfig } from '@webpieces/rules-config';
3
+ import { MaxMethodLinesConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: MaxMethodLinesConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-new-methods/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsD;AAGvC,KAAK,UAAU,WAAW,CACrC,OAA6B,EAC7B,OAAwB;IAExB,OAAO,IAAA,0BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { runNewMethods } from '@webpieces/code-rules';\nimport { MaxMethodLinesConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: MaxMethodLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return runNewMethods(options, context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-new-methods/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsD;AAGvC,KAAK,UAAU,WAAW,CACrC,OAA6B,EAC7B,OAAwB;IAExB,OAAO,IAAA,0BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { runNewMethods } from '@webpieces/code-rules';\nimport { MaxMethodLinesConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: MaxMethodLinesConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return runNewMethods(options, context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { NoAnyUnknownConfig } from '@webpieces/rules-config';
3
+ import { NoAnyUnknownConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: NoAnyUnknownConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-any-unknown/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA6E;AAG9D,KAAK,UAAU,WAAW,CACrC,OAA2B,EAC3B,OAAwB;IAExB,OAAO,IAAI,kCAAqB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACrF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoAnyUnknownValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoAnyUnknownConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: NoAnyUnknownConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoAnyUnknownValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-any-unknown/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA6E;AAG9D,KAAK,UAAU,WAAW,CACrC,OAA2B,EAC3B,OAAwB;IAExB,OAAO,IAAI,kCAAqB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACrF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoAnyUnknownValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoAnyUnknownConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: NoAnyUnknownConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoAnyUnknownValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { NoDestructureConfig } from '@webpieces/rules-config';
3
+ import { NoDestructureConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: NoDestructureConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-destructure/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8E;AAG/D,KAAK,UAAU,WAAW,CACrC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAI,mCAAsB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoDestructureValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoDestructureConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: NoDestructureConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoDestructureValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-destructure/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8E;AAG/D,KAAK,UAAU,WAAW,CACrC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAI,mCAAsB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoDestructureValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoDestructureConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: NoDestructureConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoDestructureValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { AngularNoDirectApiInResolverConfig } from '@webpieces/rules-config';
3
+ import { AngularNoDirectApiInResolverConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: AngularNoDirectApiInResolverConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-direct-api-resolver/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAqE;AAGtD,KAAK,UAAU,WAAW,CACrC,OAA2C,EAC3C,OAAwB;IAExB,OAAO,IAAI,yCAA4B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoDirectApiResolverValidator } from '@webpieces/code-rules';\nimport { AngularNoDirectApiInResolverConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: AngularNoDirectApiInResolverConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoDirectApiResolverValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-direct-api-resolver/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAqE;AAGtD,KAAK,UAAU,WAAW,CACrC,OAA2C,EAC3C,OAAwB;IAExB,OAAO,IAAI,yCAA4B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoDirectApiResolverValidator } from '@webpieces/code-rules';\nimport { AngularNoDirectApiInResolverConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: AngularNoDirectApiInResolverConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoDirectApiResolverValidator(options).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { NoImplicitAnyConfig } from '@webpieces/rules-config';
3
+ import { NoImplicitAnyConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: NoImplicitAnyConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-implicit-any/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8E;AAG/D,KAAK,UAAU,WAAW,CACrC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAI,mCAAsB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoImplicitAnyValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoImplicitAnyConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: NoImplicitAnyConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoImplicitAnyValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-implicit-any/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAA8E;AAG/D,KAAK,UAAU,WAAW,CACrC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAI,mCAAsB,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoImplicitAnyValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoImplicitAnyConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: NoImplicitAnyConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoImplicitAnyValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { NoInlineTypeLiteralsConfig } from '@webpieces/rules-config';
3
+ import { NoInlineTypeLiteralsConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: NoInlineTypeLiteralsConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-inline-types/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsE;AAGvD,KAAK,UAAU,WAAW,CACrC,OAAmC,EACnC,OAAwB;IAExB,OAAO,IAAI,0CAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoInlineTypeLiteralsValidator } from '@webpieces/code-rules';\nimport { NoInlineTypeLiteralsConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: NoInlineTypeLiteralsConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoInlineTypeLiteralsValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-inline-types/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsE;AAGvD,KAAK,UAAU,WAAW,CACrC,OAAmC,EACnC,OAAwB;IAExB,OAAO,IAAI,0CAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoInlineTypeLiteralsValidator } from '@webpieces/code-rules';\nimport { NoInlineTypeLiteralsConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: NoInlineTypeLiteralsConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoInlineTypeLiteralsValidator(options).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { NoUnmanagedExceptionsConfig } from '@webpieces/rules-config';
3
+ import { NoUnmanagedExceptionsConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: NoUnmanagedExceptionsConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-unmanaged-exceptions/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsF;AAGvE,KAAK,UAAU,WAAW,CACrC,OAAoC,EACpC,OAAwB;IAExB,OAAO,IAAI,2CAA8B,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoUnmanagedExceptionsValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoUnmanagedExceptionsConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: NoUnmanagedExceptionsConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoUnmanagedExceptionsValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-no-unmanaged-exceptions/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAsF;AAGvE,KAAK,UAAU,WAAW,CACrC,OAAoC,EACpC,OAAwB;IAExB,OAAO,IAAI,2CAA8B,CAAC,OAAO,EAAE,IAAI,0BAAa,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { NoUnmanagedExceptionsValidator, GateScanScope } from '@webpieces/code-rules';\nimport { NoUnmanagedExceptionsConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: NoUnmanagedExceptionsConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new NoUnmanagedExceptionsValidator(options, new GateScanScope()).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { PrismaConverterConfig } from '@webpieces/rules-config';
3
+ import { PrismaConverterConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: PrismaConverterConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-prisma-converters/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAiE;AAGlD,KAAK,UAAU,WAAW,CACrC,OAA8B,EAC9B,OAAwB;IAExB,OAAO,IAAI,qCAAwB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { PrismaConverterValidator } from '@webpieces/code-rules';\nimport { PrismaConverterConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: PrismaConverterConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new PrismaConverterValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-prisma-converters/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAiE;AAGlD,KAAK,UAAU,WAAW,CACrC,OAA8B,EAC9B,OAAwB;IAExB,OAAO,IAAI,qCAAwB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { PrismaConverterValidator } from '@webpieces/code-rules';\nimport { PrismaConverterConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: PrismaConverterConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new PrismaConverterValidator(options).run(context.root);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import { ExecutorResult } from '../../executor-result';
3
- import { RequireReturnTypeConfig } from '@webpieces/rules-config';
3
+ import { RequireReturnTypeConfig } from "@webpieces/code-rules";
4
4
  export default function runExecutor(options: RequireReturnTypeConfig, context: ExecutorContext): Promise<ExecutorResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-return-types/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAmE;AAGpD,KAAK,UAAU,WAAW,CACrC,OAAgC,EAChC,OAAwB;IAExB,OAAO,IAAI,uCAA0B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { RequireReturnTypeValidator } from '@webpieces/code-rules';\nimport { RequireReturnTypeConfig } from '@webpieces/rules-config';\n\nexport default async function runExecutor(\n options: RequireReturnTypeConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new RequireReturnTypeValidator(options).run(context.root);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/executors/validate-return-types/executor.ts"],"names":[],"mappings":";;AAKA,8BAKC;AARD,sDAAmE;AAGpD,KAAK,UAAU,WAAW,CACrC,OAAgC,EAChC,OAAwB;IAExB,OAAO,IAAI,uCAA0B,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\nimport { ExecutorResult } from '../../executor-result';\nimport { RequireReturnTypeValidator } from '@webpieces/code-rules';\nimport { RequireReturnTypeConfig } from \"@webpieces/code-rules\";\n\nexport default async function runExecutor(\n options: RequireReturnTypeConfig,\n context: ExecutorContext,\n): Promise<ExecutorResult> {\n return new RequireReturnTypeValidator(options).run(context.root);\n}\n"]}
package/src/index.d.ts CHANGED
@@ -19,3 +19,9 @@ declare const _default: {
19
19
  createNodesV2: import("@nx/devkit").CreateNodesV2<import("./plugin").ArchitecturePluginOptions>;
20
20
  };
21
21
  export default _default;
22
+ export { STRUCTURAL_MODES, NoFileImportCyclesConfig, RuntimeArchitectureConfig, NxWiringConfig, DiGraphConfig, MissingDesignAnnotationConfig, ValidateArchitectureUnchangedConfig, ValidateNoArchitectureCyclesConfig, ValidatePackageJsonConfig, ValidateVersionsLockedConfig, ValidateEslintSyncConfig } from './configs/rule-configs';
23
+ export type { StructuralMode } from './configs/rule-configs';
24
+ export { NoRootUnionApiTypeConfig } from './configs/no-root-union-config';
25
+ export { API_DOC_MODES, ApiRulesForOpenApiConfig, ApiRulesForMcpConfig } from './configs/api-doc-rules-config';
26
+ export type { ApiDocMode } from './configs/api-doc-rules-config';
27
+ export { ApiClientPackagesEntry, ApiLibDependenciesConfig, ApiLibPathConfig, FrameworkFolderEntry, FrameworkFolderConfig } from './configs/tag-truth-configs';
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNodesV2 = void 0;
3
+ exports.FrameworkFolderConfig = exports.FrameworkFolderEntry = exports.ApiLibPathConfig = exports.ApiLibDependenciesConfig = exports.ApiClientPackagesEntry = exports.ApiRulesForMcpConfig = exports.ApiRulesForOpenApiConfig = exports.API_DOC_MODES = exports.NoRootUnionApiTypeConfig = exports.ValidateEslintSyncConfig = exports.ValidateVersionsLockedConfig = exports.ValidatePackageJsonConfig = exports.ValidateNoArchitectureCyclesConfig = exports.ValidateArchitectureUnchangedConfig = exports.MissingDesignAnnotationConfig = exports.DiGraphConfig = exports.NxWiringConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.STRUCTURAL_MODES = exports.createNodesV2 = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./lib/graph-generator"), exports);
6
6
  tslib_1.__exportStar(require("./lib/graph-sorter"), exports);
@@ -19,4 +19,28 @@ tslib_1.__exportStar(require("./lib/di-graph/design-finder"), exports);
19
19
  const plugin_1 = require("./plugin");
20
20
  Object.defineProperty(exports, "createNodesV2", { enumerable: true, get: function () { return plugin_1.createNodesV2; } });
21
21
  exports.default = { name: '@webpieces/nx-webpieces-rules', createNodesV2: plugin_1.createNodesV2 };
22
+ var rule_configs_1 = require("./configs/rule-configs");
23
+ Object.defineProperty(exports, "STRUCTURAL_MODES", { enumerable: true, get: function () { return rule_configs_1.STRUCTURAL_MODES; } });
24
+ Object.defineProperty(exports, "NoFileImportCyclesConfig", { enumerable: true, get: function () { return rule_configs_1.NoFileImportCyclesConfig; } });
25
+ Object.defineProperty(exports, "RuntimeArchitectureConfig", { enumerable: true, get: function () { return rule_configs_1.RuntimeArchitectureConfig; } });
26
+ Object.defineProperty(exports, "NxWiringConfig", { enumerable: true, get: function () { return rule_configs_1.NxWiringConfig; } });
27
+ Object.defineProperty(exports, "DiGraphConfig", { enumerable: true, get: function () { return rule_configs_1.DiGraphConfig; } });
28
+ Object.defineProperty(exports, "MissingDesignAnnotationConfig", { enumerable: true, get: function () { return rule_configs_1.MissingDesignAnnotationConfig; } });
29
+ Object.defineProperty(exports, "ValidateArchitectureUnchangedConfig", { enumerable: true, get: function () { return rule_configs_1.ValidateArchitectureUnchangedConfig; } });
30
+ Object.defineProperty(exports, "ValidateNoArchitectureCyclesConfig", { enumerable: true, get: function () { return rule_configs_1.ValidateNoArchitectureCyclesConfig; } });
31
+ Object.defineProperty(exports, "ValidatePackageJsonConfig", { enumerable: true, get: function () { return rule_configs_1.ValidatePackageJsonConfig; } });
32
+ Object.defineProperty(exports, "ValidateVersionsLockedConfig", { enumerable: true, get: function () { return rule_configs_1.ValidateVersionsLockedConfig; } });
33
+ Object.defineProperty(exports, "ValidateEslintSyncConfig", { enumerable: true, get: function () { return rule_configs_1.ValidateEslintSyncConfig; } });
34
+ var no_root_union_config_1 = require("./configs/no-root-union-config");
35
+ Object.defineProperty(exports, "NoRootUnionApiTypeConfig", { enumerable: true, get: function () { return no_root_union_config_1.NoRootUnionApiTypeConfig; } });
36
+ var api_doc_rules_config_1 = require("./configs/api-doc-rules-config");
37
+ Object.defineProperty(exports, "API_DOC_MODES", { enumerable: true, get: function () { return api_doc_rules_config_1.API_DOC_MODES; } });
38
+ Object.defineProperty(exports, "ApiRulesForOpenApiConfig", { enumerable: true, get: function () { return api_doc_rules_config_1.ApiRulesForOpenApiConfig; } });
39
+ Object.defineProperty(exports, "ApiRulesForMcpConfig", { enumerable: true, get: function () { return api_doc_rules_config_1.ApiRulesForMcpConfig; } });
40
+ var tag_truth_configs_1 = require("./configs/tag-truth-configs");
41
+ Object.defineProperty(exports, "ApiClientPackagesEntry", { enumerable: true, get: function () { return tag_truth_configs_1.ApiClientPackagesEntry; } });
42
+ Object.defineProperty(exports, "ApiLibDependenciesConfig", { enumerable: true, get: function () { return tag_truth_configs_1.ApiLibDependenciesConfig; } });
43
+ Object.defineProperty(exports, "ApiLibPathConfig", { enumerable: true, get: function () { return tag_truth_configs_1.ApiLibPathConfig; } });
44
+ Object.defineProperty(exports, "FrameworkFolderEntry", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkFolderEntry; } });
45
+ Object.defineProperty(exports, "FrameworkFolderConfig", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkFolderConfig; } });
22
46
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsC;AACtC,6DAAmC;AACnC,iEAAuC;AACvC,kEAAwC;AACxC,6DAAmC;AACnC,iEAAuC;AACvC,+DAAqC;AACrC,mEAAyC;AACzC,6EAAmD;AACnD,6DAAmC;AACnC,iEAAuC;AACvC,6DAAmC;AACnC,2EAAiD;AACjD,uEAA6C;AAC7C,qCAAyC;AAChC,8FADA,sBAAa,OACA;AACtB,kBAAe,EAAE,IAAI,EAAE,+BAA+B,EAAE,aAAa,EAAb,sBAAa,EAAE,CAAC","sourcesContent":["export * from './lib/graph-generator';\nexport * from './lib/graph-sorter';\nexport * from './lib/graph-comparator';\nexport * from './lib/package-validator';\nexport * from './lib/graph-loader';\nexport * from './lib/graph-visualizer';\nexport * from './lib/graph-metadata';\nexport * from './lib/framework-resolver';\nexport * from './lib/runtime-participant-resolver';\nexport * from './lib/project-info';\nexport * from './lib/responsibilities';\nexport * from './lib/di-graph/dot';\nexport * from './lib/di-graph/design-visualizer';\nexport * from './lib/di-graph/design-finder';\nimport { createNodesV2 } from './plugin';\nexport { createNodesV2 };\nexport default { name: '@webpieces/nx-webpieces-rules', createNodesV2 };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsC;AACtC,6DAAmC;AACnC,iEAAuC;AACvC,kEAAwC;AACxC,6DAAmC;AACnC,iEAAuC;AACvC,+DAAqC;AACrC,mEAAyC;AACzC,6EAAmD;AACnD,6DAAmC;AACnC,iEAAuC;AACvC,6DAAmC;AACnC,2EAAiD;AACjD,uEAA6C;AAC7C,qCAAyC;AAChC,8FADA,sBAAa,OACA;AACtB,kBAAe,EAAE,IAAI,EAAE,+BAA+B,EAAE,aAAa,EAAb,sBAAa,EAAE,CAAC;AAExE,uDAAyU;AAAhU,gHAAA,gBAAgB,OAAA;AAAE,wHAAA,wBAAwB,OAAA;AAAE,yHAAA,yBAAyB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,6HAAA,6BAA6B,OAAA;AAAE,mIAAA,mCAAmC,OAAA;AAAE,kIAAA,kCAAkC,OAAA;AAAE,yHAAA,yBAAyB,OAAA;AAAE,4HAAA,4BAA4B,OAAA;AAAE,wHAAA,wBAAwB,OAAA;AAExS,uEAA0E;AAAjE,gIAAA,wBAAwB,OAAA;AACjC,uEAA+G;AAAtG,qHAAA,aAAa,OAAA;AAAE,gIAAA,wBAAwB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAEtE,iEAA8J;AAArJ,2HAAA,sBAAsB,OAAA;AAAE,6HAAA,wBAAwB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAAE,0HAAA,qBAAqB,OAAA","sourcesContent":["export * from './lib/graph-generator';\nexport * from './lib/graph-sorter';\nexport * from './lib/graph-comparator';\nexport * from './lib/package-validator';\nexport * from './lib/graph-loader';\nexport * from './lib/graph-visualizer';\nexport * from './lib/graph-metadata';\nexport * from './lib/framework-resolver';\nexport * from './lib/runtime-participant-resolver';\nexport * from './lib/project-info';\nexport * from './lib/responsibilities';\nexport * from './lib/di-graph/dot';\nexport * from './lib/di-graph/design-visualizer';\nexport * from './lib/di-graph/design-finder';\nimport { createNodesV2 } from './plugin';\nexport { createNodesV2 };\nexport default { name: '@webpieces/nx-webpieces-rules', createNodesV2 };\n\nexport { STRUCTURAL_MODES, NoFileImportCyclesConfig, RuntimeArchitectureConfig, NxWiringConfig, DiGraphConfig, MissingDesignAnnotationConfig, ValidateArchitectureUnchangedConfig, ValidateNoArchitectureCyclesConfig, ValidatePackageJsonConfig, ValidateVersionsLockedConfig, ValidateEslintSyncConfig } from './configs/rule-configs';\nexport type { StructuralMode } from './configs/rule-configs';\nexport { NoRootUnionApiTypeConfig } from './configs/no-root-union-config';\nexport { API_DOC_MODES, ApiRulesForOpenApiConfig, ApiRulesForMcpConfig } from './configs/api-doc-rules-config';\nexport type { ApiDocMode } from './configs/api-doc-rules-config';\nexport { ApiClientPackagesEntry, ApiLibDependenciesConfig, ApiLibPathConfig, FrameworkFolderEntry, FrameworkFolderConfig } from './configs/tag-truth-configs';\n"]}
@@ -6,8 +6,8 @@
6
6
  * config is read exactly once per executor run.
7
7
  */
8
8
  /** As written in a disable comment and as a config key. */
9
- export declare const OPENAPI_RULE: "api-rules-for-openapi";
10
- export declare const MCP_RULE: "api-rules-for-mcp";
9
+ export declare const OPENAPI_RULE = "api-rules-for-openapi";
10
+ export declare const MCP_RULE = "api-rules-for-mcp";
11
11
  /** The `@ApiType` value that means "a partner reads this document". */
12
12
  export declare const EXTERNAL_CUSTOMER_API_TYPE = "external-customer";
13
13
  /**
@@ -13,8 +13,8 @@ const fs = tslib_1.__importStar(require("fs"));
13
13
  const rules_config_1 = require("@webpieces/rules-config");
14
14
  const rule_gate_1 = require("../rule-gate");
15
15
  /** As written in a disable comment and as a config key. */
16
- exports.OPENAPI_RULE = rules_config_1.RULE_NAMES.API_RULES_FOR_OPENAPI;
17
- exports.MCP_RULE = rules_config_1.RULE_NAMES.API_RULES_FOR_MCP;
16
+ exports.OPENAPI_RULE = "api-rules-for-openapi";
17
+ exports.MCP_RULE = "api-rules-for-mcp";
18
18
  /** The `@ApiType` value that means "a partner reads this document". */
19
19
  exports.EXTERNAL_CUSTOMER_API_TYPE = 'external-customer';
20
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"api-doc-rules.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/lib/api-usage/api-doc-rules.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,+CAAyB;AACzB,0DAOiC;AACjC,4CAAwC;AAExC,2DAA2D;AAC9C,QAAA,YAAY,GAAG,yBAAU,CAAC,qBAAqB,CAAC;AAChD,QAAA,QAAQ,GAAG,yBAAU,CAAC,iBAAiB,CAAC;AAErD,uEAAuE;AAC1D,QAAA,0BAA0B,GAAG,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,GAAG,IAAI,MAAM,CACzB,SAAS,gCAAiB,wDAAwD,CACrF,CAAC;AAEF,kGAAkG;AAClG,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;;;;GAOG;A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,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAC5C,OAAO,IAAI,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,6DAA6D;IAC7D,qFAAqF;IAC7E,MAAM,CAAC,OAAO,CAAC,IAAY;QAC/B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAC3C,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;CACJ;AA9DD,wCA8DC","sourcesContent":["/**\n * The DATA and the SWITCHES of `api-rules-for-openapi` and `api-rules-for-mcp` (#1011).\n *\n * The scan itself is in `api-doc-rules-scan.ts`; this file holds what a caller reads back and the\n * per-rule config, so a unit test can construct either without touching a config file and so the\n * config is read exactly once per executor run.\n */\n\nimport * as fs from 'fs';\nimport {\n ChangedFilesOptions,\n DiffScope,\n loadAndValidate,\n matchesAnyGlob,\n RULE_NAMES,\n WEBPIECES_DISABLE,\n} from '@webpieces/rules-config';\nimport { RuleGate } from '../rule-gate';\n\n/** As written in a disable comment and as a config key. */\nexport const OPENAPI_RULE = RULE_NAMES.API_RULES_FOR_OPENAPI;\nexport const MCP_RULE = RULE_NAMES.API_RULES_FOR_MCP;\n\n/** The `@ApiType` value that means \"a partner reads this document\". */\nexport const EXTERNAL_CUSTOMER_API_TYPE = 'external-customer';\n\n/**\n * `// webpieces-disable <rule>[, <rule2>] -- <reason>`, with the reason CAPTURED so a reasonless\n * disable can be told apart from an absent one. Identical to the spelling `root-union-scan` reads.\n */\nconst DISABLE_RE = new RegExp(\n `//\\\\s*${WEBPIECES_DISABLE}\\\\s+([\\\\w-]+(?:\\\\s*,\\\\s*[\\\\w-]+)*)(?:\\\\s*--\\\\s*(.*))?$`,\n);\n\n/** How far above a declaration a disable comment may sit before it is somebody else's comment. */\nconst DISABLE_LOOKBACK_LINES = 40;\n\n/**\n * ONE defect on ONE contract.\n *\n * `exposure` is the contract's `@ApiType` list, and it is carried rather than derived because the\n * SAME defect is louder on a contract that reaches `external-customer`: an unshaped field on a\n * partner document costs a partner something, where the same field on a service-to-service contract\n * costs a colleague a question. The refusal sorts and labels on it.\n */\nexport class ApiContractDefect {\n constructor(\n /** The `@ApiPath` contract class. */\n public readonly api: string,\n /** The `@Endpoint` method, or `''` for a contract-level or DTO-level defect. */\n public readonly method: string,\n /** What is wrong, in one line, naming the declaration. */\n public readonly what: string,\n /** `path/to/File.ts:LINE`, workspace-relative. */\n public readonly at: string,\n /** What to do instead, in one sentence. */\n public readonly cure: string,\n /** The contract's `@ApiType` list — `svc-to-svc` when it declares none. */\n public readonly exposure: readonly string[],\n ) {}\n\n /** True when this contract feeds the PARTNER-facing document. */\n isExternal(): boolean {\n return this.exposure.includes(EXTERNAL_CUSTOMER_API_TYPE);\n }\n\n /** `Api.method` or `Api` — what a reader opens. */\n where(): string {\n return this.method === '' ? this.api : `${this.api}.${this.method}`;\n }\n}\n\n/** What ONE rule found: real defects, and disables of it that gave no reason. */\nexport class ApiRuleFindings {\n constructor(\n public readonly violations: readonly ApiContractDefect[],\n /**\n * Sites that named this rule in a disable and wrote no reason. A reasonless disable is\n * itself a violation: the point of the per-site hatch is the ARGUMENT, which is the only\n * part the next reader can weigh.\n */\n public readonly reasonlessDisables: readonly ApiContractDefect[],\n ) {}\n\n isEmpty(): boolean {\n return this.violations.length === 0 && this.reasonlessDisables.length === 0;\n }\n}\n\n/**\n * ONE endpoint declared PERMANENTLY outside MCP by `@InvalidEndpointForMcp('<reason>')` (#1014).\n *\n * Not a violation and not a suppression — a DECLARATION, which is why it is carried beside the\n * findings rather than in them. `api-rules-for-mcp` restates the whole list, with reasons, on every\n * run: an exclusion announced once at the moment somebody added it is an exclusion nobody will read\n * again, and a build-time warning at add time would be read exactly as little.\n */\nexport class McpExclusion {\n constructor(\n public readonly api: string,\n public readonly method: string,\n /** The decorator's reason, verbatim. Empty only when the argument could not be folded. */\n public readonly reason: string,\n /** `path/to/File.ts:LINE`, workspace-relative. */\n public readonly at: string,\n ) {}\n}\n\n/** Both rules' findings from ONE scan — one program build, two verdicts. */\nexport class ApiDocRulesFindings {\n constructor(\n public readonly openApi: ApiRuleFindings,\n public readonly mcp: ApiRuleFindings,\n /** Every `@InvalidEndpointForMcp` endpoint the MCP rule looked at, in declaration order. */\n public readonly mcpExclusions: readonly McpExclusion[] = [],\n ) {}\n\n // webpieces-disable no-function-outside-class -- static factory of this class\n static empty(): ApiDocRulesFindings {\n return new ApiDocRulesFindings(\n new ApiRuleFindings([], []),\n new ApiRuleFindings([], []),\n [],\n );\n }\n}\n\n/** The mode value that narrows the scan to the projects the diff touched. */\nexport const AFFECTED_PROJECT_MODE = 'AFFECTED_PROJECT';\n\n/**\n * ONE rule's switches, resolved from webpieces.config.json once per scan.\n *\n * There is NO default (#1017). Both rules are schema'd, so `webpieces.config.json` must carry an\n * entry for each or the config FAILS TO LOAD naming them — a consumer states `OFF`,\n * `AFFECTED_PROJECT` or `RUN_EVERY_TIME` out loud. The `off()` a bare constructor or a unit test\n * gets is not a default; it is what a caller that configured nothing asked for.\n */\nexport class ApiDocRule {\n constructor(\n public readonly name: string,\n public readonly enabled: boolean,\n /** Project roots this rule does not apply to — `allowedPaths` in the config. */\n public readonly allowedPaths: readonly string[],\n /**\n * Workspace-relative paths the diff touched, under `AFFECTED_PROJECT`; `null` under\n * `RUN_EVERY_TIME`, which means every project is in scope.\n *\n * `null` is also what an UNCOMPUTABLE diff resolves to — no merge-base, a shallow clone, no\n * repository at all. A diff that could not be read is not evidence that nothing changed, and\n * the only safe reading of \"I do not know what changed\" is \"look at all of it\".\n */\n public readonly changedPaths: readonly string[] | null = null,\n ) {}\n\n /** ARMED over every project — what a unit test constructs, and what RUN_EVERY_TIME resolves to. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static armed(name: string): ApiDocRule {\n return new ApiDocRule(name, true, [], null);\n }\n\n /** ARMED over the projects owning one of `changedPaths` — what AFFECTED_PROJECT resolves to. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static affected(name: string, changedPaths: readonly string[]): ApiDocRule {\n return new ApiDocRule(name, true, [], changedPaths);\n }\n\n // webpieces-disable no-function-outside-class -- static factory of this class\n static off(name: string): ApiDocRule {\n return new ApiDocRule(name, false, [], null);\n }\n\n /**\n * True when this rule scans the contracts of the project rooted at `root`.\n *\n * ONE place answers it, for both rules, so `allowedPaths` and the affected-project narrowing can\n * never be applied by one caller and skipped by another.\n */\n coversProject(root: string): boolean {\n if (!this.enabled) return false;\n if (matchesAnyGlob(root, this.allowedPaths)) return false;\n if (this.changedPaths === null) return true;\n const prefix = `${root}/`;\n return this.changedPaths.some((each: string): boolean => each.startsWith(prefix));\n }\n\n /** `mode: OFF` and the time-box/branch hatches come from RuleGate, so there is ONE reading. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static fromConfig(workspaceRoot: string, name: string): ApiDocRule {\n if (new RuleGate().isDisabled(workspaceRoot, name, true)) {\n return ApiDocRule.off(name);\n }\n const rule = loadAndValidate(workspaceRoot).resolved.rules.get(name);\n const allowed = rule?.options['allowedPaths'];\n const allowedPaths = Array.isArray(allowed) ? (allowed as string[]) : [];\n const affected =\n rule?.options['mode'] === AFFECTED_PROJECT_MODE\n ? ApiDocRule.changedPathsOf(workspaceRoot)\n : null;\n return new ApiDocRule(name, true, allowedPaths, affected);\n }\n\n /**\n * Every path the diff touched, against the base nx itself uses (`NX_BASE`, else the merge-base\n * with origin/main). NOT ts-only and INCLUDING deletions: a deleted DTO changes what a project's\n * contracts can express exactly as an added one does, and a `project.json` edit can change which\n * project owns a contract at all.\n */\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static changedPathsOf(workspaceRoot: string): readonly string[] | null {\n const scope = new DiffScope();\n const range = scope.resolveBase(workspaceRoot);\n if (range.base === undefined) return null;\n const opts = new ChangedFilesOptions();\n opts.tsOnly = false;\n opts.includeDeletions = true;\n return scope.getChangedFiles(workspaceRoot, range.base, range.head, opts);\n }\n}\n\n/** ONE `webpieces-disable` naming a rule, and whether it gave a reason. */\nexport class DisableComment {\n constructor(public readonly hasReason: boolean) {}\n\n /**\n * The disable naming `rule` on the declaration at `line` (1-based) of `file`, or undefined.\n *\n * It walks UPWARD over the declaration's own leading trivia — blank lines, `//` comments, a\n * JSDoc block, and the decorators between them — because that is where an author writes one, and\n * it stops at the first line that is none of those, so a directive belonging to the PREVIOUS\n * declaration can never be read as covering this one.\n *\n * Only a directive NAMING this rule counts. An existing `// webpieces-disable no-any-unknown`\n * therefore does not silence these rules, which is the point: that rule answers \"is this\n * type-safe?\" and these answer \"is this field PUBLISHED with no shape?\" — different questions\n * with different right answers, so the second one wants its own, separately argued line.\n *\n * A file that cannot be read yields \"no disable\": a defect is still a defect, and inventing a\n * suppression out of an I/O failure is the one wrong answer.\n */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static readAt(file: string, line: number, rule: string): DisableComment | undefined {\n const lines = DisableComment.linesOf(file);\n if (lines === undefined) return undefined;\n const start = Math.max(0, line - 1);\n const onDeclaration = DisableComment.match(lines[start] ?? '', rule);\n if (onDeclaration !== undefined) return onDeclaration;\n for (let i = start - 1; i >= 0 && i >= start - DISABLE_LOOKBACK_LINES; i--) {\n const text = (lines[i] ?? '').trim();\n const above = DisableComment.match(text, rule);\n if (above !== undefined) return above;\n if (!DisableComment.isTrivia(text)) return undefined;\n }\n return undefined;\n }\n\n /** Leading trivia a disable comment is allowed to sit above: blanks, comments and decorators. */\n // webpieces-disable no-function-outside-class -- private static predicate of this class\n private static isTrivia(text: string): boolean {\n return (\n text === '' ||\n text.startsWith('//') ||\n text.startsWith('*') ||\n text.startsWith('/*') ||\n text.startsWith('@')\n );\n }\n\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static match(text: string, rule: string): DisableComment | undefined {\n const found = text.trim().match(DISABLE_RE);\n if (found === null) return undefined;\n const named = found[1].split(',').map((each: string): string => each.trim());\n if (!named.includes(rule)) return undefined;\n return new DisableComment((found[2] ?? '').trim() !== '');\n }\n\n /** The file's lines, or undefined when it cannot be read. */\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static linesOf(file: string): string[] | undefined {\n if (!fs.existsSync(file)) return undefined;\n return fs.readFileSync(file, 'utf8').split('\\n');\n }\n}\n"]}
1
+ {"version":3,"file":"api-doc-rules.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/lib/api-usage/api-doc-rules.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,+CAAyB;AACzB,0DAA6H;AAC7H,4CAAwC;AAExC,2DAA2D;AAC9C,QAAA,YAAY,GAAG,uBAAuB,CAAC;AACvC,QAAA,QAAQ,GAAG,mBAAmB,CAAC;AAE5C,uEAAuE;AAC1D,QAAA,0BAA0B,GAAG,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,GAAG,IAAI,MAAM,CACzB,SAAS,gCAAiB,wDAAwD,CACrF,CAAC;AAEF,kGAAkG;AAClG,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;;;;GAOG;AACH,MAAa,iBAAiB;IAGN;IAEA;IAEA;IAEA;IAEA;IAEA;IAZpB;IACI,qCAAqC;IACrB,GAAW;IAC3B,gFAAgF;IAChE,MAAc;IAC9B,0DAA0D;IAC1C,IAAY;IAC5B,kDAAkD;IAClC,EAAU;IAC1B,2CAA2C;IAC3B,IAAY;IAC5B,2EAA2E;IAC3D,QAA2B;QAV3B,QAAG,GAAH,GAAG,CAAQ;QAEX,WAAM,GAAN,MAAM,CAAQ;QAEd,SAAI,GAAJ,IAAI,CAAQ;QAEZ,OAAE,GAAF,EAAE,CAAQ;QAEV,SAAI,GAAJ,IA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CAAC;YAAE,OAAO,SAAS,CAAC;QAC3C,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;CACJ;AA9DD,wCA8DC","sourcesContent":["/**\n * The DATA and the SWITCHES of `api-rules-for-openapi` and `api-rules-for-mcp` (#1011).\n *\n * The scan itself is in `api-doc-rules-scan.ts`; this file holds what a caller reads back and the\n * per-rule config, so a unit test can construct either without touching a config file and so the\n * config is read exactly once per executor run.\n */\n\nimport * as fs from 'fs';\nimport { ChangedFilesOptions, DiffScope, loadAndValidate, matchesAnyGlob, WEBPIECES_DISABLE } from '@webpieces/rules-config';\nimport { RuleGate } from '../rule-gate';\n\n/** As written in a disable comment and as a config key. */\nexport const OPENAPI_RULE = \"api-rules-for-openapi\";\nexport const MCP_RULE = \"api-rules-for-mcp\";\n\n/** The `@ApiType` value that means \"a partner reads this document\". */\nexport const EXTERNAL_CUSTOMER_API_TYPE = 'external-customer';\n\n/**\n * `// webpieces-disable <rule>[, <rule2>] -- <reason>`, with the reason CAPTURED so a reasonless\n * disable can be told apart from an absent one. Identical to the spelling `root-union-scan` reads.\n */\nconst DISABLE_RE = new RegExp(\n `//\\\\s*${WEBPIECES_DISABLE}\\\\s+([\\\\w-]+(?:\\\\s*,\\\\s*[\\\\w-]+)*)(?:\\\\s*--\\\\s*(.*))?$`,\n);\n\n/** How far above a declaration a disable comment may sit before it is somebody else's comment. */\nconst DISABLE_LOOKBACK_LINES = 40;\n\n/**\n * ONE defect on ONE contract.\n *\n * `exposure` is the contract's `@ApiType` list, and it is carried rather than derived because the\n * SAME defect is louder on a contract that reaches `external-customer`: an unshaped field on a\n * partner document costs a partner something, where the same field on a service-to-service contract\n * costs a colleague a question. The refusal sorts and labels on it.\n */\nexport class ApiContractDefect {\n constructor(\n /** The `@ApiPath` contract class. */\n public readonly api: string,\n /** The `@Endpoint` method, or `''` for a contract-level or DTO-level defect. */\n public readonly method: string,\n /** What is wrong, in one line, naming the declaration. */\n public readonly what: string,\n /** `path/to/File.ts:LINE`, workspace-relative. */\n public readonly at: string,\n /** What to do instead, in one sentence. */\n public readonly cure: string,\n /** The contract's `@ApiType` list — `svc-to-svc` when it declares none. */\n public readonly exposure: readonly string[],\n ) {}\n\n /** True when this contract feeds the PARTNER-facing document. */\n isExternal(): boolean {\n return this.exposure.includes(EXTERNAL_CUSTOMER_API_TYPE);\n }\n\n /** `Api.method` or `Api` — what a reader opens. */\n where(): string {\n return this.method === '' ? this.api : `${this.api}.${this.method}`;\n }\n}\n\n/** What ONE rule found: real defects, and disables of it that gave no reason. */\nexport class ApiRuleFindings {\n constructor(\n public readonly violations: readonly ApiContractDefect[],\n /**\n * Sites that named this rule in a disable and wrote no reason. A reasonless disable is\n * itself a violation: the point of the per-site hatch is the ARGUMENT, which is the only\n * part the next reader can weigh.\n */\n public readonly reasonlessDisables: readonly ApiContractDefect[],\n ) {}\n\n isEmpty(): boolean {\n return this.violations.length === 0 && this.reasonlessDisables.length === 0;\n }\n}\n\n/**\n * ONE endpoint declared PERMANENTLY outside MCP by `@InvalidEndpointForMcp('<reason>')` (#1014).\n *\n * Not a violation and not a suppression — a DECLARATION, which is why it is carried beside the\n * findings rather than in them. `api-rules-for-mcp` restates the whole list, with reasons, on every\n * run: an exclusion announced once at the moment somebody added it is an exclusion nobody will read\n * again, and a build-time warning at add time would be read exactly as little.\n */\nexport class McpExclusion {\n constructor(\n public readonly api: string,\n public readonly method: string,\n /** The decorator's reason, verbatim. Empty only when the argument could not be folded. */\n public readonly reason: string,\n /** `path/to/File.ts:LINE`, workspace-relative. */\n public readonly at: string,\n ) {}\n}\n\n/** Both rules' findings from ONE scan — one program build, two verdicts. */\nexport class ApiDocRulesFindings {\n constructor(\n public readonly openApi: ApiRuleFindings,\n public readonly mcp: ApiRuleFindings,\n /** Every `@InvalidEndpointForMcp` endpoint the MCP rule looked at, in declaration order. */\n public readonly mcpExclusions: readonly McpExclusion[] = [],\n ) {}\n\n // webpieces-disable no-function-outside-class -- static factory of this class\n static empty(): ApiDocRulesFindings {\n return new ApiDocRulesFindings(\n new ApiRuleFindings([], []),\n new ApiRuleFindings([], []),\n [],\n );\n }\n}\n\n/** The mode value that narrows the scan to the projects the diff touched. */\nexport const AFFECTED_PROJECT_MODE = 'AFFECTED_PROJECT';\n\n/**\n * ONE rule's switches, resolved from webpieces.config.json once per scan.\n *\n * There is NO default (#1017). Both rules are schema'd, so `webpieces.config.json` must carry an\n * entry for each or the config FAILS TO LOAD naming them — a consumer states `OFF`,\n * `AFFECTED_PROJECT` or `RUN_EVERY_TIME` out loud. The `off()` a bare constructor or a unit test\n * gets is not a default; it is what a caller that configured nothing asked for.\n */\nexport class ApiDocRule {\n constructor(\n public readonly name: string,\n public readonly enabled: boolean,\n /** Project roots this rule does not apply to — `allowedPaths` in the config. */\n public readonly allowedPaths: readonly string[],\n /**\n * Workspace-relative paths the diff touched, under `AFFECTED_PROJECT`; `null` under\n * `RUN_EVERY_TIME`, which means every project is in scope.\n *\n * `null` is also what an UNCOMPUTABLE diff resolves to — no merge-base, a shallow clone, no\n * repository at all. A diff that could not be read is not evidence that nothing changed, and\n * the only safe reading of \"I do not know what changed\" is \"look at all of it\".\n */\n public readonly changedPaths: readonly string[] | null = null,\n ) {}\n\n /** ARMED over every project — what a unit test constructs, and what RUN_EVERY_TIME resolves to. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static armed(name: string): ApiDocRule {\n return new ApiDocRule(name, true, [], null);\n }\n\n /** ARMED over the projects owning one of `changedPaths` — what AFFECTED_PROJECT resolves to. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static affected(name: string, changedPaths: readonly string[]): ApiDocRule {\n return new ApiDocRule(name, true, [], changedPaths);\n }\n\n // webpieces-disable no-function-outside-class -- static factory of this class\n static off(name: string): ApiDocRule {\n return new ApiDocRule(name, false, [], null);\n }\n\n /**\n * True when this rule scans the contracts of the project rooted at `root`.\n *\n * ONE place answers it, for both rules, so `allowedPaths` and the affected-project narrowing can\n * never be applied by one caller and skipped by another.\n */\n coversProject(root: string): boolean {\n if (!this.enabled) return false;\n if (matchesAnyGlob(root, this.allowedPaths)) return false;\n if (this.changedPaths === null) return true;\n const prefix = `${root}/`;\n return this.changedPaths.some((each: string): boolean => each.startsWith(prefix));\n }\n\n /** `mode: OFF` and the time-box/branch hatches come from RuleGate, so there is ONE reading. */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static fromConfig(workspaceRoot: string, name: string): ApiDocRule {\n if (new RuleGate().isDisabled(workspaceRoot, name, true)) {\n return ApiDocRule.off(name);\n }\n const rule = loadAndValidate(workspaceRoot).resolved.rules.get(name);\n const allowed = rule?.options['allowedPaths'];\n const allowedPaths = Array.isArray(allowed) ? (allowed as string[]) : [];\n const affected =\n rule?.options['mode'] === AFFECTED_PROJECT_MODE\n ? ApiDocRule.changedPathsOf(workspaceRoot)\n : null;\n return new ApiDocRule(name, true, allowedPaths, affected);\n }\n\n /**\n * Every path the diff touched, against the base nx itself uses (`NX_BASE`, else the merge-base\n * with origin/main). NOT ts-only and INCLUDING deletions: a deleted DTO changes what a project's\n * contracts can express exactly as an added one does, and a `project.json` edit can change which\n * project owns a contract at all.\n */\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static changedPathsOf(workspaceRoot: string): readonly string[] | null {\n const scope = new DiffScope();\n const range = scope.resolveBase(workspaceRoot);\n if (range.base === undefined) return null;\n const opts = new ChangedFilesOptions();\n opts.tsOnly = false;\n opts.includeDeletions = true;\n return scope.getChangedFiles(workspaceRoot, range.base, range.head, opts);\n }\n}\n\n/** ONE `webpieces-disable` naming a rule, and whether it gave a reason. */\nexport class DisableComment {\n constructor(public readonly hasReason: boolean) {}\n\n /**\n * The disable naming `rule` on the declaration at `line` (1-based) of `file`, or undefined.\n *\n * It walks UPWARD over the declaration's own leading trivia — blank lines, `//` comments, a\n * JSDoc block, and the decorators between them — because that is where an author writes one, and\n * it stops at the first line that is none of those, so a directive belonging to the PREVIOUS\n * declaration can never be read as covering this one.\n *\n * Only a directive NAMING this rule counts. An existing `// webpieces-disable no-any-unknown`\n * therefore does not silence these rules, which is the point: that rule answers \"is this\n * type-safe?\" and these answer \"is this field PUBLISHED with no shape?\" — different questions\n * with different right answers, so the second one wants its own, separately argued line.\n *\n * A file that cannot be read yields \"no disable\": a defect is still a defect, and inventing a\n * suppression out of an I/O failure is the one wrong answer.\n */\n // webpieces-disable no-function-outside-class -- static factory of this class\n static readAt(file: string, line: number, rule: string): DisableComment | undefined {\n const lines = DisableComment.linesOf(file);\n if (lines === undefined) return undefined;\n const start = Math.max(0, line - 1);\n const onDeclaration = DisableComment.match(lines[start] ?? '', rule);\n if (onDeclaration !== undefined) return onDeclaration;\n for (let i = start - 1; i >= 0 && i >= start - DISABLE_LOOKBACK_LINES; i--) {\n const text = (lines[i] ?? '').trim();\n const above = DisableComment.match(text, rule);\n if (above !== undefined) return above;\n if (!DisableComment.isTrivia(text)) return undefined;\n }\n return undefined;\n }\n\n /** Leading trivia a disable comment is allowed to sit above: blanks, comments and decorators. */\n // webpieces-disable no-function-outside-class -- private static predicate of this class\n private static isTrivia(text: string): boolean {\n return (\n text === '' ||\n text.startsWith('//') ||\n text.startsWith('*') ||\n text.startsWith('/*') ||\n text.startsWith('@')\n );\n }\n\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static match(text: string, rule: string): DisableComment | undefined {\n const found = text.trim().match(DISABLE_RE);\n if (found === null) return undefined;\n const named = found[1].split(',').map((each: string): string => each.trim());\n if (!named.includes(rule)) return undefined;\n return new DisableComment((found[2] ?? '').trim() !== '');\n }\n\n /** The file's lines, or undefined when it cannot be read. */\n // webpieces-disable no-function-outside-class -- private static reader of this class\n private static linesOf(file: string): string[] | undefined {\n if (!fs.existsSync(file)) return undefined;\n return fs.readFileSync(file, 'utf8').split('\\n');\n }\n}\n"]}
@@ -32,7 +32,7 @@
32
32
  */
33
33
  import { ProjectInfo } from '../project-info';
34
34
  /** The rule name, as it is written in a disable comment and as a config key. */
35
- export declare const ROOT_UNION_RULE: "no-root-union-api-type";
35
+ export declare const ROOT_UNION_RULE = "no-root-union-api-type";
36
36
  /**
37
37
  * The rule's SWITCHES, resolved from webpieces.config.json once per scan.
38
38
  *
@@ -41,7 +41,7 @@ const rules_config_1 = require("@webpieces/rules-config");
41
41
  const rule_gate_1 = require("../rule-gate");
42
42
  const api_ast_1 = require("./api-ast");
43
43
  /** The rule name, as it is written in a disable comment and as a config key. */
44
- exports.ROOT_UNION_RULE = rules_config_1.RULE_NAMES.NO_ROOT_UNION_API_TYPE;
44
+ exports.ROOT_UNION_RULE = "no-root-union-api-type";
45
45
  /**
46
46
  * `// webpieces-disable no-root-union-api-type -- <reason>`, with the reason CAPTURED so a
47
47
  * reasonless one can be told apart from an absent one. A comma list of rules is the shared spelling