Skip to content
forked from npm/cli

Commit

Permalink
deps: npm-bundled@2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Aug 25, 2022
1 parent 6e2d6b4 commit e401a81
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 328 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "npm-bundled",
"version": "1.1.2",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-bundled.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"devDependencies": {
"mkdirp": "^0.5.1",
"mutate-fs": "^1.1.0",
"rimraf": "^2.6.1",
"tap": "^12.0.1"
},
"scripts": {
"test": "tap test/*.js -J --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"files": [
"index.js"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// pass in a manifest with a 'bin' field here, and it'll turn it
// into a properly santized bin object
const {join, basename} = require('path')
const { join, basename } = require('path')

const normalize = pkg =>
!pkg.bin ? removeBin(pkg)
Expand All @@ -10,8 +10,9 @@ const normalize = pkg =>
: removeBin(pkg)

const normalizeString = pkg => {
if (!pkg.name)
if (!pkg.name) {
return removeBin(pkg)
}
pkg.bin = { [pkg.name]: pkg.bin }
return normalizeObject(pkg)
}
Expand All @@ -34,25 +35,28 @@ const normalizeObject = pkg => {
const clean = {}
let hasBins = false
Object.keys(orig).forEach(binKey => {
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1)
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1)

if (typeof orig[binKey] !== 'string' || !base)
if (typeof orig[binKey] !== 'string' || !base) {
return
}

const binTarget = join('/', orig[binKey])
.replace(/\\/g, '/').substr(1)
.replace(/\\/g, '/').slice(1)

if (!binTarget)
if (!binTarget) {
return
}

clean[base] = binTarget
hasBins = true
})

if (hasBins)
if (hasBins) {
pkg.bin = clean
else
} else {
delete pkg.bin
}

return pkg
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
{
"name": "npm-bundled",
"name": "npm-normalize-package-bin",
"version": "2.0.0",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"description": "Turn any flavor of allowable package.json bin into a normalized object",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/npm/npm-bundled.git"
"url": "https://github.com/npm/npm-normalize-package-bin.git"
},
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.5.0",
"mkdirp": "^1.0.4",
"mutate-fs": "^2.1.1",
"rimraf": "^3.0.2",
"tap": "^16.3.0"
},
"scripts": {
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags",
"postpublish": "git push origin --follow-tags",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.5.0",
"tap": "^16.3.0"
},
"files": [
"bin/",
"lib/"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
Expand Down
41 changes: 29 additions & 12 deletions node_modules/npm-bundled/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
{
"name": "npm-bundled",
"version": "1.1.2",
"version": "2.0.1",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"main": "index.js",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-bundled.git"
"url": "https://github.com/npm/npm-bundled.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"mkdirp": "^0.5.1",
"mutate-fs": "^1.1.0",
"rimraf": "^2.6.1",
"tap": "^12.0.1"
"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.5.0",
"mkdirp": "^1.0.4",
"mutate-fs": "^2.1.1",
"rimraf": "^3.0.2",
"tap": "^16.3.0"
},
"scripts": {
"test": "tap test/*.js -J --100",
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
"postpublish": "git push origin --all; git push origin --tags",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
"posttest": "npm run lint"
},
"files": [
"index.js"
"bin/",
"lib/"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1"
"npm-normalize-package-bin": "^2.0.0"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.5.0"
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e401a81

Please sign in to comment.