2020-05-16 21:34:52 +00:00
{
2020-05-17 10:03:54 +00:00
"name" : "ruffle-core" ,
"version" : "0.1.0" ,
"description" : "Core bindings for Ruffle" ,
2020-05-26 09:10:44 +00:00
"license" : "(MIT OR Apache-2.0)" ,
2022-01-07 14:52:35 +00:00
"private" : true ,
2020-11-13 20:40:15 +00:00
"main" : "./pkg/index.js" ,
"types" : "./pkg/index.d.ts" ,
2020-11-17 22:53:17 +00:00
"files" : [
"pkg/"
] ,
2020-05-17 10:03:54 +00:00
"scripts" : {
2021-12-09 14:58:12 +00:00
"build" : "npm run build:ruffle_web && npm run build:ruffle_web-wasm_extensions && npm run build:ts" ,
2022-01-08 03:45:18 +00:00
"//1" : "# Setting ENABLE_WASM_EXTENSIONS=true causes a second module to be built as well, that utilizes WebAssembly extensions, instead of it just being a 'fake' - a copy of the 'vanilla' one." ,
"//2" : "# Unfortunately, we have to set $RUSTFLAGS here, instead of in .cargo/config.toml (for example), because it's not possible to specify them per-profile; see cargo issue #7878." ,
"//3" : "# Enabling 'build-std' would also be great, but it's not stable yet." ,
2021-12-09 14:58:12 +00:00
2022-05-16 02:40:33 +00:00
"build:ruffle_web" : "cross-env OUT_NAME=ruffle_web CARGO_PROFILE=web-vanilla-wasm RUSTFLAGS=\"--cfg=web_sys_unstable_apis -Aunknown_lints\" npm run build:cargo_bindgen_opt" ,
2021-12-09 14:58:12 +00:00
2022-01-08 03:45:18 +00:00
"//4" : "# Dispatches to either building the real, or copying the fake (stand-in), 'with-extensions' module." ,
"build:ruffle_web-wasm_extensions" : "node -e \"process.exit(process.env.ENABLE_WASM_EXTENSIONS == 'true' ? 0 : 1)\" && npm run build:ruffle_web-wasm_extensions-real || npm run build:ruffle_web-wasm_extensions-fake" ,
2022-05-17 19:26:41 +00:00
"build:ruffle_web-wasm_extensions-real" : "echo \"Building module with WebAssembly extensions\" && cross-env OUT_NAME=ruffle_web-wasm_extensions CARGO_PROFILE=web-wasm-extensions RUSTFLAGS=\"--cfg=web_sys_unstable_apis -Aunknown_lints -C target-feature=+bulk-memory,+simd128,+nontrapping-fptoint,+sign-ext\" npm run build:cargo_bindgen_opt" ,
2022-01-08 03:45:18 +00:00
"build:ruffle_web-wasm_extensions-fake" : "echo \"Copying the vanilla module as stand-in\" && shx cp ./pkg/ruffle_web_bg.wasm ./pkg/ruffle_web-wasm_extensions_bg.wasm && shx cp ./pkg/ruffle_web_bg.wasm.d.ts ./pkg/ruffle_web-wasm_extensions_bg.wasm.d.ts && shx cp ./pkg/ruffle_web.js ./pkg/ruffle_web-wasm_extensions.js && shx cp ./pkg/ruffle_web.d.ts ./pkg/ruffle_web-wasm_extensions.d.ts" ,
"//5" : "# This just chains together the three commands after it." ,
2021-12-09 14:58:12 +00:00
"build:cargo_bindgen_opt" : "npm run build:cargo && npm run build:wasm-bindgen && npm run build:wasm-opt" ,
2022-07-30 03:08:22 +00:00
"build:cargo" : "cross-env-shell cargo build --profile \"$CARGO_PROFILE\" --target wasm32-unknown-unknown --features \\\"$CARGO_FEATURES\\\" $CARGO_FLAGS" ,
2022-01-13 07:25:34 +00:00
"build:wasm-bindgen" : "cross-env-shell wasm-bindgen \"../../../target/wasm32-unknown-unknown/${CARGO_PROFILE}/ruffle_web.wasm\" --target web --out-dir ./pkg --out-name \"$OUT_NAME\"" ,
2022-01-08 03:45:18 +00:00
"build:wasm-opt" : "cross-env-shell wasm-opt -o \"./pkg/${OUT_NAME}_bg.wasm\" -O -g \"./pkg/${OUT_NAME}_bg.wasm\" || npm run build:wasm-opt-failed" ,
2021-12-09 14:58:12 +00:00
2021-12-17 14:18:56 +00:00
"build:wasm-opt-failed" : "echo 'NOTE: Since wasm-opt could not be found (or it failed), the resulting module might not perform that well, but it should still work.' && echo ; [ \"$CI\" != true ] # > nul" ,
2021-12-09 14:58:12 +00:00
2020-11-19 23:23:38 +00:00
"build:ts" : "tsc -d && node tools/set_version.js" ,
2020-11-17 23:12:17 +00:00
"docs" : "typedoc" ,
2021-06-24 17:36:11 +00:00
"test" : "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\"} mocha"
2020-05-17 22:37:33 +00:00
} ,
2021-12-09 14:58:12 +00:00
"dependencies" : {
"wasm-feature-detect" : "^1.2.11"
} ,
2020-05-17 22:37:33 +00:00
"devDependencies" : {
2022-05-01 20:46:54 +00:00
"@types/mocha" : "^9.1.1" ,
2022-08-02 09:17:49 +00:00
"@typescript-eslint/eslint-plugin" : "^5.32.0" ,
2022-08-02 13:13:32 +00:00
"@typescript-eslint/parser" : "^5.32.0" ,
2022-08-02 12:06:11 +00:00
"eslint" : "^8.21.0" ,
2022-08-02 06:22:07 +00:00
"eslint-plugin-jsdoc" : "^39.3.4" ,
2022-05-01 22:10:31 +00:00
"mocha" : "^10.0.0" ,
2022-06-06 14:24:43 +00:00
"replace-in-file" : "^6.3.5" ,
2022-01-08 03:45:18 +00:00
"shx" : "^0.3.3" ,
2022-04-01 20:59:18 +00:00
"ts-node" : "^10.7.0" ,
2022-08-02 11:31:06 +00:00
"typedoc" : "^0.23.10" ,
2022-06-06 14:26:08 +00:00
"typescript" : "^4.7.3"
2020-05-17 10:03:54 +00:00
}
2020-05-16 21:34:52 +00:00
}