Update deps

This commit is contained in:
Luis Blanco 2022-09-24 19:02:48 +04:00
parent c4d42eea40
commit 847a68a2d2
15 changed files with 6133 additions and 3776 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
test/binding.gyp linguist-vendored

View File

@ -25,7 +25,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 14.16.0
node-version: 16.17.0
- name: Get Npm Version
id: package-version
@ -43,6 +43,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.current-version}}
tag_name: ${{ steps.package-version.outputs.current-version }}
release_name: ${{ github.event.inputs.name }}
body: ${{ github.event.inputs.text }}

View File

@ -9,22 +9,26 @@ on:
- master
jobs:
Validate:
validate:
name: Validate
strategy:
matrix:
os: [ubuntu-16.04, windows-latest, macos-10.15]
os: [ubuntu-20.04, windows-2022, macos-11]
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.16.0
node-version: 16.17.0
cache: 'npm'
- name: Install Modules
run: npm ci
@ -32,8 +36,8 @@ jobs:
- name: Build Sample Addon
run: npm run test-build
- name: Run Lint
run: npm run eslint
- name: Run Unit Tests
run: npm run test-ci
- name: Run ESLint
run: npm run eslint

2
.gitignore vendored
View File

@ -4,8 +4,6 @@
.DS_Store
.project
.DS_Store
.vscode
.eslintrc
node_modules/
test/build/
doc/jest/

22
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/node_modules/node-addon-api",
"${LocalAppData}/node-gyp/Cache/16.17.0/include/node"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 Luis Blanco
Copyright (c) 2022 Luis Blanco
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -16,7 +16,7 @@ A snippet for **src/package.json**:
"build": "node-gyp rebuild && node -e \"require('addon-tools-raub/cpbin')('ADDON')\""
},
"dependencies": {
"addon-tools-raub": "5.0.0",
"addon-tools-raub": "6.0.0",
"DEPS": "1.0.0"
}
}

8
download.d.ts vendored
View File

@ -5,14 +5,14 @@ declare module "addon-tools-raub/download" {
* when the file is loaded. Use for small files, as the whole
* file will be loaded into memory at once.
*
* ```
* ```
* download(srcUrl).then(data => useData(data), err => emit('error', err));
* ```
* ```
* or
* ```
* ```
* const data = await download(srcUrl);
* useData(data);
* ```
* ```
*/
const download: (url: string) => Promise<Buffer>;
export = download;

View File

@ -10,19 +10,15 @@ const protocols = { http, https };
module.exports = url => new Promise((res, rej) => {
url = url.toLowerCase();
const stream = new WritableBuffer();
const proto = protocols[url.match(/^https?/)[0]];
proto.get(url, response => {
response.pipe(stream);
response.on('end', () => res(stream.get()));
response.on('error', err => rej(err));
});
});

View File

@ -185,7 +185,7 @@
#define REQ_ARRV_ARG(I, VAR) \
CHECK_REQ_ARG(I, IsArrayBuffer(), "ArrayBuffer"); \
CHECK_REQ_ARG(I, IsArrayBuffer(), "ArrayBuffer"); \
Napi::ArrayBuffer VAR = info[I].As<Napi::ArrayBuffer>();

View File

@ -19,7 +19,7 @@ if ( ! platformName ) {
const rootPath = __dirname.replace(/\\/g, '/');
const napiInclude = napi.include.replace(/\\/g, '/');
const napiInclude = napi.include_dir.replace(/\\/g, '/');
const thisInclude = `${rootPath}/include`;
const includePath = `${napiInclude} ${thisInclude}`;

View File

@ -4,7 +4,6 @@
const https = require('https');
const http = require('http');
const fs = require('fs');
const AdmZip = require('adm-zip');
const { bin, platform } = require('.');
@ -23,7 +22,6 @@ const zipPath = `${bin}/${bin}.zip`;
const install = async (url, count = 1) => {
try {
const proto = protocols[url.match(/^https?/)[0]];
const response = await new Promise((res, rej) => {
@ -64,7 +62,6 @@ const install = async (url, count = 1) => {
} catch (ex) {
onError(ex.message);
}
};

9811
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"author": "Luis Blanco <luisblanco1337@gmail.com>",
"name": "addon-tools-raub",
"version": "5.3.4",
"version": "6.0.0",
"description": "Helpers for Node.js addons and dependency packages",
"license": "MIT",
"main": "index.js",
@ -36,8 +36,8 @@
"README.md"
],
"engines": {
"node": ">=14.16.0",
"npm": ">=6.14.1"
"node": ">=16.17.0",
"npm": ">=8.15.0"
},
"scripts": {
"eslint": "eslint .",
@ -66,15 +66,17 @@
"type": "git",
"url": "https://github.com/node-3d/addon-tools-raub.git"
},
"dependencies": {
"adm-zip": "0.5.4",
"node-addon-api": "3.1.0"
"peerDependencies": {
"adm-zip": "~0.5.9",
"node-addon-api": "~5.0.0"
},
"devDependencies": {
"eslint": "7.23.0",
"eslint-plugin-jest": "24.3.3",
"eslint-plugin-node": "11.1.0",
"jest": "26.6.3",
"typescript": "4.2.4"
"adm-zip": "~0.5.9",
"eslint-plugin-jest": "~27.0.4",
"eslint-plugin-node": "~11.1.0",
"eslint": "~8.24.0",
"jest": "~29.0.3",
"node-addon-api": "~5.0.0",
"typescript": "~4.8.3"
}
}

View File

@ -229,7 +229,6 @@ JS_METHOD(reqTypedArg) { NAPI_ENV;
);
Napi::Object init(Napi::Env env, Napi::Object exports) {
TEST_SET_METHOD(empty);
TEST_SET_METHOD(throwing);
@ -291,7 +290,6 @@ Napi::Object init(Napi::Env env, Napi::Object exports) {
TEST_SET_METHOD(reqTypedArg);
return exports;
}
NODE_API_MODULE(test, init)