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)" ,
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-01-15 20:59:25 +00:00
"build" : "npm run build:cargo && npm run build:wasm-bindgen && npm run build:wasm-opt && npm run build:ts" ,
2021-07-16 21:55:53 +00:00
"build:cargo" : "cross-env-shell \"cargo build --release --target wasm32-unknown-unknown --features \\\"$CARGO_FEATURES\\\"\"" ,
2021-01-15 22:25:47 +00:00
"build:wasm-bindgen" : "wasm-bindgen ../../../target/wasm32-unknown-unknown/release/ruffle_web.wasm --target web --out-dir ./pkg --out-name ruffle_web" ,
2021-02-14 19:15:26 +00:00
"build:wasm-opt" : "wasm-opt -o ./pkg/ruffle_web_bg.wasm -O -g ./pkg/ruffle_web_bg.wasm || npm run build:wasm-opt-failed" ,
web: Fix build without wasm-opt on Windows
Since #3111, `wasm-opt` became mandatory on GitHub Actions. But the
check whether we run on GitHub Actions is Bash-specific, and fails
on Windows. That means builds on Windows without `wasm-opt` always
fail.
As a workaround, use the trick from https://gist.github.com/prail/24acc95908e581722c0e9df5795180f6
to run the check only on Unix, and skip it on Windows:
```
echo ; [ \"$GITHUB_ACTIONS\" != true ] # > nul
```
On Unix, `echo` does nothing, the check runs, and the rest is
considered a comment.
On Windows, `echo` prints everything until the `> nul`, which
suppresses the print by redirection, making the whole statement
effectively a no-op.
2021-07-02 10:15:22 +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 ; [ \"$GITHUB_ACTIONS\" != true ] # > nul" ,
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
} ,
"devDependencies" : {
2021-06-19 19:28:48 +00:00
"@types/mocha" : "^8.2.2" ,
2021-07-01 20:02:04 +00:00
"@typescript-eslint/eslint-plugin" : "^4.28.1" ,
2021-08-01 21:13:22 +00:00
"@typescript-eslint/parser" : "^4.28.5" ,
2021-06-19 19:28:48 +00:00
"eslint" : "^7.29.0" ,
2021-07-01 20:04:47 +00:00
"eslint-plugin-jsdoc" : "^35.4.1" ,
2021-08-01 20:09:17 +00:00
"mocha" : "^9.0.3" ,
2021-06-19 19:28:48 +00:00
"replace-in-file" : "^6.2.0" ,
"ts-node" : "^10.0.0" ,
2021-07-01 20:01:08 +00:00
"typedoc" : "^0.21.2" ,
2021-06-19 19:28:48 +00:00
"typescript" : "^4.3.4"
2020-05-17 10:03:54 +00:00
}
2020-05-16 21:34:52 +00:00
}