@teambit/export 1.0.487 → 1.0.489
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_scope_export-preview.js +1 -1
- package/artifacts/schema.json +4744 -2104
- package/dist/export-cmd.js +5 -5
- package/dist/export-cmd.js.map +1 -1
- package/dist/export-scope-components.d.ts +40 -0
- package/dist/export-scope-components.js +368 -0
- package/dist/export-scope-components.js.map +1 -0
- package/dist/export.main.runtime.d.ts +5 -6
- package/dist/export.main.runtime.js +46 -53
- package/dist/export.main.runtime.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +60 -11
- package/dist/index.js.map +1 -1
- package/dist/{preview-1733714450424.js → preview-1733851236714.js} +2 -2
- package/package.json +29 -17
package/dist/export-cmd.js
CHANGED
@@ -18,9 +18,9 @@ function _eject() {
|
|
18
18
|
};
|
19
19
|
return data;
|
20
20
|
}
|
21
|
-
function
|
22
|
-
const data = require("@teambit/legacy
|
23
|
-
|
21
|
+
function _legacy() {
|
22
|
+
const data = require("@teambit/legacy.constants");
|
23
|
+
_legacy = function () {
|
24
24
|
return data;
|
25
25
|
};
|
26
26
|
return data;
|
@@ -50,12 +50,12 @@ class ExportCmd {
|
|
50
50
|
_defineProperty(this, "description", 'export components from the workspace to remote scopes');
|
51
51
|
_defineProperty(this, "arguments", [{
|
52
52
|
name: 'component-patterns...',
|
53
|
-
description: `(not recommended) ${
|
53
|
+
description: `(not recommended) ${_legacy().COMPONENT_PATTERN_HELP}`
|
54
54
|
}]);
|
55
55
|
_defineProperty(this, "extendedDescription", `bit export => export all staged snaps/tags of components to their remote scope. if checked out to a lane, export the lane as well
|
56
56
|
\`bit export [pattern...]\` => export components included by the pattern to their remote scope (we recommend not using a pattern in
|
57
57
|
most scenarios so that all changes are exported simultaneously)
|
58
|
-
${(0,
|
58
|
+
${(0, _legacy().WILDCARD_HELP)('export')}`);
|
59
59
|
_defineProperty(this, "alias", 'e');
|
60
60
|
_defineProperty(this, "helpUrl", 'reference/components/exporting-components');
|
61
61
|
_defineProperty(this, "options", [['e', 'eject', 'after export, remove the components from the workspace and install them as packages'], ['a', 'all', 'export all components, including non-staged (useful when components in the remote scope are corrupted or missing)'], ['', 'all-versions', 'export not only staged versions but all of them (useful when versions in the remote scope are corrupted or missing)'], ['', 'origin-directly', 'avoid export to the central hub, instead, export directly to the original scopes. not recommended!'], ['', 'resume <string>', 'in case the previous export failed and suggested to resume with an export-id, enter the id'], ['', 'head-only', 'in case previous export failed and locally it shows exported and only one snap/tag was created, try using this flag'], ['', 'ignore-missing-artifacts', "don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote"], ['', 'fork-lane-new-scope', 'allow exporting a forked lane into a different scope than the original scope'], ['', 'open-browser', 'open a browser once the export is completed in the cloud job url'], ['', 'verbose', 'per exported component, show the versions being exported'], ['j', 'json', 'show output in json format']]);
|
package/dist/export-cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_open","data","_interopRequireDefault","require","_eject","_constants","_chalk","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExportCmd","constructor","exportMain","name","description","COMPONENT_PATTERN_HELP","WILDCARD_HELP","report","ids","eject","all","allVersions","originDirectly","ignoreMissingArtifacts","resume","headOnly","forkLaneNewScope","openBrowser","verbose","componentsIds","newIdsOnRemote","nonExistOnBitMap","removedIds","missingScope","exportedLanes","ejectResults","rippleJobUrls","export","includeNonStaged","resumeExportId","isEmpty","length","chalk","yellow","exportedLane","id","getExportedIds","join","map","versions","filter","newId","isEqualWithoutVersion","version","toString","exportOutput","bold","lanesOutput","green","nonExistOnBitMapOutput","idsStr","removedOutput","remoteLaneStr","title","missingScopeOutput","ejectOutput","output","ejectTemplate","rippleJobsOutput","shouldOpenBrowser","process","env","CI","prefix","msg","open","url","catch","urlsColored","underline","json","results","exports"],"sources":["export-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport open from 'open';\nimport { ejectTemplate } from '@teambit/eject';\nimport { WILDCARD_HELP, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\nimport { ExportMain, ExportResult } from './export.main.runtime';\n\nexport class ExportCmd implements Command {\n name = 'export [component-patterns...]';\n description = 'export components from the workspace to remote scopes';\n arguments = [\n {\n name: 'component-patterns...',\n description: `(not recommended) ${COMPONENT_PATTERN_HELP}`,\n },\n ];\n extendedDescription = `bit export => export all staged snaps/tags of components to their remote scope. if checked out to a lane, export the lane as well\n \\`bit export [pattern...]\\` => export components included by the pattern to their remote scope (we recommend not using a pattern in\n most scenarios so that all changes are exported simultaneously)\n ${WILDCARD_HELP('export')}`;\n alias = 'e';\n helpUrl = 'reference/components/exporting-components';\n options = [\n ['e', 'eject', 'after export, remove the components from the workspace and install them as packages'],\n [\n 'a',\n 'all',\n 'export all components, including non-staged (useful when components in the remote scope are corrupted or missing)',\n ],\n [\n '',\n 'all-versions',\n 'export not only staged versions but all of them (useful when versions in the remote scope are corrupted or missing)',\n ],\n [\n '',\n 'origin-directly',\n 'avoid export to the central hub, instead, export directly to the original scopes. not recommended!',\n ],\n [\n '',\n 'resume <string>',\n 'in case the previous export failed and suggested to resume with an export-id, enter the id',\n ],\n [\n '',\n 'head-only',\n 'in case previous export failed and locally it shows exported and only one snap/tag was created, try using this flag',\n ],\n [\n '',\n 'ignore-missing-artifacts',\n \"don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote\",\n ],\n ['', 'fork-lane-new-scope', 'allow exporting a forked lane into a different scope than the original scope'],\n ['', 'open-browser', 'open a browser once the export is completed in the cloud job url'],\n ['', 'verbose', 'per exported component, show the versions being exported'],\n ['j', 'json', 'show output in json format'],\n ] as CommandOptions;\n loader = true;\n group = 'collaborate';\n remoteOp = true;\n\n constructor(private exportMain: ExportMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n eject = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n ignoreMissingArtifacts = false,\n resume,\n headOnly,\n forkLaneNewScope = false,\n openBrowser = false,\n verbose = false,\n }: any\n ): Promise<string> {\n const {\n componentsIds,\n newIdsOnRemote,\n nonExistOnBitMap,\n removedIds,\n missingScope,\n exportedLanes,\n ejectResults,\n rippleJobUrls,\n } = await this.exportMain.export({\n ids,\n eject,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n resumeExportId: resume,\n headOnly,\n ignoreMissingArtifacts,\n forkLaneNewScope,\n });\n\n if (isEmpty(componentsIds) && isEmpty(nonExistOnBitMap) && isEmpty(missingScope) && !exportedLanes.length) {\n return chalk.yellow('nothing to export');\n }\n const exportedLane = exportedLanes[0]?.id();\n const getExportedIds = () => {\n if (!verbose) return componentsIds.join('\\n');\n return componentsIds\n .map((id) => {\n const versions = newIdsOnRemote\n .filter((newId) => newId.isEqualWithoutVersion(id))\n .map((newId) => newId.version);\n return `${id.toString()} - ${versions.join(', ') || 'n/a'}`;\n })\n .join('\\n');\n };\n const exportOutput = () => {\n if (isEmpty(componentsIds)) return exportedLane ? `exported the lane ${chalk.bold(exportedLane)}` : '';\n const lanesOutput = exportedLanes.length ? ` the lane ${chalk.bold(exportedLanes[0].id())} and` : '';\n return chalk.green(\n `exported${lanesOutput} the following ${componentsIds.length} component(s):\\n${chalk.bold(getExportedIds())}`\n );\n };\n const nonExistOnBitMapOutput = () => {\n // if includeDependencies is true, the nonExistOnBitMap might be the dependencies\n if (isEmpty(nonExistOnBitMap)) return '';\n const idsStr = nonExistOnBitMap.map((id) => id.toString()).join(', ');\n return chalk.yellow(\n `${idsStr}\\nexported successfully. bit did not update the workspace as the component files are not tracked. this might happen when a component was tracked in a different git branch. to fix it check if they where tracked in a different git branch, checkout to that branch and resync by running 'bit import'. or stay on your branch and track the components again using 'bit add'.\\n`\n );\n };\n const removedOutput = () => {\n if (!removedIds.length) return '';\n const remoteLaneStr = exportedLanes.length ? ' lane' : '';\n const title = chalk.bold(\n `\\n\\nthe following component(s) have been marked as removed on the remote${remoteLaneStr}\\n`\n );\n const idsStr = removedIds.join('\\n');\n return title + idsStr;\n };\n const missingScopeOutput = () => {\n if (isEmpty(missingScope)) return '';\n const idsStr = missingScope.map((id) => id.toString()).join(', ');\n return chalk.yellow(\n `the following component(s) were not exported as no remote scope is configured for them: ${chalk.bold(\n idsStr\n )}.\\nplease specify <remote> to export them, run 'bit scope set <scope> <component>, or set a \"defaultScope\" in your workspace config\\n\\n`\n );\n };\n const ejectOutput = () => {\n if (!ejectResults) return '';\n const output = ejectTemplate(ejectResults);\n return `\\n${output}`;\n };\n const rippleJobsOutput = () => {\n if (!rippleJobUrls.length) return '';\n const shouldOpenBrowser = openBrowser && !process.env.CI;\n const prefix = shouldOpenBrowser ? 'Your browser has been opened to the following link' : 'Visit the link below';\n const msg = `\\n\\n${prefix} to track the progress of building the components in the cloud\\n`;\n if (shouldOpenBrowser) {\n open(rippleJobUrls[0], { url: true }).catch(() => {\n /** it's ok, the user is instructed to open the browser manually */\n });\n }\n const urlsColored = rippleJobUrls.map((url) => chalk.bold.underline(url));\n return msg + urlsColored.join('\\n');\n };\n\n return (\n nonExistOnBitMapOutput() +\n missingScopeOutput() +\n exportOutput() +\n ejectOutput() +\n removedOutput() +\n rippleJobsOutput()\n );\n }\n\n async json(\n [ids = []]: [string[]],\n {\n eject = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n ignoreMissingArtifacts = false,\n resume,\n }: any\n ): Promise<ExportResult> {\n const results = await this.exportMain.export({\n ids,\n eject,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n resumeExportId: resume,\n ignoreMissingArtifacts,\n });\n\n return results;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,O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,MAAMC,WAAW,GAAG1C,aAAa,CAACY,GAAG,CAAE4B,GAAG,IAAKlC,gBAAK,CAACc,IAAI,CAACuB,SAAS,CAACH,GAAG,CAAC,CAAC;MACzE,OAAOF,GAAG,GAAGI,WAAW,CAAC/B,IAAI,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,OACEY,sBAAsB,CAAC,CAAC,GACxBK,kBAAkB,CAAC,CAAC,GACpBT,YAAY,CAAC,CAAC,GACdU,WAAW,CAAC,CAAC,GACbJ,aAAa,CAAC,CAAC,GACfO,gBAAgB,CAAC,CAAC;EAEtB;EAEA,MAAMY,IAAIA,CACR,CAAC9D,GAAG,GAAG,EAAE,CAAa,EACtB;IACEC,KAAK,GAAG,KAAK;IACbC,GAAG,GAAG,KAAK;IACXC,WAAW,GAAG,KAAK;IACnBC,cAAc,GAAG,KAAK;IACtBC,sBAAsB,GAAG,KAAK;IAC9BC;EACG,CAAC,EACiB;IACvB,MAAMyD,OAAO,GAAG,MAAM,IAAI,CAACrE,UAAU,CAACyB,MAAM,CAAC;MAC3CnB,GAAG;MACHC,KAAK;MACLmB,gBAAgB,EAAElB,GAAG,IAAIC,WAAW;MACpCA,WAAW,EAAEA,WAAW,IAAID,GAAG;MAC/BE,cAAc;MACdiB,cAAc,EAAEf,MAAM;MACtBD;IACF,CAAC,CAAC;IAEF,OAAO0D,OAAO;EAChB;AACF;AAACC,OAAA,CAAAxE,SAAA,GAAAA,SAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_open","data","_interopRequireDefault","require","_eject","_legacy","_chalk","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExportCmd","constructor","exportMain","name","description","COMPONENT_PATTERN_HELP","WILDCARD_HELP","report","ids","eject","all","allVersions","originDirectly","ignoreMissingArtifacts","resume","headOnly","forkLaneNewScope","openBrowser","verbose","componentsIds","newIdsOnRemote","nonExistOnBitMap","removedIds","missingScope","exportedLanes","ejectResults","rippleJobUrls","export","includeNonStaged","resumeExportId","isEmpty","length","chalk","yellow","exportedLane","id","getExportedIds","join","map","versions","filter","newId","isEqualWithoutVersion","version","toString","exportOutput","bold","lanesOutput","green","nonExistOnBitMapOutput","idsStr","removedOutput","remoteLaneStr","title","missingScopeOutput","ejectOutput","output","ejectTemplate","rippleJobsOutput","shouldOpenBrowser","process","env","CI","prefix","msg","open","url","catch","urlsColored","underline","json","results","exports"],"sources":["export-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport open from 'open';\nimport { ejectTemplate } from '@teambit/eject';\nimport { WILDCARD_HELP, COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\nimport { ExportMain, ExportResult } from './export.main.runtime';\n\nexport class ExportCmd implements Command {\n name = 'export [component-patterns...]';\n description = 'export components from the workspace to remote scopes';\n arguments = [\n {\n name: 'component-patterns...',\n description: `(not recommended) ${COMPONENT_PATTERN_HELP}`,\n },\n ];\n extendedDescription = `bit export => export all staged snaps/tags of components to their remote scope. if checked out to a lane, export the lane as well\n \\`bit export [pattern...]\\` => export components included by the pattern to their remote scope (we recommend not using a pattern in\n most scenarios so that all changes are exported simultaneously)\n ${WILDCARD_HELP('export')}`;\n alias = 'e';\n helpUrl = 'reference/components/exporting-components';\n options = [\n ['e', 'eject', 'after export, remove the components from the workspace and install them as packages'],\n [\n 'a',\n 'all',\n 'export all components, including non-staged (useful when components in the remote scope are corrupted or missing)',\n ],\n [\n '',\n 'all-versions',\n 'export not only staged versions but all of them (useful when versions in the remote scope are corrupted or missing)',\n ],\n [\n '',\n 'origin-directly',\n 'avoid export to the central hub, instead, export directly to the original scopes. not recommended!',\n ],\n [\n '',\n 'resume <string>',\n 'in case the previous export failed and suggested to resume with an export-id, enter the id',\n ],\n [\n '',\n 'head-only',\n 'in case previous export failed and locally it shows exported and only one snap/tag was created, try using this flag',\n ],\n [\n '',\n 'ignore-missing-artifacts',\n \"don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote\",\n ],\n ['', 'fork-lane-new-scope', 'allow exporting a forked lane into a different scope than the original scope'],\n ['', 'open-browser', 'open a browser once the export is completed in the cloud job url'],\n ['', 'verbose', 'per exported component, show the versions being exported'],\n ['j', 'json', 'show output in json format'],\n ] as CommandOptions;\n loader = true;\n group = 'collaborate';\n remoteOp = true;\n\n constructor(private exportMain: ExportMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n eject = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n ignoreMissingArtifacts = false,\n resume,\n headOnly,\n forkLaneNewScope = false,\n openBrowser = false,\n verbose = false,\n }: any\n ): Promise<string> {\n const {\n componentsIds,\n newIdsOnRemote,\n nonExistOnBitMap,\n removedIds,\n missingScope,\n exportedLanes,\n ejectResults,\n rippleJobUrls,\n } = await this.exportMain.export({\n ids,\n eject,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n resumeExportId: resume,\n headOnly,\n ignoreMissingArtifacts,\n forkLaneNewScope,\n });\n\n if (isEmpty(componentsIds) && isEmpty(nonExistOnBitMap) && isEmpty(missingScope) && !exportedLanes.length) {\n return chalk.yellow('nothing to export');\n }\n const exportedLane = exportedLanes[0]?.id();\n const getExportedIds = () => {\n if (!verbose) return componentsIds.join('\\n');\n return componentsIds\n .map((id) => {\n const versions = newIdsOnRemote\n .filter((newId) => newId.isEqualWithoutVersion(id))\n .map((newId) => newId.version);\n return `${id.toString()} - ${versions.join(', ') || 'n/a'}`;\n })\n .join('\\n');\n };\n const exportOutput = () => {\n if (isEmpty(componentsIds)) return exportedLane ? `exported the lane ${chalk.bold(exportedLane)}` : '';\n const lanesOutput = exportedLanes.length ? ` the lane ${chalk.bold(exportedLanes[0].id())} and` : '';\n return chalk.green(\n `exported${lanesOutput} the following ${componentsIds.length} component(s):\\n${chalk.bold(getExportedIds())}`\n );\n };\n const nonExistOnBitMapOutput = () => {\n // if includeDependencies is true, the nonExistOnBitMap might be the dependencies\n if (isEmpty(nonExistOnBitMap)) return '';\n const idsStr = nonExistOnBitMap.map((id) => id.toString()).join(', ');\n return chalk.yellow(\n `${idsStr}\\nexported successfully. bit did not update the workspace as the component files are not tracked. this might happen when a component was tracked in a different git branch. to fix it check if they where tracked in a different git branch, checkout to that branch and resync by running 'bit import'. or stay on your branch and track the components again using 'bit add'.\\n`\n );\n };\n const removedOutput = () => {\n if (!removedIds.length) return '';\n const remoteLaneStr = exportedLanes.length ? ' lane' : '';\n const title = chalk.bold(\n `\\n\\nthe following component(s) have been marked as removed on the remote${remoteLaneStr}\\n`\n );\n const idsStr = removedIds.join('\\n');\n return title + idsStr;\n };\n const missingScopeOutput = () => {\n if (isEmpty(missingScope)) return '';\n const idsStr = missingScope.map((id) => id.toString()).join(', ');\n return chalk.yellow(\n `the following component(s) were not exported as no remote scope is configured for them: ${chalk.bold(\n idsStr\n )}.\\nplease specify <remote> to export them, run 'bit scope set <scope> <component>, or set a \"defaultScope\" in your workspace config\\n\\n`\n );\n };\n const ejectOutput = () => {\n if (!ejectResults) return '';\n const output = ejectTemplate(ejectResults);\n return `\\n${output}`;\n };\n const rippleJobsOutput = () => {\n if (!rippleJobUrls.length) return '';\n const shouldOpenBrowser = openBrowser && !process.env.CI;\n const prefix = shouldOpenBrowser ? 'Your browser has been opened to the following link' : 'Visit the link below';\n const msg = `\\n\\n${prefix} to track the progress of building the components in the cloud\\n`;\n if (shouldOpenBrowser) {\n open(rippleJobUrls[0], { url: true }).catch(() => {\n /** it's ok, the user is instructed to open the browser manually */\n });\n }\n const urlsColored = rippleJobUrls.map((url) => chalk.bold.underline(url));\n return msg + urlsColored.join('\\n');\n };\n\n return (\n nonExistOnBitMapOutput() +\n missingScopeOutput() +\n exportOutput() +\n ejectOutput() +\n removedOutput() +\n rippleJobsOutput()\n );\n }\n\n async json(\n [ids = []]: [string[]],\n {\n eject = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n ignoreMissingArtifacts = false,\n resume,\n }: any\n ): Promise<ExportResult> {\n const results = await this.exportMain.export({\n ids,\n eject,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n resumeExportId: resume,\n ignoreMissingArtifacts,\n });\n\n return results;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,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
2
|
+
import { Remote } from '@teambit/scope.remotes';
|
3
|
+
import { MergeResult, Scope } from '@teambit/legacy.scope';
|
4
|
+
import { Lane, LaneHistory, BitObjectList, ObjectList } from '@teambit/scope.objects';
|
5
|
+
/**
|
6
|
+
* ** Legacy and "bit sign" Only **
|
7
|
+
*
|
8
|
+
* @TODO there is no real difference between bare scope and a working directory scope - let's adjust terminology to avoid confusions in the future
|
9
|
+
* saves a component into the objects directory of the remote scope, then, resolves its
|
10
|
+
* dependencies, saves them as well. Finally runs the build process if needed on an isolated
|
11
|
+
* environment.
|
12
|
+
*/
|
13
|
+
export declare function exportManyBareScope(scope: Scope, objectList: ObjectList): Promise<ComponentIdList>;
|
14
|
+
type RemotesForPersist = {
|
15
|
+
remote: Remote;
|
16
|
+
exportedIds?: string[];
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* save objects into the scope.
|
20
|
+
*/
|
21
|
+
export declare function saveObjects(scope: Scope, objectList: ObjectList): Promise<ComponentIdList>;
|
22
|
+
type MergeObjectsResult = {
|
23
|
+
mergedIds: ComponentIdList;
|
24
|
+
mergedComponentsResults: MergeResult[];
|
25
|
+
mergedLanes: Lane[];
|
26
|
+
mergedLaneHistories: LaneHistory[];
|
27
|
+
};
|
28
|
+
/**
|
29
|
+
* merge components into the scope.
|
30
|
+
*
|
31
|
+
* a component might have multiple versions that some where merged and some were not.
|
32
|
+
* the BitIds returned here includes the versions that were merged. so it could contain multiple
|
33
|
+
* ids of the same component with different versions
|
34
|
+
*/
|
35
|
+
export declare function mergeObjects(scope: Scope, bitObjectList: BitObjectList, throwForMissingDeps?: boolean): Promise<MergeObjectsResult>;
|
36
|
+
export declare function validateRemotes(remotes: Remote[], clientId: string, isResumingExport?: boolean): Promise<void>;
|
37
|
+
export declare function persistRemotes(manyObjectsPerRemote: RemotesForPersist[], clientId: string): Promise<void>;
|
38
|
+
export declare function resumeExport(scope: Scope, exportId: string, remotes: string[]): Promise<string[]>;
|
39
|
+
export declare function removePendingDirs(pushedRemotes: Remote[], clientId: string): Promise<void>;
|
40
|
+
export {};
|
@@ -0,0 +1,368 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.exportManyBareScope = exportManyBareScope;
|
7
|
+
exports.mergeObjects = mergeObjects;
|
8
|
+
exports.persistRemotes = persistRemotes;
|
9
|
+
exports.removePendingDirs = removePendingDirs;
|
10
|
+
exports.resumeExport = resumeExport;
|
11
|
+
exports.saveObjects = saveObjects;
|
12
|
+
exports.validateRemotes = validateRemotes;
|
13
|
+
function _pMapSeries() {
|
14
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
15
|
+
_pMapSeries = function () {
|
16
|
+
return data;
|
17
|
+
};
|
18
|
+
return data;
|
19
|
+
}
|
20
|
+
function _lodash() {
|
21
|
+
const data = require("lodash");
|
22
|
+
_lodash = function () {
|
23
|
+
return data;
|
24
|
+
};
|
25
|
+
return data;
|
26
|
+
}
|
27
|
+
function _componentId() {
|
28
|
+
const data = require("@teambit/component-id");
|
29
|
+
_componentId = function () {
|
30
|
+
return data;
|
31
|
+
};
|
32
|
+
return data;
|
33
|
+
}
|
34
|
+
function _legacy() {
|
35
|
+
const data = require("@teambit/legacy.logger");
|
36
|
+
_legacy = function () {
|
37
|
+
return data;
|
38
|
+
};
|
39
|
+
return data;
|
40
|
+
}
|
41
|
+
function _scope() {
|
42
|
+
const data = require("@teambit/scope.remotes");
|
43
|
+
_scope = function () {
|
44
|
+
return data;
|
45
|
+
};
|
46
|
+
return data;
|
47
|
+
}
|
48
|
+
function _legacy2() {
|
49
|
+
const data = require("@teambit/legacy.scope");
|
50
|
+
_legacy2 = function () {
|
51
|
+
return data;
|
52
|
+
};
|
53
|
+
return data;
|
54
|
+
}
|
55
|
+
function _scope2() {
|
56
|
+
const data = require("@teambit/scope.objects");
|
57
|
+
_scope2 = function () {
|
58
|
+
return data;
|
59
|
+
};
|
60
|
+
return data;
|
61
|
+
}
|
62
|
+
function _scope3() {
|
63
|
+
const data = require("@teambit/scope.remote-actions");
|
64
|
+
_scope3 = function () {
|
65
|
+
return data;
|
66
|
+
};
|
67
|
+
return data;
|
68
|
+
}
|
69
|
+
function _legacy3() {
|
70
|
+
const data = require("@teambit/legacy.loader");
|
71
|
+
_legacy3 = function () {
|
72
|
+
return data;
|
73
|
+
};
|
74
|
+
return data;
|
75
|
+
}
|
76
|
+
function _toolboxPromise() {
|
77
|
+
const data = require("@teambit/toolbox.promise.map-pool");
|
78
|
+
_toolboxPromise = function () {
|
79
|
+
return data;
|
80
|
+
};
|
81
|
+
return data;
|
82
|
+
}
|
83
|
+
function _harmonyModules() {
|
84
|
+
const data = require("@teambit/harmony.modules.concurrency");
|
85
|
+
_harmonyModules = function () {
|
86
|
+
return data;
|
87
|
+
};
|
88
|
+
return data;
|
89
|
+
}
|
90
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
91
|
+
/**
|
92
|
+
* ** Legacy and "bit sign" Only **
|
93
|
+
*
|
94
|
+
* @TODO there is no real difference between bare scope and a working directory scope - let's adjust terminology to avoid confusions in the future
|
95
|
+
* saves a component into the objects directory of the remote scope, then, resolves its
|
96
|
+
* dependencies, saves them as well. Finally runs the build process if needed on an isolated
|
97
|
+
* environment.
|
98
|
+
*/
|
99
|
+
async function exportManyBareScope(scope, objectList) {
|
100
|
+
_legacy().logger.debugAndAddBreadCrumb('exportManyBareScope', `started with ${objectList.objects.length} objects`);
|
101
|
+
const mergedIds = await saveObjects(scope, objectList);
|
102
|
+
_legacy().logger.debugAndAddBreadCrumb('exportManyBareScope', 'will try to importMany in case there are missing dependencies');
|
103
|
+
const scopeComponentsImporter = scope.scopeImporter;
|
104
|
+
await scopeComponentsImporter.importManyFromOriginalScopes(mergedIds); // resolve dependencies
|
105
|
+
_legacy().logger.debugAndAddBreadCrumb('exportManyBareScope', 'successfully ran importMany');
|
106
|
+
return mergedIds;
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* save objects into the scope.
|
110
|
+
*/
|
111
|
+
async function saveObjects(scope, objectList) {
|
112
|
+
const bitObjectList = await objectList.toBitObjects();
|
113
|
+
const objectsNotRequireMerge = bitObjectList.getObjectsNotRequireMerge();
|
114
|
+
// components and lanes can't be just added, they need to be carefully merged.
|
115
|
+
const {
|
116
|
+
mergedIds,
|
117
|
+
mergedComponentsResults,
|
118
|
+
mergedLanes,
|
119
|
+
mergedLaneHistories
|
120
|
+
} = await mergeObjects(scope, bitObjectList);
|
121
|
+
const mergedComponents = mergedComponentsResults.map(_ => _.mergedComponent);
|
122
|
+
const versionObjects = objectsNotRequireMerge.filter(o => o instanceof _scope2().Version);
|
123
|
+
const versionsHistory = await updateVersionHistory(scope, mergedComponents, versionObjects);
|
124
|
+
const allObjects = [...mergedComponents, ...mergedLanes, ...objectsNotRequireMerge, ...versionsHistory, ...mergedLaneHistories];
|
125
|
+
scope.objects.validateObjects(true, allObjects);
|
126
|
+
await scope.objects.writeObjectsToTheFS(allObjects);
|
127
|
+
_legacy().logger.debug(`export-scope-components.saveObjects, ${allObjects.length} objects were written successfully to the filesystem`);
|
128
|
+
return mergedIds;
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Previously, the VersionHistory was populated during fetch. However, we want the fetch operation to be more efficient
|
133
|
+
* so we move this logic to the export operation.
|
134
|
+
* Before version 0.2.22, the Version object didn't have any info about the component-id, so we do update only for
|
135
|
+
* rebase. For versions that tagged by > 0.2.22, we have the "origin.id" and we know to what component this version
|
136
|
+
* belongs to.
|
137
|
+
*/
|
138
|
+
async function updateVersionHistory(scope, mergedComponents, versionObjects) {
|
139
|
+
if (!mergedComponents.length) {
|
140
|
+
// this is important for bit-sign to not try to update VersionHistory and then error due to missing components
|
141
|
+
_legacy().logger.debug('updateVersionHistory, no components were merged, no need to update VersionHistory');
|
142
|
+
return [];
|
143
|
+
}
|
144
|
+
_legacy().logger.debug(`updateVersionHistory, total components: ${mergedComponents.length}, total versions: ${versionObjects.length}`);
|
145
|
+
const versionsWithComponentId = versionObjects.filter(obj => obj.origin?.id);
|
146
|
+
const [versionsWithOrigin, versionWithoutOrigin] = (0, _lodash().partition)(versionsWithComponentId, v => v.origin?.id);
|
147
|
+
const versionHistoryOfVersionsWithOrigin = await _updateVersionHistoryForVersionsWithOrigin(scope, mergedComponents, versionsWithOrigin);
|
148
|
+
const versionHistoryOfVersionsWithoutOrigin = await _updateVersionHistoryForVersionsWithoutOrigin(scope, mergedComponents, versionWithoutOrigin);
|
149
|
+
return [...versionHistoryOfVersionsWithOrigin, ...versionHistoryOfVersionsWithoutOrigin];
|
150
|
+
}
|
151
|
+
|
152
|
+
/**
|
153
|
+
* In case of rebase (squash / unrelated) where the version history is changed, make the necessary changes in the
|
154
|
+
* VersionHistory.
|
155
|
+
* Because previously (bit-version < 0.2.22) we only knew about this from the Version object, and the Version object
|
156
|
+
* didn't have any info about what the component-id is, we have to iterate all model-components, grab their
|
157
|
+
* version-history and check whether the version-hash is inside their VersionHistory.
|
158
|
+
* it's not ideal performance wise. however, in most cases, this rebase is about squashing, and when squashing, it's
|
159
|
+
* done for the entire lane, so all components need to be updated regardless.
|
160
|
+
*/
|
161
|
+
async function _updateVersionHistoryForVersionsWithoutOrigin(scope, mergedComponents, versionWithoutOrigin) {
|
162
|
+
const mutatedVersionObjects = versionWithoutOrigin.filter(v => v.squashed || v.unrelated);
|
163
|
+
if (!mutatedVersionObjects.length) return [];
|
164
|
+
_legacy().logger.debug(`_updateVersionHistoryForVersionsWithoutOrigin, found ${mutatedVersionObjects.length} mutated version`);
|
165
|
+
const versionsHistory = await Promise.all(mergedComponents.map(async modelComp => modelComp.updateRebasedVersionHistory(scope.objects, mutatedVersionObjects)));
|
166
|
+
const versionsHistoryNoNull = (0, _lodash().compact)(versionsHistory);
|
167
|
+
_legacy().logger.debug(`_updateVersionHistoryForVersionsWithoutOrigin, found ${versionsHistoryNoNull.length} versionsHistory to update
|
168
|
+
${versionsHistoryNoNull.map(v => v.compId.toString()).join(', ')}`);
|
169
|
+
return versionsHistoryNoNull;
|
170
|
+
}
|
171
|
+
async function _updateVersionHistoryForVersionsWithOrigin(scope, mergedComponents, versionObjects) {
|
172
|
+
if (!versionObjects.length) return [];
|
173
|
+
_legacy().logger.debug(`_updateVersionHistoryForVersionsWithOrigin, found ${versionObjects.length} versions with origin`);
|
174
|
+
const componentVersionMap = new Map();
|
175
|
+
versionObjects.forEach(version => {
|
176
|
+
const component = mergedComponents.find(c => c.scope === version.origin?.id.scope && c.name === version.origin?.id.name);
|
177
|
+
if (!component) {
|
178
|
+
_legacy().logger.error(`updateVersionHistoryIfNeeded, unable to find component for version ${version.hash().toString()}`);
|
179
|
+
return;
|
180
|
+
}
|
181
|
+
const versions = componentVersionMap.get(component) || [];
|
182
|
+
componentVersionMap.set(component, [...versions, version]);
|
183
|
+
});
|
184
|
+
const versionsHistory = await (0, _toolboxPromise().pMapPool)(mergedComponents, async modelComp => {
|
185
|
+
const versions = componentVersionMap.get(modelComp);
|
186
|
+
if (!versions || !versions.length) return undefined;
|
187
|
+
return modelComp.updateVersionHistory(scope.objects, versions);
|
188
|
+
}, {
|
189
|
+
concurrency: (0, _harmonyModules().concurrentComponentsLimit)()
|
190
|
+
});
|
191
|
+
return (0, _lodash().compact)(versionsHistory);
|
192
|
+
}
|
193
|
+
/**
|
194
|
+
* merge components into the scope.
|
195
|
+
*
|
196
|
+
* a component might have multiple versions that some where merged and some were not.
|
197
|
+
* the BitIds returned here includes the versions that were merged. so it could contain multiple
|
198
|
+
* ids of the same component with different versions
|
199
|
+
*/
|
200
|
+
async function mergeObjects(scope, bitObjectList, throwForMissingDeps = false) {
|
201
|
+
const components = bitObjectList.getComponents();
|
202
|
+
const lanesObjects = bitObjectList.getLanes();
|
203
|
+
const versions = bitObjectList.getVersions();
|
204
|
+
const lanesHistory = bitObjectList.getLaneHistories();
|
205
|
+
_legacy().logger.debugAndAddBreadCrumb('export-scope-components.mergeObjects', `Going to merge ${components.length} components, ${lanesObjects.length} lanes`);
|
206
|
+
const {
|
207
|
+
mergeResults,
|
208
|
+
errors
|
209
|
+
} = lanesObjects.length ? {
|
210
|
+
mergeResults: [],
|
211
|
+
errors: []
|
212
|
+
} // for lanes, no need to merge component objects, the lane is merged later.
|
213
|
+
: await scope.sources.mergeComponents(components, versions);
|
214
|
+
const mergeAllLanesResults = await (0, _pMapSeries().default)(lanesObjects, laneObject => scope.sources.mergeLane(laneObject, false, versions, components));
|
215
|
+
const lanesErrors = mergeAllLanesResults.map(r => r.mergeErrors).flat();
|
216
|
+
const componentsNeedUpdate = [...errors.filter(result => result instanceof _legacy2().ComponentNeedsUpdate), ...lanesErrors];
|
217
|
+
const componentsWithConflicts = errors.filter(result => result instanceof _legacy2().MergeConflict);
|
218
|
+
if (componentsWithConflicts.length || componentsNeedUpdate.length) {
|
219
|
+
const idsAndVersions = componentsWithConflicts.map(c => ({
|
220
|
+
id: c.id,
|
221
|
+
versions: c.versions
|
222
|
+
}));
|
223
|
+
const idsAndVersionsWithConflicts = (0, _lodash().sortBy)(idsAndVersions, (0, _lodash().property)('id'));
|
224
|
+
const idsOfNeedUpdateComps = (0, _lodash().sortBy)(componentsNeedUpdate.map(c => ({
|
225
|
+
id: c.id,
|
226
|
+
lane: c.lane
|
227
|
+
})), (0, _lodash().property)('id'));
|
228
|
+
scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.
|
229
|
+
throw new (_legacy2().MergeConflictOnRemote)(idsAndVersionsWithConflicts, idsOfNeedUpdateComps);
|
230
|
+
}
|
231
|
+
if (throwForMissingDeps) await throwForMissingLocalDependencies(scope, versions, components, lanesObjects);
|
232
|
+
const mergedComponents = mergeResults.filter(({
|
233
|
+
mergedVersions
|
234
|
+
}) => mergedVersions.length);
|
235
|
+
const mergedLanesComponents = mergeAllLanesResults.map(r => r.mergeResults).flat().filter(({
|
236
|
+
mergedVersions
|
237
|
+
}) => mergedVersions.length);
|
238
|
+
const mergedComponentsResults = [...mergedComponents, ...mergedLanesComponents];
|
239
|
+
const getMergedIds = ({
|
240
|
+
mergedComponent,
|
241
|
+
mergedVersions
|
242
|
+
}) => mergedVersions.map(version => mergedComponent.toBitId().changeVersion(version));
|
243
|
+
const mergedIds = _componentId().ComponentIdList.uniqFromArray(mergedComponentsResults.map(getMergedIds).flat());
|
244
|
+
const mergedLanes = mergeAllLanesResults.map(r => r.mergeLane);
|
245
|
+
const mergedLaneHistories = await (0, _pMapSeries().default)(lanesHistory, async laneHistory => {
|
246
|
+
const existingLaneHistory = await scope.objects.load(laneHistory.hash());
|
247
|
+
if (existingLaneHistory) {
|
248
|
+
existingLaneHistory.merge(laneHistory);
|
249
|
+
return existingLaneHistory;
|
250
|
+
}
|
251
|
+
return laneHistory;
|
252
|
+
});
|
253
|
+
return {
|
254
|
+
mergedIds,
|
255
|
+
mergedComponentsResults,
|
256
|
+
mergedLanes,
|
257
|
+
mergedLaneHistories
|
258
|
+
};
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* make sure that all local objects were actually transferred into the remote.
|
263
|
+
* this gets called as part of the export-validate step. it doesn't check for dependencies from
|
264
|
+
* other scopes, as they'll be retrieved later by the fetch-missing-deps step.
|
265
|
+
* we can't wait for that step to validate local dependencies because it happens after persisting,
|
266
|
+
* and we don't want to persist when local dependencies were not exported.
|
267
|
+
*/
|
268
|
+
async function throwForMissingLocalDependencies(scope, versions, components, lanes) {
|
269
|
+
const compsWithHeads = lanes.length ? lanes.map(lane => lane.toBitIds()).flat() : components.map(c => c.toComponentIdWithHead());
|
270
|
+
await Promise.all(versions.map(async version => {
|
271
|
+
const originComp = compsWithHeads.find(id => version.hash().toString() === id.version);
|
272
|
+
if (!originComp) {
|
273
|
+
// coz if an older version has a missing dep, then, it's fine. (it can easily happen when exporting lane, which
|
274
|
+
// all old versions are exported)
|
275
|
+
return;
|
276
|
+
}
|
277
|
+
const getOriginCompWithVer = () => {
|
278
|
+
const compObj = components.find(c => c.toComponentId().isEqualWithoutVersion(originComp));
|
279
|
+
if (!compObj) return originComp;
|
280
|
+
const tag = compObj.getTagOfRefIfExists(_scope2().Ref.from(originComp.version));
|
281
|
+
if (tag) return originComp.changeVersion(tag);
|
282
|
+
return originComp;
|
283
|
+
};
|
284
|
+
const depsIds = version.getAllFlattenedDependencies();
|
285
|
+
await Promise.all(depsIds.map(async depId => {
|
286
|
+
if (depId.scope !== scope.name) return;
|
287
|
+
const existingModelComponent = (await scope.getModelComponentIfExist(depId)) || components.find(c => c.toComponentId().isEqualWithoutVersion(depId));
|
288
|
+
if (!existingModelComponent) {
|
289
|
+
scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.
|
290
|
+
throw new (_legacy2().ComponentNotFound)(depId.toString(), getOriginCompWithVer().toString());
|
291
|
+
}
|
292
|
+
const versionRef = existingModelComponent.getRef(depId.version);
|
293
|
+
if (!versionRef) throw new Error(`unable to find Ref/Hash of ${depId.toString()}`);
|
294
|
+
const objectExist = scope.objects.getCache(versionRef) || (await scope.objects.has(versionRef)) || versions.find(v => v.hash().isEqual(versionRef));
|
295
|
+
if (!objectExist) {
|
296
|
+
scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.
|
297
|
+
throw new (_legacy2().ComponentNotFound)(depId.toString(), getOriginCompWithVer().toString());
|
298
|
+
}
|
299
|
+
}));
|
300
|
+
}));
|
301
|
+
}
|
302
|
+
async function validateRemotes(remotes, clientId, isResumingExport = true) {
|
303
|
+
_legacy3().loader.start('verifying that objects can be merged on the remotes...');
|
304
|
+
try {
|
305
|
+
await Promise.all(remotes.map(remote => remote.action(_scope3().ExportValidate.name, {
|
306
|
+
clientId,
|
307
|
+
isResumingExport: true
|
308
|
+
})));
|
309
|
+
} catch (err) {
|
310
|
+
_legacy().logger.errorAndAddBreadCrumb('validateRemotes', 'failed validating remotes', {}, err);
|
311
|
+
if (!isResumingExport) {
|
312
|
+
// when resuming export, we don't want to delete the pending-objects because some scopes
|
313
|
+
// have them persisted and some not. we want to persist to all failing scopes.
|
314
|
+
await removePendingDirs(remotes, clientId);
|
315
|
+
}
|
316
|
+
throw err;
|
317
|
+
}
|
318
|
+
}
|
319
|
+
async function persistRemotes(manyObjectsPerRemote, clientId) {
|
320
|
+
const persistedRemotes = [];
|
321
|
+
await (0, _pMapSeries().default)(manyObjectsPerRemote, async objectsPerRemote => {
|
322
|
+
const {
|
323
|
+
remote
|
324
|
+
} = objectsPerRemote;
|
325
|
+
_legacy3().loader.start(`persisting data on the remote "${remote.name}"...`);
|
326
|
+
const maxRetries = 3;
|
327
|
+
let succeed = false;
|
328
|
+
let lastErrMsg = '';
|
329
|
+
for (let i = 0; i < maxRetries; i += 1) {
|
330
|
+
try {
|
331
|
+
// eslint-disable-next-line no-await-in-loop
|
332
|
+
const exportedIds = await remote.action(_scope3().ExportPersist.name, {
|
333
|
+
clientId
|
334
|
+
});
|
335
|
+
objectsPerRemote.exportedIds = exportedIds;
|
336
|
+
succeed = true;
|
337
|
+
break;
|
338
|
+
} catch (err) {
|
339
|
+
lastErrMsg = err.message;
|
340
|
+
_legacy().logger.errorAndAddBreadCrumb('persistRemotes', `failed on remote ${remote.name}, attempt ${i + 1} out of ${maxRetries}`, {}, err);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
if (!succeed) {
|
344
|
+
throw new (_legacy2().PersistFailed)([remote.name], {
|
345
|
+
[remote.name]: lastErrMsg
|
346
|
+
});
|
347
|
+
}
|
348
|
+
_legacy().logger.debugAndAddBreadCrumb('persistRemotes', `successfully pushed all ids to the bare-scope ${remote.name}`);
|
349
|
+
persistedRemotes.push(remote.name);
|
350
|
+
});
|
351
|
+
}
|
352
|
+
async function resumeExport(scope, exportId, remotes) {
|
353
|
+
const scopeRemotes = await (0, _scope().getScopeRemotes)(scope);
|
354
|
+
const remotesObj = await Promise.all(remotes.map(r => scopeRemotes.resolve(r, scope)));
|
355
|
+
const remotesForPersist = remotesObj.map(remote => ({
|
356
|
+
remote
|
357
|
+
}));
|
358
|
+
await validateRemotes(remotesObj, exportId);
|
359
|
+
await persistRemotes(remotesForPersist, exportId);
|
360
|
+
return (0, _lodash().compact)(remotesForPersist.map(r => r.exportedIds).flat());
|
361
|
+
}
|
362
|
+
async function removePendingDirs(pushedRemotes, clientId) {
|
363
|
+
await Promise.all(pushedRemotes.map(remote => remote.action(_scope3().RemovePendingDir.name, {
|
364
|
+
clientId
|
365
|
+
})));
|
366
|
+
}
|
367
|
+
|
368
|
+
//# sourceMappingURL=export-scope-components.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_componentId","_legacy","_scope","_legacy2","_scope2","_scope3","_legacy3","_toolboxPromise","_harmonyModules","e","__esModule","default","exportManyBareScope","scope","objectList","logger","debugAndAddBreadCrumb","objects","length","mergedIds","saveObjects","scopeComponentsImporter","scopeImporter","importManyFromOriginalScopes","bitObjectList","toBitObjects","objectsNotRequireMerge","getObjectsNotRequireMerge","mergedComponentsResults","mergedLanes","mergedLaneHistories","mergeObjects","mergedComponents","map","_","mergedComponent","versionObjects","filter","o","Version","versionsHistory","updateVersionHistory","allObjects","validateObjects","writeObjectsToTheFS","debug","versionsWithComponentId","obj","origin","id","versionsWithOrigin","versionWithoutOrigin","partition","v","versionHistoryOfVersionsWithOrigin","_updateVersionHistoryForVersionsWithOrigin","versionHistoryOfVersionsWithoutOrigin","_updateVersionHistoryForVersionsWithoutOrigin","mutatedVersionObjects","squashed","unrelated","Promise","all","modelComp","updateRebasedVersionHistory","versionsHistoryNoNull","compact","compId","toString","join","componentVersionMap","Map","forEach","version","component","find","c","name","error","hash","versions","get","set","pMapPool","undefined","concurrency","concurrentComponentsLimit","throwForMissingDeps","components","getComponents","lanesObjects","getLanes","getVersions","lanesHistory","getLaneHistories","mergeResults","errors","sources","mergeComponents","mergeAllLanesResults","mapSeries","laneObject","mergeLane","lanesErrors","r","mergeErrors","flat","componentsNeedUpdate","result","ComponentNeedsUpdate","componentsWithConflicts","MergeConflict","idsAndVersions","idsAndVersionsWithConflicts","sortBy","property","idsOfNeedUpdateComps","lane","clearObjectsFromCache","MergeConflictOnRemote","throwForMissingLocalDependencies","mergedVersions","mergedLanesComponents","getMergedIds","toBitId","changeVersion","ComponentIdList","uniqFromArray","laneHistory","existingLaneHistory","load","merge","lanes","compsWithHeads","toBitIds","toComponentIdWithHead","originComp","getOriginCompWithVer","compObj","toComponentId","isEqualWithoutVersion","tag","getTagOfRefIfExists","Ref","from","depsIds","getAllFlattenedDependencies","depId","existingModelComponent","getModelComponentIfExist","ComponentNotFound","versionRef","getRef","Error","objectExist","getCache","has","isEqual","validateRemotes","remotes","clientId","isResumingExport","loader","start","remote","action","ExportValidate","err","errorAndAddBreadCrumb","removePendingDirs","persistRemotes","manyObjectsPerRemote","persistedRemotes","objectsPerRemote","maxRetries","succeed","lastErrMsg","i","exportedIds","ExportPersist","message","PersistFailed","push","resumeExport","exportId","scopeRemotes","getScopeRemotes","remotesObj","resolve","remotesForPersist","pushedRemotes","RemovePendingDir"],"sources":["export-scope-components.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { compact, partition, property, sortBy } from 'lodash';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { logger } from '@teambit/legacy.logger';\nimport { Remotes, Remote, getScopeRemotes } from '@teambit/scope.remotes';\nimport {\n MergeResult,\n PersistFailed,\n Scope,\n ComponentNeedsUpdate,\n ComponentNotFound,\n MergeConflict,\n MergeConflictOnRemote,\n} from '@teambit/legacy.scope';\nimport {\n Lane,\n Version,\n ModelComponent,\n VersionHistory,\n LaneHistory,\n Ref,\n BitObjectList,\n ObjectList,\n} from '@teambit/scope.objects';\nimport { ExportPersist, ExportValidate, RemovePendingDir } from '@teambit/scope.remote-actions';\nimport { loader } from '@teambit/legacy.loader';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';\n\n/**\n * ** Legacy and \"bit sign\" Only **\n *\n * @TODO there is no real difference between bare scope and a working directory scope - let's adjust terminology to avoid confusions in the future\n * saves a component into the objects directory of the remote scope, then, resolves its\n * dependencies, saves them as well. Finally runs the build process if needed on an isolated\n * environment.\n */\nexport async function exportManyBareScope(scope: Scope, objectList: ObjectList): Promise<ComponentIdList> {\n logger.debugAndAddBreadCrumb('exportManyBareScope', `started with ${objectList.objects.length} objects`);\n const mergedIds = await saveObjects(scope, objectList);\n logger.debugAndAddBreadCrumb('exportManyBareScope', 'will try to importMany in case there are missing dependencies');\n const scopeComponentsImporter = scope.scopeImporter;\n await scopeComponentsImporter.importManyFromOriginalScopes(mergedIds); // resolve dependencies\n logger.debugAndAddBreadCrumb('exportManyBareScope', 'successfully ran importMany');\n\n return mergedIds;\n}\n\ntype RemotesForPersist = {\n remote: Remote;\n exportedIds?: string[];\n};\n\n/**\n * save objects into the scope.\n */\nexport async function saveObjects(scope: Scope, objectList: ObjectList): Promise<ComponentIdList> {\n const bitObjectList = await objectList.toBitObjects();\n const objectsNotRequireMerge = bitObjectList.getObjectsNotRequireMerge();\n // components and lanes can't be just added, they need to be carefully merged.\n const { mergedIds, mergedComponentsResults, mergedLanes, mergedLaneHistories } = await mergeObjects(\n scope,\n bitObjectList\n );\n const mergedComponents = mergedComponentsResults.map((_) => _.mergedComponent);\n const versionObjects = objectsNotRequireMerge.filter((o) => o instanceof Version) as Version[];\n const versionsHistory = await updateVersionHistory(scope, mergedComponents, versionObjects);\n const allObjects = [\n ...mergedComponents,\n ...mergedLanes,\n ...objectsNotRequireMerge,\n ...versionsHistory,\n ...mergedLaneHistories,\n ];\n scope.objects.validateObjects(true, allObjects);\n await scope.objects.writeObjectsToTheFS(allObjects);\n logger.debug(\n `export-scope-components.saveObjects, ${allObjects.length} objects were written successfully to the filesystem`\n );\n\n return mergedIds;\n}\n\n/**\n * Previously, the VersionHistory was populated during fetch. However, we want the fetch operation to be more efficient\n * so we move this logic to the export operation.\n * Before version 0.2.22, the Version object didn't have any info about the component-id, so we do update only for\n * rebase. For versions that tagged by > 0.2.22, we have the \"origin.id\" and we know to what component this version\n * belongs to.\n */\nasync function updateVersionHistory(\n scope: Scope,\n mergedComponents: ModelComponent[],\n versionObjects: Version[]\n): Promise<VersionHistory[]> {\n if (!mergedComponents.length) {\n // this is important for bit-sign to not try to update VersionHistory and then error due to missing components\n logger.debug('updateVersionHistory, no components were merged, no need to update VersionHistory');\n return [];\n }\n logger.debug(\n `updateVersionHistory, total components: ${mergedComponents.length}, total versions: ${versionObjects.length}`\n );\n\n const versionsWithComponentId = versionObjects.filter((obj) => obj.origin?.id);\n\n const [versionsWithOrigin, versionWithoutOrigin] = partition(versionsWithComponentId, (v) => v.origin?.id);\n\n const versionHistoryOfVersionsWithOrigin = await _updateVersionHistoryForVersionsWithOrigin(\n scope,\n mergedComponents,\n versionsWithOrigin\n );\n\n const versionHistoryOfVersionsWithoutOrigin = await _updateVersionHistoryForVersionsWithoutOrigin(\n scope,\n mergedComponents,\n versionWithoutOrigin\n );\n\n return [...versionHistoryOfVersionsWithOrigin, ...versionHistoryOfVersionsWithoutOrigin];\n}\n\n/**\n * In case of rebase (squash / unrelated) where the version history is changed, make the necessary changes in the\n * VersionHistory.\n * Because previously (bit-version < 0.2.22) we only knew about this from the Version object, and the Version object\n * didn't have any info about what the component-id is, we have to iterate all model-components, grab their\n * version-history and check whether the version-hash is inside their VersionHistory.\n * it's not ideal performance wise. however, in most cases, this rebase is about squashing, and when squashing, it's\n * done for the entire lane, so all components need to be updated regardless.\n */\nasync function _updateVersionHistoryForVersionsWithoutOrigin(\n scope: Scope,\n mergedComponents: ModelComponent[],\n versionWithoutOrigin: Version[]\n): Promise<VersionHistory[]> {\n const mutatedVersionObjects = versionWithoutOrigin.filter((v) => v.squashed || v.unrelated);\n if (!mutatedVersionObjects.length) return [];\n logger.debug(`_updateVersionHistoryForVersionsWithoutOrigin, found ${mutatedVersionObjects.length} mutated version`);\n const versionsHistory = await Promise.all(\n mergedComponents.map(async (modelComp) =>\n modelComp.updateRebasedVersionHistory(scope.objects, mutatedVersionObjects)\n )\n );\n const versionsHistoryNoNull = compact(versionsHistory);\n logger.debug(`_updateVersionHistoryForVersionsWithoutOrigin, found ${\n versionsHistoryNoNull.length\n } versionsHistory to update\n${versionsHistoryNoNull.map((v) => v.compId.toString()).join(', ')}`);\n\n return versionsHistoryNoNull;\n}\n\nasync function _updateVersionHistoryForVersionsWithOrigin(\n scope: Scope,\n mergedComponents: ModelComponent[],\n versionObjects: Version[]\n): Promise<VersionHistory[]> {\n if (!versionObjects.length) return [];\n logger.debug(`_updateVersionHistoryForVersionsWithOrigin, found ${versionObjects.length} versions with origin`);\n const componentVersionMap = new Map<ModelComponent, Version[]>();\n versionObjects.forEach((version) => {\n const component = mergedComponents.find(\n (c) => c.scope === version.origin?.id.scope && c.name === version.origin?.id.name\n );\n if (!component) {\n logger.error(`updateVersionHistoryIfNeeded, unable to find component for version ${version.hash().toString()}`);\n return;\n }\n const versions = componentVersionMap.get(component) || [];\n componentVersionMap.set(component, [...versions, version]);\n });\n\n const versionsHistory = await pMapPool(\n mergedComponents,\n async (modelComp) => {\n const versions = componentVersionMap.get(modelComp);\n if (!versions || !versions.length) return undefined;\n return modelComp.updateVersionHistory(scope.objects, versions);\n },\n { concurrency: concurrentComponentsLimit() }\n );\n\n return compact(versionsHistory);\n}\n\ntype MergeObjectsResult = {\n mergedIds: ComponentIdList;\n mergedComponentsResults: MergeResult[];\n mergedLanes: Lane[];\n mergedLaneHistories: LaneHistory[];\n};\n\n/**\n * merge components into the scope.\n *\n * a component might have multiple versions that some where merged and some were not.\n * the BitIds returned here includes the versions that were merged. so it could contain multiple\n * ids of the same component with different versions\n */\nexport async function mergeObjects(\n scope: Scope,\n bitObjectList: BitObjectList,\n throwForMissingDeps = false\n): Promise<MergeObjectsResult> {\n const components = bitObjectList.getComponents();\n const lanesObjects = bitObjectList.getLanes();\n const versions = bitObjectList.getVersions();\n const lanesHistory = bitObjectList.getLaneHistories();\n logger.debugAndAddBreadCrumb(\n 'export-scope-components.mergeObjects',\n `Going to merge ${components.length} components, ${lanesObjects.length} lanes`\n );\n const { mergeResults, errors } = lanesObjects.length\n ? { mergeResults: [], errors: [] } // for lanes, no need to merge component objects, the lane is merged later.\n : await scope.sources.mergeComponents(components, versions);\n\n const mergeAllLanesResults = await mapSeries(lanesObjects, (laneObject) =>\n scope.sources.mergeLane(laneObject, false, versions, components)\n );\n const lanesErrors = mergeAllLanesResults.map((r) => r.mergeErrors).flat();\n const componentsNeedUpdate = [\n ...errors.filter((result) => result instanceof ComponentNeedsUpdate),\n ...lanesErrors,\n ] as ComponentNeedsUpdate[];\n const componentsWithConflicts = errors.filter((result) => result instanceof MergeConflict) as MergeConflict[];\n if (componentsWithConflicts.length || componentsNeedUpdate.length) {\n const idsAndVersions = componentsWithConflicts.map((c) => ({ id: c.id, versions: c.versions }));\n const idsAndVersionsWithConflicts = sortBy(idsAndVersions, property('id'));\n const idsOfNeedUpdateComps = sortBy(\n componentsNeedUpdate.map((c) => ({ id: c.id, lane: c.lane })),\n property('id')\n );\n scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.\n throw new MergeConflictOnRemote(idsAndVersionsWithConflicts, idsOfNeedUpdateComps);\n }\n if (throwForMissingDeps) await throwForMissingLocalDependencies(scope, versions, components, lanesObjects);\n const mergedComponents = mergeResults.filter(({ mergedVersions }) => mergedVersions.length);\n const mergedLanesComponents = mergeAllLanesResults\n .map((r) => r.mergeResults)\n .flat()\n .filter(({ mergedVersions }) => mergedVersions.length);\n const mergedComponentsResults = [...mergedComponents, ...mergedLanesComponents];\n const getMergedIds = ({ mergedComponent, mergedVersions }): ComponentID[] =>\n mergedVersions.map((version) => mergedComponent.toBitId().changeVersion(version));\n const mergedIds = ComponentIdList.uniqFromArray(mergedComponentsResults.map(getMergedIds).flat());\n const mergedLanes = mergeAllLanesResults.map((r) => r.mergeLane);\n\n const mergedLaneHistories = await mapSeries(lanesHistory, async (laneHistory) => {\n const existingLaneHistory = (await scope.objects.load(laneHistory.hash())) as LaneHistory | undefined;\n if (existingLaneHistory) {\n existingLaneHistory.merge(laneHistory);\n return existingLaneHistory;\n }\n return laneHistory;\n });\n\n return { mergedIds, mergedComponentsResults, mergedLanes, mergedLaneHistories };\n}\n\n/**\n * make sure that all local objects were actually transferred into the remote.\n * this gets called as part of the export-validate step. it doesn't check for dependencies from\n * other scopes, as they'll be retrieved later by the fetch-missing-deps step.\n * we can't wait for that step to validate local dependencies because it happens after persisting,\n * and we don't want to persist when local dependencies were not exported.\n */\nasync function throwForMissingLocalDependencies(\n scope: Scope,\n versions: Version[],\n components: ModelComponent[],\n lanes: Lane[]\n) {\n const compsWithHeads = lanes.length\n ? lanes.map((lane) => lane.toBitIds()).flat()\n : components.map((c) => c.toComponentIdWithHead());\n\n await Promise.all(\n versions.map(async (version) => {\n const originComp = compsWithHeads.find((id) => version.hash().toString() === id.version);\n if (!originComp) {\n // coz if an older version has a missing dep, then, it's fine. (it can easily happen when exporting lane, which\n // all old versions are exported)\n return;\n }\n const getOriginCompWithVer = () => {\n const compObj = components.find((c) => c.toComponentId().isEqualWithoutVersion(originComp));\n if (!compObj) return originComp;\n const tag = compObj.getTagOfRefIfExists(Ref.from(originComp.version as string));\n if (tag) return originComp.changeVersion(tag);\n return originComp;\n };\n const depsIds = version.getAllFlattenedDependencies();\n await Promise.all(\n depsIds.map(async (depId) => {\n if (depId.scope !== scope.name) return;\n const existingModelComponent =\n (await scope.getModelComponentIfExist(depId)) ||\n components.find((c) => c.toComponentId().isEqualWithoutVersion(depId));\n if (!existingModelComponent) {\n scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.\n throw new ComponentNotFound(depId.toString(), getOriginCompWithVer().toString());\n }\n const versionRef = existingModelComponent.getRef(depId.version as string);\n if (!versionRef) throw new Error(`unable to find Ref/Hash of ${depId.toString()}`);\n const objectExist =\n scope.objects.getCache(versionRef) ||\n (await scope.objects.has(versionRef)) ||\n versions.find((v) => v.hash().isEqual(versionRef));\n if (!objectExist) {\n scope.objects.clearObjectsFromCache(); // just in case this error is caught. we don't want to persist anything by mistake.\n throw new ComponentNotFound(depId.toString(), getOriginCompWithVer().toString());\n }\n })\n );\n })\n );\n}\n\nexport async function validateRemotes(remotes: Remote[], clientId: string, isResumingExport = true) {\n loader.start('verifying that objects can be merged on the remotes...');\n try {\n await Promise.all(\n remotes.map((remote) =>\n remote.action(ExportValidate.name, {\n clientId,\n isResumingExport: true,\n })\n )\n );\n } catch (err: any) {\n logger.errorAndAddBreadCrumb('validateRemotes', 'failed validating remotes', {}, err);\n if (!isResumingExport) {\n // when resuming export, we don't want to delete the pending-objects because some scopes\n // have them persisted and some not. we want to persist to all failing scopes.\n await removePendingDirs(remotes, clientId);\n }\n throw err;\n }\n}\n\nexport async function persistRemotes(manyObjectsPerRemote: RemotesForPersist[], clientId: string) {\n const persistedRemotes: string[] = [];\n await mapSeries(manyObjectsPerRemote, async (objectsPerRemote: RemotesForPersist) => {\n const { remote } = objectsPerRemote;\n loader.start(`persisting data on the remote \"${remote.name}\"...`);\n const maxRetries = 3;\n let succeed = false;\n let lastErrMsg = '';\n for (let i = 0; i < maxRetries; i += 1) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const exportedIds: string[] = await remote.action(ExportPersist.name, { clientId });\n objectsPerRemote.exportedIds = exportedIds;\n succeed = true;\n break;\n } catch (err: any) {\n lastErrMsg = err.message;\n logger.errorAndAddBreadCrumb(\n 'persistRemotes',\n `failed on remote ${remote.name}, attempt ${i + 1} out of ${maxRetries}`,\n {},\n err\n );\n }\n }\n if (!succeed) {\n throw new PersistFailed([remote.name], { [remote.name]: lastErrMsg });\n }\n logger.debugAndAddBreadCrumb('persistRemotes', `successfully pushed all ids to the bare-scope ${remote.name}`);\n persistedRemotes.push(remote.name);\n });\n}\n\nexport async function resumeExport(scope: Scope, exportId: string, remotes: string[]): Promise<string[]> {\n const scopeRemotes: Remotes = await getScopeRemotes(scope);\n const remotesObj = await Promise.all(remotes.map((r) => scopeRemotes.resolve(r, scope)));\n const remotesForPersist: RemotesForPersist[] = remotesObj.map((remote) => ({ remote }));\n await validateRemotes(remotesObj, exportId);\n await persistRemotes(remotesForPersist, exportId);\n return compact(remotesForPersist.map((r) => r.exportedIds).flat());\n}\n\nexport async function removePendingDirs(pushedRemotes: Remote[], clientId: string) {\n await Promise.all(pushedRemotes.map((remote) => remote.action(RemovePendingDir.name, { clientId })));\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAS,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pE;AAEO,eAAe+D,iBAAiBA,CAACqB,aAAuB,EAAE9B,QAAgB,EAAE;EACjF,MAAMnG,OAAO,CAACC,GAAG,CAACgI,aAAa,CAAC7J,GAAG,CAAEmI,MAAM,IAAKA,MAAM,CAACC,MAAM,CAAC0B,0BAAgB,CAAClH,IAAI,EAAE;IAAEmF;EAAS,CAAC,CAAC,CAAC,CAAC;AACtG","ignoreList":[]}
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
2
2
|
import { ScopeMain } from '@teambit/scope';
|
3
3
|
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
4
|
-
import { Consumer } from '@teambit/legacy
|
4
|
+
import { Consumer } from '@teambit/legacy.consumer';
|
5
5
|
import { RemoveMain } from '@teambit/remove';
|
6
|
-
import { Lane } from '@teambit/legacy/dist/scope/models';
|
7
|
-
import { Scope } from '@teambit/legacy/dist/scope';
|
8
6
|
import { Workspace } from '@teambit/workspace';
|
9
7
|
import { Logger, LoggerMain } from '@teambit/logger';
|
10
|
-
import {
|
11
|
-
import { Remote, Remotes } from '@teambit/legacy/dist/remotes';
|
8
|
+
import { Remotes, Remote } from '@teambit/scope.remotes';
|
12
9
|
import { EjectMain, EjectResults } from '@teambit/eject';
|
13
|
-
import { ExportOrigin } from '@teambit/
|
10
|
+
import { ExportOrigin } from '@teambit/scope.network';
|
14
11
|
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
12
|
+
import { Lane, ObjectList } from '@teambit/scope.objects';
|
13
|
+
import { Scope } from '@teambit/legacy.scope';
|
15
14
|
export type OnExportIdTransformer = (id: ComponentID) => ComponentID;
|
16
15
|
type ObjectsPerRemote = {
|
17
16
|
remote: Remote;
|