mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-16 13:55:21 +00:00
build: migrate frontend tooling to pnpm (v3) (#678)
* build: migrate frontend tooling to pnpm (v3) Rebuilds the stale #673 on current 3.x so it doesn't revert #657's test split, the Node-24 action bumps, or composer-install@4.0.0. - package.json: packageManager pnpm@11.6.0; drop dead 'resolutions' - pnpm-workspace.yaml: nodeLinker hoisted, allowBuilds vue-demi, overrides brace-expansion (replaces resolutions) - pnpm-lock.yaml generated via 'pnpm import' from yarn.lock (keeps the resolved versions, incl. vite 8.0.3 / rolldown rc.12); yarn.lock removed - docker.yaml + release.yaml: pnpm/action-setup@v6 + cache pnpm + pnpm install/build (action versions and the #657 split left intact; check.yaml needs no change — its test job is PHP-only after #657) - 3 Dockerfiles: node:24 + corepack + pnpm install --frozen-lockfile && pnpm build - Makefile, composer 'dev' script, CLAUDE.md, .gitignore -> pnpm * fix(deps): pin vite to 8.0.5 (security) Now that 3.x is the default branch, Dependabot flags vite <8.0.5. Pin to 8.0.5 (the patched version), which keeps rolldown 1.0.0-rc.12 — still below 8.0.15 where the broken rolldown 1.0.3 (the init_runtime_dom_esm_bundler chunk regression) starts, so the build stays clean. Mirrors v2's #674.
This commit is contained in:
committed by
GitHub
parent
4ab62b98c6
commit
e48212b18a
8
.github/workflows/docker.yaml
vendored
8
.github/workflows/docker.yaml
vendored
@@ -92,16 +92,20 @@ jobs:
|
||||
with:
|
||||
composer-options: --no-dev
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Use Node.js 24
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install
|
||||
run: npm install
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Compile Front-end
|
||||
run: npm run build
|
||||
run: pnpm build
|
||||
|
||||
- name: Build Dist
|
||||
run: |
|
||||
|
||||
8
.github/workflows/release.yaml
vendored
8
.github/workflows/release.yaml
vendored
@@ -31,16 +31,20 @@ jobs:
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-dev --optimize-autoloader --no-interaction
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Use Node.js 24
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build frontend
|
||||
run: npm run build
|
||||
run: pnpm build
|
||||
|
||||
- name: Prepare release directory
|
||||
run: |
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,6 +24,7 @@ Homestead.yaml
|
||||
.devenvconfig
|
||||
/storage/fonts*
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
/docker/development/docker-compose.yml
|
||||
/docker/production/docker-compose.yml
|
||||
/docker-compose.yaml
|
||||
|
||||
10
CLAUDE.md
10
CLAUDE.md
@@ -11,8 +11,8 @@ InvoiceShelf is an open-source invoicing and expense tracking application built
|
||||
### Development
|
||||
```bash
|
||||
composer run dev # Starts PHP server, queue listener, log tail, and Vite dev server concurrently
|
||||
npm run dev # Vite dev server only
|
||||
npm run build # Production frontend build
|
||||
pnpm dev # Vite dev server only
|
||||
pnpm build # Production frontend build
|
||||
```
|
||||
|
||||
### Testing
|
||||
@@ -30,7 +30,7 @@ Tests use SQLite in-memory DB, configured in `phpunit.xml`. Tests seed via `Data
|
||||
vendor/bin/pint --dirty --format agent # Fix style on modified PHP files
|
||||
vendor/bin/pint --test # Check style without fixing (CI uses this)
|
||||
composer lint # = pint --test ; composer lint:fix = pint
|
||||
npm run lint # eslint (--max-warnings 0) ; npm run lint:fix = eslint --fix
|
||||
pnpm lint # eslint (--max-warnings 0) ; pnpm lint:fix = eslint --fix
|
||||
```
|
||||
|
||||
### Code Quality Gate (pre-commit hook)
|
||||
@@ -38,7 +38,7 @@ A committed Git hook (`.githooks/pre-commit`) runs **Pint** on staged `.php` and
|
||||
`resources/scripts/**` `.{js,cjs,mjs,ts,vue}` files, and **blocks the commit on any failure** (ESLint runs
|
||||
with `--max-warnings 0`). It lints **staged files only**, and soft-skips if PHP/Pint or `node_modules` is
|
||||
unavailable (CI is the backstop). The hook is enabled via `core.hooksPath`, set automatically by the
|
||||
`prepare` script on `npm install`/`yarn install`; to enable it manually run:
|
||||
`prepare` script on `pnpm install`; to enable it manually run:
|
||||
```bash
|
||||
git config core.hooksPath .githooks
|
||||
```
|
||||
@@ -136,7 +136,7 @@ InvoiceShelf follows TDD development style:
|
||||
- Use `config()` helper, never `env()` outside config files
|
||||
- Every change must have tests
|
||||
- Run `vendor/bin/pint --dirty --format agent` after modifying PHP files
|
||||
- After editing `lang/en.json` or any file under `resources/scripts/`, rebuild via `npm run build` — the bundled chunks (including locale chunks) are content-hashed by Vite, so the browser will pick them up on hard refresh
|
||||
- After editing `lang/en.json` or any file under `resources/scripts/`, rebuild via `pnpm build` — the bundled chunks (including locale chunks) are content-hashed by Vite, so the browser will pick them up on hard refresh
|
||||
|
||||
## CI Pipeline
|
||||
|
||||
|
||||
5
Makefile
5
Makefile
@@ -7,8 +7,9 @@ composer:
|
||||
npm-build:
|
||||
rm -r public/build 2> /dev/null || true
|
||||
rm -r node_modules 2> /dev/null || true
|
||||
npm install
|
||||
npm run build
|
||||
corepack enable
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build
|
||||
|
||||
dist-gen: clean composer npm-build
|
||||
@echo "packaging..."
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"pnpm dev\" --names=server,queue,logs,vite"
|
||||
],
|
||||
"ide-helper": [
|
||||
"@php artisan ide-helper:generate",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM --platform=$BUILDPLATFORM node:24 AS static_builder
|
||||
WORKDIR /var/www/html
|
||||
COPY . /var/www/html
|
||||
RUN yarn && yarn build
|
||||
RUN corepack enable && pnpm install --frozen-lockfile && pnpm build
|
||||
|
||||
FROM serversideup/php:8.4-fpm-alpine AS base
|
||||
USER root
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM --platform=$BUILDPLATFORM node AS static_builder
|
||||
FROM --platform=$BUILDPLATFORM node:24 AS static_builder
|
||||
WORKDIR /var/www/html
|
||||
COPY . /var/www/html
|
||||
RUN yarn && yarn build
|
||||
RUN corepack enable && pnpm install --frozen-lockfile && pnpm build
|
||||
|
||||
FROM nginx AS production
|
||||
ENV PHP_FPM_HOST="php-fpm:9000"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM --platform=$BUILDPLATFORM node:24 AS static_builder
|
||||
WORKDIR /var/www/html
|
||||
COPY . /var/www/html
|
||||
RUN yarn && yarn build
|
||||
RUN corepack enable && pnpm install --frozen-lockfile && pnpm build
|
||||
|
||||
FROM serversideup/php:8.4-fpm-nginx-alpine AS base
|
||||
USER root
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"packageManager": "pnpm@11.6.0",
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
},
|
||||
@@ -32,9 +33,6 @@
|
||||
"vue-eslint-parser": "^10.0.0",
|
||||
"vue-tsc": "^3.2.6"
|
||||
},
|
||||
"resolutions": {
|
||||
"brace-expansion": "^5.0.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@headlessui/vue": "^1.7.23",
|
||||
"@heroicons/vue": "^2.2.0",
|
||||
@@ -57,7 +55,7 @@
|
||||
"pinia": "^3.0.0",
|
||||
"v-money3": "^3.24.1",
|
||||
"v-tooltip": "^4.0.0-beta.17",
|
||||
"vite": "^8.0.0",
|
||||
"vite": "8.0.5",
|
||||
"vue": "^3.5",
|
||||
"vue-flatpickr-component": "^12.0.0",
|
||||
"vue-i18n": "^11.0.1",
|
||||
|
||||
3398
pnpm-lock.yaml
generated
Normal file
3398
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
13
pnpm-workspace.yaml
Normal file
13
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# Flat, hoisted node_modules (npm/yarn-like) so the migration is a drop-in and
|
||||
# transitive packages imported directly (e.g. flatpickr via vue-flatpickr-component)
|
||||
# keep resolving. pnpm 11 reads these here, not from .npmrc.
|
||||
nodeLinker: hoisted
|
||||
|
||||
# Build-script allow-listing (replaces package.json "pnpm.onlyBuiltDependencies").
|
||||
# vue-demi needs its postinstall to select the Vue 3 entry; it is a trusted Vue-core shim.
|
||||
allowBuilds:
|
||||
vue-demi: true
|
||||
|
||||
# Replaces the dead package.json "resolutions" field (npm/pnpm read "overrides").
|
||||
overrides:
|
||||
brace-expansion: ^5.0.6
|
||||
Reference in New Issue
Block a user