Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ 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 check
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
dist/
node_modules/
stats.json
yarn-error.log
pat-*
37 changes: 25 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export

ESLINT ?= npx eslint
PRETTIER ?= npx prettier
YARN ?= npx yarn
PNPM ?= npx pnpm

BUILDABLE := $(shell node -p "Boolean(require('./package.json').scripts?.build)")
PACKAGE_NAME := $(shell node -p "require('./package.json').name")
BUNDLE_NAME := $(subst @patternslib/,,$(subst @plone/,,$(PACKAGE_NAME)))


.PHONY: install
yarn.lock install: .git/hooks/commit-msg
$(YARN) install
pnpm-lock.yaml install: .git/hooks/commit-msg
$(PNPM) install


.git/hooks/commit-msg:
Expand Down Expand Up @@ -52,7 +52,7 @@ prettier: install

.PHONY: check
check: install eslint
$(YARN) run test
$(PNPM) run test


.PHONY: bundle-pre
Expand All @@ -61,8 +61,8 @@ bundle-pre::
@# Please use double-colons `::` so that the base bundle-pre is also run.
@# Example: Unlink any linked dependencies.
@# bundle-pre::
@# -yarn unlink @patternslib/patternslib
@# yarn install --force
@# -pnpm unlink --recursive
@# pnpm install
npx update-browserslist-db@latest


Expand All @@ -72,7 +72,7 @@ bundle-pre::
.PHONY: bundle
bundle: clean-dist bundle-pre install
ifeq ($(BUILDABLE),true)
$(YARN) run build
$(PNPM) run build
endif


Expand Down Expand Up @@ -156,21 +156,22 @@ prerelease-beta:

.PHONY: serve
serve: install
$(YARN) run start
$(PNPM) run start


upgrade:\
.git/hooks/commit-msg\
upgrade-remove-husky\
upgrade-eslint
upgrade-eslint\
upgrade-pnpm
@# Upgrade target, depends on other upgrades


upgrade-remove-husky:
test -d .husky\
&& rm -R .husky\
&& git add .husky\
&& git commit -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
&& git commit .husky -m"maint: @patternslib/dev upgrade - remove .husky directory in favor of git hooks."\
|| :
-git config --unset core.hooksPath

Expand All @@ -180,10 +181,22 @@ eslint.config.js upgrade-eslint:
|| (\
echo 'module.exports = require("@patternslib/dev/eslint.config.js");' > eslint.config.js\
&& git add eslint.config.js\
&& git commit -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
&& git commit eslint.config.js -m"maint: @patternslib/dev upgrade - create eslint.config.js."\
)
test -f ".eslintrc.js"\
&& rm .eslintrc.js\
&& git add .eslintrc.js\
&& git commit -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
&& git commit .eslintrc.js -m"maint: @patternslib/dev upgrade - remove old .eslintrc.js."\
|| :

pnpm-workspace.yaml upgrade-pnpm:
test -f "pnpm-workspace.yaml"\
|| (\
echo '# no nested node_modules - needed by module federation' > pnpm-workspace.yaml\
&& echo 'shamefullyHoist: true' >> pnpm-workspace.yaml\
&& echo '# Allow dependencies directly from GitHub' >> pnpm-workspace.yaml\
&& echo 'blockExoticSubdeps: false' >> pnpm-workspace.yaml\
&& git add pnpm-workspace.yaml\
&& git commit pnpm-workspace.yaml -m"maint: Switch to pnpm."\
)\
|| :
12 changes: 5 additions & 7 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
module.exports = (env) => {
module.exports = (api) => {
let config = {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
corejs: 3,
modules: "auto",
},
],
],
};

// passed via NODE_ENV=development environment variable.
if (env.env() === "development") {
if (api.env() === "development") {
// For development, do less transformations for better readability.
config = {
presets: [
[
"@babel/preset-env",
{
modules: false,
debug: true,
useBuiltIns: false,
targets: "last 1 Chrome version, last 1 Firefox version",
modules: false,
},
],
],
targets: "last 1 Chrome version, last 1 Firefox version",
};
}

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ module.exports = {
},
testEnvironment: "jsdom",
transformIgnorePatterns: [
"/node_modules/(?!@patternslib/)(?!@plone/)(?!preact/)(?!screenfull/).+\\.[t|j]sx?$",
"/node_modules/(?!(?:\\.pnpm/|@patternslib/|@plone/|preact/|screenfull/)).+\\.[tj]sx?$",
],
};
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,40 @@
"version": "4.0.2",
"description": "Development base files for working with Patternslib and add-ons.",
"license": "MIT",
"packageManager": "pnpm@12.3.4",
"dependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@eslint/js": "^10.0.1",
"@release-it/conventional-changelog": "^10.0.6",
"babel-loader": "^10.1.1",
"css-loader": "^7.1.4",
"eslint": "^10.2.1",
"eslint-config-prettier": "^10.1.8",
"globals": "^17.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^30.3.0",
"jest-environment-jsdom": "^30.3.0",
"jest-watch-typeahead": "^3.0.1",
"prettier": "^3.8.3",
"regenerator-runtime": "^0.14.1",
"release-it": "^20.0.0",
"sass": "^1.99.0",
"sass-loader": "^16.0.7",
"style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.4.0",
"timezone-mock": "^1.4.2",
"webpack": "^5.106.2",
"webpack-bundle-analyzer": "^5.3.0",
"webpack-cli": "^7.0.2",
"webpack-dev-server": "^5.2.3",
"whybundled": "^2.0.0",
"yarn": "^1.22.22"
"@babel/core": "8.0.1",
"@babel/preset-env": "8.0.2",
"@commitlint/cli": "21.2.2",
"@commitlint/config-conventional": "21.2.2",
"@eslint/js": "10.0.1",
"@release-it/conventional-changelog": "12.0.0",
"babel-loader": "10.1.1",
"conventional-changelog-conventionalcommits": "10.4.0",
"css-loader": "7.1.5",
"eslint": "10.10.0",
"eslint-config-prettier": "10.1.8",
"globals": "17.12.0",
"identity-obj-proxy": "3.0.0",
"jest": "30.5.1",
"jest-environment-jsdom": "30.5.1",
"jest-watch-typeahead": "3.0.1",
"prettier": "3.9.6",
"regenerator-runtime": "0.14.1",
"release-it": "21.0.2",
"sass": "1.104.0",
"sass-loader": "17.0.1",
"style-loader": "4.0.0",
"terser-webpack-plugin": "5.6.1",
"timezone-mock": "1.4.3",
"webpack": "5.110.3",
"webpack-bundle-analyzer": "5.3.2",
"webpack-cli": "7.2.3",
"webpack-dev-server": "6.0.0",
"whybundled": "2.0.0"
},
"engines": {
"node": ">=22"
"node": "^22.18.0 || >=24.11.0"
},
"scripts": {
"postinstall": "cd $INIT_CWD && make upgrade || true",
Expand Down
Loading