@gfean/react-native-bundle-drop 0.1.31 → 0.1.33

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/CLIENT_README.md CHANGED
@@ -4,7 +4,7 @@ This guide is for app teams integrating the `react-native-bundle-drop` module to
4
4
 
5
5
  ## 1) Install and link
6
6
  ```bash
7
- yarn add react-native-bundle-drop
7
+ yarn add @gfean/react-native-bundle-drop
8
8
  cd ios && pod install && cd ..
9
9
  ```
10
10
 
@@ -82,18 +82,21 @@ console.log(status);
82
82
  - Endpoint `/bundle/latest` (or the `downloadUrl` returned) should serve the zip built by your upload script.
83
83
 
84
84
  ## 8) Bundling/Upload (CI/local)
85
+ - Login once:
86
+ ```bash
87
+ npx bundle-drop login
88
+ ```
85
89
  - Bundle and upload (Android):
86
90
  ```bash
87
- # Prefer explicit version, otherwise falls back to parsing android/app/build.gradle (or --buildgradle-path)
88
- corepack yarn ts-node modules/react-native-bundle-drop/src/scripts/upload-bundle.ts android --version=1.2.3 --channel=General
89
- # or: --buildgradle-path=android/app/build.gradle
91
+ npx bundle-drop upload android --version 1.2.3 --channel General
92
+ # or: --buildgradle-path android/app/build.gradle
90
93
  ```
91
94
  - Bundle and upload (iOS):
92
95
  ```bash
93
- # Prefer --version; otherwise pass --plist-file so version is read from CFBundleShortVersionString
94
- corepack yarn ts-node modules/react-native-bundle-drop/src/scripts/upload-bundle.ts ios --version=1.2.3 --channel=General
95
- # or: --plist-file=ios/Info.plist
96
+ npx bundle-drop upload ios --plist-file ios/Info.plist --channel General
97
+ # or: --version 1.2.3
96
98
  ```
99
+ - Optional: `--release-notes "text"`; `--runtimeVersion x.y.z`.
97
100
  - Requires `~/.bundle-drop/auth.json` from `bundle-drop login` and `bundle.drop.config.js` in project root (with `org.slug`, `project.slug`, `serverUrl`).
98
101
 
99
102
  ## 9) App entry hooks (JS bundle resolution)
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This package powers OTA bundle download/upload and asset resolution for React Native.
4
4
 
5
+ ## Install
6
+ ```bash
7
+ yarn add @gfean/react-native-bundle-drop
8
+ cd ios && pod install && cd ..
9
+ ```
10
+
5
11
  ## Prerequisites
6
12
  - `bundle.drop.config.js` in your app root:
7
13
  ```js
@@ -39,18 +45,22 @@ Android extras:
39
45
  ## Config loading
40
46
  - `src/loadConfig.ts` loads `bundle.drop.config.js` (fixed relative path) and honors `debugLocal` to force localhost.
41
47
 
42
- ## Bundling & Uploading (Node scripts)
43
- - Bundle only:
48
+ ## Bundling & Uploading (CLI)
49
+ - Login once:
44
50
  ```bash
45
- corepack yarn ts-node modules/react-native-bundle-drop/src/scripts/bundle.ts android|ios
51
+ npx bundle-drop login
46
52
  ```
47
53
  - Upload (builds, zips, uploads, cleans up):
48
54
  ```bash
49
- corepack yarn ts-node modules/react-native-bundle-drop/src/scripts/upload-bundle.ts android --version=1.2.3 --channel=General
50
- corepack yarn ts-node modules/react-native-bundle-drop/src/scripts/upload-bundle.ts ios --plist-file=ios/Info.plist --channel=General
55
+ npx bundle-drop upload android --version 1.2.3 --channel General
56
+ npx bundle-drop upload ios --plist-file ios/Info.plist --channel General
51
57
  ```
52
- - Requires `bundle.drop.config.js` (with `serverUrl`, `org.slug`, `project.slug`) and `~/.bundle-drop/auth.json` token.
53
- - Uses `Authorization: Bearer <token>`, `orgSlug`, `projectSlug`, and `x-api-key` if provided in config.
58
+ Flags:
59
+ - `--version` (ios/android) or `--plist-file` (iOS) or `--buildgradle-path` (Android) to derive version.
60
+ - `--release-notes "<text>"` optional.
61
+ Requirements:
62
+ - `bundle.drop.config.js` with `serverUrl`, `org.slug`, `project.slug`.
63
+ - Auth token at `~/.bundle-drop/auth.json` from `bundle-drop login`.
54
64
 
55
65
  ## Typical usage
56
66
  ```ts
package/lib/index.d.ts CHANGED
@@ -49,3 +49,4 @@ export declare function initUpdateManager(opts?: {
49
49
  }): Promise<void>;
50
50
  export type { BundleInfo } from './bundleInfo';
51
51
  export type { UpdatePolicy } from './types';
52
+ export { useBundleDrop } from './useBundleDrop';
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getUpdateState = exports.applyReadyUpdate = exports.downloadUpdate = exports.restartAppAndInstallUpdate = void 0;
6
+ exports.useBundleDrop = exports.getUpdateState = exports.applyReadyUpdate = exports.downloadUpdate = exports.restartAppAndInstallUpdate = void 0;
7
7
  exports.getDownloadedBundlePath = getDownloadedBundlePath;
8
8
  exports.checkForUpdate = checkForUpdate;
9
9
  exports.getInstalledBundleInfo = getInstalledBundleInfo;
@@ -413,3 +413,6 @@ async function initUpdateManager(opts) {
413
413
  // Final check to report install for already-applied bundles (deduped by lastInstalledReportedHash).
414
414
  await reportInstalledIfReady();
415
415
  }
416
+ // Hooks
417
+ var useBundleDrop_1 = require("./useBundleDrop");
418
+ Object.defineProperty(exports, "useBundleDrop", { enumerable: true, get: function () { return useBundleDrop_1.useBundleDrop; } });
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@gfean/react-native-bundle-drop",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "react native ota by gFean",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "author": " <> ()",
8
8
  "license": "UNLICENSED",
9
- "homepage": "#readme",
9
+ "homepage": "https://github.com/GFean/react-native-bundle-drop",
10
10
  "scripts": {
11
11
  "clean": "rimraf lib dist",
12
12
  "build": "tsc -p tsconfig.json && node scripts/make-cli-executable.js",
13
- "prepublishOnly": "yarn clean && yarn build"
13
+ "prepublishOnly": "yarn clean && yarn build",
14
+ "build-and-publish": "yarn clean && yarn build && npm publish --access=restricted"
14
15
  },
15
16
  "create-react-native-library": {
16
17
  "type": "legacy-module",