@teambit/export
Version:
49 lines (47 loc) • 2.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ResumeExportCmd = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _exportScopeComponents() {
const data = require("./export-scope-components");
_exportScopeComponents = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
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); }
class ResumeExportCmd {
constructor(scope) {
this.scope = scope;
_defineProperty(this, "name", 'resume-export <export-id> <remotes...>');
_defineProperty(this, "description", 'EXPERIMENTAL. resume failed export');
_defineProperty(this, "extendedDescription", `resume failed export to persist the pending objects on the given remotes.
the export-id is the id the client received in the error message during the failure.
alternatively, exporting to any one of the failed scopes, throws server-is-busy error with the export-id`);
_defineProperty(this, "alias", '');
_defineProperty(this, "options", []);
_defineProperty(this, "loader", true);
_defineProperty(this, "group", 'advanced');
_defineProperty(this, "private", true);
_defineProperty(this, "remoteOp", true);
}
async report([exportId, remotes]) {
const exportedIds = await (0, _exportScopeComponents().resumeExport)(this.scope.legacyScope, exportId, remotes);
if (!exportedIds.length) return _chalk().default.yellow('no components were left to persist for this export-id');
return `the following components were persisted successfully:
${exportedIds.join('\n')}`;
}
}
exports.ResumeExportCmd = ResumeExportCmd;
//# sourceMappingURL=resume-export-cmd.js.map