@patternslib/dev 4.2.1 → 4.4.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/.node-version +1 -0
- package/CHANGES.md +31 -0
- package/Makefile +34 -12
- package/README.md +54 -0
- package/jest.config.js +1 -1
- package/package.json +18 -18
- package/pnpm-workspace.yaml +6 -0
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24
|
package/CHANGES.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.4.0](https://github.com/Patternslib/dev/compare/4.3.0...4.4.0) (2026-11-05)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Add "update" Makefile target. ([846adbe](https://github.com/Patternslib/dev/commit/846adbe65593309cd8031a5f60f6ec3f4e139418))
|
|
8
|
+
|
|
9
|
+
`make update` will update pnpm version and project dependencies
|
|
10
|
+
individually and create 3 separate commits.
|
|
11
|
+
|
|
12
|
+
- Use the dependencies-update branch for make update. ([6f9523d](https://github.com/Patternslib/dev/commit/6f9523dfbd527773a4996e434fd6059daf6ce743))
|
|
13
|
+
|
|
14
|
+
### Maintenance
|
|
15
|
+
|
|
16
|
+
- Update dependencies. ([1e805ee](https://github.com/Patternslib/dev/commit/1e805ee1486fb802c6f38afc7ef98c95f16ab5a3))
|
|
17
|
+
- Update dependencies. ([5a2e7c8](https://github.com/Patternslib/dev/commit/5a2e7c85e1ce628d2cb575b00acdec64f8677a82))
|
|
18
|
+
- Update pnpm. ([50a976b](https://github.com/Patternslib/dev/commit/50a976b082ae5978b28d9f94135084f68eb1f47c))
|
|
19
|
+
|
|
20
|
+
## [4.3.0](https://github.com/Patternslib/dev/compare/4.2.1...4.3.0) (2026-09-22)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- Switch from yarn to pnpm. ([49e1ae8](https://github.com/Patternslib/dev/commit/49e1ae8979a8bdba71fbd12670b906567293aeae))
|
|
25
|
+
|
|
26
|
+
Note: This is not considered a breaking change. Depending packages
|
|
27
|
+
should not even break their development workflows.
|
|
28
|
+
|
|
29
|
+
### Maintenance
|
|
30
|
+
|
|
31
|
+
- Update minimum node version. ([e7cedaf](https://github.com/Patternslib/dev/commit/e7cedaf3f392b01ac8a5cb1c86ed97c8187617a4))
|
|
32
|
+
- Upgrade dependencies. ([413752c](https://github.com/Patternslib/dev/commit/413752cf033690da7b522ba12e127cc002815ac2))
|
|
33
|
+
|
|
3
34
|
## [4.2.1](https://github.com/Patternslib/dev/compare/4.2.0...4.2.1) (2026-09-18)
|
|
4
35
|
|
|
5
36
|
### Bug Fixes
|
package/Makefile
CHANGED
|
@@ -13,17 +13,39 @@ 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
|
-
|
|
26
|
+
pnpm-lock.yaml install: .git/hooks/commit-msg
|
|
27
|
+
$(PNPM) install
|
|
28
|
+
|
|
29
|
+
# Update dependencies
|
|
30
|
+
# Update pnpm version and project dependencies individually and create 3 separate commits.
|
|
31
|
+
# Don't fail if nothing needs a commit.
|
|
32
|
+
.PHONY: update
|
|
33
|
+
update:
|
|
34
|
+
@if ! git diff --quiet -- package.json || ! git diff --cached --quiet -- package.json; then \
|
|
35
|
+
echo "Warning: package.json has uncommitted changes. Commit or stash them before running make update." >&2; \
|
|
36
|
+
exit 1; \
|
|
37
|
+
fi
|
|
38
|
+
@if ! git checkout -b dependencies-update; then \
|
|
39
|
+
echo ""; \
|
|
40
|
+
echo "Warning: the branch dependencies-update already exists. If it was already merged, you might want to delete if locally with \`git branch -D dependencies-update\`." >&2; \
|
|
41
|
+
echo ""; \
|
|
42
|
+
exit 1; \
|
|
43
|
+
fi
|
|
44
|
+
$(PNPM) self-update
|
|
45
|
+
-git commit package.json -m"maint: Update pnpm."
|
|
46
|
+
$(PNPM) update --latest --interactive
|
|
47
|
+
-git commit package.json -m"maint: Update dependencies."
|
|
48
|
+
-git commit pnpm-lock.yaml -m"pnpm-lock.yaml: Update." -n
|
|
27
49
|
|
|
28
50
|
.git/hooks/commit-msg:
|
|
29
51
|
echo "npx commitlint --edit" > .git/hooks/commit-msg
|
|
@@ -52,7 +74,7 @@ prettier: install
|
|
|
52
74
|
|
|
53
75
|
.PHONY: check
|
|
54
76
|
check: install eslint
|
|
55
|
-
$(
|
|
77
|
+
$(PNPM) run test
|
|
56
78
|
|
|
57
79
|
|
|
58
80
|
.PHONY: bundle-pre
|
|
@@ -61,8 +83,8 @@ bundle-pre::
|
|
|
61
83
|
@# Please use double-colons `::` so that the base bundle-pre is also run.
|
|
62
84
|
@# Example: Unlink any linked dependencies.
|
|
63
85
|
@# bundle-pre::
|
|
64
|
-
@# -
|
|
65
|
-
@#
|
|
86
|
+
@# -pnpm unlink --recursive
|
|
87
|
+
@# pnpm install
|
|
66
88
|
npx update-browserslist-db@latest
|
|
67
89
|
|
|
68
90
|
|
|
@@ -72,7 +94,7 @@ bundle-pre::
|
|
|
72
94
|
.PHONY: bundle
|
|
73
95
|
bundle: clean-dist bundle-pre install
|
|
74
96
|
ifeq ($(BUILDABLE),true)
|
|
75
|
-
$(
|
|
97
|
+
$(PNPM) run build
|
|
76
98
|
endif
|
|
77
99
|
|
|
78
100
|
|
|
@@ -156,7 +178,7 @@ prerelease-beta:
|
|
|
156
178
|
|
|
157
179
|
.PHONY: serve
|
|
158
180
|
serve: install
|
|
159
|
-
$(
|
|
181
|
+
$(PNPM) run start
|
|
160
182
|
|
|
161
183
|
|
|
162
184
|
upgrade:\
|
|
@@ -170,7 +192,7 @@ upgrade-remove-husky:
|
|
|
170
192
|
test -d .husky\
|
|
171
193
|
&& rm -R .husky\
|
|
172
194
|
&& git add .husky\
|
|
173
|
-
&& git commit -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|
|
195
|
+
&& git commit .husky -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|
|
174
196
|
|| :
|
|
175
197
|
-git config --unset core.hooksPath
|
|
176
198
|
|
|
@@ -180,10 +202,10 @@ eslint.config.js upgrade-eslint:
|
|
|
180
202
|
|| (\
|
|
181
203
|
echo 'module.exports = require("@patternslib/dev/eslint.config.js");' > eslint.config.js\
|
|
182
204
|
&& git add eslint.config.js\
|
|
183
|
-
&& git commit -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
|
|
205
|
+
&& git commit eslint.config.js -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
|
|
184
206
|
)
|
|
185
207
|
test -f ".eslintrc.js"\
|
|
186
208
|
&& rm .eslintrc.js\
|
|
187
209
|
&& git add .eslintrc.js\
|
|
188
|
-
&& git commit -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|
|
210
|
+
&& git commit .eslintrc.js -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|
|
189
211
|
|| :
|
package/README.md
CHANGED
|
@@ -4,12 +4,66 @@ This repository includes base files which are extended in Patternslib, Mockup or
|
|
|
4
4
|
|
|
5
5
|
It includes a Makefile which helps in installing and releasing packages.
|
|
6
6
|
|
|
7
|
+
## Updating dependencies
|
|
8
|
+
|
|
9
|
+
Run `make update` to update the dependencies in this or your dependent project.
|
|
10
|
+
|
|
7
11
|
## Upgrading
|
|
8
12
|
|
|
9
13
|
Run `make upgrade` in your project.
|
|
10
14
|
|
|
11
15
|
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
16
|
|
|
17
|
+
## Migrating a consuming package to pnpm
|
|
18
|
+
|
|
19
|
+
Installing `@patternslib/dev` does not require switching your project from Yarn to pnpm.
|
|
20
|
+
If you choose to migrate, update the consuming project's configuration and workflows explicitly.
|
|
21
|
+
The shared Makefile uses pnpm for installation and for running build, test, and start scripts.
|
|
22
|
+
|
|
23
|
+
1. Pin the pnpm version you intend to use and pin it in your project's `package.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
"packageManager": "pnpm@12.3.4",
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Add a `pnpm-workspace.yaml` file at the project's workspace root:
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
# No nested node_modules for Module Federation.
|
|
33
|
+
shamefullyHoist: true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
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":
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
allowBuilds:
|
|
40
|
+
"@patternslib/dev": true
|
|
41
|
+
|
|
42
|
+
minimumReleaseAgeExclude:
|
|
43
|
+
- "@patternslib/dev"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For more information, see the [pnpm configuration reference](https://pnpm.io/settings).
|
|
47
|
+
|
|
48
|
+
3. Change the `yarn` references in the Makefile to use `pnpm`.
|
|
49
|
+
|
|
50
|
+
```makefile
|
|
51
|
+
PNPM ?= npx pnpm
|
|
52
|
+
|
|
53
|
+
-include node_modules/@patternslib/dev/Makefile
|
|
54
|
+
|
|
55
|
+
.PHONY: install
|
|
56
|
+
pnpm-lock.yaml install:
|
|
57
|
+
$(PNPM) install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If you use `yarn link` or `yarn unlink` in your Makefile, update it to fit the new [pnpm syntax](https://pnpm.io/cli/link).
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
5. Update the CI configuration to use the pnpm cache - see this projects `.github/workflows/test.yml`.
|
|
65
|
+
|
|
66
|
+
6. Run `make install`, add `pnpm-lock.yaml` to the git repository and remove `yarn.lock`.
|
|
13
67
|
|
|
14
68
|
## Code style
|
|
15
69
|
|
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,41 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternslib/dev",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Development base files for working with Patternslib and add-ons.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"packageManager": "pnpm@12.16.1",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@babel/core": "^8.0
|
|
8
|
-
"@babel/preset-env": "^8.0.
|
|
9
|
-
"@commitlint/cli": "^21.2.
|
|
10
|
-
"@commitlint/config-conventional": "^21.2.
|
|
8
|
+
"@babel/core": "^8.1.0",
|
|
9
|
+
"@babel/preset-env": "^8.0.7",
|
|
10
|
+
"@commitlint/cli": "^21.2.4",
|
|
11
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
11
12
|
"@eslint/js": "^10.0.1",
|
|
12
13
|
"@release-it/conventional-changelog": "^12.0.2",
|
|
13
14
|
"babel-loader": "^10.1.1",
|
|
14
15
|
"css-loader": "^7.1.5",
|
|
15
|
-
"eslint": "^10.
|
|
16
|
+
"eslint": "^10.14.0",
|
|
16
17
|
"eslint-config-prettier": "^10.1.8",
|
|
17
|
-
"globals": "^17.
|
|
18
|
+
"globals": "^17.14.0",
|
|
18
19
|
"identity-obj-proxy": "^3.0.0",
|
|
19
20
|
"jest": "^30.5.2",
|
|
20
21
|
"jest-environment-jsdom": "^30.5.2",
|
|
21
22
|
"jest-watch-typeahead": "^3.0.1",
|
|
22
|
-
"prettier": "^3.9.
|
|
23
|
+
"prettier": "^3.9.10",
|
|
23
24
|
"regenerator-runtime": "^0.14.1",
|
|
24
|
-
"release-it": "^21.1.
|
|
25
|
-
"sass": "^1.
|
|
26
|
-
"sass-loader": "^17.0
|
|
25
|
+
"release-it": "^21.1.2",
|
|
26
|
+
"sass": "^1.107.1",
|
|
27
|
+
"sass-loader": "^17.1.0",
|
|
27
28
|
"style-loader": "^4.0.0",
|
|
28
29
|
"terser-webpack-plugin": "^5.6.1",
|
|
29
30
|
"timezone-mock": "^1.4.3",
|
|
30
|
-
"webpack": "^5.
|
|
31
|
-
"webpack-bundle-analyzer": "^5.
|
|
32
|
-
"webpack-cli": "^7.
|
|
33
|
-
"webpack-dev-server": "^6.
|
|
34
|
-
"whybundled": "^2.0.0"
|
|
35
|
-
"yarn": "^1.22.22"
|
|
31
|
+
"webpack": "^5.112.2",
|
|
32
|
+
"webpack-bundle-analyzer": "^5.4.1",
|
|
33
|
+
"webpack-cli": "^7.3.1",
|
|
34
|
+
"webpack-dev-server": "^6.1.0",
|
|
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",
|