-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Switch to pnpm #35274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to pnpm #35274
Changes from 2 commits
199c021
c2fd022
357086b
b25482f
95609c8
71d5a30
9cb4747
e1e58b5
2bc8601
a5533ac
b0a28f0
5b5092b
c54c8cd
5dba206
4343eab
e3e68ee
8b18402
9a21be9
ad76d74
ab34337
bd06180
add7099
454f467
c0abec3
0d4b469
287a1da
ceb0111
41f8659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
audit=false | ||
fund=false | ||
update-notifier=false | ||
package-lock=true | ||
save-exact=true | ||
lockfile-version=3 | ||
auto-install-peers=true | ||
dedupe-peer-dependents=false | ||
enable-pre-post-scripts=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,9 +218,9 @@ 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)" -o "$(PNPM_MISSING)" = "1" ]; then \ | ||
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/"; \ | ||
exit 1; \ | ||
fi | ||
|
||
|
@@ -334,29 +334,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 | ||
pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) | ||
pnpm exec 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 | ||
pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix | ||
pnpm exec vue-tsc | ||
|
||
.PHONY: lint-css | ||
lint-css: node_modules ## lint css files | ||
npx stylelint --color --max-warnings=0 $(STYLELINT_FILES) | ||
pnpm exec 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 | ||
pnpm exec 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) | ||
pnpm exec spectral lint -q -F hint $(SWAGGER_SPEC) | ||
|
||
.PHONY: lint-md | ||
lint-md: node_modules ## lint markdown files | ||
npx markdownlint *.md | ||
pnpm exec markdownlint *.md | ||
|
||
.PHONY: lint-spell | ||
lint-spell: ## lint spelling | ||
|
@@ -417,7 +417,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 pnpm exec webpack --watch --progress | ||
|
||
.PHONY: watch-backend | ||
watch-backend: go-check ## watch backend files and continuously rebuild | ||
|
@@ -433,7 +433,7 @@ test-backend: ## test backend files | |
|
||
.PHONY: test-frontend | ||
test-frontend: node_modules ## test frontend files | ||
npx vitest | ||
pnpm exec vitest | ||
|
||
.PHONY: test-check | ||
test-check: | ||
|
@@ -576,7 +576,7 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test | |
|
||
.PHONY: playwright | ||
playwright: deps-frontend | ||
npx playwright install $(PLAYWRIGHT_FLAGS) | ||
pnpm exec playwright install $(PLAYWRIGHT_FLAGS) | ||
|
||
.PHONY: test-e2e% | ||
test-e2e%: TEST_TYPE ?= e2e | ||
|
@@ -839,8 +839,8 @@ deps-tools: ## install tool dependencies | |
$(GO) install $(GOPLS_MODERNIZE_PACKAGE) & \ | ||
wait | ||
|
||
node_modules: package-lock.json | ||
npm install --no-save | ||
node_modules: pnpm-lock.yaml | ||
pnpm install --frozen-lockfile | ||
@touch node_modules | ||
|
||
.venv: uv.lock | ||
|
@@ -852,28 +852,28 @@ 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 | ||
pnpm exec updates -u -f package.json | ||
rm -rf node_modules pnpm-lock.yaml | ||
pnpm install | ||
pnpm exec nolyfill install | ||
pnpm install | ||
@touch node_modules | ||
|
||
.PHONY: update-py | ||
update-py: node-check | node_modules ## update py dependencies | ||
npx updates -u -f pyproject.toml | ||
pnpm exec updates -u -f pyproject.toml | ||
rm -rf .venv uv.lock | ||
uv sync | ||
@touch .venv | ||
|
||
.PHONY: webpack | ||
webpack: $(WEBPACK_DEST) ## build webpack files | ||
|
||
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | ||
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) pnpm-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 pnpm exec webpack | ||
@touch $(WEBPACK_DEST) | ||
|
||
.PHONY: svg | ||
|
@@ -893,11 +893,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 "package-lock.json is inconsistent with package.json"; \ | ||
echo "Please run 'npm install --package-lock-only' and commit the result:"; \ | ||
echo "pnpm-lock.yaml is inconsistent with package.json"; \ | ||
echo "Please run 'pnpm install --frozen-lockfile' and commit the result:"; \ | ||
printf "%s" "$${diff}"; \ | ||
exit 1; \ | ||
fi | ||
|
@@ -918,7 +918,7 @@ generate-gitignore: ## update gitignore files | |
|
||
.PHONY: generate-images | ||
generate-images: | node_modules | ||
npm install --no-save fabric@6 imagemin-zopfli@7 | ||
pnpm install --no-save fabric@6 imagemin-zopfli@7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently there is open issue pnpm/pnpm#1237 about it. I'm not sure how to solve. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess what we should do is make a second There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. I separated it out, and added cairo and pixman to the flake so that at least those who use nix can ensure they have the expected build deps. I'll have to add a mention of those two to the docs as turns out that prebuilt versions of canvas aren't available for at least my combination of devices and node versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. I think there might be some wasm-based svg-to-png solution somewhere which would work everywhere, but this is good enough for now. Edit: Likely https://github.com/ssssota/svg2png-wasm |
||
node tools/generate-images.js $(TAGS) | ||
|
||
.PHONY: generate-manpage | ||
|
Uh oh!
There was an error while loading. Please reload this page.