@secondlayer/cli 8.6.0 → 8.6.2
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 +39 -8
- package/dist/cli.js.map +4 -4
- package/package.json +5 -5
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.2",
|
|
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.
|
|
32408
|
-
"@secondlayer/stacks": "^2.
|
|
32409
|
-
"@secondlayer/subgraphs": "^3.
|
|
32406
|
+
"@secondlayer/sdk": "^6.18.0",
|
|
32407
|
+
"@secondlayer/shared": "^6.28.0",
|
|
32408
|
+
"@secondlayer/stacks": "^2.4.0",
|
|
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,8 @@ 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";
|
|
34634
|
+
import { TRAIT_STANDARDS } from "@secondlayer/stacks/clarity";
|
|
34633
34635
|
|
|
34634
34636
|
// src/generators/subgraph-scaffold.ts
|
|
34635
34637
|
init_format();
|
|
@@ -35669,6 +35671,27 @@ ${dim("Columns")}`);
|
|
|
35669
35671
|
const deployTarget = context.bundled ? "tenant API" : "local database";
|
|
35670
35672
|
info(`Dry run only. No ${deployTarget} changes were made.`);
|
|
35671
35673
|
}
|
|
35674
|
+
function printByoBreakingPlan(details) {
|
|
35675
|
+
error("Refusing breaking schema change on BYO subgraph (no data dropped).");
|
|
35676
|
+
console.log(`
|
|
35677
|
+
Breaking changes:`);
|
|
35678
|
+
for (const r of details.reasons)
|
|
35679
|
+
console.log(` ${red("✗")} ${r}`);
|
|
35680
|
+
console.log(`
|
|
35681
|
+
To rebuild manually, run on YOUR database:`);
|
|
35682
|
+
console.log(` ${details.plan.dropStatement}`);
|
|
35683
|
+
console.log(` ${details.plan.statements.join(`;
|
|
35684
|
+
`)}`);
|
|
35685
|
+
console.log(`
|
|
35686
|
+
Grant (first deploy only):`);
|
|
35687
|
+
for (const line of details.plan.grantScript.split(`
|
|
35688
|
+
`)) {
|
|
35689
|
+
console.log(` ${dim(line)}`);
|
|
35690
|
+
}
|
|
35691
|
+
console.log(`
|
|
35692
|
+
${yellow("This DROPS all rows in that schema, then rebuilds it. Re-deploy after.")}`);
|
|
35693
|
+
console.log(dim("(--force destructive rebuild not yet supported — manual DROP required.)"));
|
|
35694
|
+
}
|
|
35672
35695
|
function formatSubgraphSync(sync) {
|
|
35673
35696
|
const targetBlock = sync.targetBlock ?? sync.chainTip;
|
|
35674
35697
|
const totalBlocks = sync.totalBlocks;
|
|
@@ -35930,6 +35953,14 @@ Stopped watching.`);
|
|
|
35930
35953
|
await closeDb();
|
|
35931
35954
|
}
|
|
35932
35955
|
} catch (err) {
|
|
35956
|
+
if (err instanceof ByoBreakingChangeError) {
|
|
35957
|
+
printByoBreakingPlan(err.details);
|
|
35958
|
+
process.exit(1);
|
|
35959
|
+
}
|
|
35960
|
+
if (err && typeof err === "object" && err.code === "BYO_BREAKING_CHANGE" && err.details) {
|
|
35961
|
+
printByoBreakingPlan(err.details);
|
|
35962
|
+
process.exit(1);
|
|
35963
|
+
}
|
|
35933
35964
|
error(`Failed to deploy subgraph: ${err}`);
|
|
35934
35965
|
process.exit(1);
|
|
35935
35966
|
}
|
|
@@ -36318,8 +36349,8 @@ Examples:
|
|
|
36318
36349
|
process.exit(1);
|
|
36319
36350
|
}
|
|
36320
36351
|
const trait = options2.trait;
|
|
36321
|
-
if (trait && !
|
|
36322
|
-
error(
|
|
36352
|
+
if (trait && !TRAIT_STANDARDS.includes(trait)) {
|
|
36353
|
+
error(`--trait must be one of: ${TRAIT_STANDARDS.join(", ")}`);
|
|
36323
36354
|
process.exit(1);
|
|
36324
36355
|
}
|
|
36325
36356
|
if (!trait && !contractAddress) {
|
|
@@ -38428,5 +38459,5 @@ registerAccountCommand(program);
|
|
|
38428
38459
|
registerKeysCommand(program);
|
|
38429
38460
|
program.parse();
|
|
38430
38461
|
|
|
38431
|
-
//# debugId=
|
|
38462
|
+
//# debugId=A3ACB9F171C1F73C64756E2164756E21
|
|
38432
38463
|
//# sourceMappingURL=cli.js.map
|