@hot-updater/rock 1.0.8 → 1.1.1
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/dist/index.cjs +18 -0
- package/dist/index.d.cts +8 -2
- package/dist/index.d.mts +8 -2
- package/dist/index.mjs +19 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -6295,6 +6295,22 @@ const runBundle = async ({ entryFile, cwd, platform, buildPath, sourcemap, herme
|
|
|
6295
6295
|
stdout
|
|
6296
6296
|
};
|
|
6297
6297
|
};
|
|
6298
|
+
/**
|
|
6299
|
+
* The Rock adapter's native fingerprint: the native interface
|
|
6300
|
+
* `rock config -p <platform>` reports. `hot-updater fingerprint hash` calls
|
|
6301
|
+
* it during native builds, from the inputs fingerprint.json records.
|
|
6302
|
+
*/
|
|
6303
|
+
const rockFingerprint = async (cwd, options) => (0, _hot_updater_cli_tools.createInterfaceFingerprint)(cwd, options, await (0, _hot_updater_cli_tools.readReactNativeInterface)({
|
|
6304
|
+
cwd,
|
|
6305
|
+
command: "npx",
|
|
6306
|
+
args: [
|
|
6307
|
+
"rock",
|
|
6308
|
+
"config",
|
|
6309
|
+
"-p",
|
|
6310
|
+
options.platform
|
|
6311
|
+
],
|
|
6312
|
+
platform: options.platform
|
|
6313
|
+
}));
|
|
6298
6314
|
const rock = (config = {
|
|
6299
6315
|
outDir: "dist",
|
|
6300
6316
|
sourcemap: false,
|
|
@@ -6303,6 +6319,7 @@ const rock = (config = {
|
|
|
6303
6319
|
}) => ({ cwd }) => {
|
|
6304
6320
|
const { outDir = "dist", sourcemap = false, entryFile = "index.js", hermes = true } = config;
|
|
6305
6321
|
return {
|
|
6322
|
+
nativeBuild: { fingerprint: (options) => rockFingerprint(cwd, options) },
|
|
6306
6323
|
build: async ({ platform }) => {
|
|
6307
6324
|
const buildPath = path.default.join(cwd, outDir);
|
|
6308
6325
|
await fs_promises.default.rm(buildPath, {
|
|
@@ -6329,3 +6346,4 @@ const rock = (config = {
|
|
|
6329
6346
|
};
|
|
6330
6347
|
//#endregion
|
|
6331
6348
|
exports.rock = rock;
|
|
6349
|
+
exports.rockFingerprint = rockFingerprint;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig } from "@hot-updater/plugin-core";
|
|
1
|
+
import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, NativeFingerprintOptions } from "@hot-updater/plugin-core";
|
|
2
2
|
//#region src/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The Rock adapter's native fingerprint: the native interface
|
|
5
|
+
* `rock config -p <platform>` reports. `hot-updater fingerprint hash` calls
|
|
6
|
+
* it during native builds, from the inputs fingerprint.json records.
|
|
7
|
+
*/
|
|
8
|
+
declare const rockFingerprint: (cwd: string, options: NativeFingerprintOptions) => Promise<import("@hot-updater/plugin-core").NativeFingerprint>;
|
|
3
9
|
interface RockAdapterConfig extends BuildAdapterConfig {
|
|
4
10
|
/**
|
|
5
11
|
* @default "index.js"
|
|
@@ -20,4 +26,4 @@ interface RockAdapterConfig extends BuildAdapterConfig {
|
|
|
20
26
|
}
|
|
21
27
|
declare const rock: (config?: RockAdapterConfig) => ({ cwd }: BuildAdapterArgs) => BuildAdapter;
|
|
22
28
|
//#endregion
|
|
23
|
-
export { RockAdapterConfig, rock };
|
|
29
|
+
export { RockAdapterConfig, rock, rockFingerprint };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig } from "@hot-updater/plugin-core";
|
|
1
|
+
import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, NativeFingerprintOptions } from "@hot-updater/plugin-core";
|
|
2
2
|
//#region src/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The Rock adapter's native fingerprint: the native interface
|
|
5
|
+
* `rock config -p <platform>` reports. `hot-updater fingerprint hash` calls
|
|
6
|
+
* it during native builds, from the inputs fingerprint.json records.
|
|
7
|
+
*/
|
|
8
|
+
declare const rockFingerprint: (cwd: string, options: NativeFingerprintOptions) => Promise<import("@hot-updater/plugin-core").NativeFingerprint>;
|
|
3
9
|
interface RockAdapterConfig extends BuildAdapterConfig {
|
|
4
10
|
/**
|
|
5
11
|
* @default "index.js"
|
|
@@ -20,4 +26,4 @@ interface RockAdapterConfig extends BuildAdapterConfig {
|
|
|
20
26
|
}
|
|
21
27
|
declare const rock: (config?: RockAdapterConfig) => ({ cwd }: BuildAdapterArgs) => BuildAdapter;
|
|
22
28
|
//#endregion
|
|
23
|
-
export { RockAdapterConfig, rock };
|
|
29
|
+
export { RockAdapterConfig, rock, rockFingerprint };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import fs from "fs/promises";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import { log } from "@hot-updater/cli-tools";
|
|
4
|
+
import { createInterfaceFingerprint, log, readReactNativeInterface } from "@hot-updater/cli-tools";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
7
7
|
import { StringDecoder } from "node:string_decoder";
|
|
@@ -6291,6 +6291,22 @@ const runBundle = async ({ entryFile, cwd, platform, buildPath, sourcemap, herme
|
|
|
6291
6291
|
stdout
|
|
6292
6292
|
};
|
|
6293
6293
|
};
|
|
6294
|
+
/**
|
|
6295
|
+
* The Rock adapter's native fingerprint: the native interface
|
|
6296
|
+
* `rock config -p <platform>` reports. `hot-updater fingerprint hash` calls
|
|
6297
|
+
* it during native builds, from the inputs fingerprint.json records.
|
|
6298
|
+
*/
|
|
6299
|
+
const rockFingerprint = async (cwd, options) => createInterfaceFingerprint(cwd, options, await readReactNativeInterface({
|
|
6300
|
+
cwd,
|
|
6301
|
+
command: "npx",
|
|
6302
|
+
args: [
|
|
6303
|
+
"rock",
|
|
6304
|
+
"config",
|
|
6305
|
+
"-p",
|
|
6306
|
+
options.platform
|
|
6307
|
+
],
|
|
6308
|
+
platform: options.platform
|
|
6309
|
+
}));
|
|
6294
6310
|
const rock = (config = {
|
|
6295
6311
|
outDir: "dist",
|
|
6296
6312
|
sourcemap: false,
|
|
@@ -6299,6 +6315,7 @@ const rock = (config = {
|
|
|
6299
6315
|
}) => ({ cwd }) => {
|
|
6300
6316
|
const { outDir = "dist", sourcemap = false, entryFile = "index.js", hermes = true } = config;
|
|
6301
6317
|
return {
|
|
6318
|
+
nativeBuild: { fingerprint: (options) => rockFingerprint(cwd, options) },
|
|
6302
6319
|
build: async ({ platform }) => {
|
|
6303
6320
|
const buildPath = path.join(cwd, outDir);
|
|
6304
6321
|
await fs.rm(buildPath, {
|
|
@@ -6324,4 +6341,4 @@ const rock = (config = {
|
|
|
6324
6341
|
};
|
|
6325
6342
|
};
|
|
6326
6343
|
//#endregion
|
|
6327
|
-
export { rock };
|
|
6344
|
+
export { rock, rockFingerprint };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/rock",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"uuidv7": "^1.0.2",
|
|
28
|
-
"@hot-updater/cli-tools": "1.
|
|
29
|
-
"@hot-updater/plugin-core": "1.
|
|
28
|
+
"@hot-updater/cli-tools": "1.1.1",
|
|
29
|
+
"@hot-updater/plugin-core": "1.1.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^20",
|