@parcel/watcher
Advanced tools
Comparing version 2.1.0 to 2.2.0-alpha.0
29
index.js
@@ -1,2 +0,1 @@ | ||
const binding = require('node-gyp-build')(__dirname); | ||
const path = require('path'); | ||
@@ -6,2 +5,23 @@ const micromatch = require('micromatch'); | ||
let name = `@parcel/watcher-${process.platform}-${process.arch}`; | ||
if (process.platform === 'linux') { | ||
const { MUSL, family } = require('detect-libc'); | ||
if (family === MUSL) { | ||
name += '-musl'; | ||
} else { | ||
name += '-glibc'; | ||
} | ||
} | ||
let binding; | ||
try { | ||
binding = require(name); | ||
} catch (err) { | ||
try { | ||
binding = require('./build/Release/watcher.node'); | ||
} catch (err) { | ||
binding = require('./build/Debug/watcher.node'); | ||
} | ||
} | ||
function normalizeOptions(dir, opts = {}) { | ||
@@ -19,5 +39,5 @@ const { ignore, ...rest } = opts; | ||
const regex = micromatch.makeRe(value, { | ||
// We set `dot: true` to workaround an issue with the | ||
// regular expression on Linux where the resulting | ||
const regex = micromatch.makeRe(value, { | ||
// We set `dot: true` to workaround an issue with the | ||
// regular expression on Linux where the resulting | ||
// negative lookahead `(?!(\\/|^)` was never matching | ||
@@ -42,2 +62,3 @@ // in some cases. See also https://bit.ly/3UZlQDm | ||
console.log(opts) | ||
return opts; | ||
@@ -44,0 +65,0 @@ } |
{ | ||
"name": "@parcel/watcher", | ||
"version": "2.1.0", | ||
"version": "2.2.0-alpha.0", | ||
"main": "index.js", | ||
@@ -20,4 +20,2 @@ "types": "index.d.ts", | ||
"files": [ | ||
"src", | ||
"prebuilds", | ||
"index.js", | ||
@@ -27,10 +25,8 @@ "index.js.flow", | ||
"package.json", | ||
"binding.gyp", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"prebuild": "prebuildify --napi --strip --tag-libc -t 10.0.0", | ||
"prebuild": "prebuildify --napi --strip --tag-libc -t 16.0.0", | ||
"format": "prettier --write \"./**/*.{js,json,md}\"", | ||
"install": "node-gyp-build", | ||
"rebuild": "node-gyp rebuild -j 8 --debug --verbose", | ||
"build": "node-gyp rebuild -j 8 --debug --verbose", | ||
"test": "mocha" | ||
@@ -53,6 +49,6 @@ }, | ||
"dependencies": { | ||
"detect-libc": "^1.0.3", | ||
"is-glob": "^4.0.3", | ||
"micromatch": "^4.0.5", | ||
"node-addon-api": "^3.2.1", | ||
"node-gyp-build": "^4.3.0" | ||
"node-addon-api": "^7.0.0" | ||
}, | ||
@@ -64,3 +60,3 @@ "devDependencies": { | ||
"mocha": "^9.1.1", | ||
"prebuildify": "^4.2.1", | ||
"prebuildify": "^5.0.1", | ||
"prettier": "^2.3.2" | ||
@@ -72,3 +68,13 @@ }, | ||
] | ||
}, | ||
"optionalDependencies": { | ||
"@parcel/watcher-darwin-x64": "2.2.0-alpha.0", | ||
"@parcel/watcher-darwin-arm64": "2.2.0-alpha.0", | ||
"@parcel/watcher-win32-x64": "2.2.0-alpha.0", | ||
"@parcel/watcher-linux-x64-glibc": "2.2.0-alpha.0", | ||
"@parcel/watcher-linux-x64-musl": "2.2.0-alpha.0", | ||
"@parcel/watcher-linux-arm64-glibc": "2.2.0-alpha.0", | ||
"@parcel/watcher-linux-arm64-musl": "2.2.0-alpha.0", | ||
"@parcel/watcher-linux-arm-glibc": "2.2.0-alpha.0" | ||
} | ||
} |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.
Found 1 instance in 1 package
131
0
14357
12
6
2
1
+ Addeddetect-libc@^1.0.3
+ Added@parcel/watcher-darwin-arm64@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-darwin-x64@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-linux-arm-glibc@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-linux-arm64-glibc@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-linux-arm64-musl@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-linux-x64-glibc@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-linux-x64-musl@2.2.0-alpha.0(transitive)
+ Added@parcel/watcher-win32-x64@2.2.0-alpha.0(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addednode-addon-api@7.1.0(transitive)
- Removednode-gyp-build@^4.3.0
- Removednode-addon-api@3.2.1(transitive)
- Removednode-gyp-build@4.8.1(transitive)
Updatednode-addon-api@^7.0.0