@hot-updater/bare 0.17.0 → 0.18.0
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 +6652 -6654
- package/dist/index.d.cts +57 -0
- package/dist/index.d.ts +57 -2
- package/dist/index.js +6454 -6394
- package/package.json +3 -3
- package/dist/bare.d.ts +0 -21
- package/dist/hermes.d.ts +0 -24
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BasePluginArgs, BuildPlugin, BuildPluginConfig } from "@hot-updater/plugin-core";
|
|
2
|
+
|
|
3
|
+
//#region src/bare.d.ts
|
|
4
|
+
interface BarePluginConfig extends BuildPluginConfig {
|
|
5
|
+
/**
|
|
6
|
+
* @default "index.js"
|
|
7
|
+
* The entry file to bundle.
|
|
8
|
+
*/
|
|
9
|
+
entryFile?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
* Whether to generate sourcemap for the bundle.
|
|
13
|
+
*/
|
|
14
|
+
sourcemap?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to use Hermes to compile the bundle
|
|
17
|
+
* Since React Native v0.70+, Hermes is enabled by default, so it's recommended to enable it.
|
|
18
|
+
* @link https://reactnative.dev/docs/hermes
|
|
19
|
+
* @recommended true
|
|
20
|
+
*/
|
|
21
|
+
enableHermes: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const bare: (config: BarePluginConfig) => ({
|
|
24
|
+
cwd
|
|
25
|
+
}: BasePluginArgs) => BuildPlugin; //#endregion
|
|
26
|
+
//#region src/hermes.d.ts
|
|
27
|
+
/**
|
|
28
|
+
* Finds the Hermes command.
|
|
29
|
+
* If Hermes is bundled with react-native, returns the hermesc path.
|
|
30
|
+
* Otherwise, returns the path from node_modules/hermes-engine or hermesvm.
|
|
31
|
+
*
|
|
32
|
+
* @returns Full path to the Hermes executable
|
|
33
|
+
*/
|
|
34
|
+
declare function getHermesCommand(cwd: string): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Compiles a JS bundle into an HBC file using the Hermes compiler,
|
|
37
|
+
* and merges the source maps if enabled.
|
|
38
|
+
*
|
|
39
|
+
* @param cwd - The current working directory
|
|
40
|
+
* @param inputJsFile - Path to the input JS file
|
|
41
|
+
* @param sourcemap - (Optional) Final sourcemap file path
|
|
42
|
+
* @returns The full path to the compiled HBC file
|
|
43
|
+
*/
|
|
44
|
+
declare function compileHermes({
|
|
45
|
+
cwd,
|
|
46
|
+
sourcemap,
|
|
47
|
+
inputJsFile
|
|
48
|
+
}: {
|
|
49
|
+
cwd: string;
|
|
50
|
+
sourcemap?: boolean;
|
|
51
|
+
inputJsFile: string;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
hermesVersion: string;
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { BarePluginConfig, bare, compileHermes, getHermesCommand };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BasePluginArgs, BuildPlugin, BuildPluginConfig } from "@hot-updater/plugin-core";
|
|
2
|
+
|
|
3
|
+
//#region src/bare.d.ts
|
|
4
|
+
interface BarePluginConfig extends BuildPluginConfig {
|
|
5
|
+
/**
|
|
6
|
+
* @default "index.js"
|
|
7
|
+
* The entry file to bundle.
|
|
8
|
+
*/
|
|
9
|
+
entryFile?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
* Whether to generate sourcemap for the bundle.
|
|
13
|
+
*/
|
|
14
|
+
sourcemap?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to use Hermes to compile the bundle
|
|
17
|
+
* Since React Native v0.70+, Hermes is enabled by default, so it's recommended to enable it.
|
|
18
|
+
* @link https://reactnative.dev/docs/hermes
|
|
19
|
+
* @recommended true
|
|
20
|
+
*/
|
|
21
|
+
enableHermes: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const bare: (config: BarePluginConfig) => ({
|
|
24
|
+
cwd
|
|
25
|
+
}: BasePluginArgs) => BuildPlugin; //#endregion
|
|
26
|
+
//#region src/hermes.d.ts
|
|
27
|
+
/**
|
|
28
|
+
* Finds the Hermes command.
|
|
29
|
+
* If Hermes is bundled with react-native, returns the hermesc path.
|
|
30
|
+
* Otherwise, returns the path from node_modules/hermes-engine or hermesvm.
|
|
31
|
+
*
|
|
32
|
+
* @returns Full path to the Hermes executable
|
|
33
|
+
*/
|
|
34
|
+
declare function getHermesCommand(cwd: string): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Compiles a JS bundle into an HBC file using the Hermes compiler,
|
|
37
|
+
* and merges the source maps if enabled.
|
|
38
|
+
*
|
|
39
|
+
* @param cwd - The current working directory
|
|
40
|
+
* @param inputJsFile - Path to the input JS file
|
|
41
|
+
* @param sourcemap - (Optional) Final sourcemap file path
|
|
42
|
+
* @returns The full path to the compiled HBC file
|
|
43
|
+
*/
|
|
44
|
+
declare function compileHermes({
|
|
45
|
+
cwd,
|
|
46
|
+
sourcemap,
|
|
47
|
+
inputJsFile
|
|
48
|
+
}: {
|
|
49
|
+
cwd: string;
|
|
50
|
+
sourcemap?: boolean;
|
|
51
|
+
inputJsFile: string;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
hermesVersion: string;
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { BarePluginConfig, bare, compileHermes, getHermesCommand };
|