@patternslib/dev 4.2.1 → 4.3.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 -1
- package/CHANGES.md +14 -0
- package/Makefile +13 -11
- package/README.md +50 -0
- package/jest.config.js +1 -1
- package/package.json +7 -7
- package/pnpm-workspace.yaml +6 -0
package/CHANGES.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.3.0](https://github.com/Patternslib/dev/compare/4.2.1...4.3.0) (2026-09-22)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Switch from yarn to pnpm. ([49e1ae8](https://github.com/Patternslib/dev/commit/49e1ae8979a8bdba71fbd12670b906567293aeae))
|
|
8
|
+
|
|
9
|
+
Note: This is not considered a breaking change. Depending packages
|
|
10
|
+
should not even break their development workflows.
|
|
11
|
+
|
|
12
|
+
### Maintenance
|
|
13
|
+
|
|
14
|
+
- Update minimum node version. ([e7cedaf](https://github.com/Patternslib/dev/commit/e7cedaf3f392b01ac8a5cb1c86ed97c8187617a4))
|
|
15
|
+
- Upgrade dependencies. ([413752c](https://github.com/Patternslib/dev/commit/413752cf033690da7b522ba12e127cc002815ac2))
|
|
16
|
+
|
|
3
17
|
## [4.2.1](https://github.com/Patternslib/dev/compare/4.2.0...4.2.1) (2026-09-18)
|
|
4
18
|
|
|
5
19
|
### Bug Fixes
|
package/Makefile
CHANGED
|
@@ -13,16 +13,18 @@ export
|
|
|
13
13
|
|
|
14
14
|
ESLINT ?= npx eslint
|
|
15
15
|
PRETTIER ?= npx prettier
|
|
16
|
-
|
|
16
|
+
PNPM ?= npx pnpm
|
|
17
17
|
|
|
18
18
|
BUILDABLE := $(shell node -p "Boolean(require('./package.json').scripts?.build)")
|
|
19
19
|
PACKAGE_NAME := $(shell node -p "require('./package.json').name")
|
|
20
20
|
BUNDLE_NAME := $(subst @patternslib/,,$(subst @plone/,,$(PACKAGE_NAME)))
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
# Repeat this install target in consuming packages' Makefiles: on a fresh
|
|
24
|
+
# checkout, @patternslib/dev and this shared Makefile are not installed yet.
|
|
23
25
|
.PHONY: install
|
|
24
|
-
|
|
25
|
-
$(
|
|
26
|
+
pnpm-lock.yaml install: .git/hooks/commit-msg
|
|
27
|
+
$(PNPM) install
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
.git/hooks/commit-msg:
|
|
@@ -52,7 +54,7 @@ prettier: install
|
|
|
52
54
|
|
|
53
55
|
.PHONY: check
|
|
54
56
|
check: install eslint
|
|
55
|
-
$(
|
|
57
|
+
$(PNPM) run test
|
|
56
58
|
|
|
57
59
|
|
|
58
60
|
.PHONY: bundle-pre
|
|
@@ -61,8 +63,8 @@ bundle-pre::
|
|
|
61
63
|
@# Please use double-colons `::` so that the base bundle-pre is also run.
|
|
62
64
|
@# Example: Unlink any linked dependencies.
|
|
63
65
|
@# bundle-pre::
|
|
64
|
-
@# -
|
|
65
|
-
@#
|
|
66
|
+
@# -pnpm unlink --recursive
|
|
67
|
+
@# pnpm install
|
|
66
68
|
npx update-browserslist-db@latest
|
|
67
69
|
|
|
68
70
|
|
|
@@ -72,7 +74,7 @@ bundle-pre::
|
|
|
72
74
|
.PHONY: bundle
|
|
73
75
|
bundle: clean-dist bundle-pre install
|
|
74
76
|
ifeq ($(BUILDABLE),true)
|
|
75
|
-
$(
|
|
77
|
+
$(PNPM) run build
|
|
76
78
|
endif
|
|
77
79
|
|
|
78
80
|
|
|
@@ -156,7 +158,7 @@ prerelease-beta:
|
|
|
156
158
|
|
|
157
159
|
.PHONY: serve
|
|
158
160
|
serve: install
|
|
159
|
-
$(
|
|
161
|
+
$(PNPM) run start
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
upgrade:\
|
|
@@ -170,7 +172,7 @@ upgrade-remove-husky:
|
|
|
170
172
|
test -d .husky\
|
|
171
173
|
&& rm -R .husky\
|
|
172
174
|
&& git add .husky\
|
|
173
|
-
&& git commit -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|
|
175
|
+
&& git commit .husky -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|
|
174
176
|
|| :
|
|
175
177
|
-git config --unset core.hooksPath
|
|
176
178
|
|
|
@@ -180,10 +182,10 @@ eslint.config.js upgrade-eslint:
|
|
|
180
182
|
|| (\
|
|
181
183
|
echo 'module.exports = require("@patternslib/dev/eslint.config.js");' > eslint.config.js\
|
|
182
184
|
&& git add eslint.config.js\
|
|
183
|
-
&& git commit -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
|
|
185
|
+
&& git commit eslint.config.js -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
|
|
184
186
|
)
|
|
185
187
|
test -f ".eslintrc.js"\
|
|
186
188
|
&& rm .eslintrc.js\
|
|
187
189
|
&& git add .eslintrc.js\
|
|
188
|
-
&& git commit -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|
|
190
|
+
&& git commit .eslintrc.js -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|
|
189
191
|
|| :
|
package/README.md
CHANGED
|
@@ -10,6 +10,56 @@ Run `make upgrade` in your project.
|
|
|
10
10
|
|
|
11
11
|
Alternatively, if there is a new `@patternslib/dev` version installed, the `postinstall` package.json script will automatically run `make upgrade` in the directory where package installer was invoked, that is your project directory which depends on `@patternslib/dev`.
|
|
12
12
|
|
|
13
|
+
## Migrating a consuming package to pnpm
|
|
14
|
+
|
|
15
|
+
Installing `@patternslib/dev` does not require switching your project from Yarn to pnpm.
|
|
16
|
+
If you choose to migrate, update the consuming project's configuration and workflows explicitly.
|
|
17
|
+
The shared Makefile uses pnpm for installation and for running build, test, and start scripts.
|
|
18
|
+
|
|
19
|
+
1. Pin the pnpm version you intend to use and pin it in your project's `package.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
"packageManager": "pnpm@12.3.4",
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. Add a `pnpm-workspace.yaml` file at the project's workspace root:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
# No nested node_modules for Module Federation.
|
|
29
|
+
shamefullyHoist: true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
You might also want to include the following to allow to build "@patternslib/dev" and to include releases of "@patternslib/dev" which are younger than the "minimumReleaseAge":
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
allowBuilds:
|
|
36
|
+
"@patternslib/dev": true
|
|
37
|
+
|
|
38
|
+
minimumReleaseAgeExclude:
|
|
39
|
+
- "@patternslib/dev"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For more information, see the [pnpm configuration reference](https://pnpm.io/settings).
|
|
43
|
+
|
|
44
|
+
3. Change the `yarn` references in the Makefile to use `pnpm`.
|
|
45
|
+
|
|
46
|
+
```makefile
|
|
47
|
+
PNPM ?= npx pnpm
|
|
48
|
+
|
|
49
|
+
-include node_modules/@patternslib/dev/Makefile
|
|
50
|
+
|
|
51
|
+
.PHONY: install
|
|
52
|
+
pnpm-lock.yaml install:
|
|
53
|
+
$(PNPM) install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If you use `yarn link` or `yarn unlink` in your Makefile, update it to fit the new [pnpm syntax](https://pnpm.io/cli/link).
|
|
57
|
+
|
|
58
|
+
4. You might need to include pnpm to the `transformIgnorePatterns` field in Jest configuration to make the tests pass. This files `jest.setup.js` for an example.
|
|
59
|
+
|
|
60
|
+
5. Update the CI configuration to use the pnpm cache - see this projects `.github/workflows/test.yml`.
|
|
61
|
+
|
|
62
|
+
6. Run `make install`, add `pnpm-lock.yaml` to the git repository and remove `yarn.lock`.
|
|
13
63
|
|
|
14
64
|
## Code style
|
|
15
65
|
|
package/jest.config.js
CHANGED
|
@@ -17,6 +17,6 @@ module.exports = {
|
|
|
17
17
|
},
|
|
18
18
|
testEnvironment: "jsdom",
|
|
19
19
|
transformIgnorePatterns: [
|
|
20
|
-
"/node_modules/(
|
|
20
|
+
"/node_modules/(?!(?:\\.pnpm/|@patternslib/|@plone/|preact/|screenfull/)).+\\.[tj]sx?$",
|
|
21
21
|
],
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternslib/dev",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Development base files for working with Patternslib and add-ons.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"packageManager": "pnpm@12.3.4",
|
|
6
7
|
"dependencies": {
|
|
7
8
|
"@babel/core": "^8.0.6",
|
|
8
9
|
"@babel/preset-env": "^8.0.6",
|
|
9
|
-
"@commitlint/cli": "^21.2.
|
|
10
|
-
"@commitlint/config-conventional": "^21.2.
|
|
10
|
+
"@commitlint/cli": "^21.2.3",
|
|
11
|
+
"@commitlint/config-conventional": "^21.2.3",
|
|
11
12
|
"@eslint/js": "^10.0.1",
|
|
12
13
|
"@release-it/conventional-changelog": "^12.0.2",
|
|
13
14
|
"babel-loader": "^10.1.1",
|
|
@@ -28,14 +29,13 @@
|
|
|
28
29
|
"terser-webpack-plugin": "^5.6.1",
|
|
29
30
|
"timezone-mock": "^1.4.3",
|
|
30
31
|
"webpack": "^5.111.1",
|
|
31
|
-
"webpack-bundle-analyzer": "^5.
|
|
32
|
+
"webpack-bundle-analyzer": "^5.4.0",
|
|
32
33
|
"webpack-cli": "^7.2.3",
|
|
33
34
|
"webpack-dev-server": "^6.0.0",
|
|
34
|
-
"whybundled": "^2.0.0"
|
|
35
|
-
"yarn": "^1.22.22"
|
|
35
|
+
"whybundled": "^2.0.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
38
|
+
"node": "^22.18.0 || >=24.11.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"postinstall": "cd $INIT_CWD && make upgrade || true",
|