diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8458303..2dc5d8d 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -186,8 +186,10 @@ jobs: name: bindings-linux-aarch64 path: ${{ env.APP_NAME }}.*.node - build-win32-ia686: + build-win32-i686: runs-on: windows-latest + env: + CARGO_PROFILE_RELEASE_OPT_LEVEL: 0 steps: - uses: actions/checkout@v2 @@ -243,9 +245,7 @@ jobs: run: yarn build --target i686-pc-windows-msvc - name: Test binary - run: | - node -v - node simple-test.js + run: yarn test - name: Upload artifact uses: actions/upload-artifact@v2 @@ -385,7 +385,7 @@ jobs: - test - test-musl - test-aarch64 - - build-win32-ia686 + - build-win32-i686 runs-on: ubuntu-latest steps: - name: auto-merge @@ -401,7 +401,7 @@ jobs: - test - test-musl - test-aarch64 - - build-win32-ia686 + - build-win32-i686 steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 45f21a4..16726b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -napi = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} -napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} +napi = {git = "https://github.com/napi-rs/napi-rs"} +napi-derive = {git = "https://github.com/napi-rs/napi-rs"} [target.'cfg(all(unix, not(target_env = "musl")))'.dependencies] jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} @@ -20,7 +20,7 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc = {version = "0.1"} [build-dependencies] -napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} +napi-build = {git = "https://github.com/napi-rs/napi-rs"} [profile.release] -opt-level = 's' +lto = true diff --git a/package.json b/package.json index 049a96f..9f19fdc 100644 --- a/package.json +++ b/package.json @@ -5,18 +5,8 @@ "main": "index.js", "repository": "git@github.com:napi-rs/package-template.git", "license": "MIT", - "keywords": [ - "napi-rs", - "NAPI", - "N-API", - "Rust", - "node-addon", - "node-addon-api" - ], - "files": [ - "index.d.ts", - "index.js" - ], + "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], + "files": ["index.d.ts", "index.js"], "napi": { "name": "package-template", "triples": { @@ -75,27 +65,14 @@ "@node-rs/helper": "^1.0.0-alpha.1" }, "lint-staged": { - "*.@(js|ts|tsx)": [ - "prettier --write", - "eslint -c .eslintrc.yml --fix" - ], - "*.@(yml|yaml)": [ - "prettier --parser yaml --write" - ], - "*.md": [ - "prettier --parser markdown --write" - ], - "*.json": [ - "prettier --parser json --write" - ] + "*.@(js|ts|tsx)": ["prettier --write", "eslint -c .eslintrc.yml --fix"], + "*.@(yml|yaml)": ["prettier --parser yaml --write"], + "*.md": ["prettier --parser markdown --write"], + "*.json": ["prettier --parser json --write"] }, "ava": { - "require": [ - "ts-node/register/transpile-only" - ], - "extensions": [ - "ts" - ], + "require": ["ts-node/register/transpile-only"], + "extensions": ["ts"], "environmentVariables": { "TS_NODE_PROJECT": "./tsconfig.json" } @@ -113,4 +90,4 @@ "pre-commit": "lint-staged" } } -} \ No newline at end of file +} diff --git a/simple-test.js b/simple-test.js index ee29c87..7371241 100644 --- a/simple-test.js +++ b/simple-test.js @@ -1,11 +1,9 @@ const { exec } = require('child_process') -const { stderr } = require('process') exec(`node -e "console.log(require('./index.js'))"`, (err, stdout, stderr) => { + console.info(stdout) + console.info(stderr) if (err) { - console.error(err) process.exit(1) } - console.info(stdout) - console.info(stderr) })