@supacloud/compiler 0.55.1 → 0.57.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.
package/dist/inspect.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface ContextPack {
26
26
  writeTransport: "command-rpc";
27
27
  writeRetry: "disabled";
28
28
  externalOutcome: "receipt-reconcile";
29
- databaseSource: "drizzle-append-only";
29
+ databaseSource: "zmodel-append-only";
30
30
  };
31
31
  relatedModules: {
32
32
  importedBy: string[];
@@ -1 +1 @@
1
- export declare const MIGRATION_APP_VERSION = "0.36.1";
1
+ export declare const MIGRATION_APP_VERSION = "0.38.0";
@@ -1 +1 @@
1
- export declare const MIGRATION_ELYSIA_VERSION = "0.38.2";
1
+ export declare const MIGRATION_ELYSIA_VERSION = "0.40.0";
@@ -15,7 +15,7 @@ export interface SupaCloudMigration {
15
15
  from: string;
16
16
  to: string;
17
17
  description: string;
18
- apply(source: string, fileName: string): SourceMigrationResult;
18
+ apply(source: string, fileName: string): SourceMigrationResult | Promise<SourceMigrationResult>;
19
19
  }
20
20
  export interface MigrateProjectOptions {
21
21
  rootDir: string;
@@ -38,7 +38,7 @@ export interface MigrateProjectResult {
38
38
  changedFiles: string[];
39
39
  issues: SourceMigrationIssue[];
40
40
  }
41
- declare function migrateRouteResponse(source: string, fileName: string): SourceMigrationResult;
41
+ declare function migrateRouteResponse(source: string, fileName: string): Promise<SourceMigrationResult>;
42
42
  export declare const SUPACLOUD_MIGRATIONS: SupaCloudMigration[];
43
43
  export declare function migrateProject(options: MigrateProjectOptions): Promise<MigrateProjectResult>;
44
44
  export { migrateRouteResponse };
package/dist/program.d.ts CHANGED
@@ -1,30 +1,18 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  import { type TraitRecord } from "./traits";
3
- export interface IncrementalProgramSession {
4
- /** The current TypeScript program used as the semantic compilation boundary. */
3
+ export interface IncrementalProgramSession extends AsyncDisposable {
5
4
  getProgram(): ts.Program;
6
- /** The current TypeScript type checker. */
7
5
  getTypeChecker(): ts.TypeChecker;
8
- /** Update the program while preserving TypeScript's incremental state. */
9
- update(rootNames: string[], changedPaths?: string[]): ProgramUpdate;
10
- /** Local Angular-style metadata records compiled from the current Program. */
6
+ update(rootNames: string[], changedPaths?: string[]): Promise<ProgramUpdate>;
11
7
  getTraits(): readonly TraitRecord[];
12
- /** TypeScript syntactic diagnostics for the current Program. */
13
- getDiagnostics(): readonly ts.Diagnostic[];
14
- /** Emit the current TypeScript program using the builder's incremental state. */
15
- emit(): ts.EmitResult;
16
- /** Drop the retained builder and source versions. */
17
- reset(): void;
8
+ getDiagnostics(): Promise<readonly ts.Diagnostic[]>;
9
+ emit(): Promise<ts.EmitOutput>;
10
+ reset(): Promise<void>;
18
11
  }
19
12
  export interface ProgramUpdate {
20
13
  changedFiles: string[];
21
14
  reusedFiles: string[];
22
15
  program: ts.Program;
23
16
  }
24
- /**
25
- * Angular-style semantic boundary around TypeScript's incremental program.
26
- *
27
- * This deliberately owns only TypeScript program state. SupaCloud metadata
28
- * handlers and ApplicationGraph linking remain separate layers.
29
- */
17
+ /** Retains native snapshots without Node-only synchronous transport or TS 6 objects. */
30
18
  export declare function createIncrementalProgramSession(projectRoot: string): IncrementalProgramSession;
@@ -1,4 +1,4 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  import type { Diagnostic } from "./types";
3
3
  /** Checks statically identifiable callbacks, not arbitrary side effects or a whole-program call graph. */
4
- export declare function scanReactiveSource(input: ts.SourceFile, file: string): Diagnostic[];
4
+ export declare function scanReactiveSource(input: ts.SourceFile, file: string): Promise<Diagnostic[]>;
@@ -1,4 +1,4 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  import type { Diagnostic } from "./types";
3
3
  export declare const SOURCE_SEMANTIC_DIAGNOSTIC_CODES: {
4
4
  readonly "source-unsafe-any": {
@@ -21,4 +21,4 @@ export declare const SOURCE_SEMANTIC_DIAGNOSTIC_CODES: {
21
21
  /** Inspect values at use sites, including types resolved through imported declarations. */
22
22
  export declare function scanSourceSemantics(source: ts.SourceFile, checker: ts.TypeChecker, file: string, rootDir: string, options?: {
23
23
  allowAlternativeLibraries?: readonly string[];
24
- }): Diagnostic[];
24
+ }): Promise<Diagnostic[]>;
@@ -1,4 +1,4 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  import type { Diagnostic } from "./types";
3
3
  export declare const SQL_SAFETY_DIAGNOSTIC_CODES: {
4
4
  readonly "sql-result-assertion": {
@@ -11,7 +11,7 @@ export declare const SQL_SAFETY_DIAGNOSTIC_CODES: {
11
11
  };
12
12
  };
13
13
  /**
14
- * Check Drizzle SQL operations using resolved symbols, including aliases and
14
+ * Check Kysely SQL operations using resolved symbols, including aliases and
15
15
  * re-exports. This is a type-escape guard, not an SQL parser or injection proof.
16
16
  */
17
- export declare function scanDrizzleSql(sourceFile: ts.SourceFile, checker: ts.TypeChecker, file: string, strict: boolean): Diagnostic[];
17
+ export declare function scanQuerySql(sourceFile: ts.SourceFile, checker: ts.TypeChecker, file: string, strict: boolean): Promise<Diagnostic[]>;
@@ -1,4 +1,4 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  import type { Diagnostic } from "./types";
3
3
  /** Reject runtime DI imports even in constructors, factory functions and aliased imports. */
4
- export declare function scanRuntimeDi(source: ts.SourceFile, file: string): Diagnostic[];
4
+ export declare function scanRuntimeDi(source: ts.SourceFile, file: string): Promise<Diagnostic[]>;
package/dist/traits.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as ts from "@typescript/typescript6";
1
+ import * as ts from "@supacloud/db/typescript";
2
2
  export type TraitKind = "module" | "injectable" | "controller" | "command" | "query" | "defineModule" | "defineFeatureSlice" | "injectionToken";
3
3
  export interface TraitRecord {
4
4
  kind: TraitKind;
@@ -55,5 +55,5 @@ export interface TypeSafetyScanOptions extends TypeSafetyOptions {
55
55
  outDir?: string;
56
56
  strict?: boolean;
57
57
  }
58
- export declare function scanGeneratedArtifacts(artifacts: Record<string, string | undefined>, strict?: boolean): Diagnostic[];
59
- export declare function scanProductionSource(options: TypeSafetyScanOptions): Diagnostic[];
58
+ export declare function scanGeneratedArtifacts(artifacts: Record<string, string | undefined>, strict?: boolean): Promise<Diagnostic[]>;
59
+ export declare function scanProductionSource(options: TypeSafetyScanOptions): Promise<Diagnostic[]>;
package/dist/types.d.ts CHANGED
@@ -55,6 +55,11 @@ export interface FunctionalInjectNode {
55
55
  host?: boolean;
56
56
  }
57
57
  export interface AspectRefNode {
58
+ /** Operation-specific factory binding, verified against the selected static boundary. */
59
+ operation?: {
60
+ kind: "route" | "command" | "job";
61
+ name: string;
62
+ };
58
63
  /** Exact project-local source path for context packs. */
59
64
  file?: string;
60
65
  /** Exported symbol name used in the generated static import. */
@@ -140,6 +145,12 @@ export type DiagnosticFix = {
140
145
  controller: string;
141
146
  route: string;
142
147
  };
148
+ export interface DependencyOptions {
149
+ optional?: boolean;
150
+ self?: boolean;
151
+ skipSelf?: boolean;
152
+ host?: boolean;
153
+ }
143
154
  export interface ProviderNode {
144
155
  /** Token name (InjectionToken variable name or class name). */
145
156
  token: string;
@@ -152,11 +163,13 @@ export interface ProviderNode {
152
163
  scope: Scope;
153
164
  /** Token names in constructor/factory parameter order. */
154
165
  deps: string[];
155
- /** Parameter tokens that are marked @Optional() (receive undefined if unresolved). */
166
+ /** Parameter-indexed modifiers; takes precedence over legacy token summaries. */
167
+ dependencyOptions?: DependencyOptions[];
168
+ /** Parameter tokens that are marked @Optional() (receive null if unresolved). */
156
169
  optionalDeps?: string[];
157
- /** Parameter tokens marked @Self() (must be resolved from current module's own providers). */
170
+ /** Parameter tokens marked @Self() (must be resolved at the current scope). */
158
171
  selfDeps?: string[];
159
- /** Parameter tokens marked @SkipSelf() (must NOT be resolved from current module's own providers). */
172
+ /** Parameter tokens marked @SkipSelf() (skip the current scope; a scoped consumer may use its module application parent). */
160
173
  skipSelfDeps?: string[];
161
174
  /** Parameter tokens marked @Host(). */
162
175
  hostDeps?: string[];
@@ -284,6 +297,8 @@ export interface ControllerNode {
284
297
  path: string;
285
298
  scope: Scope;
286
299
  deps: string[];
300
+ /** Parameter-indexed modifiers; takes precedence over legacy token summaries. */
301
+ dependencyOptions?: DependencyOptions[];
287
302
  /** Class implements OnDestroy interface or onDestroy method. */
288
303
  hasOnDestroy?: boolean;
289
304
  /** Class exposes an application startup hook. */
@@ -355,6 +370,144 @@ export interface JobNode {
355
370
  uses?: InfraResourceUseRef[];
356
371
  aspects?: AspectRefNode[];
357
372
  }
373
+ /** Static provider information exposed to deployment and tooling consumers. */
374
+ export interface ExecutionPlanProvider {
375
+ /** Effective injection modifiers in parameter order. */
376
+ dependencyOptions?: DependencyOptions[];
377
+ token: string;
378
+ kind: ProviderKind;
379
+ scope: Scope;
380
+ deps: string[];
381
+ optionalDeps: string[];
382
+ selfDeps: string[];
383
+ skipSelfDeps: string[];
384
+ hostDeps: string[];
385
+ multi: boolean;
386
+ exported: boolean;
387
+ lifecycle: {
388
+ init: boolean;
389
+ destroy: boolean;
390
+ };
391
+ }
392
+ export interface ExecutionPlanProviderEdge {
393
+ from: string;
394
+ to: string;
395
+ relation: "local" | "imported" | "root" | "context" | "external" | "unresolved";
396
+ }
397
+ export interface ExecutionPlanRoute {
398
+ method: RouteNode["method"];
399
+ path: string;
400
+ controller: string;
401
+ handler: string;
402
+ scope: Scope;
403
+ executor: "route" | "command";
404
+ invoker: "direct" | "pipeline";
405
+ commandBoundary?: "route" | "handler";
406
+ effect?: EffectRouteNode;
407
+ stages: string[];
408
+ command?: string;
409
+ guards: string[];
410
+ canMatch: string[];
411
+ canDeactivate: string[];
412
+ resolvers: string[];
413
+ aspects: string[];
414
+ plugin: {
415
+ name: string;
416
+ registration: "registerRoutes";
417
+ lifecycle: string[];
418
+ macros: string[];
419
+ conditions: string;
420
+ };
421
+ }
422
+ export interface ExecutionPlanCommand {
423
+ name: string;
424
+ className: string;
425
+ executor: "commandExecutor";
426
+ adapter: string | null;
427
+ permission: string | null;
428
+ audit: string | null;
429
+ transaction: CommandNode["transaction"];
430
+ idempotency: CommandNode["idempotency"];
431
+ branches: CommandBranchNode[];
432
+ tenantScope?: CommandNode["tenantScope"];
433
+ requiredCapabilities: {
434
+ permission: boolean;
435
+ audit: boolean;
436
+ idempotency: boolean;
437
+ transaction: boolean;
438
+ };
439
+ aspects: string[];
440
+ }
441
+ export interface ExecutionPlanJob {
442
+ name: string;
443
+ className: string;
444
+ scope: Scope;
445
+ mode: JobMode;
446
+ timeoutSec: number | null;
447
+ maxAttempts: number | null;
448
+ idempotency: JobIdempotency | null;
449
+ aspects: string[];
450
+ }
451
+ export interface ExecutionPlanModule {
452
+ name: string;
453
+ className: string;
454
+ tags: string[];
455
+ imports: string[];
456
+ providers: ExecutionPlanProvider[];
457
+ providerEdges: ExecutionPlanProviderEdge[];
458
+ scopes: {
459
+ application: string[];
460
+ request: string[];
461
+ job: string[];
462
+ };
463
+ lifecycle: {
464
+ initialize: Array<{
465
+ key: string;
466
+ index?: number;
467
+ }>;
468
+ destroy: Array<{
469
+ key: string;
470
+ index?: number;
471
+ }>;
472
+ requestDestroy: Array<{
473
+ key: string;
474
+ index?: number;
475
+ }>;
476
+ jobDestroy: Array<{
477
+ key: string;
478
+ index?: number;
479
+ }>;
480
+ };
481
+ plugin: {
482
+ name: string;
483
+ lifecycle: string[];
484
+ macros: string[];
485
+ conditions: string;
486
+ routeCount: number;
487
+ };
488
+ routes: ExecutionPlanRoute[];
489
+ commands: ExecutionPlanCommand[];
490
+ jobs: ExecutionPlanJob[];
491
+ aspects: string[];
492
+ }
493
+ /** Versioned, transport-aware plan emitted alongside static application factories. */
494
+ export interface CompiledExecutionManifest {
495
+ version: 1;
496
+ compiler: "@supacloud/compiler";
497
+ host: {
498
+ adapter: "elysia";
499
+ api: "2.x";
500
+ reflection: false;
501
+ proxy: false;
502
+ };
503
+ di: {
504
+ runtime: "angular-compatible";
505
+ generation: "static";
506
+ scopes: Scope[];
507
+ };
508
+ boundaries: ModuleBoundaryRule[];
509
+ modules: ExecutionPlanModule[];
510
+ }
358
511
  export interface QueryNode {
359
512
  className: string;
360
513
  name: string;
@@ -0,0 +1 @@
1
+ export * from "@supacloud/db/typescript";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.55.1",
3
+ "version": "0.57.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",
@@ -33,7 +33,7 @@
33
33
  "prepare:db": "bun install --cwd ../contracts --frozen-lockfile && bun run --cwd ../contracts build && bun install --cwd ../db --force --frozen-lockfile && bun run --cwd ../db build && bun install --force --frozen-lockfile",
34
34
  "prebuild": "bun run prepare:db",
35
35
  "pretypecheck": "bun run prepare:db",
36
- "build:js": "bun build src/index.ts src/diagnostics.ts src/cli.ts src/delivery-bundle-worker.ts src/database-governance-worker.ts --outdir dist --target node --conditions=supacloud-source --external @typescript/typescript6 --external @supacloud/db --external @supacloud/db/source-contracts --external graphql --external '@graphql-codegen/*'",
36
+ "build:js": "bun build src/index.ts src/diagnostics.ts src/cli.ts src/delivery-bundle-worker.ts src/database-governance-worker.ts --outdir dist --target node --conditions=supacloud-source --external typescript --external 'typescript/*' --external @supacloud/db --external @supacloud/db/source-contracts --external graphql --external '@graphql-codegen/*'",
37
37
  "build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
38
38
  "clean": "rm -rf dist",
39
39
  "prepublishOnly": "bun run build && bun run test:package",
@@ -57,25 +57,27 @@
57
57
  "directory": "packages/compiler"
58
58
  },
59
59
  "dependencies": {
60
- "@supacloud/db": "0.20.5",
61
- "@supacloud/delivery": "0.24.0",
60
+ "@supacloud/db": "0.21.0",
61
+ "@supacloud/delivery": "0.25.0",
62
62
  "typebox": "1.4.3",
63
63
  "@graphql-codegen/core": "^6.2.2",
64
64
  "@graphql-codegen/typed-document-node": "^7.2.0",
65
65
  "@graphql-codegen/typescript-operations": "^6.1.10",
66
66
  "@graphql-typed-document-node/core": "^3.2.0",
67
- "@typescript/typescript6": "^6.0.2",
68
- "graphql": "^16"
67
+ "graphql": "^16",
68
+ "typescript": "7.1.0-beta"
69
69
  },
70
70
  "overrides": {
71
- "@supacloud/contracts": "0.15.2",
71
+ "@supacloud/contracts": "0.16.0",
72
72
  "@graphql-tools/utils": "^12.0.4",
73
- "@whatwg-node/promise-helpers": "2.0.0"
73
+ "@whatwg-node/promise-helpers": "2.0.0",
74
+ "deepmerge-ts": "8.0.2",
75
+ "prisma": "6.19.3"
74
76
  },
75
77
  "devDependencies": {
76
78
  "@supabase/supabase-js": "2.118.0",
77
- "drizzle-orm": "1.0.0-rc.5-5935859",
78
79
  "@types/bun": "^1.4.4",
79
- "typescript": "^7.0.2"
80
+ "@zenstackhq/schema": "3.10.0",
81
+ "@zenstackhq/orm": "3.10.0"
80
82
  }
81
83
  }