forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRushStackCompilerBase.ts
More file actions
45 lines (40 loc) · 1.3 KB
/
RushStackCompilerBase.ts
File metadata and controls
45 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { StandardBuildFolders } from './StandardBuildFolders';
import { ITerminalProvider, Terminal } from '@rushstack/node-core-library';
/**
* @public
*/
export type WriteFileIssueFunction = (
filePath: string,
line: number,
column: number,
errorCode: string,
message: string
) => void;
/**
* @public
*/
export interface IRushStackCompilerBaseOptions {
fileError: WriteFileIssueFunction;
fileWarning: WriteFileIssueFunction;
}
/**
* @beta
*/
export abstract class RushStackCompilerBase<
TOptions extends IRushStackCompilerBaseOptions = IRushStackCompilerBaseOptions
> {
protected _standardBuildFolders: StandardBuildFolders;
protected _terminal: Terminal;
protected _taskOptions: TOptions;
protected _fileError: WriteFileIssueFunction;
protected _fileWarning: WriteFileIssueFunction;
public constructor(taskOptions: TOptions, rootPath: string, terminalProvider: ITerminalProvider) {
this._taskOptions = taskOptions;
this._standardBuildFolders = new StandardBuildFolders(rootPath);
this._terminal = new Terminal(terminalProvider);
this._fileError = taskOptions.fileError;
this._fileWarning = taskOptions.fileWarning;
}
}