@latticexyz/cli 2.2.18-9fa07c8489f1fbf167d0db01cd9aaa645a29c8e2 → 2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e
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/chunk-PZL6GJOK.js +4 -0
- package/dist/{chunk-7SEEAWAF.js.map → chunk-PZL6GJOK.js.map} +1 -1
- package/dist/commands-FLWVUEDO.js +48 -0
- package/dist/commands-FLWVUEDO.js.map +1 -0
- package/dist/errors-R4UWN5VJ.js +2 -0
- package/dist/mud.js +1 -26
- package/dist/mud.js.map +1 -1
- package/package.json +18 -26
- package/dist/chunk-7SEEAWAF.js +0 -25
- package/dist/commands-HW6E5GIK.js +0 -3025
- package/dist/commands-HW6E5GIK.js.map +0 -1
- package/dist/errors-ZD2NCPFD.js +0 -7
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/mud.cjs +0 -3566
- package/dist/mud.cjs.map +0 -1
- package/dist/mud.d.cts +0 -1
- /package/dist/{errors-ZD2NCPFD.js.map → errors-R4UWN5VJ.js.map} +0 -0
package/dist/mud.js
CHANGED
@@ -1,28 +1,3 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
|
3
|
-
// src/mud.ts
|
4
|
-
import * as dotenv from "dotenv";
|
5
|
-
dotenv.config();
|
6
|
-
async function run() {
|
7
|
-
const { default: yargs } = await import("yargs");
|
8
|
-
const { default: chalk } = await import("chalk");
|
9
|
-
const { hideBin } = await import("yargs/helpers");
|
10
|
-
const { logError } = await import("./errors-ZD2NCPFD.js");
|
11
|
-
const { commands } = await import("./commands-HW6E5GIK.js");
|
12
|
-
yargs(hideBin(process.argv)).scriptName("mud").command(commands).strict().fail((msg, err) => {
|
13
|
-
console.error(chalk.red(msg));
|
14
|
-
if (msg.includes("Missing required argument")) {
|
15
|
-
console.log(
|
16
|
-
chalk.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`)
|
17
|
-
);
|
18
|
-
}
|
19
|
-
console.log("");
|
20
|
-
if (err != null) {
|
21
|
-
logError(err);
|
22
|
-
console.log("");
|
23
|
-
}
|
24
|
-
process.exit(1);
|
25
|
-
}).alias({ h: "help" }).argv;
|
26
|
-
}
|
27
|
-
run();
|
2
|
+
import*as i from"dotenv";i.config();async function l(){let{default:r}=await import("yargs"),{default:o}=await import("chalk"),{hideBin:e}=await import("yargs/helpers"),{logError:s}=await import("./errors-R4UWN5VJ.js"),{commands:t}=await import("./commands-FLWVUEDO.js");r(e(process.argv)).scriptName("mud").command(t).strict().fail((a,n)=>{console.error(o.red(a)),a.includes("Missing required argument")&&console.log(o.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`)),console.log(""),n!=null&&(s(n),console.log("")),process.exit(1)}).alias({h:"help"}).argv}l();
|
28
3
|
//# sourceMappingURL=mud.js.map
|
package/dist/mud.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/mud.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Load .env file into process.env\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nasync function run() {\n // Import everything else async so they can pick up env vars in .env\n const { default: yargs } = await import(\"yargs\");\n const { default: chalk } = await import(\"chalk\");\n const { hideBin } = await import(\"yargs/helpers\");\n const { logError } = await import(\"./utils/errors\");\n const { commands } = await import(\"./commands\");\n\n yargs(hideBin(process.argv))\n // Explicit name to display in help (by default it's the entry file, which may not be \"mud\" for e.g. ts-node)\n .scriptName(\"mud\")\n // Use the commands directory to scaffold\n // command array overload isn't typed, see https://github.com/yargs/yargs/blob/main/docs/advanced.md#esm-hierarchy\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .command(commands as any)\n // Enable strict mode.\n .strict()\n // Custom error handler\n .fail((msg, err) => {\n console.error(chalk.red(msg));\n if (msg.includes(\"Missing required argument\")) {\n console.log(\n chalk.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`),\n );\n }\n console.log(\"\");\n // Even though `.fail` type says we should get an `Error`, this can sometimes be undefined\n if (err != null) {\n logError(err);\n console.log(\"\");\n }\n\n process.exit(1);\n })\n // Useful aliases.\n .alias({ h: \"help\" }).argv;\n}\n\nrun();\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../src/mud.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Load .env file into process.env\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nasync function run() {\n // Import everything else async so they can pick up env vars in .env\n const { default: yargs } = await import(\"yargs\");\n const { default: chalk } = await import(\"chalk\");\n const { hideBin } = await import(\"yargs/helpers\");\n const { logError } = await import(\"./utils/errors\");\n const { commands } = await import(\"./commands\");\n\n yargs(hideBin(process.argv))\n // Explicit name to display in help (by default it's the entry file, which may not be \"mud\" for e.g. ts-node)\n .scriptName(\"mud\")\n // Use the commands directory to scaffold\n // command array overload isn't typed, see https://github.com/yargs/yargs/blob/main/docs/advanced.md#esm-hierarchy\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .command(commands as any)\n // Enable strict mode.\n .strict()\n // Custom error handler\n .fail((msg, err) => {\n console.error(chalk.red(msg));\n if (msg.includes(\"Missing required argument\")) {\n console.log(\n chalk.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`),\n );\n }\n console.log(\"\");\n // Even though `.fail` type says we should get an `Error`, this can sometimes be undefined\n if (err != null) {\n logError(err);\n console.log(\"\");\n }\n\n process.exit(1);\n })\n // Useful aliases.\n .alias({ h: \"help\" }).argv;\n}\n\nrun();\n"],"mappings":";AAGA,UAAYA,MAAY,SACjB,SAAO,EAEd,eAAeC,GAAM,CAEnB,GAAM,CAAE,QAASC,CAAM,EAAI,KAAM,QAAO,OAAO,EACzC,CAAE,QAASC,CAAM,EAAI,KAAM,QAAO,OAAO,EACzC,CAAE,QAAAC,CAAQ,EAAI,KAAM,QAAO,eAAe,EAC1C,CAAE,SAAAC,CAAS,EAAI,KAAM,QAAO,sBAAgB,EAC5C,CAAE,SAAAC,CAAS,EAAI,KAAM,QAAO,wBAAY,EAE9CJ,EAAME,EAAQ,QAAQ,IAAI,CAAC,EAExB,WAAW,KAAK,EAIhB,QAAQE,CAAe,EAEvB,OAAO,EAEP,KAAK,CAACC,EAAKC,IAAQ,CAClB,QAAQ,MAAML,EAAM,IAAII,CAAG,CAAC,EACxBA,EAAI,SAAS,2BAA2B,GAC1C,QAAQ,IACNJ,EAAM,OAAO,iBAAiB,QAAQ,KAAK,CAAC,CAAC,0DAA0D,CACzG,EAEF,QAAQ,IAAI,EAAE,EAEVK,GAAO,OACTH,EAASG,CAAG,EACZ,QAAQ,IAAI,EAAE,GAGhB,QAAQ,KAAK,CAAC,CAChB,CAAC,EAEA,MAAM,CAAE,EAAG,MAAO,CAAC,EAAE,IAC1B,CAEAP,EAAI","names":["dotenv","run","yargs","chalk","hideBin","logError","commands","msg","err"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@latticexyz/cli",
|
3
|
-
"version": "2.2.18-
|
3
|
+
"version": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
4
4
|
"description": "Command line interface for mud",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -10,16 +10,7 @@
|
|
10
10
|
"license": "MIT",
|
11
11
|
"type": "module",
|
12
12
|
"exports": {
|
13
|
-
".":
|
14
|
-
"import": {
|
15
|
-
"import": "./dist/index.js",
|
16
|
-
"types": "./dist/index.d.ts"
|
17
|
-
},
|
18
|
-
"require": {
|
19
|
-
"require": "./dist/index.cjs",
|
20
|
-
"types": "./dist/index.d.cts"
|
21
|
-
}
|
22
|
-
}
|
13
|
+
".": "./dist/index.js"
|
23
14
|
},
|
24
15
|
"typesVersions": {
|
25
16
|
"*": {
|
@@ -58,19 +49,19 @@
|
|
58
49
|
"yargs": "^17.7.1",
|
59
50
|
"zod": "3.23.8",
|
60
51
|
"zod-validation-error": "^1.3.0",
|
61
|
-
"@latticexyz/abi-ts": "2.2.18-
|
62
|
-
"@latticexyz/block-logs-stream": "2.2.18-
|
63
|
-
"@latticexyz/common": "2.2.18-
|
64
|
-
"@latticexyz/config": "2.2.18-
|
65
|
-
"@latticexyz/gas-report": "2.2.18-
|
66
|
-
"@latticexyz/protocol-parser": "2.2.18-
|
67
|
-
"@latticexyz/schema-type": "2.2.18-
|
68
|
-
"@latticexyz/store": "2.2.18-
|
69
|
-
"@latticexyz/store-sync": "2.2.18-
|
70
|
-
"@latticexyz/utils": "2.2.18-
|
71
|
-
"@latticexyz/world": "2.2.18-
|
72
|
-
"@latticexyz/world-module-callwithsignature": "2.2.18-
|
73
|
-
"@latticexyz/world-module-metadata": "2.2.18-
|
52
|
+
"@latticexyz/abi-ts": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
53
|
+
"@latticexyz/block-logs-stream": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
54
|
+
"@latticexyz/common": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
55
|
+
"@latticexyz/config": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
56
|
+
"@latticexyz/gas-report": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
57
|
+
"@latticexyz/protocol-parser": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
58
|
+
"@latticexyz/schema-type": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
59
|
+
"@latticexyz/store": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
60
|
+
"@latticexyz/store-sync": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
61
|
+
"@latticexyz/utils": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
62
|
+
"@latticexyz/world": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
63
|
+
"@latticexyz/world-module-callwithsignature": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e",
|
64
|
+
"@latticexyz/world-module-metadata": "2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e"
|
74
65
|
},
|
75
66
|
"devDependencies": {
|
76
67
|
"@types/debug": "^4.1.7",
|
@@ -80,11 +71,12 @@
|
|
80
71
|
"@types/toposort": "^2.0.6",
|
81
72
|
"@types/yargs": "^17.0.10",
|
82
73
|
"ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
|
83
|
-
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1"
|
74
|
+
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",
|
75
|
+
"vitest": "0.34.6"
|
84
76
|
},
|
85
77
|
"scripts": {
|
86
78
|
"build": "pnpm run build:js && pnpm run build:test-tables",
|
87
|
-
"build:js": "tsup",
|
79
|
+
"build:js": "tsup && chmod +x ./dist/mud.js",
|
88
80
|
"build:test-tables": "tsx ./scripts/generate-test-tables.ts",
|
89
81
|
"clean": "pnpm run clean:js && pnpm run clean:test-tables",
|
90
82
|
"clean:js": "shx rm -rf dist",
|
package/dist/chunk-7SEEAWAF.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
// src/utils/errors.ts
|
2
|
-
import chalk from "chalk";
|
3
|
-
import { ZodError } from "zod";
|
4
|
-
import { fromZodError, ValidationError } from "zod-validation-error";
|
5
|
-
import { MUDError } from "@latticexyz/common/errors";
|
6
|
-
function logError(error) {
|
7
|
-
if (error instanceof ValidationError) {
|
8
|
-
console.log(chalk.redBright(error.message));
|
9
|
-
} else if (error instanceof ZodError) {
|
10
|
-
const validationError = fromZodError(error, {
|
11
|
-
prefixSeparator: "\n- ",
|
12
|
-
issueSeparator: "\n- "
|
13
|
-
});
|
14
|
-
console.log(chalk.redBright(validationError.message));
|
15
|
-
} else if (error instanceof MUDError) {
|
16
|
-
console.log(chalk.red(error));
|
17
|
-
} else {
|
18
|
-
console.log(error);
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
export {
|
23
|
-
logError
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=chunk-7SEEAWAF.js.map
|