Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: @npmcli/[email protected]
  • Loading branch information
wraithgar committed Apr 6, 2022
commit e53285e76f39b177662a9fe7e04a188139968edd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const colors = {
removed: ansi.red,
added: ansi.green,
header: ansi.yellow,
section: ansi.magenta
section: ansi.magenta,
}

function colorize (str, opts) {
Expand All @@ -13,10 +13,10 @@ function colorize (str, opts) {
headerLength = 2
}

const color = (str, colorId) => {
const color = (colorStr, colorId) => {
const { open, close } = colors[colorId]
// avoid highlighting the "\n" (would highlight till the end of the line)
return str.replace(/[^\n\r]+/g, open + '$&' + close)
return colorStr.replace(/[^\n\r]+/g, open + '$&' + close)
}

// this RegExp will include all the `\n` chars into the lines, easier to join
Expand Down
37 changes: 23 additions & 14 deletions node_modules/@npmcli/disparity-colors/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "@npmcli/disparity-colors",
"version": "1.0.1",
"version": "2.0.0",
"main": "lib/index.js",
"files": [
"index.js"
"bin/",
"lib/"
],
"engines": {
"node": ">=10"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"description": "Colorizes unified diff output",
"repository": "https://github.com/npm/disparity-colors",
"repository": {
"type": "git",
"url": "https://github.com/npm/disparity-colors.git"
},
"keywords": [
"disparity",
"npm",
Expand All @@ -24,7 +29,7 @@
"cli",
"tty"
],
"author": "npm Inc. <[email protected]>",
"author": "GitHub Inc.",
"contributors": [
{
"name": "Ruy Adorno",
Expand All @@ -34,27 +39,31 @@
],
"license": "ISC",
"scripts": {
"lint": "standard index.js",
"lint": "eslint \"**/*.js\"",
"pretest": "npm run lint",
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags"
"prepublishOnly": "git push origin --follow-tags",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint"
},
"tap": {
"check-coverage": true
},
"standard": {
"ignore": [
"/tap-snapshots/"
]
},
"devDependencies": {
"standard": "^16.0.3",
"tap": "^14.11.0"
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.2.2",
"tap": "^16.0.1"
},
"dependencies": {
"ansi-styles": "^4.3.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.2.2"
}
}
17 changes: 10 additions & 7 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,14 @@
}
},
"node_modules/@npmcli/disparity-colors": {
"version": "1.0.1",
"license": "ISC",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz",
"integrity": "sha512-FFXGrIjhvd2qSZ8iS0yDvbI7nbjdyT2VNO7wotosjYZM2p2r8PN3B7Om3M5NO9KqW/OVzfzLB3L0V5Vo5QXC7A==",
"dependencies": {
"ansi-styles": "^4.3.0"
},
"engines": {
"node": ">=10"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
},
"node_modules/@npmcli/eslint-config": {
Expand Down Expand Up @@ -9606,7 +9607,7 @@
"version": "4.0.2",
"license": "ISC",
"dependencies": {
"@npmcli/disparity-colors": "^1.0.1",
"@npmcli/disparity-colors": "^2.0.0",
"@npmcli/installed-package-contents": "^1.0.7",
"binary-extensions": "^2.2.0",
"diff": "^5.0.0",
Expand Down Expand Up @@ -10242,7 +10243,7 @@
"ssri": "^8.0.1",
"tap": "^15.1.2",
"tcompare": "^5.0.6",
"treeverse": "2.0.0",
"treeverse": "^2.0.0",
"walk-up-path": "^1.0.0"
}
},
Expand All @@ -10263,7 +10264,9 @@
}
},
"@npmcli/disparity-colors": {
"version": "1.0.1",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz",
"integrity": "sha512-FFXGrIjhvd2qSZ8iS0yDvbI7nbjdyT2VNO7wotosjYZM2p2r8PN3B7Om3M5NO9KqW/OVzfzLB3L0V5Vo5QXC7A==",
"requires": {
"ansi-styles": "^4.3.0"
}
Expand Down Expand Up @@ -12430,7 +12433,7 @@
"libnpmdiff": {
"version": "file:workspaces/libnpmdiff",
"requires": {
"@npmcli/disparity-colors": "^1.0.1",
"@npmcli/disparity-colors": "2.0.0",
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/installed-package-contents": "^1.0.7",
"@npmcli/template-oss": "3.2.2",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmdiff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"tap": "^15.0.9"
},
"dependencies": {
"@npmcli/disparity-colors": "^1.0.1",
"@npmcli/disparity-colors": "^2.0.0",
"@npmcli/installed-package-contents": "^1.0.7",
"binary-extensions": "^2.2.0",
"diff": "^5.0.0",
Expand Down