chore: align Node 26.7.0 toolchain
This commit is contained in:
1 parent
f94246e067
commit
6ed1b03e24
7 files changed
+57
-7
No files matched your search
@@ -36,6 +36,8 @@ jobs:
|
|||||||
git fetch --depth 50 origin "${REF}"
|
git fetch --depth 50 origin "${REF}"
|
||||||
git checkout -f "${REF}"
|
git checkout -f "${REF}"
|
||||||
|
|
||||||
|
node scripts/check-node-toolchain.mjs
|
||||||
|
|
||||||
export SKIP_ENV_VALIDATION=1
|
export SKIP_ENV_VALIDATION=1
|
||||||
export NODE_ENV=test
|
export NODE_ENV=test
|
||||||
export DATABASE_URL="mysql://test:test@localhost:3306/test?charset=utf8mb4"
|
export DATABASE_URL="mysql://test:test@localhost:3306/test?charset=utf8mb4"
|
||||||
@@ -130,6 +132,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${STAGE}"
|
cd "${STAGE}"
|
||||||
|
node scripts/check-node-toolchain.mjs
|
||||||
rm -f tsconfig.tsbuildinfo .tsbuildinfo
|
rm -f tsconfig.tsbuildinfo .tsbuildinfo
|
||||||
find . -maxdepth 3 -name '*.tsbuildinfo' -delete 2>/dev/null || true
|
find . -maxdepth 3 -name '*.tsbuildinfo' -delete 2>/dev/null || true
|
||||||
rm -rf .output dist .next .next/types .next/dev .next/cache
|
rm -rf .output dist .next .next/types .next/dev .next/cache
|
||||||
@@ -291,6 +294,7 @@ jobs:
|
|||||||
"${WORK}"
|
"${WORK}"
|
||||||
cd "${WORK}"
|
cd "${WORK}"
|
||||||
git checkout "${VERSION}"
|
git checkout "${VERSION}"
|
||||||
|
node scripts/check-node-toolchain.mjs
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
export SKIP_ENV_VALIDATION=1
|
export SKIP_ENV_VALIDATION=1
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
@@ -369,7 +373,7 @@ jobs:
|
|||||||
echo ""
|
echo ""
|
||||||
echo "| Component | Version | Notes |"
|
echo "| Component | Version | Notes |"
|
||||||
echo "| --------- | ------- | ----- |"
|
echo "| --------- | ------- | ----- |"
|
||||||
echo "| Node.js | >= 22 | Required by Next.js 16 |"
|
echo "| Node.js | 26.7.0 | Current release pinned in .nvmrc |"
|
||||||
echo "| pnpm | >= 10.33.4 | Package manager (npm/yarn not supported) |"
|
echo "| pnpm | >= 10.33.4 | Package manager (npm/yarn not supported) |"
|
||||||
echo "| MySQL / MariaDB | 8.0+ / 10.6+ | Shared with the emulator |"
|
echo "| MySQL / MariaDB | 8.0+ / 10.6+ | Shared with the emulator |"
|
||||||
echo "| Redis | 7.x+ | Optional — caching, rate limiting, SSE |"
|
echo "| Redis | 7.x+ | Optional — caching, rate limiting, SSE |"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Features a premium animated homepage (typewriter hero, floating orbs, scroll cou
|
|||||||
|
|
||||||
| Component | Version | Notes |
|
| Component | Version | Notes |
|
||||||
| --------------- | -------------- | ---------------------------------------- |
|
| --------------- | -------------- | ---------------------------------------- |
|
||||||
| Node.js | >= 22 | Required by Next.js 16 |
|
| Node.js | 26.7.0 | Current release pinned in `.nvmrc` |
|
||||||
| pnpm | >= 10.33.4 | Package manager (npm/yarn not supported) |
|
| pnpm | >= 10.33.4 | Package manager (npm/yarn not supported) |
|
||||||
| MySQL / MariaDB | 8.0+ / 10.6+ | Shared with the emulator |
|
| MySQL / MariaDB | 8.0+ / 10.6+ | Shared with the emulator |
|
||||||
| DragonflyDB | 1.x+ | Optional — caching, rate limiting, SSE (Redis-protocol compatible) |
|
| DragonflyDB | 1.x+ | Optional — caching, rate limiting, SSE (Redis-protocol compatible) |
|
||||||
|
|||||||
+3
-2
@@ -3,19 +3,20 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=26"
|
"node": ">=26.7.0 <27"
|
||||||
},
|
},
|
||||||
"packageManager": "[email protected]",
|
"packageManager": "[email protected]",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
|
"toolchain:check": "node scripts/check-node-toolchain.mjs",
|
||||||
"lint": "biome check .",
|
"lint": "biome check .",
|
||||||
"biome:lint": "biome check .",
|
"biome:lint": "biome check .",
|
||||||
"format": "biome format --write .",
|
"format": "biome format --write .",
|
||||||
"knip": "knip --include files,dependencies,devDependencies,unlisted,binaries",
|
"knip": "knip --include files,dependencies,devDependencies,unlisted,binaries",
|
||||||
"jobs:worker": "tsx scripts/jobs-worker.ts",
|
"jobs:worker": "tsx scripts/jobs-worker.ts",
|
||||||
"test": "DATABASE_URL=mysql://root:root@localhost:3306/test vitest run",
|
"test": "vitest run",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"db:generate": "drizzle-kit generate",
|
"db:generate": "drizzle-kit generate",
|
||||||
"db:migrate": "tsx scripts/apply-migrations.ts",
|
"db:migrate": "tsx scripts/apply-migrations.ts",
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { dirname, resolve } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const readProjectFile = (path) =>
|
||||||
|
readFileSync(resolve(projectRoot, path), "utf8");
|
||||||
|
|
||||||
|
const pinnedVersion = readProjectFile(".nvmrc").trim();
|
||||||
|
assert.match(
|
||||||
|
pinnedVersion,
|
||||||
|
/^\d+\.\d+\.\d+$/,
|
||||||
|
".nvmrc must pin an exact Node.js version",
|
||||||
|
);
|
||||||
|
|
||||||
|
const major = Number.parseInt(pinnedVersion.split(".")[0], 10);
|
||||||
|
const packageJson = JSON.parse(readProjectFile("package.json"));
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
packageJson.engines?.node,
|
||||||
|
`>=${pinnedVersion} <${major + 1}`,
|
||||||
|
"package.json engines.node must match the .nvmrc release line",
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
Number.parseInt(packageJson.devDependencies?.["@types/node"], 10),
|
||||||
|
major,
|
||||||
|
"@types/node must match the pinned Node.js major",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!process.argv.includes("--static")) {
|
||||||
|
assert.equal(
|
||||||
|
process.versions.node,
|
||||||
|
pinnedVersion,
|
||||||
|
"the active Node.js runtime must match .nvmrc",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Node.js toolchain is aligned on ${pinnedVersion}`);
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { join } from "node:path";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
const fsMock = vi.hoisted(() => ({
|
const fsMock = vi.hoisted(() => ({
|
||||||
@@ -29,7 +30,9 @@ describe("getSoundtrackPath", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("joins the safe code into the soundtrack dir", () => {
|
it("joins the safe code into the soundtrack dir", () => {
|
||||||
expect(getSoundtrackPath("song").endsWith("mp3/song.mp3")).toBe(true);
|
expect(getSoundtrackPath("song").endsWith(join("mp3", "song.mp3"))).toBe(
|
||||||
|
true,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -17,7 +17,10 @@ export default defineConfig({
|
|||||||
environment: "node",
|
environment: "node",
|
||||||
// Modules under test transitively import @/env; skip its strict parse so
|
// Modules under test transitively import @/env; skip its strict parse so
|
||||||
// unit tests run without a populated .env.
|
// unit tests run without a populated .env.
|
||||||
env: { SKIP_ENV_VALIDATION: "1" },
|
env: {
|
||||||
|
SKIP_ENV_VALIDATION: "1",
|
||||||
|
DATABASE_URL: "mysql://root:root@localhost:3306/test",
|
||||||
|
},
|
||||||
testTimeout: 10000,
|
testTimeout: 10000,
|
||||||
exclude: ["e2e/**", "node_modules/**", ".next/**", ".next.prev/**"],
|
exclude: ["e2e/**", "node_modules/**", ".next/**", ".next.prev/**"],
|
||||||
coverage: {
|
coverage: {
|
||||||
|
|||||||
Reference in new issue
Block a user