forked from shuding/yoga-wasm-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bitfrost/bun
expose yoga.wasm in a bun --compile friendly way
- Loading branch information
Showing
8 changed files
with
256 additions
and
161 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
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,56 @@ | ||
name: "release" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
parameter: | ||
description: hello | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Compile C++ to wasm | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: mymindstorm/setup-emsdk@v12 | ||
with: | ||
version: 3.1.31 | ||
actions-cache-folder: "emsdk-cache" | ||
- name: Use pnpm | ||
run: corepack enable pnpm && pnpm --version | ||
- name: Install | ||
run: pnpm install | ||
- name: Build | ||
run: pnpm build | ||
- name: Upload bundle | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bundle | ||
path: dist | ||
test: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [18, 20] | ||
name: Test node v${{ matrix.node }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use pnpm | ||
run: corepack enable pnpm && pnpm --version | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Download bundle | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: bundle | ||
path: dist | ||
- name: Install | ||
run: pnpm install | ||
- name: Type check | ||
run: pnpm typecheck | ||
- name: Test | ||
run: pnpm test |
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ dist/* | |
!dist/index.d.ts | ||
!dist/asm.d.ts | ||
!dist/auto.d.ts | ||
!dist/bun.js |
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,4 @@ | ||
#//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} | ||
#@bitfrost:registry=https://npm.pkg.github.com | ||
registry=https://registry.npmjs.org | ||
#always-auth=true |
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 @@ | ||
nodejs 20.10.0 | ||
pnpm 8.15.5 | ||
python 3.11.3 | ||
# asdf plugin add emsdk https://github.com/RobLoach/asdf-emsdk.git | ||
emsdk 3.1.50 | ||
|
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,11 @@ | ||
import { readFile } from "node:fs/promises"; | ||
import initYoga from "./index.js"; | ||
|
||
import yogaFile from './yoga.wasm'; | ||
|
||
const Yoga = await initYoga( | ||
await readFile(yogaFile) | ||
); | ||
|
||
export * from "../yoga/javascript/src_js/generated/YGEnums.js"; | ||
export default Yoga; |
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
Oops, something went wrong.