@settlemint/sdk-cli 0.8.0-pr589f154c → 0.8.0-pr5faaeb8d
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 -86
- package/dist/cli.js.map +3 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
|
|
|
197427
197427
|
code: "ENOENT"
|
|
197428
197428
|
}), getPathInfo = (e9, t7) => {
|
|
197429
197429
|
var r6 = t7.colon || or;
|
|
197430
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
197430
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.JqfntYNiQR:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.8.0-
|
|
200567
|
+
binaryVersion: "0.8.0-pr5faaeb8d",
|
|
200568
200568
|
binaryLabel: "gql.tada CLI",
|
|
200569
200569
|
binaryName: "gql.tada"
|
|
200570
200570
|
});
|
|
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
218401
218401
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
218402
218402
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
218403
218403
|
var getPathInfo2 = (cmd2, {
|
|
218404
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218404
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.JqfntYNiQR:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218405
218405
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
218406
218406
|
delimiter: optDelimiter = delimiter
|
|
218407
218407
|
}) => {
|
|
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
218605
218605
|
let pathToInitial;
|
|
218606
218606
|
try {
|
|
218607
218607
|
pathToInitial = which.sync(initialCmd, {
|
|
218608
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218608
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.JqfntYNiQR:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218609
218609
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
218610
218610
|
}).toLowerCase();
|
|
218611
218611
|
} catch (err) {
|
|
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
219322
219322
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
219323
219323
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
219324
219324
|
var getPathInfo2 = (cmd2, {
|
|
219325
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
219325
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.JqfntYNiQR:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
219326
219326
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
219327
219327
|
delimiter: optDelimiter = delimiter
|
|
219328
219328
|
}) => {
|
|
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235213
235213
|
const colon = opt2.colon || COLON;
|
|
235214
235214
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235215
235215
|
...isWindows2 ? [process.cwd()] : [],
|
|
235216
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
235216
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.JqfntYNiQR:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -273273,7 +273273,7 @@ function connectCommand() {
|
|
|
273273
273273
|
var package_default = {
|
|
273274
273274
|
name: "@settlemint/sdk-cli",
|
|
273275
273275
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273276
|
-
version: "0.8.0-
|
|
273276
|
+
version: "0.8.0-pr5faaeb8d",
|
|
273277
273277
|
type: "module",
|
|
273278
273278
|
private: false,
|
|
273279
273279
|
license: "FSL-1.1-MIT",
|
|
@@ -273324,8 +273324,8 @@ var package_default = {
|
|
|
273324
273324
|
"@inquirer/input": "4.1.1",
|
|
273325
273325
|
"@inquirer/password": "4.0.4",
|
|
273326
273326
|
"@inquirer/select": "4.0.4",
|
|
273327
|
-
"@settlemint/sdk-js": "0.8.0-
|
|
273328
|
-
"@settlemint/sdk-utils": "0.8.0-
|
|
273327
|
+
"@settlemint/sdk-js": "0.8.0-pr5faaeb8d",
|
|
273328
|
+
"@settlemint/sdk-utils": "0.8.0-pr5faaeb8d",
|
|
273329
273329
|
"get-tsconfig": "4.8.1",
|
|
273330
273330
|
giget: "1.2.3"
|
|
273331
273331
|
},
|
|
@@ -275773,96 +275773,49 @@ function platformCommand() {
|
|
|
275773
275773
|
}
|
|
275774
275774
|
|
|
275775
275775
|
// src/commands/smart-contract-set/chaincode/package.ts
|
|
275776
|
-
import { unlink as unlink2 } from "node:fs/promises";
|
|
275777
|
-
import path8 from "node:path";
|
|
275776
|
+
import { copyFile, mkdir as mkdir7, unlink as unlink2 } from "node:fs/promises";
|
|
275777
|
+
import path8, { dirname as dirname7 } from "node:path";
|
|
275778
275778
|
function packageChaincodeCommand() {
|
|
275779
|
-
console.log(`
|
|
275780
|
-
\uD83D\uDE80 Initializing package command...`);
|
|
275781
275779
|
const cmd2 = new Command2("package").description("Package a chaincode").requiredOption("--name <name>", "Name of the output file").requiredOption("--version <version>", "Version of the chaincode").requiredOption("--path <path>", "Path to the chaincode").requiredOption("--lang <language>", "Language the chaincode is written in");
|
|
275782
|
-
cmd2.action(async (options)
|
|
275783
|
-
console.log(`
|
|
275784
|
-
\uD83D\uDCCB Command Action Started`);
|
|
275785
|
-
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
275786
|
-
console.log("Options received:", JSON.stringify(options, null, 2));
|
|
275787
|
-
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
275788
|
-
console.log(`
|
|
275789
|
-
\uD83D\uDCE2 About to show note...`);
|
|
275780
|
+
cmd2.action(async function packageAction(options) {
|
|
275790
275781
|
note(`Packaging chaincode ${options.version}...`);
|
|
275791
275782
|
try {
|
|
275792
|
-
|
|
275793
|
-
|
|
275794
|
-
|
|
275795
|
-
|
|
275796
|
-
\uD83D\uDCE6 Checking for root package.json at: ${rootPackageJsonPath}`);
|
|
275797
|
-
const ccPackageJsonPath = path8.join(options.path, "package.json");
|
|
275798
|
-
console.log(`\uD83D\uDCE6 Target chaincode package.json path: ${ccPackageJsonPath}`);
|
|
275799
|
-
const rootPackageJson = Bun.file(rootPackageJsonPath);
|
|
275800
|
-
const hasRootPackageJson = await rootPackageJson.exists();
|
|
275801
|
-
console.log(`\uD83D\uDCCB Root package.json exists: ${hasRootPackageJson}`);
|
|
275802
|
-
if (hasRootPackageJson) {
|
|
275803
|
-
console.log("\uD83D\uDCDD Copying package.json to chaincode directory...");
|
|
275804
|
-
}
|
|
275805
|
-
console.log(`
|
|
275806
|
-
\uD83D\uDD27 Executing peer command...`);
|
|
275807
|
-
console.log("Command:", "peer", [
|
|
275783
|
+
const { name: name2, version, path: ccPath, lang } = options;
|
|
275784
|
+
const ccPackageJsonPath = path8.join(ccPath, "package.json");
|
|
275785
|
+
await ensureCcPackageJsonExists(ccPath);
|
|
275786
|
+
await executeCommand("peer", [
|
|
275808
275787
|
"lifecycle",
|
|
275809
275788
|
"chaincode",
|
|
275810
275789
|
"package",
|
|
275811
|
-
`./${
|
|
275790
|
+
`./${name2}.tar.gz`,
|
|
275812
275791
|
"--path",
|
|
275813
|
-
|
|
275792
|
+
ccPath,
|
|
275814
275793
|
"--lang",
|
|
275815
|
-
|
|
275794
|
+
lang,
|
|
275816
275795
|
"--label",
|
|
275817
|
-
`${
|
|
275818
|
-
]
|
|
275819
|
-
await
|
|
275820
|
-
|
|
275821
|
-
|
|
275796
|
+
`${name2}_${version}`
|
|
275797
|
+
]);
|
|
275798
|
+
if (await exists2(ccPackageJsonPath)) {
|
|
275799
|
+
await unlink2(ccPackageJsonPath);
|
|
275800
|
+
}
|
|
275822
275801
|
outro("Chaincode is packaged successfully");
|
|
275823
275802
|
} catch (error5) {
|
|
275824
|
-
console.log(`
|
|
275825
|
-
❌ Error occurred during packaging`);
|
|
275826
|
-
console.error("Error details:", error5);
|
|
275827
275803
|
cancel2(`Chaincode packaging failed: ${error5 instanceof Error ? error5.message : String(error5)}`);
|
|
275828
275804
|
}
|
|
275829
275805
|
});
|
|
275830
|
-
console.log("\uD83D\uDCE6 Package command initialized and ready");
|
|
275831
275806
|
return cmd2;
|
|
275832
275807
|
}
|
|
275833
|
-
async function
|
|
275834
|
-
|
|
275835
|
-
⚙️ packageChaincode function started`);
|
|
275836
|
-
const { name: name2, version, path: ccPath, lang } = options;
|
|
275837
|
-
const rootPackageJson = Bun.file(path8.join(process.cwd(), "package.json"));
|
|
275808
|
+
async function ensureCcPackageJsonExists(ccPath) {
|
|
275809
|
+
const rootPackageJsonPath = path8.join(process.cwd(), "package.json");
|
|
275838
275810
|
const ccPackageJsonPath = path8.join(ccPath, "package.json");
|
|
275839
|
-
|
|
275840
|
-
|
|
275811
|
+
if (await exists2(ccPackageJsonPath)) {
|
|
275812
|
+
return;
|
|
275813
|
+
}
|
|
275814
|
+
const hasRootPackageJson = await exists2(rootPackageJsonPath);
|
|
275841
275815
|
if (hasRootPackageJson) {
|
|
275842
|
-
|
|
275843
|
-
await
|
|
275844
|
-
}
|
|
275845
|
-
console.log(`
|
|
275846
|
-
\uD83D\uDE80 Executing peer lifecycle chaincode package command`);
|
|
275847
|
-
await executeCommand("peer", [
|
|
275848
|
-
"lifecycle",
|
|
275849
|
-
"chaincode",
|
|
275850
|
-
"package",
|
|
275851
|
-
`./${name2}.tar.gz`,
|
|
275852
|
-
"--path",
|
|
275853
|
-
ccPath,
|
|
275854
|
-
"--lang",
|
|
275855
|
-
lang,
|
|
275856
|
-
"--label",
|
|
275857
|
-
`${name2}_${version}`
|
|
275858
|
-
]);
|
|
275859
|
-
if (await ccPackageJson.exists()) {
|
|
275860
|
-
console.log(`
|
|
275861
|
-
\uD83E\uDDF9 Cleaning up temporary package.json`);
|
|
275862
|
-
await unlink2(ccPackageJsonPath);
|
|
275816
|
+
await mkdir7(dirname7(ccPackageJsonPath), { recursive: true });
|
|
275817
|
+
await copyFile(rootPackageJsonPath, ccPackageJsonPath);
|
|
275863
275818
|
}
|
|
275864
|
-
console.log(`
|
|
275865
|
-
✨ packageChaincode function completed`);
|
|
275866
275819
|
}
|
|
275867
275820
|
|
|
275868
275821
|
// src/commands/smart-contract-set/create.ts
|
|
@@ -276401,7 +276354,7 @@ function hardhatTestCommand() {
|
|
|
276401
276354
|
}
|
|
276402
276355
|
|
|
276403
276356
|
// src/commands/smart-contract-set/subgraph/build.ts
|
|
276404
|
-
import { dirname as
|
|
276357
|
+
import { dirname as dirname8 } from "node:path";
|
|
276405
276358
|
|
|
276406
276359
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
276407
276360
|
import { rm as rm4 } from "node:fs/promises";
|
|
@@ -276619,14 +276572,14 @@ function subgraphBuildCommand() {
|
|
|
276619
276572
|
});
|
|
276620
276573
|
const { command, args } = await getPackageManagerExecutable();
|
|
276621
276574
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276622
|
-
const cwd2 =
|
|
276575
|
+
const cwd2 = dirname8(subgraphYamlFile);
|
|
276623
276576
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
|
|
276624
276577
|
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
|
|
276625
276578
|
});
|
|
276626
276579
|
}
|
|
276627
276580
|
|
|
276628
276581
|
// src/commands/smart-contract-set/subgraph/codegen.ts
|
|
276629
|
-
import { dirname as
|
|
276582
|
+
import { dirname as dirname9 } from "node:path";
|
|
276630
276583
|
function subgraphCodegenCommand() {
|
|
276631
276584
|
return new Command2("codegen").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").description("Codegen the subgraph types").action(async ({ acceptDefaults, prod }) => {
|
|
276632
276585
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
@@ -276647,13 +276600,13 @@ function subgraphCodegenCommand() {
|
|
|
276647
276600
|
const { command, args } = await getPackageManagerExecutable();
|
|
276648
276601
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276649
276602
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276650
|
-
cwd:
|
|
276603
|
+
cwd: dirname9(subgraphYamlFile)
|
|
276651
276604
|
});
|
|
276652
276605
|
});
|
|
276653
276606
|
}
|
|
276654
276607
|
|
|
276655
276608
|
// src/commands/smart-contract-set/subgraph/deploy.ts
|
|
276656
|
-
import { dirname as
|
|
276609
|
+
import { dirname as dirname10 } from "node:path";
|
|
276657
276610
|
|
|
276658
276611
|
// src/commands/smart-contract-set/prompts/subgraph-name.prompt.ts
|
|
276659
276612
|
async function subgraphNamePrompt2(defaultName, env2, accept, prod) {
|
|
@@ -276704,7 +276657,7 @@ function subgraphDeployCommand() {
|
|
|
276704
276657
|
await updateSpecVersion(theGraphMiddleware.specVersion);
|
|
276705
276658
|
const { command, args } = await getPackageManagerExecutable();
|
|
276706
276659
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276707
|
-
cwd:
|
|
276660
|
+
cwd: dirname10(subgraphYamlFile)
|
|
276708
276661
|
});
|
|
276709
276662
|
const generated = await isGenerated();
|
|
276710
276663
|
if (generated) {
|
|
@@ -276787,4 +276740,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276787
276740
|
cancel2(reason);
|
|
276788
276741
|
});
|
|
276789
276742
|
|
|
276790
|
-
//# debugId=
|
|
276743
|
+
//# debugId=CD4B92D2C6F27FB864756E2164756E21
|