Skip to content

Commit

Permalink
feat: Rule.parser.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Sep 3, 2024
1 parent 63ea18f commit bcf6058
Show file tree
Hide file tree
Showing 9 changed files with 1,550 additions and 785 deletions.
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"github>airkro/renovate-config"
]
}
37 changes: 37 additions & 0 deletions .github/workflows/bring-it.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: bring-it

on:
push:
branches:
- master

jobs:
test:
strategy:
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
node:
- current
- lts/*
- lts/-1
exclude:
- os: ubuntu-latest
node: lts/*
runs-on: ${{ matrix.os }}
steps:
- name: Run
uses: airkro/bring-it@actions
with:
node-version: ${{ matrix.node }}

publish:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Run
uses: airkro/bring-it@actions
with:
npm-token: ${{ secrets.NPM_TOKEN }}
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@best-shot/webpack-chain",
"version": "8.1.6",
"version": "8.1.8",
"main": "src/Config.js",
"typings": "types/index.d.ts",
"repository": {
Expand Down Expand Up @@ -29,8 +29,6 @@
"lint:fix": "yarn lint --fix",
"style": "prettier --check .",
"style:fix": "prettier --write .",
"test": "jest",
"test:types": "tsc -p ./types/test/tsconfig.json",
"changelog": "auto-changelog --remote upstream --commit-limit false",
"version": "yarn changelog --package && git add CHANGELOG.md"
},
Expand All @@ -39,23 +37,24 @@
"javascript-stringify": "^2.1.0"
},
"devDependencies": {
"@types/enhanced-resolve": "^3.0.6",
"@types/tapable": "^1.0.6",
"@types/webpack": "^5.0.0",
"auto-changelog": "^2.2.0",
"enhanced-resolve": "^5.8.2",
"eslint": "^7.5.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.0.0",
"jest": "^27.0.0",
"prettier": "^2.0.5",
"typescript": "^4.0.0",
"@types/enhanced-resolve": "^3.0.7",
"@types/tapable": "^1.0.12",
"@types/webpack": "^5.28.5",
"auto-changelog": "^2.4.0",
"enhanced-resolve": "^5.17.1",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^24.7.0",
"jest": "^27.5.1",
"prettier": "^2.8.8",
"typescript": "^4.9.5",
"webpack": "^5.89.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
},
"packageManager": "[email protected]"
}
11 changes: 0 additions & 11 deletions renovate.json

This file was deleted.

14 changes: 12 additions & 2 deletions src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ module.exports = class extends ChainedMap {
'topLevelAwait',
]);

this.watchOptions = new ChainedValueMap(this);
this.watchOptions.extend(['ignored']);

this.cache = new ChainedValueMap(this);
this.cache.extend([
'buildDependencies',
'cacheDirectory',
'maxAge',
'name',
'type',
]);

this.extend([
// https://webpack.js.org/configuration/entry-context/
'context',
Expand All @@ -56,7 +68,6 @@ module.exports = class extends ChainedMap {
'target',
// https://webpack.js.org/configuration/watch/
'watch',
'watchOptions',
// https://webpack.js.org/configuration/externals/
'externals',
'externalsType',
Expand All @@ -66,7 +77,6 @@ module.exports = class extends ChainedMap {
// https://webpack.js.org/configuration/other-options
'amd',
'bail',
'cache',
'dependencies',
'ignoreWarnings',
'loader',
Expand Down
5 changes: 4 additions & 1 deletion src/DevServer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const ChainedMap = require('./ChainedMap');
const ChainedSet = require('./ChainedSet');
const ChainedValueMap = require('./ChainedValueMap');

module.exports = class extends ChainedMap {
constructor(parent) {
Expand Down Expand Up @@ -58,9 +59,11 @@ module.exports = class extends ChainedMap {
'watchContentBase',
'watchOptions',
'writeToDisk',
'client',
'devMiddleware',
]);

this.client = new ChainedValueMap(this);
this.client.extend(['logging']);
}

toConfig() {
Expand Down
12 changes: 12 additions & 0 deletions src/Output.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
const ChainedMap = require('./ChainedMap');
const ChainedValueMap = require('./ChainedValueMap');

module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);

this.library = new ChainedValueMap(this);
this.library.extend([
'amdContainer',
'name',
'type',
'export',
'auxiliaryComment',
'umdNamedDefine',
]);

this.extend([
'asyncChunks',
'auxiliaryComment',
Expand Down
13 changes: 11 additions & 2 deletions src/Rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ const Rule = Orderable(
this.oneOfs = new ChainedMap(this);
this.resolve = new Resolve(this);
this.resolve.extend(['fullySpecified']);

this.generator = new ChainedValueMap(this);
this.generator.extend(['filename']);
this.generator.extend([
'dataUrl',
'emit',
'filename',
'outputPath',
'publicPath',
]);

this.parser = new ChainedValueMap(this);
this.parser.extend(['parse']);

this.extend([
'dependency',
Expand All @@ -42,7 +52,6 @@ const Rule = Orderable(
'issuerLayer',
'layer',
'mimetype',
'parser',
'resource',
'resourceQuery',
'scheme',
Expand Down
Loading

0 comments on commit bcf6058

Please sign in to comment.