-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not compile ts code of external module #4667
Comments
other case. when npm package has ambient external module and proper external module both. for example.
expected
|
dtsGenerator is no longer used to generate the type definitions for this package, it will be removed from the dependencies list in the near future if the "proper external module" format doesn't result in any unforeseen issues. This change also made it necessary to re-introduce the `src` directory for `.ts` source files due to an issue with the TypeScript compiler <microsoft/TypeScript#4667> where TypeScript would attempt to build the `.ts` files in this package while building a project that consumes this package (instead of simply referencing the `.d.ts` files in this package). The workaround for now is to ensure the `.d.ts` files `.ts` files are in separate directories.
this should be in master and release 1.6, @vvakame can you give it a quick try. |
@mhegazy It is not works fine still... repro
|
@vladima can you take a look. |
@mhegazy this is a known issue with transitive imports from the 'external typings only' contexts that was not yet fixed |
vvakame/commandpost@d637859 |
After going on this back and forth a few times, the current behavior seems to be the best. Users working on multiple modules at design time would like to get this behavior. |
@mhegazy cool, is that tool available somewhere? |
@vladima can you share your tool? |
because tsc can look up the *.tsx? files mistakenly see microsoft/TypeScript#4667
#2338 implements npm module lookup (very cool!)
I have a request.
I want to tsc lookup
.d.ts
first, not.ts
.in above case.
code dependencies are resolved to
node_modules/commandpost/index.d.ts
->node_modules/commandpost/lib/index.ts
when my code execimport * as commandpost from "commandpost";
I want to tsc resolve
node_modules/commandpost/index.d.ts
->node_modules/commandpost/lib/index.d.ts
, not .ts.external ts code can't compile everywhere.
for example.
but node_modules/commandpost/node_modules/typescript/lib/lib.es6.d.ts is not exists (typescript is devDependencies
Does TypeScript team has best practise about project structure for npm module?
commandpost
The text was updated successfully, but these errors were encountered: