Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/node-pre-gyp

Package Overview
Dependencies
Maintainers
28
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/node-pre-gyp - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0-dev.1

.github/dependabot.yml

2

CHANGELOG.md

@@ -369,3 +369,3 @@ # node-pre-gyp changelog

- Updated ABI crosswalk to incldue node v0.10.30 and v0.10.31
- Updated ABI crosswalk to include node v0.10.30 and v0.10.31

@@ -372,0 +372,0 @@ ## 0.5.23

@@ -7,3 +7,3 @@ 'use strict';

const rm = require('rimraf');
const { rimraf } = require('rimraf');
const exists = require('fs').exists || require('path').exists;

@@ -27,3 +27,6 @@ const versioning = require('./util/versioning.js');

if (!gyp.opts.silent_clean) console.log('[' + package_json.name + '] Removing "%s"', to_delete);
return rm(to_delete, callback);
return rimraf(to_delete).then(
(result) => callback(null, result),
(err) => callback(err)
);
}

@@ -30,0 +33,0 @@ return callback();

@@ -14,4 +14,3 @@ 'use strict';

const opts = versioning.evaluate(package_json, gyp.opts);
const config = {};
s3_setup.detect(opts, config);
const config = s3_setup.detect(opts);
const s3 = s3_setup.get_s3(config);

