Repository navigation
chore(dev-deps): Replace npm-run-all2 with pnpm script selectors - #26319
Conversation
run-s becomes a `pnpm run` chain and run-p a pnpm regex selector, which runs the matching scripts of the current package concurrently and fails when one of them fails. Watch scripts pass --workspace-concurrency=Infinity: pnpm caps regex concurrency at the CPU count, so on a single core the second long-running watcher would never start. Build scripts keep the CPU-bound default. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
size-limit report 📦Compared: 6e76d15 (PR test merge using develop at 5808281) Against: 5808281 (develop) · base run #65971 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 56 successful. See the run.
Successful checks
|
# Conflicts: # package.json
into feat/remove-npm-run-all2 # Conflicts: # package.json # packages/astro/package.json # packages/aws-serverless/package.json # packages/browser-utils/package.json # packages/browser/package.json # packages/bun/package.json # packages/bundler-plugins/package.json # packages/cloudflare/package.json # packages/core/package.json # packages/effect/package.json # packages/elysia/package.json # packages/esbuild-plugin/package.json # packages/feedback/package.json # packages/gatsby/package.json # packages/google-cloud-serverless/package.json # packages/hono/package.json # packages/integration-shims/package.json # packages/nestjs/package.json # packages/nextjs/package.json # packages/nitro/package.json # packages/node-native/package.json # packages/node/package.json # packages/nuxt/package.json # packages/opentelemetry/package.json # packages/profiling-node/package.json # packages/react-router/package.json # packages/react/package.json # packages/remix/package.json # packages/replay-canvas/package.json # packages/replay-internal/package.json # packages/replay-worker/package.json # packages/rollup-plugin/package.json # packages/server-runtime-injection/package.json # packages/server-utils/package.json # packages/solid/package.json # packages/solidstart/package.json # packages/svelte/package.json # packages/sveltekit/package.json # packages/tanstackstart-react/package.json # packages/vercel-edge/package.json # packages/vite-plugin/package.json # packages/vue/package.json # packages/wasm/package.json # packages/webpack-plugin/package.json
vue-3 and vue-3-static never pass arguments to build, so the create-vue
{@} forwarding is dropped. The react-router-6 apps' start runs two servers
that never exit, so it lifts pnpm's CPU-count cap on parallel scripts.
Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
| }, | ||
| "scripts": { | ||
| "build": "run-p build:transpile build:types", | ||
| "build": "pnpm run \"/^build:(transpile|types)$/\"", |
There was a problem hiding this comment.
Does this maybe support single-quotes?
There was a problem hiding this comment.
It does on macOS/Linux, since scripts run through sh there. I kept double quotes for Windows, though: pnpm runs scripts through cmd.exe there, which doesn't treat single quotes as quotes. With '/^build:(transpile|types)$/' the | would become a pipe and the regex selector would break. Escaped double quotes work in both shells, and the repo already goes out of its way to stay cross-platform (e.g. scripts/rm.mjs instead of rm -rf), so I'd keep them.
Why: pnpm can already do what
npm-run-all2does, so it's one less dev dependency (~17 packages in its tree).run-s a bbecomespnpm run a && pnpm run b.run-p a bbecomes a regex selector (pnpm run "/^build:(transpile|types)$/"), which runs the matching scripts of the current package concurrently and exits non-zero (killing the rest) when one fails. The 4run-p/run-scalls that wrapped a single script are now plainpnpm run x. This also covers the four e2e test apps that depended on it (vue-3,vue-3-static,react-router-6,react-router-6-descendant-routes).Non-obvious choices:
--parallel. It makespnpm runrecursive, and in a package dir it ran the matching scripts of all 63 workspace projects.run-phad no cap. That's fine for builds, which use the CPU anyway. The react-router-6 apps'startruns two servers that never exit, so it passes--workspace-concurrency=Infinity; otherwise on one core the second server would never start.builddropped the create-vue{@}argument forwarding. Nothing passes arguments to it: every caller runs a plainpnpm build.Performance: same or slightly faster.
run-pstarts its own Node process plus apnpm runper script, while the regex selector runs everything from one pnpm process.via @mydea.
--
View Session [Sentry]