-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: extract TraversalNodeModuleCollector for fallback project parsing
#9440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
850646b
move the manual node module traversal to the root abstract class. Add…
mmaietta 9e83327
clear env for spawn
mmaietta 76edef5
bun back to npm collector
mmaietta 3edc5a7
Merge commit 'e70da99e34c1cc913b237c5a58456bf752a378bc' into fix/is-d…
mmaietta be94b53
fix merge conflict res
mmaietta ed507da
whoops
mmaietta 86e5d7a
woah
mmaietta dfce2a2
Merge branch 'master' into fix/is-dep-prodpath
mmaietta 75d8c10
add snapshot tests for traversal tests, add `packageManager` override…
mmaietta 42cb47f
Merge remote-tracking branch 'origin/master' into fix/is-dep-prodpath
mmaietta 5551da3
force traversal for Bun
mmaietta 39395b6
update changeset
mmaietta 650ec00
Merge remote-tracking branch 'origin/master' into fix/is-dep-prodpath
mmaietta fe1ef15
temp save
mmaietta 17d0d77
tmp save
mmaietta e0fe3e6
cleanup
mmaietta 053c1b0
cleanup
mmaietta b7661b5
rename
mmaietta 40a096c
tmp save
mmaietta 0cea36d
simplify
mmaietta c81dd37
reset snapshot
mmaietta cebf281
lint
mmaietta a80612e
Merge branch 'master' into fix/is-dep-prodpath
mmaietta 20b49b8
properly declare null return values in moduleManager
mmaietta 2e8ceea
update changeset
mmaietta dfc17c0
Merge branch 'master' into fix/is-dep-prodpath
mmaietta cdaa816
cleanup
mmaietta a427c8a
Merge branch 'master' into fix/is-dep-prodpath
mmaietta 44907f6
changeset
mmaietta c5fc00a
Merge commit 'a427c8a74cf98a2d520b1b83d0acc9c57258246c' into fix/is-d…
mmaietta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "app-builder-lib": patch | ||
| --- | ||
|
|
||
| chore: move the manual node module traversal to the separate class. Add `env: { COREPACK_ENABLE_STRICT: "0", ...process.env },` to allow `npm list` to work across environments. |
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
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
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
10 changes: 3 additions & 7 deletions
10
packages/app-builder-lib/src/node-module-collector/bunNodeModulesCollector.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,13 @@ | ||
| import { log } from "builder-util" | ||
| import { NpmNodeModulesCollector } from "./npmNodeModulesCollector" | ||
| import { PM } from "./packageManager" | ||
| import { NpmDependency } from "./types" | ||
| import { TraversalNodeModulesCollector } from "./traversalNodeModulesCollector" | ||
|
|
||
| export class BunNodeModulesCollector extends NpmNodeModulesCollector { | ||
| export class BunNodeModulesCollector extends TraversalNodeModulesCollector { | ||
mmaietta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public readonly installOptions = { manager: PM.BUN, lockfile: "bun.lock" } | ||
|
|
||
| protected async getDependenciesTree(_pm: PM): Promise<NpmDependency> { | ||
| log.info(null, "bun does not support any CLI for dependency tree extraction, falling back to NPM node module collector") | ||
| log.info(null, "note: bun does not support any CLI for dependency tree extraction, utilizing NPM node module collector instead") | ||
| return super.getDependenciesTree(PM.NPM) | ||
| } | ||
|
|
||
| protected isProdDependency(packageName: string, tree: NpmDependency): boolean { | ||
| return tree.dependencies?.[packageName] != null || tree.optionalDependencies?.[packageName] != null | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.