@metamask/snaps-cli 0.22.2 → 0.23.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/README.md +6 -6
- package/dist/__mocks__/fs.d.ts +2 -0
- package/dist/__mocks__/fs.js +4 -0
- package/dist/__mocks__/fs.js.map +1 -0
- package/dist/builders.d.ts +2 -6
- package/dist/builders.js +3 -12
- package/dist/builders.js.map +1 -1
- package/dist/cmds/init/index.js +3 -12
- package/dist/cmds/init/index.js.map +1 -1
- package/dist/cmds/init/initHandler.d.ts +5 -9
- package/dist/cmds/init/initHandler.js +34 -89
- package/dist/cmds/init/initHandler.js.map +1 -1
- package/dist/cmds/init/initUtils.d.ts +25 -32
- package/dist/cmds/init/initUtils.js +85 -249
- package/dist/cmds/init/initUtils.js.map +1 -1
- package/dist/test-utils/fs.d.ts +5 -0
- package/dist/test-utils/fs.js +18 -0
- package/dist/test-utils/fs.js.map +1 -0
- package/dist/test-utils/index.d.ts +1 -0
- package/dist/test-utils/index.js +18 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/snap-config.d.ts +21 -4
- package/dist/utils/snap-config.js +20 -3
- package/dist/utils/snap-config.js.map +1 -1
- package/package.json +11 -18
- package/dist/cmds/init/init-template.json +0 -8
- package/dist/tsconfig.json +0 -8
- package/dist/utils/readline.d.ts +0 -37
- package/dist/utils/readline.js +0 -75
- package/dist/utils/readline.js.map +0 -1
- package/dist/utils/snap-config.__GENERATED__.d.ts +0 -2
- package/dist/utils/snap-config.__GENERATED__.js +0 -18
- package/dist/utils/snap-config.__GENERATED__.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "A CLI for developing MetaMask Snaps.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,18 +15,15 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"shasum": "node ./scripts/computeSnapShasum.js",
|
|
18
|
-
"build:init-template": "node ./scripts/createInitTemplate.js && yarn prettier --check src/cmds/init/init-template.json",
|
|
19
|
-
"build:guards": "ts-auto-guard --guard-file-name=__GENERATED__ ./src/utils/snap-config.ts",
|
|
20
18
|
"build:tsc": "tsc --project ./tsconfig.local.json",
|
|
21
19
|
"build:chmod": "chmod +x ./dist/main.js",
|
|
22
20
|
"build:readme": "node ./scripts/updateReadme.js",
|
|
23
|
-
"build": "yarn build:
|
|
24
|
-
"build:pre-tsc": "yarn build:init-template && yarn build:guards",
|
|
21
|
+
"build": "yarn build:tsc && yarn build:post-tsc",
|
|
25
22
|
"build:post-tsc": "yarn build:chmod && yarn build:readme",
|
|
26
23
|
"build:clean": "yarn clean && yarn build",
|
|
27
24
|
"build:watch": "tsc-watch --onSuccess 'yarn build:chmod'",
|
|
28
|
-
"clean": "rimraf '*.tsbuildinfo' 'dist/*'
|
|
29
|
-
"test": "
|
|
25
|
+
"clean": "rimraf '*.tsbuildinfo' 'dist/*'",
|
|
26
|
+
"test": "jest",
|
|
30
27
|
"posttest": "jest-it-up",
|
|
31
28
|
"test:watch": "yarn test --watch",
|
|
32
29
|
"test:ci": "yarn test",
|
|
@@ -46,18 +43,16 @@
|
|
|
46
43
|
"@babel/plugin-transform-runtime": "^7.16.7",
|
|
47
44
|
"@babel/preset-env": "^7.16.7",
|
|
48
45
|
"@babel/preset-typescript": "^7.16.7",
|
|
49
|
-
"@metamask/snap-utils": "^0.
|
|
50
|
-
"@metamask/snaps-browserify-plugin": "^0.
|
|
51
|
-
"@metamask/utils": "^3.
|
|
46
|
+
"@metamask/snap-utils": "^0.23.0",
|
|
47
|
+
"@metamask/snaps-browserify-plugin": "^0.23.0",
|
|
48
|
+
"@metamask/utils": "^3.3.0",
|
|
52
49
|
"babelify": "^10.0.0",
|
|
53
50
|
"browserify": "^17.0.0",
|
|
54
51
|
"chokidar": "^3.5.2",
|
|
55
|
-
"init-package-json": "^1.10.3",
|
|
56
52
|
"is-url": "^1.2.4",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"slash": "^3.0.0",
|
|
53
|
+
"serve-handler": "^6.1.5",
|
|
54
|
+
"ses": "^0.17.0",
|
|
55
|
+
"superstruct": "^0.16.7",
|
|
61
56
|
"yargs": "^16.2.0",
|
|
62
57
|
"yargs-parser": "^20.2.2"
|
|
63
58
|
},
|
|
@@ -69,10 +64,8 @@
|
|
|
69
64
|
"@metamask/eslint-config-nodejs": "^9.0.0",
|
|
70
65
|
"@metamask/eslint-config-typescript": "^9.0.1",
|
|
71
66
|
"@types/browserify": "^12.0.36",
|
|
72
|
-
"@types/init-package-json": "^1.10.0",
|
|
73
67
|
"@types/is-url": "^1.2.28",
|
|
74
68
|
"@types/jest": "^27.5.1",
|
|
75
|
-
"@types/mkdirp": "^1.0.2",
|
|
76
69
|
"@types/node": "^14.14.25",
|
|
77
70
|
"@types/rimraf": "^3.0.0",
|
|
78
71
|
"@types/serve-handler": "^6.1.0",
|
|
@@ -90,10 +83,10 @@
|
|
|
90
83
|
"execa": "^5.1.1",
|
|
91
84
|
"jest": "^29.0.2",
|
|
92
85
|
"jest-it-up": "^2.0.0",
|
|
86
|
+
"memfs": "^3.4.10",
|
|
93
87
|
"prettier": "^2.3.2",
|
|
94
88
|
"prettier-plugin-packagejson": "^2.2.11",
|
|
95
89
|
"rimraf": "^3.0.2",
|
|
96
|
-
"ts-auto-guard": "^2.3.0",
|
|
97
90
|
"ts-jest": "^29.0.0",
|
|
98
91
|
"ts-node": "^10.7.0",
|
|
99
92
|
"tsc-watch": "^4.5.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"html": "<!doctype html>\n<html>\n <head>\n <title>Hello, Snaps!</title>\n <link rel=\"icon\" type=\"image/svg\" href=\"./images/icon.svg\"/>\n </head>\n\n <body>\n <h1>Hello, Snaps!</h1>\n <details>\n <summary>Instructions</summary>\n <ul>\n <li>First, click \"Connect\". Then, try out the other buttons!</li>\n <li>Please note that:</li>\n <ul>\n <li>\n The <code>snap.manifest.json</code> and <code>package.json</code> must be located in the server root directory..\n </li>\n <li>\n The Snap bundle must be hosted at the location specified by the <code>location</code> field of <code>snap.manifest.json</code>.\n </li>\n </ul>\n </ul>\n </details>\n <br/>\n\n <button class=\"connect\">Connect</button>\n <button class=\"sendHello\">Send Hello</button>\n </body>\n\n <script>\n const snapId = `local:${window.location.href}`;\n\n const connectButton = document.querySelector('button.connect')\n const sendButton = document.querySelector('button.sendHello')\n\n connectButton.addEventListener('click', connect)\n sendButton.addEventListener('click', send)\n\n // here we get permissions to interact with and install the snap\n async function connect () {\n await ethereum.request({\n method: 'wallet_enable',\n params: [{\n wallet_snap: { [snapId]: {} },\n }]\n })\n }\n\n // here we call the snap's \"hello\" method\n async function send () {\n try {\n const response = await ethereum.request({\n method: 'wallet_invokeSnap',\n params: [snapId, {\n method: 'hello'\n }]\n })\n } catch (err) {\n console.error(err)\n alert('Problem happened: ' + err.message || err)\n }\n }\n </script>\n</html>\n",
|
|
3
|
-
"source": "module.exports.onRpcRequest = async ({ origin, request }) => {\n switch (request.method) {\n case 'hello':\n return wallet.request({\n method: 'snap_confirm',\n params: [\n {\n prompt: `Hello, ${origin}!`,\n description:\n 'This custom confirmation is just for display purposes.',\n textAreaContent:\n 'But you can edit the snap source code to make it do something, if you want to!',\n },\n ],\n });\n default:\n throw new Error('Method not found.');\n }\n};\n",
|
|
4
|
-
"typescriptHtml": "<!doctype html>\n<html>\n </head>\n <title>Hello, Snaps!</title>\n <link rel=\"icon\" type=\"image/svg\" href=\"./images/icon.svg\"/>\n </head>\n\n <body>\n <h1>Hello, Snaps!</h1>\n <details>\n <summary>Instructions</summary>\n <ul>\n <li>First, click \"Connect\". Then, try out the other buttons!</li>\n <li>Please note that:</li>\n <ul>\n <li>\n The <code>snap.manifest.json</code> and <code>package.json</code> must be located in the server root directory...\n </li>\n <li>\n The Snap bundle must be hosted at the location specified by the <code>location</code> field of <code>snap.manifest.json</code>.\n </li>\n </ul>\n </ul>\n </details>\n <br/>\n\n <button class=\"connect\">Connect</button>\n <button class=\"sendHello\">Send Hello</button>\n </body>\n\n <script>\n const snapId = `local:${window.location.href}`;\n\n const connectButton = document.querySelector('button.connect')\n const sendButton = document.querySelector('button.sendHello')\n\n connectButton.addEventListener('click', connect)\n sendButton.addEventListener('click', send)\n\n // here we get permissions to interact with and install the snap\n async function connect () {\n await ethereum.request({\n method: 'wallet_enable',\n params: [{\n wallet_snap: { [snapId]: {} },\n }]\n })\n }\n\n // here we call the snap's \"hello\" method\n async function send () {\n try {\n await ethereum.request({\n method: 'wallet_invokeSnap',\n params: [snapId, {\n method: 'hello'\n }]\n })\n } catch (err) {\n console.error(err)\n alert('Problem happened: ' + err.message || err)\n }\n }\n </script>\n</html>\n",
|
|
5
|
-
"typescriptSource": "import { OnRpcRequestHandler } from '@metamask/snap-types';\n\nexport const onRpcRequest: OnRpcRequestHandler = ({ origin, request }) => {\n switch (request.method) {\n case 'hello':\n return wallet.request({\n method: 'snap_confirm',\n params: [\n {\n prompt: `Hello, ${origin}!`,\n description:\n 'This custom confirmation is just for display purposes.',\n textAreaContent:\n 'But you can edit the snap source code to make it do something, if you want to!',\n },\n ],\n });\n default:\n throw new Error('Method not found.');\n }\n};\n",
|
|
6
|
-
"typescriptConfig": "{\n \"extends\": \"../../../../tsconfig.packages.json\",\n \"compilerOptions\": {\n \"typeRoots\": [\"../../../../node_modules/@types\"]\n },\n \"files\": [\"./node_modules/@metamask/snap-types/global.d.ts\"],\n \"include\": [\"src\"]\n}\n",
|
|
7
|
-
"icon": "<svg width=\"24\" height=\"25\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.037 0H6.975C2.605 0 0 2.617 0 6.987v10.05c0 4.37 2.605 6.975 6.975 6.975h10.05c4.37 0 6.975-2.605 6.975-6.976V6.988C24.012 2.617 21.407 0 17.037 0ZM11.49 17.757c0 .36-.18.684-.492.876a.975.975 0 0 1-.54.156 1.11 1.11 0 0 1-.469-.108l-4.202-2.1a1.811 1.811 0 0 1-.985-1.61v-3.973c0-.36.18-.685.493-.877a1.04 1.04 0 0 1 1.008-.048l4.202 2.101a1.8 1.8 0 0 1 .997 1.609v3.974h-.012Zm-.252-6.423L6.723 8.896a1.045 1.045 0 0 1-.528-.924c0-.384.204-.744.528-.924l4.515-2.438a1.631 1.631 0 0 1 1.524 0l4.515 2.438c.324.18.528.528.528.924s-.204.744-.528.924l-4.515 2.438c-.24.132-.504.192-.768.192a1.54 1.54 0 0 1-.756-.192Zm7.972 3.638c0 .684-.385 1.308-.997 1.608l-4.202 2.101c-.144.072-.3.108-.468.108a.975.975 0 0 1-.54-.156 1.017 1.017 0 0 1-.493-.876v-3.974c0-.684.384-1.309.997-1.609l4.202-2.101a1.04 1.04 0 0 1 1.008.048c.313.192.493.516.493.877v3.974Z\" fill=\"#24272A\"/></svg>"
|
|
8
|
-
}
|
package/dist/tsconfig.json
DELETED
package/dist/utils/readline.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import readline from 'readline';
|
|
3
|
-
declare type PromptArgs = {
|
|
4
|
-
question: string;
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
shouldClose?: boolean;
|
|
7
|
-
readlineInterface?: readline.Interface;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Open a readline interface, to prompt for user input. Avoid using this
|
|
11
|
-
* function directly. Use the {@link prompt} function instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare function openPrompt(): void;
|
|
14
|
-
/**
|
|
15
|
-
* Prompt for user input on the command line. If the prompt isn't open, it will
|
|
16
|
-
* be opened.
|
|
17
|
-
*
|
|
18
|
-
* @param args - The prompt arguments.
|
|
19
|
-
* @param args.question - The question to ask.
|
|
20
|
-
* @param args.defaultValue - The default value to use, if no answer is provided.
|
|
21
|
-
* @param args.shouldClose - Whether to close the readline interface after
|
|
22
|
-
* prompting.
|
|
23
|
-
* @param args.readlineInterface - The readline interface to use. Uses the
|
|
24
|
-
* global readline interface if none provided.
|
|
25
|
-
* @returns The user's input, or the default value if none provided.
|
|
26
|
-
*/
|
|
27
|
-
export declare function prompt({ question, defaultValue, shouldClose, readlineInterface, }: PromptArgs): Promise<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Close the readline interface.
|
|
30
|
-
*
|
|
31
|
-
* @param readlineInterface - The readline interface to close. Uses the global
|
|
32
|
-
* readline interface if none provided.
|
|
33
|
-
* @throws If no readline interface is provided, and the global interface isn't
|
|
34
|
-
* open.
|
|
35
|
-
*/
|
|
36
|
-
export declare function closePrompt(readlineInterface?: readline.Interface): void;
|
|
37
|
-
export {};
|
package/dist/utils/readline.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
exports.closePrompt = exports.prompt = exports.openPrompt = void 0;
|
|
7
|
-
const readline_1 = __importDefault(require("readline"));
|
|
8
|
-
let singletonReadlineInterface;
|
|
9
|
-
/**
|
|
10
|
-
* Open a readline interface, to prompt for user input. Avoid using this
|
|
11
|
-
* function directly. Use the {@link prompt} function instead.
|
|
12
|
-
*/
|
|
13
|
-
function openPrompt() {
|
|
14
|
-
singletonReadlineInterface = readline_1.default.createInterface({
|
|
15
|
-
input: process.stdin,
|
|
16
|
-
output: process.stdout,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
exports.openPrompt = openPrompt;
|
|
20
|
-
/**
|
|
21
|
-
* Prompt for user input on the command line. If the prompt isn't open, it will
|
|
22
|
-
* be opened.
|
|
23
|
-
*
|
|
24
|
-
* @param args - The prompt arguments.
|
|
25
|
-
* @param args.question - The question to ask.
|
|
26
|
-
* @param args.defaultValue - The default value to use, if no answer is provided.
|
|
27
|
-
* @param args.shouldClose - Whether to close the readline interface after
|
|
28
|
-
* prompting.
|
|
29
|
-
* @param args.readlineInterface - The readline interface to use. Uses the
|
|
30
|
-
* global readline interface if none provided.
|
|
31
|
-
* @returns The user's input, or the default value if none provided.
|
|
32
|
-
*/
|
|
33
|
-
function prompt({ question, defaultValue, shouldClose, readlineInterface = singletonReadlineInterface, }) {
|
|
34
|
-
let _readlineInterface = readlineInterface;
|
|
35
|
-
if (!_readlineInterface) {
|
|
36
|
-
openPrompt();
|
|
37
|
-
_readlineInterface = singletonReadlineInterface;
|
|
38
|
-
}
|
|
39
|
-
return new Promise((resolve, _reject) => {
|
|
40
|
-
let queryString = `${question} `;
|
|
41
|
-
if (defaultValue) {
|
|
42
|
-
queryString += `(${defaultValue}) `;
|
|
43
|
-
}
|
|
44
|
-
_readlineInterface.question(queryString, (answer) => {
|
|
45
|
-
if (!answer || !answer.trim()) {
|
|
46
|
-
if (defaultValue !== undefined) {
|
|
47
|
-
resolve(defaultValue);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
resolve(answer.trim());
|
|
51
|
-
if (shouldClose) {
|
|
52
|
-
_readlineInterface.close();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.prompt = prompt;
|
|
58
|
-
/**
|
|
59
|
-
* Close the readline interface.
|
|
60
|
-
*
|
|
61
|
-
* @param readlineInterface - The readline interface to close. Uses the global
|
|
62
|
-
* readline interface if none provided.
|
|
63
|
-
* @throws If no readline interface is provided, and the global interface isn't
|
|
64
|
-
* open.
|
|
65
|
-
*/
|
|
66
|
-
function closePrompt(readlineInterface = singletonReadlineInterface) {
|
|
67
|
-
if (readlineInterface) {
|
|
68
|
-
readlineInterface.close();
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
throw new Error('You are attempting to close a non existent prompt.');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.closePrompt = closePrompt;
|
|
75
|
-
//# sourceMappingURL=readline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readline.js","sourceRoot":"","sources":["../../src/utils/readline.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAEhC,IAAI,0BAA8C,CAAC;AASnD;;;GAGG;AACH,SAAgB,UAAU;IACxB,0BAA0B,GAAG,kBAAQ,CAAC,eAAe,CAAC;QACpD,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC;AALD,gCAKC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,iBAAiB,GAAG,0BAA0B,GACnC;IACX,IAAI,kBAAkB,GAAG,iBAAiB,CAAC;IAC3C,IAAI,CAAC,kBAAkB,EAAE;QACvB,UAAU,EAAE,CAAC;QACb,kBAAkB,GAAG,0BAA0B,CAAC;KACjD;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,GAAG,QAAQ,GAAG,CAAC;QACjC,IAAI,YAAY,EAAE;YAChB,WAAW,IAAI,IAAI,YAAY,IAAI,CAAC;SACrC;QAED,kBAAkB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE;YAC1D,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE;gBAC7B,IAAI,YAAY,KAAK,SAAS,EAAE;oBAC9B,OAAO,CAAC,YAAY,CAAC,CAAC;iBACvB;aACF;YACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACvB,IAAI,WAAW,EAAE;gBACf,kBAAkB,CAAC,KAAK,EAAE,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA9BD,wBA8BC;AAED;;;;;;;GAOG;AACH,SAAgB,WAAW,CACzB,iBAAiB,GAAG,0BAA0B;IAE9C,IAAI,iBAAiB,EAAE;QACrB,iBAAiB,CAAC,KAAK,EAAE,CAAC;KAC3B;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACvE;AACH,CAAC;AARD,kCAQC","sourcesContent":["import readline from 'readline';\n\nlet singletonReadlineInterface: readline.Interface;\n\ntype PromptArgs = {\n question: string;\n defaultValue?: string;\n shouldClose?: boolean;\n readlineInterface?: readline.Interface;\n};\n\n/**\n * Open a readline interface, to prompt for user input. Avoid using this\n * function directly. Use the {@link prompt} function instead.\n */\nexport function openPrompt(): void {\n singletonReadlineInterface = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n}\n\n/**\n * Prompt for user input on the command line. If the prompt isn't open, it will\n * be opened.\n *\n * @param args - The prompt arguments.\n * @param args.question - The question to ask.\n * @param args.defaultValue - The default value to use, if no answer is provided.\n * @param args.shouldClose - Whether to close the readline interface after\n * prompting.\n * @param args.readlineInterface - The readline interface to use. Uses the\n * global readline interface if none provided.\n * @returns The user's input, or the default value if none provided.\n */\nexport function prompt({\n question,\n defaultValue,\n shouldClose,\n readlineInterface = singletonReadlineInterface,\n}: PromptArgs): Promise<string> {\n let _readlineInterface = readlineInterface;\n if (!_readlineInterface) {\n openPrompt();\n _readlineInterface = singletonReadlineInterface;\n }\n\n return new Promise((resolve, _reject) => {\n let queryString = `${question} `;\n if (defaultValue) {\n queryString += `(${defaultValue}) `;\n }\n\n _readlineInterface.question(queryString, (answer: string) => {\n if (!answer || !answer.trim()) {\n if (defaultValue !== undefined) {\n resolve(defaultValue);\n }\n }\n resolve(answer.trim());\n if (shouldClose) {\n _readlineInterface.close();\n }\n });\n });\n}\n\n/**\n * Close the readline interface.\n *\n * @param readlineInterface - The readline interface to close. Uses the global\n * readline interface if none provided.\n * @throws If no readline interface is provided, and the global interface isn't\n * open.\n */\nexport function closePrompt(\n readlineInterface = singletonReadlineInterface,\n): void {\n if (readlineInterface) {\n readlineInterface.close();\n } else {\n throw new Error('You are attempting to close a non existent prompt.');\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSnapConfig = void 0;
|
|
4
|
-
function isSnapConfig(obj, _argumentName) {
|
|
5
|
-
return ((obj !== null &&
|
|
6
|
-
typeof obj === "object" ||
|
|
7
|
-
typeof obj === "function") &&
|
|
8
|
-
(typeof obj.cliOptions === "undefined" ||
|
|
9
|
-
(obj.cliOptions !== null &&
|
|
10
|
-
typeof obj.cliOptions === "object" ||
|
|
11
|
-
typeof obj.cliOptions === "function") &&
|
|
12
|
-
Object.entries(obj.cliOptions)
|
|
13
|
-
.every(([key, _value]) => (typeof key === "string"))) &&
|
|
14
|
-
(typeof obj.bundlerCustomizer === "undefined" ||
|
|
15
|
-
typeof obj.bundlerCustomizer === "function"));
|
|
16
|
-
}
|
|
17
|
-
exports.isSnapConfig = isSnapConfig;
|
|
18
|
-
//# sourceMappingURL=snap-config.__GENERATED__.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snap-config.__GENERATED__.js","sourceRoot":"","sources":["../../src/utils/snap-config.__GENERATED__.ts"],"names":[],"mappings":";;;AAMA,SAAgB,YAAY,CAAC,GAAQ,EAAE,aAAsB;IACzD,OAAO,CACH,CAAC,GAAG,KAAK,IAAI;QACT,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,GAAG,KAAK,UAAU,CAAC;QAC9B,CAAC,OAAO,GAAG,CAAC,UAAU,KAAK,WAAW;YAClC,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI;gBACpB,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;gBAClC,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC;gBACzC,MAAM,CAAC,OAAO,CAAM,GAAG,CAAC,UAAU,CAAC;qBAC9B,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC;QAC7D,CAAC,OAAO,GAAG,CAAC,iBAAiB,KAAK,WAAW;YACzC,OAAO,GAAG,CAAC,iBAAiB,KAAK,UAAU,CAAC,CACnD,CAAA;AACL,CAAC;AAdD,oCAcC","sourcesContent":["/*\n * Generated type guards for \"snap-config.ts\".\n * WARNING: Do not manually change this file.\n */\nimport { SnapConfig } from \"./snap-config\";\n\nexport function isSnapConfig(obj: any, _argumentName?: string): obj is SnapConfig {\n return (\n (obj !== null &&\n typeof obj === \"object\" ||\n typeof obj === \"function\") &&\n (typeof obj.cliOptions === \"undefined\" ||\n (obj.cliOptions !== null &&\n typeof obj.cliOptions === \"object\" ||\n typeof obj.cliOptions === \"function\") &&\n Object.entries<any>(obj.cliOptions)\n .every(([key, _value]) => (typeof key === \"string\"))) &&\n (typeof obj.bundlerCustomizer === \"undefined\" ||\n typeof obj.bundlerCustomizer === \"function\")\n )\n}\n"]}
|