@supacloud/compiler 0.56.0 → 0.57.1
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/README.md +22 -14
- package/dist/api-source.d.ts +6 -5
- package/dist/cli.js +2066 -1829
- package/dist/command-boundary.d.ts +4 -2
- package/dist/database-contracts.d.ts +2 -2
- package/dist/delivery-bundle-worker.js +118 -78
- package/dist/delivery-imports.d.ts +1 -1
- package/dist/di-resolution.d.ts +39 -0
- package/dist/diagnostics.js +62 -22
- package/dist/graphql-runtime.d.ts +1 -1
- package/dist/http-provider-migration.d.ts +3 -3
- package/dist/incremental.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2057 -1820
- package/dist/inspect.d.ts +1 -1
- package/dist/migration-app-version.d.ts +1 -1
- package/dist/migration-elysia-version.d.ts +1 -1
- package/dist/migrations.d.ts +2 -2
- package/dist/program.d.ts +7 -19
- package/dist/reactive-analysis.d.ts +2 -2
- package/dist/source-semantics.d.ts +2 -2
- package/dist/sql-safety.d.ts +3 -3
- package/dist/static-di.d.ts +2 -2
- package/dist/traits.d.ts +1 -1
- package/dist/type-safety.d.ts +2 -2
- package/dist/types.d.ts +20 -3
- package/dist/typescript.d.ts +1 -0
- package/package.json +12 -10
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: "
|
|
29
|
+
databaseSource: "zmodel-append-only";
|
|
30
30
|
};
|
|
31
31
|
relatedModules: {
|
|
32
32
|
importedBy: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MIGRATION_APP_VERSION = "0.
|
|
1
|
+
export declare const MIGRATION_APP_VERSION = "0.38.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MIGRATION_ELYSIA_VERSION = "0.
|
|
1
|
+
export declare const MIGRATION_ELYSIA_VERSION = "0.40.0";
|
package/dist/migrations.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|
|
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[]>;
|
package/dist/sql-safety.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ts from "@typescript
|
|
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
|
|
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
|
|
17
|
+
export declare function scanQuerySql(sourceFile: ts.SourceFile, checker: ts.TypeChecker, file: string, strict: boolean): Promise<Diagnostic[]>;
|
package/dist/static-di.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ts from "@typescript
|
|
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
|
|
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;
|
package/dist/type-safety.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
170
|
+
/** Parameter tokens marked @Self() (must be resolved at the current scope). */
|
|
158
171
|
selfDeps?: string[];
|
|
159
|
-
/** Parameter tokens marked @SkipSelf() (
|
|
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. */
|
|
@@ -357,6 +372,8 @@ export interface JobNode {
|
|
|
357
372
|
}
|
|
358
373
|
/** Static provider information exposed to deployment and tooling consumers. */
|
|
359
374
|
export interface ExecutionPlanProvider {
|
|
375
|
+
/** Effective injection modifiers in parameter order. */
|
|
376
|
+
dependencyOptions?: DependencyOptions[];
|
|
360
377
|
token: string;
|
|
361
378
|
kind: ProviderKind;
|
|
362
379
|
scope: Scope;
|
|
@@ -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.
|
|
3
|
+
"version": "0.57.1",
|
|
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
|
|
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.
|
|
61
|
-
"@supacloud/delivery": "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
|
-
"
|
|
68
|
-
"
|
|
67
|
+
"graphql": "^16",
|
|
68
|
+
"typescript": "7.1.0-beta"
|
|
69
69
|
},
|
|
70
70
|
"overrides": {
|
|
71
|
-
"@supacloud/contracts": "0.
|
|
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
|
-
"
|
|
80
|
+
"@zenstackhq/schema": "3.10.0",
|
|
81
|
+
"@zenstackhq/orm": "3.10.0"
|
|
80
82
|
}
|
|
81
83
|
}
|