@madebyseed/seed-cli-tools 1.9.0 → 1.9.2

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.
@@ -18,11 +18,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
18
18
  var logger = (0, _debug["default"])("seed-tools:watch");
19
19
 
20
20
  function _default(program) {
21
- program.command("watch").alias("w").description("Watches files for code changes and immediately deploys updates to dev theme as they occur. " + "This uses shopify theme serve under the hood.").option("-o, --optimize", "Optimizes assets by compressing, minifying and purging.", false).action(function () {
21
+ program.command("watch").alias("w").description("Watches files for code changes and immediately deploys updates to dev theme as they occur. " + "This uses shopify theme serve under the hood.").option("-s, --store <store>", "Used for multi-store projects, specify the store to run the watch command for.", false).option("-o, --optimize", "Optimizes assets by compressing, minifying and purging.", false).action(function () {
22
22
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23
23
  logger("--gulpfile ".concat(_config["default"].gulpFile));
24
24
  logger("--cwd ".concat(_config["default"].themeRoot));
25
- if (!(0, _utils.login)()) return;
25
+ if (!(0, _utils.login)(options.store)) return;
26
26
  var gulpArgs = ["watch", "--gulpfile", _config["default"].gulpFile, "--cwd", _config["default"].themeRoot, "--environment", options.env];
27
27
  if (!options.optimize) gulpArgs.push("--skip-optimizations");
28
28
  process.env.NODE_ENV = options.optimize ? 'production' : 'development';
package/lib/utils.js CHANGED
@@ -232,7 +232,7 @@ function login(store) {
232
232
  var domain = getStoreName(_config["default"].themeRoot, store);
233
233
 
234
234
  if (!domain) {
235
- storeErrorMessage();
235
+ storeErrorMessage(store);
236
236
  return false;
237
237
  }
238
238
 
@@ -253,9 +253,16 @@ function login(store) {
253
253
  */
254
254
 
255
255
 
256
- function storeErrorMessage() {
257
- console.log("");
258
- console.log((0, _chalk.red)(" ".concat(_figures["default"].cross, " no store field in seed.config.js")));
259
- console.log(" Add 'store: <store.myshopify.com>' to your project seed.config.js");
260
- console.log("");
256
+ function storeErrorMessage(store) {
257
+ if (store) {
258
+ console.log("");
259
+ console.log((0, _chalk.red)(" The store ".concat(store, " does not exist in seed.config.js")));
260
+ console.log(" Check to see if you spelled the store correctly on seed config and when running the command.");
261
+ console.log("");
262
+ } else {
263
+ console.log("");
264
+ console.log((0, _chalk.red)(" ".concat(_figures["default"].cross, " no store field in seed.config.js. Did you forget the --store <store> argument?")));
265
+ 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");
266
+ console.log("");
267
+ }
261
268
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madebyseed/seed-cli-tools",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Seed CLI Tools",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -42,6 +42,7 @@
42
42
  "gulp-sass": "^5.0.0",
43
43
  "gulp-size": "^4.0.1",
44
44
  "gulp-uglify": "^3.0.2",
45
+ "lodash": "^4.17.21",
45
46
  "postcss": "^8.3.6",
46
47
  "postcss-import": "^14.0.2",
47
48
  "postcss-pxtorem": "^6.0.0",
@@ -55,5 +56,5 @@
55
56
  "webpack-stream": "^7.0.0",
56
57
  "yargs": "^17.0.1"
57
58
  },
58
- "gitHead": "c6bc83bb38b0ee0bd01f5d06621f8d9bfd55a355"
59
+ "gitHead": "7f8ebcb2b58202035fb018997a689463acc0b4a7"
59
60
  }
@@ -13,6 +13,11 @@ export default function (program) {
13
13
  "Watches files for code changes and immediately deploys updates to dev theme as they occur. " +
14
14
  "This uses shopify theme serve under the hood."
15
15
  )
16
+ .option(
17
+ "-s, --store <store>",
18
+ "Used for multi-store projects, specify the store to run the watch command for.",
19
+ false
20
+ )
16
21
  .option(
17
22
  "-o, --optimize",
18
23
  "Optimizes assets by compressing, minifying and purging.",
@@ -22,7 +27,7 @@ export default function (program) {
22
27
  logger(`--gulpfile ${config.gulpFile}`);
23
28
  logger(`--cwd ${config.themeRoot}`);
24
29
 
25
- if (!login()) return;
30
+ if (!login(options.store)) return;
26
31
 
27
32
  const gulpArgs = [
28
33
  "watch",
package/src/utils.js CHANGED
@@ -197,7 +197,7 @@ export function login(store) {
197
197
  const domain = getStoreName(config.themeRoot, store);
198
198
 
199
199
  if (!domain) {
200
- storeErrorMessage();
200
+ storeErrorMessage(store);
201
201
  return false;
202
202
  }
203
203
 
@@ -219,13 +219,25 @@ export function login(store) {
219
219
  /**
220
220
  * Outputs error message if there's no store field in seed config
221
221
  */
222
- export function storeErrorMessage() {
223
- console.log("");
224
- console.log(
225
- red(` ${figures.cross} no store field in seed.config.js`)
226
- );
227
- console.log(
228
- " Add 'store: <store.myshopify.com>' to your project seed.config.js"
229
- );
230
- console.log("");
231
- }
222
+ export function storeErrorMessage(store) {
223
+ if (store) {
224
+ console.log("");
225
+ console.log(
226
+ red(` The store ${store} does not exist in seed.config.js`)
227
+ );
228
+ console.log(
229
+ " Check to see if you spelled the store correctly on seed config and when running the command."
230
+ );
231
+ console.log("");
232
+ } else {
233
+ console.log("");
234
+ console.log(
235
+ red(` ${figures.cross} no store field in seed.config.js. Did you forget the --store <store> argument?`)
236
+ );
237
+ console.log(
238
+ " 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"
239
+ );
240
+ console.log("");
241
+ }
242
+
243
+ }