@shopify/cli-kit 3.6.0 → 3.7.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 +16 -0
- package/dist/analytics.d.ts +2 -1
- package/dist/analytics.js +32 -16
- package/dist/analytics.js.map +1 -1
- package/dist/api/common.d.ts +1 -1
- package/dist/api/common.js +1 -1
- package/dist/api/common.js.map +1 -1
- package/dist/api/graphql/extension_specifications.js.map +1 -1
- package/dist/api/graphql/functions/app_function_set.d.ts +9 -23
- package/dist/api/graphql/functions/app_function_set.js +18 -27
- package/dist/api/graphql/functions/app_function_set.js.map +1 -1
- package/dist/api/graphql/functions/upload_url_generate.d.ts +12 -0
- package/dist/api/graphql/functions/upload_url_generate.js +11 -0
- package/dist/api/graphql/functions/upload_url_generate.js.map +1 -0
- package/dist/api/graphql/index.d.ts +1 -1
- package/dist/api/graphql/index.js +1 -1
- package/dist/api/graphql/index.js.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/environment/local.d.ts +19 -2
- package/dist/environment/local.js +45 -5
- package/dist/environment/local.js.map +1 -1
- package/dist/environment/utilities.d.ts +4 -0
- package/dist/environment/utilities.js +9 -0
- package/dist/environment/utilities.js.map +1 -1
- package/dist/error.d.ts +2 -2
- package/dist/error.js +7 -1
- package/dist/error.js.map +1 -1
- package/dist/file.d.ts +2 -1
- package/dist/file.js +6 -2
- package/dist/file.js.map +1 -1
- package/dist/github.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +180 -12
- package/dist/metadata.js +39 -6
- package/dist/metadata.js.map +1 -1
- package/dist/monorail.d.ts +48 -1
- package/dist/monorail.js +2 -1
- package/dist/monorail.js.map +1 -1
- package/dist/node/archiver.js +1 -0
- package/dist/node/archiver.js.map +1 -1
- package/dist/node/base-command.d.ts +11 -1
- package/dist/node/base-command.js +19 -4
- package/dist/node/base-command.js.map +1 -1
- package/dist/node/cli.js +2 -2
- package/dist/node/cli.js.map +1 -1
- package/dist/node/error-handler.d.ts +9 -0
- package/dist/node/error-handler.js +13 -3
- package/dist/node/error-handler.js.map +1 -1
- package/dist/node/hooks/prerun.js +1 -1
- package/dist/node/hooks/prerun.js.map +1 -1
- package/dist/node/node-package-manager.d.ts +3 -7
- package/dist/node/node-package-manager.js +2 -1
- package/dist/node/node-package-manager.js.map +1 -1
- package/dist/node/ruby.js +12 -6
- package/dist/node/ruby.js.map +1 -1
- package/dist/path.d.ts +1 -0
- package/dist/plugins/tunnel.d.ts +40 -0
- package/dist/plugins/tunnel.js +11 -0
- package/dist/plugins/tunnel.js.map +1 -0
- package/dist/plugins.d.ts +11 -13
- package/dist/plugins.js +0 -1
- package/dist/plugins.js.map +1 -1
- package/dist/session/authorize.js +1 -1
- package/dist/session/authorize.js.map +1 -1
- package/dist/session/exchange.js +1 -2
- package/dist/session/exchange.js.map +1 -1
- package/dist/session/redirect-listener.js +6 -5
- package/dist/session/redirect-listener.js.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/string.d.ts +1 -0
- package/dist/string.js +3 -0
- package/dist/string.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing/deep-required.d.ts +12 -0
- package/dist/typing/deep-required.js +2 -0
- package/dist/typing/deep-required.js.map +1 -0
- package/dist/typing/pick-by-prefix.d.ts +12 -0
- package/dist/typing/pick-by-prefix.js +2 -0
- package/dist/typing/pick-by-prefix.js.map +1 -0
- package/dist/ui/executor.d.ts +7 -0
- package/dist/ui/executor.js +60 -0
- package/dist/ui/executor.js.map +1 -0
- package/dist/ui/inquirer/autocomplete.d.ts +11 -0
- package/dist/ui/inquirer/autocomplete.js +95 -0
- package/dist/ui/inquirer/autocomplete.js.map +1 -0
- package/dist/ui/inquirer/input.d.ts +16 -0
- package/dist/ui/inquirer/input.js +46 -0
- package/dist/ui/inquirer/input.js.map +1 -0
- package/dist/ui/inquirer/password.d.ts +7 -0
- package/dist/ui/inquirer/password.js +8 -0
- package/dist/ui/inquirer/password.js.map +1 -0
- package/dist/ui/inquirer/select.d.ts +14 -0
- package/dist/ui/inquirer/select.js +27 -0
- package/dist/ui/inquirer/select.js.map +1 -0
- package/dist/ui.d.ts +7 -23
- package/dist/ui.js +13 -60
- package/dist/ui.js.map +1 -1
- package/dist/version.d.ts +1 -0
- package/package.json +14 -5
- package/dist/api/graphql/functions/module_upload_url_generate.d.ts +0 -18
- package/dist/api/graphql/functions/module_upload_url_generate.js +0 -17
- package/dist/api/graphql/functions/module_upload_url_generate.js.map +0 -1
- package/dist/ui/autocomplete.d.ts +0 -7
- package/dist/ui/autocomplete.js +0 -43
- package/dist/ui/autocomplete.js.map +0 -1
- package/dist/ui/input.d.ts +0 -7
- package/dist/ui/input.js +0 -48
- package/dist/ui/input.js.map +0 -1
- package/dist/ui/select.d.ts +0 -6
- package/dist/ui/select.js +0 -30
- package/dist/ui/select.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of utilities, interfaces, and models that are common across all the platform features",
|
|
6
6
|
"keywords": [
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"node": "./dist/node/*.js",
|
|
22
22
|
"types": "./dist/node/*.d.ts"
|
|
23
23
|
},
|
|
24
|
+
"./plugins/*": {
|
|
25
|
+
"node": "./dist/plugins/*.js",
|
|
26
|
+
"types": "./dist/plugins/*.d.ts"
|
|
27
|
+
},
|
|
24
28
|
"./common/*": {
|
|
25
29
|
"node": "./dist/common/*.js",
|
|
26
30
|
"types": "./dist/common/*.d.ts"
|
|
@@ -28,6 +32,10 @@
|
|
|
28
32
|
"./testing/*": {
|
|
29
33
|
"node": "./dist/testing/*.js",
|
|
30
34
|
"types": "./dist/testing/*.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./typing/*": {
|
|
37
|
+
"node": "./dist/typing/*.js",
|
|
38
|
+
"types": "./dist/typing/*.d.ts"
|
|
31
39
|
}
|
|
32
40
|
},
|
|
33
41
|
"files": [
|
|
@@ -39,8 +47,8 @@
|
|
|
39
47
|
"@shopify:registry": "https://registry.npmjs.org"
|
|
40
48
|
},
|
|
41
49
|
"scripts": {
|
|
42
|
-
"clean": "
|
|
43
|
-
"build": "
|
|
50
|
+
"clean": "rimraf dist/",
|
|
51
|
+
"build": "tsc -b ./tsconfig.build.json",
|
|
44
52
|
"prepack": "cross-env NODE_ENV=production yarn run build",
|
|
45
53
|
"lint": "eslint \"src/**/*.ts\"",
|
|
46
54
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
@@ -65,7 +73,7 @@
|
|
|
65
73
|
"dependencies": {
|
|
66
74
|
"@bugsnag/js": "^7.16.7",
|
|
67
75
|
"@iarna/toml": "^2.2.5",
|
|
68
|
-
"@oclif/core": "
|
|
76
|
+
"@oclif/core": "1.9.2",
|
|
69
77
|
"@types/archiver": "^5.3.1",
|
|
70
78
|
"abort-controller": "^3.0.0",
|
|
71
79
|
"ansi-colors": "^4.1.1",
|
|
@@ -76,7 +84,6 @@
|
|
|
76
84
|
"conf": "^10.1.2",
|
|
77
85
|
"cross-zip": "^4.0.0",
|
|
78
86
|
"del": "^6.0.0",
|
|
79
|
-
"enquirer": "^2.3.6",
|
|
80
87
|
"env-paths": "^3.0.0",
|
|
81
88
|
"envfile": "^6.17.0",
|
|
82
89
|
"execa": "^6.0.0",
|
|
@@ -87,10 +94,12 @@
|
|
|
87
94
|
"find-versions": "^5.0.0",
|
|
88
95
|
"form-data": "^4.0.0",
|
|
89
96
|
"fs-extra": "^10.0.0",
|
|
97
|
+
"fuzzy": "^0.1.3",
|
|
90
98
|
"get-port-please": "^2.5.0",
|
|
91
99
|
"graphql": "^16.4.0",
|
|
92
100
|
"graphql-request": "^4.3.0",
|
|
93
101
|
"inquirer": "^8.2.4",
|
|
102
|
+
"inquirer-autocomplete-prompt": "^2.0.0",
|
|
94
103
|
"is-interactive": "^2.0.0",
|
|
95
104
|
"js-yaml": "^4.1.0",
|
|
96
105
|
"keytar": "^7.9.0",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const ModuleUploadUrlGenerateMutation: string;
|
|
2
|
-
export interface ModuleUploadUrlGenerateMutationSchema {
|
|
3
|
-
data: {
|
|
4
|
-
moduleUploadUrlGenerate: {
|
|
5
|
-
details: {
|
|
6
|
-
url: string;
|
|
7
|
-
headers: {
|
|
8
|
-
[key: string]: string;
|
|
9
|
-
};
|
|
10
|
-
humanizedMaxSize: string;
|
|
11
|
-
};
|
|
12
|
-
userErrors: {
|
|
13
|
-
field: string;
|
|
14
|
-
message: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { gql } from 'graphql-request';
|
|
2
|
-
export const ModuleUploadUrlGenerateMutation = gql `
|
|
3
|
-
mutation moduleUploadUrlGenerate {
|
|
4
|
-
moduleUploadUrlGenerate {
|
|
5
|
-
details {
|
|
6
|
-
url
|
|
7
|
-
headers
|
|
8
|
-
humanizedMaxSize
|
|
9
|
-
}
|
|
10
|
-
userErrors {
|
|
11
|
-
field
|
|
12
|
-
message
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
17
|
-
//# sourceMappingURL=module_upload_url_generate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module_upload_url_generate.js","sourceRoot":"","sources":["../../../../src/api/graphql/functions/module_upload_url_generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcjD,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ModuleUploadUrlGenerateMutation = gql`\n mutation moduleUploadUrlGenerate {\n moduleUploadUrlGenerate {\n details {\n url\n headers\n humanizedMaxSize\n }\n userErrors {\n field\n message\n }\n }\n }\n`\n\nexport interface ModuleUploadUrlGenerateMutationSchema {\n data: {\n moduleUploadUrlGenerate: {\n details: {\n url: string\n headers: {[key: string]: string}\n humanizedMaxSize: string\n }\n userErrors: {\n field: string\n message: string\n }[]\n }\n }\n}\n"]}
|
package/dist/ui/autocomplete.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Enquirer types are totally broken so we need to disable typescript checks for this file
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
import { colors } from '../node/colors.js';
|
|
5
|
-
import enquirer from 'enquirer';
|
|
6
|
-
export class AutoComplete extends enquirer.AutoComplete {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
const originalResult = options.result;
|
|
9
|
-
options.result = (value) => {
|
|
10
|
-
const answer = this.focused.value || this.focused.name || value;
|
|
11
|
-
if (originalResult) {
|
|
12
|
-
return originalResult(answer);
|
|
13
|
-
}
|
|
14
|
-
return answer;
|
|
15
|
-
};
|
|
16
|
-
super(options);
|
|
17
|
-
this.styles.primary = colors.magenta;
|
|
18
|
-
this.styles.em = colors.magenta;
|
|
19
|
-
}
|
|
20
|
-
pointer(_choice, i) {
|
|
21
|
-
const color = this.styles.primary;
|
|
22
|
-
const showPointer = !this.state.multiple && this.state.index === i;
|
|
23
|
-
return showPointer ? color('>') : ' ';
|
|
24
|
-
}
|
|
25
|
-
prefix(_state) {
|
|
26
|
-
const color = this.styles.primary.bold;
|
|
27
|
-
return this.state.status === 'submitted' ? color('✔') : color('?');
|
|
28
|
-
}
|
|
29
|
-
format() {
|
|
30
|
-
if (!this.focused)
|
|
31
|
-
return this.input;
|
|
32
|
-
if (this.options.multiple && this.state.submitted) {
|
|
33
|
-
return this.selected.map((ch) => this.styles.primary(ch.message)).join(', ');
|
|
34
|
-
}
|
|
35
|
-
if (this.state.submitted) {
|
|
36
|
-
this.value = this.focused.value;
|
|
37
|
-
this.input = this.focused.value;
|
|
38
|
-
return this.styles.primary(this.focused.name);
|
|
39
|
-
}
|
|
40
|
-
return this.input;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=autocomplete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/ui/autocomplete.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,6DAA6D;AAC7D,cAAc;AACd,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AACxC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,MAAM,OAAO,YAAa,SAAQ,QAAQ,CAAC,YAAY;IACrD,YAAY,OAAO;QACjB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAA;QACrC,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,KAAK,CAAA;YAE/D,IAAI,cAAc,EAAE;gBAClB,OAAO,cAAc,CAAC,MAAM,CAAC,CAAA;aAC9B;YAED,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QACD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QACpC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,OAAO,CAAC,OAAgB,EAAE,CAAS;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACjC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAA;QAClE,OAAO,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IACvC,CAAC;IAED,MAAM,CAAC,MAAe;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACpE,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,KAAK,CAAA;QACpC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SAC7E;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;YAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;YAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;SAC9C;QACD,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF","sourcesContent":["// Enquirer types are totally broken so we need to disable typescript checks for this file\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport {colors} from '../node/colors.js'\nimport enquirer from 'enquirer'\n\nexport class AutoComplete extends enquirer.AutoComplete {\n constructor(options) {\n const originalResult = options.result\n options.result = (value) => {\n const answer = this.focused.value || this.focused.name || value\n\n if (originalResult) {\n return originalResult(answer)\n }\n\n return answer\n }\n super(options)\n this.styles.primary = colors.magenta\n this.styles.em = colors.magenta\n }\n\n pointer(_choice: unknown, i: number) {\n const color = this.styles.primary\n const showPointer = !this.state.multiple && this.state.index === i\n return showPointer ? color('>') : ' '\n }\n\n prefix(_state: unknown) {\n const color = this.styles.primary.bold\n return this.state.status === 'submitted' ? color('✔') : color('?')\n }\n\n format() {\n if (!this.focused) return this.input\n if (this.options.multiple && this.state.submitted) {\n return this.selected.map((ch) => this.styles.primary(ch.message)).join(', ')\n }\n if (this.state.submitted) {\n this.value = this.focused.value\n this.input = this.focused.value\n return this.styles.primary(this.focused.name)\n }\n return this.input\n }\n}\n"]}
|
package/dist/ui/input.d.ts
DELETED
package/dist/ui/input.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Enquirer types are totally broken so we need to disable typescript checks for this file
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
import { colors } from '../node/colors.js';
|
|
5
|
-
import enquirer from 'enquirer';
|
|
6
|
-
export class Input extends enquirer.StringPrompt {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
super(options);
|
|
9
|
-
this.styles.primary = colors.magenta;
|
|
10
|
-
this.styles.submitted = colors.magenta;
|
|
11
|
-
this.styles.danger = colors.red;
|
|
12
|
-
this.symbols.pointer = '!';
|
|
13
|
-
}
|
|
14
|
-
prefix(_state) {
|
|
15
|
-
const color = this.styles.primary.bold;
|
|
16
|
-
return this.state.status === 'submitted' ? color('✔') : color('?');
|
|
17
|
-
}
|
|
18
|
-
async render() {
|
|
19
|
-
const size = this.state.size;
|
|
20
|
-
const prefix = await this.prefix();
|
|
21
|
-
const separator = await this.separator();
|
|
22
|
-
const message = await this.message();
|
|
23
|
-
const color = this.styles.primary;
|
|
24
|
-
let prompt = [prefix, message].filter(Boolean).join(' ');
|
|
25
|
-
this.state.prompt = prompt;
|
|
26
|
-
const output = this.type === 'password' ? await this.formatPassword() : await this.format();
|
|
27
|
-
const help = (await this.error()) || (await this.hint());
|
|
28
|
-
const underline = '▔'.repeat(Math.max(color.unstyle(output).length - 10, 30));
|
|
29
|
-
if (this.state.submitted) {
|
|
30
|
-
prompt += ` ${separator} ${output}`;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
prompt += `\n${color('>')} ${output}\n ${color(underline)}`;
|
|
34
|
-
if (help && !prompt.includes(help))
|
|
35
|
-
prompt += ` ${help}`;
|
|
36
|
-
}
|
|
37
|
-
this.clear(size);
|
|
38
|
-
this.write([prompt].filter(Boolean).join('\n'));
|
|
39
|
-
this.restore();
|
|
40
|
-
}
|
|
41
|
-
formatPassword() {
|
|
42
|
-
if (!this.keypressed)
|
|
43
|
-
return '';
|
|
44
|
-
const color = this.state.submitted ? this.styles.primary : this.styles.muted;
|
|
45
|
-
return color(this.symbols.asterisk.repeat(this.input.length));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=input.js.map
|
package/dist/ui/input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/ui/input.ts"],"names":[],"mappings":"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","sourcesContent":["// Enquirer types are totally broken so we need to disable typescript checks for this file\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport {colors} from '../node/colors.js'\nimport enquirer from 'enquirer'\n\nexport class Input extends enquirer.StringPrompt {\n constructor(options) {\n super(options)\n this.styles.primary = colors.magenta\n this.styles.submitted = colors.magenta\n this.styles.danger = colors.red\n this.symbols.pointer = '!'\n }\n\n prefix(_state: unknown) {\n const color = this.styles.primary.bold\n return this.state.status === 'submitted' ? color('✔') : color('?')\n }\n\n async render() {\n const size = this.state.size\n const prefix = await this.prefix()\n const separator = await this.separator()\n const message = await this.message()\n const color = this.styles.primary\n\n let prompt = [prefix, message].filter(Boolean).join(' ')\n this.state.prompt = prompt\n\n const output = this.type === 'password' ? await this.formatPassword() : await this.format()\n const help = (await this.error()) || (await this.hint())\n\n const underline = '▔'.repeat(Math.max(color.unstyle(output).length - 10, 30))\n if (this.state.submitted) {\n prompt += ` ${separator} ${output}`\n } else {\n prompt += `\\n${color('>')} ${output}\\n ${color(underline)}`\n if (help && !prompt.includes(help)) prompt += ` ${help}`\n }\n\n this.clear(size)\n this.write([prompt].filter(Boolean).join('\\n'))\n this.restore()\n }\n\n formatPassword() {\n if (!this.keypressed) return ''\n const color = this.state.submitted ? this.styles.primary : this.styles.muted\n return color(this.symbols.asterisk.repeat(this.input.length))\n }\n}\n"]}
|
package/dist/ui/select.d.ts
DELETED
package/dist/ui/select.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Enquirer types are totally broken so we need to disable typescript checks for this file
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
import { colors } from '../node/colors.js';
|
|
5
|
-
import enquirer from 'enquirer';
|
|
6
|
-
export class Select extends enquirer.Select {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
const originalResult = options.result;
|
|
9
|
-
options.result = (value) => {
|
|
10
|
-
const answer = this.focused.value || this.focused.name || value;
|
|
11
|
-
if (originalResult) {
|
|
12
|
-
return originalResult(answer);
|
|
13
|
-
}
|
|
14
|
-
return answer;
|
|
15
|
-
};
|
|
16
|
-
super(options);
|
|
17
|
-
this.styles.primary = colors.magenta;
|
|
18
|
-
this.styles.em = colors.magenta;
|
|
19
|
-
}
|
|
20
|
-
pointer(_choice, i) {
|
|
21
|
-
const color = this.styles.primary;
|
|
22
|
-
const showPointer = !this.state.multiple && this.state.index === i;
|
|
23
|
-
return showPointer ? color('>') : ' ';
|
|
24
|
-
}
|
|
25
|
-
prefix(_state) {
|
|
26
|
-
const color = this.styles.primary.bold;
|
|
27
|
-
return this.state.status === 'submitted' ? color('✔') : color('?');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=select.js.map
|
package/dist/ui/select.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/ui/select.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,6DAA6D;AAC7D,cAAc;AACd,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AACxC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,MAAM,OAAO,MAAO,SAAQ,QAAQ,CAAC,MAAM;IACzC,YAAY,OAAO;QACjB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAA;QACrC,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,KAAK,CAAA;YAE/D,IAAI,cAAc,EAAE;gBAClB,OAAO,cAAc,CAAC,MAAM,CAAC,CAAA;aAC9B;YAED,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QACD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QACpC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,OAAO,CAAC,OAAgB,EAAE,CAAS;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACjC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAA;QAClE,OAAO,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IACvC,CAAC;IAED,MAAM,CAAC,MAAe;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACpE,CAAC;CACF","sourcesContent":["// Enquirer types are totally broken so we need to disable typescript checks for this file\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport {colors} from '../node/colors.js'\nimport enquirer from 'enquirer'\n\nexport class Select extends enquirer.Select {\n constructor(options) {\n const originalResult = options.result\n options.result = (value) => {\n const answer = this.focused.value || this.focused.name || value\n\n if (originalResult) {\n return originalResult(answer)\n }\n\n return answer\n }\n super(options)\n this.styles.primary = colors.magenta\n this.styles.em = colors.magenta\n }\n\n pointer(_choice: unknown, i: number) {\n const color = this.styles.primary\n const showPointer = !this.state.multiple && this.state.index === i\n return showPointer ? color('>') : ' '\n }\n\n prefix(_state: unknown) {\n const color = this.styles.primary.bold\n return this.state.status === 'submitted' ? color('✔') : color('?')\n }\n}\n"]}
|