@webpieces/code-rules 0.4.979 → 0.4.980

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 (55) hide show
  1. package/package.json +8 -7
  2. package/src/code-policy-registry.js +5 -0
  3. package/src/code-policy-registry.js.map +1 -1
  4. package/src/configs/ipc-configs.d.ts +158 -0
  5. package/src/configs/ipc-configs.js +206 -0
  6. package/src/configs/ipc-configs.js.map +1 -0
  7. package/src/index.d.ts +7 -0
  8. package/src/index.js +20 -1
  9. package/src/index.js.map +1 -1
  10. package/src/ipc/ipc-boundary-analyzer.d.ts +92 -0
  11. package/src/ipc/ipc-boundary-analyzer.js +371 -0
  12. package/src/ipc/ipc-boundary-analyzer.js.map +1 -0
  13. package/src/ipc/ipc-contract-inventory.d.ts +83 -0
  14. package/src/ipc/ipc-contract-inventory.js +215 -0
  15. package/src/ipc/ipc-contract-inventory.js.map +1 -0
  16. package/src/ipc/ipc-contract-shape-analyzer.d.ts +54 -0
  17. package/src/ipc/ipc-contract-shape-analyzer.js +186 -0
  18. package/src/ipc/ipc-contract-shape-analyzer.js.map +1 -0
  19. package/src/ipc/ipc-controller-resolver.d.ts +43 -0
  20. package/src/ipc/ipc-controller-resolver.js +187 -0
  21. package/src/ipc/ipc-controller-resolver.js.map +1 -0
  22. package/src/ipc/ipc-pairing-analyzer.d.ts +43 -0
  23. package/src/ipc/ipc-pairing-analyzer.js +247 -0
  24. package/src/ipc/ipc-pairing-analyzer.js.map +1 -0
  25. package/src/ipc/ipc-protocol-fingerprint.d.ts +50 -0
  26. package/src/ipc/ipc-protocol-fingerprint.js +215 -0
  27. package/src/ipc/ipc-protocol-fingerprint.js.map +1 -0
  28. package/src/ipc/ipc-protocol-recorder.d.ts +25 -0
  29. package/src/ipc/ipc-protocol-recorder.js +98 -0
  30. package/src/ipc/ipc-protocol-recorder.js.map +1 -0
  31. package/src/ipc/ipc-rule-support.d.ts +27 -0
  32. package/src/ipc/ipc-rule-support.js +76 -0
  33. package/src/ipc/ipc-rule-support.js.map +1 -0
  34. package/src/ipc/ipc-source.d.ts +96 -0
  35. package/src/ipc/ipc-source.js +239 -0
  36. package/src/ipc/ipc-source.js.map +1 -0
  37. package/src/ipc-record-protocol.d.ts +2 -0
  38. package/src/ipc-record-protocol.js +34 -0
  39. package/src/ipc-record-protocol.js.map +1 -0
  40. package/src/rule-help.js +4 -0
  41. package/src/rule-help.js.map +1 -1
  42. package/src/rule-settings.js +119 -1
  43. package/src/rule-settings.js.map +1 -1
  44. package/src/validate-ipc-boundary.d.ts +20 -0
  45. package/src/validate-ipc-boundary.js +96 -0
  46. package/src/validate-ipc-boundary.js.map +1 -0
  47. package/src/validate-ipc-contract-shape.d.ts +20 -0
  48. package/src/validate-ipc-contract-shape.js +105 -0
  49. package/src/validate-ipc-contract-shape.js.map +1 -0
  50. package/src/validate-ipc-pairing.d.ts +16 -0
  51. package/src/validate-ipc-pairing.js +71 -0
  52. package/src/validate-ipc-pairing.js.map +1 -0
  53. package/src/validate-ipc-protocol-fingerprint.d.ts +23 -0
  54. package/src/validate-ipc-protocol-fingerprint.js +79 -0
  55. package/src/validate-ipc-protocol-fingerprint.js.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/code-rules",
3
- "version": "0.4.979",
3
+ "version": "0.4.980",
4
4
  "description": "Standalone code validation rules extracted from architecture-validators, no Nx dependency required",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -16,19 +16,19 @@
16
16
  "directory": "packages/tooling/code-rules"
17
17
  },
