Skip to content

Commit

Permalink
deps: hoisting newer deps in favor of older ones
Browse files Browse the repository at this point in the history
In some cases this adds duplication to the tree which will be
cleaned up as subdependencies update to the latest versions
  • Loading branch information
wraithgar committed Nov 14, 2023
1 parent 54c4f7b commit 4613774
Show file tree
Hide file tree
Showing 48 changed files with 1,560 additions and 530 deletions.
27 changes: 17 additions & 10 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
!/@npmcli/
/@npmcli/*
!/@npmcli/agent
!/@npmcli/agent/node_modules/
/@npmcli/agent/node_modules/*
!/@npmcli/agent/node_modules/agent-base
!/@npmcli/agent/node_modules/http-proxy-agent
!/@npmcli/agent/node_modules/https-proxy-agent
!/@npmcli/agent/node_modules/socks-proxy-agent
!/@npmcli/disparity-colors
!/@npmcli/disparity-colors/node_modules/
/@npmcli/disparity-colors/node_modules/*
!/@npmcli/disparity-colors/node_modules/ansi-styles
!/@npmcli/fs
!/@npmcli/git
!/@npmcli/installed-package-contents
Expand All @@ -50,6 +47,7 @@
!/@tufjs/models
!/abbrev
!/abort-controller
!/agent-base
!/aggregate-error
!/ansi-regex
!/ansi-styles
Expand All @@ -72,6 +70,7 @@
!/cli-columns
!/cli-columns/node_modules/
/cli-columns/node_modules/*
!/cli-columns/node_modules/ansi-regex
!/cli-columns/node_modules/strip-ansi
!/cli-table3
!/clone
Expand All @@ -82,6 +81,7 @@
!/columnify
!/columnify/node_modules/
/columnify/node_modules/*
!/columnify/node_modules/ansi-regex
!/columnify/node_modules/strip-ansi
!/common-ancestor-path
!/console-control-strings
Expand Down Expand Up @@ -112,13 +112,16 @@
!/gauge
!/gauge/node_modules/
/gauge/node_modules/*
!/gauge/node_modules/ansi-regex
!/gauge/node_modules/strip-ansi
!/glob
!/graceful-fs
!/has-unicode
!/has
!/hosted-git-info
!/http-cache-semantics
!/http-proxy-agent
!/https-proxy-agent
!/iconv-lite
!/ieee754
!/ignore-walk
Expand Down Expand Up @@ -218,6 +221,7 @@
!/signal-exit
!/sigstore
!/smart-buffer
!/socks-proxy-agent
!/socks
!/spdx-correct
!/spdx-exceptions
Expand All @@ -228,16 +232,18 @@
!/string-width-cjs
!/string-width-cjs/node_modules/
/string-width-cjs/node_modules/*
!/string-width-cjs/node_modules/ansi-regex
!/string-width-cjs/node_modules/strip-ansi
!/string-width
!/string-width/node_modules/
/string-width/node_modules/*
!/string-width/node_modules/ansi-regex
!/string-width/node_modules/strip-ansi
!/strip-ansi-cjs
!/strip-ansi-cjs/node_modules/
/strip-ansi-cjs/node_modules/*
!/strip-ansi-cjs/node_modules/ansi-regex
!/strip-ansi
!/strip-ansi/node_modules/
/strip-ansi/node_modules/*
!/strip-ansi/node_modules/ansi-regex
!/supports-color
!/tar
!/tar/node_modules/
Expand Down Expand Up @@ -266,11 +272,12 @@
!/wrap-ansi-cjs
!/wrap-ansi-cjs/node_modules/
/wrap-ansi-cjs/node_modules/*
!/wrap-ansi-cjs/node_modules/ansi-regex
!/wrap-ansi-cjs/node_modules/ansi-styles
!/wrap-ansi-cjs/node_modules/strip-ansi
!/wrap-ansi
!/wrap-ansi/node_modules/
/wrap-ansi/node_modules/*
!/wrap-ansi/node_modules/ansi-styles
!/wrap-ansi/node_modules/emoji-regex
!/wrap-ansi/node_modules/string-width
!/write-file-atomic
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
'use strict';

const wrapAnsi16 = (fn, offset) => (...args) => {
const code = fn(...args);
return `\u001B[${code + offset}m`;
};

const wrapAnsi256 = (fn, offset) => (...args) => {
const code = fn(...args);
return `\u001B[${38 + offset};5;${code}m`;
};

const wrapAnsi16m = (fn, offset) => (...args) => {
const rgb = fn(...args);
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
};

const ansi2ansi = n => n;
const rgb2rgb = (r, g, b) => [r, g, b];

const setLazyProperty = (object, property, get) => {
Object.defineProperty(object, property, {
get: () => {
const value = get();

Object.defineProperty(object, property, {
value,
enumerable: true,
configurable: true
});

return value;
},
enumerable: true,
configurable: true
});
};

/** @type {typeof import('color-convert')} */
let colorConvert;
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
if (colorConvert === undefined) {
colorConvert = require('color-convert');
}

const offset = isBackground ? 10 : 0;
const styles = {};

for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
if (sourceSpace === targetSpace) {
styles[name] = wrap(identity, offset);
} else if (typeof suite === 'object') {
styles[name] = wrap(suite[targetSpace], offset);
}
}

return styles;
};

function assembleStyles() {
const codes = new Map();
const styles = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
color: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],

// Bright color
blackBright: [90, 39],
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39]
},
bgColor: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],

// Bright color
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
}
};

// Alias bright black as gray (and grey)
styles.color.gray = styles.color.blackBright;
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
styles.color.grey = styles.color.blackBright;
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;

for (const [groupName, group] of Object.entries(styles)) {
for (const [styleName, style] of Object.entries(group)) {
styles[styleName] = {
open: `\u001B[${style[0]}m`,
close: `\u001B[${style[1]}m`
};

group[styleName] = styles[styleName];

codes.set(style[0], style[1]);
}

Object.defineProperty(styles, groupName, {
value: group,
enumerable: false
});
}

Object.defineProperty(styles, 'codes', {
value: codes,
enumerable: false
});

styles.color.close = '\u001B[39m';
styles.bgColor.close = '\u001B[49m';

setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));

return styles;
}

// Make the export immutable
Object.defineProperty(module, 'exports', {
enumerable: true,
get: assembleStyles
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"name": "ansi-styles",
"version": "6.2.1",
"version": "4.3.0",
"description": "ANSI escape codes for styling strings in the terminal",
"license": "MIT",
"repository": "chalk/ansi-styles",
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd",
Expand Down Expand Up @@ -45,10 +43,14 @@
"command-line",
"text"
],
"dependencies": {
"color-convert": "^2.0.1"
},
"devDependencies": {
"ava": "^3.15.0",
"@types/color-convert": "^1.9.0",
"ava": "^2.3.0",
"svg-term-cli": "^2.1.1",
"tsd": "^0.19.0",
"xo": "^0.47.0"
"tsd": "^0.11.0",
"xo": "^0.25.3"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions node_modules/ansi-regex/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict';

module.exports = ({onlyFirst = false} = {}) => {
export default function ansiRegex({onlyFirst = false} = {}) {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');

return new RegExp(pattern, onlyFirst ? undefined : 'g');
};
}
2 changes: 1 addition & 1 deletion node_modules/ansi-regex/license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
15 changes: 9 additions & 6 deletions node_modules/ansi-regex/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "ansi-regex",
"version": "5.0.1",
"version": "6.0.1",
"description": "Regular expression for matching ANSI escape codes",
"license": "MIT",
"repository": "chalk/ansi-regex",
"funding": "https://github.com/chalk/ansi-regex?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd",
Expand Down Expand Up @@ -48,8 +51,8 @@
"pattern"
],
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.9.0",
"xo": "^0.25.3"
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}
Loading

0 comments on commit 4613774

Please sign in to comment.