Socket
Socket
Sign inDemoInstall

@rushstack/node-core-library

Package Overview
Dependencies
Maintainers
3
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/node-core-library - npm Package Compare versions

Comparing version 3.27.0 to 3.28.0

lib/Import.d.ts

20

CHANGELOG.json

@@ -5,2 +5,22 @@ {

{
"version": "3.28.0",
"tag": "@rushstack/node-core-library_v3.28.0",
"date": "Tue, 18 Aug 2020 23:59:42 GMT",
"comments": {
"minor": [
{
"comment": "Add a utility function for making console color codes human-readable."
},
{
"comment": "Create a lighter weight function to get own package version."
}
],
"patch": [
{
"comment": "Lazy-import some packages to improve spin up times."
}
]
}
},
{
"version": "3.27.0",

@@ -7,0 +27,0 @@ "tag": "@rushstack/node-core-library_v3.27.0",

14

CHANGELOG.md
# Change Log - @rushstack/node-core-library
This log was last generated on Mon, 17 Aug 2020 04:53:23 GMT and should not be manually modified.
This log was last generated on Tue, 18 Aug 2020 23:59:42 GMT and should not be manually modified.
## 3.28.0
Tue, 18 Aug 2020 23:59:42 GMT
### Minor changes
- Add a utility function for making console color codes human-readable.
- Create a lighter weight function to get own package version.
### Patches
- Lazy-import some packages to improve spin up times.
## 3.27.0

@@ -6,0 +18,0 @@ Mon, 17 Aug 2020 04:53:23 GMT

2

dist/tsdoc-metadata.json

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.9.0"
"packageVersion": "7.9.5"
}
]
}

@@ -5,3 +5,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const fsx = require("fs-extra");
const Import_1 = require("./Import");
const fsx = Import_1.Import.lazy('fs-extra', require);
/**

@@ -8,0 +9,0 @@ * API for interacting with file handles.

@@ -10,2 +10,3 @@ /**

export { INodePackageJson, IPackageJson, IPackageJsonDependencyTable, IPackageJsonScriptTable } from './IPackageJson';
export { Import } from './Import';
export { InternalError } from './InternalError';

@@ -31,4 +32,4 @@ export { JsonObject, JsonFile, IJsonFileSaveOptions, IJsonFileStringifyOptions } from './JsonFile';

export { ConsoleTerminalProvider, IConsoleTerminalProviderOptions } from './Terminal/ConsoleTerminalProvider';
export { StringBufferTerminalProvider } from './Terminal/StringBufferTerminalProvider';
export { StringBufferTerminalProvider, IStringBufferOutputOptions } from './Terminal/StringBufferTerminalProvider';
export { TypeUuid } from './TypeUuid';
//# sourceMappingURL=index.d.ts.map

@@ -14,2 +14,4 @@ "use strict";

exports.Executable = Executable_1.Executable;
var Import_1 = require("./Import");
exports.Import = Import_1.Import;
var InternalError_1 = require("./InternalError");

@@ -16,0 +18,0 @@ exports.InternalError = InternalError_1.InternalError;

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

const path = require("path");
const Validator = require("z-schema");
const Validator = require("z-schema/dist/ZSchema-browser-min");
const JsonFile_1 = require("./JsonFile");

@@ -10,0 +10,0 @@ const FileSystem_1 = require("./FileSystem");

@@ -39,2 +39,36 @@ /**

}
export declare enum ConsoleColorCodes {
BlackForeground = 30,
RedForeground = 31,
GreenForeground = 32,
YellowForeground = 33,
BlueForeground = 34,
MagentaForeground = 35,
CyanForeground = 36,
WhiteForeground = 37,
GrayForeground = 90,
DefaultForeground = 39,
BlackBackground = 40,
RedBackground = 41,
GreenBackground = 42,
YellowBackground = 43,
BlueBackground = 44,
MagentaBackground = 45,
CyanBackground = 46,
WhiteBackground = 47,
GrayBackground = 100,
DefaultBackground = 49,
Bold = 1,
BoldOff = 21,
Dim = 2,
NormalColorOrIntensity = 22,
Underline = 4,
UnderlineOff = 24,
Blink = 5,
BlinkOff = 25,
InvertColor = 7,
InvertColorOFf = 27,
Hidden = 8,
HiddenOff = 28
}
/**

@@ -75,2 +109,9 @@ * The static functions on this class are used to produce colored text

/**
* This utility function can be used to normalize color codes into human-readable
* tokens. This is useful for producing more readable test snapshots.
*
* @beta
*/
static normalizeColorTokensForTest(text: string): string;
/**
* If called with a string, returns the string wrapped in a {@link IColorableSequence}.

@@ -77,0 +118,0 @@ * If called with a {@link IColorableSequence}, returns the {@link IColorableSequence}.

@@ -37,2 +37,37 @@ "use strict";

})(TextAttribute = exports.TextAttribute || (exports.TextAttribute = {}));
var ConsoleColorCodes;
(function (ConsoleColorCodes) {
ConsoleColorCodes[ConsoleColorCodes["BlackForeground"] = 30] = "BlackForeground";
ConsoleColorCodes[ConsoleColorCodes["RedForeground"] = 31] = "RedForeground";
ConsoleColorCodes[ConsoleColorCodes["GreenForeground"] = 32] = "GreenForeground";
ConsoleColorCodes[ConsoleColorCodes["YellowForeground"] = 33] = "YellowForeground";
ConsoleColorCodes[ConsoleColorCodes["BlueForeground"] = 34] = "BlueForeground";
ConsoleColorCodes[ConsoleColorCodes["MagentaForeground"] = 35] = "MagentaForeground";
ConsoleColorCodes[ConsoleColorCodes["CyanForeground"] = 36] = "CyanForeground";
ConsoleColorCodes[ConsoleColorCodes["WhiteForeground"] = 37] = "WhiteForeground";
ConsoleColorCodes[ConsoleColorCodes["GrayForeground"] = 90] = "GrayForeground";
ConsoleColorCodes[ConsoleColorCodes["DefaultForeground"] = 39] = "DefaultForeground";
ConsoleColorCodes[ConsoleColorCodes["BlackBackground"] = 40] = "BlackBackground";
ConsoleColorCodes[ConsoleColorCodes["RedBackground"] = 41] = "RedBackground";
ConsoleColorCodes[ConsoleColorCodes["GreenBackground"] = 42] = "GreenBackground";
ConsoleColorCodes[ConsoleColorCodes["YellowBackground"] = 43] = "YellowBackground";
ConsoleColorCodes[ConsoleColorCodes["BlueBackground"] = 44] = "BlueBackground";
ConsoleColorCodes[ConsoleColorCodes["MagentaBackground"] = 45] = "MagentaBackground";
ConsoleColorCodes[ConsoleColorCodes["CyanBackground"] = 46] = "CyanBackground";
ConsoleColorCodes[ConsoleColorCodes["WhiteBackground"] = 47] = "WhiteBackground";
ConsoleColorCodes[ConsoleColorCodes["GrayBackground"] = 100] = "GrayBackground";
ConsoleColorCodes[ConsoleColorCodes["DefaultBackground"] = 49] = "DefaultBackground";
ConsoleColorCodes[ConsoleColorCodes["Bold"] = 1] = "Bold";
ConsoleColorCodes[ConsoleColorCodes["BoldOff"] = 21] = "BoldOff";
ConsoleColorCodes[ConsoleColorCodes["Dim"] = 2] = "Dim";
ConsoleColorCodes[ConsoleColorCodes["NormalColorOrIntensity"] = 22] = "NormalColorOrIntensity";
ConsoleColorCodes[ConsoleColorCodes["Underline"] = 4] = "Underline";
ConsoleColorCodes[ConsoleColorCodes["UnderlineOff"] = 24] = "UnderlineOff";
ConsoleColorCodes[ConsoleColorCodes["Blink"] = 5] = "Blink";
ConsoleColorCodes[ConsoleColorCodes["BlinkOff"] = 25] = "BlinkOff";
ConsoleColorCodes[ConsoleColorCodes["InvertColor"] = 7] = "InvertColor";
ConsoleColorCodes[ConsoleColorCodes["InvertColorOFf"] = 27] = "InvertColorOFf";
ConsoleColorCodes[ConsoleColorCodes["Hidden"] = 8] = "Hidden";
ConsoleColorCodes[ConsoleColorCodes["HiddenOff"] = 28] = "HiddenOff";
})(ConsoleColorCodes = exports.ConsoleColorCodes || (exports.ConsoleColorCodes = {}));
/**

@@ -121,2 +156,20 @@ * The static functions on this class are used to produce colored text

/**
* This utility function can be used to normalize color codes into human-readable
* tokens. This is useful for producing more readable test snapshots.
*
* @beta
*/
static normalizeColorTokensForTest(text) {
// eslint-disable-next-line no-control-regex
return text.replace(/\u001b\[(\d+)m/gu, (capture, code) => {
const colorCode = ConsoleColorCodes[code];
if (!colorCode) {
return `[UnknownColorCode ${code}]`;
}
else {
return `[${colorCode}]`;
}
});
}
/**
* If called with a string, returns the string wrapped in a {@link IColorableSequence}.

@@ -123,0 +176,0 @@ * If called with a {@link IColorableSequence}, returns the {@link IColorableSequence}.

import { ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider';
/**
* @beta
*/
export interface IStringBufferOutputOptions {
/**
* If set to true, special characters like \\n, \\r, and the \\u001b character
* in color control tokens will get normalized to [-n-], [-r-], and [-x-] respectively
*
* This option defaults to `true`
*/
normalizeSpecialCharacters: boolean;
}
/**
* Terminal provider that stores written data in buffers separated by severity.

@@ -31,17 +43,17 @@ * This terminal provider is designed to be used when code that prints to a terminal

*/
getOutput(): string;
getOutput(options?: IStringBufferOutputOptions): string;
/**
* Get everything that has been written at verbose-level severity.
*/
getVerbose(): string;
getVerbose(options?: IStringBufferOutputOptions): string;
/**
* Get everything that has been written at error-level severity.
*/
getErrorOutput(): string;
getErrorOutput(options?: IStringBufferOutputOptions): string;
/**
* Get everything that has been written at warning-level severity.
*/
getWarningOutput(): string;
getWarningOutput(options?: IStringBufferOutputOptions): string;
private _normalizeOutput;
}
//# sourceMappingURL=StringBufferTerminalProvider.d.ts.map

@@ -62,4 +62,4 @@ "use strict";

*/
getOutput() {
return this._normalizeOutput(this._standardBuffer.toString());
getOutput(options) {
return this._normalizeOutput(this._standardBuffer.toString(), options);
}

@@ -69,4 +69,4 @@ /**

*/
getVerbose() {
return this._normalizeOutput(this._verboseBuffer.toString());
getVerbose(options) {
return this._normalizeOutput(this._verboseBuffer.toString(), options);
}

@@ -76,4 +76,4 @@ /**

*/
getErrorOutput() {
return this._normalizeOutput(this._errorBuffer.toString());
getErrorOutput(options) {
return this._normalizeOutput(this._errorBuffer.toString(), options);
}

@@ -83,10 +83,17 @@ /**

*/
getWarningOutput() {
return this._normalizeOutput(this._warningBuffer.toString());
getWarningOutput(options) {
return this._normalizeOutput(this._warningBuffer.toString(), options);
}
_normalizeOutput(s) {
return Text_1.Text.convertToLf(s)
.replace(/\u001b/g, '[x]') // eslint-disable-line no-control-regex
.replace(/\n/g, '[-n-]')
.replace(/\r/g, '[-r-]');
_normalizeOutput(s, options) {
options = Object.assign({ normalizeSpecialCharacters: true }, (options || {}));
s = Text_1.Text.convertToLf(s);
if (options.normalizeSpecialCharacters) {
return s
.replace(/\u001b/g, '[x]') // eslint-disable-line no-control-regex
.replace(/\n/g, '[-n-]')
.replace(/\r/g, '[-r-]');
}
else {
return s;
}
}

@@ -93,0 +100,0 @@ }

@@ -143,44 +143,44 @@ "use strict";

case Colors_1.ColorValue.Black: {
startColorCodes.push(30);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.BlackForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Red: {
startColorCodes.push(31);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.RedForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Green: {
startColorCodes.push(32);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.GreenForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Yellow: {
startColorCodes.push(33);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.YellowForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Blue: {
startColorCodes.push(34);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.BlueForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Magenta: {
startColorCodes.push(35);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.MagentaForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Cyan: {
startColorCodes.push(36);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.CyanForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.White: {
startColorCodes.push(37);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.WhiteForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;
}
case Colors_1.ColorValue.Gray: {
startColorCodes.push(90);
endColorCodes.push(39);
startColorCodes.push(Colors_1.ConsoleColorCodes.GrayForeground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultForeground);
break;

@@ -191,43 +191,43 @@ }

case Colors_1.ColorValue.Black: {
startColorCodes.push(40);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.BlackBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Red: {
startColorCodes.push(41);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.RedBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Green: {
startColorCodes.push(42);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.GreenBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Yellow: {
startColorCodes.push(43);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.YellowBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Blue: {
startColorCodes.push(44);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.BlueBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Magenta: {
startColorCodes.push(45);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.MagentaBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Cyan: {
startColorCodes.push(46);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.CyanBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.White: {
startColorCodes.push(47);
endColorCodes.push(49);
startColorCodes.push(Colors_1.ConsoleColorCodes.WhiteBackground);
endColorCodes.push(Colors_1.ConsoleColorCodes.DefaultBackground);
break;
}
case Colors_1.ColorValue.Gray: {
startColorCodes.push(100);
startColorCodes.push(Colors_1.ConsoleColorCodes.GrayBackground);
endColorCodes.push(49);

@@ -241,29 +241,29 @@ break;

case Colors_1.TextAttribute.Bold: {
startColorCodes.push(1);
endColorCodes.push(21);
startColorCodes.push(Colors_1.ConsoleColorCodes.Bold);
endColorCodes.push(Colors_1.ConsoleColorCodes.BoldOff);
break;
}
case Colors_1.TextAttribute.Dim: {
startColorCodes.push(2);
endColorCodes.push(22);
startColorCodes.push(Colors_1.ConsoleColorCodes.Dim);
endColorCodes.push(Colors_1.ConsoleColorCodes.NormalColorOrIntensity);
break;
}
case Colors_1.TextAttribute.Underline: {
startColorCodes.push(4);
endColorCodes.push(24);
startColorCodes.push(Colors_1.ConsoleColorCodes.Underline);
endColorCodes.push(Colors_1.ConsoleColorCodes.UnderlineOff);
break;
}
case Colors_1.TextAttribute.Blink: {
startColorCodes.push(5);
endColorCodes.push(25);
startColorCodes.push(Colors_1.ConsoleColorCodes.Blink);
endColorCodes.push(Colors_1.ConsoleColorCodes.BlinkOff);
break;
}
case Colors_1.TextAttribute.InvertColor: {
startColorCodes.push(7);
endColorCodes.push(27);
startColorCodes.push(Colors_1.ConsoleColorCodes.InvertColor);
endColorCodes.push(Colors_1.ConsoleColorCodes.InvertColorOFf);
break;
}
case Colors_1.TextAttribute.Hidden: {
startColorCodes.push(8);
endColorCodes.push(28);
startColorCodes.push(Colors_1.ConsoleColorCodes.Hidden);
endColorCodes.push(Colors_1.ConsoleColorCodes.HiddenOff);
break;

@@ -270,0 +270,0 @@ }

{
"name": "@rushstack/node-core-library",
"version": "3.27.0",
"version": "3.28.0",
"description": "Core libraries that every NodeJS toolchain project should use",

@@ -19,2 +19,3 @@ "main": "lib/index.js",

"jju": "~1.4.0",
"import-lazy": "~4.0.0",
"semver": "~7.3.0",

@@ -25,5 +26,5 @@ "timsort": "~0.3.0",

"devDependencies": {
"@microsoft/rush-stack-compiler-3.5": "0.8.0",
"@microsoft/rush-stack-compiler-3.5": "0.8.4",
"@rushstack/eslint-config": "1.1.0",
"@rushstack/heft": "0.4.3",
"@rushstack/heft": "0.5.1",
"@types/fs-extra": "7.0.0",

@@ -30,0 +31,0 @@ "@types/jest": "25.2.1",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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