Refactored settings usage; got rid of global settings object

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 8 years ago
parent e05cd07b89
commit 3b7acb1b25
  1. 27
      BuildServer/lib/builder.ts
  2. 9
      BuildServer/lib/commenter.ts
  3. 5
      BuildServer/lib/github-wrapper.ts
  4. 58
      BuildServer/lib/index.ts
  5. 12
      BuildServer/lib/report-processor.ts
  6. 6
      BuildServer/lib/routes/artifact.ts
  7. 6
      BuildServer/lib/routes/manual.ts
  8. 10
      BuildServer/lib/routes/postreceive.ts
  9. 3
      BuildServer/lib/routes/release.ts
  10. 7
      BuildServer/lib/routes/status.ts
  11. 12
      BuildServer/lib/settings-wrapper.ts
  12. 21
      BuildServer/lib/status-processor.ts
  13. 6
      BuildServer/lib/task-processor.ts
  14. 3
      BuildServer/lib/tasks/dotnetbuilderwrapper.ts
  15. 13
      BuildServer/lib/tasks/dotnetcompile.ts
  16. 5
      BuildServer/lib/tasks/dotnetnugetpushonly.ts
  17. 7
      BuildServer/lib/tasks/dotnetrewrite.ts
  18. 7
      BuildServer/lib/tasks/eslintbrowser.ts
  19. 3
      BuildServer/lib/types/task-processor-types.ts

@ -6,13 +6,12 @@ import { mkdirsSync, remove } from "fs-extra";
import * as JSONParse from "json-parse-safe";
import { join } from "path";
import settings from "../settings";
import { gitLoader } from "./git/loader";
import { createGithub } from "./github-wrapper";
import { send as sendMail } from "./mail-sender";
import { writeReport } from "./report-processor";
import { processTask } from "./task-processor";
import { ReportResult } from "./types";
import { ReportResult, Settings } from "./types";
const codePostfix = "";
const mailLazinessLevel = 1000;
@ -36,7 +35,7 @@ const createBuildDoneMessage = (isSuccess, name) => {
return `Build failed for ${name}`;
};
const notifyStatus = (options, notifyStatusCallback) => {
const notifyStatus = (settings: Settings, options, notifyStatusCallback) => {
const status = {
description: String(options.description || "").substr(0, maxDescriptionLength),
owner: options.owner,
@ -46,7 +45,7 @@ const notifyStatus = (options, notifyStatusCallback) => {
target_url: `${settings.siteRoot}status/${options.owner}/${options.reponame}/${options.hash}`,
};
createGithub(options.owner).repos.createStatus(status, (createStatusErr) => {
createGithub(settings, options.owner).repos.createStatus(status, (createStatusErr) => {
if (createStatusErr) {
console.log(`Error while creating status: ${createStatusErr}`);
console.log(status);
@ -66,17 +65,17 @@ const wrapGitLoader = (skipGitLoader) => {
return (gitLoaderOptions, gitLoaderCallback) => process.nextTick(gitLoaderCallback);
};
export const build = (options, buildCallback) => {
export const build = (settings: Settings, options, buildCallback) => {
const url = options.url;
const owner = options.owner;
const reponame = options.reponame;
const rev = options.rev;
const branch = options.branch;
const skipGitLoader = options.skipGitLoader;
const local = join(options.app.get("gitpath"), "r");
const tmp = join(options.app.get("tmpcodepath"), rev.substr(0, maxTmpcodepathLength));
const local = join(settings.gitpath, "r");
const tmp = join(settings.tmpcodepath, rev.substr(0, maxTmpcodepathLength));
const exported = tmp + codePostfix;
const release = join(options.app.get("releasepath"), owner, reponame, branch, rev);
const release = join(settings.releasepath, owner, reponame, branch, rev);
const statusQueue = queue((task: (callback: any) => void, queueCallback) => task(queueCallback), 1);
const actualGitLoader = wrapGitLoader(skipGitLoader);
const date = new Date();
@ -87,7 +86,7 @@ export const build = (options, buildCallback) => {
const version = `${versionMajor}.${versionMinor}.${versionBuild}.${versionRev}`;
const versionInfo = `${version}; built from ${rev}; repository: ${owner}/${reponame}; branch: ${branch}`;
statusQueue.push((queueCallback) => notifyStatus({
statusQueue.push((queueCallback) => notifyStatus(settings, {
description: "Preparing to build...",
hash: rev,
owner,
@ -97,9 +96,9 @@ export const build = (options, buildCallback) => {
mkdirsSync(release);
writeFileSync(join(options.app.get("releasepath"), owner, reponame, branch, "latest.id"), rev);
mkdirsSync(join(options.app.get("releasepath"), owner, reponame, "$revs"));
writeFileSync(join(options.app.get("releasepath"), owner, reponame, "$revs", `${rev}.branch`), branch);
writeFileSync(join(settings.releasepath, owner, reponame, branch, "latest.id"), rev);
mkdirsSync(join(settings.releasepath, owner, reponame, "$revs"));
writeFileSync(join(settings.releasepath, owner, reponame, "$revs", `${rev}.branch`), branch);
const createErrorMessageForMail = (doneErr) => {
if (!doneErr) {
@ -127,7 +126,7 @@ export const build = (options, buildCallback) => {
writeReport(release, doneErr, result, (writeErr) => {
statusQueue.push((queueCallback) => parallel([
(parallelCallback) => notifyStatus({
(parallelCallback) => notifyStatus(settings, {
description: errorMessage || warnMessage || infoMessage || "Success",
hash: rev,
owner,
@ -191,7 +190,7 @@ export const build = (options, buildCallback) => {
return done("MBSMalformed");
}
return processTask(value, {
return processTask(settings, value, {
branch,
exported,
owner,

@ -2,13 +2,12 @@
import * as _ from "underscore";
import settings from "../settings";
import { createGithub, IGithub } from "./github-wrapper";
import { getStatusMessageFromRelease } from "./report-processor";
import { Settings } from "./types";
interface ICommentOnPullRequestOptions {
readonly action: string;
readonly app: any;
readonly baseRepoOptions: any;
readonly headRepoOptions: any;
}
@ -159,17 +158,17 @@ const checkPullRequest = (options: ICheckPullRequestOptions, callback) => {
});
};
export const commentOnPullRequest = (originalOptions: ICommentOnPullRequestOptions, callback) => {
export const commentOnPullRequest = (settings: Settings, originalOptions: ICommentOnPullRequestOptions, callback) => {
const optionsGithub = {
...originalOptions,
github: createGithub(originalOptions.baseRepoOptions.owner),
github: createGithub(settings, originalOptions.baseRepoOptions.owner),
};
const options = {
...optionsGithub,
onTenthAttempt: () => writeComment(optionsGithub, "Waiting for build to finish...", _.noop),
};
return checkPullRequest(options, () => getStatusMessageFromRelease(options.app, options.headRepoOptions, (statusMessageErr, statusSuccessMessage) => {
return checkPullRequest(options, () => getStatusMessageFromRelease(settings, options.headRepoOptions, (statusMessageErr, statusSuccessMessage) => {
const escapedErr = String(statusMessageErr || "").substring(0, maxCommentLength)
.replace(/`/g, "` ");
const message = statusMessageErr

@ -1,7 +1,8 @@
"use strict";
import * as RawGithub from "github";
import settings from "../settings";
import { Settings } from "./types";
interface IHttpError extends Error {
readonly message: string;
@ -40,7 +41,7 @@ interface IGithub {
};
}
const createGithub = (repoOwner) => settings.createGithub(repoOwner) as any as IGithub;
const createGithub = (settings: Settings, repoOwner) => settings.createGithub(repoOwner) as any as IGithub;
export {
IGithub,

@ -17,39 +17,45 @@ import * as serveStatic from "serve-static";
import settings from "../settings";
import * as routes from "./routes";
import { setSettings } from "./settings-wrapper";
import { Settings } from "./types";
const app = express();
app.set("port", settings.port);
app.set("views", settings.viewspath);
app.set("view engine", "jade");
app.set("gitpath", settings.gitpath);
app.set("tmpcodepath", settings.tmpcodepath);
app.set("releasepath", settings.releasepath);
app.use(serveFavicon(settings.faviconpath));
app.use(morgan("dev"));
app.use(bodyJson({ limit: "10mb" }));
app.use(bodyUrlencoded({ extended: false }));
app.use(methodOverride());
app.use(serveStatic(settings.staticcontentpath));
if (app.get("env") === "development") {
const run = (settings: Settings) => {
const app = express();
app.set("port", settings.port);
app.set("views", settings.viewspath);
app.set("view engine", "jade");
setSettings(app, settings);
app.use(serveFavicon(settings.faviconpath));
app.use(morgan("dev"));
app.use(bodyJson({ limit: "10mb" }));
app.use(bodyUrlencoded({ extended: false }));
app.use(methodOverride());
app.use(serveStatic(settings.staticcontentpath));
if (app.get("env") === "development") {
app.use(errorhandler());
}
}
app.route("/").get(routes.index);
app.route("/github/postreceive")
app.route("/").get(routes.index);
app.route("/github/postreceive")
.post(routes.postreceive)
.get((req, res) => res.send("Only automated POST requests are allowed for postreceive route"));
app.route("/manual")
app.route("/manual")
.get(routes.manual.get)
.post(routes.manual.post);
app.route("/status/:owner/:reponame/:branch/:rev?").get(routes.status.page);
app.route("/pos-github.payonline.ru/*").get(routes.status.pageFromGithub);
app.route("/status.svg").get(routes.status.image);
app.route("/release/:owner/:reponame/:branch/:rev").get(routes.release);
app.route("/artifact/:owner/:reponame/:branch/:rev/*").get(routes.artifact);
app.route("/status/:owner/:reponame/:branch/:rev?").get(routes.status.page);
app.route("/pos-github.payonline.ru/*").get(routes.status.pageFromGithub);
app.route("/status.svg").get(routes.status.image);
app.route("/release/:owner/:reponame/:branch/:rev").get(routes.release);
app.route("/artifact/:owner/:reponame/:branch/:rev/*").get(routes.artifact);
createServer(app).listen(app.get("port"), () => console.log(`Express server listening on port ${app.get("port")}`));
};
createServer(app).listen(app.get("port"), () => console.log(`Express server listening on port ${app.get("port")}`));
export default run;

@ -8,7 +8,7 @@ import { ReadableStreamBuffer, WritableStreamBuffer } from "stream-buffers";
import * as _ from "underscore";
import { createGunzip, createGzip } from "zlib";
import { Message, Report, ReportResult } from "./types";
import { Message, Report, ReportResult, Settings } from "./types";
const reportFilename = "report.json.gz";
const maxAttemptsNumber = 100;
@ -78,8 +78,8 @@ export const readReport = (releaseDir, callback) => {
});
};
export const loadReport = (app, options, callback) => {
const releaseDir = join(app.get("releasepath"), options.owner, options.reponame, options.branch, options.rev);
export const loadReport = (settings: Settings, options, callback) => {
const releaseDir = join(settings.releasepath, options.owner, options.reponame, options.branch, options.rev);
glob("**", {
cwd: releaseDir,
@ -114,12 +114,12 @@ export const loadReport = (app, options, callback) => {
});
};
export const getStatusMessageFromRelease = (app, originalOptions, callback) => {
export const getStatusMessageFromRelease = (settings: Settings, originalOptions, callback) => {
const options = {
...originalOptions,
attemptsGetReport: (Number(originalOptions.attemptsGetReport) || Number()) + 1,
};
const releaseDir = join(app.get("releasepath"), options.owner, options.reponame, options.branch, options.rev);
const releaseDir = join(settings.releasepath, options.owner, options.reponame, options.branch, options.rev);
const reportFile = join(releaseDir, reportFilename);
exists(reportFile, (reportFileExists) => {
@ -138,7 +138,7 @@ export const getStatusMessageFromRelease = (app, originalOptions, callback) => {
options.onTenthAttempt();
}
return setTimeout(() => exports.getStatusMessageFromRelease(app, options, callback), attemptsTimeout);
return setTimeout(() => exports.getStatusMessageFromRelease(settings, options, callback), attemptsTimeout);
}), directoryCheckTimeout);
}

@ -1,5 +1,7 @@
"use strict";
import { getSettings } from "../settings-wrapper";
export default (req, res) => {
const options = {
branch: `/refs/heads/${req.params.branch}`,
@ -10,7 +12,9 @@ export default (req, res) => {
rev: req.params.rev,
};
const pathParts = [req.app.get("releasepath"), options.owner, options.reponame, options.branch, options.rev, options.file];
const settings = getSettings(req.app);
const pathParts = [settings.releasepath, options.owner, options.reponame, options.branch, options.rev, options.file];
res.sendfile(pathParts.join("/"));
};

@ -2,17 +2,19 @@
import * as _ from "underscore";
import { build } from "../builder";
import { getSettings } from "../settings-wrapper";
export const get = (req, res) => res.render("manual");
export const post = (req, res) => {
const settings = getSettings(req.app);
const options = {
...req.body,
app: req.app,
url: `https://pos-github.payonline.ru/${req.body.owner}/${req.body.reponame}`,
};
build(options, (err, result) => {
build(settings, options, (err, result) => {
console.log("Done processing manual request");
console.log(`Error: ${err}`);
res.render("manual-done", {

@ -3,13 +3,14 @@
import * as JSONParse from "json-parse-safe";
import { build } from "../builder";
import { commentOnPullRequest } from "../commenter";
import { getSettings } from "../settings-wrapper";
const getBranchDescription = (options) => `${options.owner}/${options.reponame}:${options.branchname || options.branch}`;
const processPush = (req, res, payload) => {
const settings = getSettings(req.app);
const repository = payload.repository;
const options = {
app: req.app,
branch: payload.ref,
owner: repository.owner.name,
reponame: repository.name,
@ -19,7 +20,7 @@ const processPush = (req, res, payload) => {
console.log(`Got push event for ${getBranchDescription(options)}`);
build(options, (err, result) => {
build(settings, options, (err, result) => {
console.log("Done processing request from GitHub");
console.log(`Error: ${err}`);
res.send(`Done processing request from GitHub\r\nError: ${err}\r\nResult: ${result}`);
@ -47,16 +48,15 @@ const processPullRequest = (req, res, payload) => {
owner: baseRepo.owner.name || baseRepo.owner.login,
reponame: baseRepo.name,
};
const settings = getSettings(req.app);
const options = {
action,
app: req.app,
baseRepoOptions,
headRepoOptions,
pullRequestNumber,
};
const masterOptions = {
action,
app: req.app,
baseRepoOptions,
headRepoOptions: baseRepoOptions,
pullRequestNumber,
@ -79,7 +79,7 @@ const processPullRequest = (req, res, payload) => {
return res.send("");
}
return commentOnPullRequest((action === "closed" && masterOptions) || options, (err, data) => {
return commentOnPullRequest(settings, (action === "closed" && masterOptions) || options, (err, data) => {
if (err) {
console.log(`Unable to post comment: ${err}`);
}

@ -4,6 +4,7 @@ import { create as createArchiver } from "archiver";
import { join } from "path";
import { readReport } from "../report-processor";
import { getSettings } from "../settings-wrapper";
const getDatePart = (report) => {
if (!report.date) {
@ -32,7 +33,7 @@ export default (req, res, next) => {
rev: req.params.rev,
};
const releasePath = join(req.app.get("releasepath"), options.owner, options.reponame, options.branch, options.rev);
const releasePath = join(getSettings(req.app).releasepath, options.owner, options.reponame, options.branch, options.rev);
readReport(releasePath, (err, report) => {
if (err) {

@ -3,6 +3,7 @@
import * as _ from "underscore";
import { parse } from "url";
import { getSettings } from "../settings-wrapper";
import { getReport } from "../status-processor";
const parseOptionsFromReferer = (path, callback) => {
@ -101,7 +102,7 @@ export const image = (req, res) => {
return handle(err, options);
}
return getReport(req.app, options, handle);
return getReport(getSettings(req.app), options, handle);
});
};
@ -114,7 +115,7 @@ export const page = (req, res) => {
rev: req.params.rev,
};
getReport(req.app, options, createShowReport(res));
getReport(getSettings(req.app), options, createShowReport(res));
};
export const pageFromGithub = (req, res) => parseOptionsFromReferer(req.params[0], (err, options) => {
@ -122,5 +123,5 @@ export const pageFromGithub = (req, res) => parseOptionsFromReferer(req.params[0
return createShowReport(res)(err, options);
}
return getReport(req.app, options, createShowReport(res));
return getReport(req.app /* xxx */, options, createShowReport(res));
});

@ -0,0 +1,12 @@
"use strict";
import { Settings } from "./types";
const getSettings = (app): Settings => app.get("mbsSettings");
const setSettings = (app, settings: Settings) => app.set("mbsSettings", settings);
export {
getSettings,
setSettings,
};

@ -5,9 +5,10 @@ import { join } from "path";
import * as _ from "underscore";
import { loadReport } from "./report-processor";
import { Settings } from "./types";
const addBranchInfo = (app, options, callback) => {
const branchFile = join(app.get("releasepath"), options.owner, options.reponame, "$revs", `${options.rev}.branch`);
const addBranchInfo = (settings: Settings, options, callback) => {
const branchFile = join(settings.releasepath, options.owner, options.reponame, "$revs", `${options.rev}.branch`);
exists(branchFile, (exists) => {
if (!exists) {
@ -32,8 +33,8 @@ const addBranchInfo = (app, options, callback) => {
});
};
const addRevInfo = (app, options, callback) => {
const revFile = join(app.get("releasepath"), options.owner, options.reponame, options.branch, "latest.id");
const addRevInfo = (settings: Settings, options, callback) => {
const revFile = join(settings.releasepath, options.owner, options.reponame, options.branch, "latest.id");
exists(revFile, (exists) => {
if (!exists) {
@ -55,7 +56,7 @@ const addRevInfo = (app, options, callback) => {
});
};
const parseOptions = (app, options, callback) => {
const parseOptions = (settings: Settings, options, callback) => {
if (options.rev && !(/^[\da-f]{40}$/i).test(options.rev)) {
return callback(`Wrong rev format: ${options.rev}`, options);
}
@ -66,14 +67,14 @@ const parseOptions = (app, options, callback) => {
};
if (options.rev) {
return addBranchInfo(app, {
return addBranchInfo(settings, {
...result,
rev: options.rev,
}, callback);
}
if (/^[\da-f]{40}$/i.test(options.branchName)) {
return addBranchInfo(app, {
return addBranchInfo(settings, {
...result,
rev: options.branchName,
}, callback);
@ -81,17 +82,17 @@ const parseOptions = (app, options, callback) => {
const branchName = options.branchName || "master";
return addRevInfo(app, {
return addRevInfo(settings, {
...result,
branch: `refs/heads/${branchName}`,
branchName,
}, callback);
};
export const getReport = (app, options, callback) => parseOptions(app, options, (err, result) => {
export const getReport = (settings: Settings, options, callback) => parseOptions(settings, options, (err, result) => {
if (err) {
return callback(err, {});
}
return loadReport(app, result, callback);
return loadReport(settings, result, callback);
});

@ -3,7 +3,7 @@
import * as _ from "underscore";
import tasks from "./tasks";
import { MessagesRoot, TaskInfo, TaskProcessor, TaskProcessorCallback, TaskProcessorCore } from "./types";
import { MessagesRoot, Settings, TaskInfo, TaskProcessor, TaskProcessorCallback, TaskProcessorCore } from "./types";
// TaskProcessor does not look like EventEmitter, so no need to extend EventEmitter and use `emit' here.
const createTaskProcessor = (task: TaskInfo, outerProcessor: TaskProcessorCore, callback: TaskProcessorCallback) => {
@ -31,6 +31,7 @@ const createTaskProcessor = (task: TaskInfo, outerProcessor: TaskProcessorCore,
onInfo,
process: () => tasks[task.type](task.params || {}, result)(),
processTask: (innerTask, innerCallback) => createTaskProcessor(innerTask, result, innerCallback).process(),
settings: outerProcessor.settings,
};
return result;
@ -65,7 +66,7 @@ const addFlag = (flags) => (flagName) => {
const containsFlag = (flags) => (flagName) => flags[flagName];
export const processTask = (task, context, callback) => {
export const processTask = (settings: Settings, task, context, callback) => {
const errors: MessagesRoot = { $allMessages: [] };
const warns: MessagesRoot = { $allMessages: [] };
const infos: MessagesRoot = { $allMessages: [] };
@ -86,6 +87,7 @@ export const processTask = (task, context, callback) => {
onError: messageProcessor(errors),
onInfo: messageProcessor(infos),
onWarn: messageProcessor(warns),
settings,
}, (err) => callback(err, {
errors,
infos,

@ -4,7 +4,6 @@ import { spawn } from "child_process";
import * as JSONParse from "json-parse-safe";
import { WritableStreamBuffer } from "stream-buffers";
import settings from "../../settings";
import { Task } from "../types";
const wrapBuilder = (builder, input, onExit) => {
@ -46,7 +45,7 @@ const wrapBuilder = (builder, input, onExit) => {
export default ((params, processor) => () => {
const input = JSON.stringify(params);
const builder = spawn(settings.builderExecutable, [params.command]);
const builder = spawn(processor.settings.builderExecutable, [params.command]);
processor.onInfo(`DotNetBuilderWrapper processing (at ${new Date().toISOString()}): ${input}`);

@ -3,30 +3,27 @@
import { join } from "path";
import * as _ from "underscore";
import rawSettings from "../../settings";
import { Settings, Task } from "../types";
import dotnetbuilderwrapper from "./dotnetbuilderwrapper";
const settings: Settings = rawSettings;
export default ((params, processor) => {
if (settings.isCodeAnalysisUnsupported && params.forceCodeAnalysis) {
if (processor.settings.isCodeAnalysisUnsupported && params.forceCodeAnalysis) {
processor.onError("Code analysis is not supported");
return processor.done();
}
const getAdditionalSigningParameters = () => {
if (settings.skipCodeSigning || params.skipCodeSigning) {
if (processor.settings.skipCodeSigning || params.skipCodeSigning) {
return {};
}
return { SigningKey: settings.codeSigningKeyFile };
return { SigningKey: processor.settings.codeSigningKeyFile };
};
const skipCodeAnalysis = settings.isCodeAnalysisUnsupported
const skipCodeAnalysis = processor.settings.isCodeAnalysisUnsupported
|| params.ignoreCodeAnalysis
|| (settings.ignoreCodeAnalysisByDefault && !params.forceCodeAnalysis);
|| (processor.settings.ignoreCodeAnalysisByDefault && !params.forceCodeAnalysis);
const compileParams = {
Configuration: params.configuration,

@ -2,13 +2,12 @@
import { join } from "path";
import settings from "../../settings";
import { Task } from "../types";
import dotnetbuilderwrapper from "./dotnetbuilderwrapper";
export default ((params, processor) => dotnetbuilderwrapper({
ApiKey: settings.nugetApiKey,
NugetHost: settings.nugetHost,
ApiKey: processor.settings.nugetApiKey,
NugetHost: processor.settings.nugetHost,
Package: join(processor.context.exported, params.Package),
command: "nugetpush",
}, processor)) as Task;

@ -5,21 +5,18 @@ import { readFile, writeFile } from "fs";
import * as glob from "glob";
import { join } from "path";
import rawSettings from "../../settings";
import { Settings, Task } from "../types";
const flagDoneName = "dotnetrewriterDone";
const settings: Settings = rawSettings;
const processAssemblyInfo = (params, processor, appendInformationalVersion) => (originalContent, cb) => {
const processInternalsVisible = (content) => {
if (params.skipCodeSigning || settings.skipCodeSigning) {
if (params.skipCodeSigning || processor.settings.xxxskipCodeSigning) {
return content;
}
const pattern = /InternalsVisibleTo\s*\(\s*"([\w.]+)"\s*\)/g;
const replacer = (match, p1) => `InternalsVisibleTo("${p1},PublicKey=${settings.codeSigningPublicKey}")`;
const replacer = (match, p1) => `InternalsVisibleTo("${p1},PublicKey=${processor.settings.codeSigningPublicKey}")`;
return content.replace(pattern, replacer);
};

@ -3,19 +3,16 @@
import { CLIEngine } from "eslint";
import { join } from "path";
import rawSettings from "../../settings";
import { Settings, Task } from "../types";
const settings: Settings = rawSettings;
const errorSeverity = 2;
export default ((params, processor) => () => {
if (settings.isCodeAnalysisUnsupported) {
if (processor.settings.isCodeAnalysisUnsupported) {
return;
}
const cli = new CLIEngine({ configFile: settings.eslintBrowserConfig });
const cli = new CLIEngine({ configFile: processor.settings.eslintBrowserConfig });
const filePath = join(processor.context.exported, params.filename);
const result = cli.executeOnFiles([filePath]);

@ -1,9 +1,12 @@
import { Settings } from "./settings-types";
export type TaskProcessorCallback = (err: string) => void;
export interface ITaskProcessorCore {
readonly onError: (message: string | Error, prefix?: string) => void;
readonly onWarn: (message: string, prefix?: string) => void;
readonly onInfo: (message: string, prefix?: string) => void;
readonly settings: Settings;
readonly context?: any;
}

Loading…
Cancel
Save