Build: Centralize npm targets in root Makefile and align flags

Define npm clean-install, install, update, and audit commands once in the
root Makefile and have frontend/Makefile delegate via $(MAKE) -C .., so the
single root node_modules and package-lock.json are used. Standardize the
--ignore-scripts/--no-audit/--no-fund/--no-update-notifier flag order across
all npm invocations and drop the no-op --no-audit from npm audit.
This commit is contained in:
Michael Mayer 2026-05-29 04:40:23 +00:00
parent e39f9f20a6
commit c786eb6df9
2 changed files with 32 additions and 21 deletions

View file

@ -280,8 +280,7 @@ dep-list-all:
go list -u -m -json all | go-mod-outdated
vuln: audit
audit: audit-frontend audit-backend
audit-frontend:
npm audit --ignore-scripts --no-fund --no-audit --no-update-notifier
audit-frontend: npm-audit
audit-backend: dep-vuln
dep-audit: dep-vuln
dep-vuln:
@ -299,12 +298,22 @@ npm-version:
dep-npm:
@echo "Installing NPM package manager..."
@if command -v sudo >/dev/null 2>&1; then \
sudo npm install -g --location=global --ignore-scripts --no-fund --no-audit --no-update-notifier "npm@latest"; \
sudo npm install -g --location=global --ignore-scripts --no-audit --no-fund --no-update-notifier "npm@latest"; \
else \
npm install -g --location=global --ignore-scripts --no-fund --no-audit --no-update-notifier "npm@latest"; \
npm install -g --location=global --ignore-scripts --no-audit --no-fund --no-update-notifier "npm@latest"; \
fi
dep-js:
npm ci --ignore-scripts --no-update-notifier --no-audit
dep-js: npm-ci
npm-ci:
$(info Clean install of NPM dependencies...)
npm ci --ignore-scripts --no-audit --no-fund --no-update-notifier
npm-install:
$(info Installing NPM dependencies...)
npm install --save --ignore-scripts --no-audit --no-fund --no-update-notifier
npm-update:
$(info Updating NPM dependencies in package.json and package-lock.json...)
npm update --save --package-lock --ignore-scripts --no-audit --no-fund --no-update-notifier
npm-audit:
npm audit --ignore-scripts --no-fund --no-update-notifier
tools: gh claude codex
codex: dep-codex codex-version codex-skills
codex-version:
@ -313,9 +322,9 @@ dep-codex:
@echo "Installing Codex CLI..."
@[ -n "$(CODEX_HOME)" ] && [ "$(CODEX_HOME)" != "/" ] && install -d -m 700 -- "$(CODEX_HOME)" || true
@if command -v sudo >/dev/null 2>&1; then \
sudo npm install -g --location=global --ignore-scripts --no-fund --no-audit --no-update-notifier "@openai/codex@latest"; \
sudo npm install -g --location=global --ignore-scripts --no-audit --no-fund --no-update-notifier "@openai/codex@latest"; \
else \
npm install -g --location=global --ignore-scripts --no-fund --no-audit --no-update-notifier "@openai/codex@latest"; \
npm install -g --location=global --ignore-scripts --no-audit --no-fund --no-update-notifier "@openai/codex@latest"; \
fi
skills: agents-skills claude-skills
agents-skills: codex-skills

View file

@ -42,31 +42,33 @@ notice:
license-report --only=prod --config=.report.json > NOTICE
install-npm:
# Split global installs and disable package scripts for safety.
sudo npm install -g --ignore-scripts --no-fund --no-audit --no-update-notifier npm@latest
sudo npm install -g --ignore-scripts --no-fund --no-audit --no-update-notifier npm-check-updates@latest license-report@latest
sudo npm install -g --ignore-scripts --no-audit --no-fund --no-update-notifier npm@latest
sudo npm install -g --ignore-scripts --no-audit --no-fund --no-update-notifier npm-check-updates@latest license-report@latest
install-testcafe:
npm install -g --ignore-scripts --no-fund --no-audit --no-update-notifier testcafe@latest
npm install -g --ignore-scripts --no-audit --no-fund --no-update-notifier testcafe@latest
install-eslint:
npm install -g --ignore-scripts --no-fund --no-audit --no-update-notifier eslint globals @eslint/eslintrc @eslint/js eslint-config-prettier eslint-formatter-pretty eslint-plugin-html eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-vue eslint-webpack-plugin vue-eslint-parser prettier
npm install -g --ignore-scripts --no-audit --no-fund --no-update-notifier eslint globals @eslint/eslintrc @eslint/js eslint-config-prettier eslint-formatter-pretty eslint-plugin-html eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-vue eslint-webpack-plugin vue-eslint-parser prettier
upgrade:
$(info Securely upgrading NPM dependencies...)
$(DOCKER_NPM) 'npx -y npm@latest update --save --package-lock --ignore-scripts --no-fund --no-audit --no-update-notifier && npx -y npm@latest install --ignore-scripts --no-audit --no-fund --no-update-notifier'
npm-install:
$(info Installing NPM dependencies...)
(cd .. && npm install --save --ignore-scripts --no-audit --no-fund --no-update-notifier)
$(DOCKER_NPM) 'npx -y npm@latest update --save --package-lock --ignore-scripts --no-audit --no-fund --no-update-notifier && npx -y npm@latest install --ignore-scripts --no-audit --no-fund --no-update-notifier'
ci: npm-ci
npm-ci:
@$(MAKE) -C .. --no-print-directory npm-ci
install: npm-install
npm-update:
$(info Updating NPM dependencies in package-lock.json...)
(cd .. && npm update --save --package-lock --ignore-scripts --no-audit --no-fund --no-update-notifier)
npm-install:
@$(MAKE) -C .. --no-print-directory npm-install
update: npm-update npm-install
npm-update:
@$(MAKE) -C .. --no-print-directory npm-update
audit: npm-audit
npm-audit:
@$(MAKE) -C .. --no-print-directory npm-audit
security-check: # Scan for missing --ignore-scripts and unsafe v-html
npm run -s security:scan
watch:
npm run watch
build:
npm run build
audit:
npm audit --ignore-scripts --no-fund --no-audit --no-update-notifier
lint:
npm run lint || true
fmt: