-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixed importing in Node ESM #3029
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@emotion/babel-plugin': patch | ||
'@emotion/babel-plugin-jsx-pragmatic': patch | ||
'@emotion/babel-preset-css-prop': patch | ||
'@emotion/cache': patch | ||
'@emotion/css': patch | ||
'@emotion/css-prettifier': patch | ||
'@emotion/eslint-plugin': patch | ||
'@emotion/hash': patch | ||
'@emotion/is-prop-valid': patch | ||
'@emotion/jest': patch | ||
'@emotion/memoize': patch | ||
'@emotion/native': patch | ||
'@emotion/primitives': patch | ||
'@emotion/primitives-core': patch | ||
'@emotion/react': patch | ||
'@emotion/serialize': patch | ||
'@emotion/server': patch | ||
'@emotion/sheet': patch | ||
'@emotion/styled': patch | ||
'@emotion/unitless': patch | ||
'@emotion/use-insertion-effect-with-fallbacks': patch | ||
'@emotion/utils': patch | ||
'@emotion/weak-memoize': patch | ||
--- | ||
|
||
Fixed importing in Node ESM |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './macro.js' |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,9 +9,7 @@ | |||||||||||||||||||||||||||||||
"src", | ||||||||||||||||||||||||||||||||
"dist", | ||||||||||||||||||||||||||||||||
"types", | ||||||||||||||||||||||||||||||||
"macro.js", | ||||||||||||||||||||||||||||||||
"macro.d.ts", | ||||||||||||||||||||||||||||||||
"macro.js.flow", | ||||||||||||||||||||||||||||||||
"macro.*", | ||||||||||||||||||||||||||||||||
"create-instance" | ||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||
"scripts": { | ||||||||||||||||||||||||||||||||
|
@@ -46,14 +44,22 @@ | |||||||||||||||||||||||||||||||
"exports": { | ||||||||||||||||||||||||||||||||
".": { | ||||||||||||||||||||||||||||||||
"module": "./dist/emotion-css.esm.js", | ||||||||||||||||||||||||||||||||
"import": "./dist/emotion-css.cjs.mjs", | ||||||||||||||||||||||||||||||||
"default": "./dist/emotion-css.cjs.js" | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
"./create-instance": { | ||||||||||||||||||||||||||||||||
"module": "./create-instance/dist/emotion-css-create-instance.esm.js", | ||||||||||||||||||||||||||||||||
"import": "./create-instance/dist/emotion-css-create-instance.cjs.mjs", | ||||||||||||||||||||||||||||||||
"default": "./create-instance/dist/emotion-css-create-instance.cjs.js" | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
"./package.json": "./package.json", | ||||||||||||||||||||||||||||||||
"./macro": "./macro.js" | ||||||||||||||||||||||||||||||||
"./macro": { | ||||||||||||||||||||||||||||||||
"types": { | ||||||||||||||||||||||||||||||||
"import": "./macro.d.mts", | ||||||||||||||||||||||||||||||||
"default": "./macro.d.ts" | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
"default": "./macro.js" | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
"preconstruct": { | ||||||||||||||||||||||||||||||||
"umdName": "emotion", | ||||||||||||||||||||||||||||||||
|
@@ -63,7 +69,13 @@ | |||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||
"exports": { | ||||||||||||||||||||||||||||||||
"extra": { | ||||||||||||||||||||||||||||||||
"./macro": "./macro.js" | ||||||||||||||||||||||||||||||||
"./macro": { | ||||||||||||||||||||||||||||||||
"types": { | ||||||||||||||||||||||||||||||||
"import": "./macro.d.mts", | ||||||||||||||||||||||||||||||||
"default": "./macro.d.ts" | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
"default": "./macro.js" | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
Comment on lines
+72
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I'm not a fan of array flavor... maybe, in here, this would actually be a little bit more obvious that the "fallthrough" is intended?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, just leave it how it is. (it looks like arethetypeswrong incorrectly flags this as a problem, will open an issue about that in a moment) |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styled from '@emotion/native' | ||
export * from '@emotion/native' | ||
export default styled |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styled from '@emotion/native' | ||
export * from '@emotion/native' | ||
export default styled |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './macro.js' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styled from '@emotion/styled' | ||
export * from '@emotion/styled' | ||
export default styled |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
declare module '@emotion/styled/macro' { | ||
import styled from '@emotion/styled' | ||
export * from '@emotion/styled' | ||
export default styled | ||
} | ||
import styled from '@emotion/styled' | ||
export * from '@emotion/styled' | ||
export default styled |
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.
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.
hm, i wasn't sure if this would "fall through" to the other default... does it? 🤔
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.
It does (but that's correct behaviour, not like TS's bug)