diff --git a/bun.lock b/bun.lock index 359c96f5..14a30440 100644 --- a/bun.lock +++ b/bun.lock @@ -71,10 +71,10 @@ "name": "react-native-nitro-sqlite-example", "version": "10.2.0", "dependencies": { - "@craftzdog/react-native-buffer": "^6.1.2", "@react-native-clipboard/clipboard": "^1.16.3", "@react-navigation/native": "^7.5.1", "@react-navigation/native-stack": "^7.21.0", + "buffer": "^6.0.3", "chai": "^4.3.7", "chance": "^1.1.9", "events": "^3.3.0", @@ -84,8 +84,6 @@ "react-native-nitro-modules": "*", "react-native-nitro-sqlite": "10.2.0", "react-native-nitro-sqlite-vec": "10.2.0", - "react-native-quick-base64": "^3.0.1", - "react-native-quick-crypto": "^1.1.8", "react-native-safe-area-context": "^5.10.1", "react-native-screens": "^4.30.0", "reflect-metadata": "^0.2.2", @@ -458,8 +456,6 @@ "@conventional-commits/parser": ["@conventional-commits/parser@0.4.1", "", { "dependencies": { "unist-util-visit": "^2.0.3", "unist-util-visit-parents": "^3.1.1" } }, "sha512-H2ZmUVt6q+KBccXfMBhbBF14NlANeqHTXL4qCL6QGbMzrc4HDXyzWuxPxPNbz71f/5UkR5DrycP5VO9u7crahg=="], - "@craftzdog/react-native-buffer": ["@craftzdog/react-native-buffer@6.1.2", "", { "dependencies": { "ieee754": "^1.2.1", "react-native-quick-base64": "^3.0.0" } }, "sha512-KV1HitN05FHLLDG7Zb/yftDsa+mKBYBzFMQ0PMldvUicq6vWOtAvz9mDavt7Fzozh+WNqORE+yFDkkdWysZ/SA=="], - "@emnapi/core": ["@emnapi/core@1.7.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "sha512-pJdKGq/1iquWYtv1RRSljZklxHCOCAJFJrImO5ZLKPJVJlVUcs8yFwNQlqS0Lo8xT1VAXXTCZocF9n26FWEKsw=="], "@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], @@ -2592,10 +2588,6 @@ "react-native-nitro-sqlite-vec": ["react-native-nitro-sqlite-vec@workspace:packages/react-native-nitro-sqlite-vec"], - "react-native-quick-base64": ["react-native-quick-base64@3.0.1", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-EjUP2U7WqKmlMmoY7XGyHomy8bM0q4+yCDCRg4ZezQ6zedYRwc7yVk4V2O/iSftKaLEzhuW98lpyPMdk1iPHXQ=="], - - "react-native-quick-crypto": ["react-native-quick-crypto@1.1.8", "", { "dependencies": { "@craftzdog/react-native-buffer": "^6.1.2", "events": "3.3.0", "readable-stream": "4.7.0", "safe-buffer": "^5.2.1", "string_decoder": "^1.3.0", "util": "0.12.5" }, "peerDependencies": { "expo": ">=48.0.0", "react": "*", "react-native": "*", "react-native-nitro-modules": ">=0.31.2", "react-native-quick-base64": ">=3.0.0" }, "optionalPeers": ["expo"] }, "sha512-KJ96J3XsRtw3RpFgi8nJTBWhIuB5/g87XOMlyHMGHsOjLsE5C6FLEfBTJOGaab/i0EGC0NMrUK63+SR5wsj+Lw=="], - "react-native-safe-area-context": ["react-native-safe-area-context@5.10.1", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-ax0T3cAHQIhuAjDQpJ9C1Le96aRiM9PF+Kmgg7Y8+mD7QJMEIx04cG0eG3EGUTdvymgOkCrkakgZFwuOIuNQGw=="], "react-native-screens": ["react-native-screens@4.30.0", "", { "dependencies": { "react-freeze": "^1.0.0", "warn-once": "^0.1.0" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-FrZG/Q5gqoDu0SgP4d2Ly0qdio5DR1KdGPEYImhkz7tmrhpML4C39m6RYLGd5TVLHZwcCh8NPvW9rylevjD0uQ=="], diff --git a/example/babel.config.shared.js b/example/babel.config.shared.js index bc29acbe..76bc9e07 100644 --- a/example/babel.config.shared.js +++ b/example/babel.config.shared.js @@ -1,7 +1,7 @@ const path = require('path') const libraryPackage = require('../packages/react-native-nitro-sqlite/package.json') -function createExampleBabelConfig(projectRoot, { buffer, crypto } = {}) { +function createExampleBabelConfig(projectRoot) { const sourceDirectory = path.join(projectRoot, 'src') const testsDirectory = path.join(projectRoot, 'tests') const aliases = { @@ -20,14 +20,6 @@ function createExampleBabelConfig(projectRoot, { buffer, crypto } = {}) { '^@tests/(.+)': `${testsDirectory}/\\1`, } - if (buffer !== false) { - aliases.buffer = buffer ?? 'react-native-quick-crypto' - } - - if (crypto !== false) { - aliases.crypto = crypto ?? 'react-native-quick-crypto' - } - return { presets: ['module:@react-native/babel-preset'], plugins: [ diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index caafd829..8a61cb30 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -38,31 +38,6 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - QuickCrypto (1.1.8): - - hermes-engine - - NitroModules - - RCTRequired - - RCTTypeSafety - - React-bridging - - React-callinvoker - - React-Core - - React-Core-prebuilt - - React-cxxstableapi - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-jsi - - React-NativeModulesApple - - React-RCTFabric - - React-renderercss - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/core - - ReactNativeDependencies - - Yoga - RCT-Folly (2024.11.18.00): - RCT-Folly/Default (= 2024.11.18.00) - ReactNativeDependencies @@ -1398,29 +1373,6 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - react-native-quick-base64 (3.0.1): - - hermes-engine - - RCTRequired - - RCTTypeSafety - - React-bridging - - React-Core - - React-Core-prebuilt - - React-cxxstableapi - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-jsi - - React-NativeModulesApple - - React-RCTFabric - - React-renderercss - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/core - - ReactNativeDependencies - - Yoga - react-native-safe-area-context (5.10.1): - hermes-engine - RCTRequired @@ -1997,7 +1949,6 @@ DEPENDENCIES: - glog (from `build/rndeps-facades/glog`) - hermes-engine (from `../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - NitroModules (from `../../node_modules/react-native-nitro-modules`) - - QuickCrypto (from `../../node_modules/react-native-quick-crypto`) - RCT-Folly (from `build/rndeps-facades/RCT-Folly`) - RCTDeprecation (from `build/rncore-facades/RCTDeprecation`) - RCTRequired (from `build/rncore-facades/RCTRequired`) @@ -2039,7 +1990,6 @@ DEPENDENCIES: - React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`) - React-microtasksnativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) - React-mutationobservernativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/mutationobserver`) - - react-native-quick-base64 (from `../../node_modules/react-native-quick-base64`) - react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`) - React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-networking (from `../../node_modules/react-native/ReactCommon/react/networking`) @@ -2103,8 +2053,6 @@ EXTERNAL SOURCES: :tag: hermes-v260318099.0.2 NitroModules: :path: "../../node_modules/react-native-nitro-modules" - QuickCrypto: - :path: "../../node_modules/react-native-quick-crypto" RCT-Folly: :path: build/rndeps-facades/RCT-Folly RCTDeprecation: @@ -2185,8 +2133,6 @@ EXTERNAL SOURCES: :path: "../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" React-mutationobservernativemodule: :path: "../../node_modules/react-native/ReactCommon/react/nativemodule/mutationobserver" - react-native-quick-base64: - :path: "../../node_modules/react-native-quick-base64" react-native-safe-area-context: :path: "../../node_modules/react-native-safe-area-context" React-NativeModulesApple: @@ -2285,7 +2231,6 @@ SPEC CHECKSUMS: glog: 3cf7cb46f743c4bc758ae3e6d9c15bd1b4cfd6d4 hermes-engine: 6a00d96909f1648698fe5419972fe3c9e628755e NitroModules: 92c2f230ec822ce8be72c8330fe292cdcf24e3a4 - QuickCrypto: 3e6ba9b95e4e6ddf3a5e01290b96d22ada38d3cf RCT-Folly: 82921e585c0400eda46fac1068297aa9dfb035e4 RCTDeprecation: e134f2a2c096a6450f5fcbbe949531f913a2ff04 RCTRequired: f1a68295837ee8f91e112ed1b5694d12e7ff1784 @@ -2326,7 +2271,6 @@ SPEC CHECKSUMS: React-Mapbuffer: cf4026a5c35cd3598b648ce6f3ac6e8bfae12ad5 React-microtasksnativemodule: 3c7c5f3624403317fe91b4ddefa86b60023552a8 React-mutationobservernativemodule: 7284a91b3c7d7fb85b5d4ac04f7f8da811b22977 - react-native-quick-base64: f93ca829b2c94cc5b3a175533af49f934a4697e7 react-native-safe-area-context: 7b143af09becaf26ba247b9a82d355f91b77b9b0 React-NativeModulesApple: 52f3def085f129de1307e3eb78e26729ff70f421 React-networking: e97a095de90a95bf811b887e2dfdb225f20fd493 diff --git a/example/macos/babel.config.js b/example/macos/babel.config.js index de549d9f..c1b3afe8 100644 --- a/example/macos/babel.config.js +++ b/example/macos/babel.config.js @@ -1,9 +1,4 @@ const path = require('path') const createExampleBabelConfig = require('../babel.config.shared') -module.exports = createExampleBabelConfig(path.resolve(__dirname, '..'), { - // react-native-quick-base64 does not have a macOS native implementation. - // Use the portable Buffer package instead of the mobile crypto polyfill. - buffer: false, - crypto: false, -}) +module.exports = createExampleBabelConfig(path.resolve(__dirname, '..')) diff --git a/example/package.json b/example/package.json index 2f54b362..5037dd20 100644 --- a/example/package.json +++ b/example/package.json @@ -22,10 +22,10 @@ "test:harness:ios": "react-native-harness --harnessRunner ios" }, "dependencies": { - "@craftzdog/react-native-buffer": "^6.1.2", "@react-native-clipboard/clipboard": "^1.16.3", "@react-navigation/native": "^7.5.1", "@react-navigation/native-stack": "^7.21.0", + "buffer": "^6.0.3", "chai": "^4.3.7", "chance": "^1.1.9", "events": "^3.3.0", @@ -35,8 +35,6 @@ "react-native-nitro-modules": "*", "react-native-nitro-sqlite": "10.2.0", "react-native-nitro-sqlite-vec": "10.2.0", - "react-native-quick-base64": "^3.0.1", - "react-native-quick-crypto": "^1.1.8", "react-native-safe-area-context": "^5.10.1", "react-native-screens": "^4.30.0", "reflect-metadata": "^0.2.2", diff --git a/example/src/initGlobals.ts b/example/src/initGlobals.ts index c7e563d8..b54ed2f2 100644 --- a/example/src/initGlobals.ts +++ b/example/src/initGlobals.ts @@ -1,21 +1,10 @@ -import { Buffer as CraftzdogBuffer } from '@craftzdog/react-native-buffer' -import { - install as installQuickCrypto, - Buffer as QuickCryptoBuffer, -} from 'react-native-quick-crypto' - -declare global { - // eslint-disable-next-line no-var - var Buffer: typeof CraftzdogBuffer | typeof QuickCryptoBuffer -} +import { Buffer } from 'buffer' if (!globalThis.process) { // @ts-expect-error - if process is not defined, we need to set it to an empty object globalThis.process = {} } -globalThis.Buffer = QuickCryptoBuffer +globalThis.Buffer = Buffer globalThis.process.cwd = () => 'sxsx' globalThis.process.env = { NODE_ENV: 'production' } - -installQuickCrypto()