gulp-preprocess 4.0.1 → 5.0.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/.eslintrc +3 -0
- package/.github/workflows/test.yaml +3 -3
- package/README.md +2 -2
- package/index.js +3 -6
- package/package.json +7 -8
package/.eslintrc
CHANGED
|
@@ -5,10 +5,10 @@ jobs:
|
|
|
5
5
|
runs-on: ubuntu-latest
|
|
6
6
|
strategy:
|
|
7
7
|
matrix:
|
|
8
|
-
node: [
|
|
8
|
+
node: [18, 20, 21]
|
|
9
9
|
steps:
|
|
10
|
-
- uses: actions/checkout@
|
|
11
|
-
- uses: actions/setup-node@
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
- uses: actions/setup-node@v4
|
|
12
12
|
with:
|
|
13
13
|
node-version: ${{ matrix.node }}
|
|
14
14
|
- run: npm install
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# gulp-preprocess [](https://www.npmjs.com/package/gulp-preprocess) [](https://github.com/nfroidure/svg-pathdata/actions/workflows/test.yml)
|
|
1
|
+
# gulp-preprocess [](https://www.npmjs.com/package/gulp-preprocess) [](https://github.com/nfroidure/svg-pathdata/actions/workflows/test.yml)
|
|
2
2
|
|
|
3
3
|
> [Gulp](http://gulpjs.com) plugin to preprocess HTML, JavaScript, and other files based on custom context or environment configuration
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</tr>
|
|
11
11
|
<tr>
|
|
12
12
|
<td>Node Version</td>
|
|
13
|
-
<td>>=
|
|
13
|
+
<td>>= 18</td>
|
|
14
14
|
</tr>
|
|
15
15
|
<tr>
|
|
16
16
|
<td>Gulp Version</td>
|
package/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
var _ = require("lodash");
|
|
2
1
|
var pp = require("preprocess");
|
|
3
2
|
var path = require("path");
|
|
4
3
|
var through = require('through2');
|
|
5
4
|
|
|
6
5
|
module.exports = function (options) {
|
|
7
|
-
var opts =
|
|
8
|
-
var context =
|
|
6
|
+
var opts = Object.assign({}, options);
|
|
7
|
+
var context = Object.assign({}, process.env, opts.context);
|
|
9
8
|
|
|
10
9
|
function ppStream(file, encoding, callback) {
|
|
11
10
|
var contents, extension;
|
|
@@ -19,9 +18,7 @@ module.exports = function (options) {
|
|
|
19
18
|
context.srcDir = opts.includeBase || path.dirname(file.path);
|
|
20
19
|
context.NODE_ENV = context.NODE_ENV || "development";
|
|
21
20
|
|
|
22
|
-
extension =
|
|
23
|
-
? getExtension(context.src)
|
|
24
|
-
: opts.extension;
|
|
21
|
+
extension = opts.extension ?? getExtension(context.src);
|
|
25
22
|
|
|
26
23
|
contents = file.contents.toString("utf8");
|
|
27
24
|
contents = pp.preprocess(contents, context, extension);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gulp-preprocess",
|
|
3
3
|
"description": "Gulp plugin to preprocess HTML, JavaScript, and other files based on custom context or environment configuration",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"homepage": "http://github.com/pioug/gulp-preprocess",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -10,19 +10,18 @@
|
|
|
10
10
|
"author": "Jason Sandmeyer",
|
|
11
11
|
"main": "./index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"lodash": "^4.17.15",
|
|
14
13
|
"preprocess": "^3.0.0",
|
|
15
|
-
"through2": "4.0.2"
|
|
14
|
+
"through2": "^4.0.2"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"eslint": "
|
|
19
|
-
"mocha": "^
|
|
20
|
-
"prettier": "^
|
|
17
|
+
"eslint": "^8.57.0",
|
|
18
|
+
"mocha": "^10.3.0",
|
|
19
|
+
"prettier": "^3.2.5",
|
|
21
20
|
"should": "^13.2.3",
|
|
22
|
-
"vinyl": "^
|
|
21
|
+
"vinyl": "^3.0.0"
|
|
23
22
|
},
|
|
24
23
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
24
|
+
"node": ">= 18"
|
|
26
25
|
},
|
|
27
26
|
"scripts": {
|
|
28
27
|
"test": "mocha --reporter spec"
|