Add peer meta
This commit is contained in:
parent
f9fe9f0124
commit
9857670794
|
@ -3,6 +3,7 @@
|
|||
There is a C++ header file, `addon-tools.hpp`, shipped with this package. It
|
||||
introduces several useful macros and utilities. Also it includes **Napi**
|
||||
implicitly, so you can replace:
|
||||
|
||||
```
|
||||
#include <napi.h>
|
||||
```
|
||||
|
|
|
@ -31,7 +31,6 @@ public:
|
|||
JS_DECLARE_METHOD(ClassName, ClassName, destroy);
|
||||
|
||||
bool _isDestroyed;
|
||||
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -62,13 +61,10 @@ void ClassName::init(Napi::Env env, Napi::Object exports) {
|
|||
}
|
||||
|
||||
ClassName::ClassName(const Napi::CallbackInfo &info) { NAPI_ENV;
|
||||
|
||||
super(info);
|
||||
|
||||
_isDestroyed = false;
|
||||
|
||||
// ...
|
||||
|
||||
}
|
||||
|
||||
ClassName::~ClassName() {
|
||||
|
|
|
@ -73,12 +73,12 @@ directory. E.g. on Windows it will be **bin-windows**.
|
|||
```
|
||||
|
||||
|
||||
Publishing binaries is done by attaching a zipped platform folder to the Github
|
||||
Publishing binaries is done by attaching a zipped platform folder to the GitHub
|
||||
release. Zip file must NOT contain platform folder as a subfolder, but rather
|
||||
contain the final binaries. The tag of the release should be the same as in
|
||||
`npm_package_config_install` - that is the way installer will find it.
|
||||
|
||||
> NOTE: You can publish your binaries to anywhere, not necessarily Github.
|
||||
> NOTE: You can publish your binaries to anywhere, not necessarily GitHub.
|
||||
Just tweak **YOUR install.js** script as appropriate. The only limitation
|
||||
from **Addon Tools** is that it should be a zipped set of files/folders.
|
||||
|
||||
|
|
8
index.js
8
index.js
|
@ -1,6 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
const napi = require('node-addon-api');
|
||||
let napi = null;
|
||||
try {
|
||||
napi = require('node-addon-api');
|
||||
} catch (ex) {
|
||||
console.error('To build addons, `node-addon-api` module is required.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
const platformNames = {
|
||||
|
|
10
install.js
10
install.js
|
@ -1,10 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
|
||||
const https = require('https');
|
||||
const http = require('http');
|
||||
const fs = require('fs');
|
||||
const AdmZip = require('adm-zip');
|
||||
|
||||
let AdmZip = null;
|
||||
try {
|
||||
AdmZip = require('adm-zip');
|
||||
} catch (ex) {
|
||||
console.error('The `install` script requires `adm-zip` module to be installed.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const { bin, platform } = require('.');
|
||||
const { mkdir, rm } = require('./utils');
|
||||
|
|
|
@ -70,6 +70,10 @@
|
|||
"adm-zip": "^0.5.9",
|
||||
"node-addon-api": "^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"adm-zip": { "optional": true },
|
||||
"node-addon-api": { "optional": true }
|
||||
},
|
||||
"devDependencies": {
|
||||
"adm-zip": "^0.5.9",
|
||||
"eslint-plugin-jest": "^27.0.4",
|
||||
|
|
Loading…
Reference in New Issue