@ -218,15 +218,19 @@ node-check:
$( eval MIN_NODE_VERSION_STR := $( shell grep -Eo '"node":.*[0-9.]+"' package.json | sed -n 's/.*[^0-9.]\([0-9.]*\)"/\1/p' ) )
$( eval MIN_NODE_VERSION := $( shell printf "%03d%03d%03d" $( shell echo '$(MIN_NODE_VERSION_STR)' | tr '.' ' ' ) ) )
$( eval NODE_VERSION := $( shell printf "%03d%03d%03d" $( shell node -v | cut -c2- | tr '.' ' ' ) ; ) )
$( eval NPM_MISSING := $( shell hash npm > /dev/null 2>& 1 || echo 1) )
@if [ " $( NODE_VERSION) " -lt " $( MIN_NODE_VERSION) " -o " $( NPM_MISSING) " = "1" ] ; then \
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/ " ; \
$( eval PNPM_MISSING := $( shell hash pnpm > /dev/null 2>& 1 || echo 1) )
@if [ " $( NODE_VERSION) " -lt " $( MIN_NODE_VERSION) " ] ; then \
echo " Gitea requires Node.js $( MIN_NODE_VERSION_STR) or greater to build. You can get it at https://nodejs.org/en/download/ " ; \
exit 1; \
fi
@if [ " $( PNPM_MISSING) " = "1" ] ; then \
echo "Gitea requires pnpm to build. You can install it at https://pnpm.io/installation" ; \
exit 1; \
fi
.PHONY : clean -all
clean-all : clean ## delete backend, frontend and integration files
rm -rf $( WEBPACK_DEST_ENTRIES) node_modules
rm -rf $( WEBPACK_DEST_ENTRIES) node_modules tools/node_modules
.PHONY : clean
clean : ## delete backend and integration files
@ -334,29 +338,29 @@ lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backen
.PHONY : lint -js
lint-js : node_modules ## lint js files
npx eslint --color --max-warnings= 0 --ext js,ts,vue $( ESLINT_FILES)
npx vue-tsc
p npm e xec eslint --color --max-warnings= 0 --ext js,ts,vue $( ESLINT_FILES)
p npm e xec vue-tsc
.PHONY : lint -js -fix
lint-js-fix : node_modules ## lint js files and fix issues
npx eslint --color --max-warnings= 0 --ext js,ts,vue $( ESLINT_FILES) --fix
npx vue-tsc
p npm e xec eslint --color --max-warnings= 0 --ext js,ts,vue $( ESLINT_FILES) --fix
p npm e xec vue-tsc
.PHONY : lint -css
lint-css : node_modules ## lint css files
npx stylelint --color --max-warnings= 0 $( STYLELINT_FILES)
p npm e xec stylelint --color --max-warnings= 0 $( STYLELINT_FILES)
.PHONY : lint -css -fix
lint-css-fix : node_modules ## lint css files and fix issues
npx stylelint --color --max-warnings= 0 $( STYLELINT_FILES) --fix
p npm e xec stylelint --color --max-warnings= 0 $( STYLELINT_FILES) --fix
.PHONY : lint -swagger
lint-swagger : node_modules ## lint swagger files
npx spectral lint -q -F hint $( SWAGGER_SPEC)
p npm e xec spectral lint -q -F hint $( SWAGGER_SPEC)
.PHONY : lint -md
lint-md : node_modules ## lint markdown files
npx markdownlint *.md
p npm e xec markdownlint *.md
.PHONY : lint -spell
lint-spell : ## lint spelling
@ -417,7 +421,7 @@ watch: ## watch everything and continuously rebuild
.PHONY : watch -frontend
watch-frontend : node -check node_modules ## watch frontend files and continuously rebuild
@rm -rf $( WEBPACK_DEST_ENTRIES)
NODE_ENV = development npx webpack --watch --progress
NODE_ENV = development p npm e xec webpack --watch --progress
.PHONY : watch -backend
watch-backend : go -check ## watch backend files and continuously rebuild
@ -433,7 +437,7 @@ test-backend: ## test backend files
.PHONY : test -frontend
test-frontend : node_modules ## test frontend files
npx vitest
p npm e xec vitest
.PHONY : test -check
test-check :
@ -576,7 +580,7 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test
.PHONY : playwright
playwright : deps -frontend
npx playwright install $( PLAYWRIGHT_FLAGS)
p npm e xec playwright install $( PLAYWRIGHT_FLAGS)
.PHONY : test -e 2e %
test-e2e% : TEST_TYPE ?= e 2e
@ -839,10 +843,14 @@ deps-tools: ## install tool dependencies
$( GO) install $( GOPLS_MODERNIZE_PACKAGE) & \
wait
node_modules : p ackage-lock .json
npm install --no-sav e
node_modules : p npm-lock .yaml
pnpm install --frozen-lockfil e
@touch node_modules
tools/node_modules : tools /package .json
cd tools && pnpm install
@touch tools/node_modules
.venv : uv .lock
uv sync
@touch .venv
@ -852,16 +860,16 @@ update: update-js update-py ## update js and py dependencies
.PHONY : update -js
update-js : node -check | node_modules ## update js dependencies
npx updates -u -f package.json
rm -rf node_modules package-lock.json
npm install --package-lock
npx nolyfill install
npm install --package-lock
p npm e xec updates -u -f package.json
rm -rf node_modules pnpm-lock.yaml
p npm install
p npm e xec nolyfill install
p npm install
@touch node_modules
.PHONY : update -py
update-py : node -check | node_modules ## update py dependencies
npx updates -u -f pyproject.toml
p npm e xec updates -u -f pyproject.toml
rm -rf .venv uv.lock
uv sync
@touch .venv
@ -869,11 +877,11 @@ update-py: node-check | node_modules ## update py dependencies
.PHONY : webpack
webpack : $( WEBPACK_DEST ) ## build webpack files
$(WEBPACK_DEST) : $( WEBPACK_SOURCES ) $( WEBPACK_CONFIGS ) p ackage-lock .json
$(WEBPACK_DEST) : $( WEBPACK_SOURCES ) $( WEBPACK_CONFIGS ) p npm-lock .yaml
@$( MAKE) -s node-check node_modules
@rm -rf $( WEBPACK_DEST_ENTRIES)
@echo "Running webpack..."
@BROWSERSLIST_IGNORE_OLD_DATA= true npx webpack
@BROWSERSLIST_IGNORE_OLD_DATA= true p npm e xec webpack
@touch $( WEBPACK_DEST)
.PHONY : svg
@ -893,11 +901,11 @@ svg-check: svg
.PHONY : lockfile -check
lockfile-check :
npm install --package-lock-only
@diff= $$ ( git diff --color= always package-lock.json ) ; \
pnpm install --frozen-lockfile
@diff= $$ ( git diff --color= always pnpm-lock.yaml ) ; \
if [ -n " $$ diff " ] ; then \
echo "p ackage-lock.json is inconsistent with package.json"; \
echo "Please run ' npm install --package-lock-only ' and commit the result:"; \
echo "p npm-lock.yaml is inconsistent with package.json"; \
echo "Please run ' pnpm install --frozen-lockfile ' and commit the result:"; \
printf "%s" " $$ {diff} " ; \
exit 1; \
fi
@ -917,9 +925,8 @@ generate-gitignore: ## update gitignore files
$( GO) run build/generate-gitignores.go
.PHONY : generate -images
generate-images : | node_modules
npm install --no-save fabric@6 imagemin-zopfli@7
node tools/generate-images.js $( TAGS)
generate-images : | node_modules tools /node_modules ## generate images (requires cairo development packages)
cd tools && node generate-images.js $( TAGS)
.PHONY : generate -manpage
generate-manpage : ## generate manpage