@secondlayer/cli 8.6.0 → 8.6.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/dist/cli.js +35 -5
- package/dist/cli.js.map +3 -3
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -32354,7 +32354,7 @@ var {
|
|
|
32354
32354
|
// package.json
|
|
32355
32355
|
var package_default = {
|
|
32356
32356
|
name: "@secondlayer/cli",
|
|
32357
|
-
version: "8.6.
|
|
32357
|
+
version: "8.6.1",
|
|
32358
32358
|
repository: {
|
|
32359
32359
|
type: "git",
|
|
32360
32360
|
url: "git+https://github.com/ryanwaits/secondlayer.git",
|
|
@@ -32403,10 +32403,10 @@ var package_default = {
|
|
|
32403
32403
|
dependencies: {
|
|
32404
32404
|
"@inquirer/prompts": "^8.2.0",
|
|
32405
32405
|
"@secondlayer/bundler": "^0.3.7",
|
|
32406
|
-
"@secondlayer/sdk": "^6.
|
|
32407
|
-
"@secondlayer/shared": "^6.
|
|
32406
|
+
"@secondlayer/sdk": "^6.16.0",
|
|
32407
|
+
"@secondlayer/shared": "^6.27.0",
|
|
32408
32408
|
"@secondlayer/stacks": "^2.3.0",
|
|
32409
|
-
"@secondlayer/subgraphs": "^3.
|
|
32409
|
+
"@secondlayer/subgraphs": "^3.10.0",
|
|
32410
32410
|
"@biomejs/js-api": "^0.7.0",
|
|
32411
32411
|
"@biomejs/wasm-nodejs": "^1.9.0",
|
|
32412
32412
|
esbuild: "^0.19.0",
|
|
@@ -34630,6 +34630,7 @@ import {
|
|
|
34630
34630
|
import { dirname as dirname5, join as join7, resolve as resolve2 } from "node:path";
|
|
34631
34631
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
34632
34632
|
import { confirm as confirm3 } from "@inquirer/prompts";
|
|
34633
|
+
import { ByoBreakingChangeError } from "@secondlayer/sdk";
|
|
34633
34634
|
|
|
34634
34635
|
// src/generators/subgraph-scaffold.ts
|
|
34635
34636
|
init_format();
|
|
@@ -35669,6 +35670,27 @@ ${dim("Columns")}`);
|
|
|
35669
35670
|
const deployTarget = context.bundled ? "tenant API" : "local database";
|
|
35670
35671
|
info(`Dry run only. No ${deployTarget} changes were made.`);
|
|
35671
35672
|
}
|
|
35673
|
+
function printByoBreakingPlan(details) {
|
|
35674
|
+
error("Refusing breaking schema change on BYO subgraph (no data dropped).");
|
|
35675
|
+
console.log(`
|
|
35676
|
+
Breaking changes:`);
|
|
35677
|
+
for (const r of details.reasons)
|
|
35678
|
+
console.log(` ${red("✗")} ${r}`);
|
|
35679
|
+
console.log(`
|
|
35680
|
+
To rebuild manually, run on YOUR database:`);
|
|
35681
|
+
console.log(` ${details.plan.dropStatement}`);
|
|
35682
|
+
console.log(` ${details.plan.statements.join(`;
|
|
35683
|
+
`)}`);
|
|
35684
|
+
console.log(`
|
|
35685
|
+
Grant (first deploy only):`);
|
|
35686
|
+
for (const line of details.plan.grantScript.split(`
|
|
35687
|
+
`)) {
|
|
35688
|
+
console.log(` ${dim(line)}`);
|
|
35689
|
+
}
|
|
35690
|
+
console.log(`
|
|
35691
|
+
${yellow("This DROPS all rows in that schema, then rebuilds it. Re-deploy after.")}`);
|
|
35692
|
+
console.log(dim("(--force destructive rebuild not yet supported — manual DROP required.)"));
|
|
35693
|
+
}
|
|
35672
35694
|
function formatSubgraphSync(sync) {
|
|
35673
35695
|
const targetBlock = sync.targetBlock ?? sync.chainTip;
|
|
35674
35696
|
const totalBlocks = sync.totalBlocks;
|
|
@@ -35930,6 +35952,14 @@ Stopped watching.`);
|
|
|
35930
35952
|
await closeDb();
|
|
35931
35953
|
}
|
|
35932
35954
|
} catch (err) {
|
|
35955
|
+
if (err instanceof ByoBreakingChangeError) {
|
|
35956
|
+
printByoBreakingPlan(err.details);
|
|
35957
|
+
process.exit(1);
|
|
35958
|
+
}
|
|
35959
|
+
if (err && typeof err === "object" && err.code === "BYO_BREAKING_CHANGE" && err.details) {
|
|
35960
|
+
printByoBreakingPlan(err.details);
|
|
35961
|
+
process.exit(1);
|
|
35962
|
+
}
|
|
35933
35963
|
error(`Failed to deploy subgraph: ${err}`);
|
|
35934
35964
|
process.exit(1);
|
|
35935
35965
|
}
|
|
@@ -38428,5 +38458,5 @@ registerAccountCommand(program);
|
|
|
38428
38458
|
registerKeysCommand(program);
|
|
38429
38459
|
program.parse();
|
|
38430
38460
|
|
|
38431
|
-
//# debugId=
|
|
38461
|
+
//# debugId=2E1CD81E99BBC74264756E2164756E21
|
|
38432
38462
|
//# sourceMappingURL=cli.js.map
|