Skip to content

Commit 958c2a4

Browse files
authored
fix: esm/cjs exports (#2101)
1 parent 71089c0 commit 958c2a4

File tree

24 files changed

+191
-33
lines changed

24 files changed

+191
-33
lines changed

.changeset/fresh-moles-shake.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@react-spring/types': patch
3+
'@react-spring/core': patch
4+
'@react-spring/animated': patch
5+
'@react-spring/parallax': patch
6+
'@react-spring/rafz': patch
7+
'react-spring': patch
8+
'@react-spring/shared': patch
9+
'@react-spring/konva': patch
10+
'@react-spring/native': patch
11+
'@react-spring/three': patch
12+
'@react-spring/web': patch
13+
'@react-spring/zdog': patch
14+
---
15+
16+
fix types package

.changeset/warm-schools-sell.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'react-spring': patch
3+
'@react-spring/animated': patch
4+
'@react-spring/parallax': patch
5+
'@react-spring/shared': patch
6+
'@react-spring/types': patch
7+
'@react-spring/native': patch
8+
'@react-spring/core': patch
9+
'@react-spring/rafz': patch
10+
'@react-spring/konva': patch
11+
'@react-spring/three': patch
12+
'@react-spring/zdog': patch
13+
'@react-spring/web': patch
14+
---
15+
16+
chore: add exports to package.json

packages/animated/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
"version": "9.7.0",
44
"description": "Animated component props for React",
55
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
6+
"module": "dist/esm/index.js",
77
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/esm/index.js",
12+
"module": "./dist/esm/index.js",
13+
"require": "./dist/index.js"
14+
},
15+
"./package.json": "./package.json"
16+
},
817
"files": [
918
"dist/*",
1019
"README.md",
@@ -29,7 +38,7 @@
2938
"Josh Ellis (https://github.com/joshuaellis)"
3039
],
3140
"scripts": {
32-
"build": "tsup",
41+
"build": "tsup --legacy-output",
3342
"dev": "tsup"
3443
},
3544
"dependencies": {

packages/core/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
"name": "@react-spring/core",
33
"version": "9.7.0",
44
"main": "dist/index.js",
5-
"module": "dist/index.mjs",
5+
"module": "dist/esm/index.js",
66
"types": "dist/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/esm/index.js",
11+
"module": "./dist/esm/index.js",
12+
"require": "./dist/index.js"
13+
},
14+
"./package.json": "./package.json"
15+
},
716
"files": [
817
"dist/*",
918
"README.md",
@@ -32,7 +41,7 @@
3241
"Josh Ellis (https://github.com/joshuaellis)"
3342
],
3443
"scripts": {
35-
"build": "tsup",
44+
"build": "tsup --legacy-output",
3645
"dev": "tsup"
3746
},
3847
"dependencies": {

packages/core/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ export {
2121
export { inferTo } from './helpers'
2222

2323
export * from './types'
24-
export type { UnknownProps } from '@react-spring/types'
25-
export * from '@react-spring/types/animated'
26-
export * from '@react-spring/types/interpolation'
24+
export * from '@react-spring/types'

packages/parallax/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
"name": "@react-spring/parallax",
33
"version": "9.7.0",
44
"main": "dist/index.js",
5-
"module": "dist/index.mjs",
5+
"module": "dist/esm/index.js",
66
"types": "dist/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/esm/index.js",
11+
"module": "./dist/esm/index.js",
12+
"require": "./dist/index.js"
13+
},
14+
"./package.json": "./package.json"
15+
},
716
"files": [
817
"dist/*",
918
"README.md",
@@ -28,7 +37,7 @@
2837
"Josh Ellis (https://github.com/joshuaellis)"
2938
],
3039
"scripts": {
31-
"build": "tsup",
40+
"build": "tsup --legacy-output",
3241
"dev": "tsup",
3342
"test": "vite serve ./test"
3443
},

packages/rafz/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
"version": "9.7.0",
44
"description": "react-spring's fork of rafz one frameloop to rule them all",
55
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
6+
"module": "dist/esm/index.js",
77
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/esm/index.js",
12+
"module": "./dist/esm/index.js",
13+
"require": "./dist/index.js"
14+
},
15+
"./package.json": "./package.json"
16+
},
817
"files": [
918
"dist/*",
1019
"README.md",
@@ -26,7 +35,7 @@
2635
"license": "MIT",
2736
"author": "Josh Ellis",
2837
"scripts": {
29-
"build": "tsup",
38+
"build": "tsup --legacy-output",
3039
"dev": "tsup"
3140
}
3241
}

packages/react-spring/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
"name": "react-spring",
33
"version": "9.7.0",
44
"main": "dist/index.js",
5-
"module": "dist/index.mjs",
5+
"module": "dist/esm/index.js",
66
"types": "dist/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/esm/index.js",
11+
"module": "./dist/esm/index.js",
12+
"require": "./dist/index.js"
13+
},
14+
"./package.json": "./package.json"
15+
},
716
"files": [
817
"dist/*",
918
"README.md",
@@ -40,7 +49,7 @@
4049
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
4150
},
4251
"scripts": {
43-
"build": "tsup",
52+
"build": "tsup --legacy-output",
4453
"dev": "tsup"
4554
}
4655
}

packages/shared/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
"version": "9.7.0",
44
"description": "Globals and shared modules",
55
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
6+
"module": "dist/esm/index.js",
77
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/esm/index.js",
12+
"module": "./dist/esm/index.js",
13+
"require": "./dist/index.js"
14+
},
15+
"./package.json": "./package.json"
16+
},
817
"files": [
918
"dist/*",
1019
"README.md",
@@ -36,7 +45,7 @@
3645
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
3746
},
3847
"scripts": {
39-
"build": "tsup",
48+
"build": "tsup --legacy-output",
4049
"dev": "tsup"
4150
}
4251
}

packages/types/animated.js

Whitespace-only changes.

0 commit comments

Comments
 (0)