@supacloud/cli 0.119.1 → 0.120.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/index.js +48 -6
- package/dist/shared/tools/app-tools.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -9368,7 +9368,7 @@ var ACTION_POLICY = {
|
|
|
9368
9368
|
init: { local: ["init"] },
|
|
9369
9369
|
env: { local: ["list", "check"] },
|
|
9370
9370
|
app: {
|
|
9371
|
-
local: ["init", "generate", "dev", "watch", "verify-plan", "compile", "check", "graph", "explain", "export-tools", "context", "doctor", "fix", "plan", "build"],
|
|
9371
|
+
local: ["init", "generate", "dev", "watch", "verify-plan", "compile", "check", "graph", "explain", "export-tools", "context", "lens", "doctor", "fix", "plan", "build"],
|
|
9372
9372
|
read: ["status", "evidence", "logs", "transfer-plan", "promote-plan", "rollback-plan", "history", "deploy-plan", "diff", "promote-status", "preview-plan", "previews", "preview-list", "preview-status"],
|
|
9373
9373
|
write: ["release", "upload", "configure", "transfer", "promote", "promote-reconcile", "deploy", "rollback", "reconcile", "retire", "preview", "preview-create", "preview-reconcile", "preview-cleanup"]
|
|
9374
9374
|
},
|
|
@@ -22099,6 +22099,8 @@ import {
|
|
|
22099
22099
|
planDeliveryProject,
|
|
22100
22100
|
resolveSupacloudConfig,
|
|
22101
22101
|
readExecutionMetadata,
|
|
22102
|
+
createProjectSemanticSnapshot,
|
|
22103
|
+
createSemanticLens,
|
|
22102
22104
|
watchProject
|
|
22103
22105
|
} from "@supacloud/compiler";
|
|
22104
22106
|
|
|
@@ -22225,7 +22227,7 @@ var starter_metadata_default = {
|
|
|
22225
22227
|
generatedBy: "supacloud/starter-metadata-v1",
|
|
22226
22228
|
packages: {
|
|
22227
22229
|
compiler: {
|
|
22228
|
-
version: "0.
|
|
22230
|
+
version: "0.62.0"
|
|
22229
22231
|
},
|
|
22230
22232
|
app: {
|
|
22231
22233
|
version: "0.39.1",
|
|
@@ -28888,6 +28890,7 @@ function formatModuleContextPack(pack) {
|
|
|
28888
28890
|
` external tokens: ${pack.externalTokens.join(", ") || "-"}`,
|
|
28889
28891
|
` imports: ${pack.relatedModules.imports.join(", ") || "-"}`,
|
|
28890
28892
|
` imported by: ${pack.relatedModules.importedBy.join(", ") || "-"}`,
|
|
28893
|
+
` semantic hash: ${pack.semantic.hash}`,
|
|
28891
28894
|
...pack.graphql ? [
|
|
28892
28895
|
` graphql schema: ${pack.graphql.schema}`,
|
|
28893
28896
|
` graphql queries: ${pack.graphql.operations.map((operation) => operation.name).join(", ") || "-"}`
|
|
@@ -28943,6 +28946,7 @@ async function runContext(args) {
|
|
|
28943
28946
|
].join(`
|
|
28944
28947
|
`));
|
|
28945
28948
|
}
|
|
28949
|
+
const semantic = await createProjectSemanticSnapshot(result.graph, root, outDir);
|
|
28946
28950
|
const project = {
|
|
28947
28951
|
version: 1,
|
|
28948
28952
|
root,
|
|
@@ -28951,6 +28955,12 @@ async function runContext(args) {
|
|
|
28951
28955
|
modules: result.graph.modules,
|
|
28952
28956
|
externalTokens: result.graph.externalTokens,
|
|
28953
28957
|
diagnostics: result.diagnostics,
|
|
28958
|
+
semantic: {
|
|
28959
|
+
version: 1,
|
|
28960
|
+
hash: semantic.semanticHash,
|
|
28961
|
+
sourceHash: semantic.sourceHash,
|
|
28962
|
+
nodeCount: semantic.nodes.length
|
|
28963
|
+
},
|
|
28954
28964
|
allowedDependencies: await readAllowedDependencies(root),
|
|
28955
28965
|
commands: {
|
|
28956
28966
|
check: "supacloud app check",
|
|
@@ -28975,6 +28985,8 @@ async function runContext(args) {
|
|
|
28975
28985
|
`CONTEXT ${root}`,
|
|
28976
28986
|
` config: ${configFile ?? "(none)"}`,
|
|
28977
28987
|
` generated: ${outDir}`,
|
|
28988
|
+
` semantic hash: ${project.semantic.hash}`,
|
|
28989
|
+
` source hash: ${project.semantic.sourceHash}`,
|
|
28978
28990
|
` modules: ${project.modules.map((module) => module.name).join(", ") || "-"}`,
|
|
28979
28991
|
` external tokens: ${project.externalTokens.join(", ") || "-"}`,
|
|
28980
28992
|
` dependencies: ${project.allowedDependencies.dependencies.join(", ") || "-"}`,
|
|
@@ -28985,6 +28997,32 @@ async function runContext(args) {
|
|
|
28985
28997
|
].join(`
|
|
28986
28998
|
`));
|
|
28987
28999
|
}
|
|
29000
|
+
async function runLens(args) {
|
|
29001
|
+
const { root, sourceDir, outDir, result } = await projectCompileConfig(args);
|
|
29002
|
+
const graph = { ...result.graph, diagnostics: result.diagnostics };
|
|
29003
|
+
const target = args.target?.trim();
|
|
29004
|
+
const snapshot = await createProjectSemanticSnapshot(result.graph, root, outDir);
|
|
29005
|
+
const lens = createSemanticLens(graph, target, { snapshot, detail: args.detail === true });
|
|
29006
|
+
const context = target ? createContextPack(graph, lens.subject ?? target, snapshot) : undefined;
|
|
29007
|
+
const output = {
|
|
29008
|
+
version: 1,
|
|
29009
|
+
root,
|
|
29010
|
+
sourceRoot: sourceDir,
|
|
29011
|
+
generatedDir: outDir,
|
|
29012
|
+
...lens,
|
|
29013
|
+
...context ? { context } : {},
|
|
29014
|
+
diagnostics: result.diagnostics
|
|
29015
|
+
};
|
|
29016
|
+
if (args.format === "json")
|
|
29017
|
+
return textResult(JSON.stringify(output, null, 2), lens.conflicts.some((conflict) => conflict.severity === "error"));
|
|
29018
|
+
const lines = [`LENS ${context?.subject ?? "application"}`, ` semantic hash: ${lens.snapshot.semanticHash}`, ` source hash: ${lens.snapshot.sourceHash}`];
|
|
29019
|
+
for (const item of lens.nodes)
|
|
29020
|
+
lines.push(` ${item.kind} ${item.id} ${item.hash}`);
|
|
29021
|
+
for (const conflict of lens.conflicts)
|
|
29022
|
+
lines.push(` ${conflict.severity.toUpperCase()} ${conflict.code}: ${conflict.message}`);
|
|
29023
|
+
return textResult(lines.join(`
|
|
29024
|
+
`), lens.conflicts.some((conflict) => conflict.severity === "error"));
|
|
29025
|
+
}
|
|
28988
29026
|
function doctorFixPlan(doctor) {
|
|
28989
29027
|
return createDiagnosticRepairPlan(doctor.diagnostics ?? []).map((repair, index) => ({
|
|
28990
29028
|
...repair,
|
|
@@ -30164,6 +30202,8 @@ async function runAppTool(request, options = {}) {
|
|
|
30164
30202
|
return runExportTools(request);
|
|
30165
30203
|
case "context":
|
|
30166
30204
|
return runContext(request);
|
|
30205
|
+
case "lens":
|
|
30206
|
+
return runLens(request);
|
|
30167
30207
|
case "doctor":
|
|
30168
30208
|
return runDoctor(request);
|
|
30169
30209
|
case "fix":
|
|
@@ -30187,6 +30227,7 @@ function registerAppTools(server, options = {}) {
|
|
|
30187
30227
|
"explain",
|
|
30188
30228
|
"export-tools",
|
|
30189
30229
|
"context",
|
|
30230
|
+
"lens",
|
|
30190
30231
|
"doctor",
|
|
30191
30232
|
"fix",
|
|
30192
30233
|
"plan",
|
|
@@ -30243,7 +30284,8 @@ function registerAppTools(server, options = {}) {
|
|
|
30243
30284
|
once: optional(Boolean2(), "[dev] Validate and report once without watching"),
|
|
30244
30285
|
watch: optional(Boolean2(), "[dev] Watch for changes (default: true; --once disables)"),
|
|
30245
30286
|
database_url: optional(String2(), "[dev] Explicit loopback integration URL; watch/once only inspect its shape"),
|
|
30246
|
-
target: optional(String2(), "[explain/context/verify-plan] Provider class name / token name / command name / job name / module name"),
|
|
30287
|
+
target: optional(String2(), "[explain/context/lens/verify-plan] Provider class name / token name / command name / job name / module name"),
|
|
30288
|
+
detail: optional(Boolean2(), "[lens] Include the per-node value payload (larger output)"),
|
|
30247
30289
|
events: optional(String2(), "[context] Project-relative execution metadata JSON or generated JSON-lines file"),
|
|
30248
30290
|
request_id: optional(String2(), "[context] Opaque request ID or Workflow run ID selected from --events"),
|
|
30249
30291
|
fix: optional(String2(), "[fix] Path to a DiagnosticFix JSON file produced by `doctor --format json`"),
|
|
@@ -34301,7 +34343,7 @@ async function runProjectDeployment(http, args) {
|
|
|
34301
34343
|
// package.json
|
|
34302
34344
|
var package_default = {
|
|
34303
34345
|
name: "@supacloud/cli",
|
|
34304
|
-
version: "0.
|
|
34346
|
+
version: "0.120.0",
|
|
34305
34347
|
description: "Project-scoped CLI for SupaCloud users",
|
|
34306
34348
|
type: "module",
|
|
34307
34349
|
main: "./dist/index.js",
|
|
@@ -34353,7 +34395,7 @@ var package_default = {
|
|
|
34353
34395
|
directory: "packages/cli"
|
|
34354
34396
|
},
|
|
34355
34397
|
dependencies: {
|
|
34356
|
-
"@supacloud/compiler": "^0.
|
|
34398
|
+
"@supacloud/compiler": "^0.62.0",
|
|
34357
34399
|
"@supacloud/delivery": "0.26.0",
|
|
34358
34400
|
"@supacloud/db": "0.24.0",
|
|
34359
34401
|
typebox: "1.4.3"
|
|
@@ -34362,7 +34404,7 @@ var package_default = {
|
|
|
34362
34404
|
"@supacloud/contracts": "0.16.1",
|
|
34363
34405
|
"@supacloud/delivery": "0.26.0",
|
|
34364
34406
|
"@graphql-tools/utils": "^12.0.4",
|
|
34365
|
-
"@supacloud/compiler": "^0.
|
|
34407
|
+
"@supacloud/compiler": "^0.62.0",
|
|
34366
34408
|
"@supacloud/db": "0.24.0",
|
|
34367
34409
|
"deepmerge-ts": "8.0.2",
|
|
34368
34410
|
prisma: "6.19.3"
|
|
@@ -39,7 +39,7 @@ export interface AppToolOptions {
|
|
|
39
39
|
onDevProgress?: (result: ToolResult) => void;
|
|
40
40
|
}
|
|
41
41
|
export interface AppToolArguments {
|
|
42
|
-
action: "init" | "generate" | "dev" | "watch" | "verify-plan" | "compile" | "check" | "graph" | "explain" | "export-tools" | "context" | "doctor" | "fix" | "plan" | "build" | "release" | "promote" | keyof typeof REMOTE_APP_ACTIONS;
|
|
42
|
+
action: "init" | "generate" | "dev" | "watch" | "verify-plan" | "compile" | "check" | "graph" | "explain" | "export-tools" | "context" | "lens" | "doctor" | "fix" | "plan" | "build" | "release" | "promote" | keyof typeof REMOTE_APP_ACTIONS;
|
|
43
43
|
ref?: string;
|
|
44
44
|
id?: string;
|
|
45
45
|
environment_id?: string;
|
|
@@ -86,6 +86,7 @@ export interface AppToolArguments {
|
|
|
86
86
|
strict?: boolean;
|
|
87
87
|
format?: "text" | "json";
|
|
88
88
|
target?: string;
|
|
89
|
+
detail?: boolean;
|
|
89
90
|
fix?: string;
|
|
90
91
|
from_doctor?: string;
|
|
91
92
|
fix_index?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.0",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"directory": "packages/cli"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@supacloud/compiler": "^0.
|
|
55
|
+
"@supacloud/compiler": "^0.62.0",
|
|
56
56
|
"@supacloud/delivery": "0.26.0",
|
|
57
57
|
"@supacloud/db": "0.24.0",
|
|
58
58
|
"typebox": "1.4.3"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@supacloud/contracts": "0.16.1",
|
|
62
62
|
"@supacloud/delivery": "0.26.0",
|
|
63
63
|
"@graphql-tools/utils": "^12.0.4",
|
|
64
|
-
"@supacloud/compiler": "^0.
|
|
64
|
+
"@supacloud/compiler": "^0.62.0",
|
|
65
65
|
"@supacloud/db": "0.24.0",
|
|
66
66
|
"deepmerge-ts": "8.0.2",
|
|
67
67
|
"prisma": "6.19.3"
|