@madebyseed/seed-cli-tools 2.3.2 → 3.0.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.
Files changed (100) hide show
  1. package/lib/commands/build.d.ts +2 -0
  2. package/lib/commands/build.js +30 -29
  3. package/lib/commands/build.js.map +1 -0
  4. package/lib/commands/deploy.d.ts +2 -0
  5. package/lib/commands/deploy.js +47 -30
  6. package/lib/commands/deploy.js.map +1 -0
  7. package/lib/commands/pull.d.ts +2 -0
  8. package/lib/commands/pull.js +39 -29
  9. package/lib/commands/pull.js.map +1 -0
  10. package/lib/commands/watch.d.ts +2 -0
  11. package/lib/commands/watch.js +44 -40
  12. package/lib/commands/watch.js.map +1 -0
  13. package/lib/commands/zip.d.ts +2 -0
  14. package/lib/commands/zip.js +23 -25
  15. package/lib/commands/zip.js.map +1 -0
  16. package/lib/config.d.ts +3 -0
  17. package/lib/config.js +21 -28
  18. package/lib/config.js.map +1 -0
  19. package/lib/gulpfile.d.ts +1 -0
  20. package/lib/gulpfile.js +26 -33
  21. package/lib/gulpfile.js.map +1 -0
  22. package/lib/tasks/build-assets.d.ts +1 -0
  23. package/lib/tasks/build-assets.js +80 -72
  24. package/lib/tasks/build-assets.js.map +1 -0
  25. package/lib/tasks/build-css.d.ts +1 -0
  26. package/lib/tasks/build-css.js +88 -82
  27. package/lib/tasks/build-css.js.map +1 -0
  28. package/lib/tasks/build-js.d.ts +1 -0
  29. package/lib/tasks/build-js.js +78 -82
  30. package/lib/tasks/build-js.js.map +1 -0
  31. package/lib/tasks/build-svg.d.ts +1 -0
  32. package/lib/tasks/build-svg.js +51 -54
  33. package/lib/tasks/build-svg.js.map +1 -0
  34. package/lib/tasks/build-utils.d.ts +1 -0
  35. package/lib/tasks/build-utils.js +68 -49
  36. package/lib/tasks/build-utils.js.map +1 -0
  37. package/lib/tasks/includes/config.d.ts +71 -0
  38. package/lib/tasks/includes/config.js +118 -163
  39. package/lib/tasks/includes/config.js.map +1 -0
  40. package/lib/tasks/includes/messages.d.ts +19 -0
  41. package/lib/tasks/includes/messages.js +80 -72
  42. package/lib/tasks/includes/messages.js.map +1 -0
  43. package/lib/tasks/includes/utilities.d.ts +71 -0
  44. package/lib/tasks/includes/utilities.js +127 -141
  45. package/lib/tasks/includes/utilities.js.map +1 -0
  46. package/lib/tasks/shopify-cli.d.ts +1 -0
  47. package/lib/tasks/shopify-cli.js +107 -93
  48. package/lib/tasks/shopify-cli.js.map +1 -0
  49. package/lib/tasks/watchers.d.ts +1 -0
  50. package/lib/tasks/watchers.js +29 -29
  51. package/lib/tasks/watchers.js.map +1 -0
  52. package/lib/types.d.ts +53 -0
  53. package/lib/types.js +3 -0
  54. package/lib/types.js.map +1 -0
  55. package/lib/utils.d.ts +102 -0
  56. package/lib/utils.js +310 -189
  57. package/lib/utils.js.map +1 -0
  58. package/package.json +36 -16
  59. package/src/commands/build.ts +39 -0
  60. package/src/commands/deploy.ts +79 -0
  61. package/src/commands/pull.ts +58 -0
  62. package/src/commands/watch.ts +72 -0
  63. package/src/commands/zip.ts +28 -0
  64. package/src/config.ts +28 -0
  65. package/src/gulpfile.ts +134 -0
  66. package/src/tasks/build-assets.ts +135 -0
  67. package/src/tasks/build-css.ts +129 -0
  68. package/src/tasks/build-js.ts +108 -0
  69. package/src/tasks/build-svg.ts +92 -0
  70. package/src/tasks/build-utils.ts +137 -0
  71. package/src/tasks/includes/config.ts +224 -0
  72. package/src/tasks/includes/messages.ts +157 -0
  73. package/src/tasks/includes/utilities.ts +170 -0
  74. package/src/tasks/shopify-cli.ts +199 -0
  75. package/src/tasks/watchers.ts +50 -0
  76. package/src/types/declarations.d.ts +72 -0
  77. package/src/types.ts +84 -0
  78. package/src/utils.ts +444 -0
  79. package/tsconfig.json +14 -0
  80. package/tsconfig.tsbuildinfo +1 -0
  81. package/.babelrc +0 -3
  82. package/.eslintrc +0 -8
  83. /package/{src → src-legacy}/commands/build.js +0 -0
  84. /package/{src → src-legacy}/commands/deploy.js +0 -0
  85. /package/{src → src-legacy}/commands/pull.js +0 -0
  86. /package/{src → src-legacy}/commands/watch.js +0 -0
  87. /package/{src → src-legacy}/commands/zip.js +0 -0
  88. /package/{src → src-legacy}/config.js +0 -0
  89. /package/{src → src-legacy}/gulpfile.js +0 -0
  90. /package/{src → src-legacy}/tasks/build-assets.js +0 -0
  91. /package/{src → src-legacy}/tasks/build-css.js +0 -0
  92. /package/{src → src-legacy}/tasks/build-js.js +0 -0
  93. /package/{src → src-legacy}/tasks/build-svg.js +0 -0
  94. /package/{src → src-legacy}/tasks/build-utils.js +0 -0
  95. /package/{src → src-legacy}/tasks/includes/config.js +0 -0
  96. /package/{src → src-legacy}/tasks/includes/messages.js +0 -0
  97. /package/{src → src-legacy}/tasks/includes/utilities.js +0 -0
  98. /package/{src → src-legacy}/tasks/shopify-cli.js +0 -0
  99. /package/{src → src-legacy}/tasks/watchers.js +0 -0
  100. /package/{src → src-legacy}/utils.js +0 -0
