@madebyseed/seed-cli-tools 2.2.1 → 2.3.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.
@@ -16,18 +16,23 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
16
16
  var logger = (0, _debug["default"])("seed-tools:watch");
17
17
 
18
18
  function _default(program) {
19
- 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 () {
19
+ 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("-sp, --store-password <password>", "Used for store password protected stores.", false).option("-o, --optimize", "Optimizes assets by compressing, minifying and purging.", false).action(function () {
20
20
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
21
  logger("--gulpfile ".concat(_config["default"].gulpFile));
22
22
  logger("--cwd ".concat(_config["default"].themeRoot));
23
23
  var gulpArgs = ["watch", "--gulpfile", _config["default"].gulpFile, "--cwd", _config["default"].themeRoot, "--environment", options.env];
24
- if (!options.optimize) gulpArgs.push("--skip-optimizations");
25
24
 
26
25
  if (options.store) {
27
26
  gulpArgs.push("--store");
28
27
  gulpArgs.push(options.store);
29
28
  }
30
29
 
30
+ if (options.storePassword) {
31
+ gulpArgs.push("--store-password");
32
+ gulpArgs.push(options.storePassword);
33
+ }
34
+
35
+ if (!options.optimize) gulpArgs.push("--skip-optimizations");
31
36
  process.env.NODE_ENV = options.optimize ? "production" : "development";
32
37
  (0, _crossSpawn["default"])(_config["default"].gulp, gulpArgs, {
33
38
  detached: false,
@@ -52,6 +52,7 @@ try {
52
52
  var config = {
53
53
  environment: argv.environment === "undefined" || !argv.environment ? "development" : argv.environment,
54
54
  store: argv.store === "undefined" || !argv.store ? null : argv.store,
55
+ storePassword: argv['store-password'] === "undefined" || !argv['store-password'] ? null : argv['store-password'],
55
56
  optimize: !argv["skip-optimizations"],
56
57
  nodelete: !argv["delete"],
57
58
  themeRoot: themeRoot,
@@ -17,6 +17,7 @@ var messages = require("./includes/messages");
17
17
 
18
18
  var environment = config.environment.split(/\s*,\s*|\s+/)[0];
19
19
  var store = config.store;
20
+ var storePassword = config.storePassword;
20
21
  /**
21
22
  * Initiates shopify's cli command 'shopify theme serve' on the dist folder,
22
23
  * watching files and uploading them to development store
@@ -28,7 +29,7 @@ var store = config.store;
28
29
 
29
30
  gulp.task("shopify:serve:dist", function () {
30
31
  var domain = getStoreName(config.themeRoot, store);
31
- messages.logChildProcess("'shopify theme dev --store ".concat(domain, "' on dist..."));
32
+ messages.logChildProcess("'shopify theme dev --store ".concat(domain).concat(storePassword ? " --store-password ".concat(storePassword) : '', "' on dist..."));
32
33
  var childProcess = shopifyCLI.serve(domain, {
33
34
  stdio: ["inherit", "pipe", "inherit"]
34
35
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madebyseed/seed-cli-tools",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Seed CLI Tools",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -57,5 +57,5 @@
57
57
  "webpack-stream": "^7.0.0",
58
58
  "yargs": "^17.0.1"
59
59
  },
60
- "gitHead": "bf1fc8efec7921816461f48b7c8f5fae70bb6a64"
60
+ "gitHead": "b238f65d36559b8b10670bc8840c24c853b497f9"
61
61
  }
@@ -17,6 +17,11 @@ export default function (program) {
17
17
  "Used for multi-store projects, specify the store to run the watch command for.",
18
18
  false
19
19
  )
20
+ .option(
21
+ "-sp, --store-password <password>",
22
+ "Used for store password protected stores.",
23
+ false
24
+ )
20
25
  .option(
21
26
  "-o, --optimize",
22
27
  "Optimizes assets by compressing, minifying and purging.",
@@ -36,13 +41,19 @@ export default function (program) {
36
41
  options.env,
37
42
  ];
38
43
 
39
- if (!options.optimize) gulpArgs.push("--skip-optimizations");
40
44
 
41
45
  if (options.store) {
42
46
  gulpArgs.push("--store");
43
47
  gulpArgs.push(options.store);
44
48
  }
45
49
 
50
+ if (options.storePassword) {
51
+ gulpArgs.push("--store-password");
52
+ gulpArgs.push(options.storePassword);
53
+ }
54
+
55
+ if (!options.optimize) gulpArgs.push("--skip-optimizations");
56
+
46
57
  process.env.NODE_ENV = options.optimize ? "production" : "development";
47
58
 
48
59
  spawn(config.gulp, gulpArgs, {
@@ -40,6 +40,7 @@ try {
40
40
  const config = {
41
41
  environment: (argv.environment === "undefined" || !argv.environment) ? "development" : argv.environment,
42
42
  store: (argv.store === "undefined" || !argv.store) ? null : argv.store,
43
+ storePassword: (argv['store-password'] === "undefined" || !argv['store-password']) ? null : argv['store-password'],
43
44
  optimize: !argv["skip-optimizations"],
44
45
  nodelete: !argv["delete"],
45
46
  themeRoot,
@@ -13,6 +13,7 @@ const config = require("./includes/config");
13
13
  const messages = require("./includes/messages")
14
14
  const environment = config.environment.split(/\s*,\s*|\s+/)[0];
15
15
  const store = config.store;
16
+ const storePassword = config.storePassword;
16
17
 
17
18
  /**
18
19
  * Initiates shopify's cli command 'shopify theme serve' on the dist folder,
@@ -24,7 +25,7 @@ const store = config.store;
24
25
  */
25
26
  gulp.task("shopify:serve:dist", () => {
26
27
  const domain = getStoreName(config.themeRoot, store);
27
- messages.logChildProcess(`'shopify theme dev --store ${domain}' on dist...`);
28
+ messages.logChildProcess(`'shopify theme dev --store ${domain}${storePassword ? ` --store-password ${storePassword}` : ''}' on dist...`);
28
29
  const childProcess = shopifyCLI.serve(domain, {
29
30
  stdio: ["inherit", "pipe", "inherit"],
30
31
  });