@supacloud/compiler 0.27.4 → 0.29.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,4 @@
1
+ import * as ts from "@typescript/typescript6";
2
+ import type { Diagnostic } from "./types";
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[];
@@ -0,0 +1,2 @@
1
+ /** This artifact-only entry never loads source, project configuration or credentials. */
2
+ export declare function runReleaseEvidenceCommand(args: readonly string[]): Promise<void>;
@@ -0,0 +1,54 @@
1
+ import type { DeliveryObject } from "./delivery-build-schema";
2
+ /** Build evidence only; this does not attest deployment, health or rollback safety. */
3
+ export declare const RELEASE_EVIDENCE_SCHEMA = "supacloud.release-evidence.v1";
4
+ export type ReleaseEvidenceErrorCode = "RELEASE_EVIDENCE_INVALID" | "RELEASE_EVIDENCE_TARGET_NOT_FOUND";
5
+ export declare class ReleaseEvidenceError extends Error {
6
+ readonly code: ReleaseEvidenceErrorCode;
7
+ constructor(code: ReleaseEvidenceErrorCode);
8
+ }
9
+ export interface ReleaseEvidence {
10
+ schema: typeof RELEASE_EVIDENCE_SCHEMA;
11
+ correlation: "verified-build-snapshot";
12
+ deploymentVerified: false;
13
+ target: string;
14
+ build: {
15
+ producer: string;
16
+ deploymentReady: false;
17
+ manifestSha256: string;
18
+ objectId: string;
19
+ entryKind: DeliveryObject["entryKind"];
20
+ entrypoint: "bundle/index.js";
21
+ files: number;
22
+ bytes: number;
23
+ };
24
+ contract: {
25
+ status: "present" | "absent";
26
+ schema: string | null;
27
+ resources: number;
28
+ diagnostics: {
29
+ errors: number;
30
+ warnings: number;
31
+ };
32
+ };
33
+ migrations: {
34
+ status: "present" | "absent";
35
+ count: number;
36
+ latestVersion: string | null;
37
+ executionPerformed: false;
38
+ compatibility: "not-proven";
39
+ dataRecovery: "separate-required";
40
+ };
41
+ rollback: {
42
+ application: string;
43
+ database: string;
44
+ storage: string;
45
+ };
46
+ notes: string[];
47
+ }
48
+ /**
49
+ * Read one bounded manifest, verify its selected object, and correlate every
50
+ * secondary reader to that exact object. Missing optional metadata is different
51
+ * from invalid metadata: any integrity, schema, UTF-8 or target failure is fatal.
52
+ */
53
+ export declare function createReleaseEvidence(manifestPath: string, target: string): Promise<ReleaseEvidence>;
54
+ export declare function formatReleaseEvidence(evidence: ReleaseEvidence): string;
package/dist/types.d.ts CHANGED
@@ -9,6 +9,37 @@ export type JobIdempotency = "required" | "none";
9
9
  export type JobSchemaKind = "opaque" | "declared";
10
10
  export type ProviderKind = "class" | "value" | "factory" | "existing";
11
11
  export type TokenKind = "injection-token" | "class";
