Skip to content

Commit c5f7b64

Browse files
committed
chore: improve package export
1 parent d54a496 commit c5f7b64

File tree

4 files changed

+33
-35
lines changed

4 files changed

+33
-35
lines changed

.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

android/build.gradle

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@ buildscript {
2929
}
3030
}
3131

32-
def isNewArchitectureEnabled() {
33-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
34-
}
35-
3632
apply plugin: "com.android.library"
3733
apply plugin: "kotlin-android"
3834

39-
if (isNewArchitectureEnabled()) {
40-
apply plugin: "com.facebook.react"
41-
}
35+
apply plugin: "com.facebook.react"
4236

4337
def getExtOrIntegerDefault(name) {
4438
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["react_native_navigation_sdk_" + name]).toInteger()
@@ -69,7 +63,6 @@ android {
6963
defaultConfig {
7064
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
7165
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
72-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
7366
}
7467

7568
buildFeatures {
@@ -88,12 +81,10 @@ android {
8881

8982
sourceSets {
9083
main {
91-
if (isNewArchitectureEnabled()) {
92-
java.srcDirs += [
93-
"generated/java",
94-
"generated/jni"
95-
]
96-
}
84+
java.srcDirs += [
85+
"generated/java",
86+
"generated/jni"
87+
]
9788
}
9889
}
9990
}
@@ -122,10 +113,8 @@ dependencies {
122113
api 'com.google.guava:guava:31.0.1-android'
123114
}
124115

125-
if (isNewArchitectureEnabled()) {
126-
react {
127-
jsRootDir = file("../src/")
128-
libraryName = "ReactNativeNavigationSdk"
129-
codegenJavaPackageName = "com.google.maps.android.rn.navsdk"
130-
}
131-
}
116+
react {
117+
jsRootDir = file("../src/")
118+
libraryName = "ReactNativeNavigationSdk"
119+
codegenJavaPackageName = "com.google.maps.android.rn.navsdk"
120+
}

babel.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,14 @@
1515
*/
1616

1717
module.exports = {
18-
presets: ['module:react-native-builder-bob/babel-preset'],
18+
overrides: [
19+
{
20+
exclude: /\/node_modules\//,
21+
presets: ['module:react-native-builder-bob/babel-preset'],
22+
},
23+
{
24+
include: /\/node_modules\//,
25+
presets: ['module:@react-native/babel-preset'],
26+
},
27+
],
1928
};

package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
"version": "0.9.3",
44
"author": "Google",
55
"description": "A React Native library for Navigation SDK on Google Maps Platform",
6-
"main": "./lib/commonjs/index.js",
7-
"module": "./lib/module/index.js",
6+
"main": "./lib/module/index.js",
87
"types": "./lib/typescript/src/index.d.ts",
9-
"source": "./src/index.tsx",
8+
"exports": {
9+
".": {
10+
"source": "./src/index.tsx",
11+
"types": "./lib/typescript/src/index.d.ts",
12+
"import": "./lib/module/index.js",
13+
"default": "./lib/module/index.js"
14+
},
15+
"./package.json": "./package.json"
16+
},
1017
"files": [
1118
"src",
1219
"lib",
@@ -21,6 +28,9 @@
2128
"!android/gradlew",
2229
"!android/gradlew.bat",
2330
"!android/local.properties",
31+
"!example",
32+
"!coverage",
33+
"!scripts",
2434
"!**/__tests__",
2535
"!**/__fixtures__",
2636
"!**/__mocks__",
@@ -137,12 +147,6 @@
137147
"output": "lib",
138148
"targets": [
139149
"codegen",
140-
[
141-
"commonjs",
142-
{
143-
"esm": true
144-
}
145-
],
146150
[
147151
"module",
148152
{

0 commit comments

Comments
 (0)