This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

21
node_modules/@docusaurus/logger/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62
node_modules/@docusaurus/logger/README.md generated vendored Normal file
View File

@@ -0,0 +1,62 @@
# `@docusaurus/logger`
An encapsulated logger for semantically formatting console messages.
## APIs
It exports a single object as default export: `logger`. `logger` has the following properties:
- Some useful colors.
- `red`
- `yellow`
- `green`
- `bold`
- `dim`
- Formatters. These functions all have the signature `(msg: unknown) => string`. Note that their implementations are not guaranteed. You should only care about their semantics.
- `path`: formats a file path.
- `url`: formats a URL.
- `name`: formats an identifier.
- `code`: formats a code snippet.
- `subdue`: subdues the text.
- `num`: formats a number.
- The `interpolate` function. It is a template literal tag. The syntax can be found below.
- Logging functions. All logging functions can both be used as normal functions (similar to the `console.log` family, but only accepts one parameter) or template literal tags.
- `info`: prints information.
- `warn`: prints a warning that should be paid attention to.
- `error`: prints an error (not necessarily halting the program) that signals significant problems.
- `success`: prints a success message.
- The `report` function. It takes a `ReportingSeverity` value (`ignore`, `log`, `warn`, `throw`) and reports a message according to the severity.
### A word on the `error` formatter
Beware that an `error` message, even when it doesn't hang the program, is likely going to cause confusion. When users inspect logs and find an `[ERROR]`, even when the build succeeds, they will assume something is going wrong. Use it sparingly.
Docusaurus only uses `logger.error` when printing messages immediately before throwing an error, or when user has set the reporting severity of `onBrokenLink`, etc. to `"error"`.
In addition, `warn` and `error` will color the **entire** message for better attention. If you are printing large blocks of help text about an error, better use `logger.info`.
### Using the template literal tag
The template literal tag evaluates the template and expressions embedded. `interpolate` returns a new string, while other logging functions prints it. Below is a typical usage:
```js
import logger from '@docusaurus/logger';
logger.info`Hello name=${name}! You have number=${money} dollars. Here are the ${
items.length > 1 ? 'items' : 'item'
} on the shelf: ${items}
To buy anything, enter code=${'buy x'} where code=${'x'} is the item's name; to quit, press code=${'Ctrl + C'}.`;
```
An embedded expression is optionally preceded by a flag in the form `[a-z]+=` (a few lowercase letters, followed by an equals sign, directly preceding the embedded expression). If the expression is not preceded by any flag, it's printed out as-is. Otherwise, it's formatted with one of the formatters:
- `path=`: `path`
- `url=`: `url`
- `name=`: `name`
- `code=`: `code`
- `subdue=`: `subdue`
- `number=`: `num`
If the expression is an array, it's formatted by `` `\n- ${array.join('\n- ')}\n` `` (note it automatically gets a leading line end). Each member is formatted by itself and the bullet is not formatted. So you would see the above message printed as:
![Some text output in the terminal, containing array, code, name, and number formatting](./demo.png)

BIN
node_modules/@docusaurus/logger/demo.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -0,0 +1,70 @@
declare const _exports: {
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
(...text: unknown[]): string;
Instance: chalk.Instance;
level: chalk.Level;
hex(color: string): chalk.Chalk;
keyword(color: string): chalk.Chalk;
rgb(red: number, green: number, blue: number): chalk.Chalk;
hsl(hue: number, saturation: number, lightness: number): chalk.Chalk;
hsv(hue: number, saturation: number, value: number): chalk.Chalk;
hwb(hue: number, whiteness: number, blackness: number): chalk.Chalk;
ansi(code: number): chalk.Chalk;
ansi256(index: number): chalk.Chalk;
bgHex(color: string): chalk.Chalk;
bgKeyword(color: string): chalk.Chalk;
bgRgb(red: number, green: number, blue: number): chalk.Chalk;
bgHsl(hue: number, saturation: number, lightness: number): chalk.Chalk;
bgHsv(hue: number, saturation: number, value: number): chalk.Chalk;
bgHwb(hue: number, whiteness: number, blackness: number): chalk.Chalk;
bgAnsi(code: number): chalk.Chalk;
bgAnsi256(index: number): chalk.Chalk;
readonly reset: chalk.Chalk;
readonly bold: chalk.Chalk;
readonly dim: chalk.Chalk;
readonly italic: chalk.Chalk;
readonly underline: chalk.Chalk;
readonly inverse: chalk.Chalk;
readonly hidden: chalk.Chalk;
readonly strikethrough: chalk.Chalk;
readonly visible: chalk.Chalk;
readonly black: chalk.Chalk;
readonly red: chalk.Chalk;
readonly green: chalk.Chalk;
readonly yellow: chalk.Chalk;
readonly blue: chalk.Chalk;
readonly magenta: chalk.Chalk;
readonly cyan: chalk.Chalk;
readonly white: chalk.Chalk;
readonly gray: chalk.Chalk;
readonly grey: chalk.Chalk;
readonly blackBright: chalk.Chalk;
readonly redBright: chalk.Chalk;
readonly greenBright: chalk.Chalk;
readonly yellowBright: chalk.Chalk;
readonly blueBright: chalk.Chalk;
readonly magentaBright: chalk.Chalk;
readonly cyanBright: chalk.Chalk;
readonly whiteBright: chalk.Chalk;
readonly bgBlack: chalk.Chalk;
readonly bgRed: chalk.Chalk;
readonly bgGreen: chalk.Chalk;
readonly bgYellow: chalk.Chalk;
readonly bgBlue: chalk.Chalk;
readonly bgMagenta: chalk.Chalk;
readonly bgCyan: chalk.Chalk;
readonly bgWhite: chalk.Chalk;
readonly bgGray: chalk.Chalk;
readonly bgGrey: chalk.Chalk;
readonly bgBlackBright: chalk.Chalk;
readonly bgRedBright: chalk.Chalk;
readonly bgGreenBright: chalk.Chalk;
readonly bgYellowBright: chalk.Chalk;
readonly bgBlueBright: chalk.Chalk;
readonly bgMagentaBright: chalk.Chalk;
readonly bgCyanBright: chalk.Chalk;
readonly bgWhiteBright: chalk.Chalk;
};
export = _exports;
import chalk = require("chalk");
//# sourceMappingURL=chalk.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"chalk.d.ts","sourceRoot":"","sources":["../../src/__mocks__/chalk.js"],"names":[],"mappings":""}

12
node_modules/@docusaurus/logger/lib/__mocks__/chalk.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const chalk = require('chalk');
// Force coloring the output even in CI
module.exports = new chalk.Instance({ level: 3 });
//# sourceMappingURL=chalk.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"chalk.js","sourceRoot":"","sources":["../../src/__mocks__/chalk.js"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,uCAAuC;AACvC,MAAM,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,CAAC,CAAC"}

55
node_modules/@docusaurus/logger/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,55 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ReportingSeverity } from '@docusaurus/types';
type InterpolatableValue = string | number | (string | number)[];
declare function interpolate(msgs: TemplateStringsArray, ...values: InterpolatableValue[]): string;
declare function info(msg: unknown): void;
declare function info(msg: TemplateStringsArray, ...values: [InterpolatableValue, ...InterpolatableValue[]]): void;
declare function warn(msg: unknown): void;
declare function warn(msg: TemplateStringsArray, ...values: [InterpolatableValue, ...InterpolatableValue[]]): void;
declare function error(msg: unknown): void;
declare function error(msg: TemplateStringsArray, ...values: [InterpolatableValue, ...InterpolatableValue[]]): void;
declare function success(msg: unknown): void;
declare function success(msg: TemplateStringsArray, ...values: [InterpolatableValue, ...InterpolatableValue[]]): void;
declare function newLine(): void;
/**
* Takes a message and reports it according to the severity that the user wants.
*
* - `ignore`: completely no-op
* - `log`: uses the `INFO` log level
* - `warn`: uses the `WARN` log level
* - `throw`: aborts the process, throws the error.
*
* Since the logger doesn't have logging level filters yet, these severities
* mostly just differ by their colors.
*
* @throws In addition to throwing when `reportingSeverity === "throw"`, this
* function also throws if `reportingSeverity` is not one of the above.
*/
declare function report(reportingSeverity: ReportingSeverity): typeof success;
declare const logger: {
red: (msg: string | number) => string;
yellow: (msg: string | number) => string;
green: (msg: string | number) => string;
bold: (msg: string | number) => string;
dim: (msg: string | number) => string;
path: (msg: unknown) => string;
url: (msg: unknown) => string;
name: (msg: unknown) => string;
code: (msg: unknown) => string;
subdue: (msg: unknown) => string;
num: (msg: unknown) => string;
interpolate: typeof interpolate;
info: typeof info;
warn: typeof warn;
error: typeof error;
success: typeof success;
report: typeof report;
newLine: typeof newLine;
};
export = logger;
//# sourceMappingURL=index.d.ts.map

1
node_modules/@docusaurus/logger/lib/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,KAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AASjE,iBAAS,WAAW,CAClB,IAAI,EAAE,oBAAoB,EAC1B,GAAG,MAAM,EAAE,mBAAmB,EAAE,GAC/B,MAAM,CAkCR;AAYD,iBAAS,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;AAClC,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,SAAS,MAAM,CAAC"}

133
node_modules/@docusaurus/logger/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,133 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const tslib_1 = require("tslib");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
const path = (msg) => chalk_1.default.cyan.underline(`"${String(msg)}"`);
const url = (msg) => chalk_1.default.cyan.underline(msg);
const name = (msg) => chalk_1.default.blue.bold(msg);
const code = (msg) => chalk_1.default.cyan(`\`${String(msg)}\``);
const subdue = (msg) => chalk_1.default.gray(msg);
const num = (msg) => chalk_1.default.yellow(msg);
function interpolate(msgs, ...values) {
let res = '';
values.forEach((value, idx) => {
const flag = msgs[idx].match(/[a-z]+=$/);
res += msgs[idx].replace(/[a-z]+=$/, '');
const format = (() => {
if (!flag) {
return (a) => a;
}
switch (flag[0]) {
case 'path=':
return path;
case 'url=':
return url;
case 'number=':
return num;
case 'name=':
return name;
case 'subdue=':
return subdue;
case 'code=':
return code;
default:
throw new Error('Bad Docusaurus logging message. This is likely an internal bug, please report it.');
}
})();
res += Array.isArray(value)
? `\n- ${value.map((v) => format(v)).join('\n- ')}`
: format(value);
});
res += msgs.slice(-1)[0];
return res;
}
function stringify(msg) {
if (String(msg) === '[object Object]') {
return JSON.stringify(msg);
}
if (msg instanceof Date) {
return msg.toUTCString();
}
return String(msg);
}
function info(msg, ...values) {
console.info(`${chalk_1.default.cyan.bold('[INFO]')} ${values.length === 0
? stringify(msg)
: interpolate(msg, ...values)}`);
}
function warn(msg, ...values) {
console.warn(chalk_1.default.yellow(`${chalk_1.default.bold('[WARNING]')} ${values.length === 0
? stringify(msg)
: interpolate(msg, ...values)}`));
}
function error(msg, ...values) {
console.error(chalk_1.default.red(`${chalk_1.default.bold('[ERROR]')} ${values.length === 0
? stringify(msg)
: interpolate(msg, ...values)}`));
}
function success(msg, ...values) {
console.log(`${chalk_1.default.green.bold('[SUCCESS]')} ${values.length === 0
? stringify(msg)
: interpolate(msg, ...values)}`);
}
function throwError(msg, ...values) {
throw new Error(values.length === 0
? stringify(msg)
: interpolate(msg, ...values));
}
function newLine() {
console.log();
}
/**
* Takes a message and reports it according to the severity that the user wants.
*
* - `ignore`: completely no-op
* - `log`: uses the `INFO` log level
* - `warn`: uses the `WARN` log level
* - `throw`: aborts the process, throws the error.
*
* Since the logger doesn't have logging level filters yet, these severities
* mostly just differ by their colors.
*
* @throws In addition to throwing when `reportingSeverity === "throw"`, this
* function also throws if `reportingSeverity` is not one of the above.
*/
function report(reportingSeverity) {
const reportingMethods = {
ignore: () => { },
log: info,
warn,
throw: throwError,
};
if (!Object.prototype.hasOwnProperty.call(reportingMethods, reportingSeverity)) {
throw new Error(`Unexpected "reportingSeverity" value: ${reportingSeverity}.`);
}
return reportingMethods[reportingSeverity];
}
const logger = {
red: (msg) => chalk_1.default.red(msg),
yellow: (msg) => chalk_1.default.yellow(msg),
green: (msg) => chalk_1.default.green(msg),
bold: (msg) => chalk_1.default.bold(msg),
dim: (msg) => chalk_1.default.dim(msg),
path,
url,
name,
code,
subdue,
num,
interpolate,
info,
warn,
error,
success,
report,
newLine,
};
module.exports = logger;
//# sourceMappingURL=index.js.map

