Skip to content

Commit

Permalink
Improve exported root definitions (vercel#32077)
Browse files Browse the repository at this point in the history
Fixes vercel#32045

doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.

## Bug

- [x] Related issues linked using `fixes #number`
  • Loading branch information
lfades authored and natew committed Feb 16, 2022
1 parent 930668e commit 0d580a0
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion packages/next/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import App from './dist/pages/_app'
export * from './dist/pages/_app'
export { default } from './dist/pages/_app'
export default App
1 change: 0 additions & 1 deletion packages/next/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './dist/client/index'
export { default } from './dist/client/index'
3 changes: 2 additions & 1 deletion packages/next/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import getConfig from './dist/shared/lib/runtime-config'
export * from './dist/shared/lib/runtime-config'
export { default } from './dist/shared/lib/runtime-config'
export default getConfig
3 changes: 2 additions & 1 deletion packages/next/document.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Document from './dist/shared/lib/runtime-config'
export * from './dist/pages/_document'
export { default } from './dist/pages/_document'
export default Document
3 changes: 2 additions & 1 deletion packages/next/dynamic.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import dynamic from './dist/shared/lib/dynamic'
export * from './dist/shared/lib/dynamic'
export { default } from './dist/shared/lib/dynamic'
export default dynamic
3 changes: 2 additions & 1 deletion packages/next/error.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Error from './dist/pages/_error'
export * from './dist/pages/_error'
export { default } from './dist/pages/_error'
export default Error
3 changes: 2 additions & 1 deletion packages/next/head.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Head from './dist/shared/lib/head'
export * from './dist/shared/lib/head'
export { default } from './dist/shared/lib/head'
export default Head
3 changes: 2 additions & 1 deletion packages/next/image.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Image from './dist/client/image'
export * from './dist/client/image'
export { default } from './dist/client/image'
export default Image
3 changes: 2 additions & 1 deletion packages/next/jest.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import nextJest from './dist/build/jest/jest'
export * from './dist/build/jest/jest'
export { default } from './dist/build/jest/jest'
export default nextJest
3 changes: 2 additions & 1 deletion packages/next/link.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Link from './dist/client/link'
export * from './dist/client/link'
export { default } from './dist/client/link'
export default Link
3 changes: 2 additions & 1 deletion packages/next/router.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Router from './dist/client/router'
export * from './dist/client/router'
export { default } from './dist/client/router'
export default Router
3 changes: 2 additions & 1 deletion packages/next/script.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Script from './dist/client/script'
export * from './dist/client/script'
export { default } from './dist/client/script'
export default Script

0 comments on commit 0d580a0

Please sign in to comment.