Update net-keepalive and pkg, Node.js >= v10.20.0 (steps towards Node.js v14)

Change-type: minor
This commit is contained in:
Paulo Castro 2020-07-13 18:03:37 +01:00 committed by Balena CI
parent b0dce6b477
commit a6a8dc822f
5 changed files with 2596 additions and 3047 deletions

5611
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,6 @@
"build/",
"doc/",
"lib/",
"patches0/",
"patches/",
"*.md",
"npm-shrinkwrap.json",
@ -83,7 +82,7 @@
"author": "Juan Cruz Viotti <juan@balena.io>",
"license": "Apache-2.0",
"engines": {
"node": ">=10.0.0"
"node": ">=10.20.0"
},
"husky": {
"hooks": {
@ -168,7 +167,7 @@
"mock-require": "^3.0.3",
"nock": "^12.0.3",
"parse-link-header": "~1.0.1",
"pkg": "^4.4.8",
"pkg": "^4.4.9",
"publish-release": "^1.6.1",
"rewire": "^4.0.1",
"simple-git": "^1.131.0",
@ -268,7 +267,7 @@
"window-size": "^1.1.0"
},
"optionalDependencies": {
"net-keepalive": "^1.2.1",
"net-keepalive": "^1.3.2",
"windosu": "^0.3.0"
}
}

View File

@ -62,7 +62,7 @@ index a9d4276..4ac508f 100644
File /r bin
File /r client
diff --git a/node_modules/@oclif/dev-cli/lib/tarballs/build.js b/node_modules/@oclif/dev-cli/lib/tarballs/build.js
index 3e613e0..18a9b1a 100644
index 3e613e0..4059ff4 100644
--- a/node_modules/@oclif/dev-cli/lib/tarballs/build.js
+++ b/node_modules/@oclif/dev-cli/lib/tarballs/build.js
@@ -17,8 +17,11 @@ const pack = async (from, to) => {
@ -78,7 +78,7 @@ index 3e613e0..18a9b1a 100644
const packCLI = async () => {
const stdout = await qq.x.stdout('npm', ['pack', '--unsafe-perm'], { cwd: c.root });
return path.join(c.root, stdout.split('\n').pop());
@@ -34,6 +37,45 @@ async function build(c, options = {}) {
@@ -34,6 +37,44 @@ async function build(c, options = {}) {
await qq.mv(f, '.');
await qq.rm('package', tarball, 'bin/run.cmd');
};
@ -98,7 +98,6 @@ index 3e613e0..18a9b1a 100644
+ 'npm-shrinkwrap.json',
+ 'package.json',
+ 'patches',
+ 'patches0',
+ 'typings',
+ 'oclif.manifest.json',
+ ];
@ -124,7 +123,7 @@ index 3e613e0..18a9b1a 100644
const updatePJSON = async () => {
qq.cd(c.workspace());
const pjson = await qq.readJSON('package.json');
@@ -56,7 +98,13 @@ async function build(c, options = {}) {
@@ -56,7 +97,13 @@ async function build(c, options = {}) {
lockpath = qq.join(c.root, 'npm-shrinkwrap.json');
}
await qq.cp(lockpath, '.');
@ -139,7 +138,7 @@ index 3e613e0..18a9b1a 100644
}
};
const buildTarget = async (target) => {
@@ -71,7 +119,8 @@ async function build(c, options = {}) {
@@ -71,7 +118,8 @@ async function build(c, options = {}) {
output: path.join(workspace, 'bin', 'node'),
platform: target.platform,
arch: target.arch,
@ -149,7 +148,7 @@ index 3e613e0..18a9b1a 100644
});
if (options.pack === false)
return;
@@ -124,7 +173,8 @@ async function build(c, options = {}) {
@@ -124,7 +172,8 @@ async function build(c, options = {}) {
await qq.writeJSON(c.dist(config.s3Key('manifest')), manifest);
};
log_1.log(`gathering workspace for ${config.bin} to ${c.workspace()}`);

View File

@ -0,0 +1,14 @@
diff --git a/node_modules/net-keepalive/node_modules/node-gyp-build/index.js b/node_modules/net-keepalive/node_modules/node-gyp-build/index.js
index 3e39703..5e84906 100644
--- a/node_modules/net-keepalive/node_modules/node-gyp-build/index.js
+++ b/node_modules/net-keepalive/node_modules/node-gyp-build/index.js
@@ -29,6 +29,9 @@ load.path = function (dir) {
if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']
} catch (err) {}
+ // pkg fix: native node modules are located externally to the pkg executable
+ dir = dir.replace(/^\/snapshot\/.+?\/node_modules\//, path.dirname(process.execPath) + path.sep)
+
if (!prebuildsOnly) {
var release = getFirst(path.join(dir, 'build/Release'), matchBuild)
if (release) return release