-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
feat(types): export Rollup namespace #12316
Conversation
|
8d2f158
to
6e6d078
Compare
4dd5b35
to
3b35716
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Hey @sun0day! We discussed the PR in today's team meeting at the end we decided that the best approach is to export all types as a namespace, The rationale is that it avoids the need for a new exported path (that as we saw, it wasn't easy to define), and it isn't bad that the imported types would end up being more explicit We would also like to export other deps types in the same way (for example the ones for Chokidar), and in a future major remove the flat exports we have for them. The types for Terser require extra attention as we are no longer bundling them, but we should be able to do the same. And we also discussed exposing I think we don't need to rename |
That's ok. I'd love to continue working on this pr. So I just need to add |
I think we could do this in several PRs.
// dep types
export type {
AliasOptions,
MapToFunction,
ResolverFunction,
ResolverObject,
Alias,
} from 'dep-types/alias'
export type { Connect } from 'dep-types/connect'
export type { WebSocket, WebSocketAlias } from 'dep-types/ws'
export type { HttpProxy } from 'dep-types/http-proxy'
export type {
FSWatcher,
WatchOptions,
AwaitWriteFinishOptions,
} from 'dep-types/chokidar'
export type { Terser } from 'dep-types/terser'
export type { RollupCommonJSOptions } from 'dep-types/commonjs'
export type { RollupDynamicImportVarsOptions } from 'dep-types/dynamicImportVars'
export type { Matcher, AnymatchPattern, AnymatchFn } from 'dep-types/anymatch' It looks like We would need to do the same for I'm not sure about
|
Cool. I'd love to work on these 3 PRs. |
3b35716
to
d8ed273
Compare
@@ -1,3 +1,6 @@ | |||
import type * as Rollup from 'rollup' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api-extractor
hasn't support export * as ...
syntax, so use import type * as ...
instead.
Description
fix #12270
export origin rollup types as
Rollup
namespace inindex.d.ts
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).