You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some manual d.ts definition files that import some other manual d.ts files that do not have corresponding .js code files. Specifically in my reproduction below I have these files in my src directory:
src
├── types <------ NONE OF THE FILES IN THIS DIRECTORY ARE COPIED TO `dist`
│ ├── README.md
│ ├── lng.components.namespace.d.ts
│ ├── lng.d.ts
│ ├── lng.shaders.c2d.namespace.d.ts
│ ├── lng.shaders.namespace.d.ts
│ ├── lng.textures.namespace.d.ts
│ ├── lng.tools.namespace.d.ts
│ └── lng.types.namespace.d.ts
├── internalTypes.d.mts <------ ALSO MISSING
├── commonTypes.d.mts <------ ALSO MISSING
├── lightning.d.mts
├── lightning.mjs
└── ...
src/lightning.d.mts
// ...import*aslngfrom"./types/lng";// <----- This `d.ts` file and the files it depends on are not copied over to `dist`/** * This seeming nonsense helps us export all the types with the same names/structure as * their runtime counterparts. */declarenamespacelng_{exportimportlng_=lng;}exportdefaultlng_.lng_;
src/types/lng.d.ts
// ...import*asshadersfrom'./lng.shaders.namespace';import*astexturesfrom'./lng.textures.namespace';import*ascomponentsfrom'./lng.components.namespace';import*astoolsfrom'./lng.tools.namespace';import*astypesfrom'./lng.types.namespace';// ^ ----- None of these are copied over eitherexport{Application,Component,Base,Utils,StageUtils,Element,Tools,Stage,ElementCore,ElementTexturizer,Texture,EventEmitter,shaders,textures,components,tools};// `types` has to be exported as type so TS/IDEs don't allow you access it from runtime contextexporttype{types};
As mentioned in the comments of the code above, none of the files in the src/types directory are copied over to dist. Which causes TypeScript to throw errors because of missing dependencies in any application that uses this library as a dependency.
dist
├── index.d.ts <--- Definition file copied over by vite-plugin-dts
├── ...
└── src <--- Definition files copied over by vite-plugin-dts
├── EventEmitter.d.mts
├── EventEmitter.d.mts.map
├── animation
├── application
├── components
├── flex
├── lightning.d.mts
├── lightning.d.mts.map
├── platforms
├── renderer
├── textures
├── tools
└── tree
^----------- Note how the `types` directory is completely missing.
As well as `internalTypes.d.mts`/`commonTypes.d.mts`
I believe in 2174868 (prompted by #178) is where you added the copying of manual .d.ts files.
Describe the bug
I have some manual
d.ts
definition files that import some other manuald.ts
files that do not have corresponding.js
code files. Specifically in my reproduction below I have these files in mysrc
directory:src/lightning.d.mts
src/types/lng.d.ts
As mentioned in the comments of the code above, none of the files in the
src/types
directory are copied over todist
. Which causes TypeScript to throw errors because of missing dependencies in any application that uses this library as a dependency.I believe in 2174868 (prompted by #178) is where you added the copying of manual .d.ts files.
Thanks!
Reproduction
https://stackblitz.com/~/github.com/frank-weindel/lightning/tree/vite-plugin-dts-bug-3
Steps to reproduce
System Info
Validations
The text was updated successfully, but these errors were encountered: