From 0fb04d0c2c20b36de19abf16232e85880509b6b9 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 8 Sep 2026 01:47:28 +0200 Subject: [PATCH] maint: Switch to pnpm. --- .github/workflows/test.yml | 9 +++++---- .gitignore | 1 - Makefile | 38 +++++++++++++++++++------------------- package.json | 2 +- pnpm-workspace.yaml | 9 +++++++++ 5 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 pnpm-workspace.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4af49a7d..e5edb7422 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,12 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: pnpm/action-setup@v6 + - uses: actions/setup-node@v7 with: - node-version: '22' - cache: 'yarn' + node-version: '24' + cache: 'pnpm' - run: | make install make check diff --git a/.gitignore b/.gitignore index c3c3b5e7a..32c6c11d6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ .sass-cache /paternslib.sublime-project /paternslib.sublime-workspace -/stamp-yarn Gemfile.lock Patterns-site/ cache/ diff --git a/Makefile b/Makefile index 3c4b516f3..2e3f5ae17 100644 --- a/Makefile +++ b/Makefile @@ -20,20 +20,26 @@ export PEGJS ?= npx pegjs SASS ?= npx sass -YARN ?= npx yarn +PNPM ?= npx pnpm PACKAGE_NAME = "patternslib" all:: bundle css -yarn.lock install: - $(YARN) install +.PHONY: install +pnpm-lock.yaml install: .git/hooks/commit-msg + $(PNPM) install + + +.git/hooks/commit-msg: + echo "npx commitlint --edit" > .git/hooks/commit-msg + chmod u+x .git/hooks/commit-msg .PHONY: watch watch: install - $(YARN) watch + $(PNPM) run watch .PHONY: build @@ -48,14 +54,8 @@ depends-parser: install # Unlink any linked dependencies before building a bundle. # Also run parent @patternslib/dev `bundle-pre` (double colon `::`) bundle-pre:: - -$(YARN) unlink @patternslib/dev - -$(YARN) unlink @patternslib/pat-content-mirror - -$(YARN) unlink @patternslib/pat-doclock - -$(YARN) unlink @patternslib/pat-shopping-cart - -$(YARN) unlink @patternslib/pat-sortable-table - -$(YARN) unlink @patternslib/pat-tiptap - -$(YARN) unlink @patternslib/pat-upload - $(YARN) install --force + -$(PNPM) unlink --recursive + $(MAKE) install .PHONY: css @@ -73,7 +73,7 @@ Patterns-site/Makefile: .PHONY: update-patternslib-site update-patternslib-site: Patterns-site/Makefile # something - cd Patterns-site && git pull && make update-patternslib && git push + cd Patterns-site && git pull && $(MAKE) update-patternslib && git push # Overrides release + Update https://patternslib.com @@ -81,17 +81,17 @@ update-patternslib-site: Patterns-site/Makefile .PHONY: release-major release-major: - make LEVEL=major release - make update-patternslib-site + $(MAKE) LEVEL=major release + $(MAKE) update-patternslib-site .PHONY: release-minor release-minor: - make LEVEL=minor release - make update-patternslib-site + $(MAKE) LEVEL=minor release + $(MAKE) update-patternslib-site .PHONY: release-patch release-patch: - make LEVEL=patch release - make update-patternslib-site + $(MAKE) LEVEL=patch release + $(MAKE) update-patternslib-site diff --git a/package.json b/package.json index 53981aad6..d5738c1c7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "title": "Markup patterns to drive behaviour.", "description": "Patternslib is a JavaScript library that enables designers to build rich interactive prototypes without the need for writing any Javascript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming language. Accessibility, SEO and well structured HTML are core values of Patterns.", "license": "BSD-3-Clause", + "packageManager": "pnpm@12.3.4", "dependencies": { "@fullcalendar/adaptive": "^5.11.3", "@fullcalendar/core": "^5.11.3", @@ -31,7 +32,6 @@ "showdown": "^2.1.0", "showdown-prettify": "^1.3.0", "slick-carousel": "git+https://github.com/kenwheeler/slick.git#d0716f19aa730006ee80ab026625fb1107816a97", - "slides": "git+https://github.com/Patternslib/slides.git", "spectrum-colorpicker": "^1.8.0", "tippy.js": "^6.3.7" }, diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..dcd44c38c --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,9 @@ +# no nested node_modules - needed by module federation +shamefullyHoist: true +# Allow dependencies directly from GitHub +blockExoticSubdeps: false +allowBuilds: + '@parcel/watcher': true + '@patternslib/dev': true + unrs-resolver: true + yarn: true