From ef4c7f769e6996f86ed156c5168ab5685e6e291d Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sat, 21 Nov 2020 23:16:41 +0800 Subject: [PATCH] Try again --- .github/workflows/CI.yaml | 2 ++ Cargo.toml | 2 +- package.json | 42 ++++++++++----------------------------- simple-test.js | 5 ++--- yarn.lock | 9 ++++++++- 5 files changed, 23 insertions(+), 37 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8458303..1c9a342 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -188,6 +188,8 @@ jobs: build-win32-ia686: runs-on: windows-latest + env: + CARGO_PROFILE_RELEASE_OPT_LEVEL: 1 steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 45f21a4..b484c3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,4 +23,4 @@ mimalloc = {version = "0.1"} napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"} [profile.release] -opt-level = 's' +lto = true diff --git a/package.json b/package.json index fa4dadb..79a5f89 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": { @@ -59,6 +49,7 @@ "ava": "^3.13.0", "benny": "^3.6.15", "chalk": "^4.1.0", + "cross-env": "^7.0.2", "eslint": "^7.14.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", @@ -75,27 +66,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 +91,4 @@ "pre-commit": "lint-staged" } } -} \ No newline at end of file +} diff --git a/simple-test.js b/simple-test.js index ee29c87..5068d9a 100644 --- a/simple-test.js +++ b/simple-test.js @@ -1,11 +1,10 @@ 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) }) diff --git a/yarn.lock b/yarn.lock index c65e6ff..ea79c43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -942,6 +942,13 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +cross-env@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9" + integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -953,7 +960,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==