package/lib/utils.js CHANGED
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.shopifyCLI = void 0;
7
+ exports.getProjectConfig = getProjectConfig;
6
8
  exports.getSeedConfig = getSeedConfig;
7
9
  exports.getStoreName = getStoreName;
10
+ exports.getStorePassword = getStorePassword;
11
+ exports.getLiveThemeId = getLiveThemeId;
12
+ exports.duplicateTheme = duplicateTheme;
13
+ exports.duplicateFromLive = duplicateFromLive;
8
14
  exports.getThemeID = getThemeID;
9
15
  exports.getDevThemeID = getDevThemeID;
10
16
  exports.extractThemeId = extractThemeId;
@@ -12,159 +18,287 @@ exports.logChildProcessOutput = logChildProcessOutput;
12
18
  exports.setDevThemeID = setDevThemeID;
13
19
  exports.login = login;
14
20
  exports.storeErrorMessage = storeErrorMessage;
15
- exports.shopifyCLI = void 0;
16
-
17
- var _chalk = require("chalk");
18
-
19
- var _figures = _interopRequireDefault(require("figures"));
20
-
21
- var _crossSpawn = _interopRequireDefault(require("cross-spawn"));
22
-
23
- var _path = require("path");
24
-
25
- var _fs = require("fs");
26
-
27
- var _config = _interopRequireDefault(require("./config"));
28
-
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
30
-
31
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
32
-
33
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
34
-
35
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
-
21
+ const chalk_1 = require("chalk");
22
+ const figures_1 = __importDefault(require("figures"));
23
+ const cross_spawn_1 = __importDefault(require("cross-spawn"));
24
+ const path_1 = require("path");
25
+ const fs_1 = require("fs");
26
+ const config_1 = __importDefault(require("./config"));
37
27
  /**
38
- * Wrappers for Shopify CLI commands
28
+ * Get seed.project.json from project root dir
39
29
  *
40
- * @summary a set of utility functions used to wrap shopify's CLI
41
- * @namespace seed-cli.shopifyCLI
42
- * @memberof seed-cli
30
+ * @param {string} themeRoot - the path to theme root dir
31
+ * @returns {SeedProjectConfig | null} - project config object or null if not found
43
32
  */
