@shopify/cli-kit 3.36.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/cli-kit",
3
- "version": "3.36.2",
3
+ "version": "3.37.0",
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": [
package/dist/git.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import { AbortError } from './public/node/error.js';
2
- import { DefaultLogFields, ListLogLine } from 'simple-git';
3
- export declare const factory: import("simple-git").SimpleGitFactory;
4
- export declare const GitNotPresentError: () => AbortError;
5
- export declare const OutsideGitDirectoryError: (directory: string) => AbortError;
6
- export declare const NoCommitError: () => AbortError;
7
- export declare const DetachedHeadError: () => AbortError;
8
- export declare function initializeRepository(directory: string, initialBranch?: string): Promise<void>;
9
- export interface GitIgnoreTemplate {
10
- [section: string]: string[];
11
- }
12
- export declare function createGitIgnore(directory: string, template: GitIgnoreTemplate): void;
13
- export declare function downloadRepository({ repoUrl, destination, progressUpdater, shallow, latestTag, }: {
14
- repoUrl: string;
15
- destination: string;
16
- progressUpdater?: (statusString: string) => void;
17
- shallow?: boolean;
18
- latestTag?: boolean;
19
- }): Promise<void>;
20
- export declare function getLatestCommit(directory?: string): Promise<DefaultLogFields & ListLogLine>;
21
- export declare function addAll(directory?: string): Promise<void>;
22
- export declare function commit(message: string, options?: {
23
- directory?: string;
24
- author?: string;
25
- }): Promise<string>;
26
- export declare function getHeadSymbolicRef(directory?: string): Promise<string>;
27
- /**
28
- * If "git" is not present in the environment it throws
29
- * an abort error.
30
- */
31
- export declare function ensurePresentOrAbort(): Promise<void>;
32
- /**
33
- * If command run from outside a .git directory tree
34
- * it throws an abort error.
35
- */
36
- export declare function ensureInsideGitDirectory(directory?: string): Promise<void>;
package/dist/git.js DELETED
@@ -1,130 +0,0 @@
1
- import { AbortError } from './public/node/error.js';
2
- import { hasGit, isTerminalInteractive } from './public/node/environment/local.js';
3
- import { content, token, debug } from './output.js';
4
- import { appendFileSync } from './public/node/fs.js';
5
- import { cwd } from './public/node/path.js';
6
- import git from 'simple-git';
7
- export const factory = git;
8
- export const GitNotPresentError = () => {
9
- return new AbortError(`Git is necessary in the environment to continue`, content `Install ${token.link('git', 'https://git-scm.com/book/en/v2/Getting-Started-Installing-Git')}`);
10
- };
11
- export const OutsideGitDirectoryError = (directory) => {
12
- return new AbortError(`${token.path(directory)} is not a Git directory`);
13
- };
14
- export const NoCommitError = () => {
15
- return new AbortError('Must have at least one commit to run command', content `Run ${token.genericShellCommand("git commit -m 'Initial commit'")} to create your first commit.`);
16
- };
17
- export const DetachedHeadError = () => {
18
- return new AbortError("Git HEAD can't be detached to run command", content `Run ${token.genericShellCommand('git checkout [branchName]')} to reattach HEAD or see git ${token.link('documentation', 'https://git-scm.com/book/en/v2/Git-Internals-Git-References')} for more details`);
19
- };
20
- export async function initializeRepository(directory, initialBranch = 'main') {
21
- debug(content `Initializing git repository at ${token.path(directory)}...`);
22
- await ensurePresentOrAbort();
23
- // We use init and checkout instead of `init --initial-branch` because the latter is only supported in git 2.28+
24
- const repo = git(directory);
25
- await repo.init();
26
- await repo.checkoutLocalBranch(initialBranch);
27
- }
28
- export function createGitIgnore(directory, template) {
29
- debug(content `Creating .gitignore at ${token.path(directory)}...`);
30
- const filePath = `${directory}/.gitignore`;
31
- let fileContent = '';
32
- for (const [section, lines] of Object.entries(template)) {
33
- fileContent += `# ${section}\n`;
34
- fileContent += `${lines.join('\n')}\n\n`;
35
- }
36
- appendFileSync(filePath, fileContent);
37
- }
38
- export async function downloadRepository({ repoUrl, destination, progressUpdater, shallow, latestTag, }) {
39
- debug(content `Git-cloning repository ${repoUrl} into ${token.path(destination)}...`);
40
- await ensurePresentOrAbort();
41
- const [repository, branch] = repoUrl.split('#');
42
- const options = { '--recurse-submodules': null };
43
- if (branch && latestTag) {
44
- throw new AbortError("Error cloning the repository. Git can't clone the latest release with a 'branch'.");
45
- }
46
- if (branch) {
47
- options['--branch'] = branch;
48
- }
49
- if (shallow && latestTag) {
50
- throw new AbortError("Error cloning the repository. Git can't clone the latest release with the 'shallow' property.");
51
- }
52
- if (shallow) {
53
- options['--depth'] = 1;
54
- }
55
- const progress = ({ stage, progress, processed, total }) => {
56
- const updateString = `${stage}, ${processed}/${total} objects (${progress}% complete)`;
57
- if (progressUpdater)
58
- progressUpdater(updateString);
59
- };
60
- const simpleGitOptions = {
61
- progress,
62
- ...(!isTerminalInteractive() && { config: ['core.askpass=true'] }),
63
- };
64
- try {
65
- await git(simpleGitOptions).clone(repository, destination, options);
66
- if (latestTag) {
67
- const localGitRepository = git(destination);
68
- const latestTag = await getLocalLatestTag(localGitRepository, repoUrl);
69
- await localGitRepository.checkout(latestTag);
70
- }
71
- }
72
- catch (err) {
73
- if (err instanceof Error) {
74
- const abortError = new AbortError(err.message);
75
- abortError.stack = err.stack;
76
- throw abortError;
77
- }
78
- throw err;
79
- }
80
- }
81
- async function getLocalLatestTag(repository, repoUrl) {
82
- const latest = (await repository.tags()).latest;
83
- if (!latest) {
84
- throw new AbortError(`Couldn't obtain the most recent tag of the repository ${repoUrl}`);
85
- }
86
- return latest;
87
- }
88
- export async function getLatestCommit(directory) {
89
- const logs = await git({ baseDir: directory }).log({
90
- maxCount: 1,
91
- });
92
- if (!logs.latest)
93
- throw NoCommitError();
94
- return logs.latest;
95
- }
96
- export async function addAll(directory) {
97
- const simpleGit = git({ baseDir: directory });
98
- await simpleGit.raw('add', '--all');
99
- }
100
- export async function commit(message, options) {
101
- const simpleGit = git({ baseDir: options?.directory });
102
- const commitOptions = options?.author ? { '--author': options.author } : undefined;
103
- const result = await simpleGit.commit(message, commitOptions);
104
- return result.commit;
105
- }
106
- export async function getHeadSymbolicRef(directory) {
107
- const ref = await git({ baseDir: directory }).raw('symbolic-ref', '-q', 'HEAD');
108
- if (!ref)
109
- throw DetachedHeadError();
110
- return ref.trim();
111
- }
112
- /**
113
- * If "git" is not present in the environment it throws
114
- * an abort error.
115
- */
116
- export async function ensurePresentOrAbort() {
117
- if (!(await hasGit())) {
118
- throw GitNotPresentError();
119
- }
120
- }
121
- /**
122
- * If command run from outside a .git directory tree
123
- * it throws an abort error.
124
- */
125
- export async function ensureInsideGitDirectory(directory) {
126
- if (!(await git({ baseDir: directory }).checkIsRepo())) {
127
- throw OutsideGitDirectoryError(directory || cwd());
128
- }
129
- }
130
- //# sourceMappingURL=git.js.map
package/dist/git.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAC,MAAM,EAAE,qBAAqB,EAAC,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAA;AACzC,OAAO,GAAoF,MAAM,YAAY,CAAA;AAE7G,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,IAAI,UAAU,CACnB,iDAAiD,EACjD,OAAO,CAAA,WAAW,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,+DAA+D,CAAC,EAAE,CACvG,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC5D,OAAO,IAAI,UAAU,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;AAC1E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,IAAI,UAAU,C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nimport {hasGit, isTerminalInteractive} from './public/node/environment/local.js'\nimport {content, token, debug} from './output.js'\nimport {appendFileSync} from './public/node/fs.js'\nimport {cwd} from './public/node/path.js'\nimport git, {TaskOptions, SimpleGitProgressEvent, DefaultLogFields, ListLogLine, SimpleGit} from 'simple-git'\n\nexport const factory = git\n\nexport const GitNotPresentError = () => {\n return new AbortError(\n `Git is necessary in the environment to continue`,\n content`Install ${token.link('git', 'https://git-scm.com/book/en/v2/Getting-Started-Installing-Git')}`,\n )\n}\n\nexport const OutsideGitDirectoryError = (directory: string) => {\n return new AbortError(`${token.path(directory)} is not a Git directory`)\n}\n\nexport const NoCommitError = () => {\n return new AbortError(\n 'Must have at least one commit to run command',\n content`Run ${token.genericShellCommand(\"git commit -m 'Initial commit'\")} to create your first commit.`,\n )\n}\n\nexport const DetachedHeadError = () => {\n return new AbortError(\n \"Git HEAD can't be detached to run command\",\n content`Run ${token.genericShellCommand('git checkout [branchName]')} to reattach HEAD or see git ${token.link(\n 'documentation',\n 'https://git-scm.com/book/en/v2/Git-Internals-Git-References',\n )} for more details`,\n )\n}\n\nexport async function initializeRepository(directory: string, initialBranch = 'main') {\n debug(content`Initializing git repository at ${token.path(directory)}...`)\n await ensurePresentOrAbort()\n // We use init and checkout instead of `init --initial-branch` because the latter is only supported in git 2.28+\n const repo = git(directory)\n await repo.init()\n await repo.checkoutLocalBranch(initialBranch)\n}\n\nexport interface GitIgnoreTemplate {\n [section: string]: string[]\n}\nexport function createGitIgnore(directory: string, template: GitIgnoreTemplate): void {\n debug(content`Creating .gitignore at ${token.path(directory)}...`)\n const filePath = `${directory}/.gitignore`\n\n let fileContent = ''\n for (const [section, lines] of Object.entries(template)) {\n fileContent += `# ${section}\\n`\n fileContent += `${lines.join('\\n')}\\n\\n`\n }\n\n appendFileSync(filePath, fileContent)\n}\n\nexport async function downloadRepository({\n repoUrl,\n destination,\n progressUpdater,\n shallow,\n latestTag,\n}: {\n repoUrl: string\n destination: string\n progressUpdater?: (statusString: string) => void\n shallow?: boolean\n latestTag?: boolean\n}) {\n debug(content`Git-cloning repository ${repoUrl} into ${token.path(destination)}...`)\n await ensurePresentOrAbort()\n const [repository, branch] = repoUrl.split('#')\n const options: TaskOptions = {'--recurse-submodules': null}\n\n if (branch && latestTag) {\n throw new AbortError(\"Error cloning the repository. Git can't clone the latest release with a 'branch'.\")\n }\n if (branch) {\n options['--branch'] = branch\n }\n\n if (shallow && latestTag) {\n throw new AbortError(\n \"Error cloning the repository. Git can't clone the latest release with the 'shallow' property.\",\n )\n }\n if (shallow) {\n options['--depth'] = 1\n }\n\n const progress = ({stage, progress, processed, total}: SimpleGitProgressEvent) => {\n const updateString = `${stage}, ${processed}/${total} objects (${progress}% complete)`\n if (progressUpdater) progressUpdater(updateString)\n }\n\n const simpleGitOptions = {\n progress,\n ...(!isTerminalInteractive() && {config: ['core.askpass=true']}),\n }\n try {\n await git(simpleGitOptions).clone(repository!, destination, options)\n\n if (latestTag) {\n const localGitRepository = git(destination)\n const latestTag = await getLocalLatestTag(localGitRepository, repoUrl)\n await localGitRepository.checkout(latestTag)\n }\n } catch (err) {\n if (err instanceof Error) {\n const abortError = new AbortError(err.message)\n abortError.stack = err.stack\n throw abortError\n }\n throw err\n }\n}\n\nasync function getLocalLatestTag(repository: SimpleGit, repoUrl: string) {\n const latest = (await repository.tags()).latest\n\n if (!latest) {\n throw new AbortError(`Couldn't obtain the most recent tag of the repository ${repoUrl}`)\n }\n\n return latest\n}\n\nexport async function getLatestCommit(directory?: string): Promise<DefaultLogFields & ListLogLine> {\n const logs = await git({baseDir: directory}).log({\n maxCount: 1,\n })\n if (!logs.latest) throw NoCommitError()\n return logs.latest\n}\n\nexport async function addAll(directory?: string): Promise<void> {\n const simpleGit = git({baseDir: directory})\n await simpleGit.raw('add', '--all')\n}\n\nexport async function commit(message: string, options?: {directory?: string; author?: string}): Promise<string> {\n const simpleGit = git({baseDir: options?.directory})\n\n const commitOptions = options?.author ? {'--author': options.author} : undefined\n const result = await simpleGit.commit(message, commitOptions)\n\n return result.commit\n}\n\nexport async function getHeadSymbolicRef(directory?: string): Promise<string> {\n const ref = await git({baseDir: directory}).raw('symbolic-ref', '-q', 'HEAD')\n if (!ref) throw DetachedHeadError()\n return ref.trim()\n}\n\n/**\n * If \"git\" is not present in the environment it throws\n * an abort error.\n */\nexport async function ensurePresentOrAbort() {\n if (!(await hasGit())) {\n throw GitNotPresentError()\n }\n}\n\n/**\n * If command run from outside a .git directory tree\n * it throws an abort error.\n */\nexport async function ensureInsideGitDirectory(directory?: string) {\n if (!(await git({baseDir: directory}).checkIsRepo())) {\n throw OutsideGitDirectoryError(directory || cwd())\n }\n}\n"]}
@@ -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>;
@@ -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/private/node/testing/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AACrD,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/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,SAAkC,CAAA;AAEtC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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"]}