18
18
  "dependencies": {
19
- "@webpieces/rules-config": "0.4.979",
19
+ "@webpieces/rules-config": "0.4.980",
20
20
  "@inversifyjs/binding-decorators": "1.1.5",
21
21
  "inversify": "7.10.4",
22
22
  "reflect-metadata": "0.2.2",
23
- "@webpieces/tooling-common": "0.4.979",
24
- "@webpieces/repo-workflow-core": "0.4.979",
25
- "@webpieces/rules-sdk": "0.4.979"
23
+ "@webpieces/tooling-common": "0.4.980",
24
+ "@webpieces/repo-workflow-core": "0.4.980",
25
+ "@webpieces/rules-sdk": "0.4.980"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
30
  "devDependencies": {
31
- "@webpieces/tooling-testkit": "0.4.979"
31
+ "@webpieces/tooling-testkit": "0.4.980"
32
32
  },
33
33
  "exports": {
34
34
  ".": "./src/index.js",
@@ -39,6 +39,7 @@
39
39
  "bin": {
40
40
  "wp-validate-code": "./src/cli.js",
41
41
  "wp-ci": "./src/wp-ci.js",
42
- "wp-prune-unknown-config": "./src/prune-unknown-config.js"
42
+ "wp-prune-unknown-config": "./src/prune-unknown-config.js",
43
+ "wp-ipc-record-protocol": "./src/ipc-record-protocol.js"
43
44
  }
44
45
  }
@@ -42,6 +42,7 @@ const no_utility_types_config_1 = require("./configs/no-utility-types-config");
42
42
  const required_type_suffix_config_1 = require("./configs/required-type-suffix-config");
43
43
  const tag_truth_configs_1 = require("./configs/tag-truth-configs");
44
44
  const catch_must_propagate_config_1 = require("./configs/catch-must-propagate-config");
45
+ const ipc_configs_1 = require("./configs/ipc-configs");
45
46
  class CodePolicy {
46
47
  configClass;
47
48
  ruleId;
@@ -93,5 +94,9 @@ exports.CODE_POLICIES = [
93
94
  new CodePolicy(required_type_suffix_config_1.RequiredTypeSuffixConfig, 'required-type-suffix', async () => (await Promise.resolve().then(() => __importStar(require('./validate-required-type-suffix')))).RequiredTypeSuffixValidator, required_type_suffix_config_1.RequiredTypeSuffixConfig.SCHEMA),
94
95
  new CodePolicy(tag_truth_configs_1.FrameworkTsconfigConfig, 'framework-tsconfig', async () => (await Promise.resolve().then(() => __importStar(require('./validate-framework-tsconfig')))).FrameworkTsconfigValidator, tag_truth_configs_1.FrameworkTsconfigConfig.SCHEMA),
95
96
  new CodePolicy(tag_truth_configs_1.FrameworkPackagesConfig, 'framework-packages', async () => (await Promise.resolve().then(() => __importStar(require('./validate-framework-packages')))).FrameworkPackagesValidator, tag_truth_configs_1.FrameworkPackagesConfig.SCHEMA),
97
+ new CodePolicy(ipc_configs_1.IpcBoundaryConfig, 'ipc-boundary', async () => (await Promise.resolve().then(() => __importStar(require('./validate-ipc-boundary')))).IpcBoundaryValidator, ipc_configs_1.IpcBoundaryConfig.SCHEMA),
98
+ new CodePolicy(ipc_configs_1.IpcContractShapeConfig, 'ipc-contract-shape', async () => (await Promise.resolve().then(() => __importStar(require('./validate-ipc-contract-shape')))).IpcContractShapeValidator, ipc_configs_1.IpcContractShapeConfig.SCHEMA),
99
+ new CodePolicy(ipc_configs_1.IpcPairingConfig, 'ipc-pairing', async () => (await Promise.resolve().then(() => __importStar(require('./validate-ipc-pairing')))).IpcPairingValidator, ipc_configs_1.IpcPairingConfig.SCHEMA),
100
+ new CodePolicy(ipc_configs_1.IpcProtocolFingerprintConfig, 'ipc-protocol-fingerprint', async () => (await Promise.resolve().then(() => __importStar(require('./validate-ipc-protocol-fingerprint')))).IpcProtocolFingerprintValidator, ipc_configs_1.IpcProtocolFingerprintConfig.SCHEMA),
96
101
  ];
97
102
  //# sourceMappingURL=code-policy-registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-policy-registry.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/code-policy-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAqBgC;AAChC,mFAAkG;AAClG,2EAAgF;AAChF,iFAG4C;AAC5C,+EAAiF;AACjF,uFAAiF;AACjF,mEAA+F;AAC/F,uFAAiF;AAOjF,MAAa,UAAU;IAGN;IACA;IACA;IACA;IALb,yDAAyD;IACzD,YACa,WAAuB,EACvB,MAAc,EACd,aAA2C,EAC3C,MAA0C;QAH1C,gBAAW,GAAX,WAAW,CAAY;QACvB,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAA8B;QAC3C,WAAM,GAAN,MAAM,CAAoC;IACpD,CAAC;CACP;AARD,gCAQC;A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wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,uDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,wDAA6B,EAC7B,8BAA8B,EAC9B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,yCAAyC,GAAC,CAAC;SACpD,gCAAgC,EACzC,wDAA6B,CAAC,MAAM,CACvC;IACD,IAAI,UAAU,CACV,sDAA4B,EAC5B,6BAA6B,EAC7B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,sDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,sDAAwB,EACxB,sBAAsB,EACtB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,iCAAiC,GAAC,CAAC,CAAC,2BAA2B,EACzF,sDAAwB,CAAC,MAAM,CAClC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;CACJ,CAAC","sourcesContent":["import { BaseRuleConfig, FieldDef, BuildPolicy } from '@webpieces/rules-sdk';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n CatchErrorPatternConfig,\n NoUnmanagedExceptionsConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n} from './configs/rule-configs';\nimport { NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nimport { NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nimport {\n NoInlineImportInApiLibConfig,\n OneEnumSpellingInApiLibConfig,\n} from './configs/api-lib-spelling-configs';\nimport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nimport { RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nimport { FrameworkTsconfigConfig, FrameworkPackagesConfig } from './configs/tag-truth-configs';\nimport { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';\n\n/** The owner entry declares both its schema token and executable validator. */\nexport type ConfigCtor = new () => BaseRuleConfig;\n\nexport type ValidatorCtor = new (...args: never[]) => BuildPolicy;\n\nexport class CodePolicy {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly configClass: ConfigCtor,\n readonly ruleId: string,\n readonly loadValidator: () => Promise<ValidatorCtor>,\n readonly schema: Readonly<Record<string, FieldDef>>,\n ) {}\n}\n\nexport const CODE_POLICIES: readonly CodePolicy[] = [\n new CodePolicy(\n MaxMethodLinesConfig,\n 'max-method-lines',\n async () => (await import('./validate-modified-methods')).MaxMethodLinesValidator,\n MaxMethodLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n MaxFileLinesConfig,\n 'max-file-lines',\n async () => (await import('./validate-modified-files')).MaxFileLinesValidator,\n MaxFileLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n RequireReturnTypeConfig,\n 'require-return-type',\n async () => (await import('./validate-return-types')).RequireReturnTypeValidator,\n RequireReturnTypeConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineTypeLiteralsConfig,\n 'no-inline-type-literals',\n async () => (await import('./validate-no-inline-types')).NoInlineTypeLiteralsValidator,\n NoInlineTypeLiteralsConfig.SCHEMA,\n ),\n new CodePolicy(\n NoAnyUnknownConfig,\n 'no-any-unknown',\n async () => (await import('./validate-no-any-unknown')).NoAnyUnknownValidator,\n NoAnyUnknownConfig.SCHEMA,\n ),\n new CodePolicy(\n NoImplicitAnyConfig,\n 'no-implicit-any',\n async () => (await import('./validate-no-implicit-any')).NoImplicitAnyValidator,\n NoImplicitAnyConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaValidateDtosConfig,\n 'prisma-validate-dtos',\n async () => (await import('./validate-dtos')).PrismaValidateDtosValidator,\n PrismaValidateDtosConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaConverterConfig,\n 'prisma-converter',\n async () => (await import('./validate-prisma-converters')).PrismaConverterValidator,\n PrismaConverterConfig.SCHEMA,\n ),\n new CodePolicy(\n NoDestructureConfig,\n 'no-destructure',\n async () => (await import('./validate-no-destructure')).NoDestructureValidator,\n NoDestructureConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchErrorPatternConfig,\n 'catch-error-pattern',\n async () => (await import('./validate-catch-error-pattern')).CatchErrorPatternValidator,\n CatchErrorPatternConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUnmanagedExceptionsConfig,\n 'no-unmanaged-exceptions',\n async () =>\n (await import('./validate-no-unmanaged-exceptions')).NoUnmanagedExceptionsValidator,\n NoUnmanagedExceptionsConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchMustPropagateConfig,\n 'catch-must-propagate',\n async () => (await import('./validate-catch-must-propagate')).CatchMustPropagateValidator,\n CatchMustPropagateConfig.SCHEMA,\n ),\n new CodePolicy(\n AngularNoDirectApiInResolverConfig,\n 'angular-no-direct-api-in-resolver',\n async () =>\n (await import('./validate-no-direct-api-resolver')).NoDirectApiResolverValidator,\n AngularNoDirectApiInResolverConfig.SCHEMA,\n ),\n new CodePolicy(\n NoSymbolDiTokensConfig,\n 'no-symbol-di-tokens',\n async () => (await import('./validate-no-symbol-di-tokens')).NoSymbolDiTokensValidator,\n NoSymbolDiTokensConfig.SCHEMA,\n ),\n new CodePolicy(\n NoClientCreationOutsideServerOrClientConfig,\n 'no-client-creation-outside-server-or-client',\n async () =>\n (await import('./validate-no-client-creation-outside-server-or-client'))\n .NoClientCreationOutsideServerOrClientValidator,\n NoClientCreationOutsideServerOrClientConfig.SCHEMA,\n ),\n new CodePolicy(\n NoCustomCssConfig,\n 'no-custom-css',\n async () => (await import('./validate-no-custom-css')).NoCustomCssValidator,\n NoCustomCssConfig.SCHEMA,\n ),\n new CodePolicy(\n NoStatePathsInTemplatesConfig,\n 'no-state-paths-in-templates',\n async () =>\n (await import('./validate-no-state-paths-in-templates'))\n .NoStatePathsInTemplatesValidator,\n NoStatePathsInTemplatesConfig.SCHEMA,\n ),\n new CodePolicy(\n NoProcessExitOutsideMainConfig,\n 'no-process-exit-outside-main',\n async () =>\n (await import('./validate-no-process-exit-outside-main'))\n .NoProcessExitOutsideMainValidator,\n NoProcessExitOutsideMainConfig.SCHEMA,\n ),\n new CodePolicy(\n NoFunctionOutsideClassConfig,\n 'no-function-outside-class',\n async () =>\n (await import('./validate-no-function-outside-class')).NoFunctionOutsideClassValidator,\n NoFunctionOutsideClassConfig.SCHEMA,\n ),\n new CodePolicy(\n InjectAnnotationNotNeededForConcreteClassConfig,\n 'inject-annotation-not-needed-for-concrete-class',\n async () =>\n (await import('./validate-inject-annotation-not-needed-for-concrete-class'))\n .InjectAnnotationNotNeededForConcreteClassValidator,\n InjectAnnotationNotNeededForConcreteClassConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTagConfig,\n 'framework-tag',\n async () => (await import('./validate-framework-tag')).FrameworkTagValidator,\n FrameworkTagConfig.SCHEMA,\n ),\n new CodePolicy(\n RoleTagConfig,\n 'role-tag',\n async () => (await import('./validate-role-tag')).RoleTagValidator,\n RoleTagConfig.SCHEMA,\n ),\n new CodePolicy(\n EnsureWeAreSecureConfig,\n 'ensure-we-are-secure',\n async () => (await import('./validate-ensure-we-are-secure')).EnsureWeAreSecureValidator,\n EnsureWeAreSecureConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineImportInApiLibConfig,\n 'no-inline-import-in-api-lib',\n async () =>\n (await import('./validate-no-inline-import-in-api-lib'))\n .NoInlineImportInApiLibValidator,\n NoInlineImportInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n OneEnumSpellingInApiLibConfig,\n 'one-enum-spelling-in-api-lib',\n async () =>\n (await import('./validate-one-enum-spelling-in-api-lib'))\n .OneEnumSpellingInApiLibValidator,\n OneEnumSpellingInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUtilityTypesInApiLibConfig,\n 'no-utility-types-in-api-lib',\n async () =>\n (await import('./validate-no-utility-types-in-api-lib'))\n .NoUtilityTypesInApiLibValidator,\n NoUtilityTypesInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n RequiredTypeSuffixConfig,\n 'required-type-suffix',\n async () => (await import('./validate-required-type-suffix')).RequiredTypeSuffixValidator,\n RequiredTypeSuffixConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTsconfigConfig,\n 'framework-tsconfig',\n async () => (await import('./validate-framework-tsconfig')).FrameworkTsconfigValidator,\n FrameworkTsconfigConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkPackagesConfig,\n 'framework-packages',\n async () => (await import('./validate-framework-packages')).FrameworkPackagesValidator,\n FrameworkPackagesConfig.SCHEMA,\n ),\n];\n"]}
1
+ {"version":3,"file":"code-policy-registry.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/code-policy-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAqBgC;AAChC,mFAAkG;AAClG,2EAAgF;AAChF,iFAG4C;AAC5C,+EAAiF;AACjF,uFAAiF;AACjF,mEAA+F;AAC/F,uFAAiF;AACjF,uDAK+B;AAO/B,MAAa,UAAU;IAGN;IACA;IACA;IACA;IALb,yDAAyD;IACzD,YACa,WAAuB,EACvB,MAAc,EACd,aAA2C,EAC3C,MAA0C;QAH1C,gB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Aa,+BAA+B,GAAC,CAAC,CAAC,yBAAyB,EACrF,oCAAsB,CAAC,MAAM,CAChC;IACD,IAAI,UAAU,CACV,8BAAgB,EAChB,aAAa,EACb,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,wBAAwB,GAAC,CAAC,CAAC,mBAAmB,EACxE,8BAAgB,CAAC,MAAM,CAC1B;IACD,IAAI,UAAU,CACV,0CAA4B,EAC5B,0BAA0B,EAC1B,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,qCAAqC,GAAC,CAAC,CAAC,+BAA+B,EACjG,0CAA4B,CAAC,MAAM,CACtC;CACJ,CAAC","sourcesContent":["import { BaseRuleConfig, FieldDef, BuildPolicy } from '@webpieces/rules-sdk';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n CatchErrorPatternConfig,\n NoUnmanagedExceptionsConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n} from './configs/rule-configs';\nimport { NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nimport { NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nimport {\n NoInlineImportInApiLibConfig,\n OneEnumSpellingInApiLibConfig,\n} from './configs/api-lib-spelling-configs';\nimport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nimport { RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nimport { FrameworkTsconfigConfig, FrameworkPackagesConfig } from './configs/tag-truth-configs';\nimport { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';\nimport {\n IpcBoundaryConfig,\n IpcContractShapeConfig,\n IpcPairingConfig,\n IpcProtocolFingerprintConfig,\n} from './configs/ipc-configs';\n\n/** The owner entry declares both its schema token and executable validator. */\nexport type ConfigCtor = new () => BaseRuleConfig;\n\nexport type ValidatorCtor = new (...args: never[]) => BuildPolicy;\n\nexport class CodePolicy {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly configClass: ConfigCtor,\n readonly ruleId: string,\n readonly loadValidator: () => Promise<ValidatorCtor>,\n readonly schema: Readonly<Record<string, FieldDef>>,\n ) {}\n}\n\nexport const CODE_POLICIES: readonly CodePolicy[] = [\n new CodePolicy(\n MaxMethodLinesConfig,\n 'max-method-lines',\n async () => (await import('./validate-modified-methods')).MaxMethodLinesValidator,\n MaxMethodLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n MaxFileLinesConfig,\n 'max-file-lines',\n async () => (await import('./validate-modified-files')).MaxFileLinesValidator,\n MaxFileLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n RequireReturnTypeConfig,\n 'require-return-type',\n async () => (await import('./validate-return-types')).RequireReturnTypeValidator,\n RequireReturnTypeConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineTypeLiteralsConfig,\n 'no-inline-type-literals',\n async () => (await import('./validate-no-inline-types')).NoInlineTypeLiteralsValidator,\n NoInlineTypeLiteralsConfig.SCHEMA,\n ),\n new CodePolicy(\n NoAnyUnknownConfig,\n 'no-any-unknown',\n async () => (await import('./validate-no-any-unknown')).NoAnyUnknownValidator,\n NoAnyUnknownConfig.SCHEMA,\n ),\n new CodePolicy(\n NoImplicitAnyConfig,\n 'no-implicit-any',\n async () => (await import('./validate-no-implicit-any')).NoImplicitAnyValidator,\n NoImplicitAnyConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaValidateDtosConfig,\n 'prisma-validate-dtos',\n async () => (await import('./validate-dtos')).PrismaValidateDtosValidator,\n PrismaValidateDtosConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaConverterConfig,\n 'prisma-converter',\n async () => (await import('./validate-prisma-converters')).PrismaConverterValidator,\n PrismaConverterConfig.SCHEMA,\n ),\n new CodePolicy(\n NoDestructureConfig,\n 'no-destructure',\n async () => (await import('./validate-no-destructure')).NoDestructureValidator,\n NoDestructureConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchErrorPatternConfig,\n 'catch-error-pattern',\n async () => (await import('./validate-catch-error-pattern')).CatchErrorPatternValidator,\n CatchErrorPatternConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUnmanagedExceptionsConfig,\n 'no-unmanaged-exceptions',\n async () =>\n (await import('./validate-no-unmanaged-exceptions')).NoUnmanagedExceptionsValidator,\n NoUnmanagedExceptionsConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchMustPropagateConfig,\n 'catch-must-propagate',\n async () => (await import('./validate-catch-must-propagate')).CatchMustPropagateValidator,\n CatchMustPropagateConfig.SCHEMA,\n ),\n new CodePolicy(\n AngularNoDirectApiInResolverConfig,\n 'angular-no-direct-api-in-resolver',\n async () =>\n (await import('./validate-no-direct-api-resolver')).NoDirectApiResolverValidator,\n AngularNoDirectApiInResolverConfig.SCHEMA,\n ),\n new CodePolicy(\n NoSymbolDiTokensConfig,\n 'no-symbol-di-tokens',\n async () => (await import('./validate-no-symbol-di-tokens')).NoSymbolDiTokensValidator,\n NoSymbolDiTokensConfig.SCHEMA,\n ),\n new CodePolicy(\n NoClientCreationOutsideServerOrClientConfig,\n 'no-client-creation-outside-server-or-client',\n async () =>\n (await import('./validate-no-client-creation-outside-server-or-client'))\n .NoClientCreationOutsideServerOrClientValidator,\n NoClientCreationOutsideServerOrClientConfig.SCHEMA,\n ),\n new CodePolicy(\n NoCustomCssConfig,\n 'no-custom-css',\n async () => (await import('./validate-no-custom-css')).NoCustomCssValidator,\n NoCustomCssConfig.SCHEMA,\n ),\n new CodePolicy(\n NoStatePathsInTemplatesConfig,\n 'no-state-paths-in-templates',\n async () =>\n (await import('./validate-no-state-paths-in-templates'))\n .NoStatePathsInTemplatesValidator,\n NoStatePathsInTemplatesConfig.SCHEMA,\n ),\n new CodePolicy(\n NoProcessExitOutsideMainConfig,\n 'no-process-exit-outside-main',\n async () =>\n (await import('./validate-no-process-exit-outside-main'))\n .NoProcessExitOutsideMainValidator,\n NoProcessExitOutsideMainConfig.SCHEMA,\n ),\n new CodePolicy(\n NoFunctionOutsideClassConfig,\n 'no-function-outside-class',\n async () =>\n (await import('./validate-no-function-outside-class')).NoFunctionOutsideClassValidator,\n NoFunctionOutsideClassConfig.SCHEMA,\n ),\n new CodePolicy(\n InjectAnnotationNotNeededForConcreteClassConfig,\n 'inject-annotation-not-needed-for-concrete-class',\n async () =>\n (await import('./validate-inject-annotation-not-needed-for-concrete-class'))\n .InjectAnnotationNotNeededForConcreteClassValidator,\n InjectAnnotationNotNeededForConcreteClassConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTagConfig,\n 'framework-tag',\n async () => (await import('./validate-framework-tag')).FrameworkTagValidator,\n FrameworkTagConfig.SCHEMA,\n ),\n new CodePolicy(\n RoleTagConfig,\n 'role-tag',\n async () => (await import('./validate-role-tag')).RoleTagValidator,\n RoleTagConfig.SCHEMA,\n ),\n new CodePolicy(\n EnsureWeAreSecureConfig,\n 'ensure-we-are-secure',\n async () => (await import('./validate-ensure-we-are-secure')).EnsureWeAreSecureValidator,\n EnsureWeAreSecureConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineImportInApiLibConfig,\n 'no-inline-import-in-api-lib',\n async () =>\n (await import('./validate-no-inline-import-in-api-lib'))\n .NoInlineImportInApiLibValidator,\n NoInlineImportInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n OneEnumSpellingInApiLibConfig,\n 'one-enum-spelling-in-api-lib',\n async () =>\n (await import('./validate-one-enum-spelling-in-api-lib'))\n .OneEnumSpellingInApiLibValidator,\n OneEnumSpellingInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUtilityTypesInApiLibConfig,\n 'no-utility-types-in-api-lib',\n async () =>\n (await import('./validate-no-utility-types-in-api-lib'))\n .NoUtilityTypesInApiLibValidator,\n NoUtilityTypesInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n RequiredTypeSuffixConfig,\n 'required-type-suffix',\n async () => (await import('./validate-required-type-suffix')).RequiredTypeSuffixValidator,\n RequiredTypeSuffixConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTsconfigConfig,\n 'framework-tsconfig',\n async () => (await import('./validate-framework-tsconfig')).FrameworkTsconfigValidator,\n FrameworkTsconfigConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkPackagesConfig,\n 'framework-packages',\n async () => (await import('./validate-framework-packages')).FrameworkPackagesValidator,\n FrameworkPackagesConfig.SCHEMA,\n ),\n new CodePolicy(\n IpcBoundaryConfig,\n 'ipc-boundary',\n async () => (await import('./validate-ipc-boundary')).IpcBoundaryValidator,\n IpcBoundaryConfig.SCHEMA,\n ),\n new CodePolicy(\n IpcContractShapeConfig,\n 'ipc-contract-shape',\n async () => (await import('./validate-ipc-contract-shape')).IpcContractShapeValidator,\n IpcContractShapeConfig.SCHEMA,\n ),\n new CodePolicy(\n IpcPairingConfig,\n 'ipc-pairing',\n async () => (await import('./validate-ipc-pairing')).IpcPairingValidator,\n IpcPairingConfig.SCHEMA,\n ),\n new CodePolicy(\n IpcProtocolFingerprintConfig,\n 'ipc-protocol-fingerprint',\n async () => (await import('./validate-ipc-protocol-fingerprint')).IpcProtocolFingerprintValidator,\n IpcProtocolFingerprintConfig.SCHEMA,\n ),\n];\n"]}
@@ -0,0 +1,158 @@
1
+ import { SchemaShape, BaseRuleConfig } from '@webpieces/rules-sdk';
2
+ /**
3
+ * The four `@webpieces/ipc-bridge` guard rules (#1389). They replace a consumer's standalone script that
4
+ * built ONE TypeScript program over every source file of a monorepo (and ran out of memory doing it):
5
+ *
6
+ * ipc-boundary — per FILE, syntax only: who may touch raw IPC, the factories and the WebView
7
+ * ipc-contract-shape — per FILE, syntax only: the shape of every directional API in the contract lib
8
+ * ipc-pairing — per IPC PROJECT SET: every API has a generated client at its sender and exactly
9
+ * one registration at its receiver, whose controller extends that same API
10
+ * ipc-protocol-fingerprint — per IPC PROJECT SET: the recorded wire fingerprint, compared with the branch
11
+ * base so an unversioned contract change fails
12
+ *
13
+ * The only type-checked program any of them builds is rooted at the configured `contractPaths` files
14
+ * alone, so memory follows the size of the contract library, never the size of the repo.
15
+ *
16
+ * Every field that names a consumer path or decides what is refused is REQUIRED with no default
17
+ * (`.claude/rules/no-rule-defaults.md`); every glob is workspace-relative (`**` any depth, `*` one segment).
18
+ * A list that may legitimately be empty (no retired modules) is still required, so the choice is visible.
19
+ */
20
+ /** Per-file IPC rules judge whole files: the changed ones, every file of a touched project, or all of them. */
21
+ export declare const IPC_FILE_MODES: readonly ["OFF", "NEW_AND_MODIFIED_FILES", "MODIFIED_PROJECTS", "RUN_EVERY_TIME"];
22
+ export type IpcFileMode = typeof IPC_FILE_MODES[number];
23
+ /**
24
+ * Project-scoped IPC rules judge the configured IPC file set as a whole: whenever a project owning one of
25
+ * those files is touched (MODIFIED_PROJECTS), or on every run (RUN_EVERY_TIME).
26
+ */
27
+ export declare const IPC_PROJECT_MODES: readonly ["OFF", "MODIFIED_PROJECTS", "RUN_EVERY_TIME"];
28
+ export type IpcProjectMode = typeof IPC_PROJECT_MODES[number];
29
+ /** What `ipc-protocol-fingerprint` does when the branch base (merge-base with main) cannot be found. */
30
+ export declare const IPC_WITHOUT_BASELINE: readonly ["FAIL", "VERIFY_COMMITTED"];
31
+ export type IpcWithoutBaseline = typeof IPC_WITHOUT_BASELINE[number];
32
+ /**
33
+ * `ipc-boundary` — "nobody else may". Judged one file at a time from that file's syntax tree; an alias is
34
+ * followed only inside the file (`import { IpcClientFactory as F }`, `const alias = webView`).
35
+ *
36
+ * - `tsconfigPath` — the tsconfig whose `paths`/`baseUrl` resolve a non-relative import (read without
37
+ * enumerating the repo's files).
38
+ * - `transportFiles` — globs of the modules that own raw delivery and `IpcConnection` lifetimes (the shell
39
+ * transport, a WebView delivery layer). A transport file is ALSO a composition file.
40
+ * - `compositionFiles` — globs of the modules that may build `IpcClientFactory` / `IpcServerFactory`, call
41
+ * `createClient` / `create` / `createScoped` / `withContext`, and import `@webpieces/ipc-bridge`.
42
+ * - `bootstrapFiles` — globs of the protocol-discovery modules that may send the one raw discovery message.
43
+ * - `testOnlyModuleSuffixes` — module specifier suffixes (e.g. `.spec-support`) production code may not import.
44
+ * - `retiredModules` — module specifiers nobody may import or `require` (a retired vendor bus).
45
+ * - `retiredIdentifiers` — identifiers nobody may write (a retired raw request helper).
46
+ * - `forbiddenClassNamePatterns` — regular expressions a class name may not match (handwritten wire clients).
47
+ * - `legacyWireFile` — the file declaring the legacy raw wire constants, whose exported constants transport
48
+ * and bootstrap files may not import; `null` when there is none.
49
+ * - `bootstrapAllowedLegacyNames` — the legacy constants a bootstrap file MAY import (the discovery message).
50
+ * - `legacyWireCommandPrefixes` — string-literal prefixes of legacy feature wire commands that transport and
51
+ * bootstrap files may not author.
52
+ */
53
+ export declare class IpcBoundaryConfig extends BaseRuleConfig {
54
+ mode?: IpcFileMode;
55
+ tsconfigPath: string;
56
+ transportFiles: string[];
57
+ compositionFiles: string[];
58
+ bootstrapFiles: string[];
59
+ testOnlyModuleSuffixes: string[];
60
+ retiredModules: string[];
61
+ retiredIdentifiers: string[];
62
+ forbiddenClassNamePatterns: string[];
63
+ legacyWireFile: string | null;
64
+ bootstrapAllowedLegacyNames: string[];
65
+ legacyWireCommandPrefixes: string[];
66
+ static readonly SCHEMA: SchemaShape<IpcBoundaryConfig>;
67
+ }
68
+ /**
69
+ * `ipc-contract-shape` — every directional API in the `api:ipc-contract` library, judged one file at a time:
70
+ * class-level `@WpInternal('<id>')`, and on every method `@WpIpcEndpoint('<id>')` (with a literal `kind` when
71
+ * given) plus `@MaskLog(...)`, ONE required parameter typed by a named DTO, an explicit `Promise<…>` return,
72
+ * and unique ids. Contract files may not import host/factory packages or endpoint/runtime code.
73
+ *
74
+ * - `tsconfigPath` — resolves the contract's non-relative imports for `forbiddenImportPaths`.
75
+ * - `contractPaths` — globs of the contract library's source files (the files this rule judges).
76
+ * - `apiClassSuffixes` — class-name suffixes that make a class a directional API (`ToNativeApi`).
77
+ * - `requiredProjectTags` — tags the project owning a contract file must carry (`api:ipc-contract`, …).
78
+ * - `forbiddenImportModules` — globs over a contract import's MODULE SPECIFIER (`@angular/*`, `react`).
79
+ * - `forbiddenImportPaths` — globs over the workspace path a contract import RESOLVES to (`services/**`).
80
+ */
81
+ export declare class IpcContractShapeConfig extends BaseRuleConfig {
82
+ mode?: IpcFileMode;
83
+ tsconfigPath: string;
84
+ contractPaths: string[];
85
+ apiClassSuffixes: string[];
86
+ requiredProjectTags: string[];
87
+ forbiddenImportModules: string[];
88
+ forbiddenImportPaths: string[];
89
+ static readonly SCHEMA: SchemaShape<IpcContractShapeConfig>;
90
+ }
91
+ /** One direction of the bridge: which APIs travel it, who sends, who receives. Data-only. */
92
+ export declare class IpcDirectionEntry {
93
+ /** Class-name suffix of the APIs in this direction, e.g. `ToNativeApi`. */
94
+ apiSuffix: string;
95
+ /** The `direction` value the wire table carries for these APIs, e.g. `native`. */
96
+ wireDirection: string;
97
+ /** Globs of the sending endpoint's files; one of them must hold `createClient(<Api>)`. */
98
+ senderFiles: string[];
99
+ /** Globs of the receiving endpoint's files; exactly one `create`/`createScoped(<Api>, …)` lives here. */
100
+ receiverFiles: string[];
101
+ static readonly SCHEMA: SchemaShape<IpcDirectionEntry>;
102
+ }
103
+ /**
104
+ * `ipc-pairing` — every directional API has a generated client at its sending endpoint and exactly ONE
105
+ * framework registration at its receiver, whose controller is a subclass of that same shared abstract API;
106
+ * no handwritten dispatch map sits beside the factory. With a wire table configured, every table row names
107
+ * a real API method, wires are unique, kinds/since/direction are sane and agree with the decorators.
108
+ *
109
+ * The contract side is read through a type-checked program rooted at `contractPaths` ONLY; the endpoint
110
+ * side is read syntactically from `senderFiles` / `receiverFiles` and the files their controllers come from.
111
+ *
112
+ * - `tsconfigPath`, `contractPaths` — as for `ipc-contract-shape`.
113
+ * - `directions` — one entry per direction of the bridge (see {@link IpcDirectionEntry}).
114
+ * - `wireTableFile` / `wireTableExport` — the file and exported const of a literal wire table
115
+ * (`[{ api, method, wire, direction, kind, since }]`); both `null` when the contract has none.
116
+ * - `forbiddenDispatchVariables` — variable names a receiver file may not initialise with `new …`
117
+ * (the handwritten dispatch map the factory replaced).
118
+ */
119
+ export declare class IpcPairingConfig extends BaseRuleConfig {
120
+ mode?: IpcProjectMode;
121
+ tsconfigPath: string;
122
+ contractPaths: string[];
123
+ directions: IpcDirectionEntry[];
124
+ wireTableFile: string | null;
125
+ wireTableExport: string | null;
126
+ forbiddenDispatchVariables: string[];
127
+ static readonly SCHEMA: SchemaShape<IpcPairingConfig>;
128
+ }
129
+ /**
130
+ * `ipc-protocol-fingerprint` — `manifestPath` records `{ protocol, fingerprint }`: a sha256 over every API /
131
+ * method id, kind, wire row (direction, since), the fully resolved request and reply shapes, and the
132
+ * comment-free printed source of `normalizedSourceFiles` (decorators, masks, validators). The rule fails
133
+ * when the committed manifest does not match the source, when the protocol decreased relative to the branch
134
+ * base, or when the fingerprint changed relative to the branch base without a protocol increment — so
135
+ * re-recording the manifest alone cannot hide an unversioned wire change. Re-record with
136
+ * `pnpm wp-ipc-record-protocol` after incrementing the version constant.
137
+ *
138
+ * - `tsconfigPath`, `contractPaths`, `apiClassSuffixes`, `wireTableFile`, `wireTableExport` — as above.
139
+ * - `normalizedSourceFiles` — globs, hashed in the order listed (files matching one glob sorted by path).
140
+ * - `manifestPath` — the committed manifest, workspace-relative.
141
+ * - `versionFile` / `versionConstant` — where the protocol integer is declared (`export const X = 18;`).
142
+ * - `withoutBaseline` — FAIL (an ordinary clone with no reachable main) or VERIFY_COMMITTED (an archive or
143
+ * shallow build checkout: still verify the manifest against the source, skip the increment check).
144
+ */
145
+ export declare class IpcProtocolFingerprintConfig extends BaseRuleConfig {
146
+ mode?: IpcProjectMode;
147
+ tsconfigPath: string;
148
+ contractPaths: string[];
149
+ apiClassSuffixes: string[];
150
+ wireTableFile: string | null;
151
+ wireTableExport: string | null;
152
+ normalizedSourceFiles: string[];
153
+ manifestPath: string;
154
+ versionFile: string;
155
+ versionConstant: string;
156
+ withoutBaseline: IpcWithoutBaseline;
157
+ static readonly SCHEMA: SchemaShape<IpcProtocolFingerprintConfig>;
158
+ }
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IpcProtocolFingerprintConfig = exports.IpcPairingConfig = exports.IpcDirectionEntry = exports.IpcContractShapeConfig = exports.IpcBoundaryConfig = exports.IPC_WITHOUT_BASELINE = exports.IPC_PROJECT_MODES = exports.IPC_FILE_MODES = void 0;
4
+ const rules_sdk_1 = require("@webpieces/rules-sdk");
5
+ /**
6
+ * The four `@webpieces/ipc-bridge` guard rules (#1389). They replace a consumer's standalone script that
7
+ * built ONE TypeScript program over every source file of a monorepo (and ran out of memory doing it):
8
+ *
9
+ * ipc-boundary — per FILE, syntax only: who may touch raw IPC, the factories and the WebView
10
+ * ipc-contract-shape — per FILE, syntax only: the shape of every directional API in the contract lib
11
+ * ipc-pairing — per IPC PROJECT SET: every API has a generated client at its sender and exactly
12
+ * one registration at its receiver, whose controller extends that same API
13
+ * ipc-protocol-fingerprint — per IPC PROJECT SET: the recorded wire fingerprint, compared with the branch
14
+ * base so an unversioned contract change fails
15
+ *
16
+ * The only type-checked program any of them builds is rooted at the configured `contractPaths` files
17
+ * alone, so memory follows the size of the contract library, never the size of the repo.
18
+ *
19
+ * Every field that names a consumer path or decides what is refused is REQUIRED with no default
20
+ * (`.claude/rules/no-rule-defaults.md`); every glob is workspace-relative (`**` any depth, `*` one segment).
21
+ * A list that may legitimately be empty (no retired modules) is still required, so the choice is visible.
22
+ */
23
+ /** Per-file IPC rules judge whole files: the changed ones, every file of a touched project, or all of them. */
24
+ exports.IPC_FILE_MODES = ['OFF', 'NEW_AND_MODIFIED_FILES', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'];
25
+ /**
26
+ * Project-scoped IPC rules judge the configured IPC file set as a whole: whenever a project owning one of
27
+ * those files is touched (MODIFIED_PROJECTS), or on every run (RUN_EVERY_TIME).
28
+ */
29
+ exports.IPC_PROJECT_MODES = ['OFF', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'];
30
+ /** What `ipc-protocol-fingerprint` does when the branch base (merge-base with main) cannot be found. */
31
+ exports.IPC_WITHOUT_BASELINE = ['FAIL', 'VERIFY_COMMITTED'];
32
+ /**
33
+ * `ipc-boundary` — "nobody else may". Judged one file at a time from that file's syntax tree; an alias is
34
+ * followed only inside the file (`import { IpcClientFactory as F }`, `const alias = webView`).
35
+ *
36
+ * - `tsconfigPath` — the tsconfig whose `paths`/`baseUrl` resolve a non-relative import (read without
37
+ * enumerating the repo's files).
38
+ * - `transportFiles` — globs of the modules that own raw delivery and `IpcConnection` lifetimes (the shell
39
+ * transport, a WebView delivery layer). A transport file is ALSO a composition file.
40
+ * - `compositionFiles` — globs of the modules that may build `IpcClientFactory` / `IpcServerFactory`, call
41
+ * `createClient` / `create` / `createScoped` / `withContext`, and import `@webpieces/ipc-bridge`.
42
+ * - `bootstrapFiles` — globs of the protocol-discovery modules that may send the one raw discovery message.
43
+ * - `testOnlyModuleSuffixes` — module specifier suffixes (e.g. `.spec-support`) production code may not import.
44
+ * - `retiredModules` — module specifiers nobody may import or `require` (a retired vendor bus).
45
+ * - `retiredIdentifiers` — identifiers nobody may write (a retired raw request helper).
46
+ * - `forbiddenClassNamePatterns` — regular expressions a class name may not match (handwritten wire clients).
47
+ * - `legacyWireFile` — the file declaring the legacy raw wire constants, whose exported constants transport
48
+ * and bootstrap files may not import; `null` when there is none.
49
+ * - `bootstrapAllowedLegacyNames` — the legacy constants a bootstrap file MAY import (the discovery message).
50
+ * - `legacyWireCommandPrefixes` — string-literal prefixes of legacy feature wire commands that transport and
51
+ * bootstrap files may not author.
52
+ */
53
+ class IpcBoundaryConfig extends rules_sdk_1.BaseRuleConfig {
54
+ tsconfigPath;
55
+ transportFiles;
56
+ compositionFiles;
57
+ bootstrapFiles;
58
+ testOnlyModuleSuffixes;
59
+ retiredModules;
60
+ retiredIdentifiers;
61
+ forbiddenClassNamePatterns;
62
+ legacyWireFile;
63
+ bootstrapAllowedLegacyNames;
64
+ legacyWireCommandPrefixes;
65
+ static SCHEMA = {
66
+ mode: new rules_sdk_1.FieldDef('string', exports.IPC_FILE_MODES),
67
+ tsconfigPath: new rules_sdk_1.FieldDef('string'),
68
+ transportFiles: rules_sdk_1.FieldDef.nonEmptyStrings('Name the module(s) that own raw IPC delivery.'),
69
+ compositionFiles: rules_sdk_1.FieldDef.nonEmptyStrings('Name the module(s) that create IPC clients and register receivers.'),
70
+ bootstrapFiles: new rules_sdk_1.FieldDef('string[]'),
71
+ testOnlyModuleSuffixes: new rules_sdk_1.FieldDef('string[]'),
72
+ retiredModules: new rules_sdk_1.FieldDef('string[]'),
73
+ retiredIdentifiers: new rules_sdk_1.FieldDef('string[]'),
74
+ forbiddenClassNamePatterns: new rules_sdk_1.FieldDef('string[]'),
75
+ legacyWireFile: rules_sdk_1.FieldDef.nullableString(),
76
+ bootstrapAllowedLegacyNames: new rules_sdk_1.FieldDef('string[]'),
77
+ legacyWireCommandPrefixes: new rules_sdk_1.FieldDef('string[]'),
78
+ };
79
+ }
80
+ exports.IpcBoundaryConfig = IpcBoundaryConfig;
81
+ /**
82
+ * `ipc-contract-shape` — every directional API in the `api:ipc-contract` library, judged one file at a time:
83
+ * class-level `@WpInternal('<id>')`, and on every method `@WpIpcEndpoint('<id>')` (with a literal `kind` when
84
+ * given) plus `@MaskLog(...)`, ONE required parameter typed by a named DTO, an explicit `Promise<…>` return,
85
+ * and unique ids. Contract files may not import host/factory packages or endpoint/runtime code.
86
+ *
87
+ * - `tsconfigPath` — resolves the contract's non-relative imports for `forbiddenImportPaths`.
88
+ * - `contractPaths` — globs of the contract library's source files (the files this rule judges).
89
+ * - `apiClassSuffixes` — class-name suffixes that make a class a directional API (`ToNativeApi`).
90
+ * - `requiredProjectTags` — tags the project owning a contract file must carry (`api:ipc-contract`, …).
91
+ * - `forbiddenImportModules` — globs over a contract import's MODULE SPECIFIER (`@angular/*`, `react`).
92
+ * - `forbiddenImportPaths` — globs over the workspace path a contract import RESOLVES to (`services/**`).
93
+ */
94
+ class IpcContractShapeConfig extends rules_sdk_1.BaseRuleConfig {
95
+ tsconfigPath;
96
+ contractPaths;
97
+ apiClassSuffixes;
98
+ requiredProjectTags;
99
+ forbiddenImportModules;
100
+ forbiddenImportPaths;
101
+ static SCHEMA = {
102
+ mode: new rules_sdk_1.FieldDef('string', exports.IPC_FILE_MODES),
103
+ tsconfigPath: new rules_sdk_1.FieldDef('string'),
104
+ contractPaths: rules_sdk_1.FieldDef.nonEmptyStrings('Name the contract library source globs.'),
105
+ apiClassSuffixes: rules_sdk_1.FieldDef.nonEmptyStrings('Name the class suffixes of directional APIs, e.g. ToNativeApi.'),
106
+ requiredProjectTags: new rules_sdk_1.FieldDef('string[]'),
107
+ forbiddenImportModules: new rules_sdk_1.FieldDef('string[]'),
108
+ forbiddenImportPaths: new rules_sdk_1.FieldDef('string[]'),
109
+ };
110
+ }
111
+ exports.IpcContractShapeConfig = IpcContractShapeConfig;
112
+ /** One direction of the bridge: which APIs travel it, who sends, who receives. Data-only. */
113
+ class IpcDirectionEntry {
114
+ /** Class-name suffix of the APIs in this direction, e.g. `ToNativeApi`. */
115
+ apiSuffix;
116
+ /** The `direction` value the wire table carries for these APIs, e.g. `native`. */
117
+ wireDirection;
118
+ /** Globs of the sending endpoint's files; one of them must hold `createClient(<Api>)`. */
119
+ senderFiles;
120
+ /** Globs of the receiving endpoint's files; exactly one `create`/`createScoped(<Api>, …)` lives here. */
121
+ receiverFiles;
122
+ static SCHEMA = {
123
+ apiSuffix: new rules_sdk_1.FieldDef('string'),
124
+ wireDirection: new rules_sdk_1.FieldDef('string'),
125
+ senderFiles: rules_sdk_1.FieldDef.nonEmptyStrings(),
126
+ receiverFiles: rules_sdk_1.FieldDef.nonEmptyStrings(),
127
+ };
128
+ }
129
+ exports.IpcDirectionEntry = IpcDirectionEntry;
130
+ /**
131
+ * `ipc-pairing` — every directional API has a generated client at its sending endpoint and exactly ONE
132
+ * framework registration at its receiver, whose controller is a subclass of that same shared abstract API;
133
+ * no handwritten dispatch map sits beside the factory. With a wire table configured, every table row names
134
+ * a real API method, wires are unique, kinds/since/direction are sane and agree with the decorators.
135
+ *
136
+ * The contract side is read through a type-checked program rooted at `contractPaths` ONLY; the endpoint
137
+ * side is read syntactically from `senderFiles` / `receiverFiles` and the files their controllers come from.
138
+ *
139
+ * - `tsconfigPath`, `contractPaths` — as for `ipc-contract-shape`.
140
+ * - `directions` — one entry per direction of the bridge (see {@link IpcDirectionEntry}).
141
+ * - `wireTableFile` / `wireTableExport` — the file and exported const of a literal wire table
142
+ * (`[{ api, method, wire, direction, kind, since }]`); both `null` when the contract has none.
143
+ * - `forbiddenDispatchVariables` — variable names a receiver file may not initialise with `new …`
144
+ * (the handwritten dispatch map the factory replaced).
145
+ */
146
+ class IpcPairingConfig extends rules_sdk_1.BaseRuleConfig {
147
+ tsconfigPath;
148
+ contractPaths;
149
+ directions;
150
+ wireTableFile;
151
+ wireTableExport;
152
+ forbiddenDispatchVariables;
153
+ static SCHEMA = {
154
+ mode: new rules_sdk_1.FieldDef('string', exports.IPC_PROJECT_MODES),
155
+ tsconfigPath: new rules_sdk_1.FieldDef('string'),
156
+ contractPaths: rules_sdk_1.FieldDef.nonEmptyStrings('Name the contract library source globs.'),
157
+ directions: rules_sdk_1.FieldDef.nonEmptyObjects(IpcDirectionEntry.SCHEMA),
158
+ wireTableFile: rules_sdk_1.FieldDef.nullableString(),
159
+ wireTableExport: rules_sdk_1.FieldDef.nullableString(),
160
+ forbiddenDispatchVariables: new rules_sdk_1.FieldDef('string[]'),
161
+ };
162
+ }
163
+ exports.IpcPairingConfig = IpcPairingConfig;
164
+ /**
165
+ * `ipc-protocol-fingerprint` — `manifestPath` records `{ protocol, fingerprint }`: a sha256 over every API /
166
+ * method id, kind, wire row (direction, since), the fully resolved request and reply shapes, and the
167
+ * comment-free printed source of `normalizedSourceFiles` (decorators, masks, validators). The rule fails
168
+ * when the committed manifest does not match the source, when the protocol decreased relative to the branch
169
+ * base, or when the fingerprint changed relative to the branch base without a protocol increment — so
170
+ * re-recording the manifest alone cannot hide an unversioned wire change. Re-record with
171
+ * `pnpm wp-ipc-record-protocol` after incrementing the version constant.
172
+ *
173
+ * - `tsconfigPath`, `contractPaths`, `apiClassSuffixes`, `wireTableFile`, `wireTableExport` — as above.
174
+ * - `normalizedSourceFiles` — globs, hashed in the order listed (files matching one glob sorted by path).
175
+ * - `manifestPath` — the committed manifest, workspace-relative.
176
+ * - `versionFile` / `versionConstant` — where the protocol integer is declared (`export const X = 18;`).
177
+ * - `withoutBaseline` — FAIL (an ordinary clone with no reachable main) or VERIFY_COMMITTED (an archive or
178
+ * shallow build checkout: still verify the manifest against the source, skip the increment check).
179
+ */
180
+ class IpcProtocolFingerprintConfig extends rules_sdk_1.BaseRuleConfig {
181
+ tsconfigPath;
182
+ contractPaths;
183
+ apiClassSuffixes;
184
+ wireTableFile;
185
+ wireTableExport;
186
+ normalizedSourceFiles;
187
+ manifestPath;
188
+ versionFile;
189
+ versionConstant;
190
+ withoutBaseline;
191
+ static SCHEMA = {
192
+ mode: new rules_sdk_1.FieldDef('string', exports.IPC_PROJECT_MODES),
193
+ tsconfigPath: new rules_sdk_1.FieldDef('string'),
194
+ contractPaths: rules_sdk_1.FieldDef.nonEmptyStrings('Name the contract library source globs.'),
195
+ apiClassSuffixes: rules_sdk_1.FieldDef.nonEmptyStrings('Name the class suffixes of directional APIs, e.g. ToNativeApi.'),
196
+ wireTableFile: rules_sdk_1.FieldDef.nullableString(),
197
+ wireTableExport: rules_sdk_1.FieldDef.nullableString(),
198
+ normalizedSourceFiles: rules_sdk_1.FieldDef.nonEmptyStrings('Name the contract/mask/validator sources to hash.'),
199
+ manifestPath: new rules_sdk_1.FieldDef('string'),
200
+ versionFile: new rules_sdk_1.FieldDef('string'),
201
+ versionConstant: new rules_sdk_1.FieldDef('string'),
202
+ withoutBaseline: new rules_sdk_1.FieldDef('string', exports.IPC_WITHOUT_BASELINE),
203
+ };
204
+ }
205
+ exports.IpcProtocolFingerprintConfig = IpcProtocolFingerprintConfig;
206
+ //# sourceMappingURL=ipc-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipc-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/ipc-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA6E;AAE7E;;;;;;;;;;;;;;;;;GAiBG;AAEH,+GAA+G;AAClG,QAAA,cAAc,GAAG,CAAC,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,gBAAgB,CAAU,CAAC;AAIhH;;;GAGG;AACU,QAAA,iBAAiB,GAAG,CAAC,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,CAAU,CAAC;AAIzF,wGAAwG;AAC3F,QAAA,oBAAoB,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAU,CAAC;AAI1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,iBAAkB,SAAQ,0BAAc;IAEjD,YAAY,CAAU;IACtB,cAAc,CAAY;IAC1B,gBAAgB,CAAY;IAC5B,cAAc,CAAY;IAC1B,sBAAsB,CAAY;IAClC,cAAc,CAAY;IAC1B,kBAAkB,CAAY;IAC9B,0BAA0B,CAAY;IACtC,cAAc,CAAiB;IAC/B,2BAA2B,CAAY;IACvC,yBAAyB,CAAY;IAErC,MAAM,CAAU,MAAM,GAAmC;QACrD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,sBAAc,CAAC;QAC5C,YAAY,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QACpC,cAAc,EAAE,oBAAQ,CAAC,eAAe,CAAC,+CAA+C,CAAC;QACz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U,MAAM,GAA8C;QAChE,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,yBAAiB,CAAC;QAC/C,YAAY,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QACpC,aAAa,EAAE,oBAAQ,CAAC,eAAe,CAAC,yCAAyC,CAAC;QAClF,gBAAgB,EAAE,oBAAQ,CAAC,eAAe,CAAC,gEAAgE,CAAC;QAC5G,aAAa,EAAE,oBAAQ,CAAC,cAAc,EAAE;QACxC,eAAe,EAAE,oBAAQ,CAAC,cAAc,EAAE;QAC1C,qBAAqB,EAAE,oBAAQ,CAAC,eAAe,CAAC,mDAAmD,CAAC;QACpG,YAAY,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QACpC,WAAW,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QACnC,eAAe,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QACvC,eAAe,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,4BAAoB,CAAC;KAChE,CAAC;;AAzBN,oEA0BC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig } from '@webpieces/rules-sdk';\n\n/**\n * The four `@webpieces/ipc-bridge` guard rules (#1389). They replace a consumer's standalone script that\n * built ONE TypeScript program over every source file of a monorepo (and ran out of memory doing it):\n *\n * ipc-boundary — per FILE, syntax only: who may touch raw IPC, the factories and the WebView\n * ipc-contract-shape — per FILE, syntax only: the shape of every directional API in the contract lib\n * ipc-pairing — per IPC PROJECT SET: every API has a generated client at its sender and exactly\n * one registration at its receiver, whose controller extends that same API\n * ipc-protocol-fingerprint — per IPC PROJECT SET: the recorded wire fingerprint, compared with the branch\n * base so an unversioned contract change fails\n *\n * The only type-checked program any of them builds is rooted at the configured `contractPaths` files\n * alone, so memory follows the size of the contract library, never the size of the repo.\n *\n * Every field that names a consumer path or decides what is refused is REQUIRED with no default\n * (`.claude/rules/no-rule-defaults.md`); every glob is workspace-relative (`**` any depth, `*` one segment).\n * A list that may legitimately be empty (no retired modules) is still required, so the choice is visible.\n */\n\n/** Per-file IPC rules judge whole files: the changed ones, every file of a touched project, or all of them. */\nexport const IPC_FILE_MODES = ['OFF', 'NEW_AND_MODIFIED_FILES', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'] as const;\n\nexport type IpcFileMode = typeof IPC_FILE_MODES[number];\n\n/**\n * Project-scoped IPC rules judge the configured IPC file set as a whole: whenever a project owning one of\n * those files is touched (MODIFIED_PROJECTS), or on every run (RUN_EVERY_TIME).\n */\nexport const IPC_PROJECT_MODES = ['OFF', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'] as const;\n\nexport type IpcProjectMode = typeof IPC_PROJECT_MODES[number];\n\n/** What `ipc-protocol-fingerprint` does when the branch base (merge-base with main) cannot be found. */\nexport const IPC_WITHOUT_BASELINE = ['FAIL', 'VERIFY_COMMITTED'] as const;\n\nexport type IpcWithoutBaseline = typeof IPC_WITHOUT_BASELINE[number];\n\n/**\n * `ipc-boundary` — \"nobody else may\". Judged one file at a time from that file's syntax tree; an alias is\n * followed only inside the file (`import { IpcClientFactory as F }`, `const alias = webView`).\n *\n * - `tsconfigPath` — the tsconfig whose `paths`/`baseUrl` resolve a non-relative import (read without\n * enumerating the repo's files).\n * - `transportFiles` — globs of the modules that own raw delivery and `IpcConnection` lifetimes (the shell\n * transport, a WebView delivery layer). A transport file is ALSO a composition file.\n * - `compositionFiles` — globs of the modules that may build `IpcClientFactory` / `IpcServerFactory`, call\n * `createClient` / `create` / `createScoped` / `withContext`, and import `@webpieces/ipc-bridge`.\n * - `bootstrapFiles` — globs of the protocol-discovery modules that may send the one raw discovery message.\n * - `testOnlyModuleSuffixes` — module specifier suffixes (e.g. `.spec-support`) production code may not import.\n * - `retiredModules` — module specifiers nobody may import or `require` (a retired vendor bus).\n * - `retiredIdentifiers` — identifiers nobody may write (a retired raw request helper).\n * - `forbiddenClassNamePatterns` — regular expressions a class name may not match (handwritten wire clients).\n * - `legacyWireFile` — the file declaring the legacy raw wire constants, whose exported constants transport\n * and bootstrap files may not import; `null` when there is none.\n * - `bootstrapAllowedLegacyNames` — the legacy constants a bootstrap file MAY import (the discovery message).\n * - `legacyWireCommandPrefixes` — string-literal prefixes of legacy feature wire commands that transport and\n * bootstrap files may not author.\n */\nexport class IpcBoundaryConfig extends BaseRuleConfig {\n declare mode?: IpcFileMode;\n tsconfigPath!: string;\n transportFiles!: string[];\n compositionFiles!: string[];\n bootstrapFiles!: string[];\n testOnlyModuleSuffixes!: string[];\n retiredModules!: string[];\n retiredIdentifiers!: string[];\n forbiddenClassNamePatterns!: string[];\n legacyWireFile!: string | null;\n bootstrapAllowedLegacyNames!: string[];\n legacyWireCommandPrefixes!: string[];\n\n static readonly SCHEMA: SchemaShape<IpcBoundaryConfig> = {\n mode: new FieldDef('string', IPC_FILE_MODES),\n tsconfigPath: new FieldDef('string'),\n transportFiles: FieldDef.nonEmptyStrings('Name the module(s) that own raw IPC delivery.'),\n compositionFiles: FieldDef.nonEmptyStrings('Name the module(s) that create IPC clients and register receivers.'),\n bootstrapFiles: new FieldDef('string[]'),\n testOnlyModuleSuffixes: new FieldDef('string[]'),\n retiredModules: new FieldDef('string[]'),\n retiredIdentifiers: new FieldDef('string[]'),\n forbiddenClassNamePatterns: new FieldDef('string[]'),\n legacyWireFile: FieldDef.nullableString(),\n bootstrapAllowedLegacyNames: new FieldDef('string[]'),\n legacyWireCommandPrefixes: new FieldDef('string[]'),\n };\n}\n\n/**\n * `ipc-contract-shape` — every directional API in the `api:ipc-contract` library, judged one file at a time:\n * class-level `@WpInternal('<id>')`, and on every method `@WpIpcEndpoint('<id>')` (with a literal `kind` when\n * given) plus `@MaskLog(...)`, ONE required parameter typed by a named DTO, an explicit `Promise<…>` return,\n * and unique ids. Contract files may not import host/factory packages or endpoint/runtime code.\n *\n * - `tsconfigPath` — resolves the contract's non-relative imports for `forbiddenImportPaths`.\n * - `contractPaths` — globs of the contract library's source files (the files this rule judges).\n * - `apiClassSuffixes` — class-name suffixes that make a class a directional API (`ToNativeApi`).\n * - `requiredProjectTags` — tags the project owning a contract file must carry (`api:ipc-contract`, …).\n * - `forbiddenImportModules` — globs over a contract import's MODULE SPECIFIER (`@angular/*`, `react`).\n * - `forbiddenImportPaths` — globs over the workspace path a contract import RESOLVES to (`services/**`).\n */\nexport class IpcContractShapeConfig extends BaseRuleConfig {\n declare mode?: IpcFileMode;\n tsconfigPath!: string;\n contractPaths!: string[];\n apiClassSuffixes!: string[];\n requiredProjectTags!: string[];\n forbiddenImportModules!: string[];\n forbiddenImportPaths!: string[];\n\n static readonly SCHEMA: SchemaShape<IpcContractShapeConfig> = {\n mode: new FieldDef('string', IPC_FILE_MODES),\n tsconfigPath: new FieldDef('string'),\n contractPaths: FieldDef.nonEmptyStrings('Name the contract library source globs.'),\n apiClassSuffixes: FieldDef.nonEmptyStrings('Name the class suffixes of directional APIs, e.g. ToNativeApi.'),\n requiredProjectTags: new FieldDef('string[]'),\n forbiddenImportModules: new FieldDef('string[]'),\n forbiddenImportPaths: new FieldDef('string[]'),\n };\n}\n\n/** One direction of the bridge: which APIs travel it, who sends, who receives. Data-only. */\nexport class IpcDirectionEntry {\n /** Class-name suffix of the APIs in this direction, e.g. `ToNativeApi`. */\n apiSuffix!: string;\n /** The `direction` value the wire table carries for these APIs, e.g. `native`. */\n wireDirection!: string;\n /** Globs of the sending endpoint's files; one of them must hold `createClient(<Api>)`. */\n senderFiles!: string[];\n /** Globs of the receiving endpoint's files; exactly one `create`/`createScoped(<Api>, …)` lives here. */\n receiverFiles!: string[];\n\n static readonly SCHEMA: SchemaShape<IpcDirectionEntry> = {\n apiSuffix: new FieldDef('string'),\n wireDirection: new FieldDef('string'),\n senderFiles: FieldDef.nonEmptyStrings(),\n receiverFiles: FieldDef.nonEmptyStrings(),\n };\n}\n\n/**\n * `ipc-pairing` — every directional API has a generated client at its sending endpoint and exactly ONE\n * framework registration at its receiver, whose controller is a subclass of that same shared abstract API;\n * no handwritten dispatch map sits beside the factory. With a wire table configured, every table row names\n * a real API method, wires are unique, kinds/since/direction are sane and agree with the decorators.\n *\n * The contract side is read through a type-checked program rooted at `contractPaths` ONLY; the endpoint\n * side is read syntactically from `senderFiles` / `receiverFiles` and the files their controllers come from.\n *\n * - `tsconfigPath`, `contractPaths` — as for `ipc-contract-shape`.\n * - `directions` — one entry per direction of the bridge (see {@link IpcDirectionEntry}).\n * - `wireTableFile` / `wireTableExport` — the file and exported const of a literal wire table\n * (`[{ api, method, wire, direction, kind, since }]`); both `null` when the contract has none.\n * - `forbiddenDispatchVariables` — variable names a receiver file may not initialise with `new …`\n * (the handwritten dispatch map the factory replaced).\n */\nexport class IpcPairingConfig extends BaseRuleConfig {\n declare mode?: IpcProjectMode;\n tsconfigPath!: string;\n contractPaths!: string[];\n directions!: IpcDirectionEntry[];\n wireTableFile!: string | null;\n wireTableExport!: string | null;\n forbiddenDispatchVariables!: string[];\n\n static readonly SCHEMA: SchemaShape<IpcPairingConfig> = {\n mode: new FieldDef('string', IPC_PROJECT_MODES),\n tsconfigPath: new FieldDef('string'),\n contractPaths: FieldDef.nonEmptyStrings('Name the contract library source globs.'),\n directions: FieldDef.nonEmptyObjects(IpcDirectionEntry.SCHEMA),\n wireTableFile: FieldDef.nullableString(),\n wireTableExport: FieldDef.nullableString(),\n forbiddenDispatchVariables: new FieldDef('string[]'),\n };\n}\n\n/**\n * `ipc-protocol-fingerprint` — `manifestPath` records `{ protocol, fingerprint }`: a sha256 over every API /\n * method id, kind, wire row (direction, since), the fully resolved request and reply shapes, and the\n * comment-free printed source of `normalizedSourceFiles` (decorators, masks, validators). The rule fails\n * when the committed manifest does not match the source, when the protocol decreased relative to the branch\n * base, or when the fingerprint changed relative to the branch base without a protocol increment — so\n * re-recording the manifest alone cannot hide an unversioned wire change. Re-record with\n * `pnpm wp-ipc-record-protocol` after incrementing the version constant.\n *\n * - `tsconfigPath`, `contractPaths`, `apiClassSuffixes`, `wireTableFile`, `wireTableExport` — as above.\n * - `normalizedSourceFiles` — globs, hashed in the order listed (files matching one glob sorted by path).\n * - `manifestPath` — the committed manifest, workspace-relative.\n * - `versionFile` / `versionConstant` — where the protocol integer is declared (`export const X = 18;`).\n * - `withoutBaseline` — FAIL (an ordinary clone with no reachable main) or VERIFY_COMMITTED (an archive or\n * shallow build checkout: still verify the manifest against the source, skip the increment check).\n */\nexport class IpcProtocolFingerprintConfig extends BaseRuleConfig {\n declare mode?: IpcProjectMode;\n tsconfigPath!: string;\n contractPaths!: string[];\n apiClassSuffixes!: string[];\n wireTableFile!: string | null;\n wireTableExport!: string | null;\n normalizedSourceFiles!: string[];\n manifestPath!: string;\n versionFile!: string;\n versionConstant!: string;\n withoutBaseline!: IpcWithoutBaseline;\n\n static readonly SCHEMA: SchemaShape<IpcProtocolFingerprintConfig> = {\n mode: new FieldDef('string', IPC_PROJECT_MODES),\n tsconfigPath: new FieldDef('string'),\n contractPaths: FieldDef.nonEmptyStrings('Name the contract library source globs.'),\n apiClassSuffixes: FieldDef.nonEmptyStrings('Name the class suffixes of directional APIs, e.g. ToNativeApi.'),\n wireTableFile: FieldDef.nullableString(),\n wireTableExport: FieldDef.nullableString(),\n normalizedSourceFiles: FieldDef.nonEmptyStrings('Name the contract/mask/validator sources to hash.'),\n manifestPath: new FieldDef('string'),\n versionFile: new FieldDef('string'),\n versionConstant: new FieldDef('string'),\n withoutBaseline: new FieldDef('string', IPC_WITHOUT_BASELINE),\n };\n}\n"]}
package/src/index.d.ts CHANGED
@@ -51,3 +51,10 @@ export { CatchMustPropagateConfig } from './configs/catch-must-propagate-config'
51
51
  export { CatchMustPropagateValidator, LocatedCatchFinding } from './validate-catch-must-propagate';
52
52
  export { PROJECT_SCAN_MODES, FrameworkTsconfigConfig, FrameworkPackagesEntry, FrameworkPackagesConfig } from './configs/tag-truth-configs';
53
53
  export type { ProjectScanMode } from './configs/tag-truth-configs';
54
+ export { IPC_FILE_MODES, IPC_PROJECT_MODES, IPC_WITHOUT_BASELINE, IpcBoundaryConfig, IpcContractShapeConfig, IpcDirectionEntry, IpcPairingConfig, IpcProtocolFingerprintConfig } from './configs/ipc-configs';
55
+ export type { IpcFileMode, IpcProjectMode, IpcWithoutBaseline } from './configs/ipc-configs';
56
+ export { IpcBoundaryValidator } from './validate-ipc-boundary';
57
+ export { IpcContractShapeValidator } from './validate-ipc-contract-shape';
58
+ export { IpcPairingValidator } from './validate-ipc-pairing';
59
+ export { IpcProtocolFingerprintValidator } from './validate-ipc-protocol-fingerprint';
60
+ export { IpcProtocolSnapshot } from './ipc/ipc-protocol-fingerprint';
package/src/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.frameworkTsconfigError = exports.TsconfigRuntimeViolation = exports.RuntimeCompilerOptions = exports.FrameworkTsconfigAudit = exports.FrameworkTsconfigValidator = exports.ScannedProject = exports.ProjectScanTargets = exports.ApiLibEnumIndex = exports.GoverningGlob = exports.SuffixRename = exports.SuffixEntryPicker = exports.ExportedTypeScanner = exports.RequiredTypeSuffixValidator = exports.UtilityTypeScanner = exports.NoUtilityTypesInApiLibValidator = exports.EnumSpellingScanner = exports.OneEnumSpellingInApiLibValidator = exports.InlineImportScanner = exports.NoInlineImportInApiLibValidator = exports.ApiLibSite = exports.ApiLibFile = exports.findDirectlyChangedProjectRoots = exports.auditSecurityContracts = exports.SecurityContractViolation = exports.EnsureWeAreSecureValidator = exports.RoleTagValidator = exports.FrameworkTagValidator = exports.findRedundantInjectInSource = exports.InjectAnnotationNotNeededForConcreteClassValidator = exports.NoFunctionOutsideClassValidator = exports.NoProcessExitOutsideMainValidator = exports.ProjectRoleResolver = exports.StatePathViolation = exports.StatePathHit = exports.NoStatePathsInTemplatesValidator = exports.NoClientCreationOutsideServerOrClientValidator = exports.NoSymbolDiTokensValidator = exports.NoDirectApiResolverValidator = exports.NoDestructureValidator = exports.NoUnmanagedExceptionsValidator = exports.CatchErrorPatternValidator = exports.NoInlineTypeLiteralsValidator = exports.RequireReturnTypeValidator = exports.MaxFileLinesValidator = exports.runNewMethods = exports.runModifiedMethods = exports.MaxMethodLinesValidator = exports.NoImplicitAnyValidator = exports.NoAnyUnknownValidator = exports.CodeValidator = void 0;
4
4
  exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoSymbolDiTokensConfig = exports.NoCustomCssConfig = exports.AngularNoDirectApiInResolverConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.METHOD_LIMIT_MODES = exports.ReactNativeCompatibility = exports.RuleExclusionsFactory = exports.GlobalExcludePaths = exports.ExclusionScopedPolicy = exports.DebugPlan = exports.DebugAsk = exports.RuleDebugRun = exports.RecordedSite = exports.ProjectEntry = exports.ProjectCatalog = exports.ScanRestriction = exports.GateScanScope = exports.ScanScope = exports.RunRequestParser = exports.RuleSelection = exports.CodeRulesRunRequest = exports.CodeRulesBootstrap = exports.validateCode = exports.PrismaConverterValidator = exports.PrismaValidateDtosValidator = exports.EnumText = exports.frameworkPackagesError = exports.FrameworkPackageViolation = exports.FrameworkPackagesAudit = exports.FrameworkPackagesValidator = void 0;
5
- exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.LocatedCatchFinding = exports.CatchMustPropagateValidator = exports.CatchMustPropagateConfig = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = exports.CLIENT_CREATION_SEVERITIES = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = void 0;
5
+ exports.IpcProtocolSnapshot = exports.IpcProtocolFingerprintValidator = exports.IpcPairingValidator = exports.IpcContractShapeValidator = exports.IpcBoundaryValidator = exports.IpcProtocolFingerprintConfig = exports.IpcPairingConfig = exports.IpcDirectionEntry = exports.IpcContractShapeConfig = exports.IpcBoundaryConfig = exports.IPC_WITHOUT_BASELINE = exports.IPC_PROJECT_MODES = exports.IPC_FILE_MODES = exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.LocatedCatchFinding = exports.CatchMustPropagateValidator = exports.CatchMustPropagateConfig = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = exports.CLIENT_CREATION_SEVERITIES = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  var code_validator_1 = require("./code-validator");
8
8
  Object.defineProperty(exports, "CodeValidator", { enumerable: true, get: function () { return code_validator_1.CodeValidator; } });
@@ -174,4 +174,23 @@ Object.defineProperty(exports, "PROJECT_SCAN_MODES", { enumerable: true, get: fu
174
174
  Object.defineProperty(exports, "FrameworkTsconfigConfig", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkTsconfigConfig; } });
175
175
  Object.defineProperty(exports, "FrameworkPackagesEntry", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkPackagesEntry; } });
176
176
  Object.defineProperty(exports, "FrameworkPackagesConfig", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkPackagesConfig; } });
