Skip to content

fix(utoopack): support explicit filesystem roots for linked dependencies - #149

Closed
hongxuWei wants to merge 1 commit into
mainfrom
fix/utoopack-root-path
Closed

hongxuWei wants to merge 1 commit into
mainfrom
fix/utoopack-root-path

Conversation

@hongxuWei

Copy link
Copy Markdown
Contributor

Problem

A linked package or a shared node_modules directory can resolve outside Utoopack's automatically discovered filesystem root. Builds then fail with Symlink node_modules could not be resolved, even though the dependency exists and compiles when its common parent is explicitly included.

Change

Add an optional application-level rootPath configuration. The default Utoopack adapter resolves it relative to the application, checks the real directory contains the application, and rejects filesystem-wide roots before cleaning build output. Omitting the option preserves automatic discovery.

Pass the validated scope through production builds and the dev worker to both client and server Projects. Keep project inputs, outputs, and persistent caches application-relative. Include English and Chinese documentation covering linked dependencies and native loader scratch files.

export default defineConfig({
  routing: { mode: "spa" },
  rootPath: "../..",
});

Validation

  • npm run check-types — passed.
  • npm run lint — passed.
  • npm test — passed (2,155 tests).
  • npm --workspace evjs-docs run build — passed for English and Chinese.
  • git diff --check — passed.
  • Real native build regression: the same linked dependency fails under implicit scope and compiles after explicitly including its parent.
  • Real dev worker regression: linked dependencies compile in both client and server Projects across Session replacement; output and persistent-cache locations remain application-owned.
  • Validation covers invalid/missing roots, files, realpath containment, filesystem-root rejection, and preserving existing output when configuration is invalid.

No dependency or lockfile changes. Browser E2E execution is left to the repository CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant