[feat] update package and loadbinding

This commit is contained in:
Jay 2020-09-11 12:24:57 +08:00
parent 0b00b55244
commit a8d1a0b4c1
5 changed files with 61 additions and 22 deletions

View File

@ -5,7 +5,7 @@ try {
// __dirname means load native addon from current dir
// 'index' means native addon name is `index`
// the value of this two arguments was decided by `build` script in `package.json`
module.exports = loadBinding(path.join(__dirname, '..', `rs-diff-${process.platform}`), 'index')
module.exports = loadBinding(path.join(__dirname, 'index', '@mtfos/rs-diff')
} catch (e) {
try {
module.exports = require(`@swc-node/core-${platform()}`)

View File

@ -1,13 +1,26 @@
{
"name": "@mtfos/rs-diff-darwin",
"version": "0.0.3",
"version": "0.0.5",
"description": "Template project for writing node package with napi-rs",
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
"license": "MIT",
"author": "Jay <jay@trj.tw>",
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"keywords": [
"napi-rs",
"NAPI",
"N-API",
"Rust",
"node-addon",
"node-addon-api"
],
"main": "index.darwin.node",
"files": ["index.darwin.node"],
"os": ["darwin"],
"cpu": ["x64"]
}
"files": [
"index.darwin.node"
],
"os": [
"darwin"
],
"cpu": [
"x64"
]
}

View File

@ -1,13 +1,26 @@
{
"name": "@mtfos/rs-diff-linux",
"version": "0.0.3",
"version": "0.0.5",
"description": "Template project for writing node package with napi-rs",
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
"license": "MIT",
"author": "Jay <jay@trj.tw>",
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"keywords": [
"napi-rs",
"NAPI",
"N-API",
"Rust",
"node-addon",
"node-addon-api"
],
"main": "index.linux.node",
"files": ["index.linux.node"],
"os": ["linux"],
"cpu": ["x64"]
}
"files": [
"index.linux.node"
],
"os": [
"linux"
],
"cpu": [
"x64"
]
}

View File

@ -1,16 +1,29 @@
{
"name": "@mtfos/rs-diff-win32",
"version": "0.0.1",
"version": "0.0.4",
"description": "Template project for writing node package with napi-rs",
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
"license": "MIT",
"author": "Jay <jay@trj.tw>",
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"keywords": [
"napi-rs",
"NAPI",
"N-API",
"Rust",
"node-addon",
"node-addon-api"
],
"main": "index.win32.node",
"files": ["index.win32.node"],
"files": [
"index.win32.node"
],
"publishConfig": {
"@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/"
},
"os": ["win32"],
"cpu": ["x64"]
}
"os": [
"win32"
],
"cpu": [
"x64"
]
}

View File

@ -1,6 +1,6 @@
{
"name": "@mtfos/rs-diff",
"version": "0.0.4",
"version": "0.0.5",
"description": "Template project for writing node package with napi-rs",
"author": "Jay <jay@trj.tw>",
"main": "index.js",
@ -45,7 +45,7 @@
"@node-rs/helper": "^0.4.0"
},
"optionalDependencies": {
"@mtfos/rs-diff-darwin": "^0.0.3",
"@mtfos/rs-diff-linux": "^0.0.3"
"@mtfos/rs-diff-darwin": "^0.0.4",
"@mtfos/rs-diff-linux": "^0.0.4"
}
}