Skip to content

Commit b3ed5d6

Browse files
committed
Merge branch 'main' into regexp-bundledPackages
2 parents 37a51be + 546507c commit b3ed5d6

File tree

99 files changed

+581
-524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+581
-524
lines changed

apps/api-documenter/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
"@microsoft/api-extractor-model": "workspace:*",
2424
"@microsoft/tsdoc": "0.14.2",
2525
"@rushstack/node-core-library": "workspace:*",
26+
"@rushstack/terminal": "workspace:*",
2627
"@rushstack/ts-command-line": "workspace:*",
27-
"colors": "~1.2.1",
2828
"js-yaml": "~3.13.1",
2929
"resolve": "~1.22.1"
3030
},
3131
"devDependencies": {
3232
"@rushstack/heft": "workspace:*",
33-
"local-node-rig": "workspace:*",
3433
"@types/js-yaml": "3.12.1",
35-
"@types/resolve": "1.20.2"
34+
"@types/resolve": "1.20.2",
35+
"local-node-rig": "workspace:*"
3636
}
3737
}

apps/api-documenter/src/cli/BaseAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import * as path from 'path';
55
import type * as tsdoc from '@microsoft/tsdoc';
6-
import colors from 'colors/safe';
76

87
import {
98
CommandLineAction,
@@ -18,6 +17,7 @@ import {
1817
ApiDocumentedItem,
1918
type IResolveDeclarationReferenceResult
2019
} from '@microsoft/api-extractor-model';
20+
import { Colorize } from '@rushstack/terminal';
2121

2222
export interface IBuildApiModelResult {
2323
apiModel: ApiModel;
@@ -94,7 +94,7 @@ export abstract class BaseAction extends CommandLineAction {
9494

9595
if (result.errorMessage) {
9696
console.log(
97-
colors.yellow(
97+
Colorize.yellow(
9898
`Warning: Unresolved @inheritDoc tag for ${apiItem.displayName}: ` + result.errorMessage
9999
)
100100
);

apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import colors from 'colors';
54
import * as path from 'path';
65
import yaml = require('js-yaml');
76

87
import type { ApiModel } from '@microsoft/api-extractor-model';
98
import { FileSystem } from '@rushstack/node-core-library';
9+
import { Colorize } from '@rushstack/terminal';
1010

1111
import type { IYamlTocItem } from '../yaml/IYamlTocFile';
1212
import type { IYamlItem } from '../yaml/IYamlApiFile';
@@ -59,7 +59,7 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
5959
// After we generate everything, check for any unused snippets
6060
console.log();
6161
for (const apiName of Object.keys(this._snippets)) {
62-
console.error(colors.yellow('Warning: Unused snippet ' + apiName));
62+
console.error(Colorize.yellow('Warning: Unused snippet ' + apiName));
6363
}
6464
}
6565

apps/api-documenter/src/markdown/CustomMarkdownEmitter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import colors from 'colors';
5-
64
import type { DocNode, DocLinkTag, StringBuilder } from '@microsoft/tsdoc';
75
import type { ApiModel, IResolveDeclarationReferenceResult, ApiItem } from '@microsoft/api-extractor-model';
6+
import { Colorize } from '@rushstack/terminal';
87

98
import { CustomDocNodeKind } from '../nodes/CustomDocNodeKind';
109
import type { DocHeading } from '../nodes/DocHeading';
@@ -183,12 +182,12 @@ export class CustomMarkdownEmitter extends MarkdownEmitter {
183182
context.writer.write(encodedLinkText);
184183
context.writer.write(`](${filename!})`);
185184
} else {
186-
console.log(colors.yellow('WARNING: Unable to determine link text'));
185+
console.log(Colorize.yellow('WARNING: Unable to determine link text'));
187186
}
188187
}
189188
} else if (result.errorMessage) {
190189
console.log(
191-
colors.yellow(
190+
Colorize.yellow(
192191
`WARNING: Unable to resolve reference "${docLinkTag.codeDestination!.emitAsTsdoc()}": ` +
193192
result.errorMessage
194193
)

apps/api-documenter/src/start.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
// See LICENSE in the project root for license information.
33

44
import * as os from 'os';
5-
import colors from 'colors';
65

76
import { PackageJsonLookup } from '@rushstack/node-core-library';
7+
import { Colorize } from '@rushstack/terminal';
88

99
import { ApiDocumenterCommandLine } from './cli/ApiDocumenterCommandLine';
1010

1111
const myPackageVersion: string = PackageJsonLookup.loadOwnPackageJson(__dirname).version;
1212

1313
console.log(
1414
os.EOL +
15-
colors.bold(`api-documenter ${myPackageVersion} ` + colors.cyan(' - https://api-extractor.com/') + os.EOL)
15+
Colorize.bold(
16+
`api-documenter ${myPackageVersion} ` + Colorize.cyan(' - https://api-extractor.com/') + os.EOL
17+
)
1618
);
1719

1820
const parser: ApiDocumenterCommandLine = new ApiDocumenterCommandLine();

apps/api-extractor/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
},
3939
"dependencies": {
4040
"@microsoft/api-extractor-model": "workspace:*",
41-
"@microsoft/tsdoc": "0.14.2",
4241
"@microsoft/tsdoc-config": "~0.16.1",
42+
"@microsoft/tsdoc": "0.14.2",
4343
"@rushstack/node-core-library": "workspace:*",
4444
"@rushstack/rig-package": "workspace:*",
45+
"@rushstack/terminal": "workspace:*",
4546
"@rushstack/ts-command-line": "workspace:*",
46-
"colors": "~1.2.1",
4747
"lodash": "~4.17.15",
4848
"minimatch": "~3.0.3",
4949
"resolve": "~1.22.1",
@@ -52,14 +52,14 @@
5252
"typescript": "5.3.3"
5353
},
5454
"devDependencies": {
55-
"local-eslint-config": "workspace:*",
56-
"@rushstack/heft": "0.64.0",
5755
"@rushstack/heft-node-rig": "2.4.0",
56+
"@rushstack/heft": "0.64.0",
5857
"@types/heft-jest": "1.0.1",
5958
"@types/lodash": "4.14.116",
6059
"@types/minimatch": "3.0.5",
6160
"@types/node": "18.17.15",
6261
"@types/resolve": "1.20.2",
63-
"@types/semver": "7.5.0"
62+
"@types/semver": "7.5.0",
63+
"local-eslint-config": "workspace:*"
6464
}
6565
}

apps/api-extractor/src/api/CompilerState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
import * as path from 'path';
55
import * as ts from 'typescript';
6-
import colors = require('colors');
76

87
import { JsonFile } from '@rushstack/node-core-library';
98

109
import { ExtractorConfig } from './ExtractorConfig';
1110
import type { IExtractorInvokeOptions } from './Extractor';
11+
import { Colorize } from '@rushstack/terminal';
1212

1313
/**
1414
* Options for {@link CompilerState.create}
@@ -60,7 +60,7 @@ export class CompilerState {
6060
if (!commandLine.options.skipLibCheck && extractorConfig.skipLibCheck) {
6161
commandLine.options.skipLibCheck = true;
6262
console.log(
63-
colors.cyan(
63+
Colorize.cyan(
6464
'API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +
6565
'incorrect type analysis.'
6666
)

apps/api-extractor/src/cli/ApiExtractorCommandLine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import colors from 'colors';
54
import * as os from 'os';
65

76
import { CommandLineParser, type CommandLineFlagParameter } from '@rushstack/ts-command-line';
87
import { InternalError } from '@rushstack/node-core-library';
8+
import { Colorize } from '@rushstack/terminal';
99

1010
import { RunAction } from './RunAction';
1111
import { InitAction } from './InitAction';
@@ -42,7 +42,7 @@ export class ApiExtractorCommandLine extends CommandLineParser {
4242
if (this._debugParameter.value) {
4343
console.error(os.EOL + error.stack);
4444
} else {
45-
console.error(os.EOL + colors.red('ERROR: ' + error.message.trim()));
45+
console.error(os.EOL + Colorize.red('ERROR: ' + error.message.trim()));
4646
}
4747

4848
process.exitCode = 1;

apps/api-extractor/src/cli/InitAction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import colors from 'colors';
54
import * as path from 'path';
65
import { FileSystem } from '@rushstack/node-core-library';
76
import { CommandLineAction } from '@rushstack/ts-command-line';
7+
import { Colorize } from '@rushstack/terminal';
88

99
import type { ApiExtractorCommandLine } from './ApiExtractorCommandLine';
1010
import { ExtractorConfig } from '../api/ExtractorConfig';
@@ -27,12 +27,12 @@ export class InitAction extends CommandLineAction {
2727
const outputFilePath: string = path.resolve(ExtractorConfig.FILENAME);
2828

2929
if (FileSystem.exists(outputFilePath)) {
30-
console.log(colors.red('The output file already exists:'));
30+
console.log(Colorize.red('The output file already exists:'));
3131
console.log('\n ' + outputFilePath + '\n');
3232
throw new Error('Unable to write output file');
3333
}
3434

35-
console.log(colors.green('Writing file: ') + outputFilePath);
35+
console.log(Colorize.green('Writing file: ') + outputFilePath);
3636
FileSystem.copyFile({
3737
sourcePath: inputFilePath,
3838
destinationPath: outputFilePath

apps/api-extractor/src/cli/RunAction.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import colors from 'colors';
54
import * as os from 'os';
65
import * as path from 'path';
76
import { PackageJsonLookup, FileSystem, type IPackageJson, Path } from '@rushstack/node-core-library';
8-
7+
import { Colorize } from '@rushstack/terminal';
98
import {
109
CommandLineAction,
1110
type CommandLineStringParameter,
1211
type CommandLineFlagParameter
1312
} from '@rushstack/ts-command-line';
1413

1514
import { Extractor, type ExtractorResult } from '../api/Extractor';
16-
1715
import type { ApiExtractorCommandLine } from './ApiExtractorCommandLine';
1816
import { ExtractorConfig, type IExtractorConfigPrepareOptions } from '../api/ExtractorConfig';
1917

@@ -144,9 +142,9 @@ export class RunAction extends CommandLineAction {
144142
process.exitCode = 1;
145143

146144
if (extractorResult.errorCount > 0) {
147-
console.log(os.EOL + colors.red('API Extractor completed with errors'));
145+
console.log(os.EOL + Colorize.red('API Extractor completed with errors'));
148146
} else {
149-
console.log(os.EOL + colors.yellow('API Extractor completed with warnings'));
147+
console.log(os.EOL + Colorize.yellow('API Extractor completed with warnings'));
150148
}
151149
}
152150
}

0 commit comments

Comments
 (0)