Repository navigation
fix: webjs check skips a nested package with its own package.json - #1701
Merged
Merged
Conversation
A sub-folder with its own package.json is a separate package, such as an Expo app in mobile/ beside an api backend. webjs check walked it as app code, so no-foreign-framework-import failed on its React imports and there was no way to exclude it. The check's file walk and its TypeScript walk now stop at that boundary, as they stop at node_modules. The router, action and component scans are unchanged. Closes #1700
|
Preview for Next: fix the listed keys in the compose file |
runner-support.js imported walk but never called it, which read as a third check walk that needed the nested-package boundary. Its scans start from the app's components and routes instead.
vivek7405
marked this pull request as ready for review
November 13, 2026 18:47
vivek7405
added a commit
that referenced
this pull request
Nov 13, 2026
Ships the webjs check nested-package boundary from #1701, so an app with a separate package such as an Expo app in mobile/ passes the check once it installs the latest server. Co-authored-by: t <t@t>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1700
webjs checknow skips any folder below the app root that has its ownpackage.json, and everything under it, the way it already skipsnode_modules. Such a folder is a separate package (an Expo or React Native app inmobile/beside anapibackend), so its React imports and its TypeScript are no longer reported as WebJs code. The app root's ownpackage.jsonis never a boundary, and no config key is needed.What changed
packages/server/src/fs-walk.js:walk(dir, filter, { skipNestedPackages: true })stops at a directory belowdirthat holds apackage.json. The check is free, since the walk already reads each directory's entries.packages/server/src/check/runner.js(the file list every file rule reads) andpackages/server/src/check/rules-typescript.js(the separate TypeScript walk behindno-non-erasable-typescript) set the option.runner-support.jsimportedwalkbut never called it, so the unused import is gone. Its scans arebuildModuleGraph/scanComponents/buildRouteTable. Those still walk the whole app dir,mobile/included, but the rule built on them only reports modules reachable from the app's own components andinstrumentation-client, and nothing under a nested Expo app is a WebJs component, so no rule fires on it there.Deliberately not changed
The router, the
'use server'action index and the component scanner keep walking everything. Skipping a nested package there is arguably right too, but it changes what the server registers and serves, so it is a separate change with its own tests if it is ever wanted.Tests
packages/server/test/check/foreign-imports.test.js: a React import undermobile/withmobile/package.jsonpasses whilecomponents/is still flagged, and the same files with nomobile/package.jsonstill fail (counterfactual).packages/server/test/check/check.test.js: the runner level, covering both walks (an enum and a JSX file inmobile/are skipped, the app's own enum is still reported, and both come back oncemobile/package.jsonis gone), plus thewalk()option being opt-in.readdirwalk, not a runtime-sensitive surface, and the Bun matrix runs these node:test files.bun test.npm testgreen (the blog integration file needed its local db seeded first).webjs checkpasses ingallery,examples/blogandwebsite. A freshbun create webjs@latest app --template api --runtime bun --db postgreswithmobile/package.jsonand a Reactmobile/src/ui.tsxpasses with this branch's CLI, fails with it oncemobile/package.jsonis removed, and fails with the published CLI as before.Docs
website/app/(site)/docs/conventions/page.ts: thewebjs checksection says what is skipped.AGENTS.mdCLI section andpackages/server/AGENTS.mdmodule map (fs-walk.js).