@cartesi/cli 0.16.1 → 1.0.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/baseCommand.d.ts +1 -7
- package/dist/baseCommand.d.ts.map +1 -1
- package/dist/baseCommand.js +4 -7
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +1 -7
- package/dist/prompts.d.ts +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +1 -2
- package/oclif.manifest.json +1 -1
- package/package.json +36 -34
package/dist/baseCommand.d.ts
CHANGED
|
@@ -3,12 +3,6 @@ import { Address, Hash } from "viem";
|
|
|
3
3
|
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
|
|
4
4
|
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
|
|
5
5
|
export type AddressBook = Record<string, Address>;
|
|
6
|
-
export interface DApp {
|
|
7
|
-
address: Address;
|
|
8
|
-
blockHash: Address;
|
|
9
|
-
blockNumber: number;
|
|
10
|
-
transactionHash: Address;
|
|
11
|
-
}
|
|
12
6
|
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
13
7
|
protected flags: Flags<T>;
|
|
14
8
|
protected args: Args<T>;
|
|
@@ -19,7 +13,7 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
|
|
|
19
13
|
title: string;
|
|
20
14
|
value: string;
|
|
21
15
|
}): void;
|
|
22
|
-
protected getApplicationAddress(): Promise<Address
|
|
16
|
+
protected getApplicationAddress(): Promise<Address>;
|
|
23
17
|
protected getAddressBook(): Promise<AddressBook>;
|
|
24
18
|
init(): Promise<void>;
|
|
25
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseCommand.d.ts","sourceRoot":"","sources":["../src/baseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa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CAAC,WAAW,CAAC;IAkCzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAYrC"}
|
package/dist/baseCommand.js
CHANGED
|
@@ -3,7 +3,7 @@ import chalk from "chalk";
|
|
|
3
3
|
import { execa } from "execa";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import { isHash } from "viem";
|
|
6
|
+
import { getAddress, isHash } from "viem";
|
|
7
7
|
import { authorityHistoryPairFactoryAddress, cartesiDAppFactoryAddress, dAppAddressRelayAddress, erc1155BatchPortalAddress, erc1155SinglePortalAddress, erc20PortalAddress, erc721PortalAddress, etherPortalAddress, inputBoxAddress, selfHostedApplicationFactoryAddress, testMultiTokenAddress, testNftAddress, testTokenAddress, } from "./contracts.js";
|
|
8
8
|
export class BaseCommand extends Command {
|
|
9
9
|
async getServiceState(projectName, serviceName) {
|
|
@@ -39,12 +39,14 @@ export class BaseCommand extends Command {
|
|
|
39
39
|
}
|
|
40
40
|
async getApplicationAddress() {
|
|
41
41
|
// fixed value, as we do deterministic deployment with a zero hash
|
|
42
|
-
return "0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e";
|
|
42
|
+
return getAddress("0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e");
|
|
43
43
|
}
|
|
44
44
|
async getAddressBook() {
|
|
45
|
+
const applicationAddress = await this.getApplicationAddress();
|
|
45
46
|
// build rollups contracts address book
|
|
46
47
|
const contracts = {
|
|
47
48
|
AuthorityHistoryPairFactory: authorityHistoryPairFactoryAddress,
|
|
49
|
+
CartesiDApp: applicationAddress,
|
|
48
50
|
CartesiDAppFactory: cartesiDAppFactoryAddress,
|
|
49
51
|
DAppAddressRelay: dAppAddressRelayAddress,
|
|
50
52
|
EntryPointV06: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
@@ -68,11 +70,6 @@ export class BaseCommand extends Command {
|
|
|
68
70
|
VerifyingPaymasterV06: "0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",
|
|
69
71
|
VerifyingPaymasterV07: "0xc5c97885C67F7361aBAfD2B95067a5bBdA603608",
|
|
70
72
|
};
|
|
71
|
-
// get dapp address
|
|
72
|
-
const applicationAddress = await this.getApplicationAddress();
|
|
73
|
-
if (applicationAddress) {
|
|
74
|
-
contracts["CartesiDApp"] = applicationAddress;
|
|
75
|
-
}
|
|
76
73
|
return contracts;
|
|
77
74
|
}
|
|
78
75
|
async init() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW,CACrD,OAAO,gBAAgB,CAC1B;IACG,MAAM,CAAC,OAAO,SAAwB;IAEtC,MAAM,CAAC,WAAW,SAC8V;IAEhX,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;MAWV;IAEF;;;OAGG;YACW,UAAU;YAcV,YAAY;YAsEZ,aAAa;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW,CACrD,OAAO,gBAAgB,CAC1B;IACG,MAAM,CAAC,OAAO,SAAwB;IAEtC,MAAM,CAAC,WAAW,SAC8V;IAEhX,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;MAWV;IAEF;;;OAGG;YACW,UAAU;YAcV,YAAY;YAsEZ,aAAa;YAUb,MAAM;IA+BpB,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAoBrC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAwB9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0DpC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -80,13 +80,7 @@ Update your application Dockerfile using one of the templates at https://github.
|
|
|
80
80
|
// saves the OCI Image to a tarball
|
|
81
81
|
async createTarball(image, outputFilePath) {
|
|
82
82
|
// create docker tarball from app image
|
|
83
|
-
|
|
84
|
-
"image",
|
|
85
|
-
"save",
|
|
86
|
-
image,
|
|
87
|
-
"-o",
|
|
88
|
-
outputFilePath,
|
|
89
|
-
]);
|
|
83
|
+
await execa("docker", ["image", "save", image, "-o", outputFilePath]);
|
|
90
84
|
}
|
|
91
85
|
// this wraps the call to the sdk image with a one-shot approach
|
|
92
86
|
// the (inputPath, outputPath) signature will mount the input as a volume and copy the output with docker cp
|
package/dist/prompts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Separator } from "@inquirer/core";
|
|
2
2
|
import input from "@inquirer/input";
|
|
3
3
|
import select from "@inquirer/select";
|
|
4
|
-
import {
|
|
4
|
+
import { Context } from "@inquirer/type";
|
|
5
5
|
import { Address, Hex } from "viem";
|
|
6
6
|
type InputConfig = Parameters<typeof input>[0];
|
|
7
7
|
type SelectConfig<ValueType> = Parameters<typeof select<ValueType>>[0];
|
|
@@ -57,6 +57,6 @@ export type SelectAutoConfig<ValueType> = SelectConfig<ValueType> & {
|
|
|
57
57
|
};
|
|
58
58
|
export declare const selectAuto: <ValueType>(config: SelectAutoConfig<ValueType> & {
|
|
59
59
|
discardDisabled?: boolean;
|
|
60
|
-
}, context?: Context | undefined) =>
|
|
60
|
+
}, context?: Context | undefined) => Promise<ValueType>;
|
|
61
61
|
export {};
|
|
62
62
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts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EF;;;;GAIG;AACH,eAAO,MAAM,UAAU,WACX,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,GAAG,CA8Cb,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,WACf,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,KAAK,MAAM,EAAE,CA+DvB,CAAC;AAGF,MAAM,MAAM,MAAM,CAAC,SAAS,IAAI;IAC5B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,GAAG;IAChE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,SAAS,UACxB,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,YACzD,OAAO,GAAG,SAAS,KAC9B,OAAO,CAAC,SAAS,CAsBnB,CAAC"}
|
package/dist/prompts.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import confirm from "@inquirer/confirm";
|
|
2
2
|
import input from "@inquirer/input";
|
|
3
3
|
import select from "@inquirer/select";
|
|
4
|
-
import { CancelablePromise } from "@inquirer/type";
|
|
5
4
|
import chalk from "chalk";
|
|
6
5
|
import { encodeAbiParameters, formatUnits, getAddress, isAddress, isHex, parseAbiParameters, parseUnits, stringToHex, } from "viem";
|
|
7
6
|
export const addressInput = async (config) => {
|
|
@@ -152,7 +151,7 @@ export const selectAuto = (config, context) => {
|
|
|
152
151
|
const prefix = chalk.green("?");
|
|
153
152
|
const message = chalk.bold(config.message);
|
|
154
153
|
output.write(`${prefix} ${message} ${chalk.cyan(choice.name || choice.value)}\n`);
|
|
155
|
-
return new
|
|
154
|
+
return new Promise((resolve) => resolve(choice.value));
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
return select(config, context);
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cartesi/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Cartesi CLI",
|
|
5
5
|
"author": "Danilo Tuler <tuler@pobox.com>",
|
|
6
6
|
"bin": {
|
|
@@ -18,51 +18,52 @@
|
|
|
18
18
|
"/oclif.manifest.json"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@inquirer/confirm": "^
|
|
22
|
-
"@inquirer/core": "^
|
|
23
|
-
"@inquirer/input": "^
|
|
24
|
-
"@inquirer/select": "^
|
|
25
|
-
"@inquirer/type": "^
|
|
26
|
-
"@oclif/core": "^4.0.
|
|
27
|
-
"@oclif/plugin-help": "^6.2.
|
|
28
|
-
"@oclif/plugin-plugins": "^5.
|
|
29
|
-
"bytes": "^3.1",
|
|
21
|
+
"@inquirer/confirm": "^5.0.0",
|
|
22
|
+
"@inquirer/core": "^10.0.0",
|
|
23
|
+
"@inquirer/input": "^4.0.0",
|
|
24
|
+
"@inquirer/select": "^4.0.0",
|
|
25
|
+
"@inquirer/type": "^3.0.0",
|
|
26
|
+
"@oclif/core": "^4.0.29",
|
|
27
|
+
"@oclif/plugin-help": "^6.2.15",
|
|
28
|
+
"@oclif/plugin-plugins": "^5.4.15",
|
|
29
|
+
"bytes": "^3.1.2",
|
|
30
30
|
"chalk": "^5.3.0",
|
|
31
31
|
"cli-table3": "^0.6.5",
|
|
32
|
-
"execa": "^9.
|
|
33
|
-
"fs-extra": "^11",
|
|
32
|
+
"execa": "^9.4.1",
|
|
33
|
+
"fs-extra": "^11.2.0",
|
|
34
34
|
"giget": "^1.2.3",
|
|
35
35
|
"lookpath": "^1.2.2",
|
|
36
36
|
"open": "^10.1.0",
|
|
37
|
-
"ora": "^8.0
|
|
38
|
-
"progress-stream": "^2.0",
|
|
37
|
+
"ora": "^8.1.0",
|
|
38
|
+
"progress-stream": "^2.0.0",
|
|
39
39
|
"semver": "^7.6.3",
|
|
40
40
|
"tmp": "^0.2.3",
|
|
41
|
-
"viem": "^2.
|
|
41
|
+
"viem": "^2.21.27"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@sunodo/wagmi-plugin-hardhat-deploy": "^0.3.0",
|
|
45
|
-
"@types/bytes": "^3.1",
|
|
46
|
-
"@types/fs-extra": "^11",
|
|
47
|
-
"@types/inquirer": "^9",
|
|
48
|
-
"@types/node": "^
|
|
49
|
-
"@types/node-fetch": "^2.6",
|
|
50
|
-
"@types/progress-stream": "^2.0",
|
|
51
|
-
"@types/prompts": "^2.4",
|
|
45
|
+
"@types/bytes": "^3.1.4",
|
|
46
|
+
"@types/fs-extra": "^11.0.4",
|
|
47
|
+
"@types/inquirer": "^9.0.7",
|
|
48
|
+
"@types/node": "^22.7.6",
|
|
49
|
+
"@types/node-fetch": "^2.6.11",
|
|
50
|
+
"@types/progress-stream": "^2.0.5",
|
|
51
|
+
"@types/prompts": "^2.4.9",
|
|
52
52
|
"@types/semver": "^7.5.8",
|
|
53
|
-
"@types/tmp": "^0.2",
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
53
|
+
"@types/tmp": "^0.2.6",
|
|
54
|
+
"@vitest/coverage-istanbul": "^2.1.3",
|
|
55
|
+
"@wagmi/cli": "^2.1.16",
|
|
56
|
+
"copyfiles": "^2.4.1",
|
|
56
57
|
"eslint": "^8.57.0",
|
|
57
|
-
"eslint-config-oclif": "^5.2.
|
|
58
|
-
"eslint-config-oclif-typescript": "^3.1.
|
|
59
|
-
"npm-run-all": "^4",
|
|
60
|
-
"oclif": "^4.
|
|
58
|
+
"eslint-config-oclif": "^5.2.1",
|
|
59
|
+
"eslint-config-oclif-typescript": "^3.1.12",
|
|
60
|
+
"npm-run-all": "^4.1.5",
|
|
61
|
+
"oclif": "^4.15.9",
|
|
61
62
|
"rimraf": "^6.0.1",
|
|
62
|
-
"ts-node": "^10",
|
|
63
|
-
"tslib": "^2.
|
|
64
|
-
"typescript": "^5.
|
|
65
|
-
"vitest": "^2.
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
64
|
+
"tslib": "^2.8.0",
|
|
65
|
+
"typescript": "^5.6.3",
|
|
66
|
+
"vitest": "^2.1.3",
|
|
66
67
|
"@cartesi/devnet": "1.8.0",
|
|
67
68
|
"@cartesi/eslint-config": "0.0.0",
|
|
68
69
|
"tsconfig": "0.0.0"
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
|
|
97
98
|
"lint": "eslint \"src/**/*.ts*\"",
|
|
98
99
|
"posttest": "pnpm lint",
|
|
99
|
-
"test": "vitest"
|
|
100
|
+
"test": "vitest",
|
|
101
|
+
"test:coverage": "vitest --coverage.enabled true"
|
|
100
102
|
}
|
|
101
103
|
}
|