@supacloud/compiler 0.52.2 → 0.53.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/cli.js +641 -201
- package/dist/index.js +9 -0
- package/dist/preview-fix-cli.d.ts +2 -0
- package/dist/preview-fix-loop.d.ts +72 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16839,6 +16839,11 @@ var init_application_history = __esm(() => {
|
|
|
16839
16839
|
});
|
|
16840
16840
|
|
|
16841
16841
|
// node_modules/@supacloud/delivery/src/application-preview.ts
|
|
16842
|
+
function applicationPreviewBranchRef(previewId) {
|
|
16843
|
+
if (!/^[a-f0-9-]{8,64}$/.test(previewId))
|
|
16844
|
+
throw new Error("Invalid preview ID");
|
|
16845
|
+
return `pv${previewId.replace(/-/g, "").slice(0, 18)}`;
|
|
16846
|
+
}
|
|
16842
16847
|
var phaseStatus, closed7, ApplicationPreviewReceiptSchema;
|
|
16843
16848
|
var init_application_preview = __esm(() => {
|
|
16844
16849
|
init_build();
|
|
@@ -16899,6 +16904,10 @@ var init_application_preview = __esm(() => {
|
|
|
16899
16904
|
status: phaseStatus,
|
|
16900
16905
|
activation_id: Union([ApplicationActivationIdSchema, Null()])
|
|
16901
16906
|
}, closed7),
|
|
16907
|
+
functions: Optional(_Object_({
|
|
16908
|
+
status: phaseStatus,
|
|
16909
|
+
slugs: _Array_(String2({ pattern: "^[A-Za-z0-9_-]{1,128}$" }), { maxItems: 64 })
|
|
16910
|
+
}, closed7)),
|
|
16902
16911
|
smoke_test: _Object_({
|
|
16903
16912
|
status: phaseStatus,
|
|
16904
16913
|
checks: _Array_(String2({ minLength: 1, maxLength: 64 }), { maxItems: 32 }),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Recorded preview evidence. This file is not a live deploy and not an npm publish. */
|
|
2
|
+
export declare const PREVIEW_DEPLOY_RECEIPT_SCHEMA = "supacloud.preview-deploy-receipt.v1";
|
|
3
|
+
export type PreviewFixErrorCode = "PREVIEW_FIX_ROOT_UNSUPPORTED" | "PREVIEW_FIX_IDENTITY_MISMATCH" | "PREVIEW_FIX_POLICY_REQUIRED" | "PREVIEW_FIX_DIAGNOSIS_REQUIRED" | "PRODUCTION_APPROVAL_REQUIRED" | "PREVIEW_FIX_COMPILE_FAILED" | "PREVIEW_FIX_INVOKE_FAILED" | "PREVIEW_FIX_TIMELINE_UNAVAILABLE" | "PREVIEW_FIX_RECEIPT_INVALID";
|
|
4
|
+
export declare class PreviewFixError extends Error {
|
|
5
|
+
readonly code: PreviewFixErrorCode;
|
|
6
|
+
constructor(code: PreviewFixErrorCode);
|
|
7
|
+
}
|
|
8
|
+
export interface PreviewFixLoopInput {
|
|
9
|
+
productionRoot: string;
|
|
10
|
+
previewRoot: string;
|
|
11
|
+
previewId: string;
|
|
12
|
+
projectRef: string;
|
|
13
|
+
applicationId: string;
|
|
14
|
+
environmentId: string;
|
|
15
|
+
/** Explicit governance choice. The loop does not infer required or none. */
|
|
16
|
+
property: "transaction" | "idempotency";
|
|
17
|
+
value: "required" | "none";
|
|
18
|
+
}
|
|
19
|
+
export interface PreviewDeployReceipt {
|
|
20
|
+
schema: typeof PREVIEW_DEPLOY_RECEIPT_SCHEMA;
|
|
21
|
+
deployed: false;
|
|
22
|
+
published: false;
|
|
23
|
+
live: false;
|
|
24
|
+
target: "preview";
|
|
25
|
+
preview_id: string;
|
|
26
|
+
project_ref: string;
|
|
27
|
+
application_id: string;
|
|
28
|
+
environment_id: string;
|
|
29
|
+
branch_ref: string;
|
|
30
|
+
artifact_sha256: string;
|
|
31
|
+
status: "recorded";
|
|
32
|
+
graph: {
|
|
33
|
+
modules: string[];
|
|
34
|
+
command: string;
|
|
35
|
+
transaction: "required" | "none";
|
|
36
|
+
};
|
|
37
|
+
change: {
|
|
38
|
+
file: string;
|
|
39
|
+
written: true;
|
|
40
|
+
};
|
|
41
|
+
diagnosis: {
|
|
42
|
+
code: string;
|
|
43
|
+
errorCode: string;
|
|
44
|
+
file: string;
|
|
45
|
+
};
|
|
46
|
+
test: {
|
|
47
|
+
operation: string;
|
|
48
|
+
ok: true;
|
|
49
|
+
};
|
|
50
|
+
timeline: {
|
|
51
|
+
requestId: string;
|
|
52
|
+
operation: string;
|
|
53
|
+
handler: "succeeded";
|
|
54
|
+
failed: false;
|
|
55
|
+
complete: boolean;
|
|
56
|
+
missingStages: string[];
|
|
57
|
+
};
|
|
58
|
+
production: {
|
|
59
|
+
written: false;
|
|
60
|
+
approval: "required";
|
|
61
|
+
graphRead: true;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Closed check for the receipt this loop writes. Rejects a live or published claim. */
|
|
65
|
+
export declare function parsePreviewDeployReceipt(value: unknown): PreviewDeployReceipt;
|
|
66
|
+
/**
|
|
67
|
+
* One pass inside an already isolated preview directory.
|
|
68
|
+
* Reads the application graph, applies one explicit command-mode fix, compiles,
|
|
69
|
+
* invokes `execute`, and reads that invoke's timeline. Production is hashed and
|
|
70
|
+
* only read. This does not provision a preview and does not deploy.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runPreviewFixLoop(input: PreviewFixLoopInput): Promise<PreviewDeployReceipt>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@supacloud/db": "0.20.3",
|
|
61
|
-
"@supacloud/delivery": "0.
|
|
61
|
+
"@supacloud/delivery": "0.24.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",
|