@ioffice/tc-builder
Advanced tools
Comparing version 1.3.0-beta.1806212344 to 1.3.0-beta.1806221419
import { MessageCategory, TypedObject, ExitCode, ITSMessage, IFileInfo, IFileMessages, IMessageInfo, IMessageReference, IProjectResults, IProjectStatus, compile, compileProject, compileCLI, getProjectStatus, formatResults, formatProjectResults, formatFailureMessage } from './compiler'; | ||
import { AbstractBuilder, IBuilder, NPMBuilder, runBuilder } from './builders'; | ||
import { CI, Environment, IO, Git, Github, Provider } from './services'; | ||
import { IField, IAction, IAttachment, AbstractSlack, ISlacker, TravisSlack, runSlacker } from './slack'; | ||
import { CI, Environment, IBuilderMessages, IO, Git, Github, Provider } from './services'; | ||
import { util, Util } from './Util'; | ||
export { MessageCategory, TypedObject, ExitCode, ITSMessage, IFileInfo, IFileMessages, IMessageInfo, IMessageReference, IProjectResults, IProjectStatus, compile, compileProject, compileCLI, getProjectStatus, formatResults, formatProjectResults, formatFailureMessage, AbstractBuilder, IBuilder, NPMBuilder, runBuilder, CI, Environment, IO, Git, Github, Provider, util, Util, }; | ||
export { MessageCategory, TypedObject, ExitCode, ITSMessage, IFileInfo, IFileMessages, IMessageInfo, IMessageReference, IProjectResults, IProjectStatus, compile, compileProject, compileCLI, getProjectStatus, formatResults, formatProjectResults, formatFailureMessage, AbstractBuilder, IBuilder, NPMBuilder, runBuilder, IField, IAction, IAttachment, AbstractSlack, ISlacker, TravisSlack, runSlacker, CI, Environment, IBuilderMessages, IO, Git, Github, Provider, util, Util, }; |
@@ -16,2 +16,6 @@ "use strict"; | ||
exports.runBuilder = builders_1.runBuilder; | ||
var slack_1 = require("./slack"); | ||
exports.AbstractSlack = slack_1.AbstractSlack; | ||
exports.TravisSlack = slack_1.TravisSlack; | ||
exports.runSlacker = slack_1.runSlacker; | ||
var services_1 = require("./services"); | ||
@@ -18,0 +22,0 @@ exports.CI = services_1.CI; |
{ | ||
"name": "@ioffice/tc-builder", | ||
"version": "1.3.0-beta.1806212344", | ||
"version": "1.3.0-beta.1806221419", | ||
"description": "iOFFICE TeamCity Builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,2 +22,3 @@ declare enum CI { | ||
readonly slackToken: string; | ||
readonly slackChannel: string; | ||
readonly isPreRelease: boolean; | ||
@@ -24,0 +25,0 @@ readonly isRelease: boolean; |
@@ -30,2 +30,3 @@ "use strict"; | ||
this.slackToken = pEnv['SLACK_TOKEN'] || ''; | ||
this.slackChannel = pEnv['SLACK_CHANNEL'] || ''; | ||
this.isPreRelease = !!pEnv['PRERELEASE']; | ||
@@ -32,0 +33,0 @@ this.isRelease = !!this.commitMessage.match(this.releaseRegEx); |
import { CI, Environment } from './Environment'; | ||
import { IO } from './IO'; | ||
import { IBuilderMessages, IO } from './IO'; | ||
import { Git } from './Git'; | ||
@@ -14,2 +14,2 @@ import { Github } from './Github'; | ||
} | ||
export { CI, Environment, IO, Git, Github, Provider, }; | ||
export { CI, Environment, IBuilderMessages, IO, Git, Github, Provider, }; |
import { Environment } from './Environment'; | ||
interface IBuilderMessages { | ||
warnings: [string, number][]; | ||
errors: [string, number][]; | ||
} | ||
declare class IO { | ||
@@ -31,2 +35,3 @@ env: Environment; | ||
escapeTC(msg: string): string; | ||
loadMessages(): IBuilderMessages; | ||
/** | ||
@@ -36,4 +41,4 @@ * To be called before the process finishes so that all the error and warning messages may be | ||
*/ | ||
dumpMessages(fileName?: string): void; | ||
dumpMessages(): void; | ||
} | ||
export { IO, }; | ||
export { IBuilderMessages, IO, }; |
@@ -92,2 +92,5 @@ "use strict"; | ||
}; | ||
IO.prototype.loadMessages = function () { | ||
return Util_1.util.readJSON('./tcBuilderMessages.json'); | ||
}; | ||
/** | ||
@@ -97,4 +100,5 @@ * To be called before the process finishes so that all the error and warning messages may be | ||
*/ | ||
IO.prototype.dumpMessages = function (fileName) { | ||
if (fileName === void 0) { fileName = 'tcBuilderMessages.json'; } | ||
IO.prototype.dumpMessages = function () { | ||
var _a, _b; | ||
var fileName = './tcBuilderMessages.json'; | ||
var data = { | ||
@@ -104,2 +108,7 @@ errors: IO.errors, | ||
}; | ||
var current = this.loadMessages(); | ||
if (current) { | ||
(_a = data.errors).push.apply(_a, current.errors); | ||
(_b = data.warnings).push.apply(_b, current.warnings); | ||
} | ||
Util_1.util.writeJSON(data, fileName); | ||
@@ -106,0 +115,0 @@ }; |
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
var Compiler_1 = require("./compiler/Compiler"); | ||
var slack_1 = require("./slack"); | ||
var commands = [ | ||
@@ -15,2 +16,3 @@ 'setup', | ||
'run', | ||
'slack-notify', | ||
]; | ||
@@ -26,3 +28,3 @@ var options = [ | ||
]; | ||
var _a = commands.map(function (x) { return process.argv.indexOf(x) > -1; }), setup = _a[0], updateTools = _a[1], compile = _a[2], run = _a[3]; | ||
var _a = commands.map(function (x) { return process.argv.indexOf(x) > -1; }), setup = _a[0], updateTools = _a[1], compile = _a[2], run = _a[3], slackNotify = _a[4]; | ||
var _b = options.map(function (x) { return process.argv.indexOf(x) > -1; }), noLint = _b[0], verbose = _b[1], help = _b[2], h = _b[3], version = _b[4], v = _b[5], ci = _b[6]; | ||
@@ -32,3 +34,3 @@ var tcPkg = Util_1.util.readJSON('./package.json', __dirname) || {}; | ||
var log = function (msg) { return process.stdout.write(msg + "\n"); }; | ||
var usage = "usage: tc-builder <command> [--options]\n\nThe following commands are supported:\n\n - setup: Installs all the same dependencies as the ones in the tc-builder and creates\n configuration files if they do not exists. This command should be run when starting\n a new project or updating tc-builder.\n\n If there are any new updates to the configuration files and you wish to see them you\n can provide the name of the file right after the command.\n - update-tools: Installs all the latest devDependencies.\n - compile: Looks at the 'tsconfig.json' file to compile the project. By default it will also\n lint the files unless we use the '--no-lint' option.\n - run: Main command to be run in team city. It will make sure to run all the tests and publish\n to npm if necessary.\n\nOptions:\n\n --no-lint: Skip linting.\n --verbose: Print messages of the steps for the 'compile' command.\n --ci: Continous Integration flag, minimizes the output in case there are too many errors.\n --help, -h: Print this message.\n --version, -v: Print the version.\n\ntc-builder@" + tcPkgVersion + "\n"; | ||
var usage = "usage: tc-builder <command> [--options]\n\nThe following commands are supported:\n\n - setup: Installs all the same dependencies as the ones in the tc-builder and creates\n configuration files if they do not exists. This command should be run when starting\n a new project or updating tc-builder.\n\n If there are any new updates to the configuration files and you wish to see them you\n can provide the name of the file right after the command.\n - update-tools: Installs all the latest devDependencies.\n - compile: Looks at the 'tsconfig.json' file to compile the project. By default it will also\n lint the files unless we use the '--no-lint' option.\n - run: Main command to be run in team city. It will make sure to run all the tests and publish\n to npm if necessary.\n - slack-notify: If you have provided the appropiate slack environment variables then this will\n get slack to send a message.\n\nOptions:\n\n --no-lint: Skip linting.\n --verbose: Print messages of the steps for the 'compile' command.\n --ci: Continous Integration flag, minimizes the output in case there are too many errors.\n --help, -h: Print this message.\n --version, -v: Print the version.\n\ntc-builder@" + tcPkgVersion + "\n"; | ||
function main() { | ||
@@ -43,20 +45,20 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
log(usage); | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 1: | ||
if (!(version || v)) return [3 /*break*/, 2]; | ||
log(tcPkgVersion); | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 2: | ||
if (!((+setup) + (+updateTools) + (+compile) + (+run) !== 1)) return [3 /*break*/, 3]; | ||
if (!((+setup) + (+updateTools) + (+compile) + (+run) + (+slackNotify) !== 1)) return [3 /*break*/, 3]; | ||
log("usage: tc-builder <" + commands.join(' | ') + "> [-h]"); | ||
exitNumber = 1; | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 3: | ||
if (!setup) return [3 /*break*/, 4]; | ||
exitNumber = Setup_1.runSetup(tcPkg); | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 4: | ||
if (!updateTools) return [3 /*break*/, 5]; | ||
Setup_1.updateDevTools(tcPkg); | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 5: | ||
@@ -68,3 +70,3 @@ if (!compile) return [3 /*break*/, 6]; | ||
exitNumber = Compiler_1.compileCLI('tsconfig.json', noLint ? '' : './tslint.json', verbose, messageMap, ci); | ||
return [3 /*break*/, 8]; | ||
return [3 /*break*/, 10]; | ||
case 6: | ||
@@ -76,4 +78,10 @@ if (!run) return [3 /*break*/, 8]; | ||
exitNumber = code; | ||
_a.label = 8; | ||
return [3 /*break*/, 10]; | ||
case 8: | ||
if (!slackNotify) return [3 /*break*/, 10]; | ||
return [4 /*yield*/, slack_1.runSlacker(slack_1.TravisSlack)]; | ||
case 9: | ||
exitNumber = _a.sent(); | ||
_a.label = 10; | ||
case 10: | ||
process.on('exit', function () { | ||
@@ -80,0 +88,0 @@ process.exit(exitNumber); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
107837
49
2563