Skip to content

Commit 199c021

Browse files
Switch to pnpm
1 parent ef613ee commit 199c021

File tree

13 files changed

+10495
-14446
lines changed

13 files changed

+10495
-14446
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ modifies/dependencies:
5959
- changed-files:
6060
- any-glob-to-any-file:
6161
- "package.json"
62-
- "package-lock.json"
62+
- "pnpm-lock.yaml"
6363
- "pyproject.toml"
6464
- "uv.lock"
6565
- "go.mod"

.github/workflows/files-changed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- "tools/*.ts"
5959
- "assets/emoji.json"
6060
- "package.json"
61-
- "package-lock.json"
61+
- "pnpm-lock.yaml"
6262
- "Makefile"
6363
- ".eslintrc.cjs"
6464
- ".npmrc"
@@ -67,7 +67,7 @@ jobs:
6767
- "**/*.md"
6868
- ".markdownlint.yaml"
6969
- "package.json"
70-
- "package-lock.json"
70+
- "pnpm-lock.yaml"
7171
7272
actions:
7373
- ".github/workflows/*"
@@ -90,7 +90,7 @@ jobs:
9090
- "templates/swagger/v1_input.json"
9191
- "Makefile"
9292
- "package.json"
93-
- "package-lock.json"
93+
- "pnpm-lock.yaml"
9494
- ".spectral.yaml"
9595
9696
yaml:

.github/workflows/pull-compliance.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
- uses: actions/setup-node@v4
3838
with:
3939
node-version: 24
40-
cache: npm
41-
cache-dependency-path: package-lock.json
40+
cache: pnpm
41+
cache-dependency-path: pnpm-lock.yaml
4242
- run: make deps-py
4343
- run: make deps-frontend
4444
- run: make lint-templates
@@ -63,8 +63,8 @@ jobs:
6363
- uses: actions/setup-node@v4
6464
with:
6565
node-version: 24
66-
cache: npm
67-
cache-dependency-path: package-lock.json
66+
cache: pnpm
67+
cache-dependency-path: pnpm-lock.yaml
6868
- run: make deps-frontend
6969
- run: make lint-swagger
7070

@@ -134,8 +134,8 @@ jobs:
134134
- uses: actions/setup-node@v4
135135
with:
136136
node-version: 24
137-
cache: npm
138-
cache-dependency-path: package-lock.json
137+
cache: pnpm
138+
cache-dependency-path: pnpm-lock.yaml
139139
- run: make deps-frontend
140140
- run: make lint-frontend
141141
- run: make checks-frontend
@@ -183,8 +183,8 @@ jobs:
183183
- uses: actions/setup-node@v4
184184
with:
185185
node-version: 24
186-
cache: npm
187-
cache-dependency-path: package-lock.json
186+
cache: pnpm
187+
cache-dependency-path: pnpm-lock.yaml
188188
- run: make deps-frontend
189189
- run: make lint-md
190190

.github/workflows/pull-e2e-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
- uses: actions/setup-node@v4
2727
with:
2828
node-version: 24
29-
cache: npm
30-
cache-dependency-path: package-lock.json
29+
cache: pnpm
30+
cache-dependency-path: pnpm-lock.yaml
3131
- run: make deps-frontend frontend deps-backend
32-
- run: npx playwright install --with-deps
32+
- run: pnpm exec playwright install --with-deps
3333
- run: make test-e2e-sqlite
3434
timeout-minutes: 40
3535
env:

.github/workflows/release-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- uses: actions/setup-node@v4
2424
with:
2525
node-version: 24
26-
cache: npm
27-
cache-dependency-path: package-lock.json
26+
cache: pnpm
27+
cache-dependency-path: pnpm-lock.yaml
2828
- run: make deps-frontend deps-backend
2929
# xgo build
3030
- run: make release

