@shopify/cli 0.6.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @shopify/cli
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 15c4491: Add Hydrogen commands to the CLI
8
+
9
+ ## 0.12.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [cb12e51]
14
+ - Updated dependencies [a999af0]
15
+ - Updated dependencies [bed0951]
16
+ - @shopify/cli-kit@0.12.0
17
+
18
+ ## 0.10.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @shopify/cli-kit@0.10.0
24
+
25
+ ## 0.8.0
26
+
27
+ ### Minor Changes
28
+
29
+ - b07c608: Rename @shopify/core to @shopify/cli-kit and finish up the create-app workflow
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [b07c608]
34
+ - @shopify/cli-kit@0.8.0
35
+
3
36
  ## 0.6.0
4
37
 
5
38
  ### Minor Changes
@@ -13,7 +46,7 @@
13
46
  - Add @shopify/support and fix dependencies' setup
14
47
  - Updated dependencies
15
48
  - @shopify/app@0.5.2
16
- - @shopify/core@0.5.2
49
+ - @shopify/cli-kit@0.5.2
17
50
  - @shopify/support@0.5.2
18
51
  - @shopify/theme@0.5.2
19
52
 
@@ -48,7 +81,7 @@
48
81
  - Updated dependencies
49
82
  - @shopify/theme@0.3.0
50
83
  - @shopify/@0.3.0
51
- - @shopify/core@0.3.0
84
+ - @shopify/cli-kit@0.3.0
52
85
  - @shopify/cli-support@0.3.0
53
86
 
54
87
  ## 0.2.0
@@ -61,6 +94,6 @@
61
94
 
62
95
  - Updated dependencies
63
96
  - @shopify/@0.2.0
64
- - @shopify/core@0.2.0
97
+ - @shopify/cli-kit@0.2.0
65
98
  - @shopify/cli-support@0.2.0
66
99
  - @shopify/theme@0.2.0
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run.js" %*
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node --no-warnings
2
+
3
+ import runCLI from "../dist/index.js";
4
+
5
+ runCLI();
package/dist/index.js CHANGED
@@ -1,12 +1,23 @@
1
- 'use strict';
1
+ import { settings, run, flush, Errors } from '@oclif/core';
2
+ import Bugsnag from '@bugsnag/js';
3
+ import { environment, error } from '@shopify/cli-kit';
2
4
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
5
+ function runCLI() {
6
+ if (environment.isDebug()) {
7
+ settings.debug = true;
8
+ } else {
9
+ Bugsnag.start({ apiKey: "9e1e6889176fd0c795d5c659225e0fae", logger: null });
10
+ }
11
+ run(void 0, import.meta.url).then(flush).catch((error$1) => {
12
+ const bugsnagHandle = new Promise((resolve) => {
13
+ Bugsnag.notify(error$1, void 0, resolve);
14
+ resolve(error$1);
15
+ });
16
+ const oclifHandle = Errors.handle;
17
+ const kitHandle = error.handler;
18
+ return bugsnagHandle.then(kitHandle).then(oclifHandle);
19
+ });
20
+ }
4
21
 
5
- var core = require('@oclif/core');
6
-
7
-
8
-
9
- Object.defineProperty(exports, 'run', {
10
- enumerable: true,
11
- get: function () { return core.run; }
12
- });
22
+ export { runCLI as default };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// CLI\nimport {run, settings, flush, Errors} from '@oclif/core';\nimport Bugsnag from '@bugsnag/js';\nimport {error as kitError, environment} from '@shopify/cli-kit';\n\nfunction runCLI() {\n if (environment.isDebug()) {\n settings.debug = true;\n } else {\n Bugsnag.start({apiKey: '9e1e6889176fd0c795d5c659225e0fae', logger: null});\n }\n\n run(undefined, import.meta.url)\n .then(flush)\n .catch((error: Error): Promise<void | Error> => {\n const bugsnagHandle = new Promise<Error>((resolve) => {\n Bugsnag.notify(error, undefined, resolve);\n resolve(error);\n });\n const oclifHandle = Errors.handle;\n const kitHandle = kitError.handler;\n // eslint-disable-next-line promise/no-nesting\n return bugsnagHandle.then(kitHandle).then(oclifHandle);\n });\n}\n\nexport default runCLI;\n"],"names":["error","kitError"],"mappings":";;;;AAGA,SAAS,MAAM,GAAG;AAClB,EAAE,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE;AAC7B,IAAI,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;AAC1B,GAAG,MAAM;AACT,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAChF,GAAG;AACH,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAACA,OAAK,KAAK;AAC5D,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;AACnD,MAAM,OAAO,CAAC,MAAM,CAACA,OAAK,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAC7C,MAAM,OAAO,CAACA,OAAK,CAAC,CAAC;AACrB,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;AACtC,IAAI,MAAM,SAAS,GAAGC,KAAQ,CAAC,OAAO,CAAC;AACvC,IAAI,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3D,GAAG,CAAC,CAAC;AACL;;;;"}
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@shopify/cli",
3
- "version": "0.6.0",
3
+ "version": "0.15.0",
4
4
  "private": false,
