@metamask/snaps-cli 0.34.1-flask.1 → 0.35.0-flask.1
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/CHANGELOG.md +8 -1
- package/dist/cjs/builders.js +149 -0
- package/dist/{builders.js.map → cjs/builders.js.map} +1 -1
- package/dist/cjs/cli.js +35 -0
- package/dist/cjs/cli.js.map +1 -0
- package/dist/cjs/cmds/build/buildHandler.js +36 -0
- package/dist/cjs/cmds/build/buildHandler.js.map +1 -0
- package/dist/cjs/cmds/build/bundle.js +83 -0
- package/dist/{cmds → cjs/cmds}/build/bundle.js.map +1 -1
- package/dist/cjs/cmds/build/index.js +32 -0
- package/dist/cjs/cmds/build/index.js.map +1 -0
- package/dist/cjs/cmds/build/utils.js +79 -0
- package/dist/cjs/cmds/build/utils.js.map +1 -0
- package/dist/cjs/cmds/eval/evalHandler.js +24 -0
- package/dist/cjs/cmds/eval/evalHandler.js.map +1 -0
- package/dist/cjs/cmds/eval/index.js +31 -0
- package/dist/cjs/cmds/eval/index.js.map +1 -0
- package/dist/cjs/cmds/index.js +30 -0
- package/dist/cjs/cmds/index.js.map +1 -0
- package/dist/cjs/cmds/manifest/index.js +44 -0
- package/dist/cjs/cmds/manifest/index.js.map +1 -0
- package/dist/cjs/cmds/manifest/manifestHandler.js +46 -0
- package/dist/cjs/cmds/manifest/manifestHandler.js.map +1 -0
- package/dist/cjs/cmds/serve/index.js +31 -0
- package/dist/cjs/cmds/serve/index.js.map +1 -0
- package/dist/cjs/cmds/serve/serveHandler.js +62 -0
- package/dist/cjs/cmds/serve/serveHandler.js.map +1 -0
- package/dist/cjs/cmds/serve/serveUtils.js +37 -0
- package/dist/cjs/cmds/serve/serveUtils.js.map +1 -0
- package/dist/cjs/cmds/watch/index.js +32 -0
- package/dist/cjs/cmds/watch/index.js.map +1 -0
- package/dist/cjs/cmds/watch/watchHandler.js +91 -0
- package/dist/cjs/cmds/watch/watchHandler.js.map +1 -0
- package/dist/cjs/index.js +52 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/main.js +20 -0
- package/dist/cjs/main.js.map +1 -0
- package/dist/cjs/utils/index.js +21 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/misc.js +141 -0
- package/dist/cjs/utils/misc.js.map +1 -0
- package/dist/cjs/utils/snap-config.js +101 -0
- package/dist/cjs/utils/snap-config.js.map +1 -0
- package/dist/{builders.js → esm/builders.js} +27 -29
- package/dist/esm/builders.js.map +1 -0
- package/dist/esm/cli.js +26 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/cmds/build/buildHandler.js +36 -0
- package/dist/esm/cmds/build/buildHandler.js.map +1 -0
- package/dist/{cmds → esm/cmds}/build/bundle.js +40 -39
- package/dist/esm/cmds/build/bundle.js.map +1 -0
- package/dist/esm/cmds/build/index.js +17 -0
- package/dist/esm/cmds/build/index.js.map +1 -0
- package/dist/{cmds → esm/cmds}/build/utils.js +22 -34
- package/dist/esm/cmds/build/utils.js.map +1 -0
- package/dist/esm/cmds/eval/evalHandler.js +20 -0
- package/dist/esm/cmds/eval/evalHandler.js.map +1 -0
- package/dist/esm/cmds/eval/index.js +16 -0
- package/dist/esm/cmds/eval/index.js.map +1 -0
- package/dist/esm/cmds/index.js +15 -0
- package/dist/esm/cmds/index.js.map +1 -0
- package/dist/esm/cmds/manifest/index.js +29 -0
- package/dist/esm/cmds/manifest/index.js.map +1 -0
- package/dist/esm/cmds/manifest/manifestHandler.js +43 -0
- package/dist/esm/cmds/manifest/manifestHandler.js.map +1 -0
- package/dist/esm/cmds/serve/index.js +16 -0
- package/dist/esm/cmds/serve/index.js.map +1 -0
- package/dist/esm/cmds/serve/serveHandler.js +54 -0
- package/dist/esm/cmds/serve/serveHandler.js.map +1 -0
- package/dist/esm/cmds/serve/serveUtils.js +30 -0
- package/dist/esm/cmds/serve/serveUtils.js.map +1 -0
- package/dist/esm/cmds/watch/index.js +17 -0
- package/dist/esm/cmds/watch/index.js.map +1 -0
- package/dist/esm/cmds/watch/watchHandler.js +87 -0
- package/dist/esm/cmds/watch/watchHandler.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/main.js +11 -0
- package/dist/esm/main.js.map +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/{utils → esm/utils}/misc.js +32 -50
- package/dist/esm/utils/misc.js.map +1 -0
- package/dist/{utils → esm/utils}/snap-config.js +26 -39
- package/dist/esm/utils/snap-config.js.map +1 -0
- package/dist/{cmds → types/cmds}/build/bundle.d.ts +0 -1
- package/dist/{cmds/serve → types/cmds/build}/index.d.ts +2 -2
- package/dist/{cmds/build → types/cmds/eval}/index.d.ts +2 -2
- package/dist/{cmds → types/cmds}/manifest/index.d.ts +2 -2
- package/dist/{cmds/eval → types/cmds/serve}/index.d.ts +2 -2
- package/dist/types/cmds/watch/index.d.ts +9 -0
- package/dist/{utils → types/utils}/snap-config.d.ts +0 -1
- package/package.json +50 -14
- package/dist/cli.js +0 -51
- package/dist/cli.js.map +0 -1
- package/dist/cmds/build/buildHandler.js +0 -37
- package/dist/cmds/build/buildHandler.js.map +0 -1
- package/dist/cmds/build/index.js +0 -29
- package/dist/cmds/build/index.js.map +0 -1
- package/dist/cmds/build/utils.js.map +0 -1
- package/dist/cmds/eval/evalHandler.js +0 -25
- package/dist/cmds/eval/evalHandler.js.map +0 -1
- package/dist/cmds/eval/index.js +0 -15
- package/dist/cmds/eval/index.js.map +0 -1
- package/dist/cmds/index.js +0 -13
- package/dist/cmds/index.js.map +0 -1
- package/dist/cmds/manifest/index.js +0 -24
- package/dist/cmds/manifest/index.js.map +0 -1
- package/dist/cmds/manifest/manifestHandler.js +0 -50
- package/dist/cmds/manifest/manifestHandler.js.map +0 -1
- package/dist/cmds/serve/index.js +0 -15
- package/dist/cmds/serve/index.js.map +0 -1
- package/dist/cmds/serve/serveHandler.js +0 -59
- package/dist/cmds/serve/serveHandler.js.map +0 -1
- package/dist/cmds/serve/serveUtils.js +0 -39
- package/dist/cmds/serve/serveUtils.js.map +0 -1
- package/dist/cmds/watch/index.d.ts +0 -9
- package/dist/cmds/watch/index.js +0 -32
- package/dist/cmds/watch/index.js.map +0 -1
- package/dist/cmds/watch/watchHandler.js +0 -99
- package/dist/cmds/watch/watchHandler.js.map +0 -1
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/main.js +0 -15
- package/dist/main.js.map +0 -1
- package/dist/utils/index.js +0 -19
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/snap-config.js.map +0 -1
- /package/dist/{builders.d.ts → types/builders.d.ts} +0 -0
- /package/dist/{cli.d.ts → types/cli.d.ts} +0 -0
- /package/dist/{cmds → types/cmds}/build/buildHandler.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/build/utils.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/eval/evalHandler.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/index.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/manifest/manifestHandler.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/serve/serveHandler.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/serve/serveUtils.d.ts +0 -0
- /package/dist/{cmds → types/cmds}/watch/watchHandler.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{main.d.ts → types/main.d.ts} +0 -0
- /package/dist/{utils → types/utils}/index.d.ts +0 -0
- /package/dist/{utils → types/utils}/misc.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.35.0-flask.1]
|
|
10
|
+
### Changed
|
|
11
|
+
- **BREAKING:** Build packages as both CJS and ESM ([#1519](https://github.com/MetaMask/snaps/pull/1519), ([#1532](https://github.com/MetaMask/snaps/pull/1532)))
|
|
12
|
+
- This is breaking in the sense that imports to `dist/` will now require you to import either `dist/cjs` or `dist/esm`.
|
|
13
|
+
- Add `sideEffects: false` ([#1486](https://github.com/MetaMask/snaps/pull/1486))
|
|
14
|
+
|
|
9
15
|
## [0.34.1-flask.1]
|
|
10
16
|
### Changed
|
|
11
17
|
- No changes this release.
|
|
@@ -338,7 +344,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
338
344
|
- Example snaps ([#72](https://github.com/MetaMask/snaps-monorepo/pull/72))
|
|
339
345
|
- The examples now live in their own package, [`@metamask/snap-examples`](https://npmjs.com/package/@metamask/snap-examples).
|
|
340
346
|
|
|
341
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/v0.
|
|
347
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/v0.35.0-flask.1...HEAD
|
|
348
|
+
[0.35.0-flask.1]: https://github.com/MetaMask/snaps/compare/v0.34.1-flask.1...v0.35.0-flask.1
|
|
342
349
|
[0.34.1-flask.1]: https://github.com/MetaMask/snaps/compare/v0.34.0-flask.1...v0.34.1-flask.1
|
|
343
350
|
[0.34.0-flask.1]: https://github.com/MetaMask/snaps/compare/v0.33.1-flask.1...v0.34.0-flask.1
|
|
344
351
|
[0.33.1-flask.1]: https://github.com/MetaMask/snaps/compare/v0.33.0-flask.1...v0.33.1-flask.1
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
TranspilationModes: function() {
|
|
13
|
+
return TranspilationModes;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var TranspilationModes;
|
|
20
|
+
(function(TranspilationModes) {
|
|
21
|
+
TranspilationModes["LocalAndDeps"] = 'localAndDeps';
|
|
22
|
+
TranspilationModes["LocalOnly"] = 'localOnly';
|
|
23
|
+
TranspilationModes["None"] = 'none';
|
|
24
|
+
})(TranspilationModes || (TranspilationModes = {}));
|
|
25
|
+
const builders = {
|
|
26
|
+
bundle: {
|
|
27
|
+
alias: 'b',
|
|
28
|
+
describe: 'Snap bundle file',
|
|
29
|
+
type: 'string',
|
|
30
|
+
demandOption: true,
|
|
31
|
+
normalize: true,
|
|
32
|
+
default: 'dist/bundle.js'
|
|
33
|
+
},
|
|
34
|
+
dist: {
|
|
35
|
+
alias: 'd',
|
|
36
|
+
describe: 'Output directory',
|
|
37
|
+
type: 'string',
|
|
38
|
+
demandOption: true,
|
|
39
|
+
normalize: true,
|
|
40
|
+
default: 'dist'
|
|
41
|
+
},
|
|
42
|
+
eval: {
|
|
43
|
+
alias: 'e',
|
|
44
|
+
describe: 'Attempt to evaluate Snap bundle in SES',
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
demandOption: false,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
manifest: {
|
|
50
|
+
alias: 'm',
|
|
51
|
+
describe: 'Validate snap.manifest.json',
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
demandOption: false,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
port: {
|
|
57
|
+
alias: 'p',
|
|
58
|
+
describe: 'Local server port for testing',
|
|
59
|
+
type: 'number',
|
|
60
|
+
demandOption: true,
|
|
61
|
+
default: 8081,
|
|
62
|
+
coerce: (arg)=>{
|
|
63
|
+
const port = Number.parseInt(String(arg), 10);
|
|
64
|
+
if (Number.isNaN(port)) {
|
|
65
|
+
throw new Error(`Invalid port: ${String(arg)}`);
|
|
66
|
+
}
|
|
67
|
+
return port;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
outfileName: {
|
|
71
|
+
alias: 'n',
|
|
72
|
+
describe: 'Output file name',
|
|
73
|
+
type: 'string',
|
|
74
|
+
demandOption: false,
|
|
75
|
+
default: 'bundle.js'
|
|
76
|
+
},
|
|
77
|
+
root: {
|
|
78
|
+
alias: 'r',
|
|
79
|
+
describe: 'Server root directory',
|
|
80
|
+
type: 'string',
|
|
81
|
+
demandOption: true,
|
|
82
|
+
normalize: true,
|
|
83
|
+
default: '.'
|
|
84
|
+
},
|
|
85
|
+
sourceMaps: {
|
|
86
|
+
describe: 'Whether builds include sourcemaps',
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
demandOption: false,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
src: {
|
|
92
|
+
alias: 's',
|
|
93
|
+
describe: 'Source file',
|
|
94
|
+
type: 'string',
|
|
95
|
+
demandOption: true,
|
|
96
|
+
normalize: true,
|
|
97
|
+
default: 'src/index.js'
|
|
98
|
+
},
|
|
99
|
+
stripComments: {
|
|
100
|
+
alias: 'strip',
|
|
101
|
+
describe: 'Whether to remove code comments from the build output',
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
demandOption: false,
|
|
104
|
+
default: true
|
|
105
|
+
},
|
|
106
|
+
suppressWarnings: {
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
describe: 'Whether to suppress warnings',
|
|
109
|
+
demandOption: false,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
transpilationMode: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
describe: 'Whether to use Babel to transpile all source code (including dependencies), local source code only, or nothing.',
|
|
115
|
+
demandOption: false,
|
|
116
|
+
default: TranspilationModes.LocalOnly,
|
|
117
|
+
choices: Object.values(TranspilationModes)
|
|
118
|
+
},
|
|
119
|
+
depsToTranspile: {
|
|
120
|
+
type: 'array',
|
|
121
|
+
describe: 'Transpile only the listed dependencies.',
|
|
122
|
+
demandOption: false
|
|
123
|
+
},
|
|
124
|
+
verboseErrors: {
|
|
125
|
+
type: 'boolean',
|
|
126
|
+
describe: 'Display original errors',
|
|
127
|
+
demandOption: false,
|
|
128
|
+
default: true
|
|
129
|
+
},
|
|
130
|
+
writeManifest: {
|
|
131
|
+
describe: 'Make necessary changes to the Snap manifest file',
|
|
132
|
+
type: 'boolean',
|
|
133
|
+
demandOption: false,
|
|
134
|
+
default: true
|
|
135
|
+
},
|
|
136
|
+
serve: {
|
|
137
|
+
describe: 'Serve Snap file(s) locally for testing',
|
|
138
|
+
type: 'boolean',
|
|
139
|
+
demandOption: false,
|
|
140
|
+
default: true
|
|
141
|
+
},
|
|
142
|
+
directory: {
|
|
143
|
+
describe: 'the directory to use',
|
|
144
|
+
type: 'string'
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const _default = builders;
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/builders.ts"],"sourcesContent":["import { Options, PositionalOptions } from 'yargs';\n\nexport type SnapsCliBuilders = {\n readonly bundle: Readonly<Options>;\n readonly dist: Readonly<Options>;\n readonly eval: Readonly<Options>;\n readonly manifest: Readonly<Options>;\n readonly outfileName: Readonly<Options>;\n readonly port: Readonly<Options>;\n readonly root: Readonly<Options>;\n readonly sourceMaps: Readonly<Options>;\n readonly src: Readonly<Options>;\n readonly stripComments: Readonly<Options>;\n readonly suppressWarnings: Readonly<Options>;\n readonly transpilationMode: Readonly<Options>;\n readonly depsToTranspile: Readonly<Options>;\n readonly verboseErrors: Readonly<Options>;\n readonly writeManifest: Readonly<Options>;\n readonly serve: Readonly<Options>;\n readonly directory: Readonly<PositionalOptions>;\n};\n\nexport enum TranspilationModes {\n LocalAndDeps = 'localAndDeps',\n LocalOnly = 'localOnly',\n None = 'none',\n}\n\nconst builders: SnapsCliBuilders = {\n bundle: {\n alias: 'b',\n describe: 'Snap bundle file',\n type: 'string',\n demandOption: true,\n normalize: true,\n default: 'dist/bundle.js',\n },\n\n dist: {\n alias: 'd',\n describe: 'Output directory',\n type: 'string',\n demandOption: true,\n normalize: true,\n default: 'dist',\n },\n\n eval: {\n alias: 'e',\n describe: 'Attempt to evaluate Snap bundle in SES',\n type: 'boolean',\n demandOption: false,\n default: true,\n },\n\n manifest: {\n alias: 'm',\n describe: 'Validate snap.manifest.json',\n type: 'boolean',\n demandOption: false,\n default: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\n demandOption: true,\n default: 8081,\n coerce: (arg: unknown) => {\n const port = Number.parseInt(String(arg), 10);\n if (Number.isNaN(port)) {\n throw new Error(`Invalid port: ${String(arg)}`);\n }\n return port;\n },\n },\n\n outfileName: {\n alias: 'n',\n describe: 'Output file name',\n type: 'string',\n demandOption: false,\n default: 'bundle.js',\n },\n\n root: {\n alias: 'r',\n describe: 'Server root directory',\n type: 'string',\n demandOption: true,\n normalize: true,\n default: '.',\n },\n\n sourceMaps: {\n describe: 'Whether builds include sourcemaps',\n type: 'boolean',\n demandOption: false,\n default: false,\n },\n\n src: {\n alias: 's',\n describe: 'Source file',\n type: 'string',\n demandOption: true,\n normalize: true,\n default: 'src/index.js',\n },\n\n stripComments: {\n alias: 'strip',\n describe: 'Whether to remove code comments from the build output',\n type: 'boolean',\n demandOption: false,\n default: true,\n },\n\n suppressWarnings: {\n type: 'boolean',\n describe: 'Whether to suppress warnings',\n demandOption: false,\n default: false,\n },\n\n transpilationMode: {\n type: 'string',\n describe:\n 'Whether to use Babel to transpile all source code (including dependencies), local source code only, or nothing.',\n demandOption: false,\n default: TranspilationModes.LocalOnly,\n choices: Object.values(TranspilationModes),\n },\n\n depsToTranspile: {\n type: 'array',\n describe: 'Transpile only the listed dependencies.',\n demandOption: false,\n },\n\n verboseErrors: {\n type: 'boolean',\n describe: 'Display original errors',\n demandOption: false,\n default: true,\n },\n\n writeManifest: {\n describe: 'Make necessary changes to the Snap manifest file',\n type: 'boolean',\n demandOption: false,\n default: true,\n },\n\n serve: {\n describe: 'Serve Snap file(s) locally for testing',\n type: 'boolean',\n demandOption: false,\n default: true,\n },\n\n directory: {\n describe: 'the directory to use',\n type: 'string',\n },\n};\n\nexport default builders;\n"],"names":["TranspilationModes","LocalAndDeps","LocalOnly","None","builders","bundle","alias","describe","type","demandOption","normalize","default","dist","eval","manifest","port","coerce","arg","Number","parseInt","String","isNaN","Error","outfileName","root","sourceMaps","src","stripComments","suppressWarnings","transpilationMode","choices","Object","values","depsToTranspile","verboseErrors","writeManifest","serve","directory"],"mappings":";;;;;;;;;;;;;;IAwKA,OAAwB;eAAxB;;;IAlJO;UAAKA,kBAAkB;IAAlBA,mBACVC,kBAAe;IADLD,mBAEVE,eAAY;IAFFF,mBAGVG,UAAO;GAHGH,uBAAAA;AAMZ,MAAMI,WAA6B;IACjCC,QAAQ;QACNC,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdC,WAAW;QACXC,SAAS;IACX;IAEAC,MAAM;QACJN,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdC,WAAW;QACXC,SAAS;IACX;IAEAE,MAAM;QACJP,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAG,UAAU;QACRR,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAI,MAAM;QACJT,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;QACTK,QAAQ,CAACC;YACP,MAAMF,OAAOG,OAAOC,QAAQ,CAACC,OAAOH,MAAM;YAC1C,IAAIC,OAAOG,KAAK,CAACN,OAAO;gBACtB,MAAM,IAAIO,MAAM,CAAC,cAAc,EAAEF,OAAOH,KAAK,CAAC;YAChD;YACA,OAAOF;QACT;IACF;IAEAQ,aAAa;QACXjB,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAa,MAAM;QACJlB,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdC,WAAW;QACXC,SAAS;IACX;IAEAc,YAAY;QACVlB,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAe,KAAK;QACHpB,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdC,WAAW;QACXC,SAAS;IACX;IAEAgB,eAAe;QACbrB,OAAO;QACPC,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAiB,kBAAkB;QAChBpB,MAAM;QACND,UAAU;QACVE,cAAc;QACdE,SAAS;IACX;IAEAkB,mBAAmB;QACjBrB,MAAM;QACND,UACE;QACFE,cAAc;QACdE,SAASX,mBAAmBE,SAAS;QACrC4B,SAASC,OAAOC,MAAM,CAAChC;IACzB;IAEAiC,iBAAiB;QACfzB,MAAM;QACND,UAAU;QACVE,cAAc;IAChB;IAEAyB,eAAe;QACb1B,MAAM;QACND,UAAU;QACVE,cAAc;QACdE,SAAS;IACX;IAEAwB,eAAe;QACb5B,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEAyB,OAAO;QACL7B,UAAU;QACVC,MAAM;QACNC,cAAc;QACdE,SAAS;IACX;IAEA0B,WAAW;QACT9B,UAAU;QACVC,MAAM;IACR;AACF;MAEA,WAAeJ"}
|
package/dist/cjs/cli.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "cli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return cli;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _yargs = /*#__PURE__*/ _interop_require_default(require("yargs"));
|
|
12
|
+
const _builders = /*#__PURE__*/ _interop_require_default(require("./builders"));
|
|
13
|
+
const _utils = require("./utils");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function cli(argv, commands) {
|
|
20
|
+
const rawArgv = argv.slice(2);
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, @typescript-eslint/no-floating-promises
|
|
22
|
+
(0, _yargs.default)(rawArgv).scriptName('mm-snap').usage('Usage: $0 <command> [options]').example('$0 init', `\tInitialize a snap project in the current directory`).example('$0 init my-snap', `\tInitialize a snap project in the 'my-snap' directory`).example('$0 build -s src/index.js -d out', `\tBuild 'src/index.js' as './out/bundle.js'`).example('$0 build -s src/index.js -d out -n snap.js', `\tBuild 'src/index.js' as './out/snap.js'`).example('$0 serve -r out', `\tServe files in './out' on port 8080`).example('$0 serve -r out -p 9000', `\tServe files in './out' on port 9000`).example('$0 watch -s src/index.js -d out', `\tRebuild './out/bundle.js' on changes to files in 'src/index.js' parent and child directories`).command(commands).option('verboseErrors', _builders.default.verboseErrors).option('suppressWarnings', _builders.default.suppressWarnings).strict()// Typecast: The @types/yargs type for .middleware is incorrect.
|
|
23
|
+
// yargs middleware functions receive the yargs instance as a second parameter.
|
|
24
|
+
// ref: https://yargs.js.org/docs/#api-reference-middlewarecallbacks-applybeforevalidation
|
|
25
|
+
.middleware((yargsArgv, yargsInstance)=>{
|
|
26
|
+
(0, _utils.applyConfig)((0, _utils.loadConfig)(), rawArgv, yargsArgv, yargsInstance);
|
|
27
|
+
(0, _utils.setSnapGlobals)(yargsArgv);
|
|
28
|
+
(0, _utils.sanitizeInputs)(yargsArgv);
|
|
29
|
+
}, true).fail((message, error, _yargs)=>{
|
|
30
|
+
(0, _utils.logError)(message, error);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
}).demandCommand(1, 'You must specify at least one command.').help().alias('help', 'h').argv;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import yargs, { Arguments } from 'yargs';\nimport yargsType from 'yargs/yargs';\n\nimport builders from './builders';\nimport {\n applyConfig,\n loadConfig,\n sanitizeInputs,\n setSnapGlobals,\n logError,\n} from './utils';\n\n/**\n * The main CLI entry point function. This processes the command line args, and\n * runs the appropriate function.\n *\n * @param argv - The raw command line arguments, i.e., `process.argv`.\n * @param commands - The list of commands to use.\n */\nexport function cli(argv: string[], commands: any): void {\n const rawArgv = argv.slice(2);\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions, @typescript-eslint/no-floating-promises\n yargs(rawArgv)\n .scriptName('mm-snap')\n .usage('Usage: $0 <command> [options]')\n\n .example('$0 init', `\\tInitialize a snap project in the current directory`)\n .example(\n '$0 init my-snap',\n `\\tInitialize a snap project in the 'my-snap' directory`,\n )\n .example(\n '$0 build -s src/index.js -d out',\n `\\tBuild 'src/index.js' as './out/bundle.js'`,\n )\n .example(\n '$0 build -s src/index.js -d out -n snap.js',\n `\\tBuild 'src/index.js' as './out/snap.js'`,\n )\n .example('$0 serve -r out', `\\tServe files in './out' on port 8080`)\n .example('$0 serve -r out -p 9000', `\\tServe files in './out' on port 9000`)\n .example(\n '$0 watch -s src/index.js -d out',\n `\\tRebuild './out/bundle.js' on changes to files in 'src/index.js' parent and child directories`,\n )\n\n .command(commands)\n\n .option('verboseErrors', builders.verboseErrors)\n\n .option('suppressWarnings', builders.suppressWarnings)\n\n .strict()\n\n // Typecast: The @types/yargs type for .middleware is incorrect.\n // yargs middleware functions receive the yargs instance as a second parameter.\n // ref: https://yargs.js.org/docs/#api-reference-middlewarecallbacks-applybeforevalidation\n .middleware(\n ((yargsArgv: Arguments, yargsInstance: typeof yargsType) => {\n applyConfig(loadConfig(), rawArgv, yargsArgv, yargsInstance);\n setSnapGlobals(yargsArgv);\n sanitizeInputs(yargsArgv);\n }) as any,\n true,\n )\n\n .fail((message: string, error: Error, _yargs) => {\n logError(message, error);\n process.exitCode = 1;\n })\n\n .demandCommand(1, 'You must specify at least one command.')\n\n .help()\n .alias('help', 'h').argv;\n}\n"],"names":["cli","argv","commands","rawArgv","slice","yargs","scriptName","usage","example","command","option","builders","verboseErrors","suppressWarnings","strict","middleware","yargsArgv","yargsInstance","applyConfig","loadConfig","setSnapGlobals","sanitizeInputs","fail","message","error","_yargs","logError","process","exitCode","demandCommand","help","alias"],"mappings":";;;;+BAmBgBA;;;eAAAA;;;8DAnBiB;iEAGZ;uBAOd;;;;;;AASA,SAASA,IAAIC,IAAc,EAAEC,QAAa;IAC/C,MAAMC,UAAUF,KAAKG,KAAK,CAAC;IAC3B,6GAA6G;IAC7GC,IAAAA,cAAK,EAACF,SACHG,UAAU,CAAC,WACXC,KAAK,CAAC,iCAENC,OAAO,CAAC,WAAW,CAAC,oDAAoD,CAAC,EACzEA,OAAO,CACN,mBACA,CAAC,sDAAsD,CAAC,EAEzDA,OAAO,CACN,mCACA,CAAC,2CAA2C,CAAC,EAE9CA,OAAO,CACN,8CACA,CAAC,yCAAyC,CAAC,EAE5CA,OAAO,CAAC,mBAAmB,CAAC,qCAAqC,CAAC,EAClEA,OAAO,CAAC,2BAA2B,CAAC,qCAAqC,CAAC,EAC1EA,OAAO,CACN,mCACA,CAAC,8FAA8F,CAAC,EAGjGC,OAAO,CAACP,UAERQ,MAAM,CAAC,iBAAiBC,iBAAQ,CAACC,aAAa,EAE9CF,MAAM,CAAC,oBAAoBC,iBAAQ,CAACE,gBAAgB,EAEpDC,MAAM,EAEP,gEAAgE;IAChE,+EAA+E;IAC/E,0FAA0F;KACzFC,UAAU,CACR,CAACC,WAAsBC;QACtBC,IAAAA,kBAAW,EAACC,IAAAA,iBAAU,KAAIhB,SAASa,WAAWC;QAC9CG,IAAAA,qBAAc,EAACJ;QACfK,IAAAA,qBAAc,EAACL;IACjB,GACA,MAGDM,IAAI,CAAC,CAACC,SAAiBC,OAAcC;QACpCC,IAAAA,eAAQ,EAACH,SAASC;QAClBG,QAAQC,QAAQ,GAAG;IACrB,GAECC,aAAa,CAAC,GAAG,0CAEjBC,IAAI,GACJC,KAAK,CAAC,QAAQ,KAAK9B,IAAI;AAC5B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "build", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return build;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
+
const _utils = require("../../utils");
|
|
13
|
+
const _evalHandler = require("../eval/evalHandler");
|
|
14
|
+
const _manifestHandler = require("../manifest/manifestHandler");
|
|
15
|
+
const _bundle = require("./bundle");
|
|
16
|
+
async function build(argv) {
|
|
17
|
+
const { src, dist, outfileName } = argv;
|
|
18
|
+
if (outfileName) {
|
|
19
|
+
(0, _snapsutils.validateOutfileName)(outfileName);
|
|
20
|
+
}
|
|
21
|
+
await (0, _snapsutils.validateFilePath)(src);
|
|
22
|
+
await (0, _snapsutils.validateDirPath)(dist, true);
|
|
23
|
+
const outfilePath = (0, _snapsutils.getOutfilePath)(dist, outfileName);
|
|
24
|
+
const result = await (0, _bundle.bundle)(src, outfilePath, argv, (0, _utils.loadConfig)().bundlerCustomizer);
|
|
25
|
+
if (result && argv.eval) {
|
|
26
|
+
await (0, _evalHandler.evalHandler)({
|
|
27
|
+
...argv,
|
|
28
|
+
bundle: outfilePath
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (argv.manifest) {
|
|
32
|
+
await (0, _manifestHandler.manifestHandler)(argv);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=buildHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/build/buildHandler.ts"],"sourcesContent":["import {\n getOutfilePath,\n validateDirPath,\n validateFilePath,\n validateOutfileName,\n} from '@metamask/snaps-utils';\n\nimport { YargsArgs } from '../../types/yargs';\nimport { loadConfig } from '../../utils';\nimport { evalHandler } from '../eval/evalHandler';\nimport { manifestHandler } from '../manifest/manifestHandler';\nimport { bundle } from './bundle';\n\n/**\n * Builds all files in the given source directory to the given destination\n * directory.\n *\n * Creates destination directory if it doesn't exist.\n *\n * @param argv - Argv from Yargs.\n * @param argv.src - The source file path.\n * @param argv.dist - The output directory path.\n * @param argv.outfileName - The output file name.\n */\nexport async function build(argv: YargsArgs): Promise<void> {\n const { src, dist, outfileName } = argv;\n if (outfileName) {\n validateOutfileName(outfileName);\n }\n await validateFilePath(src);\n await validateDirPath(dist, true);\n\n const outfilePath = getOutfilePath(dist, outfileName);\n const result = await bundle(\n src,\n outfilePath,\n argv,\n loadConfig().bundlerCustomizer,\n );\n if (result && argv.eval) {\n await evalHandler({ ...argv, bundle: outfilePath });\n }\n\n if (argv.manifest) {\n await manifestHandler(argv);\n }\n}\n"],"names":["build","argv","src","dist","outfileName","validateOutfileName","validateFilePath","validateDirPath","outfilePath","getOutfilePath","result","bundle","loadConfig","bundlerCustomizer","eval","evalHandler","manifest","manifestHandler"],"mappings":";;;;+BAwBsBA;;;eAAAA;;;4BAnBf;uBAGoB;6BACC;iCACI;wBACT;AAahB,eAAeA,MAAMC,IAAe;IACzC,MAAM,EAAEC,GAAG,EAAEC,IAAI,EAAEC,WAAW,EAAE,GAAGH;IACnC,IAAIG,aAAa;QACfC,IAAAA,+BAAmB,EAACD;IACtB;IACA,MAAME,IAAAA,4BAAgB,EAACJ;IACvB,MAAMK,IAAAA,2BAAe,EAACJ,MAAM;IAE5B,MAAMK,cAAcC,IAAAA,0BAAc,EAACN,MAAMC;IACzC,MAAMM,SAAS,MAAMC,IAAAA,cAAM,EACzBT,KACAM,aACAP,MACAW,IAAAA,iBAAU,IAAGC,iBAAiB;IAEhC,IAAIH,UAAUT,KAAKa,IAAI,EAAE;QACvB,MAAMC,IAAAA,wBAAW,EAAC;YAAE,GAAGd,IAAI;YAAEU,QAAQH;QAAY;IACnD;IAEA,IAAIP,KAAKe,QAAQ,EAAE;QACjB,MAAMC,IAAAA,gCAAe,EAAChB;IACxB;AACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "bundle", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return bundle;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _snapsbrowserifyplugin = /*#__PURE__*/ _interop_require_default(require("@metamask/snaps-browserify-plugin"));
|
|
12
|
+
const _browserify = /*#__PURE__*/ _interop_require_default(require("browserify"));
|
|
13
|
+
const _builders = require("../../builders");
|
|
14
|
+
const _utils = require("./utils");
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function bundle(src, dest, argv, bundlerTransform) {
|
|
21
|
+
const { sourceMaps: debug, transpilationMode } = argv;
|
|
22
|
+
const babelifyOptions = (0, _utils.processDependencies)(argv);
|
|
23
|
+
return new Promise((resolve, _reject)=>{
|
|
24
|
+
const bundler = (0, _browserify.default)(src, {
|
|
25
|
+
debug,
|
|
26
|
+
extensions: [
|
|
27
|
+
'.js',
|
|
28
|
+
'.ts'
|
|
29
|
+
],
|
|
30
|
+
// Standalone is required to properly support Snaps using module.exports
|
|
31
|
+
standalone: '<snap>'
|
|
32
|
+
});
|
|
33
|
+
if (transpilationMode !== _builders.TranspilationModes.None) {
|
|
34
|
+
bundler.transform(require('babelify'), {
|
|
35
|
+
global: transpilationMode === _builders.TranspilationModes.LocalAndDeps,
|
|
36
|
+
extensions: [
|
|
37
|
+
'.js',
|
|
38
|
+
'.ts'
|
|
39
|
+
],
|
|
40
|
+
presets: [
|
|
41
|
+
require('@babel/preset-typescript'),
|
|
42
|
+
[
|
|
43
|
+
require('@babel/preset-env'),
|
|
44
|
+
{
|
|
45
|
+
targets: {
|
|
46
|
+
browsers: [
|
|
47
|
+
'chrome >= 90',
|
|
48
|
+
'firefox >= 91'
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
],
|
|
54
|
+
plugins: [
|
|
55
|
+
require('@babel/plugin-transform-runtime'),
|
|
56
|
+
require('@babel/plugin-proposal-class-properties'),
|
|
57
|
+
require('@babel/plugin-proposal-private-methods'),
|
|
58
|
+
require('@babel/plugin-proposal-class-static-block'),
|
|
59
|
+
require('@babel/plugin-proposal-private-property-in-object')
|
|
60
|
+
],
|
|
61
|
+
parserOpts: {
|
|
62
|
+
attachComment: !argv.stripComments
|
|
63
|
+
},
|
|
64
|
+
...babelifyOptions
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
bundlerTransform?.(bundler);
|
|
68
|
+
bundler.plugin(_snapsbrowserifyplugin.default, {
|
|
69
|
+
stripComments: argv.stripComments,
|
|
70
|
+
manifestPath: undefined,
|
|
71
|
+
eval: false
|
|
72
|
+
});
|
|
73
|
+
bundler.bundle(async (bundleError, bundleBuffer)=>await (0, _utils.writeBundleFile)({
|
|
74
|
+
bundleError,
|
|
75
|
+
bundleBuffer,
|
|
76
|
+
src,
|
|
77
|
+
dest,
|
|
78
|
+
resolve
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/build/bundle.ts"],"sourcesContent":["import plugin, { Options } from '@metamask/snaps-browserify-plugin';\nimport browserify, { BrowserifyObject } from 'browserify';\n\nimport { TranspilationModes } from '../../builders';\nimport { YargsArgs } from '../../types/yargs';\nimport { processDependencies, writeBundleFile } from './utils';\n\n// We need to statically import all Browserify transforms and all Babel presets\n// and plugins, and calling `require` is the sanest way to do that.\n/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, node/global-require */\n\n/**\n * Builds a Snap bundle JS file from its JavaScript source.\n *\n * @param src - The source file path.\n * @param dest - The destination file path.\n * @param argv - Arguments as an object generated by `yargs`.\n * @param argv.sourceMaps - Whether to output sourcemaps.\n * @param argv.stripComments - Whether to remove comments from code.\n * @param argv.transpilationMode - The Babel transpilation mode.\n * @param bundlerTransform - An optional function which can be used to transform\n * the Browserify instance, e.g., adding a custom transform or plugin.\n */\nexport async function bundle(\n src: string,\n dest: string,\n argv: YargsArgs,\n bundlerTransform?: (bundler: BrowserifyObject) => void,\n): Promise<boolean> {\n const { sourceMaps: debug, transpilationMode } = argv;\n const babelifyOptions = processDependencies(argv as any);\n return new Promise((resolve, _reject) => {\n const bundler = browserify(src, {\n debug,\n extensions: ['.js', '.ts'],\n // Standalone is required to properly support Snaps using module.exports\n standalone: '<snap>',\n });\n\n if (transpilationMode !== TranspilationModes.None) {\n bundler.transform(require('babelify'), {\n global: transpilationMode === TranspilationModes.LocalAndDeps,\n extensions: ['.js', '.ts'],\n presets: [\n require('@babel/preset-typescript'),\n [\n require('@babel/preset-env'),\n {\n targets: {\n browsers: ['chrome >= 90', 'firefox >= 91'],\n },\n },\n ],\n ],\n plugins: [\n require('@babel/plugin-transform-runtime'),\n require('@babel/plugin-proposal-class-properties'),\n require('@babel/plugin-proposal-private-methods'),\n require('@babel/plugin-proposal-class-static-block'),\n require('@babel/plugin-proposal-private-property-in-object'),\n ],\n parserOpts: {\n attachComment: !argv.stripComments,\n },\n ...(babelifyOptions as any),\n });\n }\n\n bundlerTransform?.(bundler);\n\n bundler.plugin<Options>(plugin, {\n stripComments: argv.stripComments,\n manifestPath: undefined,\n eval: false,\n });\n\n bundler.bundle(\n async (bundleError, bundleBuffer: Buffer) =>\n await writeBundleFile({\n bundleError,\n bundleBuffer,\n src,\n dest,\n resolve,\n }),\n );\n });\n}\n"],"names":["bundle","src","dest","argv","bundlerTransform","sourceMaps","debug","transpilationMode","babelifyOptions","processDependencies","Promise","resolve","_reject","bundler","browserify","extensions","standalone","TranspilationModes","None","transform","require","global","LocalAndDeps","presets","targets","browsers","plugins","parserOpts","attachComment","stripComments","plugin","manifestPath","undefined","eval","bundleError","bundleBuffer","writeBundleFile"],"mappings":";;;;+BAuBsBA;;;eAAAA;;;8EAvBU;mEACa;0BAEV;uBAEkB;;;;;;AAkB9C,eAAeA,OACpBC,GAAW,EACXC,IAAY,EACZC,IAAe,EACfC,gBAAsD;IAEtD,MAAM,EAAEC,YAAYC,KAAK,EAAEC,iBAAiB,EAAE,GAAGJ;IACjD,MAAMK,kBAAkBC,IAAAA,0BAAmB,EAACN;IAC5C,OAAO,IAAIO,QAAQ,CAACC,SAASC;QAC3B,MAAMC,UAAUC,IAAAA,mBAAU,EAACb,KAAK;YAC9BK;YACAS,YAAY;gBAAC;gBAAO;aAAM;YAC1B,wEAAwE;YACxEC,YAAY;QACd;QAEA,IAAIT,sBAAsBU,4BAAkB,CAACC,IAAI,EAAE;YACjDL,QAAQM,SAAS,CAACC,QAAQ,aAAa;gBACrCC,QAAQd,sBAAsBU,4BAAkB,CAACK,YAAY;gBAC7DP,YAAY;oBAAC;oBAAO;iBAAM;gBAC1BQ,SAAS;oBACPH,QAAQ;oBACR;wBACEA,QAAQ;wBACR;4BACEI,SAAS;gCACPC,UAAU;oCAAC;oCAAgB;iCAAgB;4BAC7C;wBACF;qBACD;iBACF;gBACDC,SAAS;oBACPN,QAAQ;oBACRA,QAAQ;oBACRA,QAAQ;oBACRA,QAAQ;oBACRA,QAAQ;iBACT;gBACDO,YAAY;oBACVC,eAAe,CAACzB,KAAK0B,aAAa;gBACpC;gBACA,GAAIrB,eAAe;YACrB;QACF;QAEAJ,mBAAmBS;QAEnBA,QAAQiB,MAAM,CAAUA,8BAAM,EAAE;YAC9BD,eAAe1B,KAAK0B,aAAa;YACjCE,cAAcC;YACdC,MAAM;QACR;QAEApB,QAAQb,MAAM,CACZ,OAAOkC,aAAaC,eAClB,MAAMC,IAAAA,sBAAe,EAAC;gBACpBF;gBACAC;gBACAlC;gBACAC;gBACAS;YACF;IAEN;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
+
const _buildHandler = require("./buildHandler");
|
|
13
|
+
const _utils = require("./utils");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const command = {
|
|
20
|
+
command: [
|
|
21
|
+
'build',
|
|
22
|
+
'b'
|
|
23
|
+
],
|
|
24
|
+
desc: 'Build Snap from source',
|
|
25
|
+
builder: (yarg)=>{
|
|
26
|
+
yarg.option('dist', _builders.default.dist).option('eval', _builders.default.eval).option('manifest', _builders.default.manifest).option('outfileName', _builders.default.outfileName).option('sourceMaps', _builders.default.sourceMaps).option('src', _builders.default.src).option('stripComments', _builders.default.stripComments).option('transpilationMode', _builders.default.transpilationMode).option('depsToTranspile', _builders.default.depsToTranspile).option('writeManifest', _builders.default.writeManifest).implies('writeManifest', 'manifest').implies('depsToTranspile', 'transpilationMode').middleware((argv)=>(0, _utils.processInvalidTranspilation)(argv));
|
|
27
|
+
},
|
|
28
|
+
handler: async (argv)=>(0, _buildHandler.build)(argv)
|
|
29
|
+
};
|
|
30
|
+
const _default = command;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/build/index.ts"],"sourcesContent":["import yargs from 'yargs';\n\nimport builders from '../../builders';\nimport { YargsArgs } from '../../types/yargs';\nimport { build } from './buildHandler';\nimport { processInvalidTranspilation } from './utils';\n\nconst command = {\n command: ['build', 'b'],\n desc: 'Build Snap from source',\n builder: (yarg: yargs.Argv) => {\n yarg\n .option('dist', builders.dist)\n .option('eval', builders.eval)\n .option('manifest', builders.manifest)\n .option('outfileName', builders.outfileName)\n .option('sourceMaps', builders.sourceMaps)\n .option('src', builders.src)\n .option('stripComments', builders.stripComments)\n .option('transpilationMode', builders.transpilationMode)\n .option('depsToTranspile', builders.depsToTranspile)\n .option('writeManifest', builders.writeManifest)\n .implies('writeManifest', 'manifest')\n .implies('depsToTranspile', 'transpilationMode')\n .middleware((argv) => processInvalidTranspilation(argv as any));\n },\n handler: async (argv: YargsArgs) => build(argv),\n};\n\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","dist","eval","manifest","outfileName","sourceMaps","src","stripComments","transpilationMode","depsToTranspile","writeManifest","implies","middleware","argv","processInvalidTranspilation","handler","build"],"mappings":";;;;+BA6BA;;;eAAA;;;iEA3BqB;8BAEC;uBACsB;;;;;;AAE5C,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAS;KAAI;IACvBC,MAAM;IACNC,SAAS,CAACC;QACRA,KACGC,MAAM,CAAC,QAAQC,iBAAQ,CAACC,IAAI,EAC5BF,MAAM,CAAC,QAAQC,iBAAQ,CAACE,IAAI,EAC5BH,MAAM,CAAC,YAAYC,iBAAQ,CAACG,QAAQ,EACpCJ,MAAM,CAAC,eAAeC,iBAAQ,CAACI,WAAW,EAC1CL,MAAM,CAAC,cAAcC,iBAAQ,CAACK,UAAU,EACxCN,MAAM,CAAC,OAAOC,iBAAQ,CAACM,GAAG,EAC1BP,MAAM,CAAC,iBAAiBC,iBAAQ,CAACO,aAAa,EAC9CR,MAAM,CAAC,qBAAqBC,iBAAQ,CAACQ,iBAAiB,EACtDT,MAAM,CAAC,mBAAmBC,iBAAQ,CAACS,eAAe,EAClDV,MAAM,CAAC,iBAAiBC,iBAAQ,CAACU,aAAa,EAC9CC,OAAO,CAAC,iBAAiB,YACzBA,OAAO,CAAC,mBAAmB,qBAC3BC,UAAU,CAAC,CAACC,OAASC,IAAAA,kCAA2B,EAACD;IACtD;IACAE,SAAS,OAAOF,OAAoBG,IAAAA,mBAAK,EAACH;AAC5C;MAEA,WAAelB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
writeBundleFile: function() {
|
|
13
|
+
return writeBundleFile;
|
|
14
|
+
},
|
|
15
|
+
processDependencies: function() {
|
|
16
|
+
return processDependencies;
|
|
17
|
+
},
|
|
18
|
+
getDependencyRegExp: function() {
|
|
19
|
+
return getDependencyRegExp;
|
|
20
|
+
},
|
|
21
|
+
sanitizeDependencyPaths: function() {
|
|
22
|
+
return sanitizeDependencyPaths;
|
|
23
|
+
},
|
|
24
|
+
processInvalidTranspilation: function() {
|
|
25
|
+
return processInvalidTranspilation;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _snapsutils = require("@metamask/snaps-utils");
|
|
29
|
+
const _fs = require("fs");
|
|
30
|
+
const _builders = require("../../builders");
|
|
31
|
+
const _utils = require("../../utils");
|
|
32
|
+
async function writeBundleFile({ bundleError, bundleBuffer, src, dest, resolve }) {
|
|
33
|
+
if (bundleError) {
|
|
34
|
+
await (0, _utils.writeError)('Build error:', bundleError.message, bundleError);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
await _fs.promises.writeFile(dest, bundleBuffer?.toString());
|
|
38
|
+
(0, _snapsutils.logInfo)(`Build success: '${src}' bundled as '${dest}'!`);
|
|
39
|
+
resolve(true);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
await (0, _utils.writeError)('Write error:', error.message, error, dest);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function processDependencies(argv) {
|
|
45
|
+
const { depsToTranspile, transpilationMode } = argv;
|
|
46
|
+
const babelifyOptions = {};
|
|
47
|
+
if (transpilationMode === _builders.TranspilationModes.LocalAndDeps) {
|
|
48
|
+
const regexpStr = getDependencyRegExp(depsToTranspile);
|
|
49
|
+
if (regexpStr !== null) {
|
|
50
|
+
babelifyOptions.ignore = [
|
|
51
|
+
regexpStr
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return babelifyOptions;
|
|
56
|
+
}
|
|
57
|
+
function getDependencyRegExp(dependencies) {
|
|
58
|
+
let regexp = null;
|
|
59
|
+
if (!dependencies || dependencies.includes('.') || !dependencies.length) {
|
|
60
|
+
return regexp;
|
|
61
|
+
}
|
|
62
|
+
const paths = sanitizeDependencyPaths(dependencies);
|
|
63
|
+
regexp = `/node_modules/(?!${paths.shift() ?? ''}`;
|
|
64
|
+
paths.forEach((path)=>regexp += `|${path}`);
|
|
65
|
+
regexp += '/)';
|
|
66
|
+
return RegExp(regexp, 'u');
|
|
67
|
+
}
|
|
68
|
+
function sanitizeDependencyPaths(dependencies) {
|
|
69
|
+
return dependencies.map((dependency)=>{
|
|
70
|
+
return dependency.replace(/^[/\\]+/u, '').replace(/[/\\]+$/u, '');
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function processInvalidTranspilation(argv) {
|
|
74
|
+
if (argv.depsToTranspile && argv.transpilationMode !== _builders.TranspilationModes.LocalAndDeps) {
|
|
75
|
+
throw new Error('"depsToTranspile" can only be specified if "transpilationMode" is set to "localAndDeps" .');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/build/utils.ts"],"sourcesContent":["import { logInfo } from '@metamask/snaps-utils';\nimport { promises as fs } from 'fs';\n\nimport { TranspilationModes } from '../../builders';\nimport { YargsArgs } from '../../types/yargs';\nimport { writeError } from '../../utils';\n\ntype WriteBundleFileArgs = {\n bundleError: Error;\n bundleBuffer: Buffer;\n src: string;\n dest: string;\n resolve: (value: boolean) => void;\n};\n\n/**\n * Performs postprocessing on the bundle contents and writes them to disk.\n * Intended to be used in the callback passed to the Browserify `.bundle()`\n * call.\n *\n * @param options - Options bag.\n * @param options.bundleError - Any error received from Browserify.\n * @param options.bundleBuffer - The {@link Buffer} with the bundle contents\n * from Browserify.\n * @param options.src - The source file path.\n * @param options.dest - The destination file path.\n * @param options.resolve - A {@link Promise} resolution function, so that we\n * can use promises and `async`/`await` even though Browserify uses callbacks.\n */\nexport async function writeBundleFile({\n bundleError,\n bundleBuffer,\n src,\n dest,\n resolve,\n}: WriteBundleFileArgs) {\n if (bundleError) {\n await writeError('Build error:', bundleError.message, bundleError);\n }\n\n try {\n await fs.writeFile(dest, bundleBuffer?.toString());\n logInfo(`Build success: '${src}' bundled as '${dest}'!`);\n resolve(true);\n } catch (error) {\n await writeError('Write error:', error.message, error, dest);\n }\n}\n\n/**\n * Processes dependencies and updates `argv` with an options object.\n *\n * @param argv - The Yargs arguments object.\n * @returns An object with options that can be passed to Babelify.\n */\nexport function processDependencies(argv: YargsArgs) {\n const { depsToTranspile, transpilationMode } = argv;\n const babelifyOptions: Record<string, any> = {};\n if (transpilationMode === TranspilationModes.LocalAndDeps) {\n const regexpStr = getDependencyRegExp(depsToTranspile as string[]);\n if (regexpStr !== null) {\n babelifyOptions.ignore = [regexpStr];\n }\n }\n return babelifyOptions;\n}\n\n/**\n * Processes a string of space delimited dependencies into one RegExp string.\n *\n * @param dependencies - An array of dependencies to add to the RegExp.\n * @returns A RegExp object.\n */\nexport function getDependencyRegExp(dependencies: string[]): RegExp | null {\n let regexp: string | null = null;\n if (!dependencies || dependencies.includes('.') || !dependencies.length) {\n return regexp;\n }\n const paths: string[] = sanitizeDependencyPaths(dependencies);\n regexp = `/node_modules/(?!${paths.shift() ?? ''}`;\n paths.forEach((path) => (regexp += `|${path}`));\n regexp += '/)';\n return RegExp(regexp, 'u');\n}\n\n/**\n * Helper function remove any leading and trailing slashes from dependency list.\n *\n * @param dependencies - An array of dependencies to sanitize.\n * @returns An array of sanitized paths.\n */\nexport function sanitizeDependencyPaths(dependencies: string[]): string[] {\n return dependencies.map((dependency) => {\n return dependency.replace(/^[/\\\\]+/u, '').replace(/[/\\\\]+$/u, '');\n });\n}\n\n/**\n * Check the Yargs argv object, to see if the provided options are valid. The\n * options are invalid if both `depsToTranspile` are provided, and\n * `transpilationMode` is not set to `localAndDeps`.\n *\n * @param argv - The Yargs arguments object.\n * @throws If the `depsToTranspile` is set, and `transpilationMode` is not set\n * to `localAndDeps`.\n */\nexport function processInvalidTranspilation(argv: YargsArgs) {\n if (\n argv.depsToTranspile &&\n argv.transpilationMode !== TranspilationModes.LocalAndDeps\n ) {\n throw new Error(\n '\"depsToTranspile\" can only be specified if \"transpilationMode\" is set to \"localAndDeps\" .',\n );\n }\n}\n"],"names":["writeBundleFile","processDependencies","getDependencyRegExp","sanitizeDependencyPaths","processInvalidTranspilation","bundleError","bundleBuffer","src","dest","resolve","writeError","message","fs","writeFile","toString","logInfo","error","argv","depsToTranspile","transpilationMode","babelifyOptions","TranspilationModes","LocalAndDeps","regexpStr","ignore","dependencies","regexp","includes","length","paths","shift","forEach","path","RegExp","map","dependency","replace","Error"],"mappings":";;;;;;;;;;;IA6BsBA,eAAe;eAAfA;;IA0BNC,mBAAmB;eAAnBA;;IAkBAC,mBAAmB;eAAnBA;;IAkBAC,uBAAuB;eAAvBA;;IAeAC,2BAA2B;eAA3BA;;;4BA1GQ;oBACO;0BAEI;uBAER;AAwBpB,eAAeJ,gBAAgB,EACpCK,WAAW,EACXC,YAAY,EACZC,GAAG,EACHC,IAAI,EACJC,OAAO,EACa;IACpB,IAAIJ,aAAa;QACf,MAAMK,IAAAA,iBAAU,EAAC,gBAAgBL,YAAYM,OAAO,EAAEN;IACxD;IAEA,IAAI;QACF,MAAMO,YAAE,CAACC,SAAS,CAACL,MAAMF,cAAcQ;QACvCC,IAAAA,mBAAO,EAAC,CAAC,gBAAgB,EAAER,IAAI,cAAc,EAAEC,KAAK,EAAE,CAAC;QACvDC,QAAQ;IACV,EAAE,OAAOO,OAAO;QACd,MAAMN,IAAAA,iBAAU,EAAC,gBAAgBM,MAAML,OAAO,EAAEK,OAAOR;IACzD;AACF;AAQO,SAASP,oBAAoBgB,IAAe;IACjD,MAAM,EAAEC,eAAe,EAAEC,iBAAiB,EAAE,GAAGF;IAC/C,MAAMG,kBAAuC,CAAC;IAC9C,IAAID,sBAAsBE,4BAAkB,CAACC,YAAY,EAAE;QACzD,MAAMC,YAAYrB,oBAAoBgB;QACtC,IAAIK,cAAc,MAAM;YACtBH,gBAAgBI,MAAM,GAAG;gBAACD;aAAU;QACtC;IACF;IACA,OAAOH;AACT;AAQO,SAASlB,oBAAoBuB,YAAsB;IACxD,IAAIC,SAAwB;IAC5B,IAAI,CAACD,gBAAgBA,aAAaE,QAAQ,CAAC,QAAQ,CAACF,aAAaG,MAAM,EAAE;QACvE,OAAOF;IACT;IACA,MAAMG,QAAkB1B,wBAAwBsB;IAChDC,SAAS,CAAC,iBAAiB,EAAEG,MAAMC,KAAK,MAAM,GAAG,CAAC;IAClDD,MAAME,OAAO,CAAC,CAACC,OAAUN,UAAU,CAAC,CAAC,EAAEM,KAAK,CAAC;IAC7CN,UAAU;IACV,OAAOO,OAAOP,QAAQ;AACxB;AAQO,SAASvB,wBAAwBsB,YAAsB;IAC5D,OAAOA,aAAaS,GAAG,CAAC,CAACC;QACvB,OAAOA,WAAWC,OAAO,CAAC,YAAY,IAAIA,OAAO,CAAC,YAAY;IAChE;AACF;AAWO,SAAShC,4BAA4Ba,IAAe;IACzD,IACEA,KAAKC,eAAe,IACpBD,KAAKE,iBAAiB,KAAKE,4BAAkB,CAACC,YAAY,EAC1D;QACA,MAAM,IAAIe,MACR;IAEJ;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "evalHandler", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return evalHandler;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
+
const _utils = require("@metamask/utils");
|
|
13
|
+
async function evalHandler(argv) {
|
|
14
|
+
const { bundle: bundlePath } = argv;
|
|
15
|
+
(0, _utils.assert)(typeof bundlePath === 'string');
|
|
16
|
+
try {
|
|
17
|
+
await (0, _snapsutils.evalBundle)(bundlePath);
|
|
18
|
+
(0, _snapsutils.logInfo)(`Eval Success: evaluated '${bundlePath}' in SES!`);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`Snap evaluation error: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=evalHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/eval/evalHandler.ts"],"sourcesContent":["import { evalBundle, logInfo } from '@metamask/snaps-utils';\nimport { assert } from '@metamask/utils';\n\nimport { YargsArgs } from '../../types/yargs';\n\n/**\n * Runs the snap in a worker, to ensure SES compatibility.\n *\n * @param argv - The Yargs arguments object.\n * @returns A promise that resolves once the eval has finished.\n * @throws If the eval failed.\n */\nexport async function evalHandler(argv: YargsArgs): Promise<void> {\n const { bundle: bundlePath } = argv;\n\n assert(typeof bundlePath === 'string');\n\n try {\n await evalBundle(bundlePath);\n logInfo(`Eval Success: evaluated '${bundlePath}' in SES!`);\n } catch (error) {\n throw new Error(`Snap evaluation error: ${error.message}`);\n }\n}\n"],"names":["evalHandler","argv","bundle","bundlePath","assert","evalBundle","logInfo","error","Error","message"],"mappings":";;;;+BAYsBA;;;eAAAA;;;4BAZc;uBACb;AAWhB,eAAeA,YAAYC,IAAe;IAC/C,MAAM,EAAEC,QAAQC,UAAU,EAAE,GAAGF;IAE/BG,IAAAA,aAAM,EAAC,OAAOD,eAAe;IAE7B,IAAI;QACF,MAAME,IAAAA,sBAAU,EAACF;QACjBG,IAAAA,mBAAO,EAAC,CAAC,yBAAyB,EAAEH,WAAW,SAAS,CAAC;IAC3D,EAAE,OAAOI,OAAO;QACd,MAAM,IAAIC,MAAM,CAAC,uBAAuB,EAAED,MAAME,OAAO,CAAC,CAAC;IAC3D;AACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
+
const _evalHandler = require("./evalHandler");
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const command = {
|
|
19
|
+
command: [
|
|
20
|
+
'eval',
|
|
21
|
+
'e'
|
|
22
|
+
],
|
|
23
|
+
desc: 'Attempt to evaluate Snap bundle in SES',
|
|
24
|
+
builder: (yarg)=>{
|
|
25
|
+
yarg.option('bundle', _builders.default.bundle);
|
|
26
|
+
},
|
|
27
|
+
handler: async (argv)=>(0, _evalHandler.evalHandler)(argv)
|
|
28
|
+
};
|
|
29
|
+
const _default = command;
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cmds/eval/index.ts"],"sourcesContent":["import yargs from 'yargs';\n\nimport builders from '../../builders';\nimport { YargsArgs } from '../../types/yargs';\nimport { evalHandler } from './evalHandler';\n\nconst command = {\n command: ['eval', 'e'],\n desc: 'Attempt to evaluate Snap bundle in SES',\n builder: (yarg: yargs.Argv) => {\n yarg.option('bundle', builders.bundle);\n },\n handler: async (argv: YargsArgs) => evalHandler(argv),\n};\n\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","bundle","handler","argv","evalHandler"],"mappings":";;;;+BAeA;;;eAAA;;;iEAbqB;6BAEO;;;;;;AAE5B,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAQ;KAAI;IACtBC,MAAM;IACNC,SAAS,CAACC;QACRA,KAAKC,MAAM,CAAC,UAAUC,iBAAQ,CAACC,MAAM;IACvC;IACAC,SAAS,OAAOC,OAAoBC,IAAAA,wBAAW,EAACD;AAClD;MAEA,WAAeR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _build = /*#__PURE__*/ _interop_require_default(require("./build"));
|
|
12
|
+
const _eval = /*#__PURE__*/ _interop_require_default(require("./eval"));
|
|
13
|
+
const _manifest = /*#__PURE__*/ _interop_require_default(require("./manifest"));
|
|
14
|
+
const _serve = /*#__PURE__*/ _interop_require_default(require("./serve"));
|
|
15
|
+
const _watch = /*#__PURE__*/ _interop_require_default(require("./watch"));
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const commands = [
|
|
22
|
+
_build.default,
|
|
23
|
+
_eval.default,
|
|
24
|
+
_manifest.default,
|
|
25
|
+
_serve.default,
|
|
26
|
+
_watch.default
|
|
27
|
+
];
|
|
28
|
+
const _default = commands;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index.js.map
|