UNPKG

@manuth/generator-wsc-package

Version:

A Generator for WoltLab Suite Core Packages.

70 lines 2.48 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { TSProjectTasksProcessor } from "@manuth/generator-ts-project"; /** * Provides the functionality to process tasks for {@link WoltLabGenerator `WoltLabGenerator<TSettings, TOptions>`}s. * * @template TSettings * The type of the settings of the generator. * * @template TOptions * The type of the options of the generator. */ export class WoltLabTasksProcessor extends TSProjectTasksProcessor { /** * Initializes a new instance of the {@link TSProjectTasksProcessor `TSProjectTasksProcessor<TSettings, TOptions>`} class. * * @param component * The component of the processor. */ constructor(component) { super(component); } /** * @inheritdoc * * @param task * The task to filter. * * @returns * A value indicating whether the task should be included. */ FilterTask(task) { return __awaiter(this, void 0, void 0, function* () { return typeof task.label === "string" && task.label === "Build"; }); } /** * Processes a task-configuration. * * @param task * The task to process. * * @returns * The processed task. */ ProcessTask(task) { const _super = Object.create(null, { ProcessTask: { get: () => super.ProcessTask } }); return __awaiter(this, void 0, void 0, function* () { task = yield _super.ProcessTask.call(this, task); if (typeof task.label === "string" && task.label === "Build") { task.script = "package"; task.problemMatcher = []; delete task.isBackground; } return task; }); } } //# sourceMappingURL=WoltLabTasksProcessor.js.map