From 67ac787060d8536c448dd15630af93631d9043f3 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Sat, 25 Feb 2023 11:38:32 +0000 Subject: [PATCH 1/5] chore: add type module to packages Revert "chore: add type module to packages" This reverts commit 00758660b56704e0949d99f4251c275d738376fe. chore: remove echo of version from script fix: use tsup on types package and stop direct imports too --- .changeset/fresh-moles-shake.md | 16 ++++++++++++++++ packages/core/src/index.ts | 4 +--- packages/types/animated.js | 0 packages/types/index.js | 0 packages/types/interpolation.js | 0 packages/types/package.json | 16 +++++++++++++--- .../types/{animated.d.ts => src/animated.ts} | 0 packages/types/{index.d.ts => src/index.ts} | 2 +- .../{interpolation.d.ts => src/interpolation.ts} | 2 +- packages/types/{util.d.ts => src/utils.ts} | 1 + packages/types/tsup.config.ts | 12 ++++++++++++ scripts/version-and-publish.sh | 3 --- 12 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 .changeset/fresh-moles-shake.md delete mode 100644 packages/types/animated.js delete mode 100644 packages/types/index.js delete mode 100644 packages/types/interpolation.js rename packages/types/{animated.d.ts => src/animated.ts} (100%) rename packages/types/{index.d.ts => src/index.ts} (71%) rename packages/types/{interpolation.d.ts => src/interpolation.ts} (98%) rename packages/types/{util.d.ts => src/utils.ts} (99%) create mode 100644 packages/types/tsup.config.ts diff --git a/.changeset/fresh-moles-shake.md b/.changeset/fresh-moles-shake.md new file mode 100644 index 0000000000..5a1a78da81 --- /dev/null +++ b/.changeset/fresh-moles-shake.md @@ -0,0 +1,16 @@ +--- +'@react-spring/types': patch +'@react-spring/core': patch +'@react-spring/animated': patch +'@react-spring/parallax': patch +'@react-spring/rafz': patch +'react-spring': patch +'@react-spring/shared': patch +'@react-spring/konva': patch +'@react-spring/native': patch +'@react-spring/three': patch +'@react-spring/web': patch +'@react-spring/zdog': patch +--- + +fix types package diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 32e539f416..d87989b4c0 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -21,6 +21,4 @@ export { export { inferTo } from './helpers' export * from './types' -export type { UnknownProps } from '@react-spring/types' -export * from '@react-spring/types/animated' -export * from '@react-spring/types/interpolation' +export * from '@react-spring/types' diff --git a/packages/types/animated.js b/packages/types/animated.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/types/index.js b/packages/types/index.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/types/interpolation.js b/packages/types/interpolation.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/types/package.json b/packages/types/package.json index 476b7773eb..2a6e92d53f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,8 +2,14 @@ "name": "@react-spring/types", "version": "9.7.0", "description": "Internal package with TypeScript stuff", - "main": "index.js", - "types": "index.d.ts", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "files": [ + "dist/*", + "README.md", + "LICENSE" + ], "repository": "pmndrs/react-spring", "homepage": "https://github.com/pmndrs/react-spring#readme", "keywords": [ @@ -21,5 +27,9 @@ "author": "Paul Henschel", "maintainers": [ "Josh Ellis (https://github.com/joshuaellis)" - ] + ], + "scripts": { + "build": "tsup", + "dev": "tsup" + } } diff --git a/packages/types/animated.d.ts b/packages/types/src/animated.ts similarity index 100% rename from packages/types/animated.d.ts rename to packages/types/src/animated.ts diff --git a/packages/types/index.d.ts b/packages/types/src/index.ts similarity index 71% rename from packages/types/index.d.ts rename to packages/types/src/index.ts index 1f9a0ebef0..6156b86b43 100644 --- a/packages/types/index.d.ts +++ b/packages/types/src/index.ts @@ -1,3 +1,3 @@ export * from './animated' export * from './interpolation' -export * from './util' +export * from './utils' diff --git a/packages/types/interpolation.d.ts b/packages/types/src/interpolation.ts similarity index 98% rename from packages/types/interpolation.d.ts rename to packages/types/src/interpolation.ts index de35fbe6fe..439f7d2fd7 100644 --- a/packages/types/interpolation.d.ts +++ b/packages/types/src/interpolation.ts @@ -1,4 +1,4 @@ -import { Arrify, Constrain } from './util' +import { Arrify, Constrain } from './utils' import { Animatable } from './animated' export type EasingFunction = (t: number) => number diff --git a/packages/types/util.d.ts b/packages/types/src/utils.ts similarity index 99% rename from packages/types/util.d.ts rename to packages/types/src/utils.ts index 918910abe5..7fe4a2d761 100644 --- a/packages/types/util.d.ts +++ b/packages/types/src/utils.ts @@ -92,6 +92,7 @@ export interface UnknownProps extends Lookup {} /** Use `[T] extends [Any]` to know if a type parameter is `any` */ export class Any { + // @ts-ignore private _: never } diff --git a/packages/types/tsup.config.ts b/packages/types/tsup.config.ts new file mode 100644 index 0000000000..7ffdb6d887 --- /dev/null +++ b/packages/types/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'tsup' +import { defaultConfig } from '../../tsup.config.base' + +export default defineConfig(opts => { + return defaultConfig( + { + entry: ['src/index.ts'], + outDir: 'dist', + }, + opts + ) +}) diff --git a/scripts/version-and-publish.sh b/scripts/version-and-publish.sh index 198be0ad81..4f385b7df2 100755 --- a/scripts/version-and-publish.sh +++ b/scripts/version-and-publish.sh @@ -18,9 +18,6 @@ if [[ -z "$distTag" ]]; then read -r distTag fi - -echo "$version" - # publish packages ./node_modules/.bin/changeset version --snapshot "$version" ./node_modules/.bin/changeset publish --no-git-tag --snapshot --tag "$distTag" From db7461882bb2bb9fa1ba97703270fec4533e5b58 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Sat, 25 Feb 2023 17:39:09 +0000 Subject: [PATCH 2/5] chore: add exports to package.json --- .changeset/warm-schools-sell.md | 16 ++++++++++++++++ packages/animated/package.json | 8 ++++++++ packages/core/package.json | 8 ++++++++ packages/parallax/package.json | 8 ++++++++ packages/rafz/package.json | 8 ++++++++ packages/react-spring/package.json | 8 ++++++++ packages/shared/package.json | 8 ++++++++ packages/types/package.json | 8 ++++++++ targets/konva/package.json | 8 ++++++++ targets/native/package.json | 8 ++++++++ targets/three/package.json | 8 ++++++++ targets/web/package.json | 8 ++++++++ targets/zdog/package.json | 8 ++++++++ 13 files changed, 112 insertions(+) create mode 100644 .changeset/warm-schools-sell.md diff --git a/.changeset/warm-schools-sell.md b/.changeset/warm-schools-sell.md new file mode 100644 index 0000000000..2d099b31be --- /dev/null +++ b/.changeset/warm-schools-sell.md @@ -0,0 +1,16 @@ +--- +'react-spring': patch +'@react-spring/animated': patch +'@react-spring/parallax': patch +'@react-spring/shared': patch +'@react-spring/types': patch +'@react-spring/native': patch +'@react-spring/core': patch +'@react-spring/rafz': patch +'@react-spring/konva': patch +'@react-spring/three': patch +'@react-spring/zdog': patch +'@react-spring/web': patch +--- + +chore: add exports to package.json diff --git a/packages/animated/package.json b/packages/animated/package.json index 3cbde1a188..17ead4a194 100644 --- a/packages/animated/package.json +++ b/packages/animated/package.json @@ -5,6 +5,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/core/package.json b/packages/core/package.json index caf44a1e50..cc088f8cc7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/parallax/package.json b/packages/parallax/package.json index eb81b70225..7681548648 100644 --- a/packages/parallax/package.json +++ b/packages/parallax/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/rafz/package.json b/packages/rafz/package.json index 2f1d17bfa2..d58b603517 100644 --- a/packages/rafz/package.json +++ b/packages/rafz/package.json @@ -5,6 +5,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/react-spring/package.json b/packages/react-spring/package.json index d9f571518d..90ffb15dcc 100644 --- a/packages/react-spring/package.json +++ b/packages/react-spring/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/shared/package.json b/packages/shared/package.json index 9d683fed69..36c86a3a66 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -5,6 +5,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/packages/types/package.json b/packages/types/package.json index 2a6e92d53f..41fe0da119 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -5,6 +5,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/targets/konva/package.json b/targets/konva/package.json index 1097d9a72b..bc45757d0f 100644 --- a/targets/konva/package.json +++ b/targets/konva/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/targets/native/package.json b/targets/native/package.json index 596059169c..bf3599c56c 100644 --- a/targets/native/package.json +++ b/targets/native/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/targets/three/package.json b/targets/three/package.json index f39092c7f5..03b2aef8ac 100644 --- a/targets/three/package.json +++ b/targets/three/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/targets/web/package.json b/targets/web/package.json index 55ec980f73..28008d84ac 100644 --- a/targets/web/package.json +++ b/targets/web/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", diff --git a/targets/zdog/package.json b/targets/zdog/package.json index a80a638e1a..f698b9392f 100644 --- a/targets/zdog/package.json +++ b/targets/zdog/package.json @@ -4,6 +4,14 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, "files": [ "dist/*", "README.md", From b13152991101c4b7adc41eba4f10e8d155511bbe Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Sat, 25 Feb 2023 17:45:00 +0000 Subject: [PATCH 3/5] fix: swap types to be first as ruled by ts --- packages/animated/package.json | 4 ++-- packages/core/package.json | 4 ++-- packages/parallax/package.json | 4 ++-- packages/rafz/package.json | 4 ++-- packages/react-spring/package.json | 4 ++-- packages/shared/package.json | 4 ++-- packages/types/package.json | 4 ++-- targets/konva/package.json | 4 ++-- targets/native/package.json | 4 ++-- targets/three/package.json | 4 ++-- targets/web/package.json | 4 ++-- targets/zdog/package.json | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/animated/package.json b/packages/animated/package.json index 17ead4a194..a3a62c2e84 100644 --- a/packages/animated/package.json +++ b/packages/animated/package.json @@ -7,9 +7,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/core/package.json b/packages/core/package.json index cc088f8cc7..e42b9e08f3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/parallax/package.json b/packages/parallax/package.json index 7681548648..caf0f1be64 100644 --- a/packages/parallax/package.json +++ b/packages/parallax/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/rafz/package.json b/packages/rafz/package.json index d58b603517..43e4b77383 100644 --- a/packages/rafz/package.json +++ b/packages/rafz/package.json @@ -7,9 +7,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/react-spring/package.json b/packages/react-spring/package.json index 90ffb15dcc..2236c6d677 100644 --- a/packages/react-spring/package.json +++ b/packages/react-spring/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/shared/package.json b/packages/shared/package.json index 36c86a3a66..7abab7ca2d 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -7,9 +7,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/packages/types/package.json b/packages/types/package.json index 41fe0da119..2180338815 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -7,9 +7,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/targets/konva/package.json b/targets/konva/package.json index bc45757d0f..dd81be3085 100644 --- a/targets/konva/package.json +++ b/targets/konva/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/targets/native/package.json b/targets/native/package.json index bf3599c56c..5c15dc69ee 100644 --- a/targets/native/package.json +++ b/targets/native/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/targets/three/package.json b/targets/three/package.json index 03b2aef8ac..8df4160cf4 100644 --- a/targets/three/package.json +++ b/targets/three/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/targets/web/package.json b/targets/web/package.json index 28008d84ac..056361a6ec 100644 --- a/targets/web/package.json +++ b/targets/web/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, diff --git a/targets/zdog/package.json b/targets/zdog/package.json index f698b9392f..2feadc3c7f 100644 --- a/targets/zdog/package.json +++ b/targets/zdog/package.json @@ -6,9 +6,9 @@ "types": "dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "require": "./dist/index.js" }, "./package.json": "./package.json" }, From fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Mon, 27 Feb 2023 08:03:48 +0000 Subject: [PATCH 4/5] chore: use legacy-ouput for packages --- packages/animated/package.json | 4 ++-- packages/core/package.json | 4 ++-- packages/parallax/package.json | 4 ++-- packages/rafz/package.json | 4 ++-- packages/react-spring/package.json | 4 ++-- packages/shared/package.json | 4 ++-- packages/types/package.json | 4 ++-- targets/konva/package.json | 4 ++-- targets/native/package.json | 4 ++-- targets/three/package.json | 4 ++-- targets/web/package.json | 4 ++-- targets/zdog/package.json | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/animated/package.json b/packages/animated/package.json index a3a62c2e84..64093a8893 100644 --- a/packages/animated/package.json +++ b/packages/animated/package.json @@ -8,7 +8,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -37,7 +37,7 @@ "Josh Ellis (https://github.com/joshuaellis)" ], "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" }, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index e42b9e08f3..ff47a84b48 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -40,7 +40,7 @@ "Josh Ellis (https://github.com/joshuaellis)" ], "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" }, "dependencies": { diff --git a/packages/parallax/package.json b/packages/parallax/package.json index caf0f1be64..83320f6597 100644 --- a/packages/parallax/package.json +++ b/packages/parallax/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -36,7 +36,7 @@ "Josh Ellis (https://github.com/joshuaellis)" ], "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup", "test": "vite serve ./test" }, diff --git a/packages/rafz/package.json b/packages/rafz/package.json index 43e4b77383..7998dad4c6 100644 --- a/packages/rafz/package.json +++ b/packages/rafz/package.json @@ -8,7 +8,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -34,7 +34,7 @@ "license": "MIT", "author": "Josh Ellis", "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/packages/react-spring/package.json b/packages/react-spring/package.json index 2236c6d677..0b74ec975f 100644 --- a/packages/react-spring/package.json +++ b/packages/react-spring/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -48,7 +48,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/packages/shared/package.json b/packages/shared/package.json index 7abab7ca2d..f7e5c9e0f8 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -8,7 +8,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -44,7 +44,7 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/packages/types/package.json b/packages/types/package.json index 2180338815..b03e235bf9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -8,7 +8,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -37,7 +37,7 @@ "Josh Ellis (https://github.com/joshuaellis)" ], "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/targets/konva/package.json b/targets/konva/package.json index dd81be3085..0c791ffbfd 100644 --- a/targets/konva/package.json +++ b/targets/konva/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -47,7 +47,7 @@ "react-konva": "^16.8.0 || ^16.8.7-0 || ^16.9.0-0 || ^16.10.1-0 || ^16.12.0-0 || ^16.13.0-0 || ^17.0.0-0 || ^17.0.1-0 || ^17.0.2-0 || ^18.0.0-0" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/targets/native/package.json b/targets/native/package.json index 5c15dc69ee..5fbe1af959 100644 --- a/targets/native/package.json +++ b/targets/native/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -46,7 +46,7 @@ "react-native": ">=0.58" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/targets/three/package.json b/targets/three/package.json index 8df4160cf4..3842072437 100644 --- a/targets/three/package.json +++ b/targets/three/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -47,7 +47,7 @@ "three": ">=0.126" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/targets/web/package.json b/targets/web/package.json index 056361a6ec..65ed5d2e5a 100644 --- a/targets/web/package.json +++ b/targets/web/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -46,7 +46,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } diff --git a/targets/zdog/package.json b/targets/zdog/package.json index 2feadc3c7f..1cc26f87e8 100644 --- a/targets/zdog/package.json +++ b/targets/zdog/package.json @@ -7,7 +7,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", + "import": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" @@ -48,7 +48,7 @@ "zdog": ">=1.0" }, "scripts": { - "build": "tsup", + "build": "tsup --legacy-output", "dev": "tsup" } } From 40ac9039be0c657954e31ea7588bee4abbf1df1f Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Mon, 27 Feb 2023 08:13:13 +0000 Subject: [PATCH 5/5] chore: use module for webpack 4 --- packages/animated/package.json | 3 ++- packages/core/package.json | 3 ++- packages/parallax/package.json | 3 ++- packages/rafz/package.json | 3 ++- packages/react-spring/package.json | 3 ++- packages/shared/package.json | 3 ++- packages/types/package.json | 3 ++- targets/konva/package.json | 3 ++- targets/native/package.json | 3 ++- targets/three/package.json | 3 ++- targets/web/package.json | 3 ++- targets/zdog/package.json | 3 ++- 12 files changed, 24 insertions(+), 12 deletions(-) diff --git a/packages/animated/package.json b/packages/animated/package.json index 64093a8893..f88ae27372 100644 --- a/packages/animated/package.json +++ b/packages/animated/package.json @@ -3,12 +3,13 @@ "version": "9.7.0", "description": "Animated component props for React", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/core/package.json b/packages/core/package.json index ff47a84b48..a1e3262c85 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/core", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/parallax/package.json b/packages/parallax/package.json index 83320f6597..00b4fc7572 100644 --- a/packages/parallax/package.json +++ b/packages/parallax/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/parallax", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/rafz/package.json b/packages/rafz/package.json index 7998dad4c6..ab85123b15 100644 --- a/packages/rafz/package.json +++ b/packages/rafz/package.json @@ -3,12 +3,13 @@ "version": "9.7.0", "description": "react-spring's fork of rafz one frameloop to rule them all", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/react-spring/package.json b/packages/react-spring/package.json index 0b74ec975f..bb7f047baf 100644 --- a/packages/react-spring/package.json +++ b/packages/react-spring/package.json @@ -2,12 +2,13 @@ "name": "react-spring", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/shared/package.json b/packages/shared/package.json index f7e5c9e0f8..c1f7c7259a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -3,12 +3,13 @@ "version": "9.7.0", "description": "Globals and shared modules", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/packages/types/package.json b/packages/types/package.json index b03e235bf9..74d728ef63 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -3,12 +3,13 @@ "version": "9.7.0", "description": "Internal package with TypeScript stuff", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/targets/konva/package.json b/targets/konva/package.json index 0c791ffbfd..829d64a6a2 100644 --- a/targets/konva/package.json +++ b/targets/konva/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/konva", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/targets/native/package.json b/targets/native/package.json index 5fbe1af959..04757f0bd7 100644 --- a/targets/native/package.json +++ b/targets/native/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/native", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/targets/three/package.json b/targets/three/package.json index 3842072437..c8c9e3deaa 100644 --- a/targets/three/package.json +++ b/targets/three/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/three", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/targets/web/package.json b/targets/web/package.json index 65ed5d2e5a..08ec79a425 100644 --- a/targets/web/package.json +++ b/targets/web/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/web", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json" diff --git a/targets/zdog/package.json b/targets/zdog/package.json index 1cc26f87e8..ed5a06f2c5 100644 --- a/targets/zdog/package.json +++ b/targets/zdog/package.json @@ -2,12 +2,13 @@ "name": "@react-spring/zdog", "version": "9.7.0", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/esm/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", + "module": "./dist/esm/index.js", "require": "./dist/index.js" }, "./package.json": "./package.json"