Title: Multiple source roots - or something like classpath, like python_path, like include_path !!! · Issue #5893 · microsoft/TypeScript · GitHub
Open Graph Title: Multiple source roots - or something like classpath, like python_path, like include_path !!! · Issue #5893 · microsoft/TypeScript
X Title: Multiple source roots - or something like classpath, like python_path, like include_path !!! · Issue #5893 · microsoft/TypeScript
Description: I need to have the following structure: build debug release sources clients APIClient.ts runtime services test cases clients APIClientTest.ts runtime services typings My goal is that in the tests I want to be able to import the associate...
Open Graph Description: I need to have the following structure: build debug release sources clients APIClient.ts runtime services test cases clients APIClientTest.ts runtime services typings My goal is that in the tests I...
X Description: I need to have the following structure: build debug release sources clients APIClient.ts runtime services test cases clients APIClientTest.ts runtime services typings My goal is that in the tests I...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/5893
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multiple source roots - or something like classpath, like python_path, like include_path !!!","articleBody":"I need to have the following structure:\n- build\n - debug\n - release\n- sources\n - clients\n - APIClient.ts\n - runtime\n - services\n- test\n - cases\n - clients\n - APIClientTest.ts\n - runtime\n - services\n- typings\n\nMy goal is that in the tests I want to be able to import the associated tested class without using `/// reference`.\n\nThis would work out of the box if the test would stay right next to the class, not in separate directories:\n- build\n - debug\n - release\n- sources\n - clients\n - APIClient.ts\n - APIClientTest.ts\n - runtime\n - services\n- typings\n\nBut it is _extremly ugly_ and dirty and it gets even more so when these folders start growing(hundreds of classes, hundreds of tests ...)\n\nMy second attempt was to use a `tsconfig.json`:\n\n```\n{\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"target\": \"es5\",\n \"noImplicitAny\": true,\n \"noEmitOnError\": true,\n \"outDir\": \"./build/debug\",\n \"rootDir\": \"./\",\n \"sourceMap\": false\n },\n \"exclude\": [\n \"build\",\n \"node_modules\"\n ]\n}\n```\n\nBut this creates weird folder structure inside build, understandable because it considers project root as source root which is not the same thing at all. Now, from what I've tried, the ideal situation would be to have multiple source directories that output in the same build dir. In this way, the tests would be able to avoid having to declare the horor that is `/// reference`.\n\nI could use different `tsconfig.json` for sources and test directories, but then how do you specify the tests that references can be found additionally in another directory too.\n\nWhat do you recommend, what can be done ?\n","author":{"url":"https://github.com/iongion","@type":"Person","name":"iongion"},"datePublished":"2015-12-02T15:54:03Z","url":"https://github.com/microsoft/TypeScript/issues/5893"}
| 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:505a9c34-c15b-4e8d-3b78-abe01867579f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8AC:6365:1BD9213:2522104:6B0163C5 |
| html-safe-nonce | 1258bfd833446ed3812177d35905fca0d23f352f256abebace5fe60a48f05368 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEFDOjYzNjU6MUJEOTIxMzoyNTIyMTA0OjZCMDE2M0M1IiwidmlzaXRvcl9pZCI6IjI2NTg1MTMwNTM1NDAyNDY0NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f0cf7a6fb404345fc4136be938ee7d2de6299846c506476da2e75e4ca2318064 |
| hovercard-subject-tag | issue:119972662 |
| 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/5893/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ed547178eaf7394fe807d80ab8931c1396522dd6be268afe7a963a5d50158af/microsoft/TypeScript/issues/5893 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ed547178eaf7394fe807d80ab8931c1396522dd6be268afe7a963a5d50158af/microsoft/TypeScript/issues/5893 |
| og:image:alt | I need to have the following structure: build debug release sources clients APIClient.ts runtime services test cases clients APIClientTest.ts runtime services typings My goal is that in the tests I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iongion |
| 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