-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create hermes-engine-darwin npm package (#297)
Summary: {emoji:26a0} _This includes the changes of #296, so I’ll have to rebase this PR once that lands. The changes that pertain to this PR are in 9da61f7a9da01b5bd49e95dca0b98a5204210790_ Adds hermes-engine-darwin to the npm CI job. Notably the symbolic links need to be stripped from the framework bundle, as npm by design does not support symbolic links to exist in packages. However, seeing as we already package distinct versions of the framework in distinct npm packages, there isn't any need to support multiple versions of Hermes in a single framework bundle; so this should be fine. Pull Request resolved: #297 Test Plan: TODO: I’ll need to backport all changes to Hermes v0.4.1 in order to pull it into RN macOS v0.62. In the meantime I want to see if CI is correctly cutting this package. Reviewed By: mhorowitz Differential Revision: D22700399 Pulled By: willholen fbshipit-source-id: f72aefa3fd98a85c8da3e9a38dfa6be9723a0270
- Loading branch information
1 parent
8fc32f4
commit d3394bc
Showing
6 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ workflows: | |
- android | ||
- linux | ||
- macos | ||
- build-macos-runtime | ||
- windows | ||
- test-linux | ||
- test-macos | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
*.tar.gz | ||
*.tgz | ||
*.sha256 | ||
android | ||
node_modules | ||
osx-bin | ||
package-lock.json | ||
destroot | ||
LICENSE | ||
README.md | ||
hermes.podspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Hermes | ||
|
||
Hermes is a small and lightweight JavaScript VM optimized for running | ||
React Native apps on macOS. | ||
|
||
See [hermesengine.dev](https://hermesengine.dev) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "hermes-engine-darwin", | ||
"version": "%VERSION%", | ||
"private": false, | ||
"description": "A JavaScript engine optimized for running React Native on macOS", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:facebook/hermes.git" | ||
}, | ||
"scripts": { | ||
"postinstall": "node unpack-tarball.js" | ||
}, | ||
"files": [ | ||
"README.md", | ||
"unpack-tarball.js", | ||
"hermes-runtime-darwin-v*.tar.gz" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const child_process = require("child_process"); | ||
|
||
if ( | ||
process.platform === "darwin" && | ||
!fs.existsSync(path.join(__dirname, "destroot")) | ||
) { | ||
const tarball = fs.readdirSync(__dirname).find(function (entry) { | ||
return /^hermes-runtime-darwin-v[\d\.]+\.tar\.gz$/.test(entry); | ||
}); | ||
if (!tarball) { | ||
throw new Error("Could not locate tarball"); | ||
} | ||
child_process.execFileSync("tar", ["-xzvf", path.join(__dirname, tarball)]); | ||
} |