Can references path support package name?
See original GitHub issueSuggestion
🔍 Search Terms
projectReference, reference path, package name
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn’t be a breaking change in existing TypeScript/JavaScript code
- This wouldn’t change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript’s Design Goals.
⭐ Suggestion
add package name path support in tsconfig references path
📃 Motivating Example
originally, when we use project in a complex repo, path config can be nasty that only relative path is supported. so we have config like blow in our tsconfig.json.
{
"references": [
{ "path": "../libs/pkg-a" },
{ "path": "../../../libraries/pkg-b" },
{ "path": "../../../libraries/pkg-c/tsconfig.es.json" }
]
}
This is hard to trace the referenced config path, and also leads extra job when moving this package around in the repo. After implementation of package name support, above config can be simplified to
{
"references": [
{ "path": "@some/pkg-a" },
{ "path": "@some-other/pkg-b" },
{ "path": "@some-other/pkg-c/tsconfig.es.json" }
]
}
💻 Use Cases
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
PackageReference in project files - NuGet - Microsoft Learn
In this article. Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, ...
Read more >Package name does not correspond to the file path - IntelliJ
Package name does not correspond to the file path - IntelliJ - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing ......
Read more >With project references, some cross-package imports ... - GitHub
With project references, some cross-package imports of inferred types are emitted with relative paths #39117.
Read more >Documentation - Project References - TypeScript
The path property of each reference can point to a directory containing a tsconfig.json file, or to the config file itself (which may...
Read more >What are PackageReferences and how will they help optimise ...
PackageReference is a new way to allow NuGet to manage your projects references. Before this, adding a NuGet package would update both the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think maybe adding a module path resolving logic in https://github.com/microsoft/TypeScript/blob/1694c77060bc734cf2ce4feafe583a7bfb62fe76/src/compiler/tsbuild.ts#L145 would solve my problem.
Perhaps a new key?