Skip to content

Commit a56f5b3

Browse files
petschkithet
authored andcommitted
maint(bundle): switch package manager from yarn to pnpm
1 parent 3292d3d commit a56f5b3

13 files changed

Lines changed: 12249 additions & 10035 deletions

.github/workflows/coredev-robot-tests.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
comment-id: ${{ github.event.comment.id }}
2828
reactions: '+1'
2929
token: ${{ secrets.GITHUB_TOKEN }}
30-
30+
3131
- name: Info
3232
run: |
3333
echo "Workflow triggered with comment '/run-coredev-robottests' "
@@ -52,14 +52,17 @@ jobs:
5252
path: tests
5353

5454
# ── 2. Node.js setup ──────────────────────────────────────────────────────
55+
- name: Install pnpm
56+
uses: pnpm/action-setup@v4
57+
5558
- name: Set up Node.js
5659
uses: actions/setup-node@v4
5760
with:
5861
node-version: "22"
59-
cache: yarn
62+
cache: pnpm
6063

61-
- name: Install yarn dependencies
62-
run: yarn install
64+
- name: Install pnpm dependencies
65+
run: pnpm install
6366

6467
# ── 3. Python / make install ─────────────────────────────────────────────
6568
- name: Set up Python 3.12
@@ -89,7 +92,7 @@ jobs:
8992

9093
# ── 2b. Build mockup bundle into tests/src/plone.staticresources ─────────
9194
- name: Build mockup for tests (webpack)
92-
run: yarn build:webpack:tests
95+
run: pnpm build:webpack:tests
9396

9497
# ── 4. Install Playwright / rfbrowser ────────────────────────────────────
9598
- name: install rfbrowser
@@ -110,7 +113,7 @@ jobs:
110113
with open('mxcheckouts.ini', 'w') as f:
111114
cfg.write(f)
112115
"
113-
116+
114117
- name: Run Coredev robot tests
115118
working-directory: tests
116119
run: ROBOTSUITE_PREFIX=ONLYROBOT TEST_ARGS="--all -t ONLYROBOT" make test

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v4
1617
- uses: actions/setup-node@v4
1718
with:
1819
node-version: "22"
19-
cache: "yarn"
20+
cache: pnpm
2021
- name: Build docs
2122
run: |
2223
make docs

.github/workflows/test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ on:
44
push:
55
branches:
66
- master
7-
- 5.0.x
87
pull_request:
98
branches:
109
- master
11-
- 5.0.x
1210

1311
jobs:
1412
build:
@@ -18,10 +16,11 @@ jobs:
1816
NODE_OPTIONS: "--max_old_space_size=8192"
1917
steps:
2018
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@v4
2120
- uses: actions/setup-node@v4
2221
with:
2322
node-version: "22"
24-
cache: 'yarn'
25-
- run: yarn install
23+
cache: pnpm
24+
- run: pnpm install
2625
- run: make eslint
27-
- run: yarn test
26+
- run: pnpm test

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
/src/pat/modal/modal.css
99
/src/pat/relateditems/relateditems.css
1010
/src/pat/tinymce/tinymce.css
11-
/stamp-npm
12-
/yarn-error.log
1311
devsrc/*
1412
dist/
1513
docs/_site
1614
docs/mockup/patterns
1715
node_modules/
18-
stamp-yarn
1916
stats.json
2017
/_site/*

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
public-hoist-pattern[]=*

Makefile

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,48 @@
1818
-include .env
1919
export
2020

21-
YARN ?= npx yarn
21+
PNPM = pnpm
2222

2323

24-
yarn.lock install:
25-
$(YARN) install
24+
pnpm-lock.yaml install:
25+
npm i -g corepack@latest && corepack enable
26+
$(PNPM) install
27+
28+
29+
.PHONY: check
30+
check: install eslint
31+
$(PNPM) run test
2632

2733

2834
.PHONY:
2935
watch-plone:
30-
$(YARN) run watch:webpack:plone
36+
$(PNPM) run watch:webpack:plone
3137

3238

3339
.PHONY:
3440
bundle-plone:
35-
$(YARN) run build:webpack:plone
41+
$(PNPM) run build:webpack:plone
3642

3743

3844
.PHONY: bundle
39-
bundle: install
40-
$(YARN) run build:webpack
45+
bundle: clean-dist bundle-pre install
46+
$(PNPM) run build:webpack
47+
48+
49+
.PHONY: serve
50+
serve: install
51+
$(PNPM) run start
52+
4153

4254
.PHONY: docs
4355
docs: install
44-
$(YARN) build:webpack:docs
45-
$(YARN) build:docs
56+
$(PNPM) build:webpack:docs
57+
$(PNPM) build:docs
58+
4659

4760
# Unlink any linked dependencies before building a bundle.
4861
bundle-pre:
49-
-$(YARN) unlink @patternslib/dev
50-
-$(YARN) unlink @patternslib/pat-code-editor
51-
-$(YARN) unlink @patternslib/patternslib
52-
$(YARN) install --force
62+
-$(PNPM) unlink @patternslib/dev
63+
-$(PNPM) unlink @patternslib/pat-code-editor
64+
-$(PNPM) unlink @patternslib/patternslib
65+
$(PNPM) install --force

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ There are several options to integrate Mockup.
3131

3232
This starts up the webpack build process in watch mode.
3333
Any JavaScript changes are immediately compiled.
34-
For some changes - like for adding new packages via `yarn add` and then using it you might need to restart.
34+
For some changes - like for adding new packages via `pnpm add` and then using it you might need to restart.
3535
The command also spins up a development server for our `11ty` based documentation and demo pages.
36-
If you don't need the docs running, you can run `yarn start:webpack` or `npm run start:webpack` instead, so that only the webpack devserver is running.
36+
If you don't need the docs running, you can run `pnpm start:webpack` or `npm run start:webpack` instead, so that only the webpack devserver is running.
3737

3838
- Go to `http://localhost:8000`:
3939
On this port our demo and documentation pages are served.
@@ -124,7 +124,7 @@ If you want to develop in Plone, you have two options:
124124
1. Run `make watch-plone`. You need buildout to have plone.staticresources checked out next to Mockup.
125125
Mockup will compile it's bundle directly into the `++plone++static` directory of plone.staticresources and update it when you change something in Mockup.
126126

127-
2. Run `npx yarn start:webpack`, go to the resource registry ( http://localhost:8080/Plone/@@resourceregistry-controlpanel ) and add the URL `http://localhost:8000/bundle.min.js` to the JavaScript input field of the plone bundle instead of the other URL `++plone++static/bundle-plone/bundle.min.js`.
127+
2. Run `npx pnpm start:webpack`, go to the resource registry ( http://localhost:8080/Plone/@@resourceregistry-controlpanel ) and add the URL `http://localhost:8000/bundle.min.js` to the JavaScript input field of the plone bundle instead of the other URL `++plone++static/bundle-plone/bundle.min.js`.
128128

129129
For more commands inspect Makefile and the script part of the package.json.
130130

@@ -166,23 +166,23 @@ You can put some `debugger;` statements to the code to break the execution and i
166166

167167
### Developing external Packages
168168

169-
If you want to work on ony external package like Patternslib or any external Mockup pattern you can do so by linking those packages into the node_modules folder via `yarn link`.
169+
If you want to work on ony external package like Patternslib or any external Mockup pattern you can do so by linking those packages into the node_modules folder via `pnpm link`.
170170

171171
1. Check out the external package you want to develop on.
172172

173-
2. Make sure you have installed the dependencies in the development package (e.g. by running `yarn install`). (TODO: verify that!)
173+
2. Make sure you have installed the dependencies in the development package (e.g. by running `pnpm install`). (TODO: verify that!)
174174

175-
3. Run `yarn link` in the external development package to register it with yarn.
175+
3. Run `pnpm link` in the external development package to register it with pnpm.
176176

177-
4. Run `yarn link "PACKAGE-NAME"` in mockup to create the node_modules symlink.
177+
4. Run `pnpm link "PACKAGE-NAME"` in mockup to create the node_modules symlink.
178178

179-
After developing you might want to run `yarn unlink "PACKAGE-NAME"` to unlink the development package.
179+
After developing you might want to run `pnpm unlink "PACKAGE-NAME"` to unlink the development package.
180180

181181
For more information see:
182182

183-
- https://classic.yarnpkg.com/en/docs/cli/link/
184-
- https://classic.yarnpkg.com/en/docs/cli/unlink
185-
- https://docs.npmjs.com/cli/v7/commands/npm-link
183+
- https://pnpm.io/cli/link
184+
- https://pnpm.io/cli/unlink
185+
- https://docs.npmjs.com/cli/v11/commands/npm-link
186186

187187
**Please note:**: Make sure to unlink and reinstall development pacakges before building a production bundle.
188188
In doubt, remove the node_modules directory and re-install.
@@ -195,7 +195,7 @@ https://formidable.com/blog/2018/finding-webpack-duplicates-with-inspectpack-plu
195195
Build the stats.json file:
196196

197197
```
198-
npx yarn build:stats
198+
npx pnpm build:stats
199199
```
200200

201201
Check dependency tree and why which package was included:
@@ -219,7 +219,7 @@ To update the translation file, the following needs to be done:
219219
1. Extract the messages from this package:
220220

221221
```
222-
npx yarn run i18n
222+
npx pnpm run i18n
223223
```
224224

225225
Or just `npm run i18n`...
@@ -290,7 +290,7 @@ Without grouping: `TYPE: MESSAGE`
290290

291291
If the commit message doesn't follow this convention, then it won't be included in the changelog.
292292
To bypass the pre-commit hook, use the git `-n` switch.
293-
Example: `git commit yarn.lock -m "yarn install." -n`.
293+
Example: `git commit pnpm-lock.yaml -m "pnpm install." -n`.
294294

295295
If you are working on a component like the structure pattern (pat-structure), use `pat structure` as a group.
296296

@@ -318,11 +318,11 @@ git commit -am "maint: Remove unnecessary file from root directory."
318318

319319
**Note**
320320

321-
Please keep commits on the `yarn.lock` file or any other auto-generated code seperate.
321+
Please keep commits on the `pnpm-lock.yaml` file or any other auto-generated code seperate.
322322

323-
Just commit them seperately with `git commit yarn.lock -m "yarn install" -n`.
323+
Just commit them seperately with `git commit pnpm-lock.yaml -m "pnpm install" -n`.
324324

325325
Keeping them seperate reduces the effort when merging or rebasing branches where a merge conflict can easily happen.
326-
In such cases you can just withdraw your changes on the `yarn.lock` file, or remove those commits and reinstall with `yarn install` at the end of a successful merge or rebase.
326+
In such cases you can just withdraw your changes on the `pnpm-lock.yaml` file, or remove those commits and reinstall with `pnpm install` at the end of a successful merge or rebase.
327327

328328
---

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const config = require("@patternslib/dev/jest.config.js");
44
// config.setupFilesAfterEnv.push("./node_modules/@testing-library/jest-dom/extend-expect");
55
config.setupFilesAfterEnv.push(path.resolve(__dirname, "./src/setup-tests.js"));
66
config.transformIgnorePatterns = [
7-
"/node_modules/(?!@patternslib/)(?!@plone/)(?!preact/)(?!screenfull/)(?!sinon/)(?!bootstrap/)(?!datatable/)(?!svelte/)(?!esm-env/).+\\.[t|j]sx?$",
7+
"/node_modules/(?!.pnpm/)(?!@patternslib/)(?!@plone/)(?!preact/)(?!screenfull/)(?!sinon/)(?!bootstrap/)(?!datatable/)(?!svelte/)(?!esm-env/).+\\.[t|j]sx?$",
8+
"/node_modules/.pnpm/(?!@patternslib)(?!@plone)(?!preact)(?!screenfull)(?!sinon)(?!bootstrap)(?!datatable)(?!svelte)(?!esm-env)",
89
];
910

1011
// add svelte-jester

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
"main": "./src/patterns.js",
77
"dependenciesComments": {
88
"backbone": "Dependency moved to devDependencies since it requests oudated versions Underscore. Not fixing this dependencies in other bundles would make use paginator those outdated dependencies and result in a broken structure pattern.",
9-
"backbone.paginator": "Dependency moved to devDependencies since it requests oudated versions Underscore. Not fixing this dependencies in other bundles would make use paginator those outdated dependencies and result in a broken structure pattern."
9+
"backbone.paginator": "Dependency moved to devDependencies since it requests oudated versions Underscore. Not fixing this dependencies in other bundles would make use paginator those outdated dependencies and result in a broken structure pattern.",
10+
"select2": "Use the commit hash for checkout since pnpm has problems with the annotated commit #3.5.4"
1011
},
12+
"packageManager": "pnpm@10.32.1",
1113
"dependencies": {
1214
"@11ty/eleventy-upgrade-help": "3.0.2",
1315
"@patternslib/pat-code-editor": "4.0.1",
@@ -38,7 +40,7 @@
3840
"jquery-form": "4.3.0",
3941
"jquery.browser": "0.1.0",
4042
"js-cookie": "^3.0.5",
41-
"select2": "git+https://github.com/ivaynberg/select2.git#3.5.4",
43+
"select2": "git+https://github.com/ivaynberg/select2.git#95a977f674b6938af55ec5f28b7772df93786c5c",
4244
"sortablejs": "^1.15.6",
4345
"tinymce": "8.3.2",
4446
"tinymce-i18n": "26.2.16",
@@ -120,5 +122,9 @@
120122
"publishConfig": {
121123
"access": "public"
122124
},
123-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
125+
"pnpm": {
126+
"overrides": {
127+
"slick-carousel": "git+https://github.com/kenwheeler/slick.git#d0716f19aa730006ee80ab026625fb1107816a97"
128+
}
129+
}
124130
}

0 commit comments

Comments
 (0)