@patternslib/dev 2.3.0 → 2.6.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/.github/workflows/test.yml +2 -2
- package/CHANGES.md +49 -0
- package/Makefile +9 -1
- package/package.json +20 -20
- package/webpack/webpack.config.js +18 -6
- package/webpack/webpack.mf.js +1 -1
package/CHANGES.md
CHANGED
|
@@ -2,6 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [2.6.0](https://github.com/patternslib/dev/compare/2.5.0...2.6.0) (2022-09-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* Fix GitHub Actions branch name. ([e59126a](https://github.com/patternslib/dev/commit/e59126ab8ba9cc1b284c7b964dabe905de9f9fd1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Maintenance
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* Upgrade dependencies. ([0720aad](https://github.com/patternslib/dev/commit/0720aadc0d8f8064996b8ec5568ee8d30c84a70c))
|
|
18
|
+
|
|
19
|
+
## [2.5.0](https://github.com/patternslib/dev/compare/2.4.0...2.5.0) (2022-08-19)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
* **Makefile:** Add empty bundle-pre target for customization. ([0290e61](https://github.com/patternslib/dev/commit/0290e61fac9230e24428dd0b846c5bace145f56d))The empty bundle-pre target is run before the bundle target and can be
|
|
26
|
+
overwritten in extending projects to add some tasks before bundle generation.
|
|
27
|
+
This can be used to unlink and reinstall any dependencies before bundle generation.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Maintenance
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
* Upgrade dependencies. ([64094da](https://github.com/patternslib/dev/commit/64094da766b42c245dad7640216009b1d0c2701e))
|
|
34
|
+
|
|
35
|
+
## [2.4.0](https://github.com/patternslib/dev/compare/2.3.0...2.4.0) (2022-08-11)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
* **Webpack:** Add bundle name and version to the banner. ([1058b6d](https://github.com/patternslib/dev/commit/1058b6d58b6e05c0c841a02a753a7fd823688595))For this, you have to pass your project's package.json as argument to the webpack config factory.
|
|
42
|
+
Both values - name and version - are taken from the package.json data.
|
|
43
|
+
|
|
44
|
+
* **Webpack:** Add config export with named parameters. ([f7b2471](https://github.com/patternslib/dev/commit/f7b24711ce223eaa51e0ea819643a656cae846f3))Add config export along with the default export to support named parameters via parameter destructuring.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Maintenance
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
* Upgrade dependencies. ([9039642](https://github.com/patternslib/dev/commit/90396428d8b00dc6d60137387280e26f335d6128))
|
|
51
|
+
|
|
52
|
+
* **Webpack:** Correct API doc for shared_from_dependencies. ([f2b0031](https://github.com/patternslib/dev/commit/f2b003193312a332a100b8e1f6939dedcdc0e23d))
|
|
53
|
+
|
|
5
54
|
## [2.3.0](https://github.com/patternslib/dev/compare/2.2.1...2.3.0) (2022-07-07)
|
|
6
55
|
|
|
7
56
|
|
package/Makefile
CHANGED
|
@@ -35,8 +35,16 @@ check:: stamp-yarn eslint
|
|
|
35
35
|
$(YARN) run test
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
bundle-pre:
|
|
39
|
+
@# Override this in your project to add some tasks before the bundle is built.
|
|
40
|
+
@# Example: Unlink any linked dependencies.
|
|
41
|
+
@# bundle-pre:
|
|
42
|
+
@# -yarn unlink @patternslib/patternslib
|
|
43
|
+
@# yarn install --force
|
|
44
|
+
|
|
45
|
+
|
|
38
46
|
.PHONY: bundle
|
|
39
|
-
bundle: stamp-yarn
|
|
47
|
+
bundle: bundle-pre stamp-yarn
|
|
40
48
|
ifneq "$(PACKAGE_NAME)" "$(PACKAGE_DEV)"
|
|
41
49
|
@# Do not build a bundle for @patternslib/dev
|
|
42
50
|
$(YARN) run build
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternslib/dev",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Development base files for working with Patternslib and add-ons.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@babel/core": "^7.18.
|
|
8
|
-
"@babel/eslint-parser": "^7.18.
|
|
9
|
-
"@babel/preset-env": "^7.18.
|
|
10
|
-
"@commitlint/cli": "^17.
|
|
11
|
-
"@commitlint/config-conventional": "^17.0
|
|
12
|
-
"@release-it/conventional-changelog": "^5.
|
|
7
|
+
"@babel/core": "^7.18.13",
|
|
8
|
+
"@babel/eslint-parser": "^7.18.9",
|
|
9
|
+
"@babel/preset-env": "^7.18.10",
|
|
10
|
+
"@commitlint/cli": "^17.1.2",
|
|
11
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
12
|
+
"@release-it/conventional-changelog": "^5.1.0",
|
|
13
13
|
"babel-loader": "^8.2.5",
|
|
14
|
-
"core-js": "3.
|
|
14
|
+
"core-js": "3.25.0",
|
|
15
15
|
"css-loader": "^6.7.1",
|
|
16
|
-
"eslint": "^8.
|
|
16
|
+
"eslint": "^8.23.0",
|
|
17
17
|
"eslint-config-prettier": "^8.5.0",
|
|
18
18
|
"husky": "^8.0.1",
|
|
19
19
|
"identity-obj-proxy": "^3.0.0",
|
|
20
|
-
"imports-loader": "^4.0.
|
|
21
|
-
"jest": "^
|
|
22
|
-
"jest-environment-jsdom": "^
|
|
23
|
-
"jest-watch-typeahead": "^1.1
|
|
20
|
+
"imports-loader": "^4.0.1",
|
|
21
|
+
"jest": "^29.0.2",
|
|
22
|
+
"jest-environment-jsdom": "^29.0.2",
|
|
23
|
+
"jest-watch-typeahead": "^2.1.1",
|
|
24
24
|
"prettier": "^2.7.1",
|
|
25
25
|
"regenerator-runtime": "^0.13.9",
|
|
26
|
-
"release-it": "^15.
|
|
27
|
-
"sass": "^1.
|
|
26
|
+
"release-it": "^15.4.1",
|
|
27
|
+
"sass": "^1.54.8",
|
|
28
28
|
"sass-loader": "^13.0.2",
|
|
29
29
|
"style-loader": "^3.3.0",
|
|
30
|
-
"terser-webpack-plugin": "^5.3.
|
|
30
|
+
"terser-webpack-plugin": "^5.3.6",
|
|
31
31
|
"timezone-mock": "^1.3.4",
|
|
32
|
-
"webpack": "^5.
|
|
33
|
-
"webpack-bundle-analyzer": "^4.
|
|
32
|
+
"webpack": "^5.74.0",
|
|
33
|
+
"webpack-bundle-analyzer": "^4.6.1",
|
|
34
34
|
"webpack-cli": "^4.10.0",
|
|
35
|
-
"webpack-dev-server": "^4.
|
|
35
|
+
"webpack-dev-server": "^4.10.1",
|
|
36
36
|
"whybundled": "^2.0.0",
|
|
37
37
|
"yarn": "^1.22.19"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@patternslib/patternslib": "*",
|
|
41
|
-
"jquery": "^3.6.
|
|
41
|
+
"jquery": "^3.6.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"test": "jest"
|
|
@@ -5,7 +5,7 @@ const webpack_helpers = require("./webpack-helpers");
|
|
|
5
5
|
// plugins
|
|
6
6
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const config_factory = (env, argv, config, babel_include = [], package_json) => {
|
|
9
9
|
// Webpack config
|
|
10
10
|
|
|
11
11
|
// Packages in node_modules to NOT exclude from babel processing.
|
|
@@ -96,6 +96,15 @@ module.exports = (env, argv, config, babel_include = []) => {
|
|
|
96
96
|
],
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
if (package_json && package_json.version && package_json.name) {
|
|
100
|
+
// Add a banner to generated chunks with the bundle name and version.
|
|
101
|
+
base_config.plugins.push(
|
|
102
|
+
new webpack.BannerPlugin({
|
|
103
|
+
banner: `${package_json.name} ${package_json.version}`,
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
// Override base_config with entries from config.
|
|
100
109
|
// Most useful the ``entry`` entry.
|
|
101
110
|
config = Object.assign(base_config, config);
|
|
@@ -124,14 +133,17 @@ module.exports = (env, argv, config, babel_include = []) => {
|
|
|
124
133
|
new TerserPlugin({
|
|
125
134
|
include: /(\.js$)/,
|
|
126
135
|
extractComments: false,
|
|
127
|
-
terserOptions: {
|
|
128
|
-
output: {
|
|
129
|
-
comments: false,
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
136
|
}),
|
|
133
137
|
];
|
|
134
138
|
config.devtool = "source-map"; // Slowest option. False for no source maps.
|
|
135
139
|
}
|
|
136
140
|
return config;
|
|
137
141
|
};
|
|
142
|
+
|
|
143
|
+
// Default export
|
|
144
|
+
const module_exports = (module.exports = config_factory);
|
|
145
|
+
|
|
146
|
+
// Named exports
|
|
147
|
+
module_exports.config = ({ env, argv, config, babel_include = [], package_json }) => {
|
|
148
|
+
return config_factory(env, argv, config, babel_include, package_json);
|
|
149
|
+
};
|
package/webpack/webpack.mf.js
CHANGED
|
@@ -33,7 +33,7 @@ function shared_from_dependencies(...dependencies) {
|
|
|
33
33
|
*
|
|
34
34
|
* Use this to extend your webpack configuration for module federation support.
|
|
35
35
|
*
|
|
36
|
-
* @param {String} name - Bundle/remote name.
|
|
36
|
+
* @param {String} name - Bundle/remote name.
|
|
37
37
|
* @param {String} remote_entry - Path to which the new remote entry file is written to.
|
|
38
38
|
* @param {String} filename - Name of the generated remote entry file. Default ``remote.min.js``.
|
|
39
39
|
* @param {Object} dependencies - Object with dependency name - version specifier pairs. Is used to set up the shared dependencies including their version requirements.
|