microsoft / microsoft/TypeScript
Can references path support package name?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Suggestion
🔍 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Konfiguration der Projektverweise in tsconfig.json und die Art zu überprüfen, wie die aktuellen relativen path-Werte referenzierte Konfigurationen identifizieren. Lege fest, wie Paketnamen, einschließlich Paketunterpfaden wie tsconfig.es.json, aufgelöst werden sollen; als abgeschlossen gilt die Aufgabe, wenn die Beispielverweise ohne relative Pfade funktionieren und das bestehende Verhalten von Verweisen weiterhin unterstützt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- build-system
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100