-
Notifications
You must be signed in to change notification settings - Fork 929
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
feat(envs API) - Support custom dep detectors for envs #7199
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
31782cc
support custom dep detectors for envs
Jinjiang e71092e
support env interface to custom dep detectors
Jinjiang 643b5c0
pass env dep detectors into precinct.paperwork
Jinjiang dd3df4e
adjust options of precinct.paperwork
Jinjiang 13114ab
wip: refactor the logic of dep detection
Jinjiang ed53ebe
pass env dep detectors into precinct.paperwork
Jinjiang 6415576
adjust options of precinct.paperwork
Jinjiang 9591405
re-implement dep detector core
Jinjiang 4019bf9
fix: detective types
Jinjiang ef502bb
revert paperwork call in dependency-tree
Jinjiang c9fc31a
typo: env detectors
Jinjiang 1ab5f47
refactor: precinct code
Jinjiang 0ab9a90
fix: precinct code without a specific type
Jinjiang b8016e4
test: add test case for env detector
Jinjiang 535d7e4
revamp: simplify the types for precinct
Jinjiang fc01356
revamp: rename getComponentEnvDepDetectors with calc prefix
Jinjiang 3f9f120
revamp: make detectors in dep env interface optional
Jinjiang 3cbde9c
revert: return type of isSupported() in DetectorHook as boolean
Jinjiang 97ef2b5
update code comment for type in DependencyDetector
Jinjiang cc39247
Merge branch 'master' into jinjiang/dep-detectors
Jinjiang 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 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 @@ | ||
keywords: foo foo foo |
This file contains 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 @@ | ||
There is no keywords matched. |
This file contains 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 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,6 @@ | ||
import { EnvHandler } from '@teambit/envs'; | ||
import { DependencyDetector } from './dependency-detector'; | ||
|
||
export interface DependencyEnv { | ||
detectors?(): EnvHandler<DependencyDetector[] | null>; | ||
} |
This file contains 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 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 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 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 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 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 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What possible values are for this?
if it's general string, we should improve the comment above it to explain what it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
type
is whatprecinct()
previously receives as the second argument. Also, it's what the previousgetType()
returns inpaperwork()
. I added this field into the detector interface to combine the 2 steps directly.The previous implementation has 2 steps: 1) get the type from the ext, 2) get detective from the type.
Sometimes ext names and types are not 1:1 matched. For example,
.ts
and.tsx
both match the typets
.For custom env detectors, I think it's also a good practice for detector authors to specify what type of files it belongs to.
And I updated the code comment a little bit. What do you think now? :-)