mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-16 22:05:20 +00:00
* build: migrate frontend tooling from yarn to pnpm The Dockerfiles ran `yarn && yarn build`, which broke on node:24 (yarn no longer on PATH; the corepack yarn shim made `npm i -g yarn` fail EEXIST), while CI + Makefile used npm and only a yarn.lock was committed — an inconsistent yarn/npm split. Standardize on pnpm, pinned via the packageManager field + corepack. - package.json: packageManager pnpm@11.6.0. - pnpm-workspace.yaml: nodeLinker: hoisted (flat node_modules, npm/yarn-like, so directly-imported transitive deps like flatpickr resolve) + allow vue-demi's postinstall (it selects the Vue 3 entry). pnpm 11 reads these here, not .npmrc. - Generate pnpm-lock.yaml (imported from yarn.lock); delete yarn.lock. - Dockerfiles (dev/nginx/production): node:24 + `corepack enable && pnpm install --frozen-lockfile && pnpm build`. - CI (check.yaml, docker.yaml): pnpm/action-setup + setup-node cache:pnpm; pnpm install --frozen-lockfile / pnpm build. - Makefile, composer.json dev script, CLAUDE.md: npm/yarn -> pnpm. pnpm build verified on a clean install (1425 modules, hoisted node_modules). * fix(build): pin vite to 8.0.3 to fix rolldown chunk regression vite 8.0.16 (pulled in by #653) bundles rolldown 1.0.3, which emits a lazy chunk referencing an undefined Vue runtime-init function (init_runtime_dom_esm_bundler), breaking the SPA at runtime. The build succeeds so CI never caught it. Pin vite to 8.0.3 (the version 2.3.3 shipped, rolldown 1.0.0) which produces a correct bundle.
75 lines
2.6 KiB
Makefile
75 lines
2.6 KiB
Makefile
.PHONY: dist-gen dist-clean dist clean test
|
|
|
|
composer:
|
|
rm -r vendor 2> /dev/null || true
|
|
composer install --prefer-dist --no-dev
|
|
|
|
npm-build:
|
|
rm -r public/build 2> /dev/null || true
|
|
rm -r node_modules 2> /dev/null || true
|
|
corepack enable
|
|
pnpm install --frozen-lockfile
|
|
pnpm build
|
|
|
|
dist-gen: clean composer npm-build
|
|
@echo "packaging..."
|
|
@mkdir InvoiceShelf
|
|
@mkdir InvoiceShelf/public
|
|
@cp -r app InvoiceShelf
|
|
@cp -r bootstrap InvoiceShelf
|
|
@cp -r config InvoiceShelf
|
|
@cp -r database InvoiceShelf
|
|
@cp -r public/build InvoiceShelf/public
|
|
@cp -r public/favicons InvoiceShelf/public
|
|
@cp -r public/.htaccess InvoiceShelf/public
|
|
@cp -r public/index.php InvoiceShelf/public
|
|
@cp -r public/robots.txt InvoiceShelf/public
|
|
@cp -r public/web.config InvoiceShelf/public
|
|
@cp -r resources InvoiceShelf
|
|
@cp -r lang InvoiceShelf
|
|
@cp -r routes InvoiceShelf
|
|
@cp -r storage InvoiceShelf
|
|
@cp -r vendor InvoiceShelf 2> /dev/null || true
|
|
@cp -r version.md InvoiceShelf
|
|
@cp -r .env.example InvoiceShelf
|
|
@cp -r artisan InvoiceShelf
|
|
@cp -r composer.json InvoiceShelf
|
|
@cp -r composer.lock InvoiceShelf
|
|
@cp -r LICENSE InvoiceShelf
|
|
@cp -r readme.md InvoiceShelf
|
|
@cp -r SECURITY.md InvoiceShelf
|
|
@cp -r server.php InvoiceShelf
|
|
@touch InvoiceShelf/storage/logs/laravel.log
|
|
|
|
dist-clean: dist-gen
|
|
find InvoiceShelf -wholename '*/[Tt]ests/*' -delete
|
|
find InvoiceShelf -wholename '*/[Tt]est/*' -delete
|
|
@rm -r InvoiceShelf/storage/framework/cache/data/* 2> /dev/null || true
|
|
@rm InvoiceShelf/storage/framework/sessions/* 2> /dev/null || true
|
|
@rm InvoiceShelf/storage/framework/views/* 2> /dev/null || true
|
|
@rm InvoiceShelf/storage/logs/* 2> /dev/null || true
|
|
|
|
dist: dist-clean
|
|
@zip -r InvoiceShelf.zip InvoiceShelf
|
|
|
|
clean:
|
|
@rm build/* 2> /dev/null || true
|
|
@rm -r InvoiceShelf 2> /dev/null || true
|
|
@rm -r public/build 2> /dev/null || true
|
|
@rm -r node_modules 2> /dev/null || true
|
|
@rm -r vendor 2> /dev/null || true
|
|
|
|
install: composer npm-build
|
|
php artisan migrate
|
|
|
|
test:
|
|
@if [ -x "vendor/bin/pest" ]; then \
|
|
./vendor/bin/pest --stop-on-failure; \
|
|
else \
|
|
echo ""; \
|
|
echo "Please install pest:"; \
|
|
echo ""; \
|
|
echo " composer install"; \
|
|
echo ""; \
|
|
fi
|