build(yarn): migrate frontend and release tooling to yarn 4

- Frontend package management:
  - add a repo-root `.yarnrc.yml` that pins Yarn to the `node-modules` linker with a local cache
  - add the modern Yarn package manager declaration to `frontend/package.json`
  - replace the frontend npm lockfile with `frontend/yarn.lock`
  - move the frontend Just recipes to Corepack-managed Yarn commands for install, audit, build, test, and lint
  - run the production build in CI-style mode so non-interactive Yarn builds behave consistently
- Release automation:
  - add the modern Yarn package manager declaration to `tools/release/package.json`
  - replace the release tooling npm lockfile with `tools/release/yarn.lock`
  - switch the release Just recipes from `npm` and `npx` to Corepack-managed Yarn scripts
- CI and local runtime wiring:
  - switch the frontend and release GitHub Actions caches from npm lockfiles to Yarn lockfiles
  - update the root `doctor` output and contributor prerequisites to report Yarn and Corepack instead of npm
  - update the dev compose UI container to Node 24 with immutable Yarn installs
  - restore the Docker frontend build stage to install and build through Yarn, including the shared cache path
- Repository hygiene:
  - ignore the repo-local Yarn cache and per-project Yarn state directories created by modern Yarn installs

- Validation:
  - `just ui install-ci`
  - `just release install`
  - `just ui build`
  - `just image-build linux/amd64 codex-yarn-port-test` was not runnable because the local Docker daemon was unavailable
This commit is contained in:
James Cox
2026-04-22 17:26:40 -04:00
committed by Zach Yale
parent 42d9dcb4d3
commit 4855f36d46
17 changed files with 12310 additions and 17193 deletions
+2 -2
View File
@@ -61,8 +61,8 @@ jobs:
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with: with:
node-version: '24' node-version: '24'
cache: 'npm' cache: 'yarn'
cache-dependency-path: tools/release/package-lock.json cache-dependency-path: tools/release/yarn.lock
- name: Install Release Tooling Dependencies - name: Install Release Tooling Dependencies
run: just release install run: just release install
+2 -2
View File
@@ -58,8 +58,8 @@ jobs:
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with: with:
node-version: '24' node-version: '24'
cache: 'npm' cache: 'yarn'
cache-dependency-path: tools/release/package-lock.json cache-dependency-path: tools/release/yarn.lock
- name: Install Release Tooling Dependencies - name: Install Release Tooling Dependencies
run: just release install run: just release install
+2 -2
View File
@@ -119,8 +119,8 @@ jobs:
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with: with:
node-version: '24' node-version: '24'
cache: 'npm' cache: 'yarn'
cache-dependency-path: booklore-ui/package-lock.json cache-dependency-path: frontend/yarn.lock
- name: Install Frontend Dependencies - name: Install Frontend Dependencies
run: just ui install-ci run: just ui install-ci
+4
View File
@@ -50,3 +50,7 @@ booklore-api/src/main/resources/application-local.yaml
/shared/ /shared/
/scratch /scratch
/.yarn/
/frontend/.yarn/
/tools/release/node_modules
/tools/release/.yarn/
+4
View File
@@ -0,0 +1,4 @@
nodeLinker: node-modules
nmMode: hardlinks-local
enableGlobalCache: false
cacheFolder: .yarn/cache
+1 -1
View File
@@ -157,7 +157,7 @@ For full control over each component or IDE integration (debugging, hot-reload,
| Tool | Version | Download | | Tool | Version | Download |
|---------------|---------|----------------------------------------------| |---------------|---------|----------------------------------------------|
| Java | 25+ | [Adoptium](https://adoptium.net/) | | Java | 25+ | [Adoptium](https://adoptium.net/) |
| Node.js + npm | 20+ | [nodejs.org](https://nodejs.org/) | | Node.js + Corepack/Yarn | 24+ | [nodejs.org](https://nodejs.org/) |
| MariaDB | 10.6+ | [mariadb.org](https://mariadb.org/download/) | | MariaDB | 10.6+ | [mariadb.org](https://mariadb.org/download/) |
| Git | latest | [git-scm.com](https://git-scm.com/) | | Git | latest | [git-scm.com](https://git-scm.com/) |
+9 -5
View File
@@ -2,13 +2,17 @@ FROM --platform=$BUILDPLATFORM node:24-alpine AS frontend-build
WORKDIR /workspace/frontend WORKDIR /workspace/frontend
COPY frontend/package.json frontend/package-lock.json ./ COPY .yarnrc.yml /workspace/.yarnrc.yml
RUN --mount=type=cache,target=/root/.npm \ COPY frontend/package.json frontend/yarn.lock ./
npm ci --no-audit --no-fund
RUN corepack enable
RUN --mount=type=cache,target=/workspace/.yarn/cache \
corepack yarn install --immutable
COPY frontend/ ./ COPY frontend/ ./
RUN --mount=type=cache,target=/workspace/frontend/.angular/cache \ RUN --mount=type=cache,target=/workspace/.yarn/cache \
npm run build --configuration=production --mount=type=cache,target=/workspace/frontend/.angular/cache \
CI=1 NG_CLI_ANALYTICS=false corepack yarn build:prod
FROM --platform=$BUILDPLATFORM gradle:9.3.1-jdk25-alpine AS backend-build FROM --platform=$BUILDPLATFORM gradle:9.3.1-jdk25-alpine AS backend-build
+1 -1
View File
@@ -88,5 +88,5 @@ doctor:
@echo "just: $$(just --version)" @echo "just: $$(just --version)"
@echo "java: $$(java -version 2>&1 | head -n 1)" @echo "java: $$(java -version 2>&1 | head -n 1)"
@echo "node: $$(node --version)" @echo "node: $$(node --version)"
@echo "npm: $$(npm --version)" @echo "yarn: $$(corepack yarn --version)"
@echo "docker: $$(docker --version)" @echo "docker: $$(docker --version)"
-10959
View File
File diff suppressed because it is too large Load Diff
+2 -6
View File
@@ -50,8 +50,8 @@ services:
retries: 5 retries: 5
ui: ui:
image: node:22-alpine image: node:24-alpine
command: sh -c "cd /angular-app && npm install -g @angular/cli --force && npm install --force && ng serve --host 0.0.0.0" command: sh -c "cd /angular-app && corepack enable && corepack yarn install --immutable && corepack yarn ng serve --host 0.0.0.0 --watch --configuration development"
environment: environment:
- NODE_ENV=development - NODE_ENV=development
stdin_open: true stdin_open: true
@@ -63,10 +63,6 @@ services:
# you can have node_modules in a volume. however, if you enable this, expect trouble in some IDEs, as the deps are not available anymore # you can have node_modules in a volume. however, if you enable this, expect trouble in some IDEs, as the deps are not available anymore
# - node_modules:/angular-app/node_modules # - node_modules:/angular-app/node_modules
# we ignore package-lock otherwise will throw
# An unhandled exception occurred: Cannot find module @rollup/rollup-linux-x64-musl. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828).
# Please try `npm i` again after removing both package-lock.json and node_modules directory.
- '/dev/null:/angular-app/package-lock.json'
ports: ports:
- "${FRONTEND_PORT:-4200}:4200" - "${FRONTEND_PORT:-4200}:4200"
+13 -13
View File
@@ -1,6 +1,6 @@
set shell := ["bash", "-eu", "-o", "pipefail", "-c"] set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
npm := "npm" yarn := "env YARN_ENABLE_GLOBAL_CACHE=0 YARN_CACHE_FOLDER=../.yarn/cache corepack yarn"
# Show the frontend recipes available in this directory. # Show the frontend recipes available in this directory.
help: help:
@@ -8,51 +8,51 @@ help:
# Install or update frontend dependencies for local development. # Install or update frontend dependencies for local development.
install: install:
{{ npm }} install {{ yarn }} install
# Install the frontend dependencies exactly as CI does. # Install the frontend dependencies exactly as CI does.
install-ci: install-ci:
{{ npm }} ci {{ yarn }} install --immutable
# Run the Angular development server. # Run the Angular development server.
dev: dev:
{{ npm }} run dev {{ yarn }} dev
# Run the Angular development server with the default `start` script. # Run the Angular development server with the default `start` script.
start: start:
{{ npm }} start {{ yarn }} start
# Build the production frontend bundle. # Build the production frontend bundle.
build: build:
{{ npm }} run build CI=1 NG_CLI_ANALYTICS=false {{ yarn }} build:prod
# Build the frontend continuously in development mode. # Build the frontend continuously in development mode.
watch: watch:
{{ npm }} run watch {{ yarn }} watch
# Run the frontend test suite. # Run the frontend test suite.
test: test:
{{ npm }} test {{ yarn }} test
# Run the frontend tests with a coverage report. # Run the frontend tests with a coverage report.
coverage: coverage:
npx ng test --coverage {{ yarn }} ng test --coverage
# Run the frontend linter. # Run the frontend linter.
lint: lint:
{{ npm }} run lint {{ yarn }} lint
# Check the installed dependency tree. # Check the installed dependency tree.
deps: deps:
{{ npm }} ls --depth=0 {{ yarn }} list --depth=0
# Run a local dependency audit without forcing a CI-specific severity threshold. # Run a local dependency audit without forcing a CI-specific severity threshold.
audit: audit:
{{ npm }} audit {{ yarn }} npm audit
# Run the stricter dependency audit used in CI. # Run the stricter dependency audit used in CI.
audit-ci: audit-ci:
{{ npm }} audit --audit-level=critical {{ yarn }} npm audit --severity critical
# Run the standard local frontend verification pass. # Run the standard local frontend verification pass.
check: deps lint test check: deps lint test
@@ -1,10 +1,12 @@
{ {
"name": "grimmory", "name": "grimmory",
"version": "0.0.0", "version": "0.0.0",
"packageManager": "yarn@4.10.3",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"build:prod": "ng build --configuration production",
"dev": "ng serve --open --watch --configuration development", "dev": "ng serve --open --watch --configuration development",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test", "test": "ng test",
@@ -52,6 +54,8 @@
"devDependencies": { "devDependencies": {
"@analogjs/vite-plugin-angular": "^2.3.0", "@analogjs/vite-plugin-angular": "^2.3.0",
"@analogjs/vitest-angular": "^2.3.0", "@analogjs/vitest-angular": "^2.3.0",
"@angular-devkit/architect": "0.2102.0",
"@angular-devkit/schematics": "21.2.0",
"@angular/build": "^21.2.0", "@angular/build": "^21.2.0",
"@angular/cli": "^21.2.0", "@angular/cli": "^21.2.0",
"@angular/compiler-cli": "^21.2.4", "@angular/compiler-cli": "^21.2.4",
+8201
View File
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -1,17 +1,20 @@
set shell := ["bash", "-eu", "-o", "pipefail", "-c"] set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
# Use Corepack to ensure the pinned modern Yarn version is installed.
yarn := "env YARN_ENABLE_GLOBAL_CACHE=0 YARN_CACHE_FOLDER=../../.yarn/cache corepack yarn"
# Show the release-tooling recipes available in this directory. # Show the release-tooling recipes available in this directory.
help: help:
@just --list @just --list
# Install the pinned semantic-release tooling used by local and CI release tasks. # Install the pinned semantic-release tooling used by local and CI release tasks.
install: install:
npm ci {{ yarn }} install --immutable
# Preview the next semantic-release result for the current checkout. # Preview the next semantic-release result for the current checkout.
preview: preview:
npx semantic-release --dry-run --extends ./release.config.cjs {{ yarn }} release:dry-run
# Run semantic-release for the current checkout. # Run semantic-release for the current checkout.
run: run:
npx semantic-release --extends ./release.config.cjs {{ yarn }} release
-6199
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -2,6 +2,7 @@
"name": "grimmory-release-tooling", "name": "grimmory-release-tooling",
"private": true, "private": true,
"description": "Release automation tooling for Grimmory", "description": "Release automation tooling for Grimmory",
"packageManager": "yarn@4.10.3",
"engines": { "engines": {
"node": ">=24" "node": ">=24"
}, },
File diff suppressed because it is too large Load Diff