Title: Project References Wildcards · Issue #56279 · microsoft/TypeScript · GitHub
Open Graph Title: Project References Wildcards · Issue #56279 · microsoft/TypeScript
X Title: Project References Wildcards · Issue #56279 · microsoft/TypeScript
Description: 🔍 Search Terms "project references" "glob" "wildcard" "repetitive" "monorepo" ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of existing JavaScrip...
Open Graph Description: 🔍 Search Terms "project references" "glob" "wildcard" "repetitive" "monorepo" ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change th...
X Description: 🔍 Search Terms "project references" "glob" "wildcard" "repetitive" "monorepo" ✅ Viability Checklist This wouldn't be a breaking change in exist...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/56279
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Project References Wildcards","articleBody":"### 🔍 Search Terms\n\n\"project references\" \"glob\" \"wildcard\" \"repetitive\" \"monorepo\"\n\n### ✅ Viability Checklist\n\n- [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code\n- [X] This wouldn't change the runtime behavior of existing JavaScript code\n- [X] This could be implemented without emitting different JS based on the types of the expressions\n- [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\n- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals\n\n### ⭐ Suggestion\n\nProject References currently have to be written out explicitly. It would be super nice if we could use a wildcard/glob like [this](https://github.com/microsoft/TypeScript/issues/25376#issuecomment-402302343), where I could simply have all of my `tsconfig.json` files look like this:\r\n\r\n```\r\n{\r\n \"extends\": [\"../../../tsconfig.base.json\"],\r\n \"references\": [{\"path\": \"../../libs/*\"}]\r\n}\r\n```\r\n\r\nOr, even something like this:\r\n```\r\n{\r\n \"extends\": [\"../../../tsconfig.base.json\"],\r\n \"references\": [{\"path\": \"../../libs/*/tsconfig.build.json\"}]\r\n}\r\n```\r\n\r\nWe can discuss below whether supporting globstars (`**`) is prudent or not.\n\n### 📃 Motivating Example\n\nI've got a project with 8 libs and 3 apps using project references. It follows this basic structure:\r\n```\r\ntsconfig.base.json\r\nworkspaces/\r\n apps/\r\n app-1/\r\n tsconfig.json\r\n app-2/\r\n tsconfig.json\r\n .../\r\n libs/\r\n lib-1/\r\n tsconfig.json\r\n lib-2/\r\n tsconfig.json\r\n .../\r\n```\r\nThere's a little more complexity, but that's the basic idea. However, I have a ton of repetition between all my `tsconfig.json` files that basically all look like this:\r\n```json\r\n{\r\n \"extends\": [\"../../../tsconfig.base.json\"],\r\n \"references\": [\r\n {\r\n \"path\": \"../../libs/lib-1\"\r\n },\r\n {\r\n \"path\": \"../../libs/lib-2\"\r\n },\r\n // ...\r\n ]\r\n}\r\n```\r\n\r\nI can't rely on the `extends` functionality from `tsconfig.base.json` because of things like @RyanCavanaugh's explanation here: https://github.com/microsoft/TypeScript/issues/27098#issuecomment-494161387. \n\n### 💻 Use Cases\n\n1. What do you want to use this for?\r\n - A monorepo with a number of shared libraries and apps\r\n2. What shortcomings exist with current approaches?\r\n - Lots of repetition of lengthy amounts of JSON\r\n3. What workarounds are you using in the meantime?\r\n - Specifying each lib in the `\"references\"` portion for every single app/lib that needs to be able to import shared libraries.\r\n","author":{"url":"https://github.com/eabrouwer3","@type":"Person","name":"eabrouwer3"},"datePublished":"2023-10-31T19:47:25Z","url":"https://github.com/microsoft/TypeScript/issues/56279"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eeafd813-8f14-f23a-e6d5-024d0b07aa75 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4EA:11EACE:23958CD:2F7DA7B:6B019536 |
| html-safe-nonce | b505ec0cb02fea091916e24613cf5d183fb2122a662a29e8534801079b142e63 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEVBOjExRUFDRToyMzk1OENEOjJGN0RBN0I6NkIwMTk1MzYiLCJ2aXNpdG9yX2lkIjoiNTgyMDMxNzY1NzI5NTA2NjQyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b4689a0a82303501386206fe8fb30e2a0fefbe3c765d761c99830ddec340cdf9 |
| hovercard-subject-tag | issue:1971192648 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/56279/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1187b5a1ca28e4853942eb8d5e5ac2e8c479d8e4faf707d84021a6c187e55996/microsoft/TypeScript/issues/56279 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1187b5a1ca28e4853942eb8d5e5ac2e8c479d8e4faf707d84021a6c187e55996/microsoft/TypeScript/issues/56279 |
| og:image:alt | 🔍 Search Terms "project references" "glob" "wildcard" "repetitive" "monorepo" ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eabrouwer3 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width