From 0b00b55244b85d1fe284c94399b420434f68e85f Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 11 Sep 2020 12:11:54 +0800 Subject: [PATCH] upgrade dep version --- Cargo.toml | 8 +-- npm/darwin/package.json | 3 - npm/linux/package.json | 3 - package-lock.json | 138 +++++++++++++++++++++++----------------- package.json | 62 ++++++++---------- src/lib.rs | 3 +- 6 files changed, 110 insertions(+), 107 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0e62421..816e6ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,14 +11,14 @@ crate-type = ["cdylib"] [dependencies] diff = "0.1.12" -napi = { version = "0.4" } -napi-derive = { version = "0.4" } +napi = { version = "0.5.1" } +napi-derive = { version = "0.5.1" } [target.'cfg(all(unix, not(target_env = "musl")))'.dependencies] -jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] } +jemallocator = { version = "0.3.2", features = ["disable_initial_exec_tls"] } [build-dependencies] -napi-build = "0.2" +napi-build = "0.2.1" [profile.release] opt-level = 3 diff --git a/npm/darwin/package.json b/npm/darwin/package.json index 616a5a2..6a06c79 100644 --- a/npm/darwin/package.json +++ b/npm/darwin/package.json @@ -8,9 +8,6 @@ "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "main": "index.darwin.node", "files": ["index.darwin.node"], - "publishConfig": { - "@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/" - }, "os": ["darwin"], "cpu": ["x64"] } diff --git a/npm/linux/package.json b/npm/linux/package.json index ae09b2a..911d6ac 100644 --- a/npm/linux/package.json +++ b/npm/linux/package.json @@ -8,9 +8,6 @@ "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "main": "index.linux.node", "files": ["index.linux.node"], - "publishConfig": { - "@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/" - }, "os": ["linux"], "cpu": ["x64"] } diff --git a/package-lock.json b/package-lock.json index 957de87..9a90071 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "rs-diff", - "version": "0.0.1", + "name": "@mtfos/rs-diff", + "version": "0.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -100,11 +100,11 @@ } }, "@node-rs/helper": { - "version": "0.2.1", - "resolved": "https://npm.trj.tw/@node-rs%2fhelper/-/helper-0.2.1.tgz", - "integrity": "sha512-DEPYwfkkhJlVLFu6hWVGZi96jUCBahi1WoHZAC7gSFoeoJtxwJ+FrJSDx/8c9aIwAf477NnKj8bRJzFm98Me3A==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@node-rs/helper/-/helper-0.4.0.tgz", + "integrity": "sha512-fSyHEXmlt/FueKqAYiGFCnkohnQBMQwUr6VYPeZEeVBAzQzhioS1WaRe2fSpOuRKIimCQEvxhQ6fwsYxYakfGA==", "requires": { - "tslib": "^2.0.0" + "tslib": "^2.0.1" } }, "@nodelib/fs.scandir": { @@ -194,12 +194,12 @@ "dev": true }, "@octokit/plugin-rest-endpoint-methods": { - "version": "4.1.2", - "resolved": "https://npm.trj.tw/@octokit%2fplugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.1.2.tgz", - "integrity": "sha512-PTI7wpbGEZ2IR87TVh+TNWaLcgX/RsZQalFbQCq8XxYUrQ36RHyERrHSNXFy5gkWpspUAOYRSV707JJv6BhqJA==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.1.4.tgz", + "integrity": "sha512-Y2tVpSa7HjV3DGIQrQOJcReJ2JtcN9FaGr9jDa332Flro923/h3/Iu9e7Y4GilnzfLclHEh5iCQoCkHm7tWOcg==", "dev": true, "requires": { - "@octokit/types": "^5.1.1", + "@octokit/types": "^5.4.1", "deprecation": "^2.3.1" } }, @@ -231,15 +231,15 @@ } }, "@octokit/rest": { - "version": "18.0.3", - "resolved": "https://npm.trj.tw/@octokit%2frest/-/rest-18.0.3.tgz", - "integrity": "sha512-GubgemnLvUJlkhouTM2BtX+g/voYT/Mqh0SASGwTnLvSkW1irjt14N911/ABb6m1Hru0TwScOgFgMFggp3igfQ==", + "version": "18.0.5", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.0.5.tgz", + "integrity": "sha512-SPKI24tQXrr1XsnaIjv2x0rl4M5eF1+hj8+vMe3d/exZ7NnL5sTe1BuFyCyJyrc+j1HkXankvgGN9zT0rwBwtg==", "dev": true, "requires": { "@octokit/core": "^3.0.0", "@octokit/plugin-paginate-rest": "^2.2.0", "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "4.1.2" + "@octokit/plugin-rest-endpoint-methods": "4.1.4" } }, "@octokit/types": { @@ -257,6 +257,13 @@ "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", "dev": true }, + "@swc-node/core-linux-musl": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@swc-node/core-linux-musl/-/core-linux-musl-0.6.1.tgz", + "integrity": "sha512-VcQ1kdeRw1D8/uMk90wHSMJmT41Tex8iytuGKBl/bVOZ5wPD9wA3Sz5ieMgt4CNiUtVITTlpyTJuQgO526W7Ug==", + "dev": true, + "optional": true + }, "@szmarczak/http-timer": { "version": "1.1.2", "resolved": "https://npm.trj.tw/@szmarczak%2fhttp-timer/-/http-timer-1.1.2.tgz", @@ -667,7 +674,7 @@ }, "chardet": { "version": "0.7.0", - "resolved": "https://npm.trj.tw/chardet/-/chardet-0.7.0.tgz", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, @@ -756,14 +763,14 @@ }, "cli-width": { "version": "3.0.0", - "resolved": "https://npm.trj.tw/cli-width/-/cli-width-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, "clipanion": { - "version": "2.4.4", - "resolved": "https://npm.trj.tw/clipanion/-/clipanion-2.4.4.tgz", - "integrity": "sha512-KjyCBz8xplftHjIK/nOqq/9b3hPlXbAAo/AxoITrO4yySpQ6a9QSJDAfOx9PfcRUHteeqbdNxZKSPfeFqQ7plg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/clipanion/-/clipanion-2.5.0.tgz", + "integrity": "sha512-VYOMl0h/mZXQC2BWq7oBto1zY1SkPWUaJjt+cuIred1HrmrcX1I2N+LNyNoRy8Iwu9r6vUxJwS/tWLwhQW4tPw==", "dev": true }, "cliui": { @@ -817,9 +824,9 @@ "dev": true }, "commander": { - "version": "5.1.0", - "resolved": "https://npm.trj.tw/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", "dev": true }, "common-path-prefix": { @@ -886,16 +893,16 @@ "dev": true }, "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://npm.trj.tw/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", + "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", - "yaml": "^1.7.2" + "yaml": "^1.10.0" }, "dependencies": { "parse-json": { @@ -1170,7 +1177,7 @@ }, "external-editor": { "version": "3.1.0", - "resolved": "https://npm.trj.tw/external-editor/-/external-editor-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { @@ -1208,6 +1215,12 @@ "reusify": "^1.0.4" } }, + "fdir": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-4.1.0.tgz", + "integrity": "sha512-oOkohnPg4nUIkd6w22iGbFD7c7UvVnXB3a7/GHcPSsXDUGm6Jxp12bGI5O0gr0YuhDh5l/vDExdHOnrW/j9EqQ==", + "dev": true + }, "figures": { "version": "3.2.0", "resolved": "https://npm.trj.tw/figures/-/figures-3.2.0.tgz", @@ -1381,15 +1394,15 @@ "dev": true }, "husky": { - "version": "4.2.5", - "resolved": "https://npm.trj.tw/husky/-/husky-4.2.5.tgz", - "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", + "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", "dev": true, "requires": { "chalk": "^4.0.0", "ci-info": "^2.0.0", "compare-versions": "^3.6.0", - "cosmiconfig": "^6.0.0", + "cosmiconfig": "^7.0.0", "find-versions": "^3.2.0", "opencollective-postinstall": "^2.0.2", "pkg-dir": "^4.2.0", @@ -1400,7 +1413,7 @@ }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://npm.trj.tw/iconv-lite/-/iconv-lite-0.4.24.tgz", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { @@ -1489,7 +1502,7 @@ }, "inquirer": { "version": "7.3.3", - "resolved": "https://npm.trj.tw/inquirer/-/inquirer-7.3.3.tgz", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", "dev": true, "requires": { @@ -1718,20 +1731,20 @@ "dev": true }, "lint-staged": { - "version": "10.2.11", - "resolved": "https://npm.trj.tw/lint-staged/-/lint-staged-10.2.11.tgz", - "integrity": "sha512-LRRrSogzbixYaZItE2APaS4l2eJMjjf5MbclRZpLJtcQJShcvUzKXsNeZgsLIZ0H0+fg2tL4B59fU9wHIHtFIA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.3.0.tgz", + "integrity": "sha512-an3VgjHqmJk0TORB/sdQl0CTkRg4E5ybYCXTTCSJ5h9jFwZbcgKIx5oVma5e7wp/uKt17s1QYFmYqT9MGVosGw==", "dev": true, "requires": { - "chalk": "^4.0.0", - "cli-truncate": "2.1.0", - "commander": "^5.1.0", - "cosmiconfig": "^6.0.0", + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.0.0", + "cosmiconfig": "^7.0.0", "debug": "^4.1.1", "dedent": "^0.7.0", - "enquirer": "^2.3.5", - "execa": "^4.0.1", - "listr2": "^2.1.0", + "enquirer": "^2.3.6", + "execa": "^4.0.3", + "listr2": "^2.6.0", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", @@ -1741,9 +1754,9 @@ } }, "listr2": { - "version": "2.6.0", - "resolved": "https://npm.trj.tw/listr2/-/listr2-2.6.0.tgz", - "integrity": "sha512-nwmqTJYQQ+AsKb4fCXH/6/UmLCEDL1jkRAdSn9M6cEUzoRGrs33YD/3N86gAZQnGZ6hxV18XSdlBcJ1GTmetJA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", + "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -1977,13 +1990,20 @@ "dev": true }, "napi-rs": { - "version": "0.2.6", - "resolved": "https://npm.trj.tw/napi-rs/-/napi-rs-0.2.6.tgz", - "integrity": "sha512-+hjna/WShqAr7pr9+8x/16ipcs8jH4YkJ9AzHRQc0GjFETeNSZz13Rm8fSTzTxrgMDsZYl8LMQ040lLQoT8/cA==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/napi-rs/-/napi-rs-0.3.7.tgz", + "integrity": "sha512-wYBDkMq/Uw9re0gHdIkMHDYwnV2G82j5wixO5wXVw+aL5WkxvXoGHRxlg+TFUWfe6YckHeFfcHOzUpAiSEGfZg==", "dev": true, "requires": { - "clipanion": "^2.4.4", + "@octokit/rest": "^18.0.4", + "@swc-node/core-linux-musl": "^0.6.1", + "chalk": "^4.1.0", + "clipanion": "^2.5.0", + "debug": "^4.1.1", + "fdir": "^4.1.0", "inquirer": "^7.3.3", + "lodash": "^4.17.20", + "putasset": "^5.0.3", "toml": "^3.0.0", "tslib": "^2.0.1" } @@ -2093,7 +2113,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://npm.trj.tw/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -2315,9 +2335,9 @@ "dev": true }, "prettier": { - "version": "2.1.0", - "resolved": "https://npm.trj.tw/prettier/-/prettier-2.1.0.tgz", - "integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", + "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", "dev": true }, "pretty-ms": { @@ -2573,7 +2593,7 @@ }, "run-async": { "version": "2.4.1", - "resolved": "https://npm.trj.tw/run-async/-/run-async-2.4.1.tgz", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, @@ -2608,7 +2628,7 @@ }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://npm.trj.tw/safer-buffer/-/safer-buffer-2.1.2.tgz", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, @@ -2914,7 +2934,7 @@ }, "tmp": { "version": "0.0.33", - "resolved": "https://npm.trj.tw/tmp/-/tmp-0.0.33.tgz", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { @@ -2938,7 +2958,7 @@ }, "toml": { "version": "3.0.0", - "resolved": "https://npm.trj.tw/toml/-/toml-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", "dev": true }, diff --git a/package.json b/package.json index 2b5918b..5d5f6d6 100644 --- a/package.json +++ b/package.json @@ -1,60 +1,48 @@ { "name": "@mtfos/rs-diff", - "version": "0.0.3", + "version": "0.0.4", "description": "Template project for writing node package with napi-rs", "author": "Jay ", "main": "index.js", "repository": "https://git.trj.tw/nodejs/rs-diff.git", "license": "MIT", - "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], - "files": ["index.d.ts", "index.js"], - "os": ["darwin", "linux", "win32"], - "cpu": ["x64"], + "keywords": [ + "napi-rs", + "NAPI", + "N-API", + "Rust", + "node-addon", + "node-addon-api" + ], + "files": [ + "index.d.ts", + "index.js" + ], + "os": [ + "darwin", + "linux", + "win32" + ], + "cpu": [ + "x64" + ], "engines": { "node": ">= 8.9" }, - "publishConfig": { - "@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/" - }, "scripts": { - "build": "cargo build --release && napi build --platform --release ./index", - "build:debug": "cargo build && napi build --platform ./index", + "build": "cargo build --release && napi build --platform --release .", + "build:debug": "cargo build && napi build --platform .", "prepublishOnly": "node ./scripts/publish.js", "test": "ava", "version": "node ./scripts/version.js" }, "devDependencies": { - "@octokit/rest": "^18.0.3", "ava": "^3.11.1", - "chalk": "^4.1.0", - "husky": "^4.2.5", - "lint-staged": "^10.2.11", - "napi-rs": "^0.2.4", - "prettier": "^2.0.5", - "putasset": "^5.0.3", + "napi-rs": "^0.3.7", "typescript": "^3.9.7" }, "dependencies": { - "@node-rs/helper": "^0.2.1" - }, - "lint-staged": { - "*.@(js|ts|tsx)": ["prettier --write"], - "*.@(yml|yaml)": ["prettier --parser yaml --write"], - "*.md": ["prettier --parser markdown --write"], - "*.json": ["prettier --parser json --write"] - }, - "prettier": { - "printWidth": 120, - "semi": false, - "trailingComma": "all", - "singleQuote": true, - "arrowParens": "always", - "parser": "typescript" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } + "@node-rs/helper": "^0.4.0" }, "optionalDependencies": { "@mtfos/rs-diff-darwin": "^0.0.3", diff --git a/src/lib.rs b/src/lib.rs index ffb34a6..59af173 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,6 +32,7 @@ fn diff_char(ctx: CallContext) -> Result { let mut idx = 0; for it in res.iter() { let mut item = ctx.env.create_object().unwrap(); + item.set_named_property( "count", ctx.env.create_int64(it.count.try_into().unwrap()).unwrap(), @@ -40,7 +41,7 @@ fn diff_char(ctx: CallContext) -> Result { item.set_named_property("added", ctx.env.get_boolean(it.added).unwrap())?; item.set_named_property("removed", ctx.env.get_boolean(it.removed).unwrap())?; - obj.set_index(idx, item)?; + obj.set_element(idx, item)?; idx += 1; }