Comments (4)
Wow, you are quick (just pushed this first version out yesterday :)
The module is a bit of a hack-job to solve acute problem, so I'm not quite sure what is wise. It might be flawed (it still has to proof itself).
This code came originally from a project that exported some methods that returned types from a external definition, so iirc I added this reference handling to solve that. But I agree this becomes messy when you start combining these bundles and they all stomp global space. Your issue hasn't come up because I re-factored that out (for other reasons).
I'll have to look into trying to either merge referred content into the mangled string-namespace (if that works, as node.d.ts had globals and many sub-modules). That would make it nicely self-contained.
Otherwise maybe leave them out but somehow refer them to be installed as shared type to main typings folder.
Maybe it can be linked via the experimental typescript
element in package.json and some added logic in what is now upcoming TSD 0.6's link-command, which can already scan package.json and update tsd.d.ts with paths, so it might as well pull some shared dependencies.
Alternately it might relate to tsd.json somehow. But it goes a bit far to pull all of that as much of what is in there could be internals (or just for test suite stuff that doesn't relate to the package).
Let's think about this. I'm a bit distracted atm and knee deep in some other project. The problem is real enough though.
from dts-bundle.
Thanks for the quick response!
I'll make some kind of option to exclude external modules and send you a PR later.
from dts-bundle.
Very cool.
If it is active then maybe stash the omitted data in an collection we can later see if we can do something fancy with it.
from dts-bundle.
PR #3 adds support for excluding external typings (enabled by default).
As you requested, it also outputs a list of 'dependencies' as comments at the top of the generated output file (and in the verbose output).
from dts-bundle.
Related Issues (20)
- file not found error if both .d.ts file and a folder with the same name exist HOT 8
- removeSource option deletes .d.ts files within node modules HOT 3
- Export as default edge case
- A 'declare' modifier is required for a top level declaration in a .d.ts file. HOT 4
- Unable to reference external typings HOT 2
- Duplicated imports after bundle into single .d.ts file HOT 3
- Reexporting module as named export for module library HOT 4
- bug? declare module 'yargs2/index//yargs' HOT 2
- Bundle includes more than it should when using main
- dts-bundle generates circular dependencies HOT 1
- fs.writeFileSync passes the encoding the wrong way
- tsconfig.json paths HOT 2
- Add support to export as namespace HOT 1
- "already got export for:"
- All d.ts files bug with scoped package
- Interfaces with same name in separate files are combined
- Bundler fails for all declarations if project name contains slash HOT 1
- Declaration for style files
- Relative import error with namespace
- Project seems dead. dts-bundle-generator looks like an alternative.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dts-bundle.