parent
c592891dde
commit
c9dfd2b5b9
@ -1,26 +1,26 @@ |
||||
"use strict"; |
||||
|
||||
const realFs = require("fs"); |
||||
const fs = require("graceful-fs"); |
||||
import realFs = require("fs"); |
||||
import fs = require("graceful-fs"); |
||||
|
||||
fs.gracefulify(realFs); |
||||
|
||||
const express = require("express"); |
||||
const routes = require("./routes"); |
||||
const http = require("http"); |
||||
const path = require("path"); |
||||
const serveFavicon = require("serve-favicon"); |
||||
const morgan = require("morgan"); |
||||
const bodyParser = require("body-parser"); |
||||
const methodOverride = require("method-override"); |
||||
const serveStatic = require("serve-static"); |
||||
const errorhandler = require("errorhandler"); |
||||
import express = require("express"); |
||||
import routes = require("./routes"); |
||||
import http = require("http"); |
||||
import path = require("path"); |
||||
import serveFavicon = require("serve-favicon"); |
||||
import morgan = require("morgan"); |
||||
import bodyParser = require("body-parser"); |
||||
import methodOverride = require("method-override"); |
||||
import serveStatic = require("serve-static"); |
||||
import errorhandler = require("errorhandler"); |
||||
|
||||
const settings = require("./settings"); |
||||
import settings = require("./settings"); |
||||
|
||||
const app = express(); |
||||
|
||||
app.set("port", process.env.PORT || settings.port); // eslint-disable-line no-process-env
|
||||
app.set("port", settings.port); // eslint-disable-line no-process-env
|
||||
app.set("views", path.join(__dirname, "views")); |
||||
app.set("view engine", "jade"); |
||||
app.set("gitpath", settings.gitpath); |
@ -1,3 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
exports.send = (message, callback) => process.nextTick(callback); |
@ -0,0 +1,3 @@ |
||||
"use strict"; |
||||
|
||||
export const send = (message, callback) => process.nextTick(callback); |
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => glob("**/obj/{Debug,Release}/*.{dll,pdb,xml}", { |
||||
"cwd": processor.context.exported, |
||||
"dot": true |
@ -1,6 +1,6 @@ |
||||
"use strict"; |
||||
|
||||
module.exports = (params, processor) => { |
||||
export = (params, processor) => { |
||||
const condition = (!params.owner || params.owner === processor.context.owner) |
||||
&& (!params.branch || params.branch === processor.context.branch || `refs/heads/${params.branch}` === processor.context.branch); |
||||
const task = (condition && params.task) || params.otherwise; |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const fse = require("fs-extra"); |
||||
import path = require("path"); |
||||
import fse = require("fs-extra"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const sourceFilePath = path.join(processor.context.exported, params.filename); |
||||
const targetFilePath = path.join(processor.context.release, params.filename); |
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => glob(params.mask, { |
||||
"cwd": processor.context.exported, |
||||
"dot": true |
@ -1,10 +1,10 @@ |
||||
"use strict"; |
||||
|
||||
const fs = require("fs"); |
||||
const path = require("path"); |
||||
const cssnano = require("cssnano"); |
||||
import fs = require("fs"); |
||||
import path = require("path"); |
||||
import cssnano = require("cssnano"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const filePath = path.join(processor.context.exported, params.filename); |
||||
|
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
const flagDoneName = "cssnanoallDone"; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
if (processor.context.containsFlag(flagDoneName)) { |
||||
processor.onWarn("cssnanoall task is executed more than once; this is probably a bug in your mbs.json"); |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const fse = require("fs-extra"); |
||||
import path = require("path"); |
||||
import fse = require("fs-extra"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const sourceFilePath = path.join(processor.context.exported, params.filename); |
||||
|
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const sequential = require("./sequential"); |
||||
import sequential = require("./sequential"); |
||||
|
||||
module.exports = (params, processor) => sequential({ |
||||
export = (params, processor) => sequential({ |
||||
"tasks": [ |
||||
{ |
||||
"name": "build", |
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const sequential = require("./sequential"); |
||||
import sequential = require("./sequential"); |
||||
|
||||
module.exports = (params, processor) => sequential({ |
||||
export = (params, processor) => sequential({ |
||||
"tasks": [ |
||||
{ |
||||
"name": "build", |
@ -1,11 +1,11 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const _ = require("underscore"); |
||||
const settings = require("../../settings"); |
||||
const dotnetbuilderwrapper = require("./dotnetbuilderwrapper"); |
||||
import path = require("path"); |
||||
import _ = require("underscore"); |
||||
import settings = require("../../settings"); |
||||
import dotnetbuilderwrapper = require("./dotnetbuilderwrapper"); |
||||
|
||||
module.exports = (params, processor) => { |
||||
export = (params, processor) => { |
||||
if (settings.isCodeAnalysisUnsupported && params.forceCodeAnalysis) { |
||||
processor.onError("Code analysis is not supported"); |
||||
|
@ -1,11 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
const _ = require("underscore"); |
||||
const dotnetnugetprocessinternal = require("./dotnetnugetprocessinternal"); |
||||
|
||||
module.exports = (params, processor) => dotnetnugetprocessinternal(_.extendOwn(params, { |
||||
"getFinalTask": (nupkg) => ({ |
||||
"params": { "filename": nupkg }, |
||||
"type": "copy" |
||||
}) |
||||
}), processor); |
@ -0,0 +1,11 @@ |
||||
"use strict"; |
||||
|
||||
import _ = require("underscore"); |
||||
import dotnetnugetprocessinternal = require("./dotnetnugetprocessinternal"); |
||||
|
||||
export = (params, processor) => dotnetnugetprocessinternal(_.extendOwn(params, { |
||||
"getFinalTask": (nupkg) => ({ |
||||
"params": { "filename": nupkg }, |
||||
"type": "copy" |
||||
}) |
||||
}), processor); |
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const conditional = require("./conditional"); |
||||
import conditional = require("./conditional"); |
||||
|
||||
module.exports = (params, processor) => conditional({ |
||||
export = (params, processor) => conditional({ |
||||
"branch": "master", |
||||
"otherwise": { |
||||
"name": "nuget-pack", |
@ -1,11 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
const _ = require("underscore"); |
||||
const dotnetnugetprocessinternal = require("./dotnetnugetprocessinternal"); |
||||
|
||||
module.exports = (params, processor) => dotnetnugetprocessinternal(_.extendOwn(params, { |
||||
"getFinalTask": (nupkg) => ({ |
||||
"params": { "Package": nupkg }, |
||||
"type": "dotnetnugetpushonly" |
||||
}) |
||||
}), processor); |
@ -0,0 +1,11 @@ |
||||
"use strict"; |
||||
|
||||
import _ = require("underscore"); |
||||
import dotnetnugetprocessinternal = require("./dotnetnugetprocessinternal"); |
||||
|
||||
export = (params, processor) => dotnetnugetprocessinternal(_.extendOwn(params, { |
||||
"getFinalTask": (nupkg) => ({ |
||||
"params": { "Package": nupkg }, |
||||
"type": "dotnetnugetpushonly" |
||||
}) |
||||
}), processor); |
@ -1,10 +1,10 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const dotnetbuilderwrapper = require("./dotnetbuilderwrapper"); |
||||
const settings = require("../../settings"); |
||||
import path = require("path"); |
||||
import dotnetbuilderwrapper = require("./dotnetbuilderwrapper"); |
||||
import settings = require("../../settings"); |
||||
|
||||
module.exports = (params, processor) => dotnetbuilderwrapper({ |
||||
export = (params, processor) => dotnetbuilderwrapper({ |
||||
"ApiKey": settings.nugetApiKey, |
||||
"NugetHost": settings.nugetHost, |
||||
"Package": path.join(processor.context.exported, params.Package), |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const sequential = require("./sequential"); |
||||
import path = require("path"); |
||||
import sequential = require("./sequential"); |
||||
|
||||
module.exports = (params, processor) => sequential({ |
||||
export = (params, processor) => sequential({ |
||||
"tasks": [ |
||||
{ |
||||
"params": { |
@ -1,9 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const dotNetBuilderWrapper = require("./dotnetbuilderwrapper"); |
||||
|
||||
module.exports = (params, processor) => dotNetBuilderWrapper({ |
||||
"TestLibraryPath": path.join(processor.context.exported, params.assembly), |
||||
"command": "nunit" |
||||
}, processor); |
@ -0,0 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
import path = require("path"); |
||||
import dotNetBuilderWrapper = require("./dotnetbuilderwrapper"); |
||||
|
||||
export = (params, processor) => dotNetBuilderWrapper({ |
||||
"TestLibraryPath": path.join(processor.context.exported, params.assembly), |
||||
"command": "nunit" |
||||
}, processor); |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
const flagDoneName = "dotnetnunitallDone"; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
if (processor.context.containsFlag(flagDoneName)) { |
||||
processor.onWarn("dotnetnunitall task is executed more than once; this is probably a bug in your mbs.json"); |
@ -1,6 +1,6 @@ |
||||
"use strict"; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
if (params.error) { |
||||
processor.onError(params.error); |
@ -1,13 +1,13 @@ |
||||
"use strict"; |
||||
|
||||
const path = require("path"); |
||||
const CLIEngine = require("eslint").CLIEngine; |
||||
const settings = require("../../settings"); |
||||
import path = require("path"); |
||||
import { CLIEngine } from "eslint"; |
||||
import settings = require("../../settings"); |
||||
const cli = new CLIEngine({ "configFile": settings.eslintBrowserConfig }); |
||||
|
||||
const errorSeverity = 2; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const filePath = path.join(processor.context.exported, params.filename); |
||||
const result = cli.executeOnFiles([filePath]); |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
const flagDoneName = "eslintbrowserallDone"; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
if (processor.context.containsFlag(flagDoneName)) { |
||||
processor.onWarn("eslintbrowserall task is executed more than once; this is probably a bug in your mbs.json"); |
@ -1,13 +1,17 @@ |
||||
"use strict"; |
||||
|
||||
var tasks = {}; |
||||
|
||||
// Code taken from http://stackoverflow.com/a/17204293
|
||||
// eslint-disable-next-line no-sync
|
||||
require("fs").readdirSync(__dirname) |
||||
.forEach((file) => { |
||||
if (file.match(/\.js$/) !== null && file !== "index.js") { |
||||
const name = file.replace(".js", ""); |
||||
if (file.match(/\.ts$/) !== null && file !== "index.ts") { |
||||
const name = file.replace(".ts", ""); |
||||
|
||||
// eslint-disable-next-line global-require
|
||||
exports[name] = require(`./${file}`); |
||||
tasks[name] = require(`./${file}`); |
||||
} |
||||
}); |
||||
|
||||
export default tasks; |
@ -1,3 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
module.exports = (params, processor) => ({ "process": () => processor.done() }); |
@ -0,0 +1,3 @@ |
||||
"use strict"; |
||||
|
||||
export = (params, processor) => ({ "process": () => processor.done() }); |
@ -1,8 +1,8 @@ |
||||
"use strict"; |
||||
|
||||
const sequential = require("./sequential"); |
||||
import sequential = require("./sequential"); |
||||
|
||||
module.exports = (params, processor) => sequential({ |
||||
export = (params, processor) => sequential({ |
||||
"tasks": [ |
||||
{ |
||||
"params": { "excludeFiles": params.eslintExcludeFiles }, |
@ -1,7 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
const async = require("async"); |
||||
|
||||
const mapper = (processor) => (task) => (callback) => processor.processTask(task, callback); |
||||
|
||||
module.exports = (params, processor) => ({ "process": () => async.parallel(params.tasks.map(mapper(processor)), () => processor.done()) }); |
@ -0,0 +1,7 @@ |
||||
"use strict"; |
||||
|
||||
import async = require("async"); |
||||
|
||||
const mapper = (processor) => (task) => (callback) => processor.processTask(task, callback); |
||||
|
||||
export = (params, processor) => ({ "process": () => async.parallel(params.tasks.map(mapper(processor)), () => processor.done()) }); |
@ -1,7 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
const async = require("async"); |
||||
|
||||
const mapper = (processor) => (task) => (callback) => processor.processTask(task, callback); |
||||
|
||||
module.exports = (params, processor) => ({ "process": () => async.series(params.tasks.map(mapper(processor)), () => processor.done()) }); |
@ -0,0 +1,7 @@ |
||||
"use strict"; |
||||
|
||||
import async = require("async"); |
||||
|
||||
const mapper = (processor) => (task) => (callback) => processor.processTask(task, callback); |
||||
|
||||
export = (params, processor) => ({ "process": () => async.series(params.tasks.map(mapper(processor)), () => processor.done()) }); |
@ -1,10 +1,10 @@ |
||||
"use strict"; |
||||
|
||||
const fs = require("fs"); |
||||
const path = require("path"); |
||||
const UglifyJS = require("uglify-js"); |
||||
import fs = require("fs"); |
||||
import path = require("path"); |
||||
import UglifyJS = require("uglify-js"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const filePath = path.normalize(path.join(processor.context.exported, params.filename)); |
||||
const result = UglifyJS.minify(filePath); |
@ -1,10 +1,10 @@ |
||||
"use strict"; |
||||
|
||||
const glob = require("glob"); |
||||
import glob = require("glob"); |
||||
|
||||
const doneFlagName = "uglifyjsallDone"; |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
if (processor.context.containsFlag(doneFlagName)) { |
||||
processor.onWarn("dotnetnunitall task is executed more than once; this is probably a bug in your mbs.json"); |
@ -1,9 +1,9 @@ |
||||
"use strict"; |
||||
|
||||
const fs = require("fs"); |
||||
const path = require("path"); |
||||
import fs = require("fs"); |
||||
import path = require("path"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const filePath = path.join(processor.context.exported, params.filename); |
||||
|
@ -1,10 +1,10 @@ |
||||
"use strict"; |
||||
|
||||
const fs = require("fs"); |
||||
const path = require("path"); |
||||
const Archiver = require("archiver"); |
||||
import fs = require("fs"); |
||||
import path = require("path"); |
||||
import Archiver = require("archiver"); |
||||
|
||||
module.exports = (params, processor) => ({ |
||||
export = (params, processor) => ({ |
||||
"process": () => { |
||||
const sourceDirectoryPath = path.normalize(path.join(processor.context.exported, String(params.directory || ""))); |
||||
const targetArchivePath = path.normalize(path.join(processor.context.release, params.archive)); |
@ -1,6 +1,6 @@ |
||||
"use strict"; |
||||
|
||||
module.exports = (req, res) => { |
||||
export = (req, res) => { |
||||
const options = { |
||||
"branch": `/refs/heads/${req.params.branch}`, |
||||
"branchName": req.params.branch, |
@ -1,9 +0,0 @@ |
||||
"use strict"; |
||||
|
||||
exports.index = (req, res) => res.render("index", { "title": `Express<br/>\r\n${req}` }); |
||||
|
||||
exports.postreceive = require("./postreceive"); |
||||
exports.manual = require("./manual"); |
||||
exports.status = require("./status"); |
||||
exports.artifact = require("./artifact"); |
||||
exports.release = require("./release"); |
@ -0,0 +1,12 @@ |
||||
"use strict"; |
||||
|
||||
import postreceive = require("./postreceive"); |
||||
import manual = require("./manual"); |
||||
import status = require("./status"); |
||||
import artifact = require("./artifact"); |
||||
import release = require("./release"); |
||||
|
||||
const index = (req, res) => res.render("index", { "title": `Express<br/>\r\n${req}` }); |
||||
|
||||
export { index, postreceive, manual, status, artifact, release }; |
||||
|
@ -1,11 +1,11 @@ |
||||
"use strict"; |
||||
|
||||
const _ = require("underscore"); |
||||
const builder = require("../lib/builder"); |
||||
import _ = require("underscore"); |
||||
import builder = require("../lib/builder"); |
||||
|
||||
exports.get = (req, res) => res.render("manual"); |
||||
export const get = (req, res) => res.render("manual"); |
||||
|
||||
exports.post = (req, res) => { |
||||
export const post = (req, res) => { |
||||
const options = _.extend(req.body, { |
||||
"app": req.app, |
||||
"url": `https://pos-github.payonline.ru/${req.body.owner}/${req.body.reponame}` |
@ -0,0 +1,8 @@ |
||||
{ |
||||
"compilerOptions": { |
||||
"target": "es6", |
||||
"typeRoots": [ |
||||
"node_modules/@types" |
||||
] |
||||
} |
||||
} |
Loading…
Reference in new issue