@patternslib/dev 4.1.0-alpha.0 → 4.2.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.
@@ -11,9 +11,9 @@ jobs:
11
11
  name: test
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
14
+ - uses: actions/checkout@v7
15
+ - uses: actions/setup-node@v7
16
16
  with:
17
- node-version: '22'
17
+ node-version: '24'
18
18
  cache: 'yarn'
19
19
  - run: make check
package/.release-it.js CHANGED
@@ -1,18 +1,11 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
-
4
- const commits_template = fs
5
- .readFileSync(
6
- path.resolve(__dirname, "release-it", "conventional-changelog-commit.hbs"),
7
- )
8
- .toString();
1
+ const commitPartial = require("./release-it/conventional-changelog-commit.js");
9
2
 
10
3
  module.exports = {
11
4
  npm: {
12
5
  publish: true,
13
6
  },
14
7
  git: {
15
- requireBranch: ["master", "main", "*.x"],
8
+ requireBranch: ["master", "main", "*.x", "alpha/*", "beta/*"],
16
9
  commitMessage: "Release new version.",
17
10
  commitArgs: ["-n"],
18
11
  },
@@ -47,11 +40,14 @@ module.exports = {
47
40
  ],
48
41
  },
49
42
  writerOpts: {
50
- commitPartial: commits_template,
43
+ commitPartial,
51
44
  },
52
45
  },
53
46
  },
54
47
  hooks: {
48
+ // Format the changelog after it is written, before Git stages it.
49
+ "after:@release-it/conventional-changelog:beforeRelease":
50
+ "npx prettier --write CHANGES.md",
55
51
  // Run `make bundle` after the version is bumped to get a build with
56
52
  // the new version number comment in the entry scripts.
57
53
  // Use the make target which does a check to not build if the package
package/CHANGES.md CHANGED
@@ -1,39 +1,67 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.2.0](https://github.com/Patternslib/dev/compare/4.1.0...4.2.0) (2026-09-17)
3
4
 
5
+ ### Features
6
+
7
+ - Format the changelog after generation. ([8477b72](https://github.com/Patternslib/dev/commit/8477b721dfd7db18aeeefe9e9c5ce2620bbeed89))
8
+
9
+ Use prettier to format the changelog after changelog generation.
10
+
11
+ Co-authored-by: Codex <noreply@openai.com>
12
+
13
+ - Optimize the source map options. ([d60d03f](https://github.com/Patternslib/dev/commit/d60d03f5432d2cef8926538eaf65bf431c210ab4))
14
+
15
+ Change the source map options for production and development builds for
16
+ a better compromise on bundle size, build speed and debugability.
17
+
18
+ - Upgrade to babel version 8, only targeting ES6+ browsers. ([228bf05](https://github.com/Patternslib/dev/commit/228bf057eb1f97d05ca85e2b22cadaf891abedd0))
19
+
20
+ ES6 browsers are a baseline since 2017, so this change can be considered
21
+ safe and now a breaking change.
22
+
23
+ ### Maintenance
24
+
25
+ - Allow releases from alpha/* and beta/* branches, alongside to master, main and *.x. ([73c49fa](https://github.com/Patternslib/dev/commit/73c49fa2cb7d797626411da76f3b702f8e03a960))
26
+ - Migrate handlebars changelog template to JavaScript render functions. ([a1685f9](https://github.com/Patternslib/dev/commit/a1685f9d84e7e36c6d2c1cc6426b454228ddf15d))
27
+
28
+ Co-authored-by: Codex <noreply@openai.com>
29
+
30
+ - Update dependencies. ([c9e6d18](https://github.com/Patternslib/dev/commit/c9e6d181fb33fb165fd1dae3cec75ef6e65a3ec6))
31
+ - Update GitHub workflow environment. ([3261bd3](https://github.com/Patternslib/dev/commit/3261bd3f8d3b0b8f5f0f4dc2138f174d26d86b8a))
32
+ - Upgrade commitlint and release-it to v21. ([cdea75f](https://github.com/Patternslib/dev/commit/cdea75f9859641046dcc45832c650630012b6df3))
33
+
34
+ ## [4.1.0](https://github.com/Patternslib/dev/compare/4.1.0-alpha.0...4.1.0) (2026-09-16)
4
35
 
5
36
  ## [4.1.0-alpha.0](https://github.com/Patternslib/dev/compare/4.0.2...4.1.0-alpha.0) (2026-09-11)
6
37
 
7
38
  ### Features
8
39
 
40
+ - **module federation:** resolve a promise once all remote bundles are initialized ([e2f0f22](https://github.com/Patternslib/dev/commit/e2f0f22d6433960ddd297fd15e53f752a30a9486))
9
41
 
10
- * **module federation:** resolve a promise once all remote bundles are initialized ([e2f0f22](https://github.com/Patternslib/dev/commit/e2f0f22d6433960ddd297fd15e53f752a30a9486))
11
-
12
- The document-ready handler started the initialization of all Module
13
- Federation remote bundles but did not wait for them: the
14
- ``patternslib__mf--loaded`` event fired before any remote had actually
15
- loaded and run its main module. Consumers had no way to know when the
16
- remotes' patterns and components were registered.
42
+ The document-ready handler started the initialization of all Module
43
+ Federation remote bundles but did not wait for them: the
44
+ `patternslib__mf--loaded` event fired before any remote had actually
45
+ loaded and run its main module. Consumers had no way to know when the
46
+ remotes' patterns and components were registered.
17
47
 
18
48
  The helper now initializes all remotes in parallel, waits for all of
19
49
  them to settle (a failing remote is logged and does not block the
20
50
  others), and only then dispatches the event. The new promise
21
- ``window.__patternslib_mf_initialized`` is created at module load time,
51
+ `window.__patternslib_mf_initialized` is created at module load time,
22
52
  so it can be awaited by code running before or after document ready —
23
53
  the Patternslib registry uses it to defer the initial DOM scan.
24
54
 
25
- A remote's main module usually only does ``import("./bundle")`` — the
55
+ A remote's main module usually only does `import("./bundle")` — the
26
56
  async boundary needed to consume shared modules — and the registrations
27
57
  happen in that chunk. If the main module exports that promise as its
28
- default export (``export default import("./bundle")``), the helper
58
+ default export (`export default import("./bundle")`), the helper
29
59
  waits for it as well. Remotes without the export keep working as
30
60
  before.
31
61
 
32
-
33
62
  ### Bug Fixes
34
63
 
35
-
36
- * Cleanup changelog entries. ([c311b84](https://github.com/Patternslib/dev/commit/c311b84d22c3c10721525d3c56423d7a200d4450))
64
+ - Cleanup changelog entries. ([c311b84](https://github.com/Patternslib/dev/commit/c311b84d22c3c10721525d3c56423d7a200d4450))
37
65
 
38
66
  ## [4.0.2](https://github.com/Patternslib/dev/compare/4.0.1...4.0.2) (2026-09-05)
39
67
 
package/babel.config.js CHANGED
@@ -1,31 +1,29 @@
1
- module.exports = (env) => {
1
+ module.exports = (api) => {
2
2
  let config = {
3
3
  presets: [
4
4
  [
5
5
  "@babel/preset-env",
6
6
  {
7
- useBuiltIns: "entry",
8
- corejs: 3,
7
+ modules: "auto",
9
8
  },
10
9
  ],
11
10
  ],
12
11
  };
13
12
 
14
13
  // passed via NODE_ENV=development environment variable.
15
- if (env.env() === "development") {
14
+ if (api.env() === "development") {
16
15
  // For development, do less transformations for better readability.
17
16
  config = {
18
17
  presets: [
19
18
  [
20
19
  "@babel/preset-env",
21
20
  {
22
- modules: false,
23
21
  debug: true,
24
- useBuiltIns: false,
25
- targets: "last 1 Chrome version, last 1 Firefox version",
22
+ modules: false,
26
23
  },
27
24
  ],
28
25
  ],
26
+ targets: "last 1 Chrome version, last 1 Firefox version",
29
27
  };
30
28
  }
31
29
 
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@patternslib/dev",
3
- "version": "4.1.0-alpha.0",
3
+ "version": "4.2.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.29.0",
8
- "@babel/preset-env": "^7.29.2",
9
- "@commitlint/cli": "^20.5.0",
10
- "@commitlint/config-conventional": "^20.5.0",
7
+ "@babel/core": "^8.0.1",
8
+ "@babel/preset-env": "^8.0.2",
9
+ "@commitlint/cli": "^21.2.2",
10
+ "@commitlint/config-conventional": "^21.2.2",
11
11
  "@eslint/js": "^10.0.1",
12
- "@release-it/conventional-changelog": "^10.0.6",
12
+ "@release-it/conventional-changelog": "^12.0.2",
13
13
  "babel-loader": "^10.1.1",
14
- "css-loader": "^7.1.4",
15
- "eslint": "^10.2.1",
14
+ "css-loader": "^7.1.5",
15
+ "eslint": "^10.10.0",
16
16
  "eslint-config-prettier": "^10.1.8",
17
- "globals": "^17.5.0",
17
+ "globals": "^17.12.0",
18
18
  "identity-obj-proxy": "^3.0.0",
19
- "jest": "^30.3.0",
20
- "jest-environment-jsdom": "^30.3.0",
19
+ "jest": "^30.5.1",
20
+ "jest-environment-jsdom": "^30.5.1",
21
21
  "jest-watch-typeahead": "^3.0.1",
22
- "prettier": "^3.8.3",
22
+ "prettier": "^3.9.7",
23
23
  "regenerator-runtime": "^0.14.1",
24
- "release-it": "^20.0.0",
25
- "sass": "^1.99.0",
26
- "sass-loader": "^16.0.7",
24
+ "release-it": "^21.0.3",
25
+ "sass": "^1.104.1",
26
+ "sass-loader": "^17.0.1",
27
27
  "style-loader": "^4.0.0",
28
- "terser-webpack-plugin": "^5.4.0",
29
- "timezone-mock": "^1.4.2",
30
- "webpack": "^5.106.2",
31
- "webpack-bundle-analyzer": "^5.3.0",
32
- "webpack-cli": "^7.0.2",
33
- "webpack-dev-server": "^5.2.3",
28
+ "terser-webpack-plugin": "^5.6.1",
29
+ "timezone-mock": "^1.4.3",
30
+ "webpack": "^5.111.0",
31
+ "webpack-bundle-analyzer": "^5.3.3",
32
+ "webpack-cli": "^7.2.3",
33
+ "webpack-dev-server": "^6.0.0",
34
34
  "whybundled": "^2.0.0",
35
35
  "yarn": "^1.22.22"
36
36
  },
@@ -0,0 +1,45 @@
1
+ // The preset adds the list marker and indents continuation lines.
2
+ module.exports = function commitPartial(context, commit) {
3
+ const repoUrl = context.repository
4
+ ? [context.host, context.owner, context.repository].filter(Boolean).join("/")
5
+ : context.repoUrl;
6
+ const summary = [
7
+ commit.scope && `**${commit.scope}:**`,
8
+ commit.subject || commit.header,
9
+ commit.hash &&
10
+ (context.linkReferences
11
+ ? `([${commit.shortHash}](${repoUrl}/${context.commit}/${commit.hash}))`
12
+ : commit.hash),
13
+ ]
14
+ .filter(Boolean)
15
+ .join(" ");
16
+
17
+ const references = (commit.references || []).map((reference) => {
18
+ const label = `${reference.owner ? `${reference.owner}/` : ""}${reference.repository || ""}#${reference.issue}`;
19
+ if (!context.linkReferences) {
20
+ return label;
21
+ }
22
+
23
+ const referenceUrl = context.repository
24
+ ? [
25
+ context.host,
26
+ reference.repository
27
+ ? reference.owner || context.owner
28
+ : context.owner,
29
+ reference.repository || context.repository,
30
+ ]
31
+ .filter(Boolean)
32
+ .join("/")
33
+ : context.repoUrl;
34
+ return `[${label}](${referenceUrl}/${context.issue}/${reference.issue})`;
35
+ });
36
+
37
+ return [
38
+ summary,
39
+ commit.body,
40
+ commit.footer,
41
+ references.length && `closes ${references.join(" ")}`,
42
+ ]
43
+ .filter(Boolean)
44
+ .join("\n\n");
45
+ };
@@ -25,6 +25,9 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
25
25
  }
26
26
  babel_exclude = `node_modules/${babel_exclude}.*`;
27
27
 
28
+ const is_development = process.env.NODE_ENV === "development";
29
+ const is_production = process.env.NODE_ENV === "production";
30
+
28
31
  const base_config = {
29
32
  entry: {}, // Entry point files for your JavaScript application.
30
33
  externals: [
@@ -62,8 +65,20 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
62
65
  insert: require.resolve("./style-inserter"),
63
66
  },
64
67
  },
65
- "css-loader",
66
- "sass-loader",
68
+ {
69
+ loader: "css-loader",
70
+ options: {
71
+ // production: false, others: loader defaults
72
+ sourceMap: is_production ? false : undefined,
73
+ },
74
+ },
75
+ {
76
+ loader: "sass-loader",
77
+ options: {
78
+ // production: false, others: loader defaults
79
+ sourceMap: is_production ? false : undefined,
80
+ },
81
+ },
67
82
  ],
68
83
  },
69
84
  {
@@ -101,7 +116,7 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
101
116
  // Most useful the ``entry`` entry.
102
117
  config = Object.assign(base_config, config);
103
118
 
104
- if (process.env.NODE_ENV === "development") {
119
+ if (is_development) {
105
120
  // Add a dev server.
106
121
  config.devServer = {
107
122
  static: {
@@ -113,13 +128,21 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
113
128
  "Access-Control-Allow-Origin": "*",
114
129
  },
115
130
  };
131
+
132
+ if (config.devtool === undefined) {
133
+ // Build: slow, rebuild: fast - good compromise for development
134
+ // debuggability.
135
+ // Set to `false` for no source maps.
136
+ config.devtool = "eval-cheap-module-source-map";
137
+ }
138
+
116
139
  config.optimization.minimize = false;
117
- config.devtool = "source-map"; // Slowest option. False for no source maps.
118
140
  config.watchOptions = {
119
141
  ignored: ["node_modules/**", "docs/**", ".git/**"],
120
142
  };
121
143
  }
122
- if (process.env.NODE_ENV === "production") {
144
+
145
+ if (is_production) {
123
146
  // Minify all JS files in production mode.
124
147
  config.optimization.minimizer = [
125
148
  new TerserPlugin({
@@ -127,7 +150,13 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
127
150
  extractComments: false,
128
151
  }),
129
152
  ];
130
- config.devtool = "source-map"; // Slowest option. False for no source maps.
153
+
154
+ if (config.devtool === undefined) {
155
+ // Build: slowest, rebuild: slowest - Reduce bundle size but allow
156
+ // tracebacks with original line numbers.
157
+ // Set to `false` for no source maps.
158
+ config.devtool = "nosources-source-map";
159
+ }
131
160
  }
132
161
  return config;
133
162
  };
@@ -1,72 +0,0 @@
1
-
2
- *{{#if scope}} **{{scope}}:**
3
- {{~/if}} {{#if subject}}
4
- {{~subject}}
5
- {{~else}}
6
- {{~header}}
7
- {{~/if}}
8
-
9
- {{~!-- commit link --}} {{#if @root.linkReferences~}}
10
- ([{{shortHash}}](
11
- {{~#if @root.repository}}
12
- {{~#if @root.host}}
13
- {{~@root.host}}/
14
- {{~/if}}
15
- {{~#if @root.owner}}
16
- {{~@root.owner}}/
17
- {{~/if}}
18
- {{~@root.repository}}
19
- {{~else}}
20
- {{~@root.repoUrl}}
21
- {{~/if}}/
22
- {{~@root.commit}}/{{hash}}))
23
- {{~else}}
24
- {{~hash}}
25
- {{~/if}}
26
-
27
- {{#if body}}
28
-
29
- {{body}}
30
- {{/if}}
31
- {{#if footer}}
32
-
33
- {{footer}}
34
- {{/if}}
35
-
36
- {{~!-- commit references --}}
37
- {{~#if references~}}
38
-
39
- closes
40
- {{~#each references}} {{#if @root.linkReferences~}}
41
- [
42
- {{~#if this.owner}}
43
- {{~this.owner}}/
44
- {{~/if}}
45
- {{~this.repository}}#{{this.issue}}](
46
- {{~#if @root.repository}}
47
- {{~#if @root.host}}
48
- {{~@root.host}}/
49
- {{~/if}}
50
- {{~#if this.repository}}
51
- {{~#if this.owner}}
52
- {{~this.owner}}/
53
- {{~/if}}
54
- {{~this.repository}}
55
- {{~else}}
56
- {{~#if @root.owner}}
57
- {{~@root.owner}}/
58
- {{~/if}}
59
- {{~@root.repository}}
60
- {{~/if}}
61
- {{~else}}
62
- {{~@root.repoUrl}}
63
- {{~/if}}/
64
- {{~@root.issue}}/{{this.issue}})
65
- {{~else}}
66
- {{~#if this.owner}}
67
- {{~this.owner}}/
68
- {{~/if}}
69
- {{~this.repository}}#{{this.issue}}
70
- {{~/if}}{{/each}}
71
- {{~/if}}
72
-