@granite-js/plugin-hermes 0.1.22 → 0.1.23-next.10
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 +79 -0
- package/dist/index.cjs +26 -1
- package/dist/index.js +26 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
# @granite-js/plugin-hermes
|
|
2
2
|
|
|
3
|
+
## 0.1.23-next.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @granite-js/plugin-core@0.1.23-next.10
|
|
10
|
+
- @granite-js/utils@0.1.23-next.10
|
|
11
|
+
|
|
12
|
+
## 0.1.23-next.9
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- tollback
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @granite-js/plugin-core@0.1.23-next.9
|
|
19
|
+
- @granite-js/utils@0.1.23-next.9
|
|
20
|
+
|
|
21
|
+
## 0.1.23-next.8
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- router
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @granite-js/plugin-core@0.1.23-next.8
|
|
28
|
+
- @granite-js/utils@0.1.23-next.8
|
|
29
|
+
|
|
30
|
+
## 0.1.23-next.7
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- fix
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
- @granite-js/plugin-core@0.1.23-next.7
|
|
37
|
+
- @granite-js/utils@0.1.23-next.7
|
|
38
|
+
|
|
39
|
+
## 0.1.23-next.6
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- test
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
- @granite-js/plugin-core@0.1.23-next.6
|
|
46
|
+
- @granite-js/utils@0.1.23-next.6
|
|
47
|
+
|
|
48
|
+
## 0.1.23-next.5
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- temp
|
|
53
|
+
- Updated dependencies
|
|
54
|
+
- @granite-js/plugin-core@0.1.23-next.5
|
|
55
|
+
- @granite-js/utils@0.1.23-next.5
|
|
56
|
+
|
|
57
|
+
## 0.1.23-next.4
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- test
|
|
62
|
+
- Updated dependencies
|
|
63
|
+
- @granite-js/plugin-core@0.1.23-next.4
|
|
64
|
+
- @granite-js/utils@0.1.23-next.4
|
|
65
|
+
|
|
66
|
+
## 0.1.23-next.3
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- test
|
|
71
|
+
- Updated dependencies
|
|
72
|
+
- @granite-js/plugin-core@0.1.23-next.3
|
|
73
|
+
- @granite-js/utils@0.1.23-next.3
|
|
74
|
+
|
|
75
|
+
## 0.1.23-next.0
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- @granite-js/plugin-core@0.1.23-next.0
|
|
80
|
+
- @granite-js/utils@0.1.23-next.0
|
|
81
|
+
|
|
3
82
|
## 0.1.22
|
|
4
83
|
|
|
5
84
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ const execa = __toESM(require("execa"));
|
|
|
27
27
|
const fs_promises = __toESM(require("fs/promises"));
|
|
28
28
|
const source_map = __toESM(require("source-map"));
|
|
29
29
|
const os = __toESM(require("os"));
|
|
30
|
+
const path = __toESM(require("path"));
|
|
30
31
|
const __granite_js_utils = __toESM(require("@granite-js/utils"));
|
|
31
32
|
|
|
32
33
|
//#region src/compileHbc.ts
|
|
@@ -82,12 +83,36 @@ const BINARY_PATH = {
|
|
|
82
83
|
Linux: "react-native/sdks/hermesc/linux64-bin/hermesc",
|
|
83
84
|
Windows_NT: "react-native/sdks/hermesc/win64-bin/hermesc.exe"
|
|
84
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Returns the Hermes OS binary folder name for the current platform.
|
|
88
|
+
*/
|
|
89
|
+
function getHermesOSBin() {
|
|
90
|
+
switch (process.platform) {
|
|
91
|
+
case "win32": return "win64-bin";
|
|
92
|
+
case "darwin": return "osx-bin";
|
|
93
|
+
default: return "linux64-bin";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns the Hermes executable name for the current platform.
|
|
98
|
+
*/
|
|
99
|
+
function getHermesOSExe() {
|
|
100
|
+
const hermesExecutableName = "hermesc";
|
|
101
|
+
return process.platform === "win32" ? `${hermesExecutableName}.exe` : hermesExecutableName;
|
|
102
|
+
}
|
|
103
|
+
function getReactNativePackagePath(root) {
|
|
104
|
+
try {
|
|
105
|
+
return path.default.dirname(require.resolve("react-native/package.json", { paths: [root] }));
|
|
106
|
+
} catch {
|
|
107
|
+
return path.default.join("node_modules", "react-native");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
85
110
|
function resolveHermesBinaryPath() {
|
|
86
111
|
const root = (0, __granite_js_utils.getPackageRoot)();
|
|
87
112
|
const os$1 = (0, os.type)();
|
|
88
113
|
const binaryPath = BINARY_PATH[os$1];
|
|
89
114
|
if (binaryPath == null) throw new Error(`Unsupported OS: ${os$1}`);
|
|
90
|
-
return
|
|
115
|
+
return path.default.join(getReactNativePackagePath(root), "sdks", "hermesc", getHermesOSBin(), getHermesOSExe());
|
|
91
116
|
}
|
|
92
117
|
|
|
93
118
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import execa from "execa";
|
|
|
5
5
|
import * as fs from "fs/promises";
|
|
6
6
|
import { SourceMapConsumer, SourceMapGenerator } from "source-map";
|
|
7
7
|
import { type } from "os";
|
|
8
|
+
import path from "path";
|
|
8
9
|
import { getPackageRoot } from "@granite-js/utils";
|
|
9
10
|
|
|
10
11
|
//#region rolldown:runtime
|
|
@@ -64,12 +65,36 @@ const BINARY_PATH = {
|
|
|
64
65
|
Linux: "react-native/sdks/hermesc/linux64-bin/hermesc",
|
|
65
66
|
Windows_NT: "react-native/sdks/hermesc/win64-bin/hermesc.exe"
|
|
66
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Returns the Hermes OS binary folder name for the current platform.
|
|
70
|
+
*/
|
|
71
|
+
function getHermesOSBin() {
|
|
72
|
+
switch (process.platform) {
|
|
73
|
+
case "win32": return "win64-bin";
|
|
74
|
+
case "darwin": return "osx-bin";
|
|
75
|
+
default: return "linux64-bin";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns the Hermes executable name for the current platform.
|
|
80
|
+
*/
|
|
81
|
+
function getHermesOSExe() {
|
|
82
|
+
const hermesExecutableName = "hermesc";
|
|
83
|
+
return process.platform === "win32" ? `${hermesExecutableName}.exe` : hermesExecutableName;
|
|
84
|
+
}
|
|
85
|
+
function getReactNativePackagePath(root) {
|
|
86
|
+
try {
|
|
87
|
+
return path.dirname(__require.resolve("react-native/package.json", { paths: [root] }));
|
|
88
|
+
} catch {
|
|
89
|
+
return path.join("node_modules", "react-native");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
67
92
|
function resolveHermesBinaryPath() {
|
|
68
93
|
const root = getPackageRoot();
|
|
69
94
|
const os = type();
|
|
70
95
|
const binaryPath = BINARY_PATH[os];
|
|
71
96
|
if (binaryPath == null) throw new Error(`Unsupported OS: ${os}`);
|
|
72
|
-
return
|
|
97
|
+
return path.join(getReactNativePackagePath(root), "sdks", "hermesc", getHermesOSBin(), getHermesOSExe());
|
|
73
98
|
}
|
|
74
99
|
|
|
75
100
|
//#endregion
|
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.
|
|
4
|
+
"version": "0.1.23-next.10",
|
|
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.
|
|
39
|
-
"@granite-js/utils": "0.1.
|
|
38
|
+
"@granite-js/plugin-core": "0.1.23-next.10",
|
|
39
|
+
"@granite-js/utils": "0.1.23-next.10",
|
|
40
40
|
"es-toolkit": "^1.39.8",
|
|
41
41
|
"execa": "^5",
|
|
42
42
|
"source-map": "^0.8.0-beta.0"
|