Skip to content

Commit

Permalink
[ci] Create hermes-engine-darwin npm package
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alloy committed Jul 16, 2020
1 parent 12ab35f commit 0e26f58
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ workflows:
- android
- linux
- macos
- build-macos-runtime
- windows
- test-linux
- test-macos
Expand Down
5 changes: 5 additions & 0 deletions npm/.gitignore
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
12 changes: 12 additions & 0 deletions npm/hermes-engine-darwin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 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 package contains a Hermes bytecode compiler for macOS, plus macOS runtime
framework.

Additional tools are available in
[hermes-engine-cli](https://www.npmjs.com/package/hermes-engine-cli).
23 changes: 23 additions & 0 deletions npm/hermes-engine-darwin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"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": {
"strip-symlinks-from-framework": "rm -rf destroot/Library/Frameworks/hermes.framework/{Headers,Resources,hermes} && mv destroot/Library/Frameworks/hermes.framework/Versions/0/* destroot/Library/Frameworks/hermes.framework/ && rm -rf destroot/Library/Frameworks/hermes.framework/Versions && install_name_tool -id @rpath/hermes.framework/hermes destroot/Library/Frameworks/hermes.framework/hermes",
"prepack": "npm run-script strip-symlinks-from-framework"
},
"files": [
"LICENSE",
"README.md",
"hermes.podspec",
"destroot/bin/hermesc",
"destroot/include/**/*",
"destroot/Library/**/*"
]
}
4 changes: 4 additions & 0 deletions npm/unpack-builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ var inputs = [
{
name: "hermes-cli-darwin-v" + releaseVersion + ".tar.gz",
dest: "osx-bin"
},
{
name: "hermes-runtime-darwin-v" + releaseVersion + ".tar.gz",
dest: ".",
}
]

Expand Down

0 comments on commit 0e26f58

Please sign in to comment.