5
5
  "description": "A CLI tool to build for the Shopify platform",
6
+ "type": "module",
7
+ "main": "src/index.js",
8
+ "module": "src/index.js",
6
9
  "keywords": [
7
10
  "shopify",
8
11
  "shopify-cli",
@@ -10,12 +13,12 @@
10
13
  ],
11
14
  "license": "MIT",
12
15
  "bin": {
13
- "shopify": "./bin/shopify-run"
16
+ "shopify": "./bin/run.js"
14
17
  },
15
18
  "files": [
16
- "/bin",
19
+ "/bin/run.cmd",
20
+ "/bin/run.js",
17
21
  "/dist",
18
- "/npm-shrinkwrap.json",
19
22
  "/oclif.manifest.json"
20
23
  ],
21
24
  "publishConfig": {
@@ -24,14 +27,13 @@
24
27
  },
25
28
  "scripts": {
26
29
  "clean": "shx rm -rf dist",
27
- "build": "shx rm -rf dist && rollup -c",
28
- "build:watch": "tsc -b tsconfig.dist.json --watch",
29
- "prepublishOnly": "yarn run build",
30
- "lint": "prettier -c src/** && eslint src/**",
31
- "lint:fix": "prettier src/** && eslint src/** --fix",
32
- "test": "jest",
33
- "test:watch": "jest --watch",
34
- "tsc": "tsc -b --incremental"
30
+ "build": "rollup -c",
31
+ "prepack": "cross-env NODE_ENV=production yarn run build",
32
+ "lint": "prettier -c src/** && eslint src/**/*.ts",
33
+ "lint:fix": "prettier -w src/** && eslint src/**/*.ts --fix",
34
+ "test": "vitest run",
35
+ "test:watch": "vitest watch",
36
+ "tsc": "tsc --noEmit"
35
37
  },
