react-native-ble-nitro 1.0.0-beta.1 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.plugin.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build/index.js').default; // eslint-disable-line @typescript-eslint/no-var-requires
@@ -4,9 +4,9 @@
4
4
  * Creates BleManager instances with full react-native-ble-plx compatibility
5
5
  * by wrapping the Nitro implementation with compatibility shims
6
6
  */
7
- import type { BleManagerOptions, UUID, DeviceId, TransactionId, ConnectionPriority, ConnectionOptions, ScanOptions, NativeService, NativeCharacteristic, NativeDescriptor, LogLevel, Subscription } from './specs/types';
8
- import { DeviceWrapper } from './compatibility/deviceWrapper';
9
- import { State as PlxState, LogLevel as PlxLogLevel } from './compatibility/enums';
7
+ import type { BleManagerOptions, UUID, DeviceId, TransactionId, ConnectionPriority, ConnectionOptions, ScanOptions, NativeService, NativeCharacteristic, NativeDescriptor, LogLevel, Subscription } from './specs/types.js';
8
+ import { DeviceWrapper } from './compatibility/deviceWrapper.js';
9
+ import { State as PlxState, LogLevel as PlxLogLevel } from './compatibility/enums.js';
10
10
  /**
11
11
  * BleManager wrapper that provides react-native-ble-plx compatibility
12
12
  */
@@ -4,9 +4,9 @@
4
4
  * Creates BleManager instances with full react-native-ble-plx compatibility
5
5
  * by wrapping the Nitro implementation with compatibility shims
6
6
  */
7
- import { createBleManager } from './BleManagerFactory';
8
- import { DeviceWrapper } from './compatibility/deviceWrapper';
9
- import { stateToString, logLevelToString, normalizeLogLevel, normalizeCharacteristicSubscriptionType } from './compatibility/enums';
7
+ import { createBleManager } from './BleManagerFactory.js';
8
+ import { DeviceWrapper } from './compatibility/deviceWrapper.js';
9
+ import { stateToString, logLevelToString, normalizeLogLevel, normalizeCharacteristicSubscriptionType } from './compatibility/enums.js';
10
10
  /**
11
11
  * BleManager wrapper that provides react-native-ble-plx compatibility
12
12
  */
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "react-native-ble-nitro",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "High-performance React Native BLE library built on Nitro Modules - drop-in replacement for react-native-ble-plx",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "react-native": "src/index.ts",
8
8
  "source": "src/index.ts",
9
+ "type": "module",
9
10
  "exports": {
10
11
  ".": {
11
12
  "react-native": "./src/index.ts",
@@ -21,6 +22,7 @@
21
22
  "types": "./plugin/build/index.d.ts",
22
23
  "default": "./plugin/build/index.js"
23
24
  },
25
+ "./app.plugin.js": "./app.plugin.cjs",
24
26
  "./package.json": "./package.json"
25
27
  },
26
28
  "scripts": {
@@ -72,6 +74,7 @@
72
74
  "@typescript-eslint/parser": "^6.21.0",
73
75
  "eslint": "^8.0.0",
74
76
  "expo": "^52.0.47",
77
+ "expo-module-scripts": "^4.1.9",
75
78
  "jest": "^29.0.0",
76
79
  "nitro-codegen": "^0.26.4",
77
80
  "react-native": "^0.76.0",
@@ -83,7 +86,8 @@
83
86
  "src/",
84
87
  "ios/",
85
88
  "android/",
86
- "plugin/build/",
89
+ "plugin/build",
90
+ "app.plugin.cjs",
87
91
  "nitro.json",
88
92
  "react-native.config.js",
89
93
  "README.md",
@@ -1,5 +1,5 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import withBleNitro, { withBleNitroAndroid, withBleNitroIOS, type BleNitroPluginProps } from './withBleNitro';
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ import withBleNitro, { withBleNitroAndroid, withBleNitroIOS, type BleNitroPluginProps } from './withBleNitro.js';
3
3
  /**
4
4
  * Expo Config Plugin for react-native-ble-nitro
5
5
  *
@@ -1,4 +1,4 @@
1
- import withBleNitro, { withBleNitroAndroid, withBleNitroIOS } from './withBleNitro';
1
+ import withBleNitro, { withBleNitroAndroid, withBleNitroIOS } from './withBleNitro.js';
2
2
  /**
3
3
  * Expo Config Plugin for react-native-ble-nitro
4
4
  *
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
2
  export interface BleNitroPluginProps {
3
3
  /**
4
4
  * Enable background BLE support on Android.
@@ -1,4 +1,4 @@
1
- import { AndroidConfig, WarningAggregator, withAndroidManifest, withInfoPlist, } from 'expo/config-plugins';
1
+ import { AndroidConfig, WarningAggregator, withAndroidManifest, withInfoPlist, } from '@expo/config-plugins';
2
2
  const BLUETOOTH_PERMISSIONS = [
3
3
  'android.permission.BLUETOOTH',
4
4
  'android.permission.BLUETOOTH_ADMIN',
@@ -5,8 +5,8 @@
5
5
  * by wrapping the Nitro implementation with compatibility shims
6
6
  */
7
7
 
8
- import { createBleManager } from './BleManagerFactory';
9
- import type { BleManager as BleManagerInterface } from './specs/BleManager.nitro';
8
+ import { createBleManager } from './BleManagerFactory.js';
9
+ import type { BleManager as BleManagerInterface } from './specs/BleManager.nitro.js';
10
10
  import type {
11
11
  BleManagerOptions,
12
12
  UUID,
@@ -21,8 +21,8 @@ import type {
21
21
  NativeDescriptor,
22
22
  LogLevel,
23
23
  Subscription
24
- } from './specs/types';
25
- import { DeviceWrapper } from './compatibility/deviceWrapper';
24
+ } from './specs/types.js';
25
+ import { DeviceWrapper } from './compatibility/deviceWrapper.js';
26
26
  import {
27
27
  stateToString,
28
28
  logLevelToString,
@@ -30,7 +30,7 @@ import {
30
30
  normalizeCharacteristicSubscriptionType,
31
31
  State as PlxState,
32
32
  LogLevel as PlxLogLevel
33
- } from './compatibility/enums';
33
+ } from './compatibility/enums.js';
34
34
 
35
35
 
36
36
  /**