177
+ var ipc_configs_1 = require("./configs/ipc-configs");
178
+ Object.defineProperty(exports, "IPC_FILE_MODES", { enumerable: true, get: function () { return ipc_configs_1.IPC_FILE_MODES; } });
179
+ Object.defineProperty(exports, "IPC_PROJECT_MODES", { enumerable: true, get: function () { return ipc_configs_1.IPC_PROJECT_MODES; } });
180
+ Object.defineProperty(exports, "IPC_WITHOUT_BASELINE", { enumerable: true, get: function () { return ipc_configs_1.IPC_WITHOUT_BASELINE; } });
181
+ Object.defineProperty(exports, "IpcBoundaryConfig", { enumerable: true, get: function () { return ipc_configs_1.IpcBoundaryConfig; } });
182
+ Object.defineProperty(exports, "IpcContractShapeConfig", { enumerable: true, get: function () { return ipc_configs_1.IpcContractShapeConfig; } });
183
+ Object.defineProperty(exports, "IpcDirectionEntry", { enumerable: true, get: function () { return ipc_configs_1.IpcDirectionEntry; } });
184
+ Object.defineProperty(exports, "IpcPairingConfig", { enumerable: true, get: function () { return ipc_configs_1.IpcPairingConfig; } });
185
+ Object.defineProperty(exports, "IpcProtocolFingerprintConfig", { enumerable: true, get: function () { return ipc_configs_1.IpcProtocolFingerprintConfig; } });
186
+ var validate_ipc_boundary_1 = require("./validate-ipc-boundary");
187
+ Object.defineProperty(exports, "IpcBoundaryValidator", { enumerable: true, get: function () { return validate_ipc_boundary_1.IpcBoundaryValidator; } });
188
+ var validate_ipc_contract_shape_1 = require("./validate-ipc-contract-shape");
189
+ Object.defineProperty(exports, "IpcContractShapeValidator", { enumerable: true, get: function () { return validate_ipc_contract_shape_1.IpcContractShapeValidator; } });
190
+ var validate_ipc_pairing_1 = require("./validate-ipc-pairing");
191
+ Object.defineProperty(exports, "IpcPairingValidator", { enumerable: true, get: function () { return validate_ipc_pairing_1.IpcPairingValidator; } });
192
+ var validate_ipc_protocol_fingerprint_1 = require("./validate-ipc-protocol-fingerprint");
193
+ Object.defineProperty(exports, "IpcProtocolFingerprintValidator", { enumerable: true, get: function () { return validate_ipc_protocol_fingerprint_1.IpcProtocolFingerprintValidator; } });
194
+ var ipc_protocol_fingerprint_1 = require("./ipc/ipc-protocol-fingerprint");
195
+ Object.defineProperty(exports, "IpcProtocolSnapshot", { enumerable: true, get: function () { return ipc_protocol_fingerprint_1.IpcProtocolSnapshot; } });
177
196
  //# sourceMappingURL=index.js.map