diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index 5519aa44fe..64266ecd24 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -59,24 +59,15 @@ jobs: # yarn3+ by default disables lockfile alteration in CI. We want it. YARN_ENABLE_IMMUTABLE_INSTALLS: false run: | - PACKAGE_LIST=`find packages -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | egrep -v 'template|invites'` - mkdir $HOME/packages - for PACKAGE in $PACKAGE_LIST; do - echo "Packing PR version of package $PACKAGE" - pushd packages/$PACKAGE; - yarn pack; - mv package.tgz $HOME/packages/react-native-firebase-${PACKAGE}.tgz; - ls -la $HOME/packages/*${PACKAGE}* - popd; - done - ls -la $HOME/packages/ + ./.github/workflows/scripts/create_npm_packages.sh ./packages $HOME/packages cd $HOME npx @react-native-community/cli init template --skip-install --skip-git-init cd template yarn yarn add patch-package --dev mkdir patches || true - for PACKAGE in $PACKAGE_LIST; do + PACKED_PACKAGE_LIST=`find $HOME/packages/ -maxdepth 1 -mindepth 1 -type f -exec basename -s .tgz {} \; | cut -d'-' -f4-10 | sort` + for PACKAGE in $PACKED_PACKAGE_LIST; do echo "Installing package $PACKAGE into fresh template app, then clobbering with PR version" yarn add @react-native-firebase/$PACKAGE || true if [ -d node_modules/@react-native-firebase/$PACKAGE ]; then diff --git a/.github/workflows/scripts/create_npm_packages.sh b/.github/workflows/scripts/create_npm_packages.sh new file mode 100755 index 0000000000..a210c0b0ad --- /dev/null +++ b/.github/workflows/scripts/create_npm_packages.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +SOURCE_PACKAGE_DIR="$1" +TARGET_PACKAGE_DIR="$2" + +echo "Creating local npm packages from source '${SOURCE_PACKAGE_DIR}' in '${TARGET_PACKAGE_DIR}'..." + +# Make sure our target directory exists and is clean from previous runs +if ! [ -d "${TARGET_PACKAGE_DIR}" ]; then + mkdir "${TARGET_PACKAGE_DIR}" +else + rm -f "${TARGET_PACKAGE_DIR}"/*.tgz +fi + +if ! [ -d "${SOURCE_PACKAGE_DIR}" ]; then + echo "Source package dir '${SOURCE_PACKAGE_DIR} not found." + exit 1; +fi + +# Get our full list of packages, except any we specifically ignore +IGNORED_PACKAGE_NAMES='template|invites' +PACKAGE_LIST=`find ${SOURCE_PACKAGE_DIR} -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | egrep -v "${IGNORED_PACKAGE_NAMES}"` + +# Pack up each package +for PACKAGE in $PACKAGE_LIST; do + echo "Creating package for $PACKAGE from local source" + pushd "${SOURCE_PACKAGE_DIR}/${PACKAGE}"; + yarn pack; + mv package.tgz "${TARGET_PACKAGE_DIR}/react-native-firebase-${PACKAGE}.tgz"; + ls -la "${TARGET_PACKAGE_DIR}/react-native-firebase-${PACKAGE}.tgz" + popd; +done +ls -la "${TARGET_PACKAGE_DIR}" \ No newline at end of file diff --git a/packages/ai/package.json b/packages/ai/package.json index e2f6823f7a..0e2a42ed7f 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -3,13 +3,12 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - Firebase AI is a fully-managed, unified AI development platform for building and using generative AI", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/module/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf dist", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn tests:ai:mocks && yarn run build && yarn compile" }, "repository": { @@ -41,18 +40,6 @@ "typescript": "^5.9.3" }, "source": "./lib/index.ts", - "exports": { - ".": { - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } - }, "files": [ "lib", "dist", @@ -64,12 +51,6 @@ "source": "lib", "output": "dist", "targets": [ - [ - "commonjs", - { - "esm": true - } - ], [ "module", { diff --git a/packages/ai/tsconfig.json b/packages/ai/tsconfig.json index 3bb2d31285..837c336e3e 100644 --- a/packages/ai/tsconfig.json +++ b/packages/ai/tsconfig.json @@ -22,18 +22,18 @@ "strict": true, "baseUrl": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"], + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"], "@react-native-firebase/auth": ["../auth/lib"], - "@react-native-firebase/app-check": ["../app-check/dist/typescript/commonjs/lib"] + "@react-native-firebase/app-check": ["../app-check/dist/typescript/lib"] } }, "include": ["lib/**/*"], diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 1f593ba813..fa9dbb1c93 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -3,13 +3,12 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - The analytics module provides out of the box support with Google Analytics for Firebase. Integration with the Android & iOS allows for in-depth analytical insight reporting, such as device information, location, user actions and more.", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf android/build && rimraf ios/build", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn compile" }, "repository": { @@ -36,20 +35,6 @@ "devDependencies": { "react-native-builder-bob": "^0.40.17" }, - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./package.json": "./package.json" - }, "react-native-builder-bob": { "source": "lib", "output": "dist", @@ -60,12 +45,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/analytics/tsconfig.json b/packages/analytics/tsconfig.json index 58755dcb00..c4718e291a 100644 --- a/packages/analytics/tsconfig.json +++ b/packages/analytics/tsconfig.json @@ -4,16 +4,16 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"] + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"] } }, "include": ["lib/**/*"], diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 821d375108..02753478c7 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -3,15 +3,14 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - App Check", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf android/build && rimraf ios/build", "build:plugin": "rimraf plugin/build && tsc --build plugin", "lint:plugin": "eslint plugin/src/*", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn compile && yarn run build:plugin" }, "repository": { @@ -44,21 +43,6 @@ "access": "public", "provenance": true }, - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./app.plugin.js": "./app.plugin.js", - "./package.json": "./package.json" - }, "react-native-builder-bob": { "source": "lib", "output": "dist", @@ -69,12 +53,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/app-check/tsconfig.json b/packages/app-check/tsconfig.json index 34992f7207..60b64f7ea3 100644 --- a/packages/app-check/tsconfig.json +++ b/packages/app-check/tsconfig.json @@ -4,16 +4,16 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"] + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"] } }, "include": ["lib/**/*", "../app/lib/internal/global.d.ts"], diff --git a/packages/app/package.json b/packages/app/package.json index 121afc6ca3..3f54074833 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -3,16 +3,15 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts && npm run build:version", "build:version": "node ./scripts/genversion-ios && node ./scripts/genversion-android", "build:clean": "rimraf android/build && rimraf ios/build", "build:plugin": "rimraf plugin/build && tsc --build plugin", "lint:plugin": "eslint plugin/src/*", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "npm run build && npm run build:plugin && npm run compile" }, "repository": { @@ -53,65 +52,6 @@ "dynamic-links", "crashlytics" ], - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./lib/internal": { - "source": "./lib/internal/index.ts", - "import": { - "types": "./dist/typescript/module/lib/internal/index.d.ts", - "default": "./dist/module/internal/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/internal/index.d.ts", - "default": "./dist/commonjs/internal/index.js" - } - }, - "./lib/internal/*": { - "source": "./lib/internal/*.ts", - "import": { - "types": "./dist/typescript/module/lib/internal/*.d.ts", - "default": "./dist/module/internal/*" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/internal/*.d.ts", - "default": "./dist/commonjs/internal/*" - } - }, - "./lib/common": { - "source": "./lib/common/index.ts", - "import": { - "types": "./dist/typescript/module/lib/common/index.d.ts", - "default": "./dist/module/common/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/common/index.d.ts", - "default": "./dist/commonjs/common/index.js" - } - }, - "./lib/common/*": { - "source": "./lib/common/*.ts", - "import": { - "types": "./dist/typescript/module/lib/common/*.d.ts", - "default": "./dist/module/common/*" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/common/*.d.ts", - "default": "./dist/commonjs/common/*" - } - }, - "./app.plugin.js": "./app.plugin.js", - "./package.json": "./package.json" - }, "peerDependencies": { "expo": ">=47.0.0", "react": "*", @@ -164,12 +104,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/crashlytics/package.json b/packages/crashlytics/package.json index 14ee8fa38d..93f59a2072 100644 --- a/packages/crashlytics/package.json +++ b/packages/crashlytics/package.json @@ -3,15 +3,14 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. React Native Firebase provides automatic crash reporting for both native and JavaScript errors, including unhandled promise rejections.", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf android/build && rimraf ios/build", "build:plugin": "rimraf plugin/build && tsc --build plugin", "lint:plugin": "eslint plugin/src/*", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn run build:plugin && yarn compile" }, "repository": { @@ -51,21 +50,6 @@ "access": "public", "provenance": true }, - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./app.plugin.js": "./app.plugin.js", - "./package.json": "./package.json" - }, "react-native-builder-bob": { "source": "lib", "output": "dist", @@ -76,12 +60,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/crashlytics/tsconfig.json b/packages/crashlytics/tsconfig.json index 34992f7207..60b64f7ea3 100644 --- a/packages/crashlytics/tsconfig.json +++ b/packages/crashlytics/tsconfig.json @@ -4,16 +4,16 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"] + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"] } }, "include": ["lib/**/*", "../app/lib/internal/global.d.ts"], diff --git a/packages/functions/package.json b/packages/functions/package.json index 753045840a..3be8406449 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -3,9 +3,8 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. React Native Firebase supports integration with production and locally emulated Cloud Functions with a simple API interface.\n\n", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "codegenConfig": { "name": "NativeRNFBTurboFunctions", "type": "modules", @@ -23,7 +22,7 @@ "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf android/build && rimraf ios/build", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn compile", "codegen": "yarn android:codegen && yarn ios:codegen", "android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/main/java/io/invertase/firebase/functions/generated", @@ -55,20 +54,6 @@ "access": "public", "provenance": true }, - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./package.json": "./package.json" - }, "react-native-builder-bob": { "source": "lib", "output": "dist", @@ -79,12 +64,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/functions/tsconfig.json b/packages/functions/tsconfig.json index 58755dcb00..c4718e291a 100644 --- a/packages/functions/tsconfig.json +++ b/packages/functions/tsconfig.json @@ -4,16 +4,16 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"] + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"] } }, "include": ["lib/**/*"], diff --git a/packages/messaging/package.json b/packages/messaging/package.json index c7e800d769..8ee1ff6f92 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -3,15 +3,14 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - React Native Firebase provides native integration of Firebase Cloud Messaging (FCM) for both Android & iOS. FCM is a cost free service, allowing for server-device and device-device communication. The React Native Firebase Messaging module provides a simple JavaScript API to interact with FCM.", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/commonjs/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf android/build && rimraf ios/build", "build:plugin": "rimraf plugin/build && tsc --build plugin", "lint:plugin": "eslint plugin/src/*", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn compile && yarn run build:plugin" }, "repository": { @@ -43,21 +42,6 @@ "access": "public", "provenance": true }, - "exports": { - ".": { - "source": "./lib/index.ts", - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./app.plugin.js": "./app.plugin.js", - "./package.json": "./package.json" - }, "react-native-builder-bob": { "source": "lib", "output": "dist", @@ -68,12 +52,6 @@ "esm": true } ], - [ - "commonjs", - { - "esm": true - } - ], [ "typescript", { diff --git a/packages/messaging/tsconfig.json b/packages/messaging/tsconfig.json index 6c3c3ebaf0..caa67a0f0b 100644 --- a/packages/messaging/tsconfig.json +++ b/packages/messaging/tsconfig.json @@ -4,16 +4,16 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"] + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"] } }, "include": ["lib/**/*", "../app/lib/internal/global.d.ts"], diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 39e5e4dad7..15f3109573 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -3,13 +3,12 @@ "version": "23.8.3", "author": "Invertase (http://invertase.io)", "description": "React Native Firebase - Vertex AI is a fully-managed, unified AI development platform for building and using generative AI", - "main": "./dist/commonjs/index.js", - "module": "./dist/module/index.js", - "types": "./dist/typescript/module/lib/index.d.ts", + "main": "./dist/module/index.js", + "types": "./dist/typescript/lib/index.d.ts", "scripts": { "build": "genversion --esm --semi lib/version.ts", "build:clean": "rimraf dist", - "compile": "bob build", + "compile": "rimraf dist && bob build", "prepare": "yarn run build && yarn compile" }, "repository": { @@ -44,18 +43,6 @@ "typescript": "^5.9.3" }, "source": "./lib/index.ts", - "exports": { - ".": { - "import": { - "types": "./dist/typescript/module/lib/index.d.ts", - "default": "./dist/module/index.js" - }, - "require": { - "types": "./dist/typescript/commonjs/lib/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } - }, "files": [ "lib", "dist", @@ -67,12 +54,6 @@ "source": "lib", "output": "dist", "targets": [ - [ - "commonjs", - { - "esm": true - } - ], [ "module", { diff --git a/packages/vertexai/tsconfig.json b/packages/vertexai/tsconfig.json index 3bb2d31285..837c336e3e 100644 --- a/packages/vertexai/tsconfig.json +++ b/packages/vertexai/tsconfig.json @@ -22,18 +22,18 @@ "strict": true, "baseUrl": ".", "paths": { - "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/commonjs/lib/common/*"], - "@react-native-firebase/app/lib/common": ["../app/dist/typescript/commonjs/lib/common"], + "@react-native-firebase/app/lib/common/*": ["../app/dist/typescript/lib/common/*"], + "@react-native-firebase/app/lib/common": ["../app/dist/typescript/lib/common"], "@react-native-firebase/app/lib/internal/web/*": [ - "../app/dist/typescript/commonjs/lib/internal/web/*" + "../app/dist/typescript/lib/internal/web/*" ], "@react-native-firebase/app/lib/internal/*": [ - "../app/dist/typescript/commonjs/lib/internal/*" + "../app/dist/typescript/lib/internal/*" ], - "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"], - "@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"], + "@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"], + "@react-native-firebase/app": ["../app/dist/typescript/lib"], "@react-native-firebase/auth": ["../auth/lib"], - "@react-native-firebase/app-check": ["../app-check/dist/typescript/commonjs/lib"] + "@react-native-firebase/app-check": ["../app-check/dist/typescript/lib"] } }, "include": ["lib/**/*"], diff --git a/tests/metro.config.js b/tests/metro.config.js index a3de79d720..4463736889 100644 --- a/tests/metro.config.js +++ b/tests/metro.config.js @@ -62,17 +62,17 @@ const config = { }, ), resolveRequest: (context, moduleName, platform) => { - // For @react-native-firebase/app subpath imports, redirect lib/* to dist/commonjs/* + // For @react-native-firebase/app subpath imports, redirect lib/* to dist/module/* if (moduleName.startsWith('@react-native-firebase/app/lib/')) { const subpath = moduleName.replace('@react-native-firebase/app/lib/', ''); - const newModuleName = `@react-native-firebase/app/dist/commonjs/${subpath}`; + const newModuleName = `@react-native-firebase/app/dist/module/${subpath}`; return context.resolveRequest(context, newModuleName, platform); } - // For @react-native-firebase/app/common/*, redirect to dist/commonjs/common/* + // For @react-native-firebase/app/common/*, redirect to dist/module/common/* if (moduleName.startsWith('@react-native-firebase/app/common/')) { const subpath = moduleName.replace('@react-native-firebase/app/common/', ''); - const newModuleName = `@react-native-firebase/app/dist/commonjs/common/${subpath}`; + const newModuleName = `@react-native-firebase/app/dist/module/common/${subpath}`; return context.resolveRequest(context, newModuleName, platform); }