@craft-ts/dev-tools 0.7.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/generators.json +26 -0
- package/package.json +119 -0
- package/src/bin/craft-architecture-check.d.ts +2 -0
- package/src/bin/craft-architecture-check.js +51 -0
- package/src/bin/craft-architecture-check.js.map +1 -0
- package/src/bin/craft-brand.d.ts +2 -0
- package/src/bin/craft-brand.js +9 -0
- package/src/bin/craft-brand.js.map +1 -0
- package/src/bin/craft-graph.d.ts +2 -0
- package/src/bin/craft-graph.js +72 -0
- package/src/bin/craft-graph.js.map +1 -0
- package/src/bin/craft-migrate-architecture.d.ts +2 -0
- package/src/bin/craft-migrate-architecture.js +64 -0
- package/src/bin/craft-migrate-architecture.js.map +1 -0
- package/src/bin/craft-migrate-components.d.ts +2 -0
- package/src/bin/craft-migrate-components.js +67 -0
- package/src/bin/craft-migrate-components.js.map +1 -0
- package/src/bin/craft-migrate-primitives.d.ts +2 -0
- package/src/bin/craft-migrate-primitives.js +71 -0
- package/src/bin/craft-migrate-primitives.js.map +1 -0
- package/src/bin/craft-migrate-routes.d.ts +2 -0
- package/src/bin/craft-migrate-routes.js +77 -0
- package/src/bin/craft-migrate-routes.js.map +1 -0
- package/src/bin/craft-migrate-services.d.ts +2 -0
- package/src/bin/craft-migrate-services.js +75 -0
- package/src/bin/craft-migrate-services.js.map +1 -0
- package/src/bin/craft-migrate-template.d.ts +2 -0
- package/src/bin/craft-migrate-template.js +68 -0
- package/src/bin/craft-migrate-template.js.map +1 -0
- package/src/bin/craft-migrate.d.ts +2 -0
- package/src/bin/craft-migrate.js +91 -0
- package/src/bin/craft-migrate.js.map +1 -0
- package/src/bin/craft.d.ts +2 -0
- package/src/bin/craft.js +318 -0
- package/src/bin/craft.js.map +1 -0
- package/src/eslint-rules/anchor-has-href.cjs +35 -0
- package/src/eslint-rules/app-start-registry-match.cjs +355 -0
- package/src/eslint-rules/button-has-type.cjs +50 -0
- package/src/eslint-rules/control-has-accessible-name.cjs +56 -0
- package/src/eslint-rules/craft-component-name-match.cjs +8 -0
- package/src/eslint-rules/craft-computed-name-match.cjs +63 -0
- package/src/eslint-rules/craft-css-token-registry.cjs +17 -0
- package/src/eslint-rules/craft-css-var-naming.cjs +18 -0
- package/src/eslint-rules/craft-css-vars-contract.cjs +34 -0
- package/src/eslint-rules/craft-directive-name-match.cjs +8 -0
- package/src/eslint-rules/craft-method-name-match.cjs +8 -0
- package/src/eslint-rules/craft-name-match-utils.cjs +179 -0
- package/src/eslint-rules/craft-primitive-context.cjs +46 -0
- package/src/eslint-rules/craft-signal-source-name-match.cjs +8 -0
- package/src/eslint-rules/craft-source-name-match.cjs +8 -0
- package/src/eslint-rules/craft-styles-scope-safe.cjs +25 -0
- package/src/eslint-rules/css-rule-utils.cjs +109 -0
- package/src/eslint-rules/global-exception-registry-match.cjs +562 -0
- package/src/eslint-rules/heading-has-content.cjs +31 -0
- package/src/eslint-rules/html-helpers.cjs +115 -0
- package/src/eslint-rules/hyperscript-walk.cjs +249 -0
- package/src/eslint-rules/iframe-has-title.cjs +26 -0
- package/src/eslint-rules/img-has-alt.cjs +28 -0
- package/src/eslint-rules/index.cjs +209 -0
- package/src/eslint-rules/index.d.cts +5 -0
- package/src/eslint-rules/label-has-associated-control.cjs +67 -0
- package/src/eslint-rules/no-async-await.cjs +46 -0
- package/src/eslint-rules/no-craft-computed-side-effects.cjs +301 -0
- package/src/eslint-rules/no-craft-use-in-template.cjs +89 -0
- package/src/eslint-rules/no-craft-use.cjs +42 -0
- package/src/eslint-rules/no-direct-temporal-globals.cjs +73 -0
- package/src/eslint-rules/no-effect-in-params.cjs +265 -0
- package/src/eslint-rules/no-effect-outside-loaders.cjs +3 -0
- package/src/eslint-rules/no-ephemeral-template-form-state.cjs +131 -0
- package/src/eslint-rules/no-hardcoded-design-values.cjs +15 -0
- package/src/eslint-rules/no-heading-level-skip.cjs +101 -0
- package/src/eslint-rules/no-imperative-craft-resource-trigger.cjs +291 -0
- package/src/eslint-rules/no-important-in-component-styles.cjs +12 -0
- package/src/eslint-rules/no-injection-token.cjs +173 -0
- package/src/eslint-rules/no-invalid-insertion-pipe.cjs +162 -0
- package/src/eslint-rules/no-manual-route-provider-list.cjs +85 -0
- package/src/eslint-rules/no-noninteractive-element-interactions.cjs +66 -0
- package/src/eslint-rules/no-positive-tabindex.cjs +44 -0
- package/src/eslint-rules/no-redundant-primitive-insertion.cjs +361 -0
- package/src/eslint-rules/no-render-writes.cjs +106 -0
- package/src/eslint-rules/no-throw.cjs +132 -0
- package/src/eslint-rules/no-transition-actions.cjs +133 -0
- package/src/eslint-rules/no-type-assertions-in-template.cjs +211 -0
- package/src/eslint-rules/no-widened-route-provider-context.cjs +39 -0
- package/src/eslint-rules/prefer-browser-boundaries.cjs +92 -0
- package/src/eslint-rules/prefer-craft-http-transport.cjs +103 -0
- package/src/eslint-rules/prefer-craft-template-blocks.cjs +492 -0
- package/src/eslint-rules/prefer-direct-yieldable-callback.cjs +105 -0
- package/src/eslint-rules/prefer-named-html-helpers.cjs +33 -0
- package/src/eslint-rules/prefer-query-method-over-state-trigger.cjs +282 -0
- package/src/eslint-rules/prefer-relative-heading.cjs +43 -0
- package/src/eslint-rules/provide-host-name-match-component.cjs +455 -0
- package/src/eslint-rules/recommended-config.cjs +77 -0
- package/src/eslint-rules/require-assert-exhaustive-route-exceptions.cjs +259 -0
- package/src/eslint-rules/require-cascade-route-di-check.cjs +223 -0
- package/src/eslint-rules/require-child-route-mount-check.cjs +224 -0
- package/src/eslint-rules/require-component-monitoring.cjs +212 -0
- package/src/eslint-rules/require-craft-exception-handler.cjs +142 -0
- package/src/eslint-rules/require-craft-method-for-yieldable-callback.cjs +236 -0
- package/src/eslint-rules/require-craft-resource-trigger-yield.cjs +209 -0
- package/src/eslint-rules/require-effect-adapters.cjs +86 -0
- package/src/eslint-rules/require-exception-component-di-check.cjs +314 -0
- package/src/eslint-rules/require-focus-visible.cjs +36 -0
- package/src/eslint-rules/require-interactive-local-name.cjs +105 -0
- package/src/eslint-rules/require-lazy-load-with-retry.cjs +148 -0
- package/src/eslint-rules/require-outlet-heading-section.cjs +70 -0
- package/src/eslint-rules/require-pending-component-di-check.cjs +490 -0
- package/src/eslint-rules/require-primitive-context.cjs +156 -0
- package/src/eslint-rules/require-primitive-derived-property.cjs +598 -0
- package/src/eslint-rules/require-primitive-generator-unwrap.cjs +274 -0
- package/src/eslint-rules/require-reactive-template-bindings.cjs +305 -0
- package/src/eslint-rules/require-reduced-motion.cjs +38 -0
- package/src/eslint-rules/require-route-heading-outline.cjs +166 -0
- package/src/eslint-rules/require-yieldable-insertion-write.cjs +98 -0
- package/src/eslint-rules/require-yieldable-reactive-read.cjs +102 -0
- package/src/eslint-rules/require-yieldable-template-method.cjs +424 -0
- package/src/eslint-rules/role-has-required-aria.cjs +38 -0
- package/src/eslint-rules/server-function-client-match.cjs +283 -0
- package/src/eslint-rules/target-blank-noopener.cjs +31 -0
- package/src/eslint-rules/template-element-name-unique.cjs +124 -0
- package/src/eslint-rules/valid-aria.cjs +38 -0
- package/src/generators/route/compat.d.ts +3 -0
- package/src/generators/route/compat.js +6 -0
- package/src/generators/route/compat.js.map +1 -0
- package/src/generators/route/generator.d.ts +31 -0
- package/src/generators/route/generator.js +402 -0
- package/src/generators/route/generator.js.map +1 -0
- package/src/generators/route/schema.json +50 -0
- package/src/generators/route/split-schema.json +19 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +23 -0
- package/src/index.js.map +1 -0
- package/src/scripts/angular-brand-codemod.d.ts +139 -0
- package/src/scripts/angular-brand-codemod.js +2318 -0
- package/src/scripts/angular-brand-codemod.js.map +1 -0
- package/src/scripts/angular-brand-codemod.ts +3985 -0
- package/src/scripts/architecture/migrate-architecture.d.ts +14 -0
- package/src/scripts/architecture/migrate-architecture.js +534 -0
- package/src/scripts/architecture/migrate-architecture.js.map +1 -0
- package/src/scripts/architecture/migrate-architecture.ts +653 -0
- package/src/scripts/architecture-graph.d.ts +368 -0
- package/src/scripts/architecture-graph.js +2191 -0
- package/src/scripts/architecture-graph.js.map +1 -0
- package/src/scripts/architecture-graph.ts +3136 -0
- package/src/scripts/components/migrate-components.d.ts +20 -0
- package/src/scripts/components/migrate-components.js +163 -0
- package/src/scripts/components/migrate-components.js.map +1 -0
- package/src/scripts/components/migrate-components.ts +227 -0
- package/src/scripts/components/migration-diagnostic.d.ts +7 -0
- package/src/scripts/components/migration-diagnostic.js +2 -0
- package/src/scripts/components/migration-diagnostic.js.map +1 -0
- package/src/scripts/components/migration-diagnostic.ts +8 -0
- package/src/scripts/create/create-project.d.ts +20 -0
- package/src/scripts/create/create-project.js +783 -0
- package/src/scripts/create/create-project.js.map +1 -0
- package/src/scripts/create/create-project.ts +849 -0
- package/src/scripts/data-flow-graph.d.ts +36 -0
- package/src/scripts/data-flow-graph.js +186 -0
- package/src/scripts/data-flow-graph.js.map +1 -0
- package/src/scripts/data-flow-graph.ts +240 -0
- package/src/scripts/dependency-graph.d.ts +152 -0
- package/src/scripts/dependency-graph.js +4456 -0
- package/src/scripts/dependency-graph.js.map +1 -0
- package/src/scripts/dependency-graph.ts +5908 -0
- package/src/scripts/effect-dependency-graph.d.ts +89 -0
- package/src/scripts/effect-dependency-graph.js +487 -0
- package/src/scripts/effect-dependency-graph.js.map +1 -0
- package/src/scripts/effect-dependency-graph.ts +630 -0
- package/src/scripts/migrate.d.ts +37 -0
- package/src/scripts/migrate.js +98 -0
- package/src/scripts/migrate.js.map +1 -0
- package/src/scripts/migrate.ts +162 -0
- package/src/scripts/migration-workspace.d.ts +2 -0
- package/src/scripts/migration-workspace.js +67 -0
- package/src/scripts/migration-workspace.js.map +1 -0
- package/src/scripts/migration-workspace.ts +93 -0
- package/src/scripts/primitives/migrate-named-primitives.d.ts +50 -0
- package/src/scripts/primitives/migrate-named-primitives.js +487 -0
- package/src/scripts/primitives/migrate-named-primitives.js.map +1 -0
- package/src/scripts/primitives/migrate-named-primitives.ts +627 -0
- package/src/scripts/primitives/migrate-primitive-generators.d.ts +30 -0
- package/src/scripts/primitives/migrate-primitive-generators.js +309 -0
- package/src/scripts/primitives/migrate-primitive-generators.js.map +1 -0
- package/src/scripts/primitives/migrate-primitive-generators.ts +410 -0
- package/src/scripts/primitives/migrate-primitives.d.ts +27 -0
- package/src/scripts/primitives/migrate-primitives.js +427 -0
- package/src/scripts/primitives/migrate-primitives.js.map +1 -0
- package/src/scripts/primitives/migrate-primitives.ts +655 -0
- package/src/scripts/primitives/migrate-yieldable-reactive-reads.d.ts +23 -0
- package/src/scripts/primitives/migrate-yieldable-reactive-reads.js +382 -0
- package/src/scripts/primitives/migrate-yieldable-reactive-reads.js.map +1 -0
- package/src/scripts/primitives/migrate-yieldable-reactive-reads.ts +499 -0
- package/src/scripts/primitives/migration-diagnostic.d.ts +8 -0
- package/src/scripts/primitives/migration-diagnostic.js +2 -0
- package/src/scripts/primitives/migration-diagnostic.js.map +1 -0
- package/src/scripts/primitives/migration-diagnostic.ts +15 -0
- package/src/scripts/routes/migrate-routes.d.ts +34 -0
- package/src/scripts/routes/migrate-routes.js +657 -0
- package/src/scripts/routes/migrate-routes.js.map +1 -0
- package/src/scripts/routes/migrate-routes.ts +895 -0
- package/src/scripts/routes/migration-diagnostic.d.ts +16 -0
- package/src/scripts/routes/migration-diagnostic.js +2 -0
- package/src/scripts/routes/migration-diagnostic.js.map +1 -0
- package/src/scripts/routes/migration-diagnostic.ts +25 -0
- package/src/scripts/routes/route-command.d.ts +75 -0
- package/src/scripts/routes/route-command.js +1169 -0
- package/src/scripts/routes/route-command.js.map +1 -0
- package/src/scripts/routes/route-command.ts +1807 -0
- package/src/scripts/routes/verify-routes.d.ts +60 -0
- package/src/scripts/routes/verify-routes.js +1121 -0
- package/src/scripts/routes/verify-routes.js.map +1 -0
- package/src/scripts/routes/verify-routes.ts +1511 -0
- package/src/scripts/services/config.d.ts +2 -0
- package/src/scripts/services/config.js +38 -0
- package/src/scripts/services/config.js.map +1 -0
- package/src/scripts/services/config.ts +60 -0
- package/src/scripts/services/migrate-services.d.ts +29 -0
- package/src/scripts/services/migrate-services.js +924 -0
- package/src/scripts/services/migrate-services.js.map +1 -0
- package/src/scripts/services/migrate-services.ts +1348 -0
- package/src/scripts/services/migration-diagnostic.d.ts +8 -0
- package/src/scripts/services/migration-diagnostic.js +2 -0
- package/src/scripts/services/migration-diagnostic.js.map +1 -0
- package/src/scripts/services/migration-diagnostic.ts +28 -0
- package/src/scripts/template/migrate-template.d.ts +16 -0
- package/src/scripts/template/migrate-template.js +349 -0
- package/src/scripts/template/migrate-template.js.map +1 -0
- package/src/scripts/template/migrate-template.ts +418 -0
- package/src/template-migration.d.ts +1 -0
- package/src/template-migration.js +2 -0
- package/src/template-migration.js.map +1 -0
- package/src/testing.d.ts +19 -0
- package/src/testing.js +2 -0
- package/src/testing.js.map +1 -0
- package/src/tsconfig.codemod.json +13 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import type { DependencyGraph, DependencyGraphEdge, DependencyGraphEdgeFor, DependencyGraphEdgeKind, DependencyGraphNode, DependencyGraphNodeKind, DependencyGraphNodeRegistry, DependencyGraphProof } from './dependency-graph.js';
|
|
2
|
+
export type ArchitectureProvidedOn = {
|
|
3
|
+
kind: DependencyGraphNodeKind;
|
|
4
|
+
name: string;
|
|
5
|
+
file?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ArchitectureCatalog = {
|
|
8
|
+
version: 1;
|
|
9
|
+
graphHash: string;
|
|
10
|
+
routes: readonly string[];
|
|
11
|
+
services: readonly string[];
|
|
12
|
+
components: readonly string[];
|
|
13
|
+
primitives: readonly string[];
|
|
14
|
+
sources: readonly string[];
|
|
15
|
+
serverFunctionFamilies: readonly string[];
|
|
16
|
+
httpEndpoints: readonly {
|
|
17
|
+
method: string;
|
|
18
|
+
url: string;
|
|
19
|
+
}[];
|
|
20
|
+
uniques: readonly string[];
|
|
21
|
+
providers: readonly string[];
|
|
22
|
+
routeProviders: Readonly<Record<string, readonly string[]>>;
|
|
23
|
+
componentProviders: Readonly<Record<string, readonly string[]>>;
|
|
24
|
+
providedOn: Readonly<Record<string, readonly ArchitectureProvidedOn[]>>;
|
|
25
|
+
collisions: {
|
|
26
|
+
services: Readonly<Record<string, readonly string[]>>;
|
|
27
|
+
components: Readonly<Record<string, readonly string[]>>;
|
|
28
|
+
routes: Readonly<Record<string, readonly string[]>>;
|
|
29
|
+
};
|
|
30
|
+
browserBoundaryServices: readonly string[];
|
|
31
|
+
scopes: Readonly<Record<string, string>>;
|
|
32
|
+
};
|
|
33
|
+
export type ArchitectureNodeView<C extends ArchitectureCatalog = ArchitectureCatalog, K extends DependencyGraphNodeKind = DependencyGraphNodeKind> = {
|
|
34
|
+
id: string;
|
|
35
|
+
kind: K;
|
|
36
|
+
label: string;
|
|
37
|
+
filePath?: string;
|
|
38
|
+
line?: number;
|
|
39
|
+
details?: DependencyGraphNodeRegistry[K];
|
|
40
|
+
provider(name: CatalogProviders<C>): ArchitectureNodeView<C>;
|
|
41
|
+
providers(): ArchitectureNodeView<C>[];
|
|
42
|
+
outgoing(kind?: DependencyGraphEdgeKind): DependencyGraphEdge[];
|
|
43
|
+
incoming(kind?: DependencyGraphEdgeKind): DependencyGraphEdge[];
|
|
44
|
+
httpEndpoints(): {
|
|
45
|
+
method: string;
|
|
46
|
+
url: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
export type ArchitectureServiceFilter = {
|
|
50
|
+
browserBoundary?: boolean;
|
|
51
|
+
scope?: string;
|
|
52
|
+
};
|
|
53
|
+
export type ArchitectureGraphView<C extends ArchitectureCatalog = ArchitectureCatalog> = {
|
|
54
|
+
graph: DependencyGraph;
|
|
55
|
+
catalog: C;
|
|
56
|
+
nodes<K extends DependencyGraphNodeKind>(kind: K): ArchitectureNodeView<C, K>[];
|
|
57
|
+
edges<K extends DependencyGraphEdgeKind>(kind: K): DependencyGraphEdgeFor<K>[];
|
|
58
|
+
pathsBetween(fromId: string, toId: string, maxDepth?: number): ArchitectureGraphPath[];
|
|
59
|
+
proofs(edge: DependencyGraphEdge): DependencyGraphProof[];
|
|
60
|
+
route(path: CatalogRoutes<C>, file?: string): ArchitectureNodeView<C>;
|
|
61
|
+
service(name: CatalogServices<C>, file?: string): ArchitectureNodeView<C>;
|
|
62
|
+
component(name: CatalogComponents<C>, file?: string): ArchitectureNodeView<C>;
|
|
63
|
+
craftMethod(name: string, file?: string): ArchitectureNodeView<C>;
|
|
64
|
+
httpEndpoint(method: CatalogHttp<C>['method'], url: CatalogHttp<C>['url']): ArchitectureNodeView<C>;
|
|
65
|
+
providedOn(name: CatalogProviders<C>): ArchitectureNodeView<C>[];
|
|
66
|
+
services(filter?: ArchitectureServiceFilter): ArchitectureNodeView<C>[];
|
|
67
|
+
usingHttp(): ArchitectureNodeView<C>[];
|
|
68
|
+
usingTemporal(): ArchitectureNodeView<C>[];
|
|
69
|
+
dependingOnBrowserBoundary(): ArchitectureNodeView<C>[];
|
|
70
|
+
craftMethods(): ArchitectureNodeView<C>[];
|
|
71
|
+
primitives(primitive?: string): ArchitectureNodeView<C>[];
|
|
72
|
+
sources(): ArchitectureNodeView<C>[];
|
|
73
|
+
serverFunctionFamilies(): ArchitectureNodeView<C>[];
|
|
74
|
+
serverFunctionMiddlewares(): ArchitectureNodeView<C>[];
|
|
75
|
+
clientFunctionMiddlewares(): ArchitectureNodeView<C>[];
|
|
76
|
+
handshakes(): ArchitectureNodeView<C>[];
|
|
77
|
+
serverFunctionFamily(id: string): ArchitectureNodeView<C>;
|
|
78
|
+
httpEndpoints(): ArchitectureNodeView<C>[];
|
|
79
|
+
unique(value: CatalogUniques<C>): ArchitectureNodeView<C>;
|
|
80
|
+
uniques(): ArchitectureNodeView<C>[];
|
|
81
|
+
};
|
|
82
|
+
export type ArchitectureGraphPath = {
|
|
83
|
+
readonly nodes: DependencyGraphNode[];
|
|
84
|
+
readonly edges: DependencyGraphEdge[];
|
|
85
|
+
readonly proofs: DependencyGraphProof[];
|
|
86
|
+
};
|
|
87
|
+
export type ExclusiveLinkViolation = {
|
|
88
|
+
from: string;
|
|
89
|
+
to: string;
|
|
90
|
+
kind: DependencyGraphEdgeKind;
|
|
91
|
+
};
|
|
92
|
+
export type SensitiveOutputProtectionOptions = {
|
|
93
|
+
readonly categories?: readonly string[];
|
|
94
|
+
readonly allowUnknown?: boolean;
|
|
95
|
+
};
|
|
96
|
+
export type SensitiveOutputProtectionViolation = {
|
|
97
|
+
readonly code: 'SENSITIVE_OUTPUT_UNPROTECTED' | 'SENSITIVE_OUTPUT_UNKNOWN_PROTECTION';
|
|
98
|
+
readonly classification: string;
|
|
99
|
+
readonly outputId: string;
|
|
100
|
+
readonly message: string;
|
|
101
|
+
readonly path: readonly string[];
|
|
102
|
+
readonly proofs: readonly DependencyGraphProof[];
|
|
103
|
+
};
|
|
104
|
+
type CatalogRoutes<C extends ArchitectureCatalog> = C['routes'][number];
|
|
105
|
+
type CatalogServices<C extends ArchitectureCatalog> = C['services'][number];
|
|
106
|
+
type CatalogComponents<C extends ArchitectureCatalog> = C['components'][number];
|
|
107
|
+
type CatalogProviders<C extends ArchitectureCatalog> = C['providers'][number];
|
|
108
|
+
type CatalogHttp<C extends ArchitectureCatalog> = C['httpEndpoints'][number];
|
|
109
|
+
type CatalogUniques<C extends ArchitectureCatalog> = C['uniques'][number];
|
|
110
|
+
export declare function graphHash(graph: DependencyGraph): string;
|
|
111
|
+
export declare function relativeGraphPath(graph: DependencyGraph, filePath: string | undefined): string | undefined;
|
|
112
|
+
export declare function buildArchitectureCatalog(graph: DependencyGraph): ArchitectureCatalog;
|
|
113
|
+
export declare function architectureCatalogToTypeScript(catalog: ArchitectureCatalog): string;
|
|
114
|
+
export declare function createArchitectureGraph<C extends ArchitectureCatalog = ArchitectureCatalog>(graph: DependencyGraph, catalog?: C): ArchitectureGraphView<C>;
|
|
115
|
+
/**
|
|
116
|
+
* Enumerates short, explainable paths without imposing a domain-specific
|
|
117
|
+
* notion of what a backend node means. Rules can first select typed nodes and
|
|
118
|
+
* then ask this generic primitive for paths between their ids.
|
|
119
|
+
*/
|
|
120
|
+
export declare function dependencyGraphPathsBetween(graph: DependencyGraph, fromId: string, toId: string, maxDepth?: number): ArchitectureGraphPath[];
|
|
121
|
+
/**
|
|
122
|
+
* Checks the first conservative security policy for classified server
|
|
123
|
+
* responses. Capabilities are repository-declared on middleware nodes through
|
|
124
|
+
* `analyzeDependencyGraph({ middlewareCapabilities })`.
|
|
125
|
+
*/
|
|
126
|
+
export declare function sensitiveOutputProtectionViolations(graph: DependencyGraph, options?: SensitiveOutputProtectionOptions): SensitiveOutputProtectionViolation[];
|
|
127
|
+
export declare function assertSensitiveOutputsProtected(graph: DependencyGraph, options?: SensitiveOutputProtectionOptions): void;
|
|
128
|
+
export declare function exclusiveLinkViolations(left: ArchitectureNodeView<ArchitectureCatalog>, right: ArchitectureNodeView<ArchitectureCatalog>): ExclusiveLinkViolation[];
|
|
129
|
+
export declare function noExclusiveLink(left: ArchitectureNodeView<ArchitectureCatalog>, right: ArchitectureNodeView<ArchitectureCatalog>): void;
|
|
130
|
+
export type CraftUniqueViolation = {
|
|
131
|
+
kind: 'duplicate' | 'non-static';
|
|
132
|
+
id: string;
|
|
133
|
+
label: string;
|
|
134
|
+
callSites: readonly {
|
|
135
|
+
filePath?: string;
|
|
136
|
+
line?: number;
|
|
137
|
+
ownerId?: string;
|
|
138
|
+
}[];
|
|
139
|
+
};
|
|
140
|
+
export declare function craftUniqueViolations(graph: DependencyGraph): CraftUniqueViolation[];
|
|
141
|
+
export declare function assertCraftUnique(graph: DependencyGraph): void;
|
|
142
|
+
export type CraftHandshakeDiagnosticCode = 'CRAFT_HANDSHAKE_MISSING_COUNTERPART' | 'CRAFT_HANDSHAKE_NOT_STATIC' | 'CRAFT_HANDSHAKE_DUPLICATE_NAME';
|
|
143
|
+
export type CraftHandshakeViolation = {
|
|
144
|
+
readonly code: CraftHandshakeDiagnosticCode;
|
|
145
|
+
readonly message: string;
|
|
146
|
+
readonly name: string;
|
|
147
|
+
readonly filePath?: string;
|
|
148
|
+
readonly line?: number;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Vérifie qu'un `craftHandshake(...)` est bien tenu des deux côtés.
|
|
152
|
+
*
|
|
153
|
+
* C'est le pendant exact de `assertCraftUnique`, avec le prédicat inverse :
|
|
154
|
+
* `craftUnique` exige un seul site, un handshake en exige **un de chaque
|
|
155
|
+
* côté**. Le contrôle compare des identifiants, pas des noms de clés devinés
|
|
156
|
+
* dans l'AST : il n'a rien d'heuristique.
|
|
157
|
+
*/
|
|
158
|
+
export declare function craftHandshakeViolations(graph: DependencyGraph): CraftHandshakeViolation[];
|
|
159
|
+
export declare function assertCraftHandshake(graph: DependencyGraph): void;
|
|
160
|
+
export type RouteDiProofViolationKind = 'missing-di-proof' | 'unarmed-mapper' | 'missing-pending-proof' | 'missing-error-proof' | 'missing-exception-assert' | 'missing-global-error-proof' | 'missing-route-load-error-proof';
|
|
161
|
+
export type RouteDiProofViolation = {
|
|
162
|
+
kind: RouteDiProofViolationKind;
|
|
163
|
+
label: string;
|
|
164
|
+
filePath?: string;
|
|
165
|
+
line?: number;
|
|
166
|
+
};
|
|
167
|
+
export declare function routeDiProofViolations(graph: DependencyGraph): RouteDiProofViolation[];
|
|
168
|
+
export declare function assertRouteDiProofs(graph: DependencyGraph): void;
|
|
169
|
+
export type RouteComponentFileViolation = {
|
|
170
|
+
kind: 'route-and-component-same-file' | 'components-share-file';
|
|
171
|
+
route: string;
|
|
172
|
+
component: string;
|
|
173
|
+
components: readonly string[];
|
|
174
|
+
routeFile: string;
|
|
175
|
+
componentFile: string;
|
|
176
|
+
};
|
|
177
|
+
export declare function routeComponentFileViolations(graph: DependencyGraph): RouteComponentFileViolation[];
|
|
178
|
+
export declare function assertRouteComponentsInSeparateFiles(graph: DependencyGraph): void;
|
|
179
|
+
export type HttpEndpointUniqueViolation = {
|
|
180
|
+
id: string;
|
|
181
|
+
label: string;
|
|
182
|
+
method: string;
|
|
183
|
+
url: string;
|
|
184
|
+
callSites: readonly {
|
|
185
|
+
ownerId?: string;
|
|
186
|
+
filePath?: string;
|
|
187
|
+
line?: number;
|
|
188
|
+
}[];
|
|
189
|
+
};
|
|
190
|
+
export declare function httpEndpointUniqueViolations(graph: DependencyGraph): HttpEndpointUniqueViolation[];
|
|
191
|
+
export declare function assertHttpEndpointUnique(graph: DependencyGraph): void;
|
|
192
|
+
export type CraftComputedPureViolation = {
|
|
193
|
+
kind: 'calls' | 'writes';
|
|
194
|
+
id: string;
|
|
195
|
+
label: string;
|
|
196
|
+
targetId: string;
|
|
197
|
+
targetLabel: string;
|
|
198
|
+
filePath?: string;
|
|
199
|
+
line?: number;
|
|
200
|
+
};
|
|
201
|
+
export declare function craftComputedPureViolations(graph: DependencyGraph): CraftComputedPureViolation[];
|
|
202
|
+
export declare function assertCraftComputedPure(graph: DependencyGraph): void;
|
|
203
|
+
export type DependencyCycle = {
|
|
204
|
+
ids: readonly string[];
|
|
205
|
+
labels: readonly string[];
|
|
206
|
+
};
|
|
207
|
+
export declare function dependencyCycleViolations(graph: DependencyGraph): DependencyCycle[];
|
|
208
|
+
export declare function assertNoDependencyCycles(graph: DependencyGraph): void;
|
|
209
|
+
export type AppConfigRouteCycle = {
|
|
210
|
+
appConfigFile: string;
|
|
211
|
+
routeFile: string;
|
|
212
|
+
routeLabels: readonly string[];
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* App configuration owns route registration. A route module may expose route
|
|
216
|
+
* metadata to the config, but the two modules must not import each other: the
|
|
217
|
+
* cycle makes the inferred provider context unstable and invites manual DI
|
|
218
|
+
* fallbacks.
|
|
219
|
+
*/
|
|
220
|
+
export declare function appConfigRouteCycleViolations(graph: DependencyGraph): AppConfigRouteCycle[];
|
|
221
|
+
export declare function assertNoAppConfigRouteCycles(graph: DependencyGraph): void;
|
|
222
|
+
export type PathBoundaryConstraint = {
|
|
223
|
+
source: string;
|
|
224
|
+
onlyDependOn?: readonly string[];
|
|
225
|
+
forbidTarget?: readonly string[];
|
|
226
|
+
};
|
|
227
|
+
export type PathBoundaryOptions = {
|
|
228
|
+
edgeKinds?: readonly DependencyGraphEdgeKind[];
|
|
229
|
+
constraints: readonly PathBoundaryConstraint[];
|
|
230
|
+
};
|
|
231
|
+
export type PathBoundaryViolation = {
|
|
232
|
+
fromId: string;
|
|
233
|
+
toId: string;
|
|
234
|
+
fromLabel: string;
|
|
235
|
+
toLabel: string;
|
|
236
|
+
fromPath: string;
|
|
237
|
+
toPath: string;
|
|
238
|
+
edgeKind: DependencyGraphEdgeKind;
|
|
239
|
+
source: string;
|
|
240
|
+
reason: 'allowlist' | 'denylist';
|
|
241
|
+
};
|
|
242
|
+
export declare function pathBoundaryViolations(graph: DependencyGraph, options: PathBoundaryOptions): PathBoundaryViolation[];
|
|
243
|
+
export declare function assertPathBoundaries(graph: DependencyGraph, options: PathBoundaryOptions): void;
|
|
244
|
+
export type MutationReactOnOptions = {
|
|
245
|
+
allow?: readonly string[];
|
|
246
|
+
};
|
|
247
|
+
export type MutationReactOnViolation = {
|
|
248
|
+
id: string;
|
|
249
|
+
label: string;
|
|
250
|
+
filePath?: string;
|
|
251
|
+
line?: number;
|
|
252
|
+
};
|
|
253
|
+
export declare function mutationReactOnViolations(graph: DependencyGraph, options?: MutationReactOnOptions): MutationReactOnViolation[];
|
|
254
|
+
export declare function assertMutationHasReactOn(graph: DependencyGraph, options?: MutationReactOnOptions): void;
|
|
255
|
+
export type PersistedUniqueViolation = {
|
|
256
|
+
id: string;
|
|
257
|
+
label: string;
|
|
258
|
+
primitive: string;
|
|
259
|
+
filePath?: string;
|
|
260
|
+
line?: number;
|
|
261
|
+
};
|
|
262
|
+
export declare function persistedPrimitiveUniqueViolations(graph: DependencyGraph): PersistedUniqueViolation[];
|
|
263
|
+
export declare function assertPersistedPrimitiveHasUnique(graph: DependencyGraph): void;
|
|
264
|
+
export type InsertSelectUniqueViolation = {
|
|
265
|
+
key: string;
|
|
266
|
+
hostId: string;
|
|
267
|
+
hostLabel: string;
|
|
268
|
+
callSites: readonly {
|
|
269
|
+
filePath?: string;
|
|
270
|
+
line?: number;
|
|
271
|
+
}[];
|
|
272
|
+
};
|
|
273
|
+
export declare function insertSelectUniqueViolations(graph: DependencyGraph): InsertSelectUniqueViolation[];
|
|
274
|
+
export declare function assertInsertSelectUnique(graph: DependencyGraph): void;
|
|
275
|
+
export type CraftEffectNetworkViolation = {
|
|
276
|
+
kind: 'http' | 'mutation';
|
|
277
|
+
id: string;
|
|
278
|
+
label: string;
|
|
279
|
+
targetId: string;
|
|
280
|
+
targetLabel: string;
|
|
281
|
+
filePath?: string;
|
|
282
|
+
line?: number;
|
|
283
|
+
};
|
|
284
|
+
export type LoaderRequirementContext = {
|
|
285
|
+
graph: DependencyGraph;
|
|
286
|
+
primitive: DependencyGraphNode;
|
|
287
|
+
target: DependencyGraphNode;
|
|
288
|
+
edge: DependencyGraphEdge;
|
|
289
|
+
};
|
|
290
|
+
export type LoaderRequirement = {
|
|
291
|
+
/** Human-readable name used in the diagnostic. */
|
|
292
|
+
label: string;
|
|
293
|
+
/** Returns true when this target satisfies the requirement. */
|
|
294
|
+
matches: (context: LoaderRequirementContext) => boolean;
|
|
295
|
+
};
|
|
296
|
+
export type PrimitiveLoaderRequirements = {
|
|
297
|
+
/** Primitive names to check. Requirements are OR-ed for each primitive. */
|
|
298
|
+
primitives: readonly string[];
|
|
299
|
+
requirements: readonly LoaderRequirement[];
|
|
300
|
+
/** Explicitly exempted primitive labels for intentional local-state examples. */
|
|
301
|
+
allow?: readonly string[];
|
|
302
|
+
};
|
|
303
|
+
export type PrimitiveLoaderRequirementViolation = {
|
|
304
|
+
primitive: string;
|
|
305
|
+
id: string;
|
|
306
|
+
label: string;
|
|
307
|
+
missing: readonly string[];
|
|
308
|
+
filePath?: string;
|
|
309
|
+
line?: number;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Checks that every selected resource has at least one qualifying dependency
|
|
313
|
+
* from its `loader`. This is intentionally predicate-based: query/mutation
|
|
314
|
+
* can use HTTP or server functions, while an Effect application can provide a
|
|
315
|
+
* rule that recognises Effect services or another domain boundary.
|
|
316
|
+
*/
|
|
317
|
+
export declare function primitiveLoaderRequirementViolations(graph: DependencyGraph, rule: PrimitiveLoaderRequirements): PrimitiveLoaderRequirementViolation[];
|
|
318
|
+
export declare function assertPrimitiveLoaderRequirements(graph: DependencyGraph, rule: PrimitiveLoaderRequirements): void;
|
|
319
|
+
export declare function queryMutationServerStateViolations(graph: DependencyGraph): PrimitiveLoaderRequirementViolation[];
|
|
320
|
+
export declare function assertQueryMutationHasServerState(graph: DependencyGraph, options?: Pick<PrimitiveLoaderRequirements, 'allow'>): void;
|
|
321
|
+
export declare function craftEffectNetworkViolations(graph: DependencyGraph): CraftEffectNetworkViolation[];
|
|
322
|
+
export declare function assertCraftEffectNoNetwork(graph: DependencyGraph): void;
|
|
323
|
+
export type CraftEffectImperativeSyncKind = 'state' | 'source' | 'query' | 'mutation' | 'asyncProcess';
|
|
324
|
+
export type CraftEffectImperativeSyncViolation = {
|
|
325
|
+
kind: CraftEffectImperativeSyncKind;
|
|
326
|
+
action: 'writes' | 'calls';
|
|
327
|
+
id: string;
|
|
328
|
+
label: string;
|
|
329
|
+
targetId: string;
|
|
330
|
+
targetLabel: string;
|
|
331
|
+
filePath?: string;
|
|
332
|
+
line?: number;
|
|
333
|
+
};
|
|
334
|
+
export declare function craftEffectImperativeSyncViolations(graph: DependencyGraph): CraftEffectImperativeSyncViolation[];
|
|
335
|
+
export declare function assertCraftEffectNoImperativeSync(graph: DependencyGraph): void;
|
|
336
|
+
export type InteractiveElementNamedViolation = {
|
|
337
|
+
kind: 'missing' | 'non-static' | 'duplicate';
|
|
338
|
+
id: string;
|
|
339
|
+
label: string;
|
|
340
|
+
tag?: string;
|
|
341
|
+
callSites: readonly {
|
|
342
|
+
filePath?: string;
|
|
343
|
+
line?: number;
|
|
344
|
+
}[];
|
|
345
|
+
};
|
|
346
|
+
export declare function interactiveElementNamedViolations(graph: DependencyGraph): InteractiveElementNamedViolation[];
|
|
347
|
+
export declare function assertInteractiveElementNamed(graph: DependencyGraph): void;
|
|
348
|
+
export type ServerFunctionArchitectureDiagnosticCode = 'CRAFT_SERVER_FUNCTION_CLIENT_FAMILY_MISSING' | 'CRAFT_SERVER_FUNCTION_CLIENT_IMPORTS_SERVER' | 'CRAFT_SERVER_FUNCTION_CLIENT_CONTEXT_REQUIRES_CLIENT_EXPOSURE' | 'CRAFT_SERVER_FUNCTION_HANDSHAKE_NOT_ATTACHED' | 'CRAFT_SERVER_FUNCTION_HANDSHAKE_NOT_EXPECTED' | 'CRAFT_SERVER_FUNCTION_CONTRACT_MISMATCH' | 'CRAFT_SERVER_FUNCTION_DUPLICATE_ID' | 'CRAFT_SERVER_FUNCTION_ORPHAN_CLIENT_FACADE' | 'CRAFT_SERVER_FUNCTION_CLIENT_ID_NOT_UNIQUE' | 'CRAFT_SERVER_FUNCTION_CLIENT_ID_NOT_STATIC' | 'CRAFT_SERVER_FUNCTION_CLIENT_ID_MISMATCH' | 'CRAFT_SERVER_FUNCTION_CLIENT_DEFINITION_MISMATCH' | 'CRAFT_SERVER_FUNCTION_NAMING_CONVENTION_MISSING' | 'CRAFT_SERVER_FUNCTION_MIDDLEWARE_NAMING_CONVENTION_MISSING' | 'CRAFT_SERVER_FUNCTION_MIDDLEWARE_DUPLICATE_ID' | 'CRAFT_SERVER_FUNCTION_MIDDLEWARE_CYCLE' | 'CRAFT_SERVER_FUNCTION_MIDDLEWARE_IMPORTED_BY_CLIENT' | 'CRAFT_SERVER_FUNCTION_CLIENT_MIDDLEWARE_NAMING_CONVENTION_MISSING' | 'CRAFT_SERVER_FUNCTION_CLIENT_MIDDLEWARE_DUPLICATE_ID' | 'CRAFT_SERVER_FUNCTION_CLIENT_MIDDLEWARE_CYCLE' | 'CRAFT_SERVER_FUNCTION_CLIENT_MIDDLEWARE_IMPORTED_BY_SERVER' | 'CRAFT_SERVER_FUNCTION_CLIENT_CONTEXT_UNUSED';
|
|
349
|
+
export type ServerFunctionArchitectureViolation = {
|
|
350
|
+
readonly code: ServerFunctionArchitectureDiagnosticCode;
|
|
351
|
+
readonly message: string;
|
|
352
|
+
readonly family: string;
|
|
353
|
+
readonly filePath?: string;
|
|
354
|
+
readonly line?: number;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Verifies the source-level server-function family contract. The rule is
|
|
358
|
+
* intentionally independent of a bundler: a production build must fail while
|
|
359
|
+
* the offending server import is still visible in the TypeScript graph.
|
|
360
|
+
*/
|
|
361
|
+
export declare function serverFunctionArchitectureViolations(graph: DependencyGraph): ServerFunctionArchitectureViolation[];
|
|
362
|
+
export declare function assertServerFunctionArchitecture(graph: DependencyGraph): void;
|
|
363
|
+
export type ArchitectureCheckTarget = 'development' | 'production';
|
|
364
|
+
export declare function assertArchitecture(graph: DependencyGraph, options?: {
|
|
365
|
+
readonly target?: ArchitectureCheckTarget;
|
|
366
|
+
}): void;
|
|
367
|
+
export declare function assertDeclarativeArchitecture(graph: DependencyGraph, options?: MutationReactOnOptions): void;
|
|
368
|
+
export {};
|