@metamask/snaps-cli 7.0.0 → 7.1.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/CHANGELOG.md +14 -1
- package/README.md +1 -0
- package/dist/builders.cjs +5 -0
- package/dist/builders.cjs.map +1 -1
- package/dist/builders.d.cts +5 -0
- package/dist/builders.d.cts.map +1 -1
- package/dist/builders.d.mts +5 -0
- package/dist/builders.d.mts.map +1 -1
- package/dist/builders.mjs +5 -0
- package/dist/builders.mjs.map +1 -1
- package/dist/commands/build/build.cjs +9 -5
- package/dist/commands/build/build.cjs.map +1 -1
- package/dist/commands/build/build.d.cts +8 -0
- package/dist/commands/build/build.d.cts.map +1 -1
- package/dist/commands/build/build.d.mts +8 -0
- package/dist/commands/build/build.d.mts.map +1 -1
- package/dist/commands/build/build.mjs +7 -3
- package/dist/commands/build/build.mjs.map +1 -1
- package/dist/commands/build/index.cjs +3 -0
- package/dist/commands/build/index.cjs.map +1 -1
- package/dist/commands/build/index.d.cts +1 -0
- package/dist/commands/build/index.d.cts.map +1 -1
- package/dist/commands/build/index.d.mts +1 -0
- package/dist/commands/build/index.d.mts.map +1 -1
- package/dist/commands/build/index.mjs +1 -0
- package/dist/commands/build/index.mjs.map +1 -1
- package/dist/commands/index.cjs +2 -0
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts.map +1 -1
- package/dist/commands/index.d.mts.map +1 -1
- package/dist/commands/index.mjs +2 -0
- package/dist/commands/index.mjs.map +1 -1
- package/dist/commands/sandbox/index.cjs +17 -0
- package/dist/commands/sandbox/index.cjs.map +1 -0
- package/dist/commands/sandbox/index.d.cts +10 -0
- package/dist/commands/sandbox/index.d.cts.map +1 -0
- package/dist/commands/sandbox/index.d.mts +10 -0
- package/dist/commands/sandbox/index.d.mts.map +1 -0
- package/dist/commands/sandbox/index.mjs +12 -0
- package/dist/commands/sandbox/index.mjs.map +1 -0
- package/dist/commands/sandbox/sandbox.cjs +33 -0
- package/dist/commands/sandbox/sandbox.cjs.map +1 -0
- package/dist/commands/sandbox/sandbox.d.cts +14 -0
- package/dist/commands/sandbox/sandbox.d.cts.map +1 -0
- package/dist/commands/sandbox/sandbox.d.mts +14 -0
- package/dist/commands/sandbox/sandbox.d.mts.map +1 -0
- package/dist/commands/sandbox/sandbox.mjs +29 -0
- package/dist/commands/sandbox/sandbox.mjs.map +1 -0
- package/dist/commands/sandbox/server.cjs +27 -0
- package/dist/commands/sandbox/server.cjs.map +1 -0
- package/dist/commands/sandbox/server.d.cts +14 -0
- package/dist/commands/sandbox/server.d.cts.map +1 -0
- package/dist/commands/sandbox/server.d.mts +14 -0
- package/dist/commands/sandbox/server.d.mts.map +1 -0
- package/dist/commands/sandbox/server.mjs +25 -0
- package/dist/commands/sandbox/server.mjs.map +1 -0
- package/dist/webpack/server.cjs +83 -72
- package/dist/webpack/server.cjs.map +1 -1
- package/dist/webpack/server.d.cts +6 -1
- package/dist/webpack/server.d.cts.map +1 -1
- package/dist/webpack/server.d.mts +6 -1
- package/dist/webpack/server.d.mts.map +1 -1
- package/dist/webpack/server.mjs +63 -72
- package/dist/webpack/server.mjs.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [7.1.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `sandbox` command to run sandbox tool ([#3306](https://github.com/MetaMask/snaps/pull/3306))
|
|
15
|
+
- This command allows you to run the Snaps sandbox tool, which is useful for
|
|
16
|
+
quickly testing and debugging Snaps.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Bump `@metamask/utils` from `11.2.0` to `11.4.0` ([#3232](https://github.com/MetaMask/snaps/pull/3232))
|
|
21
|
+
|
|
10
22
|
## [7.0.0]
|
|
11
23
|
|
|
12
24
|
### Changed
|
|
@@ -350,7 +362,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
350
362
|
- The version of the package no longer needs to match the version of all other
|
|
351
363
|
MetaMask Snaps packages.
|
|
352
364
|
|
|
353
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.
|
|
365
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.1.0...HEAD
|
|
366
|
+
[7.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.0.0...@metamask/snaps-cli@7.1.0
|
|
354
367
|
[7.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@6.7.0...@metamask/snaps-cli@7.0.0
|
|
355
368
|
[6.7.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@6.6.1...@metamask/snaps-cli@6.7.0
|
|
356
369
|
[6.6.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@6.6.0...@metamask/snaps-cli@6.6.1
|
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Commands:
|
|
|
21
21
|
mm-snap build Build snap from source [aliases: b]
|
|
22
22
|
mm-snap eval Attempt to evaluate snap bundle in SES [aliases: e]
|
|
23
23
|
mm-snap manifest Validate the snap.manifest.json file [aliases: m]
|
|
24
|
+
mm-snap sandbox Start a sandbox server to interact with the Snap
|
|
24
25
|
mm-snap serve Locally serve Snap file(s) for testing [aliases: s]
|
|
25
26
|
mm-snap watch Build Snap on change [aliases: w]
|
|
26
27
|
|
package/dist/builders.cjs
CHANGED
package/dist/builders.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.cjs","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE;QACP,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,SAAS;KAChB;IAED,MAAM,EAAE;QACN,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,GAAG,EAAE;QACH,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,GAAY,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACmD,CAAC;AAEvD,kBAAe,QAAQ,CAAC","sourcesContent":["import type { Options } from 'yargs';\n\nconst builders = {\n analyze: {\n describe: 'Analyze the Snap bundle',\n type: 'boolean',\n },\n\n config: {\n alias: 'c',\n describe: 'Path to config file',\n type: 'string',\n normalize: true,\n },\n\n fix: {\n describe: 'Attempt to fix snap.manifest.json',\n type: 'boolean',\n },\n\n input: {\n alias: 'i',\n describe: 'Snap bundle file to evaluate',\n type: 'string',\n normalize: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\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\n return port;\n },\n },\n} as const satisfies Record<string, Readonly<Options>>;\n\nexport default builders;\n"]}
|
|
1
|
+
{"version":3,"file":"builders.cjs","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE;QACP,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd;IAED,MAAM,EAAE;QACN,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,GAAG,EAAE;QACH,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,GAAY,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACmD,CAAC;AAEvD,kBAAe,QAAQ,CAAC","sourcesContent":["import type { Options } from 'yargs';\n\nconst builders = {\n analyze: {\n describe: 'Analyze the Snap bundle',\n type: 'boolean',\n },\n\n build: {\n describe: 'Build the Snap bundle',\n type: 'boolean',\n default: true,\n },\n\n config: {\n alias: 'c',\n describe: 'Path to config file',\n type: 'string',\n normalize: true,\n },\n\n fix: {\n describe: 'Attempt to fix snap.manifest.json',\n type: 'boolean',\n },\n\n input: {\n alias: 'i',\n describe: 'Snap bundle file to evaluate',\n type: 'string',\n normalize: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\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\n return port;\n },\n },\n} as const satisfies Record<string, Readonly<Options>>;\n\nexport default builders;\n"]}
|
package/dist/builders.d.cts
CHANGED
|
@@ -3,6 +3,11 @@ declare const builders: {
|
|
|
3
3
|
readonly describe: "Analyze the Snap bundle";
|
|
4
4
|
readonly type: "boolean";
|
|
5
5
|
};
|
|
6
|
+
readonly build: {
|
|
7
|
+
readonly describe: "Build the Snap bundle";
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly default: true;
|
|
10
|
+
};
|
|
6
11
|
readonly config: {
|
|
7
12
|
readonly alias: "c";
|
|
8
13
|
readonly describe: "Path to config file";
|
package/dist/builders.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.cts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"builders.d.cts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAmCI,OAAO;;CAS6B,CAAC;AAEvD,eAAe,QAAQ,CAAC"}
|
package/dist/builders.d.mts
CHANGED
|
@@ -3,6 +3,11 @@ declare const builders: {
|
|
|
3
3
|
readonly describe: "Analyze the Snap bundle";
|
|
4
4
|
readonly type: "boolean";
|
|
5
5
|
};
|
|
6
|
+
readonly build: {
|
|
7
|
+
readonly describe: "Build the Snap bundle";
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly default: true;
|
|
10
|
+
};
|
|
6
11
|
readonly config: {
|
|
7
12
|
readonly alias: "c";
|
|
8
13
|
readonly describe: "Path to config file";
|
package/dist/builders.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.mts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"builders.d.mts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAmCI,OAAO;;CAS6B,CAAC;AAEvD,eAAe,QAAQ,CAAC"}
|
package/dist/builders.mjs
CHANGED
package/dist/builders.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.mjs","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE;QACP,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,SAAS;KAChB;IAED,MAAM,EAAE;QACN,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,GAAG,EAAE;QACH,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,GAAY,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACmD,CAAC;AAEvD,eAAe,QAAQ,CAAC","sourcesContent":["import type { Options } from 'yargs';\n\nconst builders = {\n analyze: {\n describe: 'Analyze the Snap bundle',\n type: 'boolean',\n },\n\n config: {\n alias: 'c',\n describe: 'Path to config file',\n type: 'string',\n normalize: true,\n },\n\n fix: {\n describe: 'Attempt to fix snap.manifest.json',\n type: 'boolean',\n },\n\n input: {\n alias: 'i',\n describe: 'Snap bundle file to evaluate',\n type: 'string',\n normalize: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\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\n return port;\n },\n },\n} as const satisfies Record<string, Readonly<Options>>;\n\nexport default builders;\n"]}
|
|
1
|
+
{"version":3,"file":"builders.mjs","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE;QACP,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd;IAED,MAAM,EAAE;QACN,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,GAAG,EAAE;QACH,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,SAAS;KAChB;IAED,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;KAChB;IAED,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,GAAY,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACmD,CAAC;AAEvD,eAAe,QAAQ,CAAC","sourcesContent":["import type { Options } from 'yargs';\n\nconst builders = {\n analyze: {\n describe: 'Analyze the Snap bundle',\n type: 'boolean',\n },\n\n build: {\n describe: 'Build the Snap bundle',\n type: 'boolean',\n default: true,\n },\n\n config: {\n alias: 'c',\n describe: 'Path to config file',\n type: 'string',\n normalize: true,\n },\n\n fix: {\n describe: 'Attempt to fix snap.manifest.json',\n type: 'boolean',\n },\n\n input: {\n alias: 'i',\n describe: 'Snap bundle file to evaluate',\n type: 'string',\n normalize: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\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\n return port;\n },\n },\n} as const satisfies Record<string, Readonly<Options>>;\n\nexport default builders;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildHandler = void 0;
|
|
3
|
+
exports.buildHandler = exports.steps = void 0;
|
|
4
4
|
const node_1 = require("@metamask/snaps-utils/node");
|
|
5
5
|
const utils_1 = require("@metamask/utils");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -9,9 +9,10 @@ const utils_2 = require("./utils.cjs");
|
|
|
9
9
|
const errors_1 = require("../../errors.cjs");
|
|
10
10
|
const utils_3 = require("../../utils/index.cjs");
|
|
11
11
|
const eval_1 = require("../eval/index.cjs");
|
|
12
|
-
|
|
12
|
+
exports.steps = [
|
|
13
13
|
{
|
|
14
14
|
name: 'Checking the input file.',
|
|
15
|
+
condition: ({ build }) => build,
|
|
15
16
|
task: async ({ config }) => {
|
|
16
17
|
const { input } = config;
|
|
17
18
|
if (!(await (0, node_1.isFile)(input))) {
|
|
@@ -21,7 +22,8 @@ const steps = [
|
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
name: 'Building the snap bundle.',
|
|
24
|
-
|
|
25
|
+
condition: ({ build }) => build,
|
|
26
|
+
task: async ({ analyze, build: enableBuild, config, spinner }) => {
|
|
25
27
|
// We don't evaluate the bundle here, because it's done in a separate
|
|
26
28
|
// step.
|
|
27
29
|
const compiler = await (0, implementation_1.build)(config, {
|
|
@@ -32,6 +34,7 @@ const steps = [
|
|
|
32
34
|
if (analyze) {
|
|
33
35
|
return {
|
|
34
36
|
analyze,
|
|
37
|
+
build: enableBuild,
|
|
35
38
|
config,
|
|
36
39
|
spinner,
|
|
37
40
|
port: await (0, utils_2.getBundleAnalyzerPort)(compiler),
|
|
@@ -42,7 +45,7 @@ const steps = [
|
|
|
42
45
|
},
|
|
43
46
|
{
|
|
44
47
|
name: 'Evaluating the snap bundle.',
|
|
45
|
-
condition: ({ config }) => config.evaluate,
|
|
48
|
+
condition: ({ build, config }) => build && config.evaluate,
|
|
46
49
|
task: async ({ config, spinner }) => {
|
|
47
50
|
const path = (0, path_1.resolve)(process.cwd(), config.output.path, config.output.filename);
|
|
48
51
|
await (0, eval_1.evaluate)(path);
|
|
@@ -70,7 +73,8 @@ const steps = [
|
|
|
70
73
|
* @returns Nothing.
|
|
71
74
|
*/
|
|
72
75
|
async function buildHandler(config, analyze = false) {
|
|
73
|
-
return await (0, utils_3.executeSteps)(steps, {
|
|
76
|
+
return await (0, utils_3.executeSteps)(exports.steps, {
|
|
77
|
+
build: true,
|
|
74
78
|
config,
|
|
75
79
|
analyze,
|
|
76
80
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.cjs","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,2CAAyC;AACzC,+BAA8C;AAE9C,yDAAyC;AACzC,uCAAgD;AAEhD,6CAA4C;AAE5C,iDAA0D;AAC1D,4CAAmC;
|
|
1
|
+
{"version":3,"file":"build.cjs","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,2CAAyC;AACzC,+BAA8C;AAE9C,yDAAyC;AACzC,uCAAgD;AAEhD,6CAA4C;AAE5C,iDAA0D;AAC1D,4CAAmC;AAStB,QAAA,KAAK,GAAwB;IACxC;QACE,IAAI,EAAE,0BAA0B;QAChC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;QAC/B,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YAEzB,IAAI,CAAC,CAAC,MAAM,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,qBAAY,CACpB,0BAA0B,KAAK,qEAAqE,CACrG,CAAC;YACJ,CAAC;QACH,CAAC;KACF;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;QAC/B,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;YAC/D,qEAAqE;YACrE,QAAQ;YACR,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAK,EAAC,MAAM,EAAE;gBACnC,OAAO;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO;aACR,CAAC,CAAC;YAEH,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,WAAW;oBAClB,MAAM;oBACN,OAAO;oBACP,IAAI,EAAE,MAAM,IAAA,6BAAqB,EAAC,QAAQ,CAAC;iBAC5C,CAAC;YACJ,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;KACF;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ;QAC1D,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;YAClC,MAAM,IAAI,GAAG,IAAA,cAAW,EACtB,OAAO,CAAC,GAAG,EAAE,EACb,MAAM,CAAC,MAAM,CAAC,IAAI,EAClB,MAAM,CAAC,MAAM,CAAC,QAAQ,CACvB,CAAC;YAEF,MAAM,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC;YAErB,IAAA,YAAI,EAAC,qCAAqC,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO;QACnC,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YAChC,IAAA,cAAM,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;YACrC,IAAA,eAAO,EAAC,+CAA+C,IAAI,GAAG,EAAE,OAAO,CAAC,CAAC;YAEzE,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;KACF;CACO,CAAC;AAEX;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAChC,MAAuB,EACvB,OAAO,GAAG,KAAK;IAEf,OAAO,MAAM,IAAA,oBAAY,EAAC,aAAK,EAAE;QAC/B,KAAK,EAAE,IAAI;QACX,MAAM;QACN,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AATD,oCASC","sourcesContent":["import { isFile } from '@metamask/snaps-utils/node';\nimport { assert } from '@metamask/utils';\nimport { resolve as pathResolve } from 'path';\n\nimport { build } from './implementation';\nimport { getBundleAnalyzerPort } from './utils';\nimport type { ProcessedConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { success, executeSteps, info } from '../../utils';\nimport { evaluate } from '../eval';\n\nexport type BuildContext = {\n analyze: boolean;\n build: boolean;\n config: ProcessedConfig;\n port?: number;\n};\n\nexport const steps: Steps<BuildContext> = [\n {\n name: 'Checking the input file.',\n condition: ({ build }) => build,\n task: async ({ config }) => {\n const { input } = config;\n\n if (!(await isFile(input))) {\n throw new CommandError(\n `Input file not found: \"${input}\". Make sure that the \"input\" field in your snap config is correct.`,\n );\n }\n },\n },\n {\n name: 'Building the snap bundle.',\n condition: ({ build }) => build,\n task: async ({ analyze, build: enableBuild, config, spinner }) => {\n // We don't evaluate the bundle here, because it's done in a separate\n // step.\n const compiler = await build(config, {\n analyze,\n evaluate: false,\n spinner,\n });\n\n if (analyze) {\n return {\n analyze,\n build: enableBuild,\n config,\n spinner,\n port: await getBundleAnalyzerPort(compiler),\n };\n }\n\n return undefined;\n },\n },\n {\n name: 'Evaluating the snap bundle.',\n condition: ({ build, config }) => build && config.evaluate,\n task: async ({ config, spinner }) => {\n const path = pathResolve(\n process.cwd(),\n config.output.path,\n config.output.filename,\n );\n\n await evaluate(path);\n\n info(`Snap bundle evaluated successfully.`, spinner);\n },\n },\n {\n name: 'Running analyser.',\n condition: ({ analyze }) => analyze,\n task: async ({ spinner, port }) => {\n assert(port, 'Port is not defined.');\n success(`Bundle analyzer running at http://localhost:${port}.`, spinner);\n\n spinner.stop();\n },\n },\n] as const;\n\n/**\n * Build all files in the given source directory to the given destination\n * directory.\n *\n * This creates the destination directory if it doesn't exist.\n *\n * @param config - The config object.\n * @param analyze - Whether to analyze the bundle.\n * @returns Nothing.\n */\nexport async function buildHandler(\n config: ProcessedConfig,\n analyze = false,\n): Promise<void> {\n return await executeSteps(steps, {\n build: true,\n config,\n analyze,\n });\n}\n"]}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { ProcessedConfig } from "../../config.cjs";
|
|
2
|
+
import type { Steps } from "../../utils/index.cjs";
|
|
3
|
+
export type BuildContext = {
|
|
4
|
+
analyze: boolean;
|
|
5
|
+
build: boolean;
|
|
6
|
+
config: ProcessedConfig;
|
|
7
|
+
port?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const steps: Steps<BuildContext>;
|
|
2
10
|
/**
|
|
3
11
|
* Build all files in the given source directory to the given destination
|
|
4
12
|
* directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.cts","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;
|
|
1
|
+
{"version":3,"file":"build.d.cts","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,8BAAoB;AAIzC,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,YAAY,CAgE5B,CAAC;AAEX;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,eAAe,EACvB,OAAO,UAAQ,GACd,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { ProcessedConfig } from "../../config.mjs";
|
|
2
|
+
import type { Steps } from "../../utils/index.mjs";
|
|
3
|
+
export type BuildContext = {
|
|
4
|
+
analyze: boolean;
|
|
5
|
+
build: boolean;
|
|
6
|
+
config: ProcessedConfig;
|
|
7
|
+
port?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const steps: Steps<BuildContext>;
|
|
2
10
|
/**
|
|
3
11
|
* Build all files in the given source directory to the given destination
|
|
4
12
|
* directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.mts","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;
|
|
1
|
+
{"version":3,"file":"build.d.mts","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,8BAAoB;AAIzC,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,YAAY,CAgE5B,CAAC;AAEX;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,eAAe,EACvB,OAAO,UAAQ,GACd,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -6,9 +6,10 @@ import { getBundleAnalyzerPort } from "./utils.mjs";
|
|
|
6
6
|
import { CommandError } from "../../errors.mjs";
|
|
7
7
|
import { success, executeSteps, info } from "../../utils/index.mjs";
|
|
8
8
|
import { evaluate } from "../eval/index.mjs";
|
|
9
|
-
const steps = [
|
|
9
|
+
export const steps = [
|
|
10
10
|
{
|
|
11
11
|
name: 'Checking the input file.',
|
|
12
|
+
condition: ({ build }) => build,
|
|
12
13
|
task: async ({ config }) => {
|
|
13
14
|
const { input } = config;
|
|
14
15
|
if (!(await isFile(input))) {
|
|
@@ -18,7 +19,8 @@ const steps = [
|
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
name: 'Building the snap bundle.',
|
|
21
|
-
|
|
22
|
+
condition: ({ build }) => build,
|
|
23
|
+
task: async ({ analyze, build: enableBuild, config, spinner }) => {
|
|
22
24
|
// We don't evaluate the bundle here, because it's done in a separate
|
|
23
25
|
// step.
|
|
24
26
|
const compiler = await build(config, {
|
|
@@ -29,6 +31,7 @@ const steps = [
|
|
|
29
31
|
if (analyze) {
|
|
30
32
|
return {
|
|
31
33
|
analyze,
|
|
34
|
+
build: enableBuild,
|
|
32
35
|
config,
|
|
33
36
|
spinner,
|
|
34
37
|
port: await getBundleAnalyzerPort(compiler),
|
|
@@ -39,7 +42,7 @@ const steps = [
|
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
44
|
name: 'Evaluating the snap bundle.',
|
|
42
|
-
condition: ({ config }) => config.evaluate,
|
|
45
|
+
condition: ({ build, config }) => build && config.evaluate,
|
|
43
46
|
task: async ({ config, spinner }) => {
|
|
44
47
|
const path = pathResolve(process.cwd(), config.output.path, config.output.filename);
|
|
45
48
|
await evaluate(path);
|
|
@@ -68,6 +71,7 @@ const steps = [
|
|
|
68
71
|
*/
|
|
69
72
|
export async function buildHandler(config, analyze = false) {
|
|
70
73
|
return await executeSteps(steps, {
|
|
74
|
+
build: true,
|
|
71
75
|
config,
|
|
72
76
|
analyze,
|
|
73
77
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.mjs","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,mCAAmC;AACpD,OAAO,EAAE,MAAM,EAAE,wBAAwB;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,aAAa;AAE9C,OAAO,EAAE,KAAK,EAAE,6BAAyB;AACzC,OAAO,EAAE,qBAAqB,EAAE,oBAAgB;AAEhD,OAAO,EAAE,YAAY,EAAE,yBAAqB;AAE5C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAAoB;AAC1D,OAAO,EAAE,QAAQ,EAAE,0BAAgB;
|
|
1
|
+
{"version":3,"file":"build.mjs","sourceRoot":"","sources":["../../../src/commands/build/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,mCAAmC;AACpD,OAAO,EAAE,MAAM,EAAE,wBAAwB;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,aAAa;AAE9C,OAAO,EAAE,KAAK,EAAE,6BAAyB;AACzC,OAAO,EAAE,qBAAqB,EAAE,oBAAgB;AAEhD,OAAO,EAAE,YAAY,EAAE,yBAAqB;AAE5C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAAoB;AAC1D,OAAO,EAAE,QAAQ,EAAE,0BAAgB;AASnC,MAAM,CAAC,MAAM,KAAK,GAAwB;IACxC;QACE,IAAI,EAAE,0BAA0B;QAChC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;QAC/B,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YAEzB,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,YAAY,CACpB,0BAA0B,KAAK,qEAAqE,CACrG,CAAC;YACJ,CAAC;QACH,CAAC;KACF;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;QAC/B,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;YAC/D,qEAAqE;YACrE,QAAQ;YACR,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;gBACnC,OAAO;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO;aACR,CAAC,CAAC;YAEH,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,WAAW;oBAClB,MAAM;oBACN,OAAO;oBACP,IAAI,EAAE,MAAM,qBAAqB,CAAC,QAAQ,CAAC;iBAC5C,CAAC;YACJ,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;KACF;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ;QAC1D,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;YAClC,MAAM,IAAI,GAAG,WAAW,CACtB,OAAO,CAAC,GAAG,EAAE,EACb,MAAM,CAAC,MAAM,CAAC,IAAI,EAClB,MAAM,CAAC,MAAM,CAAC,QAAQ,CACvB,CAAC;YAEF,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;YAErB,IAAI,CAAC,qCAAqC,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO;QACnC,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YAChC,MAAM,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;YACrC,OAAO,CAAC,+CAA+C,IAAI,GAAG,EAAE,OAAO,CAAC,CAAC;YAEzE,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;KACF;CACO,CAAC;AAEX;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAuB,EACvB,OAAO,GAAG,KAAK;IAEf,OAAO,MAAM,YAAY,CAAC,KAAK,EAAE;QAC/B,KAAK,EAAE,IAAI;QACX,MAAM;QACN,OAAO;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { isFile } from '@metamask/snaps-utils/node';\nimport { assert } from '@metamask/utils';\nimport { resolve as pathResolve } from 'path';\n\nimport { build } from './implementation';\nimport { getBundleAnalyzerPort } from './utils';\nimport type { ProcessedConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { success, executeSteps, info } from '../../utils';\nimport { evaluate } from '../eval';\n\nexport type BuildContext = {\n analyze: boolean;\n build: boolean;\n config: ProcessedConfig;\n port?: number;\n};\n\nexport const steps: Steps<BuildContext> = [\n {\n name: 'Checking the input file.',\n condition: ({ build }) => build,\n task: async ({ config }) => {\n const { input } = config;\n\n if (!(await isFile(input))) {\n throw new CommandError(\n `Input file not found: \"${input}\". Make sure that the \"input\" field in your snap config is correct.`,\n );\n }\n },\n },\n {\n name: 'Building the snap bundle.',\n condition: ({ build }) => build,\n task: async ({ analyze, build: enableBuild, config, spinner }) => {\n // We don't evaluate the bundle here, because it's done in a separate\n // step.\n const compiler = await build(config, {\n analyze,\n evaluate: false,\n spinner,\n });\n\n if (analyze) {\n return {\n analyze,\n build: enableBuild,\n config,\n spinner,\n port: await getBundleAnalyzerPort(compiler),\n };\n }\n\n return undefined;\n },\n },\n {\n name: 'Evaluating the snap bundle.',\n condition: ({ build, config }) => build && config.evaluate,\n task: async ({ config, spinner }) => {\n const path = pathResolve(\n process.cwd(),\n config.output.path,\n config.output.filename,\n );\n\n await evaluate(path);\n\n info(`Snap bundle evaluated successfully.`, spinner);\n },\n },\n {\n name: 'Running analyser.',\n condition: ({ analyze }) => analyze,\n task: async ({ spinner, port }) => {\n assert(port, 'Port is not defined.');\n success(`Bundle analyzer running at http://localhost:${port}.`, spinner);\n\n spinner.stop();\n },\n },\n] as const;\n\n/**\n * Build all files in the given source directory to the given destination\n * directory.\n *\n * This creates the destination directory if it doesn't exist.\n *\n * @param config - The config object.\n * @param analyze - Whether to analyze the bundle.\n * @returns Nothing.\n */\nexport async function buildHandler(\n config: ProcessedConfig,\n analyze = false,\n): Promise<void> {\n return await executeSteps(steps, {\n build: true,\n config,\n analyze,\n });\n}\n"]}
|
|
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.steps = void 0;
|
|
20
21
|
const build_1 = require("./build.cjs");
|
|
21
22
|
const builders_1 = __importDefault(require("../../builders.cjs"));
|
|
22
23
|
const command = {
|
|
@@ -29,5 +30,7 @@ const command = {
|
|
|
29
30
|
handler: async (argv) => (0, build_1.buildHandler)(argv.context.config, argv.analyze),
|
|
30
31
|
};
|
|
31
32
|
__exportStar(require("./implementation.cjs"), exports);
|
|
33
|
+
var build_2 = require("./build.cjs");
|
|
34
|
+
Object.defineProperty(exports, "steps", { enumerable: true, get: function () { return build_2.steps; } });
|
|
32
35
|
exports.default = command;
|
|
33
36
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,uCAAuC;AACvC,kEAAsC;AAGtC,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;IACvB,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI;aACD,MAAM,CAAC,SAAS,EAAE,kBAAQ,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,CACjC,IAAA,oBAAY,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;CAClD,CAAC;AAEF,uDAAiC;AACjC,qCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,kBAAe,OAAO,CAAC","sourcesContent":["import type yargs from 'yargs';\n\nimport { buildHandler } from './build';\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\n\nconst command = {\n command: ['build', 'b'],\n desc: 'Build snap from source',\n builder: (yarg: yargs.Argv) => {\n yarg\n .option('analyze', builders.analyze)\n },\n handler: async (argv: YargsArgs) =>\n buildHandler(argv.context.config, argv.analyze),\n};\n\nexport * from './implementation';\nexport { steps } from './build';\nexport default command;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAIJ,SAAS;CAEhC,CAAC;AAEF,qCAAiC;AACjC,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAIJ,SAAS;CAEhC,CAAC;AAEF,qCAAiC;AACjC,OAAO,EAAE,KAAK,EAAE,oBAAgB;AAChC,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAIJ,SAAS;CAEhC,CAAC;AAEF,qCAAiC;AACjC,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAIJ,SAAS;CAEhC,CAAC;AAEF,qCAAiC;AACjC,OAAO,EAAE,KAAK,EAAE,oBAAgB;AAChC,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,oBAAgB;AACvC,OAAO,QAAQ,2BAAuB;AAGtC,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;IACvB,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI;aACD,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,CACjC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;CAClD,CAAC;AAEF,qCAAiC;AACjC,eAAe,OAAO,CAAC","sourcesContent":["import type yargs from 'yargs';\n\nimport { buildHandler } from './build';\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\n\nconst command = {\n command: ['build', 'b'],\n desc: 'Build snap from source',\n builder: (yarg: yargs.Argv) => {\n yarg\n .option('analyze', builders.analyze)\n },\n handler: async (argv: YargsArgs) =>\n buildHandler(argv.context.config, argv.analyze),\n};\n\nexport * from './implementation';\nexport default command;\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/commands/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,oBAAgB;AACvC,OAAO,QAAQ,2BAAuB;AAGtC,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;IACvB,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI;aACD,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,CACjC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;CAClD,CAAC;AAEF,qCAAiC;AACjC,OAAO,EAAE,KAAK,EAAE,oBAAgB;AAChC,eAAe,OAAO,CAAC","sourcesContent":["import type yargs from 'yargs';\n\nimport { buildHandler } from './build';\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\n\nconst command = {\n command: ['build', 'b'],\n desc: 'Build snap from source',\n builder: (yarg: yargs.Argv) => {\n yarg\n .option('analyze', builders.analyze)\n },\n handler: async (argv: YargsArgs) =>\n buildHandler(argv.context.config, argv.analyze),\n};\n\nexport * from './implementation';\nexport { steps } from './build';\nexport default command;\n"]}
|
package/dist/commands/index.cjs
CHANGED
|
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const build_1 = __importDefault(require("./build/index.cjs"));
|
|
7
7
|
const eval_1 = __importDefault(require("./eval/index.cjs"));
|
|
8
8
|
const manifest_1 = __importDefault(require("./manifest/index.cjs"));
|
|
9
|
+
const sandbox_1 = __importDefault(require("./sandbox/index.cjs"));
|
|
9
10
|
const serve_1 = __importDefault(require("./serve/index.cjs"));
|
|
10
11
|
const watch_1 = __importDefault(require("./watch/index.cjs"));
|
|
11
12
|
const commands = [
|
|
12
13
|
build_1.default,
|
|
13
14
|
eval_1.default,
|
|
14
15
|
manifest_1.default,
|
|
16
|
+
sandbox_1.default,
|
|
15
17
|
serve_1.default,
|
|
16
18
|
watch_1.default,
|
|
17
19
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAmC;AACnC,4DAAqC;AACrC,oEAAyC;AACzC,8DAAmC;AACnC,8DAAmC;AAEnC,MAAM,QAAQ,GAAG;IACf,eAAY;IACZ,cAAe;IACf,kBAAe;IACf,eAAY;IACZ,eAAY;CACb,CAAC;AAEF,kBAAe,QAAQ,CAAC","sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAmC;AACnC,4DAAqC;AACrC,oEAAyC;AACzC,kEAAuC;AACvC,8DAAmC;AACnC,8DAAmC;AAEnC,MAAM,QAAQ,GAAG;IACf,eAAY;IACZ,cAAe;IACf,kBAAe;IACf,iBAAc;IACd,eAAY;IACZ,eAAY;CACb,CAAC;AAEF,kBAAe,QAAQ,CAAC","sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport sandboxCommand from './sandbox';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n sandboxCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";AAOA,QAAA,MAAM,QAAQ;;;;;GAOb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";AAOA,QAAA,MAAM,QAAQ;;;;;GAOb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/commands/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import buildCommand from "./build/index.mjs";
|
|
2
2
|
import evaluateCommand from "./eval/index.mjs";
|
|
3
3
|
import manifestCommand from "./manifest/index.mjs";
|
|
4
|
+
import sandboxCommand from "./sandbox/index.mjs";
|
|
4
5
|
import serveCommand from "./serve/index.mjs";
|
|
5
6
|
import watchCommand from "./watch/index.mjs";
|
|
6
7
|
const commands = [
|
|
7
8
|
buildCommand,
|
|
8
9
|
evaluateCommand,
|
|
9
10
|
manifestCommand,
|
|
11
|
+
sandboxCommand,
|
|
10
12
|
serveCommand,
|
|
11
13
|
watchCommand,
|
|
12
14
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,0BAAgB;AACnC,OAAO,eAAe,yBAAe;AACrC,OAAO,eAAe,6BAAmB;AACzC,OAAO,YAAY,0BAAgB;AACnC,OAAO,YAAY,0BAAgB;AAEnC,MAAM,QAAQ,GAAG;IACf,YAAY;IACZ,eAAe;IACf,eAAe;IACf,YAAY;IACZ,YAAY;CACb,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,0BAAgB;AACnC,OAAO,eAAe,yBAAe;AACrC,OAAO,eAAe,6BAAmB;AACzC,OAAO,cAAc,4BAAkB;AACvC,OAAO,YAAY,0BAAgB;AACnC,OAAO,YAAY,0BAAgB;AAEnC,MAAM,QAAQ,GAAG;IACf,YAAY;IACZ,eAAe;IACf,eAAe;IACf,cAAc;IACd,YAAY;IACZ,YAAY;CACb,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport sandboxCommand from './sandbox';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n sandboxCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const sandbox_1 = require("./sandbox.cjs");
|
|
7
|
+
const builders_1 = __importDefault(require("../../builders.cjs"));
|
|
8
|
+
const command = {
|
|
9
|
+
command: ['sandbox'],
|
|
10
|
+
desc: 'Start a sandbox server to interact with the Snap',
|
|
11
|
+
builder: (yarg) => {
|
|
12
|
+
yarg.option('build', builders_1.default.build);
|
|
13
|
+
},
|
|
14
|
+
handler: async (argv) => (0, sandbox_1.sandboxHandler)(argv.context.config, { build: argv.build }),
|
|
15
|
+
};
|
|
16
|
+
exports.default = command;
|
|
17
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/commands/sandbox/index.ts"],"names":[],"mappings":";;;;;AAEA,2CAA2C;AAC3C,kEAAsC;AAGtC,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,IAAI,EAAE,kDAAkD;IACxD,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,CACjC,IAAA,wBAAc,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;CAC7D,CAAC;AAEF,kBAAe,OAAO,CAAC","sourcesContent":["import type yargs from 'yargs';\n\nimport { sandboxHandler } from './sandbox';\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\n\nconst command = {\n command: ['sandbox'],\n desc: 'Start a sandbox server to interact with the Snap',\n builder: (yarg: yargs.Argv) => {\n yarg.option('build', builders.build);\n },\n handler: async (argv: YargsArgs) =>\n sandboxHandler(argv.context.config, { build: argv.build }),\n};\n\nexport default command;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type yargs from "yargs";
|
|
2
|
+
import type { YargsArgs } from "../../types/yargs.d.cjs";
|
|
3
|
+
declare const command: {
|
|
4
|
+
command: string[];
|
|
5
|
+
desc: string;
|
|
6
|
+
builder: (yarg: yargs.Argv) => void;
|
|
7
|
+
handler: (argv: YargsArgs) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export default command;
|
|
10
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/commands/sandbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAGJ,SAAS;CAEhC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type yargs from "yargs";
|
|
2
|
+
import type { YargsArgs } from "../../types/yargs.d.mjs";
|
|
3
|
+
declare const command: {
|
|
4
|
+
command: string[];
|
|
5
|
+
desc: string;
|
|
6
|
+
builder: (yarg: yargs.Argv) => void;
|
|
7
|
+
handler: (argv: YargsArgs) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export default command;
|
|
10
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/commands/sandbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,gCAA0B;AAEnD,QAAA,MAAM,OAAO;;;oBAGK,MAAM,IAAI;oBAGJ,SAAS;CAEhC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { sandboxHandler } from "./sandbox.mjs";
|
|
2
|
+
import builders from "../../builders.mjs";
|
|
3
|
+
const command = {
|
|
4
|
+
command: ['sandbox'],
|
|
5
|
+
desc: 'Start a sandbox server to interact with the Snap',
|
|
6
|
+
builder: (yarg) => {
|
|
7
|
+
yarg.option('build', builders.build);
|
|
8
|
+
},
|
|
9
|
+
handler: async (argv) => sandboxHandler(argv.context.config, { build: argv.build }),
|
|
10
|
+
};
|
|
11
|
+
export default command;
|
|
12
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/commands/sandbox/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,sBAAkB;AAC3C,OAAO,QAAQ,2BAAuB;AAGtC,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,IAAI,EAAE,kDAAkD;IACxD,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,CACjC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;CAC7D,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import type yargs from 'yargs';\n\nimport { sandboxHandler } from './sandbox';\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\n\nconst command = {\n command: ['sandbox'],\n desc: 'Start a sandbox server to interact with the Snap',\n builder: (yarg: yargs.Argv) => {\n yarg.option('build', builders.build);\n },\n handler: async (argv: YargsArgs) =>\n sandboxHandler(argv.context.config, { build: argv.build }),\n};\n\nexport default command;\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sandboxHandler = void 0;
|
|
4
|
+
const server_1 = require("./server.cjs");
|
|
5
|
+
const utils_1 = require("../../utils/index.cjs");
|
|
6
|
+
const build_1 = require("../build/index.cjs");
|
|
7
|
+
const steps = [
|
|
8
|
+
...build_1.steps,
|
|
9
|
+
{
|
|
10
|
+
name: 'Running sandbox.',
|
|
11
|
+
task: async ({ config, spinner }) => {
|
|
12
|
+
const { port } = await (0, server_1.startSandbox)(config);
|
|
13
|
+
(0, utils_1.success)(`Sandbox running at http://localhost:${port}.`, spinner);
|
|
14
|
+
spinner.stop();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Start the sandbox.
|
|
20
|
+
*
|
|
21
|
+
* @param config - The config object.
|
|
22
|
+
* @param options - The options object.
|
|
23
|
+
* @param options.build - Whether to build the Snap before starting the sandbox.
|
|
24
|
+
*/
|
|
25
|
+
async function sandboxHandler(config, { build = true }) {
|
|
26
|
+
await (0, utils_1.executeSteps)(steps, {
|
|
27
|
+
analyze: false,
|
|
28
|
+
build,
|
|
29
|
+
config,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
exports.sandboxHandler = sandboxHandler;
|
|
33
|
+
//# sourceMappingURL=sandbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.cjs","sourceRoot":"","sources":["../../../src/commands/sandbox/sandbox.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAGxC,iDAAoD;AACpD,8CAA+C;AAS/C,MAAM,KAAK,GAA0B;IACnC,GAAG,aAAU;IACb;QACE,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;YAC5C,IAAA,eAAO,EAAC,uCAAuC,IAAI,GAAG,EAAE,OAAO,CAAC,CAAC;YAEjE,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;KACF;CACF,CAAC;AAEF;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,MAAuB,EACvB,EAAE,KAAK,GAAG,IAAI,EAAkB;IAEhC,MAAM,IAAA,oBAAY,EAAC,KAAK,EAAE;QACxB,OAAO,EAAE,KAAK;QACd,KAAK;QACL,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AATD,wCASC","sourcesContent":["import { startSandbox } from './server';\nimport type { ProcessedConfig } from '../../config';\nimport type { Steps } from '../../utils';\nimport { success, executeSteps } from '../../utils';\nimport { steps as buildSteps } from '../build';\nimport type { BuildContext } from '../build/build';\n\ntype SandboxOptions = {\n build?: boolean;\n};\n\ntype SandboxContext = BuildContext;\n\nconst steps: Steps<SandboxContext> = [\n ...buildSteps,\n {\n name: 'Running sandbox.',\n task: async ({ config, spinner }) => {\n const { port } = await startSandbox(config);\n success(`Sandbox running at http://localhost:${port}.`, spinner);\n\n spinner.stop();\n },\n },\n];\n\n/**\n * Start the sandbox.\n *\n * @param config - The config object.\n * @param options - The options object.\n * @param options.build - Whether to build the Snap before starting the sandbox.\n */\nexport async function sandboxHandler(\n config: ProcessedConfig,\n { build = true }: SandboxOptions,\n) {\n await executeSteps(steps, {\n analyze: false,\n build,\n config,\n });\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProcessedConfig } from "../../config.cjs";
|
|
2
|
+
type SandboxOptions = {
|
|
3
|
+
build?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Start the sandbox.
|
|
7
|
+
*
|
|
8
|
+
* @param config - The config object.
|
|
9
|
+
* @param options - The options object.
|
|
10
|
+
* @param options.build - Whether to build the Snap before starting the sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sandboxHandler(config: ProcessedConfig, { build }: SandboxOptions): Promise<void>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=sandbox.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.d.cts","sourceRoot":"","sources":["../../../src/commands/sandbox/sandbox.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AAMpD,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAiBF;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,EAAE,KAAY,EAAE,EAAE,cAAc,iBAOjC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProcessedConfig } from "../../config.mjs";
|
|
2
|
+
type SandboxOptions = {
|
|
3
|
+
build?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Start the sandbox.
|
|
7
|
+
*
|
|
8
|
+
* @param config - The config object.
|
|
9
|
+
* @param options - The options object.
|
|
10
|
+
* @param options.build - Whether to build the Snap before starting the sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sandboxHandler(config: ProcessedConfig, { build }: SandboxOptions): Promise<void>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=sandbox.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.d.mts","sourceRoot":"","sources":["../../../src/commands/sandbox/sandbox.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AAMpD,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAiBF;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,EAAE,KAAY,EAAE,EAAE,cAAc,iBAOjC"}
|