Skip to content

Commit e5c43bb

Browse files
Merge branch 'release/1.2.0'
2 parents b53d67e + c51b5aa commit e5c43bb

23 files changed

+25231
-9028
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v1
1414
- uses: actions/setup-node@v1
1515
with:
16-
node-version: 13
16+
node-version: 16
1717
registry-url: https://registry.npmjs.org/
1818
- run: yarn install
1919
- run: npm publish --access public

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Setup Node
1212
uses: actions/setup-node@v1
1313
with:
14-
node-version: 14
14+
node-version: 16
1515
- name: Install dependencies
1616
run: npm install
1717
- name: ESlint

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## 1.2.0
5+
6+
* [Added] node-sass-glob-importer
7+
* [Added] Shareable config for stylelint
8+
* [Added] Shareable config for eslint
9+
* [Addet] Support for font files
10+
* [Changed] Webpack upgraded to version 5
11+
* [Changed] Stylelint rules changed to stylelint-config-recommended(-scss)
12+
* [Changed] Updated NPM dependencies
13+
414
## 1.1.6
515

616
* [Changed] Updated NPM dependencies

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,22 @@ All arguments other than listed below will be directly passed to [webpack](https
118118

119119
| Name | Argument | Type | Description |
120120
|-------------------|--------------------|--------------|-----------------------------------------------------------------------------------------------------------------|
121-
| **urlLoader** | -- | boolean\|number | Whether to use [url-loader](https://github.com/webpack-contrib/url-loader) for images. If number is passed it will be used as '[limit](https://github.com/webpack-contrib/url-loader#limit)' option.<br />**Default: `true`** |
122-
| **imagemin** | -- | boolean\|object | Whether to use [image-webpack-loader](https://github.com/tcoopman/image-webpack-loader) to optimize images with [imagemin](https://github.com/imagemin/imagemin). Object will be passed as [image-webpack-loader](https://github.com/tcoopman/image-webpack-loader) configuration.<br />**Default: `true`** |
121+
| **inlineAssets** | true | boolean\|number | Whether to use [url-loader](https://github.com/webpack-contrib/url-loader) for images. If number is passed it will be used as '[limit](https://github.com/webpack-contrib/url-loader#limit)' option.<br />**Default: `true`** |
122+
| **imagemin** | -- | boolean\|object | Whether to use [image-webpack-loader](https://github.com/tcoopman/image-webpack-loader) to optimize images with [imagemin](https://github.com/imagemin/imagemin). Object will be passed as [image-webpack-loader](https://github.com/tcoopman/image-webpack-loader) configuration.<br />**Default: `true`** |
123123
| **paths.src** | **--src-path** | string | Source path relative to project root.<br />**Default: `'src/assets'`** |
124124
| **paths.output** | **--output-path** | string | Output path relative to project root.<br />**Default: `'dist'`** |
125125
| **paths.scripts** | **--scripts-path** | string | Scripts path relative to `src\|output`. Use `false` to skip this path.<br />**Default: `'js'`** |
126126
| **paths.styles** | **--styles-path** | string | Styles path relative to `src\|output`. Use `false` to skip this path.<br />**Default: `'scss'`** |
127-
| **paths.images** | **--images-path** | string | Images path relative to `output`. Images included in scripts and styles will be placed in this location if `urlLoader` is turned off or the image size exceeds `limit`.<br />**Default: `'images'`** |
127+
| **paths.images** | **--images-path** | string | Images path relative to `output`. Images included in scripts and styles will be placed in this location if `inlineAssets` is turned off or the image size exceeds `limit`.<br />**Default: `'images'`** |
128+
| **paths.fonts** | **--fonts-path** | Fonts | Fonts path relative to `output`. Font files included in scripts and styles will be placed in this location.<br />**Default: `'fonts'`** |
128129

129130
*Example:*
130131
```json
131132
{
132133
"mpScriptsConfig": {
133-
"urlLoader": 8192,
134+
"inlineAssets": 8192,
134135
"imagemin": {
135-
"svgo": {
136+
"svgo": {
136137
"plugins": [
137138
{ "removeDoctype": false }
138139
]

bin/mp-scripts.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@
55
/**
66
* External dependencies
77
*/
8-
const spawn = require("cross-spawn");
8+
const spawn = require('cross-spawn');
99

1010
/**
1111
* Internal dependencies
1212
*/
13-
const { getArgs } = require("../utils");
13+
const { getArgs } = require('../utils');
1414

1515
const [script, ...args] = getArgs();
1616

17-
if (!["build", "lint-js", "lint-style", "start"].includes(script)) {
17+
if (!['build', 'lint-js', 'lint-style', 'start'].includes(script)) {
1818
if (undefined === script) {
19-
console.log("No script specified.");
19+
console.log('No script specified.');
2020
} else {
2121
console.log('Unknown script "' + script + '".');
2222
}
2323
process.exit(1);
2424
}
2525

2626
const { signal, status } = spawn.sync(
27-
"node",
28-
[require.resolve("../scripts/" + script), ...args],
29-
{ stdio: "inherit" }
27+
'node',
28+
[require.resolve('../scripts/' + script), ...args],
29+
{ stdio: 'inherit' }
3030
);
3131

3232
if (signal) {
33-
if (signal === "SIGKILL") {
33+
if (signal === 'SIGKILL') {
3434
console.log(
35-
"The script failed because the process exited too early. " +
36-
"This probably means the system ran out of memory or someone called " +
37-
"`kill -9` on the process."
35+
'The script failed because the process exited too early. ' +
36+
'This probably means the system ran out of memory or someone called ' +
37+
'`kill -9` on the process.'
3838
);
39-
} else if (signal === "SIGTERM") {
39+
} else if (signal === 'SIGTERM') {
4040
console.log(
41-
"The script failed because the process exited too early. " +
42-
"Someone might have called `kill` or `killall`, or the system could " +
43-
"be shutting down."
41+
'The script failed because the process exited too early. ' +
42+
'Someone might have called `kill` or `killall`, or the system could ' +
43+
'be shutting down.'
4444
);
4545
}
4646
process.exit(1);

config/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
2+
"extends": "../eslint-config"
33
}

config/.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "stylelint-config-wordpress/scss"
2+
"extends": "@micropackage/scripts/stylelint-config"
33
}

0 commit comments

Comments
 (0)