build: consume form-graph from npm instead of the local link

Swaps the pnpm link: override for the published package (^0.3.0, currently
0.3.1) and removes the two accommodations the link needed: the turbopack.root
widening (Turbopack refused files outside the repo) and the tsconfig
react/react-dom paths pin (the linked checkout's own @types/react could
split the program).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
briant
2026-09-03 01:08:00 -06:00
parent cde95673f2
commit 8a39b7c876
4 changed files with 234 additions and 205 deletions
+1 -4
View File
@@ -3,7 +3,6 @@ import { withAxiom } from '@civitai/next-axiom';
import bundlAnalyzer from '@next/bundle-analyzer'; import bundlAnalyzer from '@next/bundle-analyzer';
import CircularDependencyPlugin from 'circular-dependency-plugin'; import CircularDependencyPlugin from 'circular-dependency-plugin';
import { createRequire } from 'module'; import { createRequire } from 'module';
import { fileURLToPath } from 'url';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
const packageJson = require('./package.json'); const packageJson = require('./package.json');
@@ -116,9 +115,7 @@ export default defineNextConfig(
// `serverExternalPackages` below, so Turbopack externalizes them and never // `serverExternalPackages` below, so Turbopack externalizes them and never
// emits those warnings — an empty config just acknowledges we're on Turbopack // emits those warnings — an empty config just acknowledges we're on Turbopack
// and silences Next's "webpack config with no turbopack config" build error. // and silences Next's "webpack config with no turbopack config" build error.
// root spans C:work so the pnpm link: to the local form-graph checkout is turbopack: {},
// inside Turbopack's readable tree (it refuses files outside the root)
turbopack: { root: fileURLToPath(new URL('../..', import.meta.url)) },
// Per-branch build dir. Turbopack's dev filesystem cache (~8GB) is invalidated // Per-branch build dir. Turbopack's dev filesystem cache (~8GB) is invalidated
// wholesale by an in-place branch switch, so the dev daemon points each branch at // wholesale by an in-place branch switch, so the dev daemon points each branch at
// its own dir and keeps them warm instead of purging. Unset -> stock `.next`. // its own dir and keeps them warm instead of purging. Unset -> stock `.next`.
+2 -3
View File
@@ -245,7 +245,7 @@
"exifreader": "^4.39.0", "exifreader": "^4.39.0",
"fastest-levenshtein": "^1.0.16", "fastest-levenshtein": "^1.0.16",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"form-graph": "^0.2.0", "form-graph": "^0.3.0",
"google-auth-library": "^9.15.0", "google-auth-library": "^9.15.0",
"googleapis": "^144.0.0", "googleapis": "^144.0.0",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
@@ -423,8 +423,7 @@
"undici@6": "^6.27.0", "undici@6": "^6.27.0",
"tar-fs@2": "^2.1.5", "tar-fs@2": "^2.1.5",
"tar-fs@3": "^3.1.3", "tar-fs@3": "^3.1.3",
"ws@7": "^7.5.11", "ws@7": "^7.5.11"
"form-graph": "link:../../form-graph"
}, },
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"@parcel/watcher", "@parcel/watcher",
+231 -193
View File
File diff suppressed because it is too large Load Diff
-5
View File
@@ -23,11 +23,6 @@
"noUncheckedIndexedAccess": false, // TODO swap to true "noUncheckedIndexedAccess": false, // TODO swap to true
"paths": { "paths": {
"~/*": ["./src/*"], "~/*": ["./src/*"],
// form-graph is a pnpm link: — pin react types to the app's copy so the
// lib's own node_modules (@types/react 18.3.x) can't split the program.
// Remove with the link:/turbopack.root widening before any PR.
"react": ["./node_modules/@types/react"],
"react-dom": ["./node_modules/@types/react-dom"],
"@civitai/db-schema": ["./packages/civitai-db-schema/src/index"], "@civitai/db-schema": ["./packages/civitai-db-schema/src/index"],
"@civitai/db-schema/*": ["./packages/civitai-db-schema/src/*"], "@civitai/db-schema/*": ["./packages/civitai-db-schema/src/*"],
"@civitai/db": ["./packages/civitai-db/src/index"], "@civitai/db": ["./packages/civitai-db/src/index"],