Skip to content

Commit 8d469df

Browse files
committed
fix: module resolution
1 parent b6ed055 commit 8d469df

File tree

4 files changed

+67
-14
lines changed

4 files changed

+67
-14
lines changed

package.json

+32-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
{
22
"name": "@animatereactnative/accordion",
3-
"version": "0.1.4",
3+
"version": "0.1.2",
44
"description": "A React Native Accordion component, powered by React Native Reanimated layout animation that's capable of rendering and animating content that has a dynamic height.",
5-
"main": "lib/commonjs/index",
6-
"module": "lib/module/index",
7-
"types": "lib/typescript/src/index.d.ts",
8-
"react-native": "src/index",
9-
"source": "src/index",
5+
"source": "./src/index.tsx",
6+
"main": "./lib/commonjs/index.js",
7+
"module": "./lib/module/index.js",
8+
"types": "./lib/typescript/module/src/index.d.ts",
9+
"exports": {
10+
".": {
11+
"import": {
12+
"types": "./lib/typescript/module/src/index.d.ts",
13+
"default": "./lib/module/index.js"
14+
},
15+
"require": {
16+
"types": "./lib/typescript/commonjs/src/index.d.ts",
17+
"default": "./lib/commonjs/index.js"
18+
}
19+
}
20+
},
1021
"files": [
1122
"src",
1223
"lib",
@@ -70,7 +81,7 @@
7081
"prettier": "^3.0.3",
7182
"react": "18.3.1",
7283
"react-native": "0.76.2",
73-
"react-native-builder-bob": "^0.32.1",
84+
"react-native-builder-bob": "^0.35.2",
7485
"react-native-reanimated": "^3.16.2",
7586
"release-it": "^17.10.0",
7687
"typescript": "^5.2.2"
@@ -146,12 +157,23 @@
146157
"source": "src",
147158
"output": "lib",
148159
"targets": [
149-
"commonjs",
150-
"module",
160+
[
161+
"commonjs",
162+
{
163+
"esm": true
164+
}
165+
],
166+
[
167+
"module",
168+
{
169+
"esm": true
170+
}
171+
],
151172
[
152173
"typescript",
153174
{
154-
"project": "tsconfig.build.json"
175+
"project": "tsconfig.build.json",
176+
"esm": true
155177
}
156178
]
157179
]

tsconfig.build.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"extends": "./tsconfig",
3-
"exclude": ["example"]
3+
"exclude": ["example", "lib"]
44
}

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": "./",
43
"rootDir": ".",
54
"paths": {
65
"@animatereactnative/accordion": ["./src/index"]
@@ -12,7 +11,7 @@
1211
"jsx": "react-jsx",
1312
"lib": ["ESNext"],
1413
"module": "ESNext",
15-
"moduleResolution": "node",
14+
"moduleResolution": "Bundler",
1615
"noEmit": true,
1716
"noFallthroughCasesInSwitch": true,
1817
"noImplicitReturns": true,

yarn.lock

+33-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ __metadata:
6666
prettier: ^3.0.3
6767
react: 18.3.1
6868
react-native: 0.76.2
69-
react-native-builder-bob: ^0.32.1
69+
react-native-builder-bob: ^0.35.2
7070
react-native-reanimated: ^3.16.2
7171
release-it: ^17.10.0
7272
typescript: ^5.2.2
@@ -11813,6 +11813,38 @@ __metadata:
1181311813
languageName: node
1181411814
linkType: hard
1181511815

11816+
"react-native-builder-bob@npm:^0.35.2":
11817+
version: 0.35.2
11818+
resolution: "react-native-builder-bob@npm:0.35.2"
11819+
dependencies:
11820+
"@babel/core": ^7.25.2
11821+
"@babel/plugin-transform-strict-mode": ^7.24.7
11822+
"@babel/preset-env": ^7.25.2
11823+
"@babel/preset-flow": ^7.24.7
11824+
"@babel/preset-react": ^7.24.7
11825+
"@babel/preset-typescript": ^7.24.7
11826+
babel-plugin-module-resolver: ^5.0.2
11827+
browserslist: ^4.20.4
11828+
cosmiconfig: ^9.0.0
11829+
cross-spawn: ^7.0.3
11830+
dedent: ^0.7.0
11831+
del: ^6.1.1
11832+
escape-string-regexp: ^4.0.0
11833+
fs-extra: ^10.1.0
11834+
glob: ^8.0.3
11835+
is-git-dirty: ^2.0.1
11836+
json5: ^2.2.1
11837+
kleur: ^4.1.4
11838+
metro-config: ^0.80.9
11839+
prompts: ^2.4.2
11840+
which: ^2.0.2
11841+
yargs: ^17.5.1
11842+
bin:
11843+
bob: bin/bob
11844+
checksum: 254a481e35e359391d249a89aaea8b334479f6bec5c55b840dd05ae48e7733237e2e47a07d27e1132c25b39a1a9b330f2c1e706622b0a00ba4dfcec8183efa56
11845+
languageName: node
11846+
linkType: hard
11847+
1181611848
"react-native-reanimated@npm:^3.16.2, react-native-reanimated@npm:~3.16.1":
1181711849
version: 3.16.2
1181811850
resolution: "react-native-reanimated@npm:3.16.2"

0 commit comments

Comments
 (0)