@supacloud/compiler 0.24.0 → 0.26.0

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.
@@ -0,0 +1,62 @@
1
+ import { type OpenApiDiffResult } from "./openapi-tools";
2
+ import type { CompileOptions, Diagnostic } from "./types";
3
+ export type MigrationAssessmentStatus = "compatible" | "needs-review" | "breaking" | "unsupported" | "not-proven";
4
+ export type MigrationRenderMode = "unspecified" | "browser" | "ssr" | "edge" | "trusted-server";
5
+ export interface MigrationAssessmentFinding {
6
+ code: string;
7
+ status: MigrationAssessmentStatus;
8
+ message: string;
9
+ evidence?: string;
10
+ remediation?: string;
11
+ }
12
+ export interface MigrationAssessmentOptions {
13
+ projectDir: string;
14
+ compile: CompileOptions;
15
+ baselineOpenApiPath?: string;
16
+ currentOpenApiPath?: string;
17
+ renderMode?: MigrationRenderMode;
18
+ }
19
+ export interface MigrationAssessmentResult {
20
+ version: 1;
21
+ ok: boolean;
22
+ status: MigrationAssessmentStatus;
23
+ readOnly: true;
24
+ writesPerformed: false;
25
+ rendering: {
26
+ selected: MigrationRenderMode;
27
+ ssrRequired: false;
28
+ supportedModes: readonly ["browser", "ssr", "edge", "trusted-server"];
29
+ guidance: string;
30
+ };
31
+ dependencies: {
32
+ expected: Readonly<Record<string, string>>;
33
+ problems: string[];
34
+ };
35
+ compiler: {
36
+ upToDate: boolean;
37
+ diagnostics: Diagnostic[];
38
+ mismatches: string[];
39
+ };
40
+ artifacts: {
41
+ contractsManifest: {
42
+ path: string;
43
+ present: boolean;
44
+ sha256?: string;
45
+ version?: number;
46
+ commands?: number;
47
+ routes?: number;
48
+ permissions?: number;
49
+ };
50
+ openApi?: {
51
+ baselinePath: string;
52
+ baselineSha256: string;
53
+ currentPath: string;
54
+ currentSha256: string;
55
+ diff: OpenApiDiffResult;
56
+ };
57
+ };
58
+ findings: MigrationAssessmentFinding[];
59
+ }
60
+ /** Build a local, read-only migration report. It never requires or enables SSR. */
61
+ export declare function assessMigration(options: MigrationAssessmentOptions): Promise<MigrationAssessmentResult>;
62
+ export declare function formatMigrationAssessment(result: MigrationAssessmentResult): string;
@@ -0,0 +1,17 @@
1
+ import type { Diagnostic, DiagnosticFix } from "./types";
2
+ export interface DiagnosticRepair {
3
+ code: string;
4
+ errorCode?: string;
5
+ file?: string;
6
+ line?: number;
7
+ type: DiagnosticFix["type"];
8
+ targetFile: string;
9
+ fix: DiagnosticFix;
10
+ readiness: "preview" | "input-required" | "manual";
11
+ reason: string;
12
+ }
13
+ /**
14
+ * Classifies suggestions without executing them or inferring policy.
15
+ * Preview readiness does not guarantee that source preconditions still hold.
16
+ */
17
+ export declare function createDiagnosticRepairPlan(diagnostics: readonly Diagnostic[]): DiagnosticRepair[];
package/dist/types.d.ts CHANGED
@@ -149,6 +149,8 @@ export interface HandlerParamNode {
149
149
  default?: unknown;
150
150
  }
151
151
  export interface RouteNode {
152
+ parse?: "none";
153
+ allowDeleteBody?: true;
152
154
  contract?: {
153
155
  body?: "framework" | "domain";
154
156
  response?: "framework" | "native-json" | "binary" | "stream";
@@ -308,6 +310,8 @@ export interface ModuleNode {
308
310
  featureSpec?: FeatureSpecNode;
309
311
  }
310
312
  export interface ApplicationGraph {
313
+ /** Handler declaration files by module, for inspection only; omitted from app.manifest.json. */
314
+ moduleHandlerFiles?: Record<string, string[]>;
311
315
  /** Offline query inventory for AI context. Kept in graphql.manifest.json, not app.manifest.json. */
312
316
  graphql?: GraphqlContractSummary;
313
317
  modules: ModuleNode[];
@@ -456,6 +460,8 @@ export interface ModuleBoundaryProfile {
456
460
  }
457
461
  export interface ValidateOptions {
458
462
  strict?: boolean;
463
+ /** Reject route shapes that cannot coexist in an OpenAPI document. */
464
+ generateOpenApi?: boolean;
459
465
  moduleBoundaryPreset?: ModuleBoundaryPresetName;
460
466
  moduleBoundaries?: ModuleBoundaryRule[];
461
467
  /** Allow routes to bind directly to @Command (defaults to true). */
@@ -533,6 +539,8 @@ export interface WatchHandle {
533
539
  }
534
540
  export interface CachedModuleEntry {
535
541
  module: ModuleNode;
542
+ /** Direct handler declarations retained for inspection on cache hits. */
543
+ handlerFiles?: string[];
536
544
  /** Files owned by this module (normalized relative paths). */
537
545
  ownedFiles: string[];
538
546
  /** File hash mapping for owned files. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",