mirror of
https://gitea.com/actions/stale.git
synced 2026-09-05 20:24:24 +00:00
eaf9131fae
- Changed import statements across multiple files to use the .js extension for ES module compatibility. - Refactored test files to utilize jest's unstable_mockModule for mocking core actions. - Removed unnecessary spy instances in tests, replacing them with direct mocked function calls. - Updated TypeScript configuration to target ES2022 and use NodeNext module resolution. - Removed the tsconfig.spec.json file and adjusted the main tsconfig.json to exclude test files.
33 lines
966 B
TypeScript
33 lines
966 B
TypeScript
import * as core from '@actions/core';
|
|
import terminalLink from 'terminal-link';
|
|
import {Option} from '../../enums/option.js';
|
|
import {LoggerService} from '../../services/logger.service.js';
|
|
|
|
export class Logger {
|
|
warning(...message: string[]): void {
|
|
core.warning(LoggerService.whiteBright(message.join(' ')));
|
|
}
|
|
|
|
info(...message: string[]): void {
|
|
core.info(LoggerService.whiteBright(message.join(' ')));
|
|
}
|
|
|
|
error(...message: string[]): void {
|
|
core.error(LoggerService.whiteBright(message.join(' ')));
|
|
}
|
|
|
|
async grouping(message: string, fn: () => Promise<void>): Promise<void> {
|
|
return core.group(LoggerService.whiteBright(message), fn);
|
|
}
|
|
|
|
createLink(name: Readonly<string>, link: Readonly<string>): string {
|
|
return terminalLink(name, link);
|
|
}
|
|
|
|
createOptionLink(option: Readonly<Option>): string {
|
|
return LoggerService.magenta(
|
|
this.createLink(option, `https://github.com/actions/stale#${option}`)
|
|
);
|
|
}
|
|
}
|