@shopify/cli-kit 3.36.1 → 3.37.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/dist/index.d.ts +0 -7
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/private/node/analytics.js +5 -4
- package/dist/private/node/analytics.js.map +1 -1
- package/dist/private/node/api/graphql.js +2 -2
- package/dist/private/node/api/graphql.js.map +1 -1
- package/dist/private/node/api/headers.d.ts +1 -1
- package/dist/private/node/api/headers.js +1 -1
- package/dist/private/node/api/headers.js.map +1 -1
- package/dist/private/node/conf-store.d.ts +21 -0
- package/dist/private/node/conf-store.js +41 -0
- package/dist/private/node/conf-store.js.map +1 -0
- package/dist/{secure-store.d.ts → private/node/secure-store.d.ts} +3 -3
- package/dist/{secure-store.js → private/node/secure-store.js} +7 -7
- package/dist/private/node/secure-store.js.map +1 -0
- package/dist/private/node/session/authorize.d.ts +0 -2
- package/dist/private/node/session/authorize.js +2 -3
- package/dist/private/node/session/authorize.js.map +1 -1
- package/dist/private/node/session/device-authorization.js +2 -2
- package/dist/private/node/session/device-authorization.js.map +1 -1
- package/dist/private/node/session/exchange.d.ts +1 -1
- package/dist/private/node/session/exchange.js +1 -2
- package/dist/private/node/session/exchange.js.map +1 -1
- package/dist/private/node/session/identity.js +2 -2
- package/dist/private/node/session/identity.js.map +1 -1
- package/dist/private/node/session/post-auth.d.ts +2 -2
- package/dist/private/node/session/post-auth.js +2 -2
- package/dist/private/node/session/post-auth.js.map +1 -1
- package/dist/private/node/session/redirect-listener.js +5 -5
- package/dist/private/node/session/redirect-listener.js.map +1 -1
- package/dist/private/node/session/schema.d.ts +46 -46
- package/dist/private/node/session/schema.js +12 -12
- package/dist/private/node/session/schema.js.map +1 -1
- package/dist/private/node/session/scopes.js +2 -2
- package/dist/private/node/session/scopes.js.map +1 -1
- package/dist/private/node/session/store.js +5 -6
- package/dist/private/node/session/store.js.map +1 -1
- package/dist/private/node/session.js +3 -4
- package/dist/private/node/session.js.map +1 -1
- package/dist/{testing → private/node/testing}/ui.d.ts +0 -0
- package/dist/{testing → private/node/testing}/ui.js +1 -1
- package/dist/private/node/testing/ui.js.map +1 -0
- package/dist/private/node/ui/components/AutocompletePrompt.test.js +1 -1
- package/dist/private/node/ui/components/AutocompletePrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.test.js +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -1
- package/dist/private/node/ui/components/FatalError.d.ts +1 -1
- package/dist/private/node/ui/components/FatalError.js +2 -2
- package/dist/private/node/ui/components/FatalError.js.map +1 -1
- package/dist/private/node/ui/components/FatalError.test.js +4 -4
- package/dist/private/node/ui/components/FatalError.test.js.map +1 -1
- package/dist/private/node/ui/components/SelectInput.test.js +1 -1
- package/dist/private/node/ui/components/SelectInput.test.js.map +1 -1
- package/dist/private/node/ui/components/SelectPrompt.test.js +1 -1
- package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/Tasks.test.js +1 -1
- package/dist/private/node/ui/components/Tasks.test.js.map +1 -1
- package/dist/private/node/ui/components/TextInput.test.js +1 -1
- package/dist/private/node/ui/components/TextInput.test.js.map +1 -1
- package/dist/private/node/ui/components/TextPrompt.test.js +1 -1
- package/dist/private/node/ui/components/TextPrompt.test.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/public/node/analytics.js +6 -6
- package/dist/public/node/analytics.js.map +1 -1
- package/dist/public/node/api/admin.js +3 -3
- package/dist/public/node/api/admin.js.map +1 -1
- package/dist/public/node/base-command.js +6 -5
- package/dist/public/node/base-command.js.map +1 -1
- package/dist/public/node/conf.d.ts +2 -0
- package/dist/public/node/conf.js +3 -0
- package/dist/public/node/conf.js.map +1 -0
- package/dist/public/node/environment/fqdn.d.ts +5 -5
- package/dist/public/node/environment/fqdn.js +5 -5
- package/dist/public/node/environment/fqdn.js.map +1 -1
- package/dist/public/node/environment/spin.js +2 -2
- package/dist/public/node/environment/spin.js.map +1 -1
- package/dist/public/node/error-handler.d.ts +2 -2
- package/dist/public/node/error-handler.js +7 -7
- package/dist/public/node/error-handler.js.map +1 -1
- package/dist/public/node/error.d.ts +84 -4
- package/dist/public/node/error.js +165 -4
- package/dist/public/node/error.js.map +1 -1
- package/dist/public/node/fs.js +4 -0
- package/dist/public/node/fs.js.map +1 -1
- package/dist/public/node/git.d.ts +2 -2
- package/dist/public/node/git.js +11 -10
- package/dist/public/node/git.js.map +1 -1
- package/dist/{metadata.d.ts → public/node/metadata.d.ts} +13 -13
- package/dist/{metadata.js → public/node/metadata.js} +13 -8
- package/dist/public/node/metadata.js.map +1 -0
- package/dist/{monorail.d.ts → public/node/monorail.d.ts} +11 -3
- package/dist/{monorail.js → public/node/monorail.js} +11 -3
- package/dist/public/node/monorail.js.map +1 -0
- package/dist/public/node/node-package-manager.d.ts +2 -2
- package/dist/public/node/node-package-manager.js +7 -2
- package/dist/public/node/node-package-manager.js.map +1 -1
- package/dist/public/node/path.d.ts +12 -2
- package/dist/public/node/path.js +17 -4
- package/dist/public/node/path.js.map +1 -1
- package/dist/public/node/plugins/tunnel.d.ts +2 -2
- package/dist/public/node/plugins/tunnel.js +1 -1
- package/dist/public/node/plugins/tunnel.js.map +1 -1
- package/dist/{plugins.d.ts → public/node/plugins.d.ts} +17 -11
- package/dist/{plugins.js → public/node/plugins.js} +15 -9
- package/dist/public/node/plugins.js.map +1 -0
- package/dist/public/node/result.js +3 -4
- package/dist/public/node/result.js.map +1 -1
- package/dist/public/node/ruby.d.ts +1 -0
- package/dist/public/node/ruby.js +24 -31
- package/dist/public/node/ruby.js.map +1 -1
- package/dist/public/node/schema.d.ts +1 -0
- package/dist/public/node/schema.js +2 -0
- package/dist/public/node/schema.js.map +1 -0
- package/dist/public/node/session.js +4 -4
- package/dist/public/node/session.js.map +1 -1
- package/dist/public/node/system.js +4 -3
- package/dist/public/node/system.js.map +1 -1
- package/dist/public/node/tcp.js +2 -2
- package/dist/public/node/tcp.js.map +1 -1
- package/dist/public/node/testing/output.d.ts +16 -0
- package/dist/{testing → public/node/testing}/output.js +6 -2
- package/dist/public/node/testing/output.js.map +1 -0
- package/dist/public/node/ui.d.ts +1 -1
- package/dist/public/node/ui.js.map +1 -1
- package/dist/public/node/vscode.js +2 -2
- package/dist/public/node/vscode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui.js +5 -5
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/dist/error.d.ts +0 -68
- package/dist/error.js +0 -143
- package/dist/error.js.map +0 -1
- package/dist/git.d.ts +0 -36
- package/dist/git.js +0 -133
- package/dist/git.js.map +0 -1
- package/dist/metadata.js.map +0 -1
- package/dist/monorail.js.map +0 -1
- package/dist/plugins.js.map +0 -1
- package/dist/schema.d.ts +0 -1
- package/dist/schema.js +0 -2
- package/dist/schema.js.map +0 -1
- package/dist/secure-store.js.map +0 -1
- package/dist/store.d.ts +0 -53
- package/dist/store.js +0 -133
- package/dist/store.js.map +0 -1
- package/dist/testing/output.d.ts +0 -10
- package/dist/testing/output.js.map +0 -1
- package/dist/testing/store.d.ts +0 -7
- package/dist/testing/store.js +0 -26
- package/dist/testing/store.js.map +0 -1
- package/dist/testing/ui.js.map +0 -1
package/dist/store.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import Conf from 'conf';
|
|
2
|
-
export interface CachedAppInfo {
|
|
3
|
-
directory: string;
|
|
4
|
-
appId?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
orgId?: string;
|
|
7
|
-
storeFqdn?: string;
|
|
8
|
-
updateURLs?: boolean;
|
|
9
|
-
tunnelPlugin?: string;
|
|
10
|
-
}
|
|
11
|
-
interface ConfSchema {
|
|
12
|
-
appInfo: CachedAppInfo[];
|
|
13
|
-
themeStore: string;
|
|
14
|
-
session: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function cliKitStore(): CLIKitStore;
|
|
17
|
-
export declare function getAppInfo(directory: string): CachedAppInfo | undefined;
|
|
18
|
-
export declare function setAppInfo(options: {
|
|
19
|
-
directory: string;
|
|
20
|
-
appId?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
storeFqdn?: string;
|
|
23
|
-
orgId?: string;
|
|
24
|
-
updateURLs?: boolean;
|
|
25
|
-
tunnelPlugin?: string;
|
|
26
|
-
}): void;
|
|
27
|
-
export declare function clearAppInfo(directory: string): void;
|
|
28
|
-
export declare function getThemeStore(): string | undefined;
|
|
29
|
-
export declare function setThemeStore(themeStore: string): void;
|
|
30
|
-
export declare function getSession(): string | undefined;
|
|
31
|
-
export declare function setSession(session: string): void;
|
|
32
|
-
export declare function removeSession(): void;
|
|
33
|
-
export declare function clearAllAppInfo(): void;
|
|
34
|
-
export declare class CLIKitStore extends Conf<ConfSchema> {
|
|
35
|
-
getAppInfo(directory: string): CachedAppInfo | undefined;
|
|
36
|
-
setAppInfo(options: {
|
|
37
|
-
directory: string;
|
|
38
|
-
appId?: string;
|
|
39
|
-
title?: string;
|
|
40
|
-
storeFqdn?: string;
|
|
41
|
-
orgId?: string;
|
|
42
|
-
updateURLs?: boolean;
|
|
43
|
-
tunnelPlugin?: string;
|
|
44
|
-
}): void;
|
|
45
|
-
clearAppInfo(directory: string): void;
|
|
46
|
-
clearAllAppInfo(): void;
|
|
47
|
-
getThemeStore(): string | undefined;
|
|
48
|
-
setThemeStore(themeStore: string): void;
|
|
49
|
-
getSession(): string | undefined;
|
|
50
|
-
setSession(session: string): void;
|
|
51
|
-
removeSession(): void;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
package/dist/store.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { content, token, debug } from './output.js';
|
|
2
|
-
import { CLI_KIT_VERSION } from './public/common/version.js';
|
|
3
|
-
import Conf from 'conf';
|
|
4
|
-
const migrations = {};
|
|
5
|
-
const schema = {
|
|
6
|
-
appInfo: {
|
|
7
|
-
type: 'array',
|
|
8
|
-
items: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
properties: {
|
|
11
|
-
appId: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
},
|
|
14
|
-
orgId: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
},
|
|
17
|
-
storeFqdn: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
let _instance;
|
|
25
|
-
export function cliKitStore() {
|
|
26
|
-
if (!_instance) {
|
|
27
|
-
_instance = new CLIKitStore({
|
|
28
|
-
schema,
|
|
29
|
-
migrations,
|
|
30
|
-
projectName: 'shopify-cli-kit',
|
|
31
|
-
projectVersion: CLI_KIT_VERSION,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return _instance;
|
|
35
|
-
}
|
|
36
|
-
export function getAppInfo(directory) {
|
|
37
|
-
const store = cliKitStore();
|
|
38
|
-
return store.getAppInfo(directory);
|
|
39
|
-
}
|
|
40
|
-
export function setAppInfo(options) {
|
|
41
|
-
const store = cliKitStore();
|
|
42
|
-
store.setAppInfo(options);
|
|
43
|
-
}
|
|
44
|
-
export function clearAppInfo(directory) {
|
|
45
|
-
const store = cliKitStore();
|
|
46
|
-
store.clearAppInfo(directory);
|
|
47
|
-
}
|
|
48
|
-
export function getThemeStore() {
|
|
49
|
-
const store = cliKitStore();
|
|
50
|
-
return store.getThemeStore();
|
|
51
|
-
}
|
|
52
|
-
export function setThemeStore(themeStore) {
|
|
53
|
-
const store = cliKitStore();
|
|
54
|
-
store.setThemeStore(themeStore);
|
|
55
|
-
}
|
|
56
|
-
export function getSession() {
|
|
57
|
-
const store = cliKitStore();
|
|
58
|
-
return store.getSession();
|
|
59
|
-
}
|
|
60
|
-
export function setSession(session) {
|
|
61
|
-
const store = cliKitStore();
|
|
62
|
-
store.setSession(session);
|
|
63
|
-
}
|
|
64
|
-
export function removeSession() {
|
|
65
|
-
const store = cliKitStore();
|
|
66
|
-
store.removeSession();
|
|
67
|
-
}
|
|
68
|
-
export function clearAllAppInfo() {
|
|
69
|
-
const store = cliKitStore();
|
|
70
|
-
store.clearAllAppInfo();
|
|
71
|
-
}
|
|
72
|
-
export class CLIKitStore extends Conf {
|
|
73
|
-
getAppInfo(directory) {
|
|
74
|
-
debug(content `Reading cached app information for directory ${token.path(directory)}...`);
|
|
75
|
-
const apps = this.get('appInfo') ?? [];
|
|
76
|
-
return apps.find((app) => app.directory === directory);
|
|
77
|
-
}
|
|
78
|
-
setAppInfo(options) {
|
|
79
|
-
debug(content `Storing app information for directory ${token.path(options.directory)}:${token.json(options)}`);
|
|
80
|
-
const apps = this.get('appInfo') ?? [];
|
|
81
|
-
const index = apps.findIndex((saved) => saved.directory === options.directory);
|
|
82
|
-
if (index === -1) {
|
|
83
|
-
apps.push(options);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
const app = apps[index];
|
|
87
|
-
apps[index] = {
|
|
88
|
-
directory: options.directory,
|
|
89
|
-
appId: options.appId ?? app.appId,
|
|
90
|
-
title: options.title ?? app.title,
|
|
91
|
-
storeFqdn: options.storeFqdn ?? app.storeFqdn,
|
|
92
|
-
orgId: options.orgId ?? app.orgId,
|
|
93
|
-
updateURLs: options.updateURLs ?? app.updateURLs,
|
|
94
|
-
tunnelPlugin: options.tunnelPlugin ?? app.tunnelPlugin,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
this.set('appInfo', apps);
|
|
98
|
-
}
|
|
99
|
-
clearAppInfo(directory) {
|
|
100
|
-
debug(content `Clearing app information for directory ${token.path(directory)}...`);
|
|
101
|
-
const apps = this.get('appInfo') ?? [];
|
|
102
|
-
const index = apps.findIndex((saved) => saved.directory === directory);
|
|
103
|
-
if (index !== -1) {
|
|
104
|
-
apps.splice(index, 1);
|
|
105
|
-
}
|
|
106
|
-
this.set('appInfo', apps);
|
|
107
|
-
}
|
|
108
|
-
clearAllAppInfo() {
|
|
109
|
-
debug(content `Clearing all app information...`);
|
|
110
|
-
this.set('appInfo', []);
|
|
111
|
-
}
|
|
112
|
-
getThemeStore() {
|
|
113
|
-
debug(content `Getting theme store...`);
|
|
114
|
-
return this.get('themeStore');
|
|
115
|
-
}
|
|
116
|
-
setThemeStore(themeStore) {
|
|
117
|
-
debug(content `Setting theme store...`);
|
|
118
|
-
this.set('themeStore', themeStore);
|
|
119
|
-
}
|
|
120
|
-
getSession() {
|
|
121
|
-
debug(content `Getting session store...`);
|
|
122
|
-
return this.get('sessionStore');
|
|
123
|
-
}
|
|
124
|
-
setSession(session) {
|
|
125
|
-
debug(content `Setting session store...`);
|
|
126
|
-
this.set('sessionStore', session);
|
|
127
|
-
}
|
|
128
|
-
removeSession() {
|
|
129
|
-
debug(content `Removing session store...`);
|
|
130
|
-
this.set('sessionStore', '');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=store.js.map
|
package/dist/store.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAA;AAC1D,OAAO,IAAc,MAAM,MAAM,CAAA;AAEjC,MAAM,UAAU,GAAG,EAAE,CAAA;AAkBrB,MAAM,MAAM,GAAG;IACb,OAAO,EAAE;QACP,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CAC+B,CAAA;AAElC,IAAI,SA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AAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;IACpC,CAAC;IAED,UAAU;QACR,KAAK,CAAC,OAAO,CAAA,0BAA0B,CAAC,CAAA;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IACjC,CAAC;IAED,UAAU,CAAC,OAAe;QACxB,KAAK,CAAC,OAAO,CAAA,0BAA0B,CAAC,CAAA;QACxC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;IAED,aAAa;QACX,KAAK,CAAC,OAAO,CAAA,2BAA2B,CAAC,CAAA;QACzC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IAC9B,CAAC;CACF","sourcesContent":["import {content, token, debug} from './output.js'\nimport {CLI_KIT_VERSION} from './public/common/version.js'\nimport Conf, {Schema} from 'conf'\n\nconst migrations = {}\n\nexport interface CachedAppInfo {\n directory: string\n appId?: string\n title?: string\n orgId?: string\n storeFqdn?: string\n updateURLs?: boolean\n tunnelPlugin?: string\n}\n\ninterface ConfSchema {\n appInfo: CachedAppInfo[]\n themeStore: string\n session: string\n}\n\nconst schema = {\n appInfo: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n appId: {\n type: 'string',\n },\n orgId: {\n type: 'string',\n },\n storeFqdn: {\n type: 'string',\n },\n },\n },\n },\n} as unknown as Schema<ConfSchema>\n\nlet _instance: CLIKitStore | undefined\n\nexport function cliKitStore() {\n if (!_instance) {\n _instance = new CLIKitStore({\n schema,\n migrations,\n projectName: 'shopify-cli-kit',\n projectVersion: CLI_KIT_VERSION,\n })\n }\n return _instance\n}\n\nexport function getAppInfo(directory: string): CachedAppInfo | undefined {\n const store = cliKitStore()\n return store.getAppInfo(directory)\n}\n\nexport function setAppInfo(options: {\n directory: string\n appId?: string\n title?: string\n storeFqdn?: string\n orgId?: string\n updateURLs?: boolean\n tunnelPlugin?: string\n}): void {\n const store = cliKitStore()\n store.setAppInfo(options)\n}\n\nexport function clearAppInfo(directory: string): void {\n const store = cliKitStore()\n store.clearAppInfo(directory)\n}\n\nexport function getThemeStore(): string | undefined {\n const store = cliKitStore()\n return store.getThemeStore()\n}\n\nexport function setThemeStore(themeStore: string): void {\n const store = cliKitStore()\n store.setThemeStore(themeStore)\n}\n\nexport function getSession(): string | undefined {\n const store = cliKitStore()\n return store.getSession()\n}\n\nexport function setSession(session: string): void {\n const store = cliKitStore()\n store.setSession(session)\n}\n\nexport function removeSession(): void {\n const store = cliKitStore()\n store.removeSession()\n}\n\nexport function clearAllAppInfo(): void {\n const store = cliKitStore()\n store.clearAllAppInfo()\n}\n\nexport class CLIKitStore extends Conf<ConfSchema> {\n getAppInfo(directory: string): CachedAppInfo | undefined {\n debug(content`Reading cached app information for directory ${token.path(directory)}...`)\n const apps = this.get('appInfo') ?? []\n return apps.find((app: CachedAppInfo) => app.directory === directory)\n }\n\n setAppInfo(options: {\n directory: string\n appId?: string\n title?: string\n storeFqdn?: string\n orgId?: string\n updateURLs?: boolean\n tunnelPlugin?: string\n }): void {\n debug(content`Storing app information for directory ${token.path(options.directory)}:${token.json(options)}`)\n const apps = this.get('appInfo') ?? []\n const index = apps.findIndex((saved: CachedAppInfo) => saved.directory === options.directory)\n if (index === -1) {\n apps.push(options)\n } else {\n const app: CachedAppInfo = apps[index]!\n apps[index] = {\n directory: options.directory,\n appId: options.appId ?? app.appId,\n title: options.title ?? app.title,\n storeFqdn: options.storeFqdn ?? app.storeFqdn,\n orgId: options.orgId ?? app.orgId,\n updateURLs: options.updateURLs ?? app.updateURLs,\n tunnelPlugin: options.tunnelPlugin ?? app.tunnelPlugin,\n }\n }\n this.set('appInfo', apps)\n }\n\n clearAppInfo(directory: string): void {\n debug(content`Clearing app information for directory ${token.path(directory)}...`)\n const apps = this.get('appInfo') ?? []\n const index = apps.findIndex((saved: CachedAppInfo) => saved.directory === directory)\n if (index !== -1) {\n apps.splice(index, 1)\n }\n this.set('appInfo', apps)\n }\n\n clearAllAppInfo(): void {\n debug(content`Clearing all app information...`)\n this.set('appInfo', [])\n }\n\n getThemeStore(): string | undefined {\n debug(content`Getting theme store...`)\n return this.get('themeStore')\n }\n\n setThemeStore(themeStore: string): void {\n debug(content`Setting theme store...`)\n this.set('themeStore', themeStore)\n }\n\n getSession(): string | undefined {\n debug(content`Getting session store...`)\n return this.get('sessionStore')\n }\n\n setSession(session: string): void {\n debug(content`Setting session store...`)\n this.set('sessionStore', session)\n }\n\n removeSession(): void {\n debug(content`Removing session store...`)\n this.set('sessionStore', '')\n }\n}\n"]}
|
package/dist/testing/output.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/testing/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAEtC,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5D,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACxD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9D,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACxD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1D,KAAK,EAAE,GAAG,EAAE;YACV,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["import * as output from '../output.js'\n\nexport function mockAndCaptureOutput() {\n return {\n output: () => (output.collectedLogs.output ?? []).join('\\n'),\n info: () => (output.collectedLogs.info ?? []).join('\\n'),\n debug: () => (output.collectedLogs.debug ?? []).join('\\n'),\n success: () => (output.collectedLogs.success ?? []).join('\\n'),\n completed: () => (output.collectedLogs.completed ?? []).join('\\n'),\n warn: () => (output.collectedLogs.warn ?? []).join('\\n'),\n error: () => (output.collectedLogs.error ?? []).join('\\n'),\n clear: () => {\n output.clearCollectedLogs()\n },\n }\n}\n"]}
|
package/dist/testing/store.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CLIKitStore } from '../store.js';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a temporary configuration store and ties its lifecycle to the callback.
|
|
4
|
-
* @param callback - Callback to execute. When the callback exits, the local config is destroyed.
|
|
5
|
-
* @returns Promise that resolves with the value returned by the callback.
|
|
6
|
-
*/
|
|
7
|
-
export declare function temporaryTestStore<T>(callback: (store: CLIKitStore) => Promise<T>): Promise<T>;
|
package/dist/testing/store.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CLIKitStore } from '../store.js';
|
|
2
|
-
import { removeFile } from '../public/node/fs.js';
|
|
3
|
-
import uniqueString from 'unique-string';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a temporary configuration store and ties its lifecycle to the callback.
|
|
6
|
-
* @param callback - Callback to execute. When the callback exits, the local config is destroyed.
|
|
7
|
-
* @returns Promise that resolves with the value returned by the callback.
|
|
8
|
-
*/
|
|
9
|
-
export async function temporaryTestStore(callback) {
|
|
10
|
-
let localConf;
|
|
11
|
-
try {
|
|
12
|
-
const name = `shopify-cli-test-${uniqueString()}`;
|
|
13
|
-
localConf = new CLIKitStore({ projectName: name });
|
|
14
|
-
// eslint-disable-next-line node/callback-return
|
|
15
|
-
const result = callback(localConf);
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
finally {
|
|
19
|
-
if (localConf) {
|
|
20
|
-
await removeFile(localConf.path);
|
|
21
|
-
const configFolder = localConf.path.replace(/\/config.json$/, '');
|
|
22
|
-
await removeFile(configFolder);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/testing/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAA;AAC/C,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAI,QAA4C;IACtF,IAAI,SAAkC,CAAA;IACtC,IAAI;QACF,MAAM,IAAI,GAAG,oBAAoB,YAAY,EAAE,EAAE,CAAA;QACjD,SAAS,GAAG,IAAI,WAAW,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAA;QAChD,gDAAgD;QAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;QAClC,OAAO,MAAM,CAAA;KACd;YAAS;QACR,IAAI,SAAS,EAAE;YACb,MAAM,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;YACjE,MAAM,UAAU,CAAC,YAAY,CAAC,CAAA;SAC/B;KACF;AACH,CAAC","sourcesContent":["import {CLIKitStore} from '../store.js'\nimport {removeFile} from '../public/node/fs.js'\nimport uniqueString from 'unique-string'\n\n/**\n * Creates a temporary configuration store and ties its lifecycle to the callback.\n * @param callback - Callback to execute. When the callback exits, the local config is destroyed.\n * @returns Promise that resolves with the value returned by the callback.\n */\nexport async function temporaryTestStore<T>(callback: (store: CLIKitStore) => Promise<T>): Promise<T> {\n let localConf: CLIKitStore | undefined\n try {\n const name = `shopify-cli-test-${uniqueString()}`\n localConf = new CLIKitStore({projectName: name})\n // eslint-disable-next-line node/callback-return\n const result = callback(localConf)\n return result\n } finally {\n if (localConf) {\n await removeFile(localConf.path)\n const configFolder = localConf.path.replace(/\\/config.json$/, '')\n await removeFile(configFolder)\n }\n }\n}\n"]}
|
package/dist/testing/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/testing/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,0CAA0C,CAAA;AAGjE,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,gBAAmD;IACjG,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAA;QAEvC,IAAI,EAAE,CAAA;QAEN,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,IAAI,gBAAgB,EAAE,KAAK,YAAY,EAAE;gBACvC,aAAa,CAAC,QAAQ,CAAC,CAAA;gBACvB,OAAO,EAAE,CAAA;aACV;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC,CAAC,CAAA;AACJ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E,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;AAC/D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,cAAyC,EACzC,OAAe,EACf,GAAG,MAAgB;IAEnB,MAAM,cAAc,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,cAAyC;IAChF,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,CAAA;AACxH,CAAC","sourcesContent":["import {isTruthy} from '../private/node/environment/utilities.js'\nimport {render} from 'ink-testing-library'\n\nexport function waitForInputsToBeReady() {\n return new Promise((resolve) => setTimeout(resolve, 100))\n}\n\nexport function waitForChange(func: () => void, getChangingValue: () => string | number | undefined) {\n return new Promise<void>((resolve) => {\n const initialValue = getChangingValue()\n\n func()\n\n const interval = setInterval(() => {\n if (getChangingValue() !== initialValue) {\n clearInterval(interval)\n resolve()\n }\n }, 10)\n })\n}\n\nfunction waitFor(func: () => void, condition: () => boolean) {\n return new Promise<void>((resolve) => {\n func()\n\n const interval = setInterval(() => {\n if (condition()) {\n clearInterval(interval)\n resolve()\n }\n }, 10)\n })\n}\n\nexport function waitForContent(\n renderInstance: ReturnType<typeof render>,\n content: string,\n func: () => void = () => {},\n) {\n return waitFor(\n () => func(),\n () => renderInstance.lastFrame()!.includes(content),\n )\n}\n\nexport async function sendInputAndWaitForChange(renderInstance: ReturnType<typeof render>, ...inputs: string[]) {\n await waitForChange(() => inputs.forEach((input) => renderInstance.stdin.write(input)), renderInstance.lastFrame)\n // wait for another tick so we give time to react to update caches\n await new Promise((resolve) => setTimeout(resolve, 0))\n}\n\nexport async function sendInputAndWait(\n renderInstance: ReturnType<typeof render>,\n waitTime: number,\n ...inputs: string[]\n) {\n inputs.forEach((input) => renderInstance.stdin.write(input))\n await new Promise((resolve) => setTimeout(resolve, waitTime))\n}\n\nexport async function sendInputAndWaitForContent(\n renderInstance: ReturnType<typeof render>,\n content: string,\n ...inputs: string[]\n) {\n await waitForContent(renderInstance, content, () => inputs.forEach((input) => renderInstance.stdin.write(input)))\n}\n\nexport function getLastFrameAfterUnmount(renderInstance: ReturnType<typeof render>) {\n return isTruthy(process.env.CI) ? renderInstance.frames[renderInstance.frames.length - 2] : renderInstance.lastFrame()\n}\n"]}
|