@madebyseed/seed-cli-tools 1.2.1 → 1.2.3
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 +1 -1
- package/lib/tasks/build-css.js +1 -3
- package/lib/tasks/includes/config.js +3 -5
- package/lib/utils.js +2 -2
- package/package.json +3 -3
- package/src/commands/watch.js +1 -1
- package/src/tasks/build-css.js +0 -3
- package/src/tasks/includes/config.js +3 -3
- package/src/utils.js +2 -2
package/lib/commands/watch.js
CHANGED
|
@@ -48,7 +48,7 @@ function _default(program) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var gulpArgs = ["watch", "--gulpfile", _config["default"].gulpFile, "--cwd", _config["default"].themeRoot, "--environment", options.env];
|
|
51
|
-
if (!options.optimize) gulpArgs.push("--skip-
|
|
51
|
+
if (!options.optimize) gulpArgs.push("--skip-optimizations");
|
|
52
52
|
process.env.NODE_ENV = options.optimize ? 'production' : 'development';
|
|
53
53
|
(0, _crossSpawn["default"])(_config["default"].gulp, gulpArgs, {
|
|
54
54
|
detached: false,
|
package/lib/tasks/build-css.js
CHANGED
|
@@ -6,8 +6,6 @@ var sass = require('gulp-sass')(require('sass'));
|
|
|
6
6
|
|
|
7
7
|
var postcss = require('gulp-postcss');
|
|
8
8
|
|
|
9
|
-
var cssimport = require('gulp-cssimport');
|
|
10
|
-
|
|
11
9
|
var plumber = require('gulp-plumber');
|
|
12
10
|
|
|
13
11
|
var chokidar = require('chokidar');
|
|
@@ -25,7 +23,7 @@ var messages = require('./includes/messages.js');
|
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
function processCss() {
|
|
28
|
-
return gulp.src(config.roots.css).pipe(plumber()).pipe(sass().on('error', sass.logError)).pipe(postcss(config.plugins.postcss)).pipe(
|
|
26
|
+
return gulp.src(config.roots.css).pipe(plumber()).pipe(sass().on('error', sass.logError)).pipe(postcss(config.plugins.postcss)).pipe(gulp.dest(config.dist.assets));
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
29
|
* Concatenate css via gulp-cssimport
|
|
@@ -6,8 +6,6 @@ var logger = require("debug")("seed-tools");
|
|
|
6
6
|
|
|
7
7
|
var findRoot = require("find-root");
|
|
8
8
|
|
|
9
|
-
var autoprefixer = require("autoprefixer");
|
|
10
|
-
|
|
11
9
|
var tailwindcss = require("tailwindcss");
|
|
12
10
|
|
|
13
11
|
var cssnano = require("cssnano");
|
|
@@ -50,7 +48,7 @@ try {
|
|
|
50
48
|
|
|
51
49
|
|
|
52
50
|
var config = {
|
|
53
|
-
environment: argv.environment
|
|
51
|
+
environment: argv.environment === "undefined" ? "development" : argv.environment,
|
|
54
52
|
optimize: !argv["skip-optimizations"],
|
|
55
53
|
themeRoot: themeRoot,
|
|
56
54
|
packageJson: pkg,
|
|
@@ -108,9 +106,9 @@ var config = {
|
|
|
108
106
|
cheerio: {
|
|
109
107
|
run: require("./utilities.js").processSvg
|
|
110
108
|
},
|
|
111
|
-
postcss: [tailwindcss({
|
|
109
|
+
postcss: [require('postcss-import'), tailwindcss({
|
|
112
110
|
config: join(themeRoot, tailwindConfig)
|
|
113
|
-
}), autoprefixer
|
|
111
|
+
}), require('autoprefixer')]
|
|
114
112
|
}
|
|
115
113
|
};
|
|
116
114
|
|
package/lib/utils.js
CHANGED
|
@@ -150,7 +150,7 @@ function getThemeID(themeRoot, environment) {
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
function getDevThemeID(themeRoot) {
|
|
153
|
-
return getSeedConfig(themeRoot).
|
|
153
|
+
return getSeedConfig(themeRoot).__developmentThemeId;
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Given a string, finds the first themeID and returns it, if no themeID found
|
|
@@ -190,6 +190,6 @@ function setDevThemeID(themeID) {
|
|
|
190
190
|
encoding: "utf8"
|
|
191
191
|
});
|
|
192
192
|
data = data.split(_config["default"].seedConfigDelimiter);
|
|
193
|
-
data[1] = "\n
|
|
193
|
+
data[1] = "\n __developmentThemeId: '".concat(themeID, "'") + "\n};";
|
|
194
194
|
(0, _fs.writeFileSync)(_config["default"].seedConfig, data.join(_config["default"].seedConfigDelimiter));
|
|
195
195
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madebyseed/seed-cli-tools",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Seed CLI Tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"find-root": "^1.1.0",
|
|
36
36
|
"gulp": "^4.0.2",
|
|
37
37
|
"gulp-cheerio": "^1.0.0",
|
|
38
|
-
"gulp-cssimport": "^7.0.0",
|
|
39
38
|
"gulp-ext-replace": "^0.3.0",
|
|
40
39
|
"gulp-if": "^3.0.0",
|
|
41
40
|
"gulp-include": "^2.4.1",
|
|
@@ -47,11 +46,12 @@
|
|
|
47
46
|
"gulp-uglify": "^3.0.2",
|
|
48
47
|
"gulp-zip": "^5.1.0",
|
|
49
48
|
"postcss": "^8.3.6",
|
|
49
|
+
"postcss-import": "^14.0.2",
|
|
50
50
|
"require-directory": "^2.1.1",
|
|
51
51
|
"sass": "^1.36.0",
|
|
52
52
|
"tailwindcss": "^2.2.7",
|
|
53
53
|
"vinyl-paths": "^3.0.1",
|
|
54
54
|
"yargs": "^17.0.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "c8014098190f878e6bd6623c69c9164a1d94001c"
|
|
57
57
|
}
|
package/src/commands/watch.js
CHANGED
package/src/tasks/build-css.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
const gulp = require('gulp');
|
|
2
2
|
const sass = require('gulp-sass')(require('sass'));
|
|
3
3
|
const postcss = require('gulp-postcss');
|
|
4
|
-
const cssimport = require('gulp-cssimport');
|
|
5
4
|
const plumber = require('gulp-plumber');
|
|
6
5
|
const chokidar = require('chokidar');
|
|
7
6
|
|
|
8
|
-
|
|
9
7
|
const config = require('./includes/config.js');
|
|
10
8
|
const messages = require('./includes/messages.js');
|
|
11
9
|
|
|
@@ -22,7 +20,6 @@ function processCss() {
|
|
|
22
20
|
.pipe(plumber())
|
|
23
21
|
.pipe(sass().on('error', sass.logError))
|
|
24
22
|
.pipe(postcss(config.plugins.postcss))
|
|
25
|
-
.pipe(cssimport())
|
|
26
23
|
.pipe(gulp.dest(config.dist.assets));
|
|
27
24
|
}
|
|
28
25
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const join = require("path").join;
|
|
2
2
|
const logger = require("debug")("seed-tools");
|
|
3
3
|
const findRoot = require("find-root");
|
|
4
|
-
const autoprefixer = require("autoprefixer");
|
|
5
4
|
const tailwindcss = require("tailwindcss");
|
|
6
5
|
const cssnano = require("cssnano");
|
|
7
6
|
const argv = require("minimist")(process.argv.slice(2));
|
|
@@ -41,7 +40,7 @@ try {
|
|
|
41
40
|
* @prop {Object} plugins - configuration objects passed to various plugins used in the task interface
|
|
42
41
|
*/
|
|
43
42
|
const config = {
|
|
44
|
-
environment: argv.environment
|
|
43
|
+
environment: argv.environment === "undefined" ? "development" : argv.environment,
|
|
45
44
|
optimize: !argv["skip-optimizations"],
|
|
46
45
|
themeRoot,
|
|
47
46
|
packageJson: pkg,
|
|
@@ -108,8 +107,9 @@ const config = {
|
|
|
108
107
|
run: require("./utilities.js").processSvg,
|
|
109
108
|
},
|
|
110
109
|
postcss: [
|
|
110
|
+
require('postcss-import'),
|
|
111
111
|
tailwindcss({ config: join(themeRoot, tailwindConfig) }),
|
|
112
|
-
autoprefixer
|
|
112
|
+
require('autoprefixer'),
|
|
113
113
|
],
|
|
114
114
|
},
|
|
115
115
|
};
|
package/src/utils.js
CHANGED
|
@@ -120,7 +120,7 @@ export function getThemeID(themeRoot, environment) {
|
|
|
120
120
|
* @returns {string} - development store theme ID
|
|
121
121
|
*/
|
|
122
122
|
export function getDevThemeID(themeRoot) {
|
|
123
|
-
return getSeedConfig(themeRoot).
|
|
123
|
+
return getSeedConfig(themeRoot).__developmentThemeId;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -155,6 +155,6 @@ export function logChildProcessOutput(process) {
|
|
|
155
155
|
export function setDevThemeID(themeID) {
|
|
156
156
|
let data = readFileSync(config.seedConfig, { encoding: "utf8" });
|
|
157
157
|
data = data.split(config.seedConfigDelimiter);
|
|
158
|
-
data[1] = `\n
|
|
158
|
+
data[1] = `\n __developmentThemeId: '${themeID}'` + "\n};";
|
|
159
159
|
writeFileSync(config.seedConfig, data.join(config.seedConfigDelimiter));
|
|
160
160
|
}
|