skittles 0.1.6 → 0.1.7
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/lib/index.js +14 -14
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -23,6 +23,20 @@ const get_bytecode_1 = __importDefault(require("./bytecode/get-bytecode"));
|
|
|
23
23
|
const file_helper_1 = require("./helpers/file-helper");
|
|
24
24
|
const get_skittles_class_1 = __importDefault(require("./skittles-class/get-skittles-class"));
|
|
25
25
|
const get_yul_1 = __importDefault(require("./yul/get-yul"));
|
|
26
|
+
const skittlesCompile = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
const files = (0, file_helper_1.getAllContractFiles)();
|
|
28
|
+
const promises = files.map((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const skittlesClass = (0, get_skittles_class_1.default)(file);
|
|
30
|
+
const abi = (0, get_abi_1.default)(skittlesClass);
|
|
31
|
+
const { name } = skittlesClass;
|
|
32
|
+
(0, file_helper_1.writeFile)("abi", name, JSON.stringify(abi, null, 2));
|
|
33
|
+
const yul = (0, get_yul_1.default)(skittlesClass, abi);
|
|
34
|
+
(0, file_helper_1.writeFile)("yul", name, yul);
|
|
35
|
+
const bytecode = (0, get_bytecode_1.default)(name, yul);
|
|
36
|
+
(0, file_helper_1.writeFile)("bytecode", name, bytecode);
|
|
37
|
+
}));
|
|
38
|
+
yield Promise.all(promises);
|
|
39
|
+
});
|
|
26
40
|
// clear();
|
|
27
41
|
// console.log(
|
|
28
42
|
// chalk.red(figlet.textSync("skittles-cli", { horizontalLayout: "full" }))
|
|
@@ -45,17 +59,3 @@ commander_1.program
|
|
|
45
59
|
yield skittlesCompile();
|
|
46
60
|
}));
|
|
47
61
|
commander_1.program.parse();
|
|
48
|
-
const skittlesCompile = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
const files = (0, file_helper_1.getAllContractFiles)();
|
|
50
|
-
const promises = files.map((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
const skittlesClass = (0, get_skittles_class_1.default)(file);
|
|
52
|
-
const abi = (0, get_abi_1.default)(skittlesClass);
|
|
53
|
-
const { name } = skittlesClass;
|
|
54
|
-
(0, file_helper_1.writeFile)("abi", name, JSON.stringify(abi, null, 2));
|
|
55
|
-
const yul = (0, get_yul_1.default)(skittlesClass, abi);
|
|
56
|
-
(0, file_helper_1.writeFile)("yul", name, yul);
|
|
57
|
-
const bytecode = (0, get_bytecode_1.default)(name, yul);
|
|
58
|
-
(0, file_helper_1.writeFile)("bytecode", name, bytecode);
|
|
59
|
-
}));
|
|
60
|
-
yield Promise.all(promises);
|
|
61
|
-
});
|