fix: update build and test scripts to set Rayon and Tokio worker threads

This commit is contained in:
spaghet committed 2026-11-13 01:43:07 -05:00
1 parent fb8e42f632
commit d7b8a351c1
3 files changed
+14 -5

No files matched your search

+3 -3
View File
@@ -6,12 +6,12 @@
"dev": "dotenv -e .env -- astro dev", "dev": "dotenv -e .env -- astro dev",
"dev:network": "dotenv -e .env -- astro dev --host", "dev:network": "dotenv -e .env -- astro dev --host",
"start": "dotenv -e .env -- astro dev", "start": "dotenv -e .env -- astro dev",
"build": "astro check && astro build", "build": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; astro check && astro build",
"preview": "dotenv -e .env -- astro preview", "preview": "dotenv -e .env -- astro preview",
"preview:network": "dotenv -e .env -- astro dev --host", "preview:network": "dotenv -e .env -- astro dev --host",
"astro": "astro", "astro": "astro",
"test": "vitest run", "test": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest run",
"test:watch": "vitest", "test:watch": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix" "lint:fix": "eslint . --fix"
}, },
+2 -2
View File
@@ -102,7 +102,7 @@ export default function FilteredList({ entries, collection, initial }: Props) {
)} )}
</div> </div>
<label class="block text-xs uppercase mb-1 text-ink-muted" htmlFor="filter-q"> <label class="block text-xs uppercase mb-1 text-ink-muted" for="filter-q">
Keyword Keyword
</label> </label>
<input <input
@@ -116,7 +116,7 @@ export default function FilteredList({ entries, collection, initial }: Props) {
class="w-full px-2.5 py-1.5 rounded outline-none text-ink bg-chip border border-edge focus:border-edge transition-colors duration-300 ease-in-out" class="w-full px-2.5 py-1.5 rounded outline-none text-ink bg-chip border border-edge focus:border-edge transition-colors duration-300 ease-in-out"
/> />
<label class="block text-xs uppercase mt-3 mb-1 text-ink-muted" htmlFor="filter-sort"> <label class="block text-xs uppercase mt-3 mb-1 text-ink-muted" for="filter-sort">
Sort Sort
</label> </label>
<select <select
+9
View File
@@ -23,5 +23,14 @@ export default defineConfig({
test: { test: {
environment: "node", environment: "node",
include: ["src/**/__tests__/**/*.test.ts", "src/**/*.test.ts"], include: ["src/**/__tests__/**/*.test.ts", "src/**/*.test.ts"],
// Rolldown (Vite 8's bundler, loaded when Vitest reads this config) sizes
// its native thread pool to `nproc`. On hosts that report many CPUs but
// cannot actually spawn that many threads, the default `forks` pool aborts
// with "spawn node EAGAIN". The `threads` pool with a single worker avoids
// forking one child process per file; the matching RAYON/TOKIO caps live in
// the package.json scripts.
pool: "threads",
maxWorkers: 1,
fileParallelism: false,
}, },
}) })