@@ -24,3 +23,3 @@ const s3_opts = {

if (err && err.code === 'NotFound') {
return callback(new Error('[' + package_json.name + '] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + config.prefix));
return callback(new Error('[' + package_json.name + '] Not found: https://' + opts.hosted_path));
} else if (err) {

@@ -30,3 +29,3 @@ return callback(err);

log.verbose(JSON.stringify(meta, null, 1));
if (meta && meta.Contents) {
if (meta && meta.Contents.length) {
meta.Contents.forEach((obj) => {

@@ -36,3 +35,3 @@ console.log(obj.Key);

} else {
console.error('[' + package_json.name + '] No objects found at https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + config.prefix);
console.error('[' + package_json.name + '] Not found: No objects at https://' + opts.hosted_path);
}

@@ -39,0 +38,0 @@ return callback();

@@ -27,4 +27,3 @@ 'use strict';

log.info('publish', 'Detecting s3 credentials');
const config = {};
s3_setup.detect(opts, config);
const config = s3_setup.detect(opts);
const s3 = s3_setup.get_s3(config);

@@ -63,3 +62,3 @@

log.info('publish', 'successfully put object');
console.log('[' + package_json.name + '] published to ' + opts.hosted_path);
console.log('[' + package_json.name + '] Success: published to ' + opts.hosted_path);
return callback();

@@ -66,0 +65,0 @@ });

@@ -17,4 +17,3 @@ 'use strict';

const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
const config = {};
s3_setup.detect(opts, config);
const config = s3_setup.detect(opts);
const s3 = s3_setup.get_s3(config);

@@ -28,3 +27,3 @@ const key_name = url.resolve(config.prefix, opts.package_name);

if (err && err.code === 'NotFound') {
console.log('[' + package_json.name + '] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
console.log('[' + package_json.name + '] Not found: ' + opts.hosted_tarball);
return callback();

@@ -38,3 +37,3 @@ } else if (err) {

log.info(JSON.stringify(resp));
console.log('[' + package_json.name + '] Success: removed https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
console.log('[' + package_json.name + '] Success: removed ' + opts.hosted_tarball);
return callback();

@@ -41,0 +40,0 @@ });

@@ -2234,2 +2234,22 @@ {

},
"12.22.8": {
"node_abi": 72,
"v8": "7.8"
},
"12.22.9": {
"node_abi": 72,
"v8": "7.8"
},
"12.22.10": {
"node_abi": 72,
"v8": "7.8"
},
"12.22.11": {
"node_abi": 72,
"v8": "7.8"
},
"12.22.12": {
"node_abi": 72,
"v8": "7.8"
},
"13.0.0": {

@@ -2439,2 +2459,50 @@ "node_abi": 79,

},
"14.18.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.18.3": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.3": {
"node_abi": 83,
"v8": "8.4"
},
"14.20.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.20.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.3": {
"node_abi": 83,
"v8": "8.4"
},
"15.0.0": {

@@ -2592,2 +2660,70 @@ "node_abi": 88,

},
"16.13.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.13.2": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.2": {
"node_abi": 93,
"v8": "9.4"
},
"16.15.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.15.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.16.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.17.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.17.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.18.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.18.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.19.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.19.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.20.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.20.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.20.2": {
"node_abi": 93,
"v8": "9.4"
},
"17.0.0": {

@@ -2604,3 +2740,399 @@ "node_abi": 102,

"v8": "9.5"
},
"17.2.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.3.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.3.1": {
"node_abi": 102,
"v8": "9.6"
},
"17.4.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.5.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.6.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.1": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.2": {
"node_abi": 102,
"v8": "9.6"
},
"17.8.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.9.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.9.1": {
"node_abi": 102,
"v8": "9.6"
},
"18.0.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.1.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.2.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.3.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.4.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.5.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.6.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.7.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.8.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.9.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.9.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.10.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.11.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.12.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.12.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.13.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.2": {
"node_abi": 108,
"v8": "10.2"
},
"18.15.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.16.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.16.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.17.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.17.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.18.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.18.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.18.2": {
"node_abi": 108,
"v8": "10.2"
},
"18.19.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.19.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.20.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.20.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.20.2": {
"node_abi": 108,
"v8": "10.2"
},
"18.20.3": {
"node_abi": 108,
"v8": "10.2"
},
"19.0.0": {
"node_abi": 111,
"v8": "10.7"
},
"19.0.1": {
"node_abi": 111,
"v8": "10.7"
},
"19.1.0": {
"node_abi": 111,
"v8": "10.7"
},
"19.2.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.3.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.4.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.5.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.6.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.6.1": {
"node_abi": 111,
"v8": "10.8"
},
"19.7.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.8.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.8.1": {
"node_abi": 111,
"v8": "10.8"
},
"19.9.0": {
"node_abi": 111,
"v8": "10.8"
},
"20.0.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.1.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.2.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.3.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.3.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.4.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.5.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.5.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.6.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.6.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.7.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.8.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.8.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.9.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.10.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.11.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.11.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.12.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.12.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.12.2": {
"node_abi": 115,
"v8": "11.3"
},
"20.13.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.13.1": {
"node_abi": 115,
"v8": "11.3"
},
"20.14.0": {
"node_abi": 115,
"v8": "11.3"
},
"20.15.0": {
"node_abi": 115,
"v8": "11.3"
},
"21.0.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.1.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.2.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.3.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.4.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.5.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.6.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.6.1": {
"node_abi": 120,
"v8": "11.8"
},
"21.6.2": {
"node_abi": 120,
"v8": "11.8"
},
"21.7.0": {
"node_abi": 120,
"v8": "11.8"
},
"21.7.1": {
"node_abi": 120,
"v8": "11.8"
},
"21.7.2": {
"node_abi": 120,
"v8": "11.8"
},
"21.7.3": {
"node_abi": 120,
"v8": "11.8"
},
"22.0.0": {
"node_abi": 127,
"v8": "12.4"
},
"22.1.0": {
"node_abi": 127,
"v8": "12.4"
},
"22.2.0": {
"node_abi": 127,
"v8": "12.4"
},
"22.3.0": {
"node_abi": 127,
"v8": "12.4"
}
}
}

@@ -31,3 +31,3 @@ 'use strict';

try {
const node_gyp_main = require.resolve('node-gyp'); // eslint-disable-line node/no-missing-require
const node_gyp_main = require.resolve('node-gyp'); // eslint-disable-line n/no-missing-require
node_gyp_bin = path.join(path.dirname(

@@ -44,3 +44,3 @@ path.dirname(node_gyp_main)),

try {
const npm_main = require.resolve('npm'); // eslint-disable-line node/no-missing-require
const npm_main = require.resolve('npm'); // eslint-disable-line n/no-missing-require
node_gyp_bin = path.join(path.dirname(

@@ -47,0 +47,0 @@ path.dirname(npm_main)),

@@ -119,3 +119,3 @@ 'use strict';

const supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
// remove duplicates, verify each napi version can actaully be built
// remove duplicates, verify each napi version can actually be built
if (package_json.binary && package_json.binary.napi_versions) {

@@ -170,4 +170,4 @@ package_json.binary.napi_versions.forEach((napi_version) => {

if (napi_build_version) {
const rm = require('rimraf');
rm.sync(module.exports.get_build_dir(napi_build_version));
const { rimrafSync } = require('rimraf');
rimrafSync(module.exports.get_build_dir(napi_build_version));
fs.renameSync('build', module.exports.get_build_dir(napi_build_version));

@@ -179,4 +179,4 @@ }

if (napi_build_version) {
const rm = require('rimraf');
rm.sync('build');
const { rimrafSync } = require('rimraf');
rimrafSync('build');
fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');

@@ -183,0 +183,0 @@ }

@@ -9,29 +9,53 @@ 'use strict';

module.exports.detect = function(opts, config) {
module.exports.detect = function(opts) {
const config = {};
const to = opts.hosted_path;
const uri = url.parse(to);
config.prefix = (!uri.pathname || uri.pathname === '/') ? '' : uri.pathname.replace('/', '');
if (opts.bucket && opts.region) {
// use user defined settings for host, region, bucket
config.endpoint = opts.host;
config.bucket = opts.bucket;
config.region = opts.region;
config.endpoint = opts.host;
config.s3ForcePathStyle = opts.s3ForcePathStyle;
// if using s3ForcePathStyle the bucket is part of the http object path
// but not the S3 key prefix path.
// remove it
const bucketPath = config.s3ForcePathStyle ? `/${config.bucket}/` : '/';
config.prefix = (!uri.pathname || uri.pathname === bucketPath) ? '' : uri.pathname.replace(bucketPath, '');
} else {
// auto detect region and bucket from url
// only virtual-hosted–style access can be auto detected
// the uri will have the following format:
// https://bucket-name.s3.Region.amazonaws.com/key-name (dash Region)
// or in some legacy region of this format:
// https://bucket-name.s3-Region.amazonaws.com/key-name (dot Region)
const parts = uri.hostname.split('.s3');
const bucket = parts[0];
if (!bucket) {
return;
// there is nothing before the .s3
// not a valid s3 virtual host bucket url
if (parts.length === 1) {
throw new Error('Could not parse s3 bucket name from virtual host url.');
}
if (!config.bucket) {
config.bucket = bucket;
// everything before .s3 is the bucket
config.bucket = parts[0];
// from everything that comes after the s3
// first char is connecting dot or dash
// everything up to the domain should be the region name
const region = parts[1].slice(1).split('.')[0];
// if user provided url does not include region, default to us-east-1.
if (region === 'amazonaws') {
config.region = 'us-east-1';
} else {
config.region = region;
}
if (!config.region) {
const region = parts[1].slice(1).split('.')[0];
if (region === 'amazonaws') {
config.region = 'us-east-1';
} else {
config.region = region;
}
}
config.prefix = (!uri.pathname || uri.pathname === '/') ? '' : uri.pathname.replace('/', '');
}
return config;
};

@@ -106,3 +130,3 @@

// if mocking it sets up the mock http interceptors that use the mocked s3 file system
// to fulfill reponses.
// to fulfill responses.
module.exports.get_mockS3Http = function() {

@@ -109,0 +133,0 @@ let mock_s3 = false;

@@ -332,5 +332,11 @@ 'use strict';

opts.staged_tarball = path.join('build/stage', opts.remote_path, opts.package_name);
opts.hosted_path = url.resolve(opts.host, opts.remote_path);
// when using s3ForcePathStyle the bucket is part of the http object path
// add it
if (opts.s3ForcePathStyle) {
opts.hosted_path = url.resolve(opts.host, drop_double_slashes(`${opts.bucket}/${opts.remote_path}`));
} else {
opts.hosted_path = url.resolve(opts.host, opts.remote_path);
}
opts.hosted_tarball = url.resolve(opts.hosted_path, opts.package_name);
return opts;
};
{
"name": "@mapbox/node-pre-gyp",
"description": "Node.js native addon binary install tool",
"version": "1.0.11",
"version": "1.1.0-dev.1",
"keywords": [

@@ -22,2 +22,5 @@ "native",

"main": "./lib/node-pre-gyp.js",
"engines": {
"node": ">=18"
},
"dependencies": {

@@ -28,15 +31,15 @@ "detect-libc": "^2.0.0",

"node-fetch": "^2.6.7",
"nopt": "^5.0.0",
"npmlog": "^5.0.1",
"rimraf": "^3.0.2",
"nopt": "^7.2.1",
"npmlog": "^7.0.1",
"rimraf": "^5.0.5",
"semver": "^7.3.5",
"tar": "^6.1.11"
"tar": "^7.4.0"
},
"devDependencies": {
"@mapbox/cloudfriend": "^5.1.0",
"@mapbox/eslint-config-mapbox": "^3.0.0",
"@mapbox/eslint-config-mapbox": "^5.0.1",
"aws-sdk": "^2.1087.0",
"codecov": "^3.8.3",
"eslint": "^7.32.0",
"eslint-plugin-node": "^11.1.0",
"eslint": "^8.57.0",
"eslint-plugin-n": "^17.9.0",
"mock-aws-s3": "^4.0.2",

@@ -43,0 +46,0 @@ "nock": "^12.0.3",

@@ -5,3 +5,2 @@ # @mapbox/node-pre-gyp

[![Build Status](https://travis-ci.com/mapbox/node-pre-gyp.svg?branch=master)](https://travis-ci.com/mapbox/node-pre-gyp)
[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp)

@@ -445,3 +444,3 @@

These values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substituion in the `binary` properties of the `package.json` file.
These values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substitution in the `binary` properties of the `package.json` file.

@@ -448,0 +447,0 @@ ## S3 Hosting

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc