@breeztech/breez-sdk-spark-react-native 0.6.4-dev1 → 0.6.4-dev3

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.js CHANGED
@@ -1,2 +1 @@
1
- const plugin = require('./plugin/build');
2
- module.exports = plugin.default || plugin;
1
+ module.exports = require('./plugin/build');
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@breeztech/breez-sdk-spark-react-native",
3
- "version": "0.6.4-dev1",
3
+ "version": "0.6.4-dev3",
4
4
  "description": "React Native bindings for the Breez SDK - Nodeless (Spark Implementation)",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
7
7
  "module": "./lib/module/index.js",
8
- "app": "./app.plugin.js",
9
8
  "exports": {
9
+ "./app.plugin.js": "./app.plugin.js",
10
10
  ".": {
11
11
  "import": {
12
12
  "types": "./lib/typescript/module/src/index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "src",
23
23
  "lib",
24
24
  "android",
25
+ "build",
25
26
  "ios",
26
27
  "cpp",
27
28
  "*.podspec",
@@ -48,7 +49,6 @@
48
49
  "plugin:build": "EXPO_NONINTERACTIVE=true expo-module build plugin",
49
50
  "plugin:clean": "expo-module clean plugin",
50
51
  "plugin:watch": "expo-module build plugin",
51
- "postinstall": "./scripts/postinstall.sh",
52
52
  "prepare": "bob build && yarn plugin:build",
53
53
  "release": "release-it --only-version",
54
54
  "typecheck": "tsc",
@@ -1,10 +1,4 @@
1
1
  import { type ConfigPlugin } from '@expo/config-plugins';
2
- export type BreezSdkPluginOptions = {
3
- /**
4
- * Skip downloading binary artifacts (default: false)
5
- * Set to true if you want to handle binary downloads manually
6
- */
7
- skipBinaryDownload?: boolean;
8
- };
2
+ export type BreezSdkPluginOptions = {};
9
3
  declare const _default: ConfigPlugin<void | BreezSdkPluginOptions>;
10
4
  export default _default;
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("@expo/config-plugins");
4
- const withBinaryArtifacts_1 = require("./withBinaryArtifacts");
5
4
  const withAndroid_1 = require("./withAndroid");
6
5
  const withIOS_1 = require("./withIOS");
7
6
  const utils_1 = require("./utils");
8
7
  const withBreezSdk = (config, options) => {
9
- const { skipBinaryDownload = false } = options || {};
8
+ const {} = options || {};
10
9
  return (0, config_plugins_1.withPlugins)(config, [
11
- // Download binary artifacts first
12
- ...(skipBinaryDownload ? [] : [withBinaryArtifacts_1.withBinaryArtifacts]),
13
10
  // Configure Android
14
11
  withAndroid_1.withBreezSdkAndroid,
15
12
  // Configure iOS
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/utils.ts","../src/withandroid.ts","../src/withbinaryartifacts.ts","../src/withios.ts"],"version":"5.9.2"}
1
+ {"root":["../src/index.ts","../src/utils.ts","../src/withandroid.ts","../src/withios.ts"],"version":"5.9.2"}
@@ -1,6 +0,0 @@
1
- import type { ConfigPlugin } from '@expo/config-plugins';
2
- /**
3
- * Downloads prebuilt binary artifacts for Android and iOS
4
- * This runs during expo prebuild to ensure binaries are available
5
- */
6
- export declare const withBinaryArtifacts: ConfigPlugin;
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.withBinaryArtifacts = void 0;
37
- const path = __importStar(require("path"));
38
- const fs = __importStar(require("fs"));
39
- const child_process_1 = require("child_process");
40
- /**
41
- * Downloads prebuilt binary artifacts for Android and iOS
42
- * This runs during expo prebuild to ensure binaries are available
43
- */
44
- const withBinaryArtifacts = (config) => {
45
- return {
46
- ...config,
47
- async prebuildAsync(config) {
48
- try {
49
- await downloadBinaryArtifacts();
50
- }
51
- catch (error) {
52
- console.warn('Failed to download Breez SDK binary artifacts:', error);
53
- console.warn('You may need to run the postinstall script manually or check your network connection.');
54
- }
55
- return config;
56
- },
57
- };
58
- };
59
- exports.withBinaryArtifacts = withBinaryArtifacts;
60
- async function downloadBinaryArtifacts() {
61
- const packageRoot = findPackageRoot();
62
- if (!packageRoot) {
63
- throw new Error('Could not find @breeztech/breez-sdk-spark-react-native package');
64
- }
65
- // Check if artifacts already exist
66
- const androidLibsPath = path.join(packageRoot, 'android/src/main/jniLibs');
67
- const iosFrameworkPath = path.join(packageRoot, 'build/RnBreezSdkSpark.xcframework');
68
- if (fs.existsSync(androidLibsPath) && fs.existsSync(iosFrameworkPath)) {
69
- return;
70
- }
71
- const packageJsonPath = path.join(packageRoot, 'package.json');
72
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
73
- const version = packageJson.version;
74
- const repo = 'https://github.com/breez/breez-sdk-spark-react-native';
75
- const androidUrl = `${repo}/releases/download/${version}/android-artifacts.zip`;
76
- const iosUrl = `${repo}/releases/download/${version}/ios-artifacts.zip`;
77
- // Download Android artifacts
78
- try {
79
- (0, child_process_1.execSync)(`curl -L "${androidUrl}" --output android-artifacts.zip && unzip -o android-artifacts.zip && rm -rf android-artifacts.zip`, { cwd: packageRoot, stdio: 'inherit' });
80
- }
81
- catch (error) {
82
- console.error('Failed to download Android artifacts');
83
- throw error;
84
- }
85
- // Download iOS artifacts
86
- try {
87
- (0, child_process_1.execSync)(`curl -L "${iosUrl}" --output ios-artifacts.zip && unzip -o ios-artifacts.zip && rm -rf ios-artifacts.zip`, { cwd: packageRoot, stdio: 'inherit' });
88
- }
89
- catch (error) {
90
- console.error('Failed to download iOS artifacts');
91
- throw error;
92
- }
93
- }
94
- function findPackageRoot() {
95
- let currentDir = __dirname;
96
- // Walk up the directory tree to find the package root
97
- while (currentDir !== path.dirname(currentDir)) {
98
- const packageJsonPath = path.join(currentDir, 'package.json');
99
- if (fs.existsSync(packageJsonPath)) {
100
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
101
- if (packageJson.name === '@breeztech/breez-sdk-spark-react-native') {
102
- return currentDir;
103
- }
104
- }
105
- currentDir = path.dirname(currentDir);
106
- }
107
- return null;
108
- }