@beecode/msh-cli 1.2.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/msh.js +1 -1
- package/dist/app/cli-app.d.ts +5 -0
- package/dist/app/cli-app.d.ts.map +1 -0
- package/dist/app/cli-app.js +5 -9
- package/dist/app/http-server-app.d.ts +5 -0
- package/dist/app/http-server-app.d.ts.map +1 -0
- package/dist/app/http-server-app.js +3 -7
- package/dist/app/init/parse-and-route-args.d.ts +8 -0
- package/dist/app/init/parse-and-route-args.d.ts.map +1 -0
- package/dist/app/init/parse-and-route-args.js +5 -9
- package/dist/app/tui-app.d.ts +5 -0
- package/dist/app/tui-app.d.ts.map +1 -0
- package/dist/app/tui-app.js +3 -7
- package/dist/controller/cli-menu/main-menu.d.ts +6 -0
- package/dist/controller/cli-menu/main-menu.d.ts.map +1 -0
- package/dist/controller/cli-menu/main-menu.js +11 -11
- package/dist/controller/yargs-router/cli-router.d.ts +14 -0
- package/dist/controller/yargs-router/cli-router.d.ts.map +1 -0
- package/dist/controller/yargs-router/cli-router.js +34 -29
- package/dist/controller/yargs-router/git-router.d.ts +10 -0
- package/dist/controller/yargs-router/git-router.d.ts.map +1 -0
- package/dist/controller/yargs-router/git-router.js +51 -49
- package/dist/controller/yargs-router/npm-router.d.ts +7 -0
- package/dist/controller/yargs-router/npm-router.d.ts.map +1 -0
- package/dist/controller/yargs-router/npm-router.js +25 -26
- package/dist/dal/shell-dal.d.ts +12 -0
- package/dist/dal/shell-dal.d.ts.map +1 -0
- package/dist/dal/shell-dal.js +12 -18
- package/dist/index-cli.d.ts +2 -0
- package/dist/index-cli.d.ts.map +1 -0
- package/dist/index-cli.js +8 -11
- package/dist/index-init.d.ts +2 -0
- package/dist/index-init.d.ts.map +1 -0
- package/dist/index-init.js +7 -12
- package/dist/index-jest-setup.d.ts +6 -0
- package/dist/index-jest-setup.d.ts.map +1 -0
- package/dist/index-jest-setup.js +4 -0
- package/dist/index-server.d.ts +2 -0
- package/dist/index-server.d.ts.map +1 -0
- package/dist/index-server.js +6 -9
- package/dist/index-terminal-ui.d.ts +2 -0
- package/dist/index-terminal-ui.d.ts.map +1 -0
- package/dist/index-terminal-ui.js +6 -9
- package/dist/model/command/init-config.d.ts +5 -0
- package/dist/model/command/init-config.d.ts.map +1 -0
- package/dist/model/command/init-config.js +4 -8
- package/dist/model/command/interfaces.d.ts +12 -0
- package/dist/model/command/interfaces.d.ts.map +1 -0
- package/dist/model/command/interfaces.js +2 -3
- package/dist/model/command/project-command/git-clone-project-command.d.ts +15 -0
- package/dist/model/command/project-command/git-clone-project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/git-clone-project-command.js +9 -12
- package/dist/model/command/project-command/git-simple-project-command.d.ts +16 -0
- package/dist/model/command/project-command/git-simple-project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/git-simple-project-command.js +9 -13
- package/dist/model/command/project-command/git-tag-project-command.d.ts +12 -0
- package/dist/model/command/project-command/git-tag-project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/git-tag-project-command.js +14 -12
- package/dist/model/command/project-command/npm-global-project-command.d.ts +21 -0
- package/dist/model/command/project-command/npm-global-project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/npm-global-project-command.js +35 -37
- package/dist/model/command/project-command/npm-install-project-command.d.ts +9 -0
- package/dist/model/command/project-command/npm-install-project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/npm-install-project-command.js +9 -16
- package/dist/model/command/project-command/project-command.d.ts +15 -0
- package/dist/model/command/project-command/project-command.d.ts.map +1 -0
- package/dist/model/command/project-command/project-command.js +7 -12
- package/dist/service/clear-service.d.ts +2 -0
- package/dist/service/clear-service.d.ts.map +1 -0
- package/dist/service/clear-service.js +4 -7
- package/dist/service/file-service.d.ts +7 -0
- package/dist/service/file-service.d.ts.map +1 -0
- package/dist/service/file-service.js +4 -7
- package/dist/service/init-config-service.d.ts +7 -0
- package/dist/service/init-config-service.d.ts.map +1 -0
- package/dist/service/init-config-service.js +13 -18
- package/dist/service/shell-service.d.ts +12 -0
- package/dist/service/shell-service.d.ts.map +1 -0
- package/dist/service/shell-service.js +29 -31
- package/dist/service/terminal-wrapper.d.ts +12 -0
- package/dist/service/terminal-wrapper.d.ts.map +1 -0
- package/dist/service/terminal-wrapper.js +6 -11
- package/dist/util/base-menu.d.ts +12 -0
- package/dist/util/base-menu.d.ts.map +1 -0
- package/dist/util/base-menu.js +20 -19
- package/dist/util/config.d.ts +21 -0
- package/dist/util/config.d.ts.map +1 -0
- package/dist/util/config.js +37 -41
- package/dist/util/constant.d.ts +5 -0
- package/dist/util/constant.d.ts.map +1 -0
- package/dist/util/constant.js +3 -6
- package/dist/util/logger.d.ts +3 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +14 -13
- package/dist/util/object-util.d.ts +4 -0
- package/dist/util/object-util.d.ts.map +1 -0
- package/dist/util/object-util.js +3 -5
- package/dist/util/sub-menu.d.ts +8 -0
- package/dist/util/sub-menu.d.ts.map +1 -0
- package/dist/util/sub-menu.js +10 -11
- package/dist/util/update-notifier-util.d.ts +4 -0
- package/dist/util/update-notifier-util.d.ts.map +1 -0
- package/dist/util/update-notifier-util.js +5 -11
- package/lib/app/cli-app.d.ts +5 -0
- package/lib/app/cli-app.d.ts.map +1 -0
- package/lib/app/cli-app.js +29 -0
- package/lib/app/http-server-app.d.ts +5 -0
- package/lib/app/http-server-app.d.ts.map +1 -0
- package/lib/app/http-server-app.js +31 -0
- package/lib/app/init/parse-and-route-args.d.ts +8 -0
- package/lib/app/init/parse-and-route-args.d.ts.map +1 -0
- package/lib/app/init/parse-and-route-args.js +74 -0
- package/lib/app/tui-app.d.ts +5 -0
- package/lib/app/tui-app.d.ts.map +1 -0
- package/lib/app/tui-app.js +31 -0
- package/lib/controller/cli-menu/main-menu.d.ts +6 -0
- package/lib/controller/cli-menu/main-menu.d.ts.map +1 -0
- package/lib/controller/cli-menu/main-menu.js +74 -0
- package/lib/controller/yargs-router/cli-router.d.ts +14 -0
- package/lib/controller/yargs-router/cli-router.d.ts.map +1 -0
- package/lib/controller/yargs-router/cli-router.js +171 -0
- package/lib/controller/yargs-router/git-router.d.ts +10 -0
- package/lib/controller/yargs-router/git-router.d.ts.map +1 -0
- package/lib/controller/yargs-router/git-router.js +207 -0
- package/lib/controller/yargs-router/npm-router.d.ts +7 -0
- package/lib/controller/yargs-router/npm-router.d.ts.map +1 -0
- package/lib/controller/yargs-router/npm-router.js +94 -0
- package/lib/dal/shell-dal.d.ts +12 -0
- package/lib/dal/shell-dal.d.ts.map +1 -0
- package/lib/dal/shell-dal.js +61 -0
- package/lib/index-cli.d.ts +2 -0
- package/lib/index-cli.d.ts.map +1 -0
- package/lib/index-cli.js +14 -0
- package/lib/index-init.d.ts +2 -0
- package/lib/index-init.d.ts.map +1 -0
- package/lib/index-init.js +16 -0
- package/lib/index-jest-setup.d.ts +6 -0
- package/lib/index-jest-setup.d.ts.map +1 -0
- package/lib/index-jest-setup.js +10 -0
- package/lib/index-server.d.ts +2 -0
- package/lib/index-server.d.ts.map +1 -0
- package/lib/index-server.js +9 -0
- package/lib/index-terminal-ui.d.ts +2 -0
- package/lib/index-terminal-ui.d.ts.map +1 -0
- package/lib/index-terminal-ui.js +9 -0
- package/lib/model/command/init-config.d.ts +5 -0
- package/lib/model/command/init-config.d.ts.map +1 -0
- package/lib/model/command/init-config.js +53 -0
- package/lib/model/command/interfaces.d.ts +12 -0
- package/lib/model/command/interfaces.d.ts.map +1 -0
- package/lib/model/command/interfaces.js +1 -0
- package/lib/model/command/project-command/git-clone-project-command.d.ts +15 -0
- package/lib/model/command/project-command/git-clone-project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/git-clone-project-command.js +77 -0
- package/lib/model/command/project-command/git-simple-project-command.d.ts +16 -0
- package/lib/model/command/project-command/git-simple-project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/git-simple-project-command.js +70 -0
- package/lib/model/command/project-command/git-tag-project-command.d.ts +12 -0
- package/lib/model/command/project-command/git-tag-project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/git-tag-project-command.js +73 -0
- package/lib/model/command/project-command/npm-global-project-command.d.ts +21 -0
- package/lib/model/command/project-command/npm-global-project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/npm-global-project-command.js +217 -0
- package/lib/model/command/project-command/npm-install-project-command.d.ts +9 -0
- package/lib/model/command/project-command/npm-install-project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/npm-install-project-command.js +66 -0
- package/lib/model/command/project-command/project-command.d.ts +15 -0
- package/lib/model/command/project-command/project-command.d.ts.map +1 -0
- package/lib/model/command/project-command/project-command.js +69 -0
- package/lib/package.json +1 -0
- package/lib/service/clear-service.d.ts +2 -0
- package/lib/service/clear-service.d.ts.map +1 -0
- package/lib/service/clear-service.js +24 -0
- package/lib/service/file-service.d.ts +7 -0
- package/lib/service/file-service.d.ts.map +1 -0
- package/lib/service/file-service.js +14 -0
- package/lib/service/init-config-service.d.ts +7 -0
- package/lib/service/init-config-service.d.ts.map +1 -0
- package/lib/service/init-config-service.js +55 -0
- package/lib/service/shell-service.d.ts +12 -0
- package/lib/service/shell-service.d.ts.map +1 -0
- package/lib/service/shell-service.js +64 -0
- package/lib/service/terminal-wrapper.d.ts +12 -0
- package/lib/service/terminal-wrapper.d.ts.map +1 -0
- package/lib/service/terminal-wrapper.js +72 -0
- package/lib/util/base-menu.d.ts +12 -0
- package/lib/util/base-menu.d.ts.map +1 -0
- package/lib/util/base-menu.js +134 -0
- package/lib/util/config.d.ts +21 -0
- package/lib/util/config.d.ts.map +1 -0
- package/lib/util/config.js +50 -0
- package/lib/util/constant.d.ts +5 -0
- package/lib/util/constant.d.ts.map +1 -0
- package/lib/util/constant.js +15 -0
- package/lib/util/logger.d.ts +3 -0
- package/lib/util/logger.d.ts.map +1 -0
- package/lib/util/logger.js +20 -0
- package/lib/util/object-util.d.ts +4 -0
- package/lib/util/object-util.d.ts.map +1 -0
- package/lib/util/object-util.js +15 -0
- package/lib/util/sub-menu.d.ts +8 -0
- package/lib/util/sub-menu.d.ts.map +1 -0
- package/lib/util/sub-menu.js +85 -0
- package/lib/util/update-notifier-util.d.ts +4 -0
- package/lib/util/update-notifier-util.d.ts.map +1 -0
- package/lib/util/update-notifier-util.js +35 -0
- package/package.json +216 -156
- package/CHANGELOG.md +0 -91
- package/package-lock.json +0 -26727
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ExecuteResult = {
|
|
2
|
+
name?: string;
|
|
3
|
+
stringResult?: string;
|
|
4
|
+
errorMessage?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface Executable {
|
|
7
|
+
execute(): Promise<ExecuteResult[]>;
|
|
8
|
+
}
|
|
9
|
+
export interface ProjectExecutable {
|
|
10
|
+
execute(project: string): Promise<ExecuteResult[]>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/model/command/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,WAAW,UAAU;IAC1B,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExecuteResult, ProjectExecutable } from '../../../model/command/interfaces.js';
|
|
2
|
+
export declare class GitCloneProjectCommand implements ProjectExecutable {
|
|
3
|
+
protected readonly _rootDir: string;
|
|
4
|
+
protected readonly _gitHost: string;
|
|
5
|
+
protected readonly _gitTeam: string;
|
|
6
|
+
protected readonly _projectPrefix: string;
|
|
7
|
+
constructor(params?: {
|
|
8
|
+
rootDir?: string;
|
|
9
|
+
gitHost?: string;
|
|
10
|
+
gitTeam?: string;
|
|
11
|
+
projectPrefix?: string;
|
|
12
|
+
});
|
|
13
|
+
execute(project: string): Promise<ExecuteResult[]>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=git-clone-project-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-clone-project-command.d.ts","sourceRoot":"","sources":["../../../../src/model/command/project-command/git-clone-project-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAIhF,qBAAa,sBAAuB,YAAW,iBAAiB;IAC/D,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACnC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACnC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACnC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;gBAE7B,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAgB/F,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAWxD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GitCloneProjectCommand = void 0;
|
|
7
|
+
var _shellService = require("../../../service/shell-service.js");
|
|
8
|
+
var _config = require("../../../util/config.js");
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
var GitCloneProjectCommand = exports.GitCloneProjectCommand = /*#__PURE__*/function () {
|
|
19
|
+
function GitCloneProjectCommand(params) {
|
|
20
|
+
var _config$git$projectPr;
|
|
21
|
+
_classCallCheck(this, GitCloneProjectCommand);
|
|
22
|
+
var _ref = params !== null && params !== void 0 ? params : {},
|
|
23
|
+
_ref$gitHost = _ref.gitHost,
|
|
24
|
+
gitHost = _ref$gitHost === void 0 ? (0, _config.config)().git.host : _ref$gitHost,
|
|
25
|
+
_ref$gitTeam = _ref.gitTeam,
|
|
26
|
+
gitTeam = _ref$gitTeam === void 0 ? (0, _config.config)().git.team : _ref$gitTeam,
|
|
27
|
+
_ref$projectPrefix = _ref.projectPrefix,
|
|
28
|
+
projectPrefix = _ref$projectPrefix === void 0 ? (_config$git$projectPr = (0, _config.config)().git.projectPrefix) !== null && _config$git$projectPr !== void 0 ? _config$git$projectPr : '' : _ref$projectPrefix,
|
|
29
|
+
_ref$rootDir = _ref.rootDir,
|
|
30
|
+
rootDir = _ref$rootDir === void 0 ? (0, _config.config)().rootDir : _ref$rootDir;
|
|
31
|
+
if (!gitTeam) {
|
|
32
|
+
throw new Error('You need to specify GIT_TEAM env variable');
|
|
33
|
+
}
|
|
34
|
+
this._rootDir = rootDir;
|
|
35
|
+
this._gitHost = gitHost;
|
|
36
|
+
this._gitTeam = gitTeam;
|
|
37
|
+
this._projectPrefix = projectPrefix;
|
|
38
|
+
}
|
|
39
|
+
return _createClass(GitCloneProjectCommand, [{
|
|
40
|
+
key: "execute",
|
|
41
|
+
value: function () {
|
|
42
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(project) {
|
|
43
|
+
var gitProject, cmd, result;
|
|
44
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
_context.prev = 0;
|
|
48
|
+
gitProject = [this._projectPrefix, project].filter(Boolean).join('-');
|
|
49
|
+
cmd = "git clone git@".concat(this._gitHost, ":").concat(this._gitTeam, "/").concat(gitProject, ".git ").concat(project);
|
|
50
|
+
_context.next = 5;
|
|
51
|
+
return _shellService.shellService.exec(cmd);
|
|
52
|
+
case 5:
|
|
53
|
+
result = _context.sent;
|
|
54
|
+
return _context.abrupt("return", [{
|
|
55
|
+
errorMessage: result.stderr,
|
|
56
|
+
name: project,
|
|
57
|
+
stringResult: result.stdout
|
|
58
|
+
}]);
|
|
59
|
+
case 9:
|
|
60
|
+
_context.prev = 9;
|
|
61
|
+
_context.t0 = _context["catch"](0);
|
|
62
|
+
return _context.abrupt("return", [{
|
|
63
|
+
errorMessage: _context.t0.message
|
|
64
|
+
}]);
|
|
65
|
+
case 12:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee, this, [[0, 9]]);
|
|
70
|
+
}));
|
|
71
|
+
function execute(_x) {
|
|
72
|
+
return _execute.apply(this, arguments);
|
|
73
|
+
}
|
|
74
|
+
return execute;
|
|
75
|
+
}()
|
|
76
|
+
}]);
|
|
77
|
+
}();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExecuteResult, ProjectExecutable } from '../../../model/command/interfaces.js';
|
|
2
|
+
export declare enum GitSimpleCommand {
|
|
3
|
+
STATUS = "status",
|
|
4
|
+
FETCH = "fetch",
|
|
5
|
+
PULL = "pull"
|
|
6
|
+
}
|
|
7
|
+
export declare class GitSimpleProjectCommand implements ProjectExecutable {
|
|
8
|
+
protected readonly _simpleGitCommand: GitSimpleCommand;
|
|
9
|
+
protected readonly _rootDir: string;
|
|
10
|
+
constructor(params: {
|
|
11
|
+
gitSimpleCommand: GitSimpleCommand;
|
|
12
|
+
rootDir?: string;
|
|
13
|
+
});
|
|
14
|
+
execute(project: string): Promise<ExecuteResult[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=git-simple-project-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-simple-project-command.d.ts","sourceRoot":"","sources":["../../../../src/model/command/project-command/git-simple-project-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAIhF,oBAAY,gBAAgB;IAC3B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;CACb;AAED,qBAAa,uBAAwB,YAAW,iBAAiB;IAChE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,gBAAgB,CAAA;IACtD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEvB,MAAM,EAAE;QAAE,gBAAgB,EAAE,gBAAgB,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAMtE,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAUxD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GitSimpleProjectCommand = exports.GitSimpleCommand = void 0;
|
|
7
|
+
var _shellService = require("../../../service/shell-service.js");
|
|
8
|
+
var _config = require("../../../util/config.js");
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
var GitSimpleCommand = exports.GitSimpleCommand = /*#__PURE__*/function (GitSimpleCommand) {
|
|
19
|
+
GitSimpleCommand["STATUS"] = "status";
|
|
20
|
+
GitSimpleCommand["FETCH"] = "fetch";
|
|
21
|
+
GitSimpleCommand["PULL"] = "pull";
|
|
22
|
+
return GitSimpleCommand;
|
|
23
|
+
}({});
|
|
24
|
+
var GitSimpleProjectCommand = exports.GitSimpleProjectCommand = /*#__PURE__*/function () {
|
|
25
|
+
function GitSimpleProjectCommand(params) {
|
|
26
|
+
_classCallCheck(this, GitSimpleProjectCommand);
|
|
27
|
+
var gitSimpleCommand = params.gitSimpleCommand,
|
|
28
|
+
_params$rootDir = params.rootDir,
|
|
29
|
+
rootDir = _params$rootDir === void 0 ? (0, _config.config)().rootDir : _params$rootDir;
|
|
30
|
+
this._simpleGitCommand = gitSimpleCommand;
|
|
31
|
+
this._rootDir = rootDir;
|
|
32
|
+
}
|
|
33
|
+
return _createClass(GitSimpleProjectCommand, [{
|
|
34
|
+
key: "execute",
|
|
35
|
+
value: function () {
|
|
36
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(project) {
|
|
37
|
+
var cmd, result;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_context.prev = 0;
|
|
42
|
+
cmd = "git -C ".concat(this._rootDir, "/").concat(project, " ").concat(this._simpleGitCommand);
|
|
43
|
+
_context.next = 4;
|
|
44
|
+
return _shellService.shellService.exec(cmd);
|
|
45
|
+
case 4:
|
|
46
|
+
result = _context.sent;
|
|
47
|
+
return _context.abrupt("return", [{
|
|
48
|
+
errorMessage: result.stderr,
|
|
49
|
+
name: project,
|
|
50
|
+
stringResult: result.stdout
|
|
51
|
+
}]);
|
|
52
|
+
case 8:
|
|
53
|
+
_context.prev = 8;
|
|
54
|
+
_context.t0 = _context["catch"](0);
|
|
55
|
+
return _context.abrupt("return", [{
|
|
56
|
+
errorMessage: _context.t0.message
|
|
57
|
+
}]);
|
|
58
|
+
case 11:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context.stop();
|
|
61
|
+
}
|
|
62
|
+
}, _callee, this, [[0, 8]]);
|
|
63
|
+
}));
|
|
64
|
+
function execute(_x) {
|
|
65
|
+
return _execute.apply(this, arguments);
|
|
66
|
+
}
|
|
67
|
+
return execute;
|
|
68
|
+
}()
|
|
69
|
+
}]);
|
|
70
|
+
}();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExecuteResult, ProjectExecutable } from '../../../model/command/interfaces.js';
|
|
2
|
+
export declare class GitTagProjectCommand implements ProjectExecutable {
|
|
3
|
+
protected readonly _rootDir: string;
|
|
4
|
+
protected readonly _filterByName?: string;
|
|
5
|
+
constructor(params: {
|
|
6
|
+
filterByName?: string;
|
|
7
|
+
rootDir?: string;
|
|
8
|
+
});
|
|
9
|
+
execute(project: string): Promise<ExecuteResult[]>;
|
|
10
|
+
protected _getFilterLine(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=git-tag-project-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-tag-project-command.d.ts","sourceRoot":"","sources":["../../../../src/model/command/project-command/git-tag-project-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAIhF,qBAAa,oBAAqB,YAAW,iBAAiB;IAC7D,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACnC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;gBAE7B,MAAM,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAMzD,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAYxD,SAAS,CAAC,cAAc,IAAI,MAAM;CAOlC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GitTagProjectCommand = void 0;
|
|
7
|
+
var _shellService = require("../../../service/shell-service.js");
|
|
8
|
+
var _config = require("../../../util/config.js");
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
var GitTagProjectCommand = exports.GitTagProjectCommand = /*#__PURE__*/function () {
|
|
19
|
+
function GitTagProjectCommand(params) {
|
|
20
|
+
_classCallCheck(this, GitTagProjectCommand);
|
|
21
|
+
var filterByName = params.filterByName,
|
|
22
|
+
_params$rootDir = params.rootDir,
|
|
23
|
+
rootDir = _params$rootDir === void 0 ? (0, _config.config)().rootDir : _params$rootDir;
|
|
24
|
+
this._rootDir = rootDir;
|
|
25
|
+
this._filterByName = filterByName;
|
|
26
|
+
}
|
|
27
|
+
return _createClass(GitTagProjectCommand, [{
|
|
28
|
+
key: "execute",
|
|
29
|
+
value: function () {
|
|
30
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(project) {
|
|
31
|
+
var filterLine, cmd, result;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
_context.prev = 0;
|
|
36
|
+
filterLine = this._getFilterLine();
|
|
37
|
+
cmd = "git -C ".concat(this._rootDir, "/").concat(project, " tag -n9").concat(filterLine, " | cat");
|
|
38
|
+
_context.next = 5;
|
|
39
|
+
return _shellService.shellService.exec(cmd);
|
|
40
|
+
case 5:
|
|
41
|
+
result = _context.sent;
|
|
42
|
+
return _context.abrupt("return", [{
|
|
43
|
+
errorMessage: result.stderr,
|
|
44
|
+
name: project,
|
|
45
|
+
stringResult: result.stdout
|
|
46
|
+
}]);
|
|
47
|
+
case 9:
|
|
48
|
+
_context.prev = 9;
|
|
49
|
+
_context.t0 = _context["catch"](0);
|
|
50
|
+
return _context.abrupt("return", [{
|
|
51
|
+
errorMessage: _context.t0.message
|
|
52
|
+
}]);
|
|
53
|
+
case 12:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
56
|
+
}
|
|
57
|
+
}, _callee, this, [[0, 9]]);
|
|
58
|
+
}));
|
|
59
|
+
function execute(_x) {
|
|
60
|
+
return _execute.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
return execute;
|
|
63
|
+
}()
|
|
64
|
+
}, {
|
|
65
|
+
key: "_getFilterLine",
|
|
66
|
+
value: function _getFilterLine() {
|
|
67
|
+
if (!this._filterByName) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
return " -l \"".concat(this._filterByName, "\"");
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
}();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Executable, ExecuteResult } from '../../../model/command/interfaces.js';
|
|
2
|
+
export type VersionOnProjects = Record<string, string[]>;
|
|
3
|
+
export type UniquePackages = Record<string, {
|
|
4
|
+
versions: string[];
|
|
5
|
+
versionProject: VersionOnProjects;
|
|
6
|
+
}>;
|
|
7
|
+
export type DependenciesObject = Record<string, string>;
|
|
8
|
+
export type ProjectWithDependencies = Record<string, DependenciesObject>;
|
|
9
|
+
export declare class NpmGlobalProjectCommand implements Executable {
|
|
10
|
+
execute(): Promise<ExecuteResult[]>;
|
|
11
|
+
protected _allDepsByProject(): ProjectWithDependencies;
|
|
12
|
+
protected _removeIgnoredPackages(dependencies: DependenciesObject): DependenciesObject;
|
|
13
|
+
protected _uniquePackages(depsByProject: ProjectWithDependencies): UniquePackages;
|
|
14
|
+
protected _versionConflictWarningMessage(uniquePackages: UniquePackages): string[];
|
|
15
|
+
protected _highestDependencies(uniquePackages: UniquePackages): DependenciesObject;
|
|
16
|
+
protected _highestVersion(versions: string[]): string;
|
|
17
|
+
protected _overrideGlobalDepsWithNewHighestDependencies(highestDependencies: DependenciesObject): void;
|
|
18
|
+
protected _packageJsonForProject(project?: string): any;
|
|
19
|
+
}
|
|
20
|
+
export declare const npmGlobalProjectCommandFactory: () => NpmGlobalProjectCommand;
|
|
21
|
+
//# sourceMappingURL=npm-global-project-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-global-project-command.d.ts","sourceRoot":"","sources":["../../../../src/model/command/project-command/npm-global-project-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAKzE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAAA;AAEtG,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;AAExE,qBAAa,uBAAwB,YAAW,UAAU;IACnD,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IA6BzC,SAAS,CAAC,iBAAiB,IAAI,uBAAuB;IAYtD,SAAS,CAAC,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,kBAAkB;IAWtF,SAAS,CAAC,eAAe,CAAC,aAAa,EAAE,uBAAuB,GAAG,cAAc;IAgBjF,SAAS,CAAC,8BAA8B,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,EAAE;IAsBlF,SAAS,CAAC,oBAAoB,CAAC,cAAc,EAAE,cAAc,GAAG,kBAAkB;IAMlF,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAUrD,SAAS,CAAC,6CAA6C,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,IAAI;IAQtG,SAAS,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG;CAGvD;AAED,eAAO,MAAM,8BAA8B,QAExC,uBAAiE,CAAA"}
|