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

View File

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

2
.gitignore vendored
View File

@ -4,8 +4,6 @@
.DS_Store .DS_Store
.project .project
.DS_Store .DS_Store
.vscode
.eslintrc
node_modules/ node_modules/
test/build/ test/build/
doc/jest/ 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 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal 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')\"" "build": "node-gyp rebuild && node -e \"require('addon-tools-raub/cpbin')('ADDON')\""
}, },
"dependencies": { "dependencies": {
"addon-tools-raub": "5.0.0", "addon-tools-raub": "6.0.0",
"DEPS": "1.0.0" "DEPS": "1.0.0"
} }
} }

View File

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

View File

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

View File

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

9825
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>", "author": "Luis Blanco <luisblanco1337@gmail.com>",
"name": "addon-tools-raub", "name": "addon-tools-raub",
"version": "5.3.4", "version": "6.0.0",
"description": "Helpers for Node.js addons and dependency packages", "description": "Helpers for Node.js addons and dependency packages",
"license": "MIT", "license": "MIT",
"main": "index.js", "main": "index.js",
@ -36,8 +36,8 @@
"README.md" "README.md"
], ],
"engines": { "engines": {
"node": ">=14.16.0", "node": ">=16.17.0",
"npm": ">=6.14.1" "npm": ">=8.15.0"
}, },
"scripts": { "scripts": {
"eslint": "eslint .", "eslint": "eslint .",
@ -66,15 +66,17 @@
"type": "git", "type": "git",
"url": "https://github.com/node-3d/addon-tools-raub.git" "url": "https://github.com/node-3d/addon-tools-raub.git"
}, },
"dependencies": { "peerDependencies": {
"adm-zip": "0.5.4", "adm-zip": "~0.5.9",
"node-addon-api": "3.1.0" "node-addon-api": "~5.0.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "7.23.0", "adm-zip": "~0.5.9",
"eslint-plugin-jest": "24.3.3", "eslint-plugin-jest": "~27.0.4",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "~11.1.0",
"jest": "26.6.3", "eslint": "~8.24.0",
"typescript": "4.2.4" "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) { Napi::Object init(Napi::Env env, Napi::Object exports) {
TEST_SET_METHOD(empty); TEST_SET_METHOD(empty);
TEST_SET_METHOD(throwing); TEST_SET_METHOD(throwing);
@ -291,7 +290,6 @@ Napi::Object init(Napi::Env env, Napi::Object exports) {
TEST_SET_METHOD(reqTypedArg); TEST_SET_METHOD(reqTypedArg);
return exports; return exports;
} }
NODE_API_MODULE(test, init) NODE_API_MODULE(test, init)