update package.json

This commit is contained in:
Jay 2020-08-25 11:38:13 +08:00
parent 3de862d4c4
commit 26772cadc6
5 changed files with 10 additions and 1 deletions

View File

@ -4,6 +4,7 @@
"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"],
"main": "index.darwin.node",
"files": ["index.darwin.node"],

View File

@ -4,6 +4,7 @@
"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"],
"main": "index.linux.node",
"files": ["index.linux.node"],

View File

@ -4,6 +4,7 @@
"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"],
"main": "index.win32.node",
"files": ["index.win32.node"],

View File

@ -2,6 +2,7 @@
"name": "rs-diff",
"version": "0.0.1",
"description": "Template project for writing node package with napi-rs",
"author": "Jay <jay@trj.tw>",
"main": "index.js",
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
"license": "MIT",
@ -55,5 +56,10 @@
"hooks": {
"pre-commit": "lint-staged"
}
},
"optionalDependencies": {
"rs-diff-darwin": "^0.0.1",
"rs-diff-linux": "^0.0.1",
"rs-diff-win32": "^0.0.1"
}
}

View File

@ -17,7 +17,7 @@ updatePackageJson(path.join(__dirname, '..', 'package.json'), {
for (const name of platforms) {
const pkgDir = path.join(__dirname, '..', 'npm', name)
const filename = `index.${name}.node`
const bindingFile = fs.readFileSync(path.join(__dirname, '..', `bindings-${name}`, filename))
const bindingFile = fs.readFileSync(path.join(__dirname, '..', filename))
fs.writeFileSync(path.join(pkgDir, filename), bindingFile)
execSync('npm publish', {
cwd: pkgDir,