1
node_modules/@docusaurus/logger/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,0DAA0B;AAK1B,MAAM,IAAI,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChF,MAAM,GAAG,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAChE,MAAM,IAAI,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,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CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAC1E;QACA,MAAM,IAAI,KAAK,CACb,yCAAyC,iBAAiB,GAAG,CAC9D,CAAC;KACH;IACD,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACrD,MAAM,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC;IAC3D,KAAK,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC;IACzD,IAAI,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACvD,GAAG,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACrD,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,WAAW;IACX,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;CACR,CAAC;AAIF,iBAAS,MAAM,CAAC"}

33
node_modules/@docusaurus/logger/package.json generated vendored Normal file
View File

@@ -0,0 +1,33 @@
{
"name": "@docusaurus/logger",
"version": "3.1.1",
"description": "An encapsulated logger for semantically formatting console messages.",
"main": "./lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-logger"
},
"bugs": {
"url": "https://github.com/facebook/docusaurus/issues"
},
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
},
"publishConfig": {
"access": "public"
},
"license": "MIT",
"dependencies": {
"chalk": "^4.1.2",
"tslib": "^2.6.0"
},
"engines": {
"node": ">=18.0"
},
"devDependencies": {
"@types/supports-color": "^8.1.1"
},
"gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
}