44
- var shopifyCLI = {
45
- /**
46
- * shopify login
47
- *
48
- * @memberof seed-cli.shopifyCLI
49
- * @param {string} store - store's myshopify domain name
50
- * @returns {object} - spawnSync object or, node's <ChildProcess> object if async
51
- */
52
- login: function login(store) {
53
- var args = ["switch", "--store", store];
54
- var options = {
55
- env: process.env,
56
- stdio: "inherit",
57
- shell: true
58
- };
59
- return _crossSpawn["default"].sync("shopify", args, options);
60
- },
61
-
62
- /**
63
- * shopify theme serve
64
- *
65
- * @memberof seed-cli.shopifyCLI
66
- * @param {object} options - node spawn options
67
- * @returns {object} - node's ChildProcess
68
- */
69
- serve: function serve(store) {
70
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
71
- return (0, _crossSpawn["default"])("shopify theme", ["dev", "--store", store, "--path", "dist"], _objectSpread({
72
- env: process.env,
73
- stdio: "inherit",
74
- shell: true
75
- }, options));
76
- },
77
-
78
- /**
79
- * shopify theme push
80
- *
81
- * @memberof seed-cli.shopifyCLI
82
- * @param {string} themeId - shopify theme id to pull from
83
- * @param {string} dir - directory to pull into
84
- * @param {boolean} [nodelete = true] - run command with --no-delete flag
85
- * @returns {object} - node's ChildProcess
86
- */
87
- pull: function pull(store) {
88
- var themeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
89
- var dir = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "./src";
90
- var nodelete = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
91
- var args = ["pull", "--store", store];
92
- if (themeId) args = args.concat(["--theme", themeId, "--path", dir]);
93
- if (nodelete) args.push("--nodelete");
94
- return (0, _crossSpawn["default"])("shopify theme", args, {
95
- env: process.env,
96
- stdio: "inherit",
97
- shell: true
98
- });
99
- },
100
-
101
- /**
102
- * shopify theme push
103
- *
104
- * @memberof seed-cli.shopifyCLI
105
- * @param {string} themeId - shopify theme id to push into
106
- * @param {boolean} [nodelete = true] - run command with --no-delete flag
107
- * @returns {ChildProcess} - node's ChildProcess
108
- */
109
- push: function push(store) {
110
- var themeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
111
- var nodelete = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
112
- var args = ["push", "--store", store, "--path", "dist"];
113
- if (themeId) args = args.concat(["--theme", themeId]);
114
- if (nodelete) args.push("--nodelete");
115
- return (0, _crossSpawn["default"])("shopify theme", args, {
116
- env: process.env,
117
- stdio: "inherit",
118
- shell: true
119
- });
120
- },
121
-
122
- /**
123
- * shopify theme package
124
- *
125
- * @memberof seed-cli.shopifyCLI
126
- * @returns {ChildProcess}
127
- */
128
- "package": function _package() {
129
- return (0, _crossSpawn["default"])("shopify theme", ["package", "--path", "dist"], {
130
- env: process.env,
131
- stdio: "inherit",
132
- shell: true
133
- });
134
- }
135
- };
33
+ function getProjectConfig(themeRoot) {
34
+ console.log(require((0, path_1.join)(themeRoot, "seed.project.json")));
35
+ return require((0, path_1.join)(themeRoot, "seed.project.json"));
36
+ }
136
37
  /**
137
38
  * Get seed.config.js from project root dir
138
39
  *
139
40
  * @param {string} themeRoot - the path to theme root dir
41
+ * @returns {SeedConfig} - seed config object
140
42
  */
141
-
142
- exports.shopifyCLI = shopifyCLI;
143
-
144
43
  function getSeedConfig(themeRoot) {
145
- return require((0, _path.join)(themeRoot, "seed.config.js"));
44
+ return require((0, path_1.join)(themeRoot, "seed.config.js"));
146
45
  }
147
46
  /**
148
- * Get store name from seed.config.js
47
+ * Get store name from seed.project.json or seed.config.js
149
48
  *
150
49
  * @param {string} themeRoot - the path to theme root dir
50
+ * @param {string} [store] - optional store name, defaults to "main"
51
+ * @returns {string | undefined} - store domain or undefined if not found
151
52
  */
