sdc-build-wp 1.3.1 → 1.3.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.
- package/lib/logging.js +3 -3
- package/lib/scripts.js +1 -3
- package/lib/style.js +2 -5
- package/package.json +6 -6
package/lib/logging.js
CHANGED
|
@@ -11,7 +11,7 @@ function log(type, ...messages) {
|
|
|
11
11
|
case 'success':
|
|
12
12
|
console.log.call(
|
|
13
13
|
console,
|
|
14
|
-
chalk.green('
|
|
14
|
+
chalk.green('✔'),
|
|
15
15
|
chalk.gray(getTime()),
|
|
16
16
|
...messages
|
|
17
17
|
);
|
|
@@ -19,7 +19,7 @@ function log(type, ...messages) {
|
|
|
19
19
|
case 'error':
|
|
20
20
|
console.log.call(
|
|
21
21
|
console,
|
|
22
|
-
chalk.red('
|
|
22
|
+
chalk.red('✖'),
|
|
23
23
|
chalk.bgRed.gray(getTime()),
|
|
24
24
|
...messages
|
|
25
25
|
);
|
|
@@ -27,7 +27,7 @@ function log(type, ...messages) {
|
|
|
27
27
|
case 'warn':
|
|
28
28
|
console.log.call(
|
|
29
29
|
console,
|
|
30
|
-
chalk.yellow('
|
|
30
|
+
chalk.yellow('⚠'),
|
|
31
31
|
chalk.bgYellow.gray(getTime()),
|
|
32
32
|
...messages
|
|
33
33
|
);
|
package/lib/scripts.js
CHANGED
|
@@ -5,14 +5,12 @@ import esbuild from 'esbuild';
|
|
|
5
5
|
import { ESLint } from 'eslint';
|
|
6
6
|
import { readFile } from 'fs/promises';
|
|
7
7
|
|
|
8
|
-
const eslintConfig = JSON.parse(await readFile(new URL('../.eslintrc', import.meta.url)))
|
|
9
|
-
|
|
10
8
|
const buildJS = async (entry) => {
|
|
11
9
|
let entryLabel = `/dist/scripts/${path.parse(entry).base.replace('.js', '.min.js')}`;
|
|
12
10
|
let timerStart = Date.now();
|
|
13
11
|
try {
|
|
14
12
|
const eslint = new ESLint({
|
|
15
|
-
baseConfig:
|
|
13
|
+
baseConfig: JSON.parse(await readFile(new URL('../.eslintrc', import.meta.url))),
|
|
16
14
|
fix: true
|
|
17
15
|
});
|
|
18
16
|
const lintresults = await eslint.lintFiles([entry]);
|
package/lib/style.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
3
4
|
import project from '../lib/project.js';
|
|
4
5
|
import log from './logging.js';
|
|
5
6
|
import sass from 'sass';
|
|
@@ -7,17 +8,13 @@ import postcss from 'postcss';
|
|
|
7
8
|
import autoprefixer from 'autoprefixer';
|
|
8
9
|
import sortMQ from 'postcss-sort-media-queries';
|
|
9
10
|
import stylelint from 'stylelint';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
import { dirname } from 'path';
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
14
11
|
|
|
15
12
|
const buildSass = (entry) => {
|
|
16
13
|
let timerStart = Date.now();
|
|
17
14
|
let outFile = project.path + '/dist/style/' + path.parse(entry).name + '.min.css';
|
|
18
15
|
let entryLabel = outFile.replace(project.path, '');
|
|
19
16
|
stylelint.lint({
|
|
20
|
-
configFile: path.resolve(
|
|
17
|
+
configFile: path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../.stylelintrc'),
|
|
21
18
|
formatter: 'string',
|
|
22
19
|
files: [entry],
|
|
23
20
|
customSyntax: 'postcss-scss',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdc-build-wp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Custom WordPress build process.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Robert Sefer",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"browser-sync": "^2.27.7",
|
|
24
24
|
"chalk": "^4.1.2",
|
|
25
25
|
"chokidar": "^3.5.2",
|
|
26
|
-
"esbuild": "^0.13.
|
|
27
|
-
"eslint": "^8.
|
|
26
|
+
"esbuild": "^0.13.14",
|
|
27
|
+
"eslint": "^8.2.0",
|
|
28
28
|
"fs-extra": "^10.0.0",
|
|
29
29
|
"glob": "^7.2.0",
|
|
30
|
-
"imagemin": "^
|
|
30
|
+
"imagemin": "^8.0.1",
|
|
31
31
|
"imagemin-jpegtran": "^7.0.0",
|
|
32
32
|
"imagemin-pngquant": "^9.0.2",
|
|
33
|
-
"imagemin-svgo": "^
|
|
33
|
+
"imagemin-svgo": "^10.0.0",
|
|
34
34
|
"minimist": "^1.2.5",
|
|
35
35
|
"postcss": "^8.3.11",
|
|
36
36
|
"postcss-scss": "^4.0.2",
|
|
37
37
|
"postcss-sort-media-queries": "^4.1.0",
|
|
38
38
|
"sass": "^1.43.4",
|
|
39
|
-
"stylelint": "^14.0
|
|
39
|
+
"stylelint": "^14.1.0"
|
|
40
40
|
}
|
|
41
41
|
}
|