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 ,
2023-02-23 11:14:34 +00:00
"main" : "dist/index.js" ,
"types" : "dist/index.d.ts" ,
2020-11-17 22:53:17 +00:00
"files" : [
2023-02-23 11:14:34 +00:00
"dist/"
2020-11-17 22:53:17 +00:00
] ,
2020-05-17 10:03:54 +00:00
"scripts" : {
2023-02-25 09:27:52 +00:00
"//0" : "# Setting ENABLE_WASM_EXTENSIONS=true causes a second module to be built as well," ,
"//1" : "# that utilizes WebAssembly extensions, instead of it just being a 'fake' - a copy" ,
"//2" : "# of the 'vanilla' one." ,
"//3" : "# Unfortunately, we have to set `$RUSTFLAGS` here, instead of in `.cargo/config.toml`" ,
"//4" : "# (for example), because it's not yet possible to specify them per-profile:" ,
"//5" : "# https://github.com/rust-lang/cargo/issues/10271" ,
"//6" : "# Enabling `build-std` would also be great, but it's not stable yet." ,
2023-02-25 09:26:17 +00:00
"prebuild" : "npm run build:wasm-vanilla && npm run build:wasm-extensions" ,
2021-12-09 14:58:12 +00:00
2023-03-24 21:09:57 +00:00
"build:wasm-vanilla" : "cross-env OUT_NAME=ruffle_web CARGO_PROFILE=web-vanilla-wasm RUSTFLAGS=\"$RUSTFLAGS --cfg=web_sys_unstable_apis -Aunknown_lints\" npm run build:wasm" ,
2021-12-09 14:58:12 +00:00
2023-02-25 09:27:52 +00:00
"//7" : "# Dispatches to either building the real, or copying the fake (stand-in)," ,
"//8" : "# 'with-extensions' module." ,
2023-02-25 09:22:33 +00:00
"build:wasm-extensions" : "node -e \"process.exit(process.env.ENABLE_WASM_EXTENSIONS == 'true' ? 0 : 1)\" && npm run build:wasm-extensions-real || npm run build:wasm-extensions-fake" ,
2023-03-24 21:09:57 +00:00
"build:wasm-extensions-real" : "echo \"Building module with WebAssembly extensions\" && cross-env OUT_NAME=ruffle_web-wasm_extensions CARGO_PROFILE=web-wasm-extensions RUSTFLAGS=\"$RUSTFLAGS --cfg=web_sys_unstable_apis -Aunknown_lints -C target-feature=+bulk-memory,+simd128,+nontrapping-fptoint,+sign-ext,+reference-types\" WASM_BINDGEN_FLAGS=\"--reference-types\" WASM_OPT_FLAGS=\"--enable-reference-types\" npm run build:wasm" ,
2023-02-25 09:22:33 +00:00
"build:wasm-extensions-fake" : "echo \"Copying the vanilla module as stand-in\" && shx cp dist/ruffle_web_bg.wasm dist/ruffle_web-wasm_extensions_bg.wasm && shx cp dist/ruffle_web_bg.wasm.d.ts dist/ruffle_web-wasm_extensions_bg.wasm.d.ts && shx cp dist/ruffle_web.js dist/ruffle_web-wasm_extensions.js && shx cp dist/ruffle_web.d.ts dist/ruffle_web-wasm_extensions.d.ts" ,
2022-01-08 03:45:18 +00:00
2023-02-25 09:27:52 +00:00
"//9" : "# This just chains together the three commands after it." ,
2023-02-25 09:22:33 +00:00
"build:wasm" : "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" ,
2023-02-25 09:17:50 +00:00
"build:wasm-bindgen" : "cross-env-shell wasm-bindgen \"../../../target/wasm32-unknown-unknown/${CARGO_PROFILE}/ruffle_web.wasm\" --target web --out-dir dist --out-name \"$OUT_NAME\" $WASM_BINDGEN_FLAGS" ,
"build:wasm-opt" : "cross-env-shell wasm-opt -o \"dist/${OUT_NAME}_bg.wasm\" -O -g \"dist/${OUT_NAME}_bg.wasm\" $WASM_OPT_FLAGS || npm run build:wasm-opt-failed" ,
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
2023-03-26 07:40:10 +00:00
"build" : "tsc --build --force" ,
2023-02-25 09:26:17 +00:00
"postbuild" : "node tools/set_version.js" ,
2020-11-17 23:12:17 +00:00
"docs" : "typedoc" ,
2023-04-01 08:49:11 +00:00
"test" : "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\",\\\"verbatimModuleSyntax\\\":false} mocha"
2020-05-17 22:37:33 +00:00
} ,
2021-12-09 14:58:12 +00:00
"dependencies" : {
2023-03-12 21:24:42 +00:00
"wasm-feature-detect" : "^1.5.1"
2021-12-09 14:58:12 +00:00
} ,
2020-05-17 22:37:33 +00:00
"devDependencies" : {
2023-04-01 06:04:27 +00:00
"@tsconfig/strictest" : "^2.0.0" ,
2022-12-01 20:02:27 +00:00
"@types/mocha" : "^10.0.1" ,
2023-03-12 21:24:42 +00:00
"eslint" : "^8.36.0" ,
2023-04-23 20:03:53 +00:00
"eslint-plugin-jsdoc" : "^43.0.0" ,
2023-01-03 04:19:16 +00:00
"mocha" : "^10.2.0" ,
2022-06-06 14:24:43 +00:00
"replace-in-file" : "^6.3.5" ,
2023-03-12 21:24:42 +00:00
"shx" : "^0.3.4" ,
2022-10-02 11:23:54 +00:00
"ts-node" : "^10.9.1" ,
2023-04-23 20:49:34 +00:00
"typedoc" : "^0.24.0" ,
2023-04-01 06:04:27 +00:00
"typescript" : "^5.0.0"
2023-04-24 10:27:03 +00:00
} ,
"sideEffects" : false
2020-05-16 21:34:52 +00:00
}