@@ -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
336336lint-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
341341lint-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
346346lint-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
350350lint-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
354354lint-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
358358lint-md : node_modules # # lint markdown files
359- npx markdownlint * .md
359+ pnpm exec markdownlint * .md
360360
361361.PHONY : lint-spell
362362lint-spell : # # lint spelling
@@ -417,7 +417,7 @@ watch: ## watch everything and continuously rebuild
417417.PHONY : watch-frontend
418418watch-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
423423watch-backend : go-check # # watch backend files and continuously rebuild
@@ -433,7 +433,7 @@ test-backend: ## test backend files
433433
434434.PHONY : test-frontend
435435test-frontend : node_modules # # test frontend files
436- npx vitest
436+ pnpm exec vitest
437437
438438.PHONY : test-check
439439test-check :
@@ -576,7 +576,7 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test
576576
577577.PHONY : playwright
578578playwright : deps-frontend
579- npx playwright install $(PLAYWRIGHT_FLAGS )
579+ pnpm exec playwright install $(PLAYWRIGHT_FLAGS )
580580
581581.PHONY : test-e2e%
582582test-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
854854update-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
863863update-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
870870webpack : $(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
895895lockfile-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
920920generate-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