@webpieces/nx-webpieces-rules 0.4.870 → 0.4.872

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 (61) hide show
  1. package/README.md +36 -0
  2. package/package.json +7 -7
  3. package/src/executors/generate/executor.d.ts +3 -1
  4. package/src/executors/generate/executor.js +9 -1
  5. package/src/executors/generate/executor.js.map +1 -1
  6. package/src/index.d.ts +1 -0
  7. package/src/index.js +5 -1
  8. package/src/index.js.map +1 -1
  9. package/src/lib/di-graph/runtime-client-bindings.d.ts +5 -1
  10. package/src/lib/di-graph/runtime-client-bindings.js +21 -5
  11. package/src/lib/di-graph/runtime-client-bindings.js.map +1 -1
  12. package/src/lib/dot-syntax.d.ts +9 -0
  13. package/src/lib/dot-syntax.js +17 -0
  14. package/src/lib/dot-syntax.js.map +1 -1
  15. package/src/lib/graph-color-modes.d.ts +136 -0
  16. package/src/lib/graph-color-modes.js +299 -0
  17. package/src/lib/graph-color-modes.js.map +1 -0
  18. package/src/lib/graph-filter.client.d.ts +11 -1
  19. package/src/lib/graph-filter.client.js +25 -4
  20. package/src/lib/graph-filter.client.js.map +1 -1
  21. package/src/lib/graph-impact.d.ts +119 -0
  22. package/src/lib/graph-impact.js +295 -0
  23. package/src/lib/graph-impact.js.map +1 -0
  24. package/src/lib/graph-legend.d.ts +34 -0
  25. package/src/lib/graph-legend.js +116 -0
  26. package/src/lib/graph-legend.js.map +1 -0
  27. package/src/lib/graph-names.d.ts +2 -2
  28. package/src/lib/graph-names.js +2 -2
  29. package/src/lib/graph-names.js.map +1 -1
  30. package/src/lib/graph-navigation.d.ts +10 -0
  31. package/src/lib/graph-navigation.js +47 -12
  32. package/src/lib/graph-navigation.js.map +1 -1
  33. package/src/lib/graph-node-menu.d.ts +4 -3
  34. package/src/lib/graph-node-menu.js +137 -20
  35. package/src/lib/graph-node-menu.js.map +1 -1
  36. package/src/lib/graph-page-shell.d.ts +34 -0
  37. package/src/lib/graph-page-shell.js +121 -0
  38. package/src/lib/graph-page-shell.js.map +1 -0
  39. package/src/lib/graph-page-styles.d.ts +20 -0
  40. package/src/lib/graph-page-styles.js +144 -0
  41. package/src/lib/graph-page-styles.js.map +1 -0
  42. package/src/lib/graph-render-model.d.ts +14 -2
  43. package/src/lib/graph-render-model.js +19 -3
  44. package/src/lib/graph-render-model.js.map +1 -1
  45. package/src/lib/graph-responsibilities.js +1 -1
  46. package/src/lib/graph-responsibilities.js.map +1 -1
  47. package/src/lib/graph-visualizer.client.d.ts +65 -0
  48. package/src/lib/graph-visualizer.client.js +311 -7
  49. package/src/lib/graph-visualizer.client.js.map +1 -1
  50. package/src/lib/graph-visualizer.d.ts +19 -31
  51. package/src/lib/graph-visualizer.js +50 -286
  52. package/src/lib/graph-visualizer.js.map +1 -1
  53. package/src/lib/runtime-html-page.js +2 -2
  54. package/src/lib/runtime-html-page.js.map +1 -1
  55. package/src/lib/runtime-wiring/source-extractor.d.ts +2 -1
  56. package/src/lib/runtime-wiring/source-extractor.js +3 -2
  57. package/src/lib/runtime-wiring/source-extractor.js.map +1 -1
  58. package/src/lib/runtime-wiring/wiring-format.js +2 -2
  59. package/src/lib/runtime-wiring/wiring-format.js.map +1 -1
  60. package/src/rule-help.js +1 -1
  61. package/src/rule-help.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wiring-format.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-wiring/wiring-format.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uDAAiC;AACjC,0DAAgE;AAChE,iDAA+D;AAC/D,2DAA8D;AAE9D,MAAM,aAAa,GAAG,yJAAyJ,CAAC;AAChL,MAAM,SAAS,GAAG,gDAAgD,CAAC;AACnE;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACh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AU,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IACzE,CAAC;IAEO,MAAM,CAAC,UAAyB;QACpC,IAAI,EAAE,CAAC,yBAAyB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,qBAAqB,CAAC,UAAU,CAAC;YACvJ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9C,OAAO,UAAU,CAAC;IACtB,CAAC;IAEO,aAAa,CAAC,IAAuB;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;QACzE,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1H,CAAC;CACJ;AAhSD,oCAgSC","sourcesContent":["import * as path from 'path';\nimport * as ts from 'typescript';\nimport { Option, RuleFailError } from '@webpieces/rules-config';\nimport { WiringSourceTypes, WiringKind } from './source-types';\nimport { CanonicalClientBindings } from './canonical-clients';\n\nconst WEBPIECES_SDK = /(?:\\/packages\\/(?:http|cloud)\\/|\\/node_modules\\/@webpieces\\/)(?:http-routing|http-client-node|http-client-browser|http-client-core|cloudtasks-client)\\//;\nconst INVERSIFY = /\\/node_modules\\/(?:@inversifyjs\\/|inversify\\/)/;\n/**\n * Methods that START a registration on the host's binder or router: a DI bind, a client created and\n * bound, a vendor implementation bound to its external contract, a browser provider recipe, a route\n * or a filter.\n */\nconst REGISTRATION_ROOTS = ['bind', 'createRpcClientAndBind', 'createPubSubClientAndBind', 'bindExternal', 'provide', 'addRoutes', 'addFilter'];\n/** Removed authoring shapes; their presence means an old wrapper, helper or an anonymous module survived. */\nconst LEGACY_TOPOLOGY = /\\b(?:rpcTarget|RpcTarget|ContainerModule|ServerWiring|ServerWiringOptions|BrowserWiring|getRuntimeWiring|RuntimeClients|RuntimeTaskClients|provideRpcClient|ExternalContractUse|BrowserBindings|BindingModule)\\b/;\n/** Getters renamed with BindingModule -> BindModule. */\nconst RENAMED_GETTERS: Readonly<Record<string, string>> = { getBindingModules: 'getBindModules', getRoutingModules: 'getRouteModules' };\n/** Environment discovery belongs in prepared configuration, never in a registration argument. */\nconst ENVIRONMENT = new Set(['process', 'window', 'document', 'localStorage', 'sessionStorage', 'navigator', 'location', 'globalThis']);\n\n/** The one canonical file being checked, its owner directory and where problems go. */\nclass CanonicalFile {\n constructor(\n readonly file: ts.SourceFile,\n readonly ownerRoot: string,\n readonly report: (node: ts.Node, message: string) => void,\n ) {}\n}\n\n/**\n * One canonical-file grammar. Each owner's src/wiring.ts holds its Wiring/AppWiring class AND the\n * BindModule/RouteModule classes it selects, with their actual registrations. A library owner's\n * canonical wiring.ts may export only BindModules. Symbol resolution may read imports; format\n * checking never does.\n */\nexport class WiringFormat {\n private readonly types: WiringSourceTypes;\n\n constructor(private readonly checker: ts.TypeChecker, private readonly maxLines: number) {\n this.types = new WiringSourceTypes(checker);\n }\n\n problems(file: ts.SourceFile): string[] {\n if (!/(?:^|\\/)wiring\\.ts$/.test(file.fileName)) return [];\n const problems: string[] = new CanonicalClientBindings(this.checker).problems(file);\n const report = (node: ts.Node, message: string): void => {\n const at = file.getLineAndCharacterOfPosition(node.getStart(file));\n problems.push(`${file.fileName}:${at.line + 1}:${at.character + 1}: ${message}`);\n };\n const scope = new CanonicalFile(file, path.dirname(path.dirname(path.resolve(file.fileName))), report);\n const lines = file.text.trimEnd().split('\\n').length;\n if (lines > this.maxLines)\n report(\n file,\n `wiring.ts has ${lines} lines, above maxLines ${this.maxLines}. Keep every BindModule/RouteModule and its registrations here beside the Wiring class; shorten the file by moving configuration building, translations, environment discovery and initializer or factory bodies into imported implementations, or give a cohesive group its own library owner with its own wiring.ts.`,\n );\n for (const statement of file.statements) {\n if (ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement)) continue;\n if (!ts.isClassDeclaration(statement)) {\n report(statement, 'Only imports, exports and named declarative classes belong in wiring.ts.');\n continue;\n }\n const kind = this.types.kind(statement);\n if (kind === undefined) {\n report(statement, LEGACY_TOPOLOGY.test(statement.getText())\n ? 'Removed authoring shape (BindingModule, ExternalContractUse, RuntimeClients, provideRpcClient, BrowserBindings); implement BindModule and register through the binder.'\n : 'Implement the framework Wiring, AppWiring, BindModule or RouteModule contract.');\n continue;\n }\n this.classProblems(statement, kind, scope);\n }\n return problems;\n }\n\n assert(problems: readonly string[]): void {\n if (problems.length === 0) return;\n throw new RuleFailError('wiring-format', problems.join('\\n'), undefined, undefined, [\n new Option(\n \"Declare each owner's Wiring/AppWiring class together with its named BindModule/RouteModule classes and their registrations in its src/wiring.ts, selected by literal getters (getBindModules/getRouteModules/getWirings); an app may select a BindModule declared in a library owner's canonical src/wiring.ts. Register through the binder (binder.bind, binder.createRpcClientAndBind, binder.createPubSubClientAndBind, binder.bindExternal, browser binder.provide) and the router. Keep configuration building, environment discovery and initializer/factory bodies in imported implementations, and keep named WiringPolicy conditions explicit.\",\n true,\n ),\n ]);\n }\n\n private classProblems(declaration: ts.ClassDeclaration, kind: WiringKind, scope: CanonicalFile): void {\n const report = scope.report;\n for (const member of declaration.members) {\n if (ts.isConstructorDeclaration(member)) {\n if (member.body !== undefined && member.body.statements.length > 0)\n report(member, 'Use constructor parameter properties to store prepared inputs; no setup logic.');\n continue;\n }\n if (!ts.isMethodDeclaration(member)) {\n report(member, 'Store prepared inputs in constructor parameter properties.');\n continue;\n }\n const name = member.name.getText();\n if (Object.hasOwn(RENAMED_GETTERS, name)) {\n report(member, `${name} was renamed to ${RENAMED_GETTERS[name]}.`);\n } else if (['getBindModules', 'getRouteModules', 'getWirings'].includes(name)) {\n const expected = name === 'getWirings' ? 'wiring' : name === 'getBindModules' ? 'binding' : 'routing';\n if (name === 'getWirings' && kind !== 'app')\n report(member, 'Only AppWiring can declare getWirings; libraries cannot compose libraries.');\n this.arrayProblems(member, expected, kind, scope);\n } else if (name === 'configure' && ['binding', 'routing'].includes(kind)) {\n for (const statement of member.body?.statements ?? []) this.configureProblems(statement, scope);\n } else if (name !== 'getHeaders' || kind !== 'app')\n report(member, 'Keep only canonical selection getters and short configure declarations; getRuntimeWiring and helper methods were removed.');\n }\n if (kind === 'binding' || kind === 'routing') {\n const configure = this.types.method(declaration, 'configure');\n if (configure !== undefined && configure.getSourceFile() !== scope.file)\n report(declaration, `configure is inherited from ${configure.getSourceFile().fileName}; declare this module's registrations in its own configure here in wiring.ts.`);\n }\n if (kind === 'app' || kind === 'wiring') {\n // getRouteModules is Node-only (its Wiring type requires it); the browser has no route channel.\n const names = ['getBindModules', 'getRouteModules', ...(kind === 'app' ? ['getWirings'] : [])];\n for (const name of names) {\n const method = this.types.method(declaration, name);\n if (method === undefined) {\n if (name !== 'getRouteModules') report(declaration, `Missing ${name} literal array getter.`);\n } else if (method.getSourceFile() !== scope.file)\n report(declaration, `${name} is inherited from ${method.getSourceFile().fileName}; declare the selection getter on this class in wiring.ts.`);\n }\n if (kind === 'wiring' && this.types.method(declaration, 'getWirings') !== undefined)\n report(declaration, 'A library Wiring must not inherit getWirings.');\n }\n }\n\n private arrayProblems(method: ts.MethodDeclaration, expected: WiringKind, ownerKind: WiringKind, scope: CanonicalFile): void {\n const report = scope.report;\n const statements = method.body?.statements;\n const returned = statements?.length === 1 && ts.isReturnStatement(statements[0]) ? statements[0].expression : undefined;\n if (returned === undefined || !ts.isArrayLiteralExpression(returned)) {\n report(method, 'Getter body must be exactly return [new NamedModule(preparedInputs)]; no delegation, spreads, helpers or conditions.');\n return;\n }\n for (const element of returned.elements) {\n if (!ts.isNewExpression(element) || this.types.kind(element.expression) !== expected) {\n report(element, `Select a named framework ${expected} instance; nested arrays and AppWiring children are forbidden.`);\n continue;\n }\n this.placementProblems(element.expression, expected, ownerKind, scope);\n for (const argument of element.arguments ?? []) {\n if (!this.prepared(argument)) report(argument, 'Pass prepared inputs or a named WiringPolicy; no callbacks, topology wrappers or computed setup.');\n }\n }\n }\n\n /**\n * Proven through the resolved declaration: a selected module lives in THIS file; a BindModule an\n * AppWiring selects may instead live in a library owner's canonical wiring.ts, and a library\n * Wiring always does. The extractor additionally proves that file is the owner's src/wiring.ts.\n */\n private placementProblems(selected: ts.Expression, expected: WiringKind, ownerKind: WiringKind, scope: CanonicalFile): void {\n const declared = this.types.declaration(selected)?.getSourceFile();\n const where = declared === undefined ? 'an unresolved file' : declared.fileName;\n const canonical = declared !== undefined && /(?:^|[\\\\/])wiring\\.(?:d\\.)?ts$/.test(declared.fileName);\n if (expected !== 'wiring') {\n if (declared === scope.file) return;\n if (expected === 'binding' && ownerKind === 'app' && canonical) return;\n const role = expected === 'binding' ? 'BindModule' : 'RouteModule';\n const library = expected === 'binding' && ownerKind === 'app' ? \", or in its library owner's canonical src/wiring.ts\" : '';\n scope.report(selected, `${selected.getText()} is declared in ${where}; declare this ${role} class, with its registrations, here in wiring.ts beside the Wiring class that selects it${library}.`);\n return;\n }\n if (canonical) return;\n scope.report(selected, `Library Wiring ${selected.getText()} is declared in ${where}; select a Wiring declared in its library's canonical src/wiring.ts.`);\n }\n\n private prepared(expression: ts.Expression): boolean {\n if (ts.isIdentifier(expression) || ts.isLiteralExpression(expression)) return true;\n if (ts.isPropertyAccessExpression(expression)) return this.prepared(expression.expression);\n if ([ts.SyntaxKind.TrueKeyword, ts.SyntaxKind.FalseKeyword, ts.SyntaxKind.ThisKeyword].includes(expression.kind)) return true;\n if (!ts.isNewExpression(expression)) return false;\n return this.types.isFramework(expression.expression, 'WiringPolicy');\n }\n\n private configureProblems(statement: ts.Statement, scope: CanonicalFile): void {\n const report = scope.report;\n if (ts.isIfStatement(statement) && ts.isPropertyAccessExpression(statement.expression) && statement.expression.name.text === 'enabled' && this.types.isPolicy(statement.expression.expression) && statement.elseStatement === undefined) {\n const body = ts.isBlock(statement.thenStatement) ? statement.thenStatement.statements : [statement.thenStatement];\n for (const child of body) this.configureProblems(child, scope);\n return;\n }\n const written = ts.isExpressionStatement(statement) || ts.isReturnStatement(statement) ? statement.expression : undefined;\n const expression = written !== undefined && ts.isAwaitExpression(written) ? written.expression : written;\n if (expression === undefined || (!ts.isCallExpression(expression) && !ts.isNewExpression(expression))) {\n report(statement, 'configure contains only registration declarations (binder DI binds, clients created and bound, external vendor bindings, provider recipes, routes, filters) and named policy conditions.');\n return;\n }\n if (LEGACY_TOPOLOGY.test(expression.getText())) {\n report(expression, 'Removed topology shape (rpcTarget, a ContainerModule, a plan wrapper, RuntimeClients/RuntimeTaskClients, provideRpcClient or ExternalContractUse); register through the binder: binder.createRpcClientAndBind(Api, deployment), binder.createPubSubClientAndBind(Api, deployment), binder.bindExternal(Api, VendorImpl).');\n return;\n }\n if (!this.registration(expression, scope)) {\n report(expression, 'Use a recognized registration declaration: binder.bind(...) chains, binder.createRpcClientAndBind(Api, deployment, options?), binder.createPubSubClientAndBind(Api, deployment, options?), binder.bindExternal(Api, VendorImpl), browser binder.provide(...recipes), router.addRoutes/addFilter. Move custom setup into imported implementations, and give a vendor ContainerModule its own library BindModule in that library\\'s canonical wiring.ts.');\n return;\n }\n for (const argument of this.registrationArguments(expression)) {\n const offending = this.offending(argument, scope);\n if (offending !== undefined)\n report(offending, 'Pass declarative registration arguments: tokens, classes, prepared fields, literals, named factory or initializer references, provider recipe objects and calls, and short DI factory callbacks such as (ctx) => ctx.get(Token). Move computed setup, environment reads, helper calls of this owner and callback bodies into imported implementations or prepared constructor inputs.');\n }\n }\n\n private registration(expression: ts.CallExpression | ts.NewExpression, scope: CanonicalFile): boolean {\n if (ts.isNewExpression(expression)) return false;\n if (!ts.isPropertyAccessExpression(expression.expression)) return false;\n const name = expression.expression.name.text;\n const receiver = this.unwrap(expression.expression.expression);\n const file = this.signatureFile(expression);\n if (file === undefined) return false;\n if (!WEBPIECES_SDK.test(file) && !INVERSIFY.test(file)) return false;\n if (ts.isCallExpression(receiver)) return this.registration(receiver, scope);\n return REGISTRATION_ROOTS.includes(name) && this.path(receiver);\n }\n\n /** Every argument of every call in a registration chain. */\n private registrationArguments(expression: ts.CallExpression | ts.NewExpression): ts.Expression[] {\n const own = [...(expression.arguments ?? [])];\n if (!ts.isCallExpression(expression) || !ts.isPropertyAccessExpression(expression.expression)) return own;\n const receiver = this.unwrap(expression.expression.expression);\n if (ts.isCallExpression(receiver)) return [...own, ...this.registrationArguments(receiver)];\n return own;\n }\n\n /** Returns the first non-declarative node inside a registration argument, or undefined. */\n private offending(expression: ts.Expression, scope: CanonicalFile): ts.Node | undefined {\n const value = this.unwrap(expression);\n if (this.literal(value)) return undefined;\n if (ts.isIdentifier(value) || value.kind === ts.SyntaxKind.ThisKeyword || ts.isPropertyAccessExpression(value))\n return this.path(value) ? undefined : value;\n if (ts.isArrayLiteralExpression(value)) {\n for (const element of value.elements) {\n const found = this.offending(ts.isSpreadElement(element) ? element.expression : element, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (ts.isObjectLiteralExpression(value)) {\n for (const property of value.properties) {\n if (ts.isShorthandPropertyAssignment(property)) {\n if (ENVIRONMENT.has(property.name.text)) return property;\n continue;\n }\n const initializer = ts.isPropertyAssignment(property) && !ts.isComputedPropertyName(property.name)\n ? property.initializer : ts.isSpreadAssignment(property) ? property.expression : undefined;\n if (initializer === undefined) return property;\n const found = this.offending(initializer, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (ts.isNewExpression(value)) {\n if (!this.path(value.expression) || LEGACY_TOPOLOGY.test(value.expression.getText())) return value;\n return this.firstOffending(value.arguments ?? [], scope);\n }\n if (ts.isCallExpression(value)) {\n const callee = value.expression;\n const receiverOk = this.path(callee) ||\n (ts.isPropertyAccessExpression(callee) && ts.isNewExpression(callee.expression) && this.offending(callee.expression, scope) === undefined);\n if (!receiverOk || !this.outsideOwner(value, scope)) return value;\n return this.firstOffending(value.arguments, scope);\n }\n if (ts.isArrowFunction(value)) return this.factoryCallback(value) ? undefined : value;\n return value;\n }\n\n private firstOffending(values: readonly ts.Expression[], scope: CanonicalFile): ts.Node | undefined {\n for (const value of values) {\n const found = this.offending(value, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n\n /**\n * A provider recipe or vendor factory (Angular, webpieces, another library) is a declaration; a\n * call into this owner's own helpers would hide the registrations it returns.\n */\n private outsideOwner(call: ts.CallExpression, scope: CanonicalFile): boolean {\n const file = this.signatureFile(call);\n if (file === undefined) return false;\n return file.includes('/node_modules/') || !file.startsWith(scope.ownerRoot.replace(/\\\\/g, '/') + '/');\n }\n\n /** A short DI factory: `(ctx) => ctx.get(Token)`, `(dep) => dep.build()` or `(dep) => new Named(dep)`. */\n private factoryCallback(arrow: ts.ArrowFunction): boolean {\n if (ts.isBlock(arrow.body)) return false;\n const parameters = new Set(arrow.parameters.map((parameter: ts.ParameterDeclaration) => parameter.name.getText()));\n const body = this.unwrap(arrow.body);\n const simple = (argument: ts.Expression): boolean => this.literal(this.unwrap(argument)) || this.path(this.unwrap(argument));\n if (ts.isNewExpression(body)) return this.path(body.expression) && (body.arguments ?? []).every(simple);\n if (!ts.isCallExpression(body) || !ts.isPropertyAccessExpression(body.expression)) return false;\n const receiver = body.expression.expression;\n return ts.isIdentifier(receiver) && parameters.has(receiver.text) && body.arguments.every(simple);\n }\n\n /** An identifier, `this`, or a property path over them that does not read the environment. */\n private path(expression: ts.Expression): boolean {\n if (ts.isIdentifier(expression)) return !ENVIRONMENT.has(expression.text);\n if (expression.kind === ts.SyntaxKind.ThisKeyword) return true;\n return ts.isPropertyAccessExpression(expression) && this.path(expression.expression);\n }\n\n private literal(expression: ts.Expression): boolean {\n if (ts.isStringLiteralLike(expression) || ts.isNumericLiteral(expression)) return true;\n if (ts.isPrefixUnaryExpression(expression)) return ts.isNumericLiteral(expression.operand);\n return [ts.SyntaxKind.TrueKeyword, ts.SyntaxKind.FalseKeyword, ts.SyntaxKind.NullKeyword].includes(expression.kind) ||\n (ts.isIdentifier(expression) && expression.text === 'undefined');\n }\n\n private unwrap(expression: ts.Expression): ts.Expression {\n if (ts.isParenthesizedExpression(expression) || ts.isAsExpression(expression) || ts.isNonNullExpression(expression) || ts.isSatisfiesExpression(expression))\n return this.unwrap(expression.expression);\n return expression;\n }\n\n private signatureFile(call: ts.CallExpression): string | undefined {\n const declaration = this.checker.getResolvedSignature(call)?.declaration;\n return declaration === undefined ? undefined : path.resolve(declaration.getSourceFile().fileName).replace(/\\\\/g, '/');\n }\n}\n"]}
