chore(tooling): modernize Next verification setup
This commit is contained in:
9
eslint.config.mjs
Normal file
9
eslint.config.mjs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||||
|
import nextVitals from 'eslint-config-next/core-web-vitals';
|
||||||
|
import nextTypeScript from 'eslint-config-next/typescript';
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
...nextVitals,
|
||||||
|
...nextTypeScript,
|
||||||
|
globalIgnores(['.next/**', 'out/**', 'node_modules/**', 'next-env.d.ts']),
|
||||||
|
]);
|
||||||
3
next-env.d.ts
vendored
3
next-env.d.ts
vendored
@@ -1,6 +1,7 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
/// <reference path="./.next/types/routes.d.ts" />
|
import "./.next/dev/types/routes.d.ts";
|
||||||
|
import "./.next/dev/types/root-params.d.ts";
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
5362
package-lock.json
generated
5362
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@@ -6,11 +6,13 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "eslint . --max-warnings=0",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"test": "node --test tests/*.test.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^1.16.0",
|
"lucide-react": "^1.16.0",
|
||||||
"next": "^15.1.7",
|
"next": "^16.3.4",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"three": "^0.180.0"
|
"three": "^0.180.0"
|
||||||
@@ -20,9 +22,8 @@
|
|||||||
"@types/react": "^19.0.10",
|
"@types/react": "^19.0.10",
|
||||||
"@types/react-dom": "^19.0.4",
|
"@types/react-dom": "^19.0.4",
|
||||||
"@types/three": "^0.180.0",
|
"@types/three": "^0.180.0",
|
||||||
|
"eslint": "^9.39.5",
|
||||||
|
"eslint-config-next": "^16.3.4",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.7.3"
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@next/swc-win32-x64-msvc": "^16.3.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
tests/static-export.test.mjs
Normal file
26
tests/static-export.test.mjs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { access, readFile } from 'node:fs/promises';
|
||||||
|
import path from 'node:path';
|
||||||
|
import test from 'node:test';
|
||||||
|
|
||||||
|
const exportRoot = path.resolve('out');
|
||||||
|
|
||||||
|
test('the production build exports a usable home page', async () => {
|
||||||
|
const indexPath = path.join(exportRoot, 'index.html');
|
||||||
|
const html = await readFile(indexPath, 'utf8');
|
||||||
|
|
||||||
|
assert.match(html, /<!DOCTYPE html>/i);
|
||||||
|
assert.match(html, /<html[^>]*lang=/i);
|
||||||
|
|
||||||
|
const assetPaths = [
|
||||||
|
...html.matchAll(/(?:src|href)="(\/_next\/static\/[^"?#]+)/g),
|
||||||
|
].map((match) => match[1]);
|
||||||
|
|
||||||
|
assert.ok(assetPaths.length > 0, 'expected the home page to reference built assets');
|
||||||
|
|
||||||
|
await Promise.all(
|
||||||
|
[...new Set(assetPaths)].map((assetPath) =>
|
||||||
|
access(path.join(exportRoot, assetPath.replace(/^\//, ''))),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@@ -11,7 +15,7 @@
|
|||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "preserve",
|
"jsx": "react-jsx",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
@@ -19,9 +23,19 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
"include": [
|
||||||
"exclude": ["node_modules"]
|
"next-env.d.ts",
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
".next/types/**/*.ts",
|
||||||
|
".next/dev/types/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user