@supacloud/compiler 0.12.0 → 0.13.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 +117 -1
- package/dist/cli.js +3895 -3317
- package/dist/config.d.ts +4 -1
- package/dist/generate.d.ts +1 -0
- package/dist/graphql-client.d.ts +2 -0
- package/dist/graphql-inputs.d.ts +3 -0
- package/dist/graphql-options.d.ts +7 -0
- package/dist/graphql-schema.d.ts +17 -0
- package/dist/graphql.d.ts +8 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4041 -3527
- package/dist/inspect.d.ts +1 -0
- package/dist/types.d.ts +28 -0
- package/package.json +10 -4
package/dist/inspect.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -287,6 +287,8 @@ export interface ModuleNode {
|
|
|
287
287
|
featureSpec?: FeatureSpecNode;
|
|
288
288
|
}
|
|
289
289
|
export interface ApplicationGraph {
|
|
290
|
+
/** Offline query inventory for AI context. Kept in graphql.manifest.json, not app.manifest.json. */
|
|
291
|
+
graphql?: GraphqlContractSummary;
|
|
290
292
|
modules: ModuleNode[];
|
|
291
293
|
/** Depended token names provided by platform injection rather than any module. */
|
|
292
294
|
externalTokens: string[];
|
|
@@ -308,6 +310,8 @@ export interface ApplicationGraph {
|
|
|
308
310
|
};
|
|
309
311
|
}
|
|
310
312
|
export interface CompileOptions {
|
|
313
|
+
/** Opt-in, offline GraphQL query contracts backed by a role-scoped schema snapshot. */
|
|
314
|
+
graphql?: GraphqlOptions;
|
|
311
315
|
/** Require schemas for bound route inputs and responses. Does not prove runtime validation. */
|
|
312
316
|
requireRouteContracts?: boolean;
|
|
313
317
|
/** Project root directory (containing tsconfig). */
|
|
@@ -348,6 +352,30 @@ export interface CompileOptions {
|
|
|
348
352
|
/** Type-safety gates for generated artifacts and production source. */
|
|
349
353
|
typeSafety?: TypeSafetyOptions;
|
|
350
354
|
}
|
|
355
|
+
export interface GraphqlOptions {
|
|
356
|
+
/** Additionally emit standard TypedDocumentNode artifacts for GraphQL ecosystem clients. */
|
|
357
|
+
typedDocuments?: boolean;
|
|
358
|
+
/** Exported role-scoped database snapshot (.graphql/.gql/.json), never authored SDL or executable code.
|
|
359
|
+
* Relative to rootDir for the programmatic API. Offline compilation does not attest its origin. */
|
|
360
|
+
schema: string;
|
|
361
|
+
/** Query/fragment globs relative to rootDir. Defaults to all .graphql and .gql files. */
|
|
362
|
+
documents?: string[];
|
|
363
|
+
/** Explicit wire types for custom scalars. Unmapped scalars remain unknown. */
|
|
364
|
+
scalars?: Record<string, string | {
|
|
365
|
+
input: string;
|
|
366
|
+
output: string;
|
|
367
|
+
}>;
|
|
368
|
+
}
|
|
369
|
+
export interface GraphqlContractSummary {
|
|
370
|
+
schema: string;
|
|
371
|
+
schemaHash?: string;
|
|
372
|
+
documents: string[];
|
|
373
|
+
operations: Array<{
|
|
374
|
+
name: string;
|
|
375
|
+
file: string;
|
|
376
|
+
line: number;
|
|
377
|
+
}>;
|
|
378
|
+
}
|
|
351
379
|
export interface TypeSafetyOptions {
|
|
352
380
|
/** Reject the `any` keyword in generated TypeScript artifacts. */
|
|
353
381
|
noAnyInGenerated?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "bun run clean && bun run build:js && bun run build:types",
|
|
25
|
-
"build:js": "bun build src/index.ts src/cli.ts --outdir dist --target node --external @typescript/typescript6",
|
|
25
|
+
"build:js": "bun build src/index.ts src/cli.ts --outdir dist --target node --external @typescript/typescript6 --external graphql --external '@graphql-codegen/*'",
|
|
26
26
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
27
27
|
"clean": "rm -rf dist",
|
|
28
|
-
"prepublishOnly": "bun run build",
|
|
28
|
+
"prepublishOnly": "bun run build && bun run test:package",
|
|
29
29
|
"test": "bun test",
|
|
30
|
+
"test:package": "SUPACLOUD_COMPILER_TEST_CLI=\"$PWD/dist/cli.js\" bun test src/graphql-package.test.ts",
|
|
30
31
|
"benchmark": "bun run src/benchmark.ts",
|
|
31
32
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
33
|
"typecheck:test": "tsc -p tsconfig.test.json --noEmit"
|
|
@@ -45,7 +46,12 @@
|
|
|
45
46
|
"directory": "packages/compiler"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@
|
|
49
|
+
"@graphql-codegen/core": "^6.2.0",
|
|
50
|
+
"@graphql-codegen/typed-document-node": "^7.1.0",
|
|
51
|
+
"@graphql-codegen/typescript-operations": "^6.1.6",
|
|
52
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
53
|
+
"@typescript/typescript6": "^6.0.2",
|
|
54
|
+
"graphql": "^16"
|
|
49
55
|
},
|
|
50
56
|
"devDependencies": {
|
|
51
57
|
"@types/bun": "^1.4.0",
|