@latticexyz/cli 1.28.0 → 1.29.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/commands/bulkupload.js +81 -41
- package/dist/commands/call-system.js +24039 -54
- package/dist/commands/create.js +113 -44
- package/dist/commands/deploy.js +95177 -425
- package/dist/commands/diamond-abi.js +2406 -50
- package/dist/commands/faucet.js +6104 -0
- package/dist/commands/hello.js +44 -16
- package/dist/commands/sync-art.js +109 -40
- package/dist/commands/system-types.js +2431 -66
- package/dist/commands/trace.js +36585 -60
- package/dist/commands/types.js +234159 -0
- package/dist/index.js +4667 -12
- package/package.json +13 -9
- package/src/commands/deploy.ts +10 -9
- package/src/commands/faucet.ts +55 -0
- package/src/commands/system-types.ts +1 -6
- package/src/commands/types.ts +46 -0
- package/src/index.ts +6 -2
- package/dist/utils.js +0 -78
package/dist/commands/hello.js
CHANGED
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
.positional("name", { type: "string", demandOption: true });
|
|
11
|
-
exports.builder = builder;
|
|
12
|
-
const handler = (argv) => {
|
|
13
|
-
const { name } = argv;
|
|
14
|
-
const greeting = `Gm, ${name}!`;
|
|
15
|
-
console.log(greeting);
|
|
16
|
-
process.exit(0);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
9
|
};
|
|
18
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc2) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc2 = __getOwnPropDesc(from, key)) || desc2.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/commands/hello.ts
|
|
21
|
+
var hello_exports = {};
|
|
22
|
+
__export(hello_exports, {
|
|
23
|
+
builder: () => builder,
|
|
24
|
+
command: () => command,
|
|
25
|
+
desc: () => desc,
|
|
26
|
+
handler: () => handler
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(hello_exports);
|
|
29
|
+
var command = "hello <name>";
|
|
30
|
+
var desc = "Greet <name> with Hello";
|
|
31
|
+
var builder = (yargs) => yargs.options({
|
|
32
|
+
upper: { type: "boolean" }
|
|
33
|
+
}).positional("name", { type: "string", demandOption: true });
|
|
34
|
+
var handler = (argv) => {
|
|
35
|
+
const { name } = argv;
|
|
36
|
+
const greeting = `Gm, ${name}!`;
|
|
37
|
+
console.log(greeting);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
builder,
|
|
43
|
+
command,
|
|
44
|
+
desc,
|
|
45
|
+
handler
|
|
46
|
+
});
|
|
@@ -1,45 +1,114 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc2) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc2 = __getOwnPropDesc(from, key)) || desc2.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __async = (__this, __arguments, generator) => {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
var fulfilled = (value) => {
|
|
22
|
+
try {
|
|
23
|
+
step(generator.next(value));
|
|
24
|
+
} catch (e) {
|
|
25
|
+
reject(e);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var rejected = (value) => {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.throw(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
36
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
37
|
+
});
|
|
10
38
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
|
|
40
|
+
// src/commands/sync-art.ts
|
|
41
|
+
var sync_art_exports = {};
|
|
42
|
+
__export(sync_art_exports, {
|
|
43
|
+
builder: () => builder,
|
|
44
|
+
command: () => command,
|
|
45
|
+
desc: () => desc,
|
|
46
|
+
handler: () => handler
|
|
18
47
|
});
|
|
19
|
-
exports
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
module.exports = __toCommonJS(sync_art_exports);
|
|
49
|
+
|
|
50
|
+
// src/utils.ts
|
|
51
|
+
var import_child_process = require("child_process");
|
|
52
|
+
var IDregex = new RegExp(new RegExp('(?<=uint256 constant ID = uint256\\(keccak256\\(")(.*)(?="\\))'));
|
|
53
|
+
function deferred() {
|
|
54
|
+
let resolve = null;
|
|
55
|
+
let reject = null;
|
|
56
|
+
const promise = new Promise((r, rj) => {
|
|
57
|
+
resolve = (t) => r(t);
|
|
58
|
+
reject = (e) => rj(e);
|
|
59
|
+
});
|
|
60
|
+
return [resolve, reject, promise];
|
|
61
|
+
}
|
|
62
|
+
function exec(command2) {
|
|
63
|
+
return __async(this, null, function* () {
|
|
64
|
+
const [resolve, , promise] = deferred();
|
|
65
|
+
const child = (0, import_child_process.exec)(command2, (error, stdout, stderr) => {
|
|
66
|
+
if (error || stderr) {
|
|
67
|
+
console.error(error);
|
|
68
|
+
console.error(stderr);
|
|
69
|
+
}
|
|
70
|
+
console.log(stdout);
|
|
71
|
+
});
|
|
72
|
+
child.on("exit", (code) => resolve(code != null ? code : 0));
|
|
73
|
+
return promise;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/commands/sync-art.ts
|
|
78
|
+
var command = "sync-art <repo>";
|
|
79
|
+
var desc = "Syncs art from a MUD-compatible art repo, found in <repo>";
|
|
80
|
+
var builder = (yargs) => yargs.positional("repo", { type: "string", demandOption: true }).options({
|
|
81
|
+
commitHash: { type: "string" }
|
|
82
|
+
});
|
|
83
|
+
var handler = (argv) => __async(void 0, null, function* () {
|
|
84
|
+
const { repo, commitHash } = argv;
|
|
85
|
+
console.log("Syncing art repo from", repo);
|
|
86
|
+
const clean = yield exec(`git diff --quiet --exit-code`);
|
|
87
|
+
if (clean !== 0) {
|
|
88
|
+
console.log("Directory is not clean! Please git add and commit");
|
|
43
89
|
process.exit(0);
|
|
90
|
+
}
|
|
91
|
+
console.log("Cloning...");
|
|
92
|
+
yield exec(`git clone ${repo} _artmudtemp`);
|
|
93
|
+
if (commitHash) {
|
|
94
|
+
yield exec(`cd _artmudtemp && git reset --hard ${commitHash} && cd -`);
|
|
95
|
+
}
|
|
96
|
+
console.log("Moving atlases...");
|
|
97
|
+
yield exec(`cp -r _artmudtemp/atlases src/public`);
|
|
98
|
+
console.log("Moving tilesets...");
|
|
99
|
+
yield exec(`cp -r _artmudtemp/tilesets src/layers/Renderer/assets`);
|
|
100
|
+
console.log("Moving tileset types...");
|
|
101
|
+
yield exec(`cp -r _artmudtemp/types/ src/layers/Renderer/Phaser/tilesets/`);
|
|
102
|
+
console.log("Cleaning up...");
|
|
103
|
+
yield exec(`rm -rf _artmudtemp`);
|
|
104
|
+
console.log("Committing...");
|
|
105
|
+
yield exec(`git add src/public && git add src/layers/Renderer && git commit -m "feat(art): adding art from ${repo}"`);
|
|
106
|
+
process.exit(0);
|
|
107
|
+
});
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
builder,
|
|
111
|
+
command,
|
|
112
|
+
desc,
|
|
113
|
+
handler
|
|
44
114
|
});
|
|
45
|
-
exports.handler = handler;
|