diff --git a/package.json b/package.json index 30ba195a00..6d11eb2c2b 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,9 @@ "react": "React", "react/jsx-runtime": "ReactJSX", "react/jsx-dev-runtime": "ReactJSXDev" + }, + "___experimentalFlags_WILL_CHANGE_IN_PATCH": { + "exports": true } }, "bugs": { @@ -187,7 +190,7 @@ "@manypkg/cli": "^0.16.1", "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", - "@preconstruct/cli": "^2.1.5", + "@preconstruct/cli": "^2.1.8", "@testing-library/react": "13.0.0-alpha.5", "@types/jest": "^27.0.3", "@types/node": "^10.11.4", diff --git a/packages/cache/package.json b/packages/cache/package.json index 17926fa7a5..fda7706993 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -8,6 +8,25 @@ "./dist/emotion-cache.cjs.js": "./dist/emotion-cache.browser.cjs.js", "./dist/emotion-cache.esm.js": "./dist/emotion-cache.browser.esm.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-cache.browser.esm.prod.js", + "default": "./dist/emotion-cache.browser.cjs.prod.js" + }, + "module": "./dist/emotion-cache.browser.esm.dev.js", + "default": "./dist/emotion-cache.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-cache.esm.prod.js", + "default": "./dist/emotion-cache.cjs.prod.js" + }, + "module": "./dist/emotion-cache.esm.dev.js", + "default": "./dist/emotion-cache.cjs.js" + } + }, "types": "types/index.d.ts", "license": "MIT", "repository": "https://github.com/emotion-js/emotion/tree/main/packages/cache", @@ -33,5 +52,13 @@ "src", "dist", "types/*.d.ts" - ] + ], + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } + } } diff --git a/packages/css/package.json b/packages/css/package.json index 7bea4af24b..621c650921 100644 --- a/packages/css/package.json +++ b/packages/css/package.json @@ -52,11 +52,52 @@ "url": "https://github.com/emotion-js/emotion/issues" }, "umd:main": "dist/emotion-css.umd.min.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-css.browser.esm.prod.js", + "default": "./dist/emotion-css.browser.cjs.prod.js" + }, + "module": "./dist/emotion-css.browser.esm.dev.js", + "default": "./dist/emotion-css.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-css.esm.prod.js", + "default": "./dist/emotion-css.cjs.prod.js" + }, + "module": "./dist/emotion-css.esm.dev.js", + "default": "./dist/emotion-css.cjs.js" + }, + "./create-instance": { + "browser": { + "production": { + "module": "./create-instance/dist/emotion-css-create-instance.browser.esm.prod.js", + "default": "./create-instance/dist/emotion-css-create-instance.browser.cjs.prod.js" + }, + "module": "./create-instance/dist/emotion-css-create-instance.browser.esm.dev.js", + "default": "./create-instance/dist/emotion-css-create-instance.browser.cjs.js" + }, + "production": { + "module": "./create-instance/dist/emotion-css-create-instance.esm.prod.js", + "default": "./create-instance/dist/emotion-css-create-instance.cjs.prod.js" + }, + "module": "./create-instance/dist/emotion-css-create-instance.esm.dev.js", + "default": "./create-instance/dist/emotion-css-create-instance.cjs.js" + } + }, "preconstruct": { "umdName": "emotion", "entrypoints": [ "./index.js", "./create-instance.js" - ] + ], + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/is-prop-valid/package.json b/packages/is-prop-valid/package.json index 1d56f76ef6..cd266b560f 100644 --- a/packages/is-prop-valid/package.json +++ b/packages/is-prop-valid/package.json @@ -28,5 +28,32 @@ "browser": { "./dist/emotion-is-prop-valid.cjs.js": "./dist/emotion-is-prop-valid.browser.cjs.js", "./dist/emotion-is-prop-valid.esm.js": "./dist/emotion-is-prop-valid.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-is-prop-valid.browser.esm.prod.js", + "default": "./dist/emotion-is-prop-valid.browser.cjs.prod.js" + }, + "module": "./dist/emotion-is-prop-valid.browser.esm.dev.js", + "default": "./dist/emotion-is-prop-valid.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-is-prop-valid.esm.prod.js", + "default": "./dist/emotion-is-prop-valid.cjs.prod.js" + }, + "module": "./dist/emotion-is-prop-valid.esm.dev.js", + "default": "./dist/emotion-is-prop-valid.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/memoize/package.json b/packages/memoize/package.json index b0c5638ba9..43f203f267 100644 --- a/packages/memoize/package.json +++ b/packages/memoize/package.json @@ -25,5 +25,32 @@ "browser": { "./dist/emotion-memoize.cjs.js": "./dist/emotion-memoize.browser.cjs.js", "./dist/emotion-memoize.esm.js": "./dist/emotion-memoize.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-memoize.browser.esm.prod.js", + "default": "./dist/emotion-memoize.browser.cjs.prod.js" + }, + "module": "./dist/emotion-memoize.browser.esm.dev.js", + "default": "./dist/emotion-memoize.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-memoize.esm.prod.js", + "default": "./dist/emotion-memoize.cjs.prod.js" + }, + "module": "./dist/emotion-memoize.esm.dev.js", + "default": "./dist/emotion-memoize.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/primitives-core/package.json b/packages/primitives-core/package.json index 852a4b9267..4e952a9cbd 100644 --- a/packages/primitives-core/package.json +++ b/packages/primitives-core/package.json @@ -43,5 +43,32 @@ "browser": { "./dist/emotion-primitives-core.cjs.js": "./dist/emotion-primitives-core.browser.cjs.js", "./dist/emotion-primitives-core.esm.js": "./dist/emotion-primitives-core.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-primitives-core.browser.esm.prod.js", + "default": "./dist/emotion-primitives-core.browser.cjs.prod.js" + }, + "module": "./dist/emotion-primitives-core.browser.esm.dev.js", + "default": "./dist/emotion-primitives-core.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-primitives-core.esm.prod.js", + "default": "./dist/emotion-primitives-core.cjs.prod.js" + }, + "module": "./dist/emotion-primitives-core.esm.dev.js", + "default": "./dist/emotion-primitives-core.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/primitives/package.json b/packages/primitives/package.json index 05b47a94f2..598dea1794 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -53,5 +53,32 @@ "browser": { "./dist/emotion-primitives.cjs.js": "./dist/emotion-primitives.browser.cjs.js", "./dist/emotion-primitives.esm.js": "./dist/emotion-primitives.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-primitives.browser.esm.prod.js", + "default": "./dist/emotion-primitives.browser.cjs.prod.js" + }, + "module": "./dist/emotion-primitives.browser.esm.dev.js", + "default": "./dist/emotion-primitives.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-primitives.esm.prod.js", + "default": "./dist/emotion-primitives.cjs.prod.js" + }, + "module": "./dist/emotion-primitives.esm.dev.js", + "default": "./dist/emotion-primitives.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/react/package.json b/packages/react/package.json index 359967d82e..0cb55da48f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -7,6 +7,73 @@ "./dist/emotion-react.cjs.js": "./dist/emotion-react.browser.cjs.js", "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-react.browser.esm.prod.js", + "default": "./dist/emotion-react.browser.cjs.prod.js" + }, + "module": "./dist/emotion-react.browser.esm.dev.js", + "default": "./dist/emotion-react.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-react.esm.prod.js", + "default": "./dist/emotion-react.cjs.prod.js" + }, + "module": "./dist/emotion-react.esm.dev.js", + "default": "./dist/emotion-react.cjs.js" + }, + "./jsx-runtime": { + "browser": { + "production": { + "module": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.prod.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.prod.js" + }, + "module": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.dev.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.js" + }, + "production": { + "module": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.prod.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.prod.js" + }, + "module": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.dev.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" + }, + "./jsx-dev-runtime": { + "browser": { + "production": { + "module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.prod.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.prod.js" + }, + "module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.dev.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js" + }, + "production": { + "module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.prod.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.prod.js" + }, + "module": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.dev.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" + }, + "./_isolated-hnrs": { + "browser": { + "production": { + "module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.prod.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.prod.js" + }, + "module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.dev.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js" + }, + "production": { + "module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.prod.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.prod.js" + }, + "module": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.dev.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" + } + }, "types": "types/index.d.ts", "files": [ "src", @@ -70,6 +137,12 @@ "./jsx-dev-runtime.js", "./_isolated-hnrs.js" ], - "umdName": "emotionReact" + "umdName": "emotionReact", + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/serialize/package.json b/packages/serialize/package.json index e2fb1dee3d..cdb19970ab 100644 --- a/packages/serialize/package.json +++ b/packages/serialize/package.json @@ -32,5 +32,32 @@ "browser": { "./dist/emotion-serialize.cjs.js": "./dist/emotion-serialize.browser.cjs.js", "./dist/emotion-serialize.esm.js": "./dist/emotion-serialize.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-serialize.browser.esm.prod.js", + "default": "./dist/emotion-serialize.browser.cjs.prod.js" + }, + "module": "./dist/emotion-serialize.browser.esm.dev.js", + "default": "./dist/emotion-serialize.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-serialize.esm.prod.js", + "default": "./dist/emotion-serialize.cjs.prod.js" + }, + "module": "./dist/emotion-serialize.esm.dev.js", + "default": "./dist/emotion-serialize.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/server/package.json b/packages/server/package.json index 768bc5e4a4..a0b0676e1c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -54,10 +54,49 @@ "browser": { "./dist/emotion-server.cjs.js": "./dist/emotion-server.browser.cjs.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-server.browser.esm.prod.js", + "default": "./dist/emotion-server.browser.cjs.prod.js" + }, + "module": "./dist/emotion-server.browser.esm.dev.js", + "default": "./dist/emotion-server.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-server.esm.prod.js", + "default": "./dist/emotion-server.cjs.prod.js" + }, + "module": "./dist/emotion-server.esm.dev.js", + "default": "./dist/emotion-server.cjs.js" + }, + "./create-instance/index": { + "browser": { + "production": { + "module": "./create-instance/index/dist/emotion-server-create-instance.browser.esm.prod.js", + "default": "./create-instance/index/dist/emotion-server-create-instance.browser.cjs.prod.js" + }, + "module": "./create-instance/index/dist/emotion-server-create-instance.browser.esm.dev.js", + "default": "./create-instance/index/dist/emotion-server-create-instance.browser.cjs.js" + }, + "production": { + "default": "./create-instance/index/dist/emotion-server-create-instance.cjs.prod.js" + }, + "default": "./create-instance/index/dist/emotion-server-create-instance.cjs.js" + } + }, "preconstruct": { "entrypoints": [ "./index.js", "./create-instance/index.js" - ] + ], + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/sheet/package.json b/packages/sheet/package.json index a93b7cc557..f52d1f211a 100644 --- a/packages/sheet/package.json +++ b/packages/sheet/package.json @@ -8,6 +8,33 @@ "./dist/emotion-sheet.cjs.js": "./dist/emotion-sheet.browser.cjs.js", "./dist/emotion-sheet.esm.js": "./dist/emotion-sheet.browser.esm.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-sheet.browser.esm.prod.js", + "default": "./dist/emotion-sheet.browser.cjs.prod.js" + }, + "module": "./dist/emotion-sheet.browser.esm.dev.js", + "default": "./dist/emotion-sheet.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-sheet.esm.prod.js", + "default": "./dist/emotion-sheet.cjs.prod.js" + }, + "module": "./dist/emotion-sheet.esm.dev.js", + "default": "./dist/emotion-sheet.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } + }, "types": "types/index.d.ts", "license": "MIT", "scripts": { diff --git a/packages/styled/package.json b/packages/styled/package.json index 7a2fd56e30..9158435a87 100644 --- a/packages/styled/package.json +++ b/packages/styled/package.json @@ -54,11 +54,52 @@ "./dist/emotion-styled.cjs.js": "./dist/emotion-styled.browser.cjs.js", "./dist/emotion-styled.esm.js": "./dist/emotion-styled.browser.esm.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-styled.browser.esm.prod.js", + "default": "./dist/emotion-styled.browser.cjs.prod.js" + }, + "module": "./dist/emotion-styled.browser.esm.dev.js", + "default": "./dist/emotion-styled.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-styled.esm.prod.js", + "default": "./dist/emotion-styled.cjs.prod.js" + }, + "module": "./dist/emotion-styled.esm.dev.js", + "default": "./dist/emotion-styled.cjs.js" + }, + "./base": { + "browser": { + "production": { + "module": "./base/dist/emotion-styled-base.browser.esm.prod.js", + "default": "./base/dist/emotion-styled-base.browser.cjs.prod.js" + }, + "module": "./base/dist/emotion-styled-base.browser.esm.dev.js", + "default": "./base/dist/emotion-styled-base.browser.cjs.js" + }, + "production": { + "module": "./base/dist/emotion-styled-base.esm.prod.js", + "default": "./base/dist/emotion-styled-base.cjs.prod.js" + }, + "module": "./base/dist/emotion-styled-base.esm.dev.js", + "default": "./base/dist/emotion-styled-base.cjs.js" + } + }, "preconstruct": { "umdName": "emotionStyled", "entrypoints": [ "./index.js", "./base.js" - ] + ], + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/unitless/package.json b/packages/unitless/package.json index f2639670a3..aacf97c626 100644 --- a/packages/unitless/package.json +++ b/packages/unitless/package.json @@ -19,5 +19,32 @@ "browser": { "./dist/emotion-unitless.cjs.js": "./dist/emotion-unitless.browser.cjs.js", "./dist/emotion-unitless.esm.js": "./dist/emotion-unitless.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-unitless.browser.esm.prod.js", + "default": "./dist/emotion-unitless.browser.cjs.prod.js" + }, + "module": "./dist/emotion-unitless.browser.esm.dev.js", + "default": "./dist/emotion-unitless.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-unitless.esm.prod.js", + "default": "./dist/emotion-unitless.cjs.prod.js" + }, + "module": "./dist/emotion-unitless.esm.dev.js", + "default": "./dist/emotion-unitless.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/packages/utils/package.json b/packages/utils/package.json index 5367f4dce3..e6b519135c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -8,6 +8,33 @@ "./dist/emotion-utils.cjs.js": "./dist/emotion-utils.browser.cjs.js", "./dist/emotion-utils.esm.js": "./dist/emotion-utils.browser.esm.js" }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-utils.browser.esm.prod.js", + "default": "./dist/emotion-utils.browser.cjs.prod.js" + }, + "module": "./dist/emotion-utils.browser.esm.dev.js", + "default": "./dist/emotion-utils.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-utils.esm.prod.js", + "default": "./dist/emotion-utils.cjs.prod.js" + }, + "module": "./dist/emotion-utils.esm.dev.js", + "default": "./dist/emotion-utils.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } + }, "types": "types/index.d.ts", "license": "MIT", "scripts": { diff --git a/packages/weak-memoize/package.json b/packages/weak-memoize/package.json index f6b4e3b853..537c10ed19 100644 --- a/packages/weak-memoize/package.json +++ b/packages/weak-memoize/package.json @@ -25,5 +25,32 @@ "browser": { "./dist/emotion-weak-memoize.cjs.js": "./dist/emotion-weak-memoize.browser.cjs.js", "./dist/emotion-weak-memoize.esm.js": "./dist/emotion-weak-memoize.browser.esm.js" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "production": { + "module": "./dist/emotion-weak-memoize.browser.esm.prod.js", + "default": "./dist/emotion-weak-memoize.browser.cjs.prod.js" + }, + "module": "./dist/emotion-weak-memoize.browser.esm.dev.js", + "default": "./dist/emotion-weak-memoize.browser.cjs.js" + }, + "production": { + "module": "./dist/emotion-weak-memoize.esm.prod.js", + "default": "./dist/emotion-weak-memoize.cjs.prod.js" + }, + "module": "./dist/emotion-weak-memoize.esm.dev.js", + "default": "./dist/emotion-weak-memoize.cjs.js" + } + }, + "preconstruct": { + "exports": { + "envConditoins": [ + "browser", + "worker" + ] + } } } diff --git a/yarn.lock b/yarn.lock index e08674d51e..8a96227ab7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5086,10 +5086,10 @@ schema-utils "^2.6.5" source-map "^0.7.3" -"@preconstruct/cli@^2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@preconstruct/cli/-/cli-2.1.5.tgz#f7f6d06809f382521589af15f67b87009b240c58" - integrity sha512-bMnGTkaotxq+xoOkXoUOfTFvxBX/ZUxukcacf3mx3G7Iz5m/T4ZGzSOU12pxl64e+rVWGTKlUsgaDSgyFkup0A== +"@preconstruct/cli@^2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@preconstruct/cli/-/cli-2.1.8.tgz#7adb77d1db4e88b4bb33ce0ac31a3df5dc17d414" + integrity sha512-s5nrYvNxNDZOgwcjaNfqdkDClbKEDO15ZlH2l7CSunO99/Atj0kHSpKXho6mipJtSRYXGiMzOVN2qH7Dl29XzQ== dependencies: "@babel/code-frame" "^7.5.5" "@babel/core" "^7.7.7" @@ -30601,8 +30601,10 @@ watchpack@^1.7.4: resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453" integrity sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ== dependencies: + chokidar "^3.4.1" graceful-fs "^4.1.2" neo-async "^2.5.0" + watchpack-chokidar2 "^2.0.1" optionalDependencies: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1"