12
+ export type InfraResourceKind = "database" | "bucket" | "queue" | "config" | "secret";
13
+ export type InfraResourceOperation = "read" | "write" | "publish" | "consume";
14
+ /**
15
+ * A logical infrastructure resource declared with `@InfraResource`. It carries
16
+ * no credentials and is never provisioned by the compiler; it only names what
17
+ * the application requires. Environment bindings resolve the name per target.
18
+ */
19
+ export interface InfraResourceNode {
20
+ /** Stable logical name shared across environments. */
21
+ name: string;
22
+ kind: InfraResourceKind;
23
+ className: string;
24
+ file: string;
25
+ line: number;
26
+ /** Relative module path of the declaring class (for import generation). */
27
+ importPath: string;
28
+ }
29
+ export interface InfraResourceUseRef {
30
+ /** Logical resource name. */
31
+ resource: string;
32
+ operations: InfraResourceOperation[];
33
+ }
34
+ /** One module/command/job resource use, kept for inspection and validation. */
35
+ export interface ResourceUseNode extends InfraResourceUseRef {
36
+ module: string;
37
+ /** Command name when the use is declared on a command. */
38
+ command?: string;
39
+ /** Job name when the use is declared on a Job. */
40
+ job?: string;
41
+ resourceClass: string;
42
+ }
12
43
  export interface FunctionalInjectNode {
13
44
  /** Logical token name used by the application graph. */
14
45
  token: string;
@@ -133,6 +164,8 @@ export interface ProviderNode {
133
164
  providedIn?: "root";
134
165
  /** Class implements OnDestroy interface or onDestroy method. */
135
166
  hasOnDestroy?: boolean;
167
+ /** Class exposes an application startup hook. */
168
+ hasOnInit?: boolean;
136
169
  exported: boolean;
137
170
  file: string;
138
171
  line: number;
@@ -214,6 +247,8 @@ export interface ControllerNode {
214
247
  deps: string[];
215
248
  /** Class implements OnDestroy interface or onDestroy method. */
216
249
  hasOnDestroy?: boolean;
250
+ /** Class exposes an application startup hook. */
251
+ hasOnInit?: boolean;
217
252
  /** Parameter tokens marked @Optional(). */
218
253
  optionalDeps?: string[];
219
254
  selfDeps?: string[];
@@ -240,6 +275,8 @@ export interface CommandNode {
240
275
  idempotency: "required" | "none";
241
276
  /** Automatically registered without manual module declaration. */
242
277
  standalone?: boolean;
278
+ /** Infrastructure resources this command uses, with the declared operations. */
279
+ uses?: InfraResourceUseRef[];
243
280
  /** Explicit aspects applied around this command. */
244
281
  aspects?: AspectRefNode[];
245
282
  }
@@ -264,6 +301,8 @@ export interface JobNode {
264
301
  maxAttempts?: number;
265
302
  /** Adapter-owned idempotency requirement. */
266
303
  idempotency?: JobIdempotency;
304
+ /** Infrastructure resources this job uses, with the declared operations. */
305
+ uses?: InfraResourceUseRef[];
267
306
  aspects?: AspectRefNode[];
268
307
  }
269
308
  export interface QueryNode {
@@ -303,6 +342,8 @@ export interface ModuleNode {
303
342
  commands: CommandNode[];
304
343
  jobs?: JobNode[];
305
344
  queries: QueryNode[];
345
+ /** Logical infrastructure resource names this module requires. */
346
+ resources?: string[];
306
347
  /** Explicit aspects applied to all routes and commands in this module. */
307
348
  aspects?: AspectRefNode[];
308
349
  /** Exported token names. */
@@ -312,6 +353,10 @@ export interface ModuleNode {
312
353
  export interface ApplicationGraph {
313
354
  /** Handler declaration files by module, for inspection only; omitted from app.manifest.json. */
314
355
  moduleHandlerFiles?: Record<string, string[]>;
356
+ /** Declared logical infrastructure resources, deduplicated by name. */
357
+ resources?: InfraResourceNode[];
358
+ /** Module/command/job resource uses, sorted deterministically. */
359
+ resourceUses?: ResourceUseNode[];
315
360
  /** Offline query inventory for AI context. Kept in graphql.manifest.json, not app.manifest.json. */
316
361
  graphql?: GraphqlContractSummary;
317
362
  modules: ModuleNode[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.27.4",
3
+ "version": "0.29.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",
@@ -14,6 +14,11 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "import": "./dist/index.js",
16
16
  "default": "./dist/index.js"
17
+ },
18
+ "./diagnostics": {
19
+ "types": "./dist/diagnostics.d.ts",
20
+ "import": "./dist/diagnostics.js",
21
+ "default": "./dist/diagnostics.js"
17
22
  }
18
23
  },
19
24
  "files": [
@@ -25,7 +30,7 @@
25
30
  ],
26
31
  "scripts": {
27
32
  "build": "bun run clean && bun run build:js && bun run build:types",
28
- "build:js": "bun build src/index.ts src/cli.ts src/delivery-bundle-worker.ts --outdir dist --target node --conditions=supacloud-source --external @typescript/typescript6 --external graphql --external '@graphql-codegen/*'",
33
+ "build:js": "bun build src/index.ts src/diagnostics.ts src/cli.ts src/delivery-bundle-worker.ts --outdir dist --target node --conditions=supacloud-source --external @typescript/typescript6 --external graphql --external '@graphql-codegen/*'",
29
34
  "build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
30
35
  "clean": "rm -rf dist",
31
36
  "prepublishOnly": "bun run build && bun run test:package",
@@ -42,14 +47,14 @@
42
47
  "codegen",
43
48
  "elysia"
44
49
  ],
45
- "license": "AGPL-3.0-only",
50
+ "license": "Apache-2.0",
46
51
  "repository": {
47
52
  "type": "git",
48
53
  "url": "https://github.com/vibeunion/supacloud.git",
49
54
  "directory": "packages/compiler"
50
55
  },
51
56
  "dependencies": {
52
- "@supacloud/delivery": "0.2.1",
57
+ "@supacloud/delivery": "0.4.0",
53
58
  "typebox": "1.3.34",
54
59
  "@graphql-codegen/core": "^6.2.0",
55
60
  "@graphql-codegen/typed-document-node": "^7.1.0",