1
+ {"version":3,"file":"wiring-format.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-wiring/wiring-format.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uDAAiC;AACjC,0DAAgE;AAChE,iDAA+D;AAC/D,2DAA8D;AAE9D,MAAM,aAAa,GAAG,yJAAyJ,CAAC;AAChL,MAAM,SAAS,GAAG,gDAAgD,CAAC;AACnE;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAChJ,6GAA6G;AAC7G,MAAM,eAAe,GAAG,kNAAkN,CAAC;AAC3O,wDAAwD;AACxD,MAAM,eAAe,GAAqC,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;AACxI,iGAAiG;AACjG,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAExI,uFAAuF;AACvF,MAAM,aAAa;IAEF;IACA;IACA;IAHb,YACa,IAAmB,EACnB,SAAiB,EACjB,MAAgD;QAFhD,SAAI,GAAJ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,IAAI,CAAC,EAAE,WAAW,CAAC;QACzE,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1H,CAAC;CACJ;AAhSD,oCAgSC","sourcesContent":["import * as path from 'path';\nimport * as ts from 'typescript';\nimport { Option, RuleFailError } from '@webpieces/rules-config';\nimport { WiringSourceTypes, WiringKind } from './source-types';\nimport { CanonicalClientBindings } from './canonical-clients';\n\nconst WEBPIECES_SDK = /(?:\\/packages\\/(?:http|cloud)\\/|\\/node_modules\\/@webpieces\\/)(?:http-routing|http-client-node|http-client-browser|http-client-core|cloudtasks-client)\\//;\nconst INVERSIFY = /\\/node_modules\\/(?:@inversifyjs\\/|inversify\\/)/;\n/**\n * Methods that START a registration on the host's binder or router: a DI bind, a client created and\n * bound, a vendor implementation bound to its external contract, a browser provider recipe, a route\n * or a filter.\n */\nconst REGISTRATION_ROOTS = ['bind', 'createRpcClientAndBind', 'createPubSubClientAndBind', 'bindExternal', 'provide', 'addRoutes', 'addFilter'];\n/** Removed authoring shapes; their presence means an old wrapper, helper or an anonymous module survived. */\nconst LEGACY_TOPOLOGY = /\\b(?:rpcTarget|RpcTarget|ContainerModule|ServerWiring|ServerWiringOptions|BrowserWiring|getRuntimeWiring|RuntimeClients|RuntimeTaskClients|provideRpcClient|ExternalContractUse|BrowserBindings|BindingModule)\\b/;\n/** Getters renamed with BindingModule -> BindModule. */\nconst RENAMED_GETTERS: Readonly<Record<string, string>> = { getBindingModules: 'getBindModules', getRoutingModules: 'getRouteModules' };\n/** Environment discovery belongs in prepared configuration, never in a registration argument. */\nconst ENVIRONMENT = new Set(['process', 'window', 'document', 'localStorage', 'sessionStorage', 'navigator', 'location', 'globalThis']);\n\n/** The one canonical file being checked, its owner directory and where problems go. */\nclass CanonicalFile {\n constructor(\n readonly file: ts.SourceFile,\n readonly ownerRoot: string,\n readonly report: (node: ts.Node, message: string) => void,\n ) {}\n}\n\n/**\n * One canonical-file grammar. Each owner's src/wiring.ts holds its Wiring/AppWiring class AND the\n * BindModule/RouteModule classes it selects, with their actual registrations. A library owner's\n * canonical wiring.ts may export only BindModules. Symbol resolution may read imports; format\n * checking never does.\n */\nexport class WiringFormat {\n private readonly types: WiringSourceTypes;\n\n constructor(private readonly checker: ts.TypeChecker, private readonly maxLines: number) {\n this.types = new WiringSourceTypes(checker);\n }\n\n problems(file: ts.SourceFile): string[] {\n if (!/(?:^|\\/)wiring\\.ts$/.test(file.fileName)) return [];\n const problems: string[] = new CanonicalClientBindings(this.checker).problems(file);\n const report = (node: ts.Node, message: string): void => {\n const at = file.getLineAndCharacterOfPosition(node.getStart(file));\n problems.push(`${file.fileName}:${at.line + 1}:${at.character + 1}: ${message}`);\n };\n const scope = new CanonicalFile(file, path.dirname(path.dirname(path.resolve(file.fileName))), report);\n const lines = file.text.trimEnd().split('\\n').length;\n if (lines > this.maxLines)\n report(\n file,\n `wiring.ts has ${lines} lines, above maxLines ${this.maxLines}. Keep every BindModule/RouteModule and its registrations here beside the Wiring class; shorten the file by moving configuration building, translations, environment discovery and initializer or factory bodies into imported implementations, or give a cohesive group its own library owner with its own wiring.ts.`,\n );\n for (const statement of file.statements) {\n if (ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement)) continue;\n if (!ts.isClassDeclaration(statement)) {\n report(statement, 'Only imports, exports and named declarative classes belong in wiring.ts.');\n continue;\n }\n const kind = this.types.kind(statement);\n if (kind === undefined) {\n report(statement, LEGACY_TOPOLOGY.test(statement.getText())\n ? 'Removed authoring shape (BindingModule, ExternalContractUse, RuntimeClients, provideRpcClient, BrowserBindings); implement BindModule and register through the binder.'\n : 'Implement the framework Wiring, AppWiring, BindModule or RouteModule contract.');\n continue;\n }\n this.classProblems(statement, kind, scope);\n }\n return problems;\n }\n\n assert(problems: readonly string[]): void {\n if (problems.length === 0) return;\n throw new RuleFailError('wiring-format', problems.join('\\n'), undefined, undefined, [\n new Option(\n \"Declare each owner's Wiring/AppWiring class together with its named BindModule/RouteModule classes and their registrations in its src/wiring.ts, selected by literal getters (getBindModules/getRouteModules/getWirings); an app may select a BindModule declared in a library owner's canonical src/wiring.ts. Register through the binder (binder.bind, binder.createRpcClientAndBind, binder.createPubSubClientAndBind, binder.bindExternal, browser binder.provide) and the router. Keep configuration building, environment discovery and initializer/factory bodies in imported implementations, and keep named WiringPolicy conditions explicit.\",\n true,\n ),\n ]);\n }\n\n private classProblems(declaration: ts.ClassDeclaration, kind: WiringKind, scope: CanonicalFile): void {\n const report = scope.report;\n for (const member of declaration.members) {\n if (ts.isConstructorDeclaration(member)) {\n if (member.body !== undefined && member.body.statements.length > 0)\n report(member, 'Use constructor parameter properties to store prepared inputs; no setup logic.');\n continue;\n }\n if (!ts.isMethodDeclaration(member)) {\n report(member, 'Store prepared inputs in constructor parameter properties.');\n continue;\n }\n const name = member.name.getText();\n if (Object.hasOwn(RENAMED_GETTERS, name)) {\n report(member, `${name} was renamed to ${RENAMED_GETTERS[name]}.`);\n } else if (['getBindModules', 'getRouteModules', 'getWirings'].includes(name)) {\n const expected = name === 'getWirings' ? 'wiring' : name === 'getBindModules' ? 'binding' : 'routing';\n if (name === 'getWirings' && kind !== 'app')\n report(member, 'Only AppWiring can declare getWirings; libraries cannot compose libraries.');\n this.arrayProblems(member, expected, kind, scope);\n } else if (name === 'configure' && ['binding', 'routing'].includes(kind)) {\n for (const statement of member.body?.statements ?? []) this.configureProblems(statement, scope);\n } else if (name !== 'getHeaders' || kind !== 'app')\n report(member, 'Keep only canonical selection getters and short configure declarations; getRuntimeWiring and helper methods were removed.');\n }\n if (kind === 'binding' || kind === 'routing') {\n const configure = this.types.method(declaration, 'configure');\n if (configure !== undefined && configure.getSourceFile() !== scope.file)\n report(declaration, `configure is inherited from ${configure.getSourceFile().fileName}; declare this module's registrations in its own configure here in wiring.ts.`);\n }\n if (kind === 'app' || kind === 'wiring') {\n // getRouteModules is Node-only (its Wiring type requires it); the browser has no route channel.\n const names = ['getBindModules', 'getRouteModules', ...(kind === 'app' ? ['getWirings'] : [])];\n for (const name of names) {\n const method = this.types.method(declaration, name);\n if (method === undefined) {\n if (name !== 'getRouteModules') report(declaration, `Missing ${name} literal array getter.`);\n } else if (method.getSourceFile() !== scope.file)\n report(declaration, `${name} is inherited from ${method.getSourceFile().fileName}; declare the selection getter on this class in wiring.ts.`);\n }\n if (kind === 'wiring' && this.types.method(declaration, 'getWirings') !== undefined)\n report(declaration, 'A library Wiring must not inherit getWirings.');\n }\n }\n\n private arrayProblems(method: ts.MethodDeclaration, expected: WiringKind, ownerKind: WiringKind, scope: CanonicalFile): void {\n const report = scope.report;\n const statements = method.body?.statements;\n const returned = statements?.length === 1 && ts.isReturnStatement(statements[0]) ? statements[0].expression : undefined;\n if (returned === undefined || !ts.isArrayLiteralExpression(returned)) {\n report(method, 'Getter body must be exactly return [new NamedModule(preparedInputs)]; no delegation, spreads, helpers or conditions.');\n return;\n }\n for (const element of returned.elements) {\n if (!ts.isNewExpression(element) || this.types.kind(element.expression) !== expected) {\n report(element, `Select a named framework ${expected} instance; nested arrays and AppWiring children are forbidden.`);\n continue;\n }\n this.placementProblems(element.expression, expected, ownerKind, scope);\n for (const argument of element.arguments ?? []) {\n if (!this.prepared(argument)) report(argument, 'Pass prepared inputs or a named WiringPolicy; no callbacks, topology wrappers or computed setup.');\n }\n }\n }\n\n /**\n * Proven through the resolved declaration: a selected module lives in THIS file; a BindModule an\n * AppWiring selects may instead live in a library owner's canonical wiring.ts, and a library\n * Wiring always does. The extractor additionally proves that file is the owner's src/wiring.ts.\n */\n private placementProblems(selected: ts.Expression, expected: WiringKind, ownerKind: WiringKind, scope: CanonicalFile): void {\n const declared = this.types.declaration(selected)?.getSourceFile();\n const where = declared === undefined ? 'an unresolved file' : declared.fileName;\n const canonical = declared !== undefined && /(?:^|[\\\\/])wiring\\.(?:d\\.)?ts$/.test(declared.fileName);\n if (expected !== 'wiring') {\n if (declared === scope.file) return;\n if (expected === 'binding' && ownerKind === 'app' && canonical) return;\n const role = expected === 'binding' ? 'BindModule' : 'RouteModule';\n const library = expected === 'binding' && ownerKind === 'app' ? \", or in its library owner's canonical src/wiring.ts\" : '';\n scope.report(selected, `${selected.getText()} is declared in ${where}; declare this ${role} class, with its registrations, here in wiring.ts beside the Wiring class that selects it${library}.`);\n return;\n }\n if (canonical) return;\n scope.report(selected, `Library Wiring ${selected.getText()} is declared in ${where}; select a Wiring declared in its library's canonical src/wiring.ts.`);\n }\n\n private prepared(expression: ts.Expression): boolean {\n if (ts.isIdentifier(expression) || ts.isLiteralExpression(expression)) return true;\n if (ts.isPropertyAccessExpression(expression)) return this.prepared(expression.expression);\n if ([ts.SyntaxKind.TrueKeyword, ts.SyntaxKind.FalseKeyword, ts.SyntaxKind.ThisKeyword].includes(expression.kind)) return true;\n if (!ts.isNewExpression(expression)) return false;\n return this.types.isFramework(expression.expression, 'WiringPolicy');\n }\n\n private configureProblems(statement: ts.Statement, scope: CanonicalFile): void {\n const report = scope.report;\n if (ts.isIfStatement(statement) && ts.isPropertyAccessExpression(statement.expression) && statement.expression.name.text === 'enabled' && this.types.isPolicy(statement.expression.expression) && statement.elseStatement === undefined) {\n const body = ts.isBlock(statement.thenStatement) ? statement.thenStatement.statements : [statement.thenStatement];\n for (const child of body) this.configureProblems(child, scope);\n return;\n }\n const written = ts.isExpressionStatement(statement) || ts.isReturnStatement(statement) ? statement.expression : undefined;\n const expression = written !== undefined && ts.isAwaitExpression(written) ? written.expression : written;\n if (expression === undefined || (!ts.isCallExpression(expression) && !ts.isNewExpression(expression))) {\n report(statement, 'configure contains only registration declarations (binder DI binds, clients created and bound, external vendor bindings, provider recipes, routes, filters) and named policy conditions.');\n return;\n }\n if (LEGACY_TOPOLOGY.test(expression.getText())) {\n report(expression, 'Removed topology shape (rpcTarget, a ContainerModule, a plan wrapper, RuntimeClients/RuntimeTaskClients, provideRpcClient or ExternalContractUse); register through the binder: binder.createRpcClientAndBind(Api, deployment), binder.createPubSubClientAndBind(Api, deployment), binder.bindExternal(Api, VendorImpl) (browser: binder.bindExternal(Api, new UseClass(Vendor) | new UseExisting(Token))).');\n return;\n }\n if (!this.registration(expression, scope)) {\n report(expression, 'Use a recognized registration declaration: binder.bind(...) chains, binder.createRpcClientAndBind(Api, deployment, options?), binder.createPubSubClientAndBind(Api, deployment, options?), binder.bindExternal(Api, VendorImpl) (browser: new UseClass(Vendor) | new UseExisting(Token)), browser binder.provide(...recipes), router.addRoutes/addFilter. Move custom setup into imported implementations, and give a vendor ContainerModule its own library BindModule in that library\\'s canonical wiring.ts.');\n return;\n }\n for (const argument of this.registrationArguments(expression)) {\n const offending = this.offending(argument, scope);\n if (offending !== undefined)\n report(offending, 'Pass declarative registration arguments: tokens, classes, prepared fields, literals, named factory or initializer references, provider recipe objects and calls, and short DI factory callbacks such as (ctx) => ctx.get(Token). Move computed setup, environment reads, helper calls of this owner and callback bodies into imported implementations or prepared constructor inputs.');\n }\n }\n\n private registration(expression: ts.CallExpression | ts.NewExpression, scope: CanonicalFile): boolean {\n if (ts.isNewExpression(expression)) return false;\n if (!ts.isPropertyAccessExpression(expression.expression)) return false;\n const name = expression.expression.name.text;\n const receiver = this.unwrap(expression.expression.expression);\n const file = this.signatureFile(expression);\n if (file === undefined) return false;\n if (!WEBPIECES_SDK.test(file) && !INVERSIFY.test(file)) return false;\n if (ts.isCallExpression(receiver)) return this.registration(receiver, scope);\n return REGISTRATION_ROOTS.includes(name) && this.path(receiver);\n }\n\n /** Every argument of every call in a registration chain. */\n private registrationArguments(expression: ts.CallExpression | ts.NewExpression): ts.Expression[] {\n const own = [...(expression.arguments ?? [])];\n if (!ts.isCallExpression(expression) || !ts.isPropertyAccessExpression(expression.expression)) return own;\n const receiver = this.unwrap(expression.expression.expression);\n if (ts.isCallExpression(receiver)) return [...own, ...this.registrationArguments(receiver)];\n return own;\n }\n\n /** Returns the first non-declarative node inside a registration argument, or undefined. */\n private offending(expression: ts.Expression, scope: CanonicalFile): ts.Node | undefined {\n const value = this.unwrap(expression);\n if (this.literal(value)) return undefined;\n if (ts.isIdentifier(value) || value.kind === ts.SyntaxKind.ThisKeyword || ts.isPropertyAccessExpression(value))\n return this.path(value) ? undefined : value;\n if (ts.isArrayLiteralExpression(value)) {\n for (const element of value.elements) {\n const found = this.offending(ts.isSpreadElement(element) ? element.expression : element, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (ts.isObjectLiteralExpression(value)) {\n for (const property of value.properties) {\n if (ts.isShorthandPropertyAssignment(property)) {\n if (ENVIRONMENT.has(property.name.text)) return property;\n continue;\n }\n const initializer = ts.isPropertyAssignment(property) && !ts.isComputedPropertyName(property.name)\n ? property.initializer : ts.isSpreadAssignment(property) ? property.expression : undefined;\n if (initializer === undefined) return property;\n const found = this.offending(initializer, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n if (ts.isNewExpression(value)) {\n if (!this.path(value.expression) || LEGACY_TOPOLOGY.test(value.expression.getText())) return value;\n return this.firstOffending(value.arguments ?? [], scope);\n }\n if (ts.isCallExpression(value)) {\n const callee = value.expression;\n const receiverOk = this.path(callee) ||\n (ts.isPropertyAccessExpression(callee) && ts.isNewExpression(callee.expression) && this.offending(callee.expression, scope) === undefined);\n if (!receiverOk || !this.outsideOwner(value, scope)) return value;\n return this.firstOffending(value.arguments, scope);\n }\n if (ts.isArrowFunction(value)) return this.factoryCallback(value) ? undefined : value;\n return value;\n }\n\n private firstOffending(values: readonly ts.Expression[], scope: CanonicalFile): ts.Node | undefined {\n for (const value of values) {\n const found = this.offending(value, scope);\n if (found !== undefined) return found;\n }\n return undefined;\n }\n\n /**\n * A provider recipe or vendor factory (Angular, webpieces, another library) is a declaration; a\n * call into this owner's own helpers would hide the registrations it returns.\n */\n private outsideOwner(call: ts.CallExpression, scope: CanonicalFile): boolean {\n const file = this.signatureFile(call);\n if (file === undefined) return false;\n return file.includes('/node_modules/') || !file.startsWith(scope.ownerRoot.replace(/\\\\/g, '/') + '/');\n }\n\n /** A short DI factory: `(ctx) => ctx.get(Token)`, `(dep) => dep.build()` or `(dep) => new Named(dep)`. */\n private factoryCallback(arrow: ts.ArrowFunction): boolean {\n if (ts.isBlock(arrow.body)) return false;\n const parameters = new Set(arrow.parameters.map((parameter: ts.ParameterDeclaration) => parameter.name.getText()));\n const body = this.unwrap(arrow.body);\n const simple = (argument: ts.Expression): boolean => this.literal(this.unwrap(argument)) || this.path(this.unwrap(argument));\n if (ts.isNewExpression(body)) return this.path(body.expression) && (body.arguments ?? []).every(simple);\n if (!ts.isCallExpression(body) || !ts.isPropertyAccessExpression(body.expression)) return false;\n const receiver = body.expression.expression;\n return ts.isIdentifier(receiver) && parameters.has(receiver.text) && body.arguments.every(simple);\n }\n\n /** An identifier, `this`, or a property path over them that does not read the environment. */\n private path(expression: ts.Expression): boolean {\n if (ts.isIdentifier(expression)) return !ENVIRONMENT.has(expression.text);\n if (expression.kind === ts.SyntaxKind.ThisKeyword) return true;\n return ts.isPropertyAccessExpression(expression) && this.path(expression.expression);\n }\n\n private literal(expression: ts.Expression): boolean {\n if (ts.isStringLiteralLike(expression) || ts.isNumericLiteral(expression)) return true;\n if (ts.isPrefixUnaryExpression(expression)) return ts.isNumericLiteral(expression.operand);\n return [ts.SyntaxKind.TrueKeyword, ts.SyntaxKind.FalseKeyword, ts.SyntaxKind.NullKeyword].includes(expression.kind) ||\n (ts.isIdentifier(expression) && expression.text === 'undefined');\n }\n\n private unwrap(expression: ts.Expression): ts.Expression {\n if (ts.isParenthesizedExpression(expression) || ts.isAsExpression(expression) || ts.isNonNullExpression(expression) || ts.isSatisfiesExpression(expression))\n return this.unwrap(expression.expression);\n return expression;\n }\n\n private signatureFile(call: ts.CallExpression): string | undefined {\n const declaration = this.checker.getResolvedSignature(call)?.declaration;\n return declaration === undefined ? undefined : path.resolve(declaration.getSourceFile().fileName).replace(/\\\\/g, '/');\n }\n}\n"]}
package/src/rule-help.js CHANGED
@@ -10,7 +10,7 @@ exports.ruleHelp = {
10
10
  'nx-wiring': new rules_sdk_1.RuleHelp('Wire the required validation targets into the Nx execution graph.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
11
11
  'di-graph': new rules_sdk_1.RuleHelp('Generate and validate dependency-injection design graphs.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
12
12
  'missing-design-annotation': new rules_sdk_1.RuleHelp('Declare the application design roots required for DI analysis.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
13
- 'validate-architecture-unchanged': new rules_sdk_1.RuleHelp('Keep the committed architecture graph aligned with current dependencies.', 'In src/wiring.ts register clients through the BindModule\'s Binder: binder.createRpcClientAndBind(Api, deployment, new ClientBindOptions(token?, filters?)) and binder.createPubSubClientAndBind(Api, deployment, new PubSubBindOptions(token?)) from @webpieces/http-routing, binder.bindExternal(Api, VendorImpl) for vendor contracts, and the browser binder.createRpcClientAndBind(Api, deployment) from @webpieces/http-client-browser. wiring-format checks canonical wiring.ts in all participating owners; preserve tokens and filters. Review graph changes and runtime-deps.json candidates explicitly.'),
13
+ 'validate-architecture-unchanged': new rules_sdk_1.RuleHelp('Keep the committed architecture graph aligned with current dependencies.', 'In src/wiring.ts register clients through the BindModule\'s Binder: binder.createRpcClientAndBind(Api, deployment, new ClientBindOptions(token?, filters?)) and binder.createPubSubClientAndBind(Api, deployment, new PubSubBindOptions(token?)) from @webpieces/http-routing, binder.bindExternal(Api, VendorImpl) for vendor contracts, and the browser binder.createRpcClientAndBind(Api, deployment) and binder.bindExternal(Api, new UseClass(Vendor) | new UseExisting(Token)) from @webpieces/http-client-browser. wiring-format checks canonical wiring.ts in all participating owners; preserve tokens and filters. Review graph changes and runtime-deps.json candidates explicitly.'),
14
14
  'validate-no-architecture-cycles': new rules_sdk_1.RuleHelp('Keep the project dependency architecture free of cycles.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
15
15
  'validate-packagejson': new rules_sdk_1.RuleHelp('Align package dependencies with declared project dependencies.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
16
16
  'validate-versions-locked': new rules_sdk_1.RuleHelp('Pin dependency versions consistently across governed projects.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
@@ -1 +1 @@
1
- {"version":3,"file":"rule-help.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/rule-help.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD,gEAAgE;AACnD,QAAA,QAAQ,GAAuC;IACxD,eAAe,EAAE,IAAI,oBAAQ,CAAC,kJAAkJ,EAAE,qyBAAqyB,CAAC;IACx9B,uBAAuB,EAAE,IAAI,oBAAQ,CACjC,kDAAkD,EAClD,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,2DAA2D,EAC3D,sIAAsI,CACzI;IACD,WAAW,EAAE,IAAI,oBAAQ,CACrB,mEAAmE,EACnE,sIAAsI,CACzI;IACD,UAAU,EAAE,IAAI,oBAAQ,CACpB,2DAA2D,EAC3D,sIAAsI,CACzI;IACD,2BAA2B,EAAE,IAAI,oBAAQ,CACrC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,iCAAiC,EAAE,IAAI,oBAAQ,CAC3C,0EAA0E,EAC1E,olBAAolB,CACvlB;IACD,iCAAiC,EAAE,IAAI,oBAAQ,CAC3C,0DAA0D,EAC1D,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,0BAA0B,EAAE,IAAI,oBAAQ,CACpC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,8EAA8E,EAC9E,sIAAsI,CACzI;IACD,wBAAwB,EAAE,IAAI,oBAAQ,CAClC,qEAAqE,EACrE,sIAAsI,CACzI;IACD,uBAAuB,EAAE,IAAI,oBAAQ,CACjC,uEAAuE,EACvE,sIAAsI,CACzI;IACD,mBAAmB,EAAE,IAAI,oBAAQ,CAC7B,mEAAmE,EACnE,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,+DAA+D,EAC/D,sIAAsI,CACzI;IACD,cAAc,EAAE,IAAI,oBAAQ,CACxB,sDAAsD,EACtD,sIAAsI,CACzI;IACD,kBAAkB,EAAE,IAAI,oBAAQ,CAC5B,gEAAgE,EAChE,sIAAsI,CACzI;CACJ,CAAC","sourcesContent":["import { RuleHelp } from '@webpieces/rules-sdk';\n\n/** Owner-authored guidance consumed by the registry catalog. */\nexport const ruleHelp: Readonly<Record<string, RuleHelp>> = {\n 'wiring-format': new RuleHelp('Check every canonical wiring.ts: its Wiring/AppWiring class plus the BindModule/RouteModule classes it selects, with their actual registrations.', 'Declare each owner\\'s Wiring/AppWiring class beside its named BindModule/RouteModule classes and their registrations (binder.createRpcClientAndBind, binder.createPubSubClientAndBind, binder.bindExternal, binder.bind chains, browser binder.provide recipes, addRoutes, addFilter) in its src/wiring.ts; select them with literal getBindModules/getRouteModules/getWirings return arrays. An AppWiring may also select a BindModule declared in a library owner\\'s canonical src/wiring.ts, and only an AppWiring selects library Wirings. Keep constructors as prepared-input storage, keep configuration building, environment discovery and initializer/factory bodies in imported implementations, use direct service strings and explicit WiringPolicy declarations. Set maxLines explicitly (agreed upstream limit: 400).'),\n 'no-file-import-cycles': new RuleHelp(\n 'Keep each project free of circular file imports.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'runtime-architecture': new RuleHelp(\n 'Validate runtime service and API dependency declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'nx-wiring': new RuleHelp(\n 'Wire the required validation targets into the Nx execution graph.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'di-graph': new RuleHelp(\n 'Generate and validate dependency-injection design graphs.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'missing-design-annotation': new RuleHelp(\n 'Declare the application design roots required for DI analysis.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-architecture-unchanged': new RuleHelp(\n 'Keep the committed architecture graph aligned with current dependencies.',\n 'In src/wiring.ts register clients through the BindModule\\'s Binder: binder.createRpcClientAndBind(Api, deployment, new ClientBindOptions(token?, filters?)) and binder.createPubSubClientAndBind(Api, deployment, new PubSubBindOptions(token?)) from @webpieces/http-routing, binder.bindExternal(Api, VendorImpl) for vendor contracts, and the browser binder.createRpcClientAndBind(Api, deployment) from @webpieces/http-client-browser. wiring-format checks canonical wiring.ts in all participating owners; preserve tokens and filters. Review graph changes and runtime-deps.json candidates explicitly.',\n ),\n 'validate-no-architecture-cycles': new RuleHelp(\n 'Keep the project dependency architecture free of cycles.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-packagejson': new RuleHelp(\n 'Align package dependencies with declared project dependencies.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-versions-locked': new RuleHelp(\n 'Pin dependency versions consistently across governed projects.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-eslint-sync': new RuleHelp(\n 'Keep managed ESLint configuration synchronized with its installed templates.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-root-union-api-type': new RuleHelp(\n 'Use a stable named root API contract rather than a root union type.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-rules-for-openapi': new RuleHelp(\n 'Validate API contracts against their configured OpenAPI requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-rules-for-mcp': new RuleHelp(\n 'Validate API contracts against their configured MCP requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-lib-dependencies': new RuleHelp(\n 'Validate the configured API library dependency relationships.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-lib-path': new RuleHelp(\n 'Use the configured paths for API contract libraries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-folder': new RuleHelp(\n 'Align framework declarations with their project folder layout.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n};\n"]}
1
+ {"version":3,"file":"rule-help.js","sourceRoot":"","sources":["../../../../../packages/tooling/nx-webpieces-rules/src/rule-help.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD,gEAAgE;AACnD,QAAA,QAAQ,GAAuC;IACxD,eAAe,EAAE,IAAI,oBAAQ,CAAC,kJAAkJ,EAAE,qyBAAqyB,CAAC;IACx9B,uBAAuB,EAAE,IAAI,oBAAQ,CACjC,kDAAkD,EAClD,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,2DAA2D,EAC3D,sIAAsI,CACzI;IACD,WAAW,EAAE,IAAI,oBAAQ,CACrB,mEAAmE,EACnE,sIAAsI,CACzI;IACD,UAAU,EAAE,IAAI,oBAAQ,CACpB,2DAA2D,EAC3D,sIAAsI,CACzI;IACD,2BAA2B,EAAE,IAAI,oBAAQ,CACrC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,iCAAiC,EAAE,IAAI,oBAAQ,CAC3C,0EAA0E,EAC1E,gqBAAgqB,CACnqB;IACD,iCAAiC,EAAE,IAAI,oBAAQ,CAC3C,0DAA0D,EAC1D,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,0BAA0B,EAAE,IAAI,oBAAQ,CACpC,gEAAgE,EAChE,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,8EAA8E,EAC9E,sIAAsI,CACzI;IACD,wBAAwB,EAAE,IAAI,oBAAQ,CAClC,qEAAqE,EACrE,sIAAsI,CACzI;IACD,uBAAuB,EAAE,IAAI,oBAAQ,CACjC,uEAAuE,EACvE,sIAAsI,CACzI;IACD,mBAAmB,EAAE,IAAI,oBAAQ,CAC7B,mEAAmE,EACnE,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,+DAA+D,EAC/D,sIAAsI,CACzI;IACD,cAAc,EAAE,IAAI,oBAAQ,CACxB,sDAAsD,EACtD,sIAAsI,CACzI;IACD,kBAAkB,EAAE,IAAI,oBAAQ,CAC5B,gEAAgE,EAChE,sIAAsI,CACzI;CACJ,CAAC","sourcesContent":["import { RuleHelp } from '@webpieces/rules-sdk';\n\n/** Owner-authored guidance consumed by the registry catalog. */\nexport const ruleHelp: Readonly<Record<string, RuleHelp>> = {\n 'wiring-format': new RuleHelp('Check every canonical wiring.ts: its Wiring/AppWiring class plus the BindModule/RouteModule classes it selects, with their actual registrations.', 'Declare each owner\\'s Wiring/AppWiring class beside its named BindModule/RouteModule classes and their registrations (binder.createRpcClientAndBind, binder.createPubSubClientAndBind, binder.bindExternal, binder.bind chains, browser binder.provide recipes, addRoutes, addFilter) in its src/wiring.ts; select them with literal getBindModules/getRouteModules/getWirings return arrays. An AppWiring may also select a BindModule declared in a library owner\\'s canonical src/wiring.ts, and only an AppWiring selects library Wirings. Keep constructors as prepared-input storage, keep configuration building, environment discovery and initializer/factory bodies in imported implementations, use direct service strings and explicit WiringPolicy declarations. Set maxLines explicitly (agreed upstream limit: 400).'),\n 'no-file-import-cycles': new RuleHelp(\n 'Keep each project free of circular file imports.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'runtime-architecture': new RuleHelp(\n 'Validate runtime service and API dependency declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'nx-wiring': new RuleHelp(\n 'Wire the required validation targets into the Nx execution graph.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'di-graph': new RuleHelp(\n 'Generate and validate dependency-injection design graphs.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'missing-design-annotation': new RuleHelp(\n 'Declare the application design roots required for DI analysis.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-architecture-unchanged': new RuleHelp(\n 'Keep the committed architecture graph aligned with current dependencies.',\n 'In src/wiring.ts register clients through the BindModule\\'s Binder: binder.createRpcClientAndBind(Api, deployment, new ClientBindOptions(token?, filters?)) and binder.createPubSubClientAndBind(Api, deployment, new PubSubBindOptions(token?)) from @webpieces/http-routing, binder.bindExternal(Api, VendorImpl) for vendor contracts, and the browser binder.createRpcClientAndBind(Api, deployment) and binder.bindExternal(Api, new UseClass(Vendor) | new UseExisting(Token)) from @webpieces/http-client-browser. wiring-format checks canonical wiring.ts in all participating owners; preserve tokens and filters. Review graph changes and runtime-deps.json candidates explicitly.',\n ),\n 'validate-no-architecture-cycles': new RuleHelp(\n 'Keep the project dependency architecture free of cycles.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-packagejson': new RuleHelp(\n 'Align package dependencies with declared project dependencies.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-versions-locked': new RuleHelp(\n 'Pin dependency versions consistently across governed projects.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'validate-eslint-sync': new RuleHelp(\n 'Keep managed ESLint configuration synchronized with its installed templates.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-root-union-api-type': new RuleHelp(\n 'Use a stable named root API contract rather than a root union type.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-rules-for-openapi': new RuleHelp(\n 'Validate API contracts against their configured OpenAPI requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-rules-for-mcp': new RuleHelp(\n 'Validate API contracts against their configured MCP requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-lib-dependencies': new RuleHelp(\n 'Validate the configured API library dependency relationships.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'api-lib-path': new RuleHelp(\n 'Use the configured paths for API contract libraries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-folder': new RuleHelp(\n 'Align framework declarations with their project folder layout.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n};\n"]}