forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
javascript: jsconfig (tsconfig) parsing for dependency inference (pan…
…tsbuild#21176) This adds support for a lot of "extensions" that bundlers allow for javascript that regular node does not. In particular, inference can now find: 1. "index files" by assuming that a matching "directory import" attempts to target said file 2. "extensionless files", essentially imports that omit the file-extensions. This has the potential to be extended to any kind of source you want to, however this PR does not add support for additional extensions. 3. Files that are mapped via the "paths" mapping. This had enough analogies with subpath imports that it reuses the latter wholesale, but is applied after the first one. I expect there to be cases I have missed [(as microsofts extended definition of node resolution algo is mega complex),](https://www.typescriptlang.org/docs/handbook/modules/reference.html). My hope is this implementation is _permissive_ and mostly includes false positive errors w.r.t runtime (meaning too many dependents are inferred). This PR also introduces the `UnknownDependencyBehaviour` for the `nodejs-infer` subsystem, so that users can opt into and out of warnings and errors using this new more permissive mode. --------- Co-authored-by: Huon Wilson <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,009 additions
and
158 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"jest": "^29.5.0" | ||
"jest": "^29.5.0", | ||
"semver": "^6.0.0" | ||
} | ||
} |
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.