Cleanup entrypoints

This commit is contained in:
Nick Gerleman
2022-12-23 07:30:15 -08:00
parent b09aad433b
commit 025698132f
28 changed files with 99 additions and 63 deletions

View File

@@ -7,35 +7,37 @@
"type": "git",
"url": "git@github.com:facebook/yoga.git"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"browser": "./dist/index.wasm.js",
"node": "./dist/index.wasm.js",
"react-native": "./dist/index.asmjs.js",
"default": "./dist/index.asmjs.js"
"browser": "./dist/variants/wasm-async.js",
"node": "./dist/variants/wasm-async.js",
"default": "./dist/variants/asmjs-async.js"
},
"./sync": {
"browser": "./dist/sync.asmks.js",
"node": "./dist/sync.wasm.js",
"react-native": "./dist/sync.asmjs.js",
"default": "./dist/sync.asmjs.js"
"browser": "./dist/variants/asmjs-sync.js",
"node": "./dist/variants/wasm-sync.js",
"default": "./dist/variants/asmjs-sync.js"
}
},
"files": [
"dist/**",
"sources/**"
"src_js/**"
],
"scripts": {
"benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')",
"build": "yarn build:native && yarn build:js",
"build:native": "yarn build:native-project && cmake --build build",
"build:native-project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build",
"build:js": "babel sources --source-maps --out-dir dist && cp -r sources/*.d.ts dist",
"build:configure": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build",
"build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist",
"build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts",
"build:native": "yarn build:configure && cmake --build build",
"postinstall": "yarn build",
"test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync",
"test:asmjs": "WASM=0 SYNC=0 jest",
"test:asmjs-sync": "WASM=0 SYNC=1 jest",
"test:wasm": "WASM=1 SYNC=0 jest",
"test:wasm-sync": "WASM=1 SYNC=1 jest",
"benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')"
"test:wasm-sync": "WASM=1 SYNC=1 jest"
},
"devDependencies": {
"@babel/cli": "^7.20.7",