11
node_modules/@docusaurus/logger/src/__mocks__/chalk.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const chalk = require('chalk');
// Force coloring the output even in CI
module.exports = new chalk.Instance({level: 3});

200
node_modules/@docusaurus/logger/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,200 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import chalk from 'chalk';
import type {ReportingSeverity} from '@docusaurus/types';
type InterpolatableValue = string | number | (string | number)[];
const path = (msg: unknown): string => chalk.cyan.underline(`"${String(msg)}"`);
const url = (msg: unknown): string => chalk.cyan.underline(msg);
const name = (msg: unknown): string => chalk.blue.bold(msg);
const code = (msg: unknown): string => chalk.cyan(`\`${String(msg)}\``);
const subdue = (msg: unknown): string => chalk.gray(msg);
const num = (msg: unknown): string => chalk.yellow(msg);
function interpolate(
msgs: TemplateStringsArray,
...values: InterpolatableValue[]
): string {
let res = '';
values.forEach((value, idx) => {
const flag = msgs[idx]!.match(/[a-z]+=$/);
res += msgs[idx]!.replace(/[a-z]+=$/, '');
const format = (() => {
if (!flag) {
return (a: string | number) => a;
}
switch (flag[0]) {
case 'path=':
return path;
case 'url=':
return url;
case 'number=':
return num;
case 'name=':
return name;
case 'subdue=':
return subdue;
case 'code=':
return code;
default:
throw new Error(
'Bad Docusaurus logging message. This is likely an internal bug, please report it.',
);
}
})();
res += Array.isArray(value)
? `\n- ${value.map((v) => format(v)).join('\n- ')}`
: format(value);
});
res += msgs.slice(-1)[0];
return res;
}
function stringify(msg: unknown): string {
if (String(msg) === '[object Object]') {
return JSON.stringify(msg);
}
if (msg instanceof Date) {
return msg.toUTCString();
}
return String(msg);
}
function info(msg: unknown): void;
function info(
msg: TemplateStringsArray,
...values: [InterpolatableValue, ...InterpolatableValue[]]
): void;
function info(msg: unknown, ...values: InterpolatableValue[]): void {
console.info(
`${chalk.cyan.bold('[INFO]')} ${
values.length === 0
? stringify(msg)
: interpolate(msg as TemplateStringsArray, ...values)
}`,
);
}
function warn(msg: unknown): void;
function warn(
msg: TemplateStringsArray,
...values: [InterpolatableValue, ...InterpolatableValue[]]
): void;
function warn(msg: unknown, ...values: InterpolatableValue[]): void {
console.warn(
chalk.yellow(
`${chalk.bold('[WARNING]')} ${
values.length === 0
? stringify(msg)
: interpolate(msg as TemplateStringsArray, ...values)
}`,
),
);
}
function error(msg: unknown): void;
function error(
msg: TemplateStringsArray,
...values: [InterpolatableValue, ...InterpolatableValue[]]
): void;
function error(msg: unknown, ...values: InterpolatableValue[]): void {
console.error(
chalk.red(
`${chalk.bold('[ERROR]')} ${
values.length === 0
? stringify(msg)
: interpolate(msg as TemplateStringsArray, ...values)
}`,
),
);
}
function success(msg: unknown): void;
function success(
msg: TemplateStringsArray,
...values: [InterpolatableValue, ...InterpolatableValue[]]
): void;
function success(msg: unknown, ...values: InterpolatableValue[]): void {
console.log(
`${chalk.green.bold('[SUCCESS]')} ${
values.length === 0
? stringify(msg)
: interpolate(msg as TemplateStringsArray, ...values)
}`,
);
}
function throwError(msg: unknown): void;
function throwError(
msg: TemplateStringsArray,
...values: [InterpolatableValue, ...InterpolatableValue[]]
): void;
function throwError(msg: unknown, ...values: InterpolatableValue[]): void {
throw new Error(
values.length === 0
? stringify(msg)
: interpolate(msg as TemplateStringsArray, ...values),
);
}
function newLine(): void {
console.log();
}
/**
* Takes a message and reports it according to the severity that the user wants.
*
* - `ignore`: completely no-op
* - `log`: uses the `INFO` log level
* - `warn`: uses the `WARN` log level
* - `throw`: aborts the process, throws the error.
*
* Since the logger doesn't have logging level filters yet, these severities
* mostly just differ by their colors.
*
* @throws In addition to throwing when `reportingSeverity === "throw"`, this
* function also throws if `reportingSeverity` is not one of the above.
*/
function report(reportingSeverity: ReportingSeverity): typeof success {
const reportingMethods = {
ignore: () => {},
log: info,
warn,
throw: throwError,
};
if (
!Object.prototype.hasOwnProperty.call(reportingMethods, reportingSeverity)
) {
throw new Error(
`Unexpected "reportingSeverity" value: ${reportingSeverity}.`,
);
}
return reportingMethods[reportingSeverity];
}
const logger = {
red: (msg: string | number): string => chalk.red(msg),
yellow: (msg: string | number): string => chalk.yellow(msg),
green: (msg: string | number): string => chalk.green(msg),
bold: (msg: string | number): string => chalk.bold(msg),
dim: (msg: string | number): string => chalk.dim(msg),
path,
url,
name,
code,
subdue,
num,
interpolate,
info,
warn,
error,
success,
report,
newLine,
};
// TODO remove when migrating to ESM
// logger can only be default-imported in ESM with this
export = logger;