152
-
153
-
154
53
  function getStoreName(themeRoot, store) {
155
- return store ? getSeedConfig(themeRoot).stores[store].domain : getSeedConfig(themeRoot).store;
54
+ // Default to "main" if no store specified
55
+ const storeKey = store || "main";
56
+ // Try to get from project config first
57
+ const projectConfig = getProjectConfig(themeRoot);
58
+ if (projectConfig?.stores?.[storeKey]) {
59
+ return projectConfig.stores[storeKey].domain;
60
+ }
61
+ // Fallback to legacy config
62
+ const legacyConfig = getSeedConfig(themeRoot);
63
+ return store && legacyConfig.stores?.[store]
64
+ ? legacyConfig.stores[store].domain
65
+ : legacyConfig.store;
66
+ }
67
+ /**
68
+ * Get store password from seed.project.json
69
+ *
70
+ * @param {string} themeRoot - the path to theme root dir
71
+ * @param {string} [store] - optional store name, defaults to "main"
72
+ * @returns {string | undefined} - store password or undefined if not found
73
+ */
74
+ function getStorePassword(themeRoot, store) {
75
+ const storeKey = store || "main";
76
+ const projectConfig = getProjectConfig(themeRoot);
77
+ return projectConfig?.stores?.[storeKey]?.password;
78
+ }
79
+ /**
80
+ * Wrappers for Shopify CLI commands
81
+ *
82
+ * @summary a set of utility functions used to wrap shopify's CLI
83
+ * @namespace seed-cli.shopifyCLI
84
+ * @memberof seed-cli
85
+ */
86
+ exports.shopifyCLI = {
87
+ /**
88
+ * shopify login
89
+ *
90
+ * @memberof seed-cli.shopifyCLI
91
+ * @param {string} store - store's myshopify domain name
92
+ * @returns {object} - spawnSync object or, node's <ChildProcess> object if async
93
+ */
94
+ login: (store) => {
95
+ const args = ["switch", "--store", store];
96
+ const options = {
97
+ env: process.env,
98
+ stdio: "inherit",
99
+ shell: true,
100
+ };
101
+ return cross_spawn_1.default.sync("shopify", args, options);
102
+ },
103
+ /**
104
+ * shopify theme serve
105
+ *
106
+ * @memberof seed-cli.shopifyCLI
107
+ * @param {string} store - store's myshopify domain name
108
+ * @param {object} options - node spawn options
109
+ * @returns {object} - node's ChildProcess
110
+ */
111
+ serve: (store, options = {}) => {
112
+ return (0, cross_spawn_1.default)("shopify theme", ["dev", "--store", store, "--path", "dist"], {
113
+ env: process.env,
114
+ stdio: "inherit",
115
+ shell: true,
116
+ ...options,
117
+ });
118
+ },
119
+ /**
120
+ * shopify theme pull
121
+ *
122
+ * @memberof seed-cli.shopifyCLI
123
+ * @param {string} store - store's myshopify domain name
124
+ * @param {string} themeId - shopify theme id to pull from
125
+ * @param {string} dir - directory to pull into
126
+ * @param {boolean} [nodelete = true] - run command with --no-delete flag
127
+ * @returns {object} - node's ChildProcess
128
+ */
129
+ pull: (store, themeId, dir = "./src", nodelete = true) => {
130
+ let args = ["pull", "--store", store];
131
+ if (themeId)
132
+ args = args.concat(["--theme", themeId, "--path", dir]);
133
+ if (nodelete)
134
+ args.push("--nodelete");
135
+ return (0, cross_spawn_1.default)("shopify theme", args, {
136
+ env: process.env,
137
+ stdio: "inherit",
138
+ shell: true,
139
+ });
140
+ },
141
+ /**
142
+ * shopify theme push
143
+ *
144
+ * @memberof seed-cli.shopifyCLI
145
+ * @param {string} store - store's myshopify domain name
146
+ * @param {string} themeId - shopify theme id to push into
147
+ * @param {boolean} [nodelete = true] - run command with --no-delete flag
148
+ * @returns {ChildProcess} - node's ChildProcess
149
+ */
150
+ push: (store, themeId, nodelete = true) => {
151
+ let args = ["push", "--store", store, "--path", "dist"];
152
+ if (themeId)
153
+ args = args.concat(["--theme", themeId]);
154
+ if (nodelete)
155
+ args.push("--nodelete");
156
+ return (0, cross_spawn_1.default)("shopify theme", args, {
157
+ env: process.env,
158
+ stdio: "inherit",
159
+ shell: true,
160
+ });
161
+ },
162
+ /**
163
+ * shopify theme package
164
+ *
165
+ * @memberof seed-cli.shopifyCLI
166
+ * @returns {ChildProcess} - node's ChildProcess
167
+ */
168
+ package: () => {
169
+ return (0, cross_spawn_1.default)("shopify theme", ["package", "--path", "dist"], {
170
+ env: process.env,
171
+ stdio: "inherit",
172
+ shell: true,
173
+ });
174
+ },
175
+ /**
176
+ * shopify theme list
177
+ *
178
+ * @memberof seed-cli.shopifyCLI
179
+ * @param {string} store - store's myshopify domain name
180
+ * @param {object} options - additional options (role, json, etc.)
181
+ * @returns {ChildProcess} - node's ChildProcess
182
+ */
183
+ list: (store, options = {}) => {
184
+ let args = ["list", "--store", store];
185
+ if (options.role)
186
+ args = args.concat(["--role", options.role]);
187
+ if (options.json)
188
+ args.push("--json");
189
+ return (0, cross_spawn_1.default)("shopify theme", args, {
190
+ env: process.env,
191
+ stdio: options.json ? "pipe" : "inherit",
192
+ shell: true,
193
+ });
194
+ },
195
+ /**
196
+ * shopify theme duplicate
197
+ *
198
+ * @memberof seed-cli.shopifyCLI
199
+ * @param {string} store - store's myshopify domain name
200
+ * @param {string} themeId - theme ID to duplicate
201
+ * @param {string} [name] - optional name for the duplicated theme
202
+ * @param {boolean} [json] - return JSON output
203
+ * @returns {ChildProcess} - node's ChildProcess
204
+ */
205
+ duplicate: (store, themeId, name, json = false) => {
206
+ let args = ["duplicate", "--store", store, "--theme", themeId, "--force"];
207
+ if (name)
208
+ args = args.concat(["--name", name]);
209
+ if (json)
210
+ args.push("--json");
211
+ return (0, cross_spawn_1.default)("shopify theme", args, {
212
+ env: process.env,
213
+ stdio: json ? "pipe" : "inherit",
214
+ shell: true,
215
+ });
216
+ },
217
+ };
218
+ /**
219
+ * Get the live theme ID from a store
220
+ */
221
+ async function getLiveThemeId(store) {
222
+ return new Promise((resolve, reject) => {
223
+ const listProcess = exports.shopifyCLI.list(store, { role: "live", json: true });
224
+ let output = "";
225
+ let errorOutput = "";
226
+ listProcess.stdout?.on("data", (data) => {
227
+ output += data.toString();
228
+ });
229
+ listProcess.stderr?.on("data", (data) => {
230
+ errorOutput += data.toString();
231
+ });
232
+ listProcess.on("close", (code) => {
233
+ if (code !== 0) {
234
+ reject(new Error(`Failed to get live theme: ${errorOutput}`));
235
+ return;
236
+ }
237
+ try {
238
+ const response = JSON.parse(output);
239
+ const liveTheme = response.themes?.find((theme) => theme.role === "live");
240
+ if (!liveTheme) {
241
+ reject(new Error("No live theme found"));
242
+ return;
243
+ }
244
+ resolve(liveTheme.id.toString());
245
+ }
246
+ catch (error) {
247
+ reject(new Error(`Failed to parse theme list response: ${error}`));
248
+ }
249
+ });
250
+ });
251
+ }
252
+ /**
253
+ * Duplicate a theme and return the new theme ID
254
+ */
255
+ async function duplicateTheme(store, sourceThemeId, name) {
256
+ return new Promise((resolve, reject) => {
257
+ const duplicateProcess = exports.shopifyCLI.duplicate(store, sourceThemeId, name, true);
258
+ let output = "";
259
+ let errorOutput = "";
260
+ duplicateProcess.stdout?.on("data", (data) => {
261
+ output += data.toString();
262
+ });
263
+ duplicateProcess.stderr?.on("data", (data) => {
264
+ errorOutput += data.toString();
265
+ });
266
+ duplicateProcess.on("close", (code) => {
267
+ if (code !== 0) {
268
+ reject(new Error(`Failed to duplicate theme: ${errorOutput}`));
269
+ return;
270
+ }
271
+ try {
272
+ const response = JSON.parse(output);
273
+ resolve(response.theme.id.toString());
274
+ }
275
+ catch (error) {
276
+ reject(new Error(`Failed to parse duplicate response: ${error}`));
277
+ }
278
+ });
279
+ });
280
+ }
281
+ /**
282
+ * Duplicate a theme from live theme
283
+ */
284
+ async function duplicateFromLive(store, name) {
285
+ const liveThemeId = await getLiveThemeId(store);
286
+ const newThemeId = await duplicateTheme(store, liveThemeId, name);
287
+ return newThemeId;
156
288
  }
157
289
  /**
158
290
  * Get theme ID from seed.config.js
159
291
  *
160
292
  * @param {string} themeRoot - the path to theme root dir
161
293
  * @param {string} environment - theme name/environment
294
+ * @param {string} [store] - optional store name
162
295
  * @returns {string} themeID
163
296
  */
164
-
165
-
166
297
  function getThemeID(themeRoot, environment, store) {
167
- return store ? getSeedConfig(themeRoot).stores[store].themes[environment] : getSeedConfig(themeRoot).themes[environment];
298
+ const config = getSeedConfig(themeRoot);
299
+ return store && config.stores?.[store]
300
+ ? config.stores[store].themes[environment]
301
+ : config.themes?.[environment];
168
302
  }
169
303
  /**
170
304
  * Get dev theme ID from seed.config.js
@@ -172,10 +306,8 @@ function getThemeID(themeRoot, environment, store) {
172
306
  * @param {string} themeRoot - the path to theme root dir
173
307
  * @returns {string} - development store theme ID
174
308
  */
175
-
176
-
177
309
  function getDevThemeID(themeRoot) {
178
- return getSeedConfig(themeRoot).__developmentThemeId;
310
+ return getSeedConfig(themeRoot).__developmentThemeId;
179
311
  }
180
312
  /**
181
313
  * Given a string, finds the first themeID and returns it, if no themeID found
@@ -184,82 +316,71 @@ function getDevThemeID(themeRoot) {
184
316
  * @param {string} string - string to extract theme id from
185
317
  * @return {string|boolean} - themeID or false if not found
186
318
  */
187
-
188
-
189
319
  function extractThemeId(string) {
190
- var regex = /\d{12}/;
191
- var match = string.match(regex);
192
- return match && match.length ? match[0] : false;
320
+ const regex = /\d{12}/;
321
+ const match = string.match(regex);
322
+ return match && match.length ? match[0] : false;
193
323
  }
194
324
  /**
195
325
  * Logs out to terminal the output of a piped child process
196
326
  *
197
327
  * @param {child_process} serveProcess shopify cli serve spawned child process
198
328
  */
199
-
200
-
201
329
  function logChildProcessOutput(process) {
202
- process.stdout.on("data", function (data) {
203
- console.log(data);
204
- });
330
+ process.stdout?.on("data", (data) => {
331
+ console.log(data.toString());
332
+ });
205
333
  }
206
334
  /**
207
335
  * Writes the development theme ID as a key to seed config file
208
336
  *
209
337
  * @param {string} themeID - development theme ID
210
338
  */
211
-
212
-
213
339
  function setDevThemeID(themeID) {
214
- var data = (0, _fs.readFileSync)(_config["default"].seedConfig, {
215
- encoding: "utf8"
216
- });
217
- data = data.split(_config["default"].seedConfigDelimiter);
218
- data[1] = "\n __developmentThemeId: '".concat(themeID, "'") + "\n};";
219
- (0, _fs.writeFileSync)(_config["default"].seedConfig, data.join(_config["default"].seedConfigDelimiter));
340
+ const data = (0, fs_1.readFileSync)(config_1.default.seedConfig, { encoding: "utf8" }).split(config_1.default.seedConfigDelimiter);
341
+ data[1] = `\n __developmentThemeId: '${themeID}'` + "\n};";
342
+ (0, fs_1.writeFileSync)(config_1.default.seedConfig, data.join(config_1.default.seedConfigDelimiter));
220
343
  }
221
344
  /**
222
345
  * Logs into seed config shopify store while logging useful messages
223
346
  * and handling errors.
224
- * @returns {boolean} whether login was succesful or not
347
+ *
348
+ * @param {string} [store] - optional store name, defaults to "main"
349
+ * @returns {boolean} whether login was successful or not
225
350
  */
226
-
227
-
228
351
  function login(store) {
229
- var domain = getStoreName(_config["default"].themeRoot, store);
230
-
231
- if (!domain) {
232
- storeErrorMessage(store);
233
- return false;
234
- }
235
-
236
- console.log("Logging into ".concat((0, _chalk.yellow)(domain), " with Shopify CLI..."));
237
- var loginProcess = shopifyCLI.login(domain);
238
-
239
- if (loginProcess.error) {
240
- console.log("");
241
- console.log((0, _chalk.red)(" ".concat(_figures["default"].cross, " Failed logging into ").concat(domain, ", are you sure you're using the correct account?")));
242
- console.log("");
243
- return false;
244
- }
245
-
246
- return true;
352
+ const domain = getStoreName(config_1.default.themeRoot, store);
353
+ if (!domain) {
354
+ storeErrorMessage(store);
355
+ return false;
356
+ }
357
+ console.log(`Logging into ${(0, chalk_1.yellow)(domain)} with Shopify CLI...`);
358
+ const loginProcess = exports.shopifyCLI.login(domain);
359
+ if (loginProcess.error) {
360
+ console.log("");
361
+ console.log((0, chalk_1.red)(` ${figures_1.default.cross} Failed logging into ${domain}, are you sure you're using the correct account?`));
362
+ console.log("");
363
+ return false;
364
+ }
365
+ return true;
247
366
  }
248
367
  /**
249
368
  * Outputs error message if there's no store field in seed config
369
+ *
370
+ * @param {string} [store] - optional store name that was not found
250
371
  */
251
-
252
-
253
372
  function storeErrorMessage(store) {
254
- if (store) {
255
- console.log("");
256
- console.log((0, _chalk.red)(" The store ".concat(store, " does not exist in seed.config.js")));
257
- console.log(" Check to see if you spelled the store correctly on seed config and when running the command.");
258
- console.log("");
259
- } else {
260
- console.log("");
261
- console.log((0, _chalk.red)(" ".concat(_figures["default"].cross, " no store field in seed.config.js. Did you forget the --store <store> argument?")));
262
- console.log(" If this is a multi-store project, please specify which store to watch, else add 'store: <store.myshopify.com>' to your project seed.config.js");
263
- console.log("");
264
- }
265
- }
373
+ if (store) {
374
+ console.log("");
375
+ console.log((0, chalk_1.red)(` The store ${store} does not exist in seed.project.json or seed.config.js`));
376
+ console.log(" Check to see if you spelled the store correctly in your config files and when running the command.");
377
+ console.log("");
378
+ }
379
+ else {
380
+ console.log("");
381
+ console.log((0, chalk_1.red)(` ${figures_1.default.cross} No 'main' store found in seed.project.json or seed.config.js`));
382
+ console.log(" Add a 'main' store to your seed.project.json or specify which store to use with --store <store>");
383
+ console.log("");
384
+ }
385
+ }
386
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;AAeA,4CAIC;AAQD,sCAEC;AASD,oCAkBC;AASD,4CAOC;AAwJD,wCAqCC;AAKD,wCAqCC;AAKD,8CAOC;AAUD,gCASC;AAQD,sCAEC;AASD,wCAIC;AAOD,sDAIC;AAOD,sCAMC;AASD,sBAsBC;AAOD,8CAwBC;AA3bD,iCAAoC;AACpC,sDAA8B;AAC9B,8DAAgC;AAEhC,+BAA4B;AAC5B,2BAA6D;AAC7D,sDAA8B;AAG9B;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,SAAiB;IAChD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAE3D,OAAO,OAAO,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,SAAiB;IAC7C,OAAO,OAAO,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,SAAiB,EACjB,KAAc;IAEd,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,KAAK,IAAI,MAAM,CAAC;IAEjC,uCAAuC;IACvC,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,IAAI,aAAa,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;IAC/C,CAAC;IAED,4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