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:
@@ -61,8 +61,8 @@ jobs:
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: tools/release/package-lock.json
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: tools/release/yarn.lock
|
||||
|
||||
- name: Install Release Tooling Dependencies
|
||||
run: just release install
|
||||
|
||||
@@ -58,8 +58,8 @@ jobs:
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: tools/release/package-lock.json
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: tools/release/yarn.lock
|
||||
|
||||
- name: Install Release Tooling Dependencies
|
||||
run: just release install
|
||||
|
||||
@@ -119,8 +119,8 @@ jobs:
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: booklore-ui/package-lock.json
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: frontend/yarn.lock
|
||||
|
||||
- name: Install Frontend Dependencies
|
||||
run: just ui install-ci
|
||||
|
||||
@@ -50,3 +50,7 @@ booklore-api/src/main/resources/application-local.yaml
|
||||
/shared/
|
||||
|
||||
/scratch
|
||||
/.yarn/
|
||||
/frontend/.yarn/
|
||||
/tools/release/node_modules
|
||||
/tools/release/.yarn/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
nodeLinker: node-modules
|
||||
nmMode: hardlinks-local
|
||||
enableGlobalCache: false
|
||||
cacheFolder: .yarn/cache
|
||||
+1
-1
@@ -157,7 +157,7 @@ For full control over each component or IDE integration (debugging, hot-reload,
|
||||
| Tool | Version | Download |
|
||||
|---------------|---------|----------------------------------------------|
|
||||
| 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/) |
|
||||
| Git | latest | [git-scm.com](https://git-scm.com/) |
|
||||
|
||||
|
||||
+9
-5
@@ -2,13 +2,17 @@ FROM --platform=$BUILDPLATFORM node:24-alpine AS frontend-build
|
||||
|
||||
WORKDIR /workspace/frontend
|
||||
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci --no-audit --no-fund
|
||||
COPY .yarnrc.yml /workspace/.yarnrc.yml
|
||||
COPY frontend/package.json frontend/yarn.lock ./
|
||||
|
||||
RUN corepack enable
|
||||
RUN --mount=type=cache,target=/workspace/.yarn/cache \
|
||||
corepack yarn install --immutable
|
||||
|
||||
COPY frontend/ ./
|
||||
RUN --mount=type=cache,target=/workspace/frontend/.angular/cache \
|
||||
npm run build --configuration=production
|
||||
RUN --mount=type=cache,target=/workspace/.yarn/cache \
|
||||
--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
|
||||
|
||||
|
||||
@@ -88,5 +88,5 @@ doctor:
|
||||
@echo "just: $$(just --version)"
|
||||
@echo "java: $$(java -version 2>&1 | head -n 1)"
|
||||
@echo "node: $$(node --version)"
|
||||
@echo "npm: $$(npm --version)"
|
||||
@echo "yarn: $$(corepack yarn --version)"
|
||||
@echo "docker: $$(docker --version)"
|
||||
|
||||
Generated
-10959
File diff suppressed because it is too large
Load Diff
@@ -50,8 +50,8 @@ services:
|
||||
retries: 5
|
||||
|
||||
ui:
|
||||
image: node:22-alpine
|
||||
command: sh -c "cd /angular-app && npm install -g @angular/cli --force && npm install --force && ng serve --host 0.0.0.0"
|
||||
image: node:24-alpine
|
||||
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:
|
||||
- NODE_ENV=development
|
||||
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
|
||||
# - 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:
|
||||
- "${FRONTEND_PORT:-4200}:4200"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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.
|
||||
help:
|
||||
@@ -8,51 +8,51 @@ help:
|
||||
|
||||
# Install or update frontend dependencies for local development.
|
||||
install:
|
||||
{{ npm }} install
|
||||
{{ yarn }} install
|
||||
|
||||
# Install the frontend dependencies exactly as CI does.
|
||||
install-ci:
|
||||
{{ npm }} ci
|
||||
{{ yarn }} install --immutable
|
||||
|
||||
# Run the Angular development server.
|
||||
dev:
|
||||
{{ npm }} run dev
|
||||
{{ yarn }} dev
|
||||
|
||||
# Run the Angular development server with the default `start` script.
|
||||
start:
|
||||
{{ npm }} start
|
||||
{{ yarn }} start
|
||||
|
||||
# Build the production frontend bundle.
|
||||
build:
|
||||
{{ npm }} run build
|
||||
CI=1 NG_CLI_ANALYTICS=false {{ yarn }} build:prod
|
||||
|
||||
# Build the frontend continuously in development mode.
|
||||
watch:
|
||||
{{ npm }} run watch
|
||||
{{ yarn }} watch
|
||||
|
||||
# Run the frontend test suite.
|
||||
test:
|
||||
{{ npm }} test
|
||||
{{ yarn }} test
|
||||
|
||||
# Run the frontend tests with a coverage report.
|
||||
coverage:
|
||||
npx ng test --coverage
|
||||
{{ yarn }} ng test --coverage
|
||||
|
||||
# Run the frontend linter.
|
||||
lint:
|
||||
{{ npm }} run lint
|
||||
{{ yarn }} lint
|
||||
|
||||
# Check the installed dependency tree.
|
||||
deps:
|
||||
{{ npm }} ls --depth=0
|
||||
{{ yarn }} list --depth=0
|
||||
|
||||
# Run a local dependency audit without forcing a CI-specific severity threshold.
|
||||
audit:
|
||||
{{ npm }} audit
|
||||
{{ yarn }} npm audit
|
||||
|
||||
# Run the stricter dependency audit used in CI.
|
||||
audit-ci:
|
||||
{{ npm }} audit --audit-level=critical
|
||||
{{ yarn }} npm audit --severity critical
|
||||
|
||||
# Run the standard local frontend verification pass.
|
||||
check: deps lint test
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
"name": "grimmory",
|
||||
"version": "0.0.0",
|
||||
"packageManager": "yarn@4.10.3",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"build:prod": "ng build --configuration production",
|
||||
"dev": "ng serve --open --watch --configuration development",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
@@ -52,6 +54,8 @@
|
||||
"devDependencies": {
|
||||
"@analogjs/vite-plugin-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/cli": "^21.2.0",
|
||||
"@angular/compiler-cli": "^21.2.4",
|
||||
+8201
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,20 @@
|
||||
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.
|
||||
help:
|
||||
@just --list
|
||||
|
||||
# Install the pinned semantic-release tooling used by local and CI release tasks.
|
||||
install:
|
||||
npm ci
|
||||
{{ yarn }} install --immutable
|
||||
|
||||
# Preview the next semantic-release result for the current checkout.
|
||||
preview:
|
||||
npx semantic-release --dry-run --extends ./release.config.cjs
|
||||
{{ yarn }} release:dry-run
|
||||
|
||||
# Run semantic-release for the current checkout.
|
||||
run:
|
||||
npx semantic-release --extends ./release.config.cjs
|
||||
{{ yarn }} release
|
||||
|
||||
Generated
-6199
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
"name": "grimmory-release-tooling",
|
||||
"private": true,
|
||||
"description": "Release automation tooling for Grimmory",
|
||||
"packageManager": "yarn@4.10.3",
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user