@madebyseed/seed-cli-tools 1.3.2 → 1.4.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/gulpfile.js CHANGED
@@ -47,7 +47,7 @@ gulp.task("watch", gulp.series("build", gulp.parallel("watch:src", "watch:dist",
47
47
  /**
48
48
  *
49
49
  * @summary pulls theme from specified environment theme into src
50
- * @function deploy
50
+ * @function pull
51
51
  * @memberof slate-cli.tasks.deploy
52
52
  * @static
53
53
  */
@@ -58,7 +58,7 @@ gulp.task("pull", gulp.series("shopify:pull:origin:src"));
58
58
  * theme using shopify theme push, by default with the --no-delete flag
59
59
  *
60
60
  * @summary pulls theme settings from specified environment theme into src
61
- * @function deploy
61
+ * @function pull:settings
62
62
  * @memberof slate-cli.tasks.deploy
63
63
  * @static
64
64
  */
@@ -83,7 +83,7 @@ gulp.task("deploy", gulp.series("sync-settings", "build", "shopify:push:dist"));
83
83
  *
84
84
  * @summary Deploy your built files to the Shopify Store set in
85
85
  * `slate-cli.config`
86
- * @function deploy
86
+ * @function deploy:no-sync
87
87
  * @memberof slate-cli.tasks.deploy:no-sync
88
88
  * @static
89
89
  */
@@ -19,6 +19,7 @@ var utils = require('./includes/utilities.js');
19
19
  var messages = require('./includes/messages.js');
20
20
 
21
21
  var assetsPaths = [config.src.assets, config.src.templates, config.src.sections, config.src.snippets, config.src.locales, config.src.config, config.src.layout];
22
+ var rootAssets = [config.shopifyIgnore];
22
23
  /**
23
24
  * Copies assets to the `/dist` directory
24
25
  *
@@ -36,6 +37,24 @@ function processAssets(files) {
36
37
  pretty: true
37
38
  })).pipe(gulp.dest(config.dist.root));
38
39
  }
40
+ /**
41
+ * Copies root assets to the `/dist` directory
42
+ *
43
+ * @param {Array} files
44
+ * @returns {Stream}
45
+ * @private
46
+ */
47
+
48
+
49
+ function processRootAssets(files) {
50
+ messages.logProcessFiles('build:assets');
51
+ return gulp.src(files, {
52
+ allowEmpty: true
53
+ }).pipe(plumber(utils.errorHandler)).pipe(size({
54
+ showFiles: true,
55
+ pretty: true
56
+ })).pipe(gulp.dest(config.dist.root));
57
+ }
39
58
  /**
40
59
  * Deletes specified files
41
60
  *
@@ -66,6 +85,7 @@ function removeAssets(files) {
66
85
 
67
86
 
68
87
  gulp.task('build:assets', function () {
88
+ processRootAssets(rootAssets);
69
89
  return processAssets(assetsPaths);
70
90
  });
71
91
  /**
@@ -86,4 +106,10 @@ gulp.task('watch:assets', function () {
86
106
  eventCache.addEvent(event, path);
87
107
  utils.processCache(eventCache, processAssets, removeAssets);
88
108
  });
109
+ chokidar.watch(rootAssets, {
110
+ ignoreInitial: true
111
+ }).on('all', function (event, path) {
112
+ messages.logFileEvent(event, path);
113
+ processRootAssets(rootAssets);
114
+ });
89
115
  });
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
 
3
- var gulp = require('gulp');
3
+ var gulp = require("gulp");
4
4
 
5
- var sass = require('gulp-sass')(require('sass'));
5
+ var sass = require("gulp-sass")(require("sass"));
6
6
 
7
- var postcss = require('gulp-postcss');
7
+ var postcss = require("gulp-postcss");
8
8
 
9
- var plumber = require('gulp-plumber');
9
+ var plumber = require("gulp-plumber");
10
10
 
11
- var chokidar = require('chokidar');
11
+ var chokidar = require("chokidar");
12
12
 
13
- var config = require('./includes/config.js');
13
+ var config = require("./includes/config.js");
14
14
 
15
- var messages = require('./includes/messages.js');
15
+ var messages = require("./includes/messages.js");
16
16
  /**
17
17
  * Concatenate css via gulp-cssimport and copys to the `/dist` folder
18
18
  *
@@ -23,7 +23,7 @@ var messages = require('./includes/messages.js');
23
23
 
24
24
 
25
25
  function processCss() {
26
- return gulp.src(config.roots.css).pipe(plumber()).pipe(postcss(config.plugins.postcss)).pipe(sass().on('error', sass.logError)).pipe(gulp.dest(config.dist.assets));
26
+ return gulp.src(config.roots.css).pipe(plumber()).pipe(postcss(config.plugins.postcss)).pipe(sass().on("error", sass.logError)).pipe(gulp.dest(config.dist.assets));
27
27
  }
28
28
  /**
29
29
  * Concatenate css via gulp-cssimport
@@ -34,7 +34,7 @@ function processCss() {
34
34
  */
35
35
 
36
36
 
37
- gulp.task('build:css', function () {
37
+ gulp.task("build:css", function () {
38
38
  return processCss();
39
39
  });
40
40
  /**
@@ -45,10 +45,10 @@ gulp.task('build:css', function () {
45
45
  * @static
46
46
  */
47
47
 
48
- gulp.task('watch:css', function () {
49
- chokidar.watch(config.src.css, {
48
+ gulp.task("watch:css", function () {
49
+ chokidar.watch([config.src.css, config.src.sections, config.src.templates, config.src.snippets, config.tailwindConfig], {
50
50
  ignoreInitial: true
51
- }).on('all', function (event, path) {
51
+ }).on("all", function (event, path) {
52
52
  messages.logFileEvent(event, path);
53
53
  processCss();
54
54
  });
@@ -61,6 +61,7 @@ var config = {
61
61
  packageJson: pkg,
62
62
  tailwindConfig: tailwindConfig,
63
63
  seedConfig: "seed.config.js",
64
+ shopifyIgnore: join(themeRoot, '.shopifyignore'),
64
65
  src: {
65
66
  root: "src/",
66
67
  js: "src/scripts/**/*.{js,js.liquid}",
@@ -71,9 +71,9 @@ gulp.task("shopify:pull:dev:tmp", function (done) {
71
71
  return shopifyCLI.pull(devThemeId, config.tmp.root);
72
72
  });
73
73
  /**
74
- * Pulls theme files from the seed config theme enviroment into src
74
+ * Pulls theme files from the seed config theme enviroment into tmp
75
75
  *
76
- * @function shopify:pull:dev
76
+ * @function shopify:pull:origin:tmp
77
77
  * @memberof seed-cli.tasks.deploy
78
78
  * @static
79
79
  */
@@ -85,7 +85,7 @@ gulp.task("shopify:pull:origin:tmp", function () {
85
85
  /**
86
86
  * Pulls theme files from the seed config theme enviroment into src
87
87
  *
88
- * @function shopify:pull:dev
88
+ * @function shopify:pull:origin:src
89
89
  * @memberof seed-cli.tasks.deploy
90
90
  * @static
91
91
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madebyseed/seed-cli-tools",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Seed CLI Tools",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -52,5 +52,5 @@
52
52
  "vinyl-paths": "^3.0.1",
53
53
  "yargs": "^17.0.1"
54
54
  },
55
- "gitHead": "664511c9ff5705270fb7146e07f92a4c51b9508b"
55
+ "gitHead": "df6244576b15e5328b84b967aff76ac6b5524a17"
56
56
  }
package/src/gulpfile.js CHANGED
@@ -67,7 +67,7 @@ gulp.task(
67
67
  /**
68
68
  *
69
69
  * @summary pulls theme from specified environment theme into src
70
- * @function deploy
70
+ * @function pull
71
71
  * @memberof slate-cli.tasks.deploy
72
72
  * @static
73
73
  */
@@ -78,7 +78,7 @@ gulp.task(
78
78
  * theme using shopify theme push, by default with the --no-delete flag
79
79
  *
80
80
  * @summary pulls theme settings from specified environment theme into src
81
- * @function deploy
81
+ * @function pull:settings
82
82
  * @memberof slate-cli.tasks.deploy
83
83
  * @static
84
84
  */
@@ -104,7 +104,7 @@ gulp.task("deploy", gulp.series("sync-settings", "build", "shopify:push:dist"));
104
104
  *
105
105
  * @summary Deploy your built files to the Shopify Store set in
106
106
  * `slate-cli.config`
107
- * @function deploy
107
+ * @function deploy:no-sync
108
108
  * @memberof slate-cli.tasks.deploy:no-sync
109
109
  * @static
110
110
  */
@@ -19,6 +19,10 @@ const assetsPaths = [
19
19
  config.src.layout,
20
20
  ];
21
21
 
22
+ const rootAssets = [
23
+ config.shopifyIgnore
24
+ ]
25
+
22
26
  /**
23
27
  * Copies assets to the `/dist` directory
24
28
  *
@@ -37,6 +41,24 @@ function processAssets(files) {
37
41
  .pipe(gulp.dest(config.dist.root));
38
42
  }
39
43
 
44
+ /**
45
+ * Copies root assets to the `/dist` directory
46
+ *
47
+ * @param {Array} files
48
+ * @returns {Stream}
49
+ * @private
50
+ */
51
+ function processRootAssets(files) {
52
+ messages.logProcessFiles('build:assets');
53
+ return gulp.src(files, { allowEmpty: true })
54
+ .pipe(plumber(utils.errorHandler))
55
+ .pipe(size({
56
+ showFiles: true,
57
+ pretty: true,
58
+ }))
59
+ .pipe(gulp.dest(config.dist.root));
60
+ }
61
+
40
62
  /**
41
63
  * Deletes specified files
42
64
  *
@@ -69,6 +91,7 @@ function removeAssets(files) {
69
91
  * @static
70
92
  */
71
93
  gulp.task('build:assets', () => {
94
+ processRootAssets(rootAssets);
72
95
  return processAssets(assetsPaths);
73
96
  });
74
97
 
@@ -90,4 +113,11 @@ gulp.task('watch:assets', () => {
90
113
  eventCache.addEvent(event, path);
91
114
  utils.processCache(eventCache, processAssets, removeAssets);
92
115
  });
116
+
117
+ chokidar.watch(rootAssets, {
118
+ ignoreInitial: true,
119
+ }).on('all', (event, path) => {
120
+ messages.logFileEvent(event, path);
121
+ processRootAssets(rootAssets);
122
+ });
93
123
  });
@@ -1,12 +1,11 @@
1
- const gulp = require('gulp');
2
- const sass = require('gulp-sass')(require('sass'));
3
- const postcss = require('gulp-postcss');
4
- const plumber = require('gulp-plumber');
5
- const chokidar = require('chokidar');
6
-
7
- const config = require('./includes/config.js');
8
- const messages = require('./includes/messages.js');
1
+ const gulp = require("gulp");
2
+ const sass = require("gulp-sass")(require("sass"));
3
+ const postcss = require("gulp-postcss");
4
+ const plumber = require("gulp-plumber");
5
+ const chokidar = require("chokidar");
9
6
 
7
+ const config = require("./includes/config.js");
8
+ const messages = require("./includes/messages.js");
10
9
 
11
10
  /**
12
11
  * Concatenate css via gulp-cssimport and copys to the `/dist` folder
@@ -16,10 +15,11 @@ const messages = require('./includes/messages.js');
16
15
  * @private
17
16
  */
18
17
  function processCss() {
19
- return gulp.src(config.roots.css)
18
+ return gulp
19
+ .src(config.roots.css)
20
20
  .pipe(plumber())
21
21
  .pipe(postcss(config.plugins.postcss))
22
- .pipe(sass().on('error', sass.logError))
22
+ .pipe(sass().on("error", sass.logError))
23
23
  .pipe(gulp.dest(config.dist.assets));
24
24
  }
25
25
 
@@ -30,7 +30,7 @@ function processCss() {
30
30
  * @memberof seed-cli.tasks.build
31
31
  * @static
32
32
  */
33
- gulp.task('build:css', () => {
33
+ gulp.task("build:css", () => {
34
34
  return processCss();
35
35
  });
36
36
 
@@ -41,10 +41,20 @@ gulp.task('build:css', () => {
41
41
  * @memberof seed-cli.tasks.watch
42
42
  * @static
43
43
  */
44
- gulp.task('watch:css', () => {
45
- chokidar.watch(config.src.css, {ignoreInitial: true})
46
- .on('all', (event, path) => {
47
- messages.logFileEvent(event, path)
44
+ gulp.task("watch:css", () => {
45
+ chokidar
46
+ .watch(
47
+ [
48
+ config.src.css,
49
+ config.src.sections,
50
+ config.src.templates,
51
+ config.src.snippets,
52
+ config.tailwindConfig,
53
+ ],
54
+ { ignoreInitial: true }
55
+ )
56
+ .on("all", (event, path) => {
57
+ messages.logFileEvent(event, path);
48
58
  processCss();
49
59
  });
50
60
  });
@@ -55,6 +55,8 @@ const config = {
55
55
 
56
56
  seedConfig: "seed.config.js",
57
57
 
58
+ shopifyIgnore: join(themeRoot, '.shopifyignore'),
59
+
58
60
  src: {
59
61
  root: "src/",
60
62
  js: "src/scripts/**/*.{js,js.liquid}",
@@ -70,9 +70,9 @@ gulp.task("shopify:pull:dev:tmp", (done) => {
70
70
  });
71
71
 
72
72
  /**
73
- * Pulls theme files from the seed config theme enviroment into src
73
+ * Pulls theme files from the seed config theme enviroment into tmp
74
74
  *
75
- * @function shopify:pull:dev
75
+ * @function shopify:pull:origin:tmp
76
76
  * @memberof seed-cli.tasks.deploy
77
77
  * @static
78
78
  */
@@ -87,7 +87,7 @@ gulp.task("shopify:pull:origin:tmp", () => {
87
87
  /**
88
88
  * Pulls theme files from the seed config theme enviroment into src
89
89
  *
90
- * @function shopify:pull:dev
90
+ * @function shopify:pull:origin:src
91
91
  * @memberof seed-cli.tasks.deploy
92
92
  * @static
93
93
  */