36
38
  "eslintConfig": {
37
39
  "extends": [
@@ -40,18 +42,13 @@
40
42
  },
41
43
  "dependencies": {
42
44
  "@bugsnag/js": "^7.14.1",
43
- "@oclif/core": "^1",
44
- "@oclif/plugin-help": "^5",
45
- "@oclif/plugin-not-found": "^2.2.4"
46
- },
47
- "devDependencies": {
48
- "@shopify/app": "0.5.2",
49
- "@shopify/core": "0.5.2",
50
- "@shopify/theme": "0.5.2"
45
+ "@oclif/core": "1.3.3",
46
+ "@oclif/plugin-help": "^5.1.11",
47
+ "@shopify/cli-kit": "0.12.0"
51
48
  },
52
49
  "engine-strict": true,
53
50
  "engines": {
54
- "node": ">=12.0.0"
51
+ "node": "^14.13.1 || ^16.0.0 || ^17.0.0"
55
52
  },
56
53
  "os": [
57
54
  "darwin",
@@ -62,18 +59,20 @@
62
59
  "bin": "shopify",
63
60
  "commands": "dist/commands",
64
61
  "plugins": [
65
- "@shopify/theme",
66
- "@shopify/app",
67
62
  "@oclif/plugin-help",
68
- "@oclif/plugin-not-found"
63
+ "@shopify/app",
64
+ "@shopify/cli-hydrogen"
69
65
  ],
70
66
  "topicSeparator": " ",
71
67
  "topics": {
68
+ "hydrogen": {
69
+ "description": "Build Hydrogen storefronts"
70
+ },
72
71
  "theme": {
73
- "description": "Commands for creating, building, and publishing themes"
72
+ "description": "Build Liquid themes"
74
73
  },
75
74
  "app": {
76
- "description": "Commands for creating, building, and publishing app"
75
+ "description": "Build Shopify apps"
77
76
  }
78
77
  }
79
78
  }
package/bin/shopify-dev DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
-
5
- const path = require('path')
6
- const project = path.join(__dirname, '..', 'tsconfig.dist.json')
7
-
8
- // In dev mode -> use ts-node and dev plugins
9
- process.env.NODE_ENV = 'development'
10
-
11
- require('ts-node').register({project})
12
-
13
- // In dev mode, always show stack traces
14
- oclif.settings.debug = true;
15
-
16
- // Start the CLI
17
- oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\shopify-dev" %*
package/bin/shopify-run DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
- const Bugsnag = require('@bugsnag/js')
5
-
6
- // Set up error tracking
7
- Bugsnag.start({apiKey: "9e1e6889176fd0c795d5c659225e0fae", logger: null})
8
-
9
- // Start the CLI
10
- oclif.run().then(require('@oclif/core/flush')).catch((error) => {
11
- return new Promise((resolve, reject) => {
12
- Bugsnag.notify(error, null, resolve);
13
- }).then(oclif.Errors.handle(error));
14
- })
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\shopify-run" %*
@@ -1,524 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var path$1 = require('path');
6
- var require$$1 = require('fs');
7
- var require$$2 = require('util');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var path__default = /*#__PURE__*/_interopDefaultLegacy(path$1);
12
- var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
13
- var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
14
-
15
- function normalizeWindowsPath(input = "") {
16
- if (!input.includes("\\")) {
17
- return input;
18
- }
19
- return input.replace(/\\/g, "/");
20
- }
21
-
22
- const _UNC_REGEX = /^[/][/]/;
23
- const _UNC_DRIVE_REGEX = /^[/][/]([.]{1,2}[/])?([a-zA-Z]):[/]/;
24
- const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
25
- const sep = "/";
26
- const delimiter = ":";
27
- const normalize = function(path2) {
28
- if (path2.length === 0) {
29
- return ".";
30
- }
31
- path2 = normalizeWindowsPath(path2);
32
- const isUNCPath = path2.match(_UNC_REGEX);
33
- const hasUNCDrive = isUNCPath && path2.match(_UNC_DRIVE_REGEX);
34
- const isPathAbsolute = isAbsolute(path2);
35
- const trailingSeparator = path2[path2.length - 1] === "/";
36
- path2 = normalizeString(path2, !isPathAbsolute);
37
- if (path2.length === 0) {
38
- if (isPathAbsolute) {
39
- return "/";
40
- }
41
- return trailingSeparator ? "./" : ".";
42
- }
43
- if (trailingSeparator) {
44
- path2 += "/";
45
- }
46
- if (isUNCPath) {
47
- if (hasUNCDrive) {
48
- return `//./${path2}`;
49
- }
50
- return `//${path2}`;
51
- }
52
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
53
- };
54
- const join = function(...args) {
55
- if (args.length === 0) {
56
- return ".";
57
- }
58
- let joined;
59
- for (let i = 0; i < args.length; ++i) {
60
- const arg = args[i];
61
- if (arg.length > 0) {
62
- if (joined === void 0) {
63
- joined = arg;
64
- } else {
65
- joined += `/${arg}`;
66
- }
67
- }
68
- }
69
- if (joined === void 0) {
70
- return ".";
71
- }
72
- return normalize(joined);
73
- };
74
- const resolve = function(...args) {
75
- args = args.map((arg) => normalizeWindowsPath(arg));
76
- let resolvedPath = "";
77
- let resolvedAbsolute = false;
78
- for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
79
- const path2 = i >= 0 ? args[i] : process.cwd();
80
- if (path2.length === 0) {
81
- continue;
82
- }
83
- resolvedPath = `${path2}/${resolvedPath}`;
84
- resolvedAbsolute = isAbsolute(path2);
85
- }
86
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
87
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
88
- return `/${resolvedPath}`;
89
- }
90
- return resolvedPath.length > 0 ? resolvedPath : ".";
91
- };
92
- function normalizeString(path2, allowAboveRoot) {
93
- let res = "";
94
- let lastSegmentLength = 0;
95
- let lastSlash = -1;
96
- let dots = 0;
97
- let char = null;
98
- for (let i = 0; i <= path2.length; ++i) {
99
- if (i < path2.length) {
100
- char = path2[i];
101
- } else if (char === "/") {
102
- break;
103
- } else {
104
- char = "/";
105
- }
106
- if (char === "/") {
107
- if (lastSlash === i - 1 || dots === 1) ; else if (dots === 2) {
108
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
109
- if (res.length > 2) {
110
- const lastSlashIndex = res.lastIndexOf("/");
111
- if (lastSlashIndex === -1) {
112
- res = "";
113
- lastSegmentLength = 0;
114
- } else {
115
- res = res.slice(0, lastSlashIndex);
116
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
117
- }
118
- lastSlash = i;
119
- dots = 0;
120
- continue;
121
- } else if (res.length !== 0) {
122
- res = "";
123
- lastSegmentLength = 0;
124
- lastSlash = i;
125
- dots = 0;
126
- continue;
127
- }
128
- }
129
- if (allowAboveRoot) {
130
- res += res.length > 0 ? "/.." : "..";
131
- lastSegmentLength = 2;
132
- }
133
- } else {
134
- if (res.length > 0) {
135
- res += `/${path2.slice(lastSlash + 1, i)}`;
136
- } else {
137
- res = path2.slice(lastSlash + 1, i);
138
- }
139
- lastSegmentLength = i - lastSlash - 1;
140
- }
141
- lastSlash = i;
142
- dots = 0;
143
- } else if (char === "." && dots !== -1) {
144
- ++dots;
145
- } else {
146
- dots = -1;
147
- }
148
- }
149
- return res;
150
- }
151
- const isAbsolute = function(p) {
152
- return _IS_ABSOLUTE_RE.test(p);
153
- };
154
- const toNamespacedPath = function(p) {
155
- return normalizeWindowsPath(p);
156
- };
157
- const extname = function(p) {
158
- return path__default["default"].posix.extname(normalizeWindowsPath(p));
159
- };
160
- const relative = function(from, to) {
161
- return path__default["default"].posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
162
- };
163
- const dirname = function(p) {
164
- return path__default["default"].posix.dirname(normalizeWindowsPath(p));
165
- };
166
- const format = function(p) {
167
- return normalizeWindowsPath(path__default["default"].posix.format(p));
168
- };
169
- const basename = function(p, ext) {
170
- return path__default["default"].posix.basename(normalizeWindowsPath(p), ext);
171
- };
172
- const parse = function(p) {
173
- return path__default["default"].posix.parse(normalizeWindowsPath(p));
174
- };
175
-
176
- const _path = /*#__PURE__*/Object.freeze({
177
- __proto__: null,
178
- sep: sep,
179
- delimiter: delimiter,
180
- normalize: normalize,
181
- join: join,
182
- resolve: resolve,
183
- normalizeString: normalizeString,
184
- isAbsolute: isAbsolute,
185
- toNamespacedPath: toNamespacedPath,
186
- extname: extname,
187
- relative: relative,
188
- dirname: dirname,
189
- format: format,
190
- basename: basename,
191
- parse: parse
192
- });
193
-
194
- const index = {
195
- ..._path
196
- };
197
-
198
- var findUp$1 = {exports: {}};
199
-
200
- var locatePath = {exports: {}};
201
-
202
- var pLocate$2 = {exports: {}};
203
-
204
- var pLimit$2 = {exports: {}};
205
-
206
- var pTry$2 = {exports: {}};
207
-
208
- const pTry$1 = (fn, ...arguments_) => new Promise(resolve => {
209
- resolve(fn(...arguments_));
210
- });
211
-
212
- pTry$2.exports = pTry$1;
213
- // TODO: remove this in the next major version
214
- pTry$2.exports.default = pTry$1;
215
-
216
- const pTry = pTry$2.exports;
217
-
218
- const pLimit$1 = concurrency => {
219
- if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
220
- return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));
221
- }
222
-
223
- const queue = [];
224
- let activeCount = 0;
225
-
226
- const next = () => {
227
- activeCount--;
228
-
229
- if (queue.length > 0) {
230
- queue.shift()();
231
- }
232
- };
233
-
234
- const run = (fn, resolve, ...args) => {
235
- activeCount++;
236
-
237
- const result = pTry(fn, ...args);
238
-
239
- resolve(result);
240
-
241
- result.then(next, next);
242
- };
243
-
244
- const enqueue = (fn, resolve, ...args) => {
245
- if (activeCount < concurrency) {
246
- run(fn, resolve, ...args);
247
- } else {
248
- queue.push(run.bind(null, fn, resolve, ...args));
249
- }
250
- };
251
-
252
- const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));
253
- Object.defineProperties(generator, {
254
- activeCount: {
255
- get: () => activeCount
256
- },
257
- pendingCount: {
258
- get: () => queue.length
259
- },
260
- clearQueue: {
261
- value: () => {
262
- queue.length = 0;
263
- }
264
- }
265
- });
266
-
267
- return generator;
268
- };
269
-
270
- pLimit$2.exports = pLimit$1;
271
- pLimit$2.exports.default = pLimit$1;
272
-
273
- const pLimit = pLimit$2.exports;
274
-
275
- class EndError extends Error {
276
- constructor(value) {
277
- super();
278
- this.value = value;
279
- }
280
- }
281
-
282
- // The input can also be a promise, so we await it
283
- const testElement = async (element, tester) => tester(await element);
284
-
285
- // The input can also be a promise, so we `Promise.all()` them both
286
- const finder = async element => {
287
- const values = await Promise.all(element);
288
- if (values[1] === true) {
289
- throw new EndError(values[0]);
290
- }
291
-
292
- return false;
293
- };
294
-
295
- const pLocate$1 = async (iterable, tester, options) => {
296
- options = {
297
- concurrency: Infinity,
298
- preserveOrder: true,
299
- ...options
300
- };
301
-
302
- const limit = pLimit(options.concurrency);
303
-
304
- // Start all the promises concurrently with optional limit
305
- const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);
306
-
307
- // Check the promises either serially or concurrently
308
- const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
309
-
310
- try {
311
- await Promise.all(items.map(element => checkLimit(finder, element)));
312
- } catch (error) {
313
- if (error instanceof EndError) {
314
- return error.value;
315
- }
316
-
317
- throw error;
318
- }
319
- };
320
-
321
- pLocate$2.exports = pLocate$1;
322
- // TODO: Remove this for the next major release
323
- pLocate$2.exports.default = pLocate$1;
324
-
325
- const path = path__default["default"];
326
- const fs$1 = require$$1__default["default"];
327
- const {promisify: promisify$1} = require$$2__default["default"];
328
- const pLocate = pLocate$2.exports;
329
-
330
- const fsStat = promisify$1(fs$1.stat);
331
- const fsLStat = promisify$1(fs$1.lstat);
332
-
333
- const typeMappings = {
334
- directory: 'isDirectory',
335
- file: 'isFile'
336
- };
337
-
338
- function checkType({type}) {
339
- if (type in typeMappings) {
340
- return;
341
- }
342
-
343
- throw new Error(`Invalid type specified: ${type}`);
344
- }
345
-
346
- const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();
347
-
348
- locatePath.exports = async (paths, options) => {
349
- options = {
350
- cwd: process.cwd(),
351
- type: 'file',
352
- allowSymlinks: true,
353
- ...options
354
- };
355
- checkType(options);
356
- const statFn = options.allowSymlinks ? fsStat : fsLStat;
357
-
358
- return pLocate(paths, async path_ => {
359
- try {
360
- const stat = await statFn(path.resolve(options.cwd, path_));
361
- return matchType(options.type, stat);
362
- } catch (_) {
363
- return false;
364
- }
365
- }, options);
366
- };
367
-
368
- locatePath.exports.sync = (paths, options) => {
369
- options = {
370
- cwd: process.cwd(),
371
- allowSymlinks: true,
372
- type: 'file',
373
- ...options
374
- };
375
- checkType(options);
376
- const statFn = options.allowSymlinks ? fs$1.statSync : fs$1.lstatSync;
377
-
378
- for (const path_ of paths) {
379
- try {
380
- const stat = statFn(path.resolve(options.cwd, path_));
381
-
382
- if (matchType(options.type, stat)) {
383
- return path_;
384
- }
385
- } catch (_) {
386
- }
387
- }
388
- };
389
-
390
- var pathExists = {exports: {}};
391
-
392
- const fs = require$$1__default["default"];
393
- const {promisify} = require$$2__default["default"];
394
-
395
- const pAccess = promisify(fs.access);
396
-
397
- pathExists.exports = async path => {
398
- try {
399
- await pAccess(path);
400
- return true;
401
- } catch (_) {
402
- return false;
403
- }
404
- };
405
-
406
- pathExists.exports.sync = path => {
407
- try {
408
- fs.accessSync(path);
409
- return true;
410
- } catch (_) {
411
- return false;
412
- }
413
- };
414
-
415
- (function (module) {
416
- const path = path__default["default"];
417
- const locatePath$1 = locatePath.exports;
418
- const pathExists$1 = pathExists.exports;
419
-
420
- const stop = Symbol('findUp.stop');
421
-
422
- module.exports = async (name, options = {}) => {
423
- let directory = path.resolve(options.cwd || '');
424
- const {root} = path.parse(directory);
425
- const paths = [].concat(name);
426
-
427
- const runMatcher = async locateOptions => {
428
- if (typeof name !== 'function') {
429
- return locatePath$1(paths, locateOptions);
430
- }
431
-
432
- const foundPath = await name(locateOptions.cwd);
433
- if (typeof foundPath === 'string') {
434
- return locatePath$1([foundPath], locateOptions);
435
- }
436
-
437
- return foundPath;
438
- };
439
-
440
- // eslint-disable-next-line no-constant-condition
441
- while (true) {
442
- // eslint-disable-next-line no-await-in-loop
443
- const foundPath = await runMatcher({...options, cwd: directory});
444
-
445
- if (foundPath === stop) {
446
- return;
447
- }
448
-
449
- if (foundPath) {
450
- return path.resolve(directory, foundPath);
451
- }
452
-
453
- if (directory === root) {
454
- return;
455
- }
456
-
457
- directory = path.dirname(directory);
458
- }
459
- };
460
-
461
- module.exports.sync = (name, options = {}) => {
462
- let directory = path.resolve(options.cwd || '');
463
- const {root} = path.parse(directory);
464
- const paths = [].concat(name);
465
-
466
- const runMatcher = locateOptions => {
467
- if (typeof name !== 'function') {
468
- return locatePath$1.sync(paths, locateOptions);
469
- }
470
-
471
- const foundPath = name(locateOptions.cwd);
472
- if (typeof foundPath === 'string') {
473
- return locatePath$1.sync([foundPath], locateOptions);
474
- }
475
-
476
- return foundPath;
477
- };
478
-
479
- // eslint-disable-next-line no-constant-condition
480
- while (true) {
481
- const foundPath = runMatcher({...options, cwd: directory});
482
-
483
- if (foundPath === stop) {
484
- return;
485
- }
486
-
487
- if (foundPath) {
488
- return path.resolve(directory, foundPath);
489
- }
490
-
491
- if (directory === root) {
492
- return;
493
- }
494
-
495
- directory = path.dirname(directory);
496
- }
497
- };
498
-
499
- module.exports.exists = pathExists$1;
500
-
501
- module.exports.sync.exists = pathExists$1.sync;
502
-
503
- module.exports.stop = stop;
504
- }(findUp$1));
505
-
506
- var findUp = findUp$1.exports;
507
-
508
- function findPathUp(path, from, type) {
509
- return findUp(path, { cwd: from, type });
510
- }
511
-
512
- class FatalError extends Error {
513
- constructor(message, tryMessage = null) {
514
- super(message);
515
- this.tryMessage = tryMessage;
516
- }
517
- }
518
- class BugError extends FatalError {
519
- }
520
-
521
- exports.BugError = BugError;
522
- exports.FatalError = FatalError;
523
- exports.findPathUp = findPathUp;
524
- exports.path = index;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Build extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Build.description = "Build a block or an app";
10
-
11
- module.exports = Build;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Connect extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Connect.description = "Connect the local app to an app on Shopify";
10
-
11
- module.exports = Connect;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Dev extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Dev.description = "Develop a block or an app";
10
-
11
- module.exports = Dev;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Push extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Push.description = "Push an app to Shopify";
10
-
11
- module.exports = Push;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Test extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Test.description = "Run the tests for a given block or app";
10
-
11
- module.exports = Test;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Check extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Check.description = "Validate the theme";
10
-
11
- module.exports = Check;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Delete extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Delete.description = "Delete a remote theme";
10
-
11
- module.exports = Delete;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Init extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Init.description = "Create a new theme";
10
-
11
- module.exports = Init;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class LanguageServer extends core.Command {
6
- async run() {
7
- }
8
- }
9
- LanguageServer.description = "Start a Language Server Protocol server.";
10
-
11
- module.exports = LanguageServer;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Package extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Package.description = "Package a theme to manually upload it to the Online Store.";
10
-
11
- module.exports = Package;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Package extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Package.description = "Set a remote theme as the live theme.";
10
-
11
- module.exports = Package;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Pull extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Pull.description = "Download your remote theme files locally.";
10
-
11
- module.exports = Pull;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Push extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Push.description = "Uploads your local theme files to the connected store, overwriting the remote version if specified.";
10
-
11
- module.exports = Push;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@oclif/core');
4
-
5
- class Push extends core.Command {
6
- async run() {
7
- }
8
- }
9
- Push.description = "Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";
10
-
11
- module.exports = Push;