@madebyseed/seed-cli-tools 2.2.0 → 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.
- package/lib/commands/watch.js +7 -2
- package/lib/tasks/build-js.js +3 -5
- package/lib/tasks/includes/config.js +1 -0
- package/lib/tasks/shopify-cli.js +2 -1
- package/package.json +3 -2
- package/src/commands/watch.js +12 -1
- package/src/tasks/build-js.js +3 -3
- package/src/tasks/includes/config.js +1 -0
- package/src/tasks/shopify-cli.js +2 -1
package/lib/commands/watch.js
CHANGED
|
@@ -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,
|
package/lib/tasks/build-js.js
CHANGED
|
@@ -16,10 +16,6 @@ var chokidar = require('chokidar');
|
|
|
16
16
|
|
|
17
17
|
var minify = composer(uglifyjs, console);
|
|
18
18
|
|
|
19
|
-
var gulpWebpack = require('webpack-stream');
|
|
20
|
-
|
|
21
|
-
var webpack = require('webpack');
|
|
22
|
-
|
|
23
19
|
var utils = require("./includes/utilities");
|
|
24
20
|
|
|
25
21
|
var config = require('./includes/config.js');
|
|
@@ -30,7 +26,9 @@ function processThemeJs() {
|
|
|
30
26
|
messages.logProcessFiles('build:js');
|
|
31
27
|
return gulp.src([config.roots.js, "!".concat(config.roots.vendorJs)], {
|
|
32
28
|
allowEmpty: true
|
|
33
|
-
}).pipe(plumber(utils.errorHandler)).pipe(
|
|
29
|
+
}).pipe(plumber(utils.errorHandler)).pipe(include({
|
|
30
|
+
separateInputs: true
|
|
31
|
+
})).pipe(gulpif(config.optimize && !config.usesModuleBundler, minify())).pipe(gulp.dest(config.dist.assets));
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
function processVendorJs() {
|
|
@@ -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,
|
package/lib/tasks/shopify-cli.js
CHANGED
|
@@ -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, "'
|
|
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.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Seed CLI Tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"start": "npm run clean && babel -w -d lib/ src/",
|
|
9
9
|
"test": "npm run lint",
|
|
10
10
|
"prepublish": "npm test && npm run clean && babel -d lib/ src/",
|
|
11
|
+
"dev": "npm run prepublish && npm link",
|
|
11
12
|
"lint": "eslint --max-warnings 0 src/",
|
|
12
13
|
"lint-allow-warning": "eslint src/"
|
|
13
14
|
},
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"webpack-stream": "^7.0.0",
|
|
57
58
|
"yargs": "^17.0.1"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "b238f65d36559b8b10670bc8840c24c853b497f9"
|
|
60
61
|
}
|
package/src/commands/watch.js
CHANGED
|
@@ -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, {
|
package/src/tasks/build-js.js
CHANGED
|
@@ -6,8 +6,7 @@ const include = require('gulp-include');
|
|
|
6
6
|
const plumber = require('gulp-plumber');
|
|
7
7
|
const chokidar = require('chokidar');
|
|
8
8
|
const minify = composer(uglifyjs, console)
|
|
9
|
-
|
|
10
|
-
const webpack = require('webpack');
|
|
9
|
+
|
|
11
10
|
|
|
12
11
|
const utils = require("./includes/utilities");
|
|
13
12
|
const config = require('./includes/config.js');
|
|
@@ -15,9 +14,10 @@ const messages = require('./includes/messages.js');
|
|
|
15
14
|
|
|
16
15
|
function processThemeJs() {
|
|
17
16
|
messages.logProcessFiles('build:js');
|
|
17
|
+
|
|
18
18
|
return gulp.src([config.roots.js, `!${config.roots.vendorJs}`], { allowEmpty: true })
|
|
19
19
|
.pipe(plumber(utils.errorHandler))
|
|
20
|
-
.pipe(
|
|
20
|
+
.pipe(include({ separateInputs: true }))
|
|
21
21
|
.pipe(gulpif(config.optimize && !config.usesModuleBundler, minify()))
|
|
22
22
|
.pipe(gulp.dest(config.dist.assets))
|
|
23
23
|
}
|
|
@@ -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,
|
package/src/tasks/shopify-cli.js
CHANGED
|
@@ -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}'
|
|
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
|
});
|