.github/workflows/release-tag-rc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
- uses: actions/setup-node@v4
2525
with:
2626
node-version: 24
27-
cache: npm
28-
cache-dependency-path: package-lock.json
27+
cache: pnpm
28+
cache-dependency-path: pnpm-lock.yaml
2929
- run: make deps-frontend deps-backend
3030
# xgo build
3131
- run: make release

.github/workflows/release-tag-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- uses: actions/setup-node@v4
2929
with:
3030
node-version: 24
31-
cache: npm
32-
cache-dependency-path: package-lock.json
31+
cache: pnpm
32+
cache-dependency-path: pnpm-lock.yaml
3333
- run: make deps-frontend deps-backend
3434
# xgo build
3535
- run: make release

.npmrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
audit=false
22
fund=false
33
update-notifier=false
4-
package-lock=true
54
save-exact=true
6-
lockfile-version=3
5+
auto-install-peers=true
6+
dedupe-peer-dependents=false
7+
enable-pre-post-scripts=true

Makefile

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ node-check:
218218
$(eval MIN_NODE_VERSION_STR := $(shell grep -Eo '"node":.*[0-9.]+"' package.json | sed -n 's/.*[^0-9.]\([0-9.]*\)"/\1/p'))
219219
$(eval MIN_NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_NODE_VERSION_STR)' | tr '.' ' ')))
220220
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | cut -c2- | tr '.' ' ');))
221-
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
222-
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
223-
echo "Gitea requires Node.js $(MIN_NODE_VERSION_STR) or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
221+
$(eval PNPM_MISSING := $(shell hash pnpm > /dev/null 2>&1 || echo 1))
222+
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(PNPM_MISSING)" = "1" ]; then \
223+
echo "Gitea requires Node.js $(MIN_NODE_VERSION_STR) or greater and pnpm to build. You can get it at https://nodejs.org/en/download/"; \
224224
exit 1; \
225225
fi
226226

@@ -334,29 +334,29 @@ lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backen
334334

335335
.PHONY: lint-js
336336
lint-js: node_modules ## lint js files
337-
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
338-
npx vue-tsc
337+
pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
338+
pnpm exec vue-tsc
339339

340340
.PHONY: lint-js-fix
341341
lint-js-fix: node_modules ## lint js files and fix issues
342-
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
343-
npx vue-tsc
342+
pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
343+
pnpm exec vue-tsc
344344

345345
.PHONY: lint-css
346346
lint-css: node_modules ## lint css files
347-
npx stylelint --color --max-warnings=0 $(STYLELINT_FILES)
347+
pnpm exec stylelint --color --max-warnings=0 $(STYLELINT_FILES)
348348

349349
.PHONY: lint-css-fix
350350
lint-css-fix: node_modules ## lint css files and fix issues
351-
npx stylelint --color --max-warnings=0 $(STYLELINT_FILES) --fix
351+
pnpm exec stylelint --color --max-warnings=0 $(STYLELINT_FILES) --fix
352352

353353
.PHONY: lint-swagger
354354
lint-swagger: node_modules ## lint swagger files
355-
npx spectral lint -q -F hint $(SWAGGER_SPEC)
355+
pnpm exec spectral lint -q -F hint $(SWAGGER_SPEC)
356356

357357
.PHONY: lint-md
358358
lint-md: node_modules ## lint markdown files
359-
npx markdownlint *.md
359+
pnpm exec markdownlint *.md
360360

361361
.PHONY: lint-spell
362362
lint-spell: ## lint spelling
@@ -417,7 +417,7 @@ watch: ## watch everything and continuously rebuild
417417
.PHONY: watch-frontend
418418
watch-frontend: node-check node_modules ## watch frontend files and continuously rebuild
419419
@rm -rf $(WEBPACK_DEST_ENTRIES)
420-
NODE_ENV=development npx webpack --watch --progress
420+
NODE_ENV=development pnpm exec webpack --watch --progress
421421

422422
.PHONY: watch-backend
423423
watch-backend: go-check ## watch backend files and continuously rebuild
@@ -433,7 +433,7 @@ test-backend: ## test backend files
433433

434434
.PHONY: test-frontend
435435
test-frontend: node_modules ## test frontend files
436-
npx vitest
436+
pnpm exec vitest
437437

438438
.PHONY: test-check
439439
test-check:
@@ -576,7 +576,7 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test
576576

577577
.PHONY: playwright
578578
playwright: deps-frontend
579-
npx playwright install $(PLAYWRIGHT_FLAGS)
579+
pnpm exec playwright install $(PLAYWRIGHT_FLAGS)
580580

581581
.PHONY: test-e2e%
582582
test-e2e%: TEST_TYPE ?= e2e
@@ -839,8 +839,8 @@ deps-tools: ## install tool dependencies
839839
$(GO) install $(GOPLS_MODERNIZE_PACKAGE) & \
840840
wait
841841

842-
node_modules: package-lock.json
843-
npm install --no-save
842+
node_modules: pnpm-lock.yaml
843+
pnpm install --frozen-lockfile
844844
@touch node_modules
845845

846846
.venv: uv.lock
@@ -852,28 +852,28 @@ update: update-js update-py ## update js and py dependencies
852852

853853
.PHONY: update-js
854854
update-js: node-check | node_modules ## update js dependencies
855-
npx updates -u -f package.json
856-
rm -rf node_modules package-lock.json
857-
npm install --package-lock
858-
npx nolyfill install
859-
npm install --package-lock
855+
pnpm exec updates -u -f package.json
856+
rm -rf node_modules pnpm-lock.yaml
857+
pnpm install
858+
pnpm exec nolyfill install
859+
pnpm install
860860
@touch node_modules
861861

862862
.PHONY: update-py
863863
update-py: node-check | node_modules ## update py dependencies
864-
npx updates -u -f pyproject.toml
864+
pnpm exec updates -u -f pyproject.toml
865865
rm -rf .venv uv.lock
866866
uv sync
867867
@touch .venv
868868

869869
.PHONY: webpack
870870
webpack: $(WEBPACK_DEST) ## build webpack files
871871

872-
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json
872+
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) pnpm-lock.yaml
873873
@$(MAKE) -s node-check node_modules
874874
@rm -rf $(WEBPACK_DEST_ENTRIES)
875875
@echo "Running webpack..."
876-
@BROWSERSLIST_IGNORE_OLD_DATA=true npx webpack
876+
@BROWSERSLIST_IGNORE_OLD_DATA=true pnpm exec webpack
877877
@touch $(WEBPACK_DEST)
878878

879879
.PHONY: svg
@@ -893,11 +893,11 @@ svg-check: svg
893893

894894
.PHONY: lockfile-check
895895
lockfile-check:
896-
npm install --package-lock-only
897-
@diff=$$(git diff --color=always package-lock.json); \
896+
pnpm install --frozen-lockfile
897+
@diff=$$(git diff --color=always pnpm-lock.yaml); \
898898
if [ -n "$$diff" ]; then \
899-
echo "package-lock.json is inconsistent with package.json"; \
900-
echo "Please run 'npm install --package-lock-only' and commit the result:"; \
899+
echo "pnpm-lock.yaml is inconsistent with package.json"; \
900+
echo "Please run 'pnpm install --frozen-lockfile' and commit the result:"; \
901901
printf "%s" "$${diff}"; \
902902
exit 1; \
903903
fi
@@ -918,7 +918,7 @@ generate-gitignore: ## update gitignore files
918918

919919
.PHONY: generate-images
920920
generate-images: | node_modules
921-
npm install --no-save fabric@6 imagemin-zopfli@7
921+
pnpm install --no-save fabric@6 imagemin-zopfli@7
922922
node tools/generate-images.js $(TAGS)
923923

924924
.PHONY: generate-manpage

0 commit comments

Comments
 (0)