@granite-js/plugin-hermes 0.1.14 → 0.1.16

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @granite-js/plugin-hermes
2
2
 
3
+ ## 0.1.16
4
+
5
+ ### Patch Changes
6
+
7
+ - c9b4fff: replace .js to .hbc
8
+ - 1678419: improve plugin options
9
+ - @granite-js/plugin-core@0.1.16
10
+ - @granite-js/utils@0.1.16
11
+
12
+ ## 0.1.15
13
+
14
+ ### Patch Changes
15
+
16
+ - d16ee87: Add useInitialProps, useInitialSearchParams hook.
17
+ - Updated dependencies [d16ee87]
18
+ - @granite-js/plugin-core@0.1.15
19
+ - @granite-js/utils@0.1.15
20
+
3
21
  ## 0.1.14
4
22
 
5
23
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -93,7 +93,7 @@ function resolveHermesBinaryPath() {
93
93
  //#endregion
94
94
  //#region src/hermesPlugin.ts
95
95
  const hermesPlugin = (options) => {
96
- const hermesc = resolveHermesBinaryPath();
96
+ const hermesc = options?.binaryPath ?? resolveHermesBinaryPath();
97
97
  return {
98
98
  name: "hermes-plugin",
99
99
  build: {
@@ -103,7 +103,7 @@ const hermesPlugin = (options) => {
103
103
  const files = config.buildResults.filter(__granite_js_plugin_core.isBuildSuccess).map(({ outfile, sourcemapOutfile }) => ({
104
104
  jsBundle: outfile,
105
105
  jsSourcemap: sourcemapOutfile,
106
- hermesBytecode: `${outfile.replace(".js", "")}.hbc`
106
+ hermesBytecode: outfile.replace(/\.js$/, ".hbc")
107
107
  }));
108
108
  for (const file of files) {
109
109
  const { jsBundle, jsSourcemap, hermesBytecode } = file;
package/dist/index.d.cts CHANGED
@@ -24,6 +24,12 @@ interface HermesPluginOptions {
24
24
  * Defaults to `true`.
25
25
  */
26
26
  sourcemap?: boolean;
27
+ /**
28
+ * Path to hermesc binary.
29
+ *
30
+ * Defaults to `hermesc` in `react-native/sdks/hermesc/<platform>/hermesc`.
31
+ */
32
+ binaryPath?: string;
27
33
  } //#endregion
28
34
  //#region src/hermesPlugin.d.ts
29
35
  declare const hermesPlugin: (options?: HermesPluginOptions) => GranitePluginCore;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,12 @@ interface HermesPluginOptions {
24
24
  * Defaults to `true`.
25
25
  */
26
26
  sourcemap?: boolean;
27
+ /**
28
+ * Path to hermesc binary.
29
+ *
30
+ * Defaults to `hermesc` in `react-native/sdks/hermesc/<platform>/hermesc`.
31
+ */
32
+ binaryPath?: string;
27
33
  } //#endregion
28
34
  //#region src/hermesPlugin.d.ts
29
35
  declare const hermesPlugin: (options?: HermesPluginOptions) => GranitePluginCore;
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ function resolveHermesBinaryPath() {
75
75
  //#endregion
76
76
  //#region src/hermesPlugin.ts
77
77
  const hermesPlugin = (options) => {
78
- const hermesc = resolveHermesBinaryPath();
78
+ const hermesc = options?.binaryPath ?? resolveHermesBinaryPath();
79
79
  return {
80
80
  name: "hermes-plugin",
81
81
  build: {
@@ -85,7 +85,7 @@ const hermesPlugin = (options) => {
85
85
  const files = config.buildResults.filter(isBuildSuccess).map(({ outfile, sourcemapOutfile }) => ({
86
86
  jsBundle: outfile,
87
87
  jsSourcemap: sourcemapOutfile,
88
- hermesBytecode: `${outfile.replace(".js", "")}.hbc`
88
+ hermesBytecode: outfile.replace(/\.js$/, ".hbc")
89
89
  }));
90
90
  for (const file of files) {
91
91
  const { jsBundle, jsSourcemap, hermesBytecode } = file;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@granite-js/plugin-hermes",
3
3
  "type": "module",
4
- "version": "0.1.14",
4
+ "version": "0.1.16",
5
5
  "description": "Hermes compilation plugin for Granite",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -35,8 +35,8 @@
35
35
  "vitest": "^3.1.3"
36
36
  },
37
37
  "dependencies": {
38
- "@granite-js/plugin-core": "0.1.14",
39
- "@granite-js/utils": "0.1.14",
38
+ "@granite-js/plugin-core": "0.1.16",
39
+ "@granite-js/utils": "0.1.16",
40
40
  "es-toolkit": "^1.39.8",
41
41
  "execa": "^5",
42
42
  "source-map": "^0.8.0-beta.0"