@teambit/export 0.0.830 → 0.0.833

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.
@@ -21,6 +21,7 @@ export declare class ExportCmd implements Command {
21
21
  json([ids]: [string[]], { eject, all, allVersions, originDirectly, ignoreMissingArtifacts, resume, }: any): Promise<{
22
22
  componentsIds: import("@teambit/legacy/dist/bit-id").BitId[];
23
23
  nonExistOnBitMap: import("@teambit/legacy/dist/bit-id").BitId[];
24
+ removedIds: import("@teambit/legacy/dist/bit-id").BitIds;
24
25
  missingScope: import("@teambit/legacy/dist/bit-id").BitId[];
25
26
  ejectResults: any;
26
27
  exportedLanes: import("@teambit/lanes").Lane[];
@@ -93,6 +93,7 @@ class ExportCmd {
93
93
  const {
94
94
  componentsIds,
95
95
  nonExistOnBitMap,
96
+ removedIds,
96
97
  missingScope,
97
98
  exportedLanes,
98
99
  ejectResults
@@ -123,6 +124,15 @@ class ExportCmd {
123
124
  return _chalk().default.yellow(`${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`);
124
125
  };
125
126
 
127
+ const removedOutput = () => {
128
+ if (!removedIds.length) return '';
129
+
130
+ const title = _chalk().default.bold(`\n\nthe following component(s) have been marked as removed on the remote\n`);
131
+
132
+ const idsStr = removedIds.join('\n');
133
+ return title + idsStr;
134
+ };
135
+
126
136
  const missingScopeOutput = () => {
127
137
  if ((0, _lodash().isEmpty)(missingScope)) return '';
128
138
  const idsStr = missingScope.map(id => id.toString()).join(', ');
@@ -135,7 +145,7 @@ class ExportCmd {
135
145
  return `\n${output}`;
136
146
  };
137
147
 
138
- return nonExistOnBitMapOutput() + missingScopeOutput() + exportOutput() + ejectOutput();
148
+ return nonExistOnBitMapOutput() + missingScopeOutput() + exportOutput() + ejectOutput() + removedOutput();
139
149
  }
140
150
 
141
151
  async json([ids = []], {
@@ -1 +1 @@
1
- {"version":3,"names":["ExportCmd","constructor","exportMain","name","description","WILDCARD_HELP","report","ids","eject","all","allVersions","originDirectly","ignoreMissingArtifacts","resume","componentsIds","nonExistOnBitMap","missingScope","exportedLanes","ejectResults","export","includeNonStaged","resumeExportId","isEmpty","chalk","yellow","exportOutput","lanesOutput","length","bold","green","join","nonExistOnBitMapOutput","idsStr","map","id","toString","missingScopeOutput","ejectOutput","output","ejectTemplate","json","results"],"sources":["export-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport ejectTemplate from '@teambit/legacy/dist/cli/templates/eject-template';\nimport { WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\nimport { ExportMain } 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:\n 'component IDs, component names, or component patterns (separated by space). Use patterns to export groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription = `bit export => export all staged components to their current scope, if checked out to a lane, export the lane as well\n \\`bit export [id...]\\` => export the given ids to their current scope\n ${WILDCARD_HELP('export remote-scope')}`;\n alias = 'e';\n helpUrl = 'components/exporting-components';\n options = [\n [\n 'e',\n 'eject',\n 'replace the exported components with their corresponding packages (to use these components without further maintaining them)',\n ],\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 'EXPERIMENTAL. 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 'ignore-missing-artifacts',\n \"EXPERIMENTAL. don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote\",\n ],\n ['j', 'json', 'show output in json format'],\n ] as CommandOptions;\n loader = true;\n migration = 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 }: any\n ): Promise<string> {\n const { componentsIds, nonExistOnBitMap, missingScope, exportedLanes, ejectResults } = await this.exportMain.export(\n {\n ids,\n eject,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n resumeExportId: resume,\n ignoreMissingArtifacts,\n }\n );\n if (isEmpty(componentsIds) && isEmpty(nonExistOnBitMap) && isEmpty(missingScope)) {\n return chalk.yellow('nothing to export');\n }\n const exportOutput = () => {\n if (isEmpty(componentsIds)) return '';\n const lanesOutput = exportedLanes.length ? ` from lane ${chalk.bold(exportedLanes[0].name)}` : '';\n return chalk.green(\n `exported the following ${componentsIds.length} component(s)${lanesOutput}:\\n${chalk.bold(\n componentsIds.join('\\n')\n )}`\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 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: ${chalk.bold(\n idsStr\n )}.\\nplease specify <remote> to export them, 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\n return nonExistOnBitMapOutput() + missingScopeOutput() + exportOutput() + ejectOutput();\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 ) {\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,SAAN,CAAmC;EAqDxCC,WAAW,CAASC,UAAT,EAAiC;IAAA,KAAxBA,UAAwB,GAAxBA,UAAwB;IAAA,8CApDrC,gCAoDqC;IAAA,qDAnD9B,uDAmD8B;IAAA,mDAlDhC,CACV;MACEC,IAAI,EAAE,uBADR;MAEEC,WAAW,EACT;IAHJ,CADU,CAkDgC;IAAA,6DA3CrB;AACzB;AACA,IAAI,IAAAC,0BAAA,EAAc,qBAAd,CAAqC,EAyCK;IAAA,+CAxCpC,GAwCoC;IAAA,iDAvClC,iCAuCkC;IAAA,iDAtClC,CACR,CACE,GADF,EAEE,OAFF,EAGE,8HAHF,CADQ,EAMR,CACE,GADF,EAEE,KAFF,EAGE,mHAHF,CANQ,EAWR,CACE,EADF,EAEE,cAFF,EAGE,qHAHF,CAXQ,EAgBR,CACE,EADF,EAEE,iBAFF,EAGE,kHAHF,CAhBQ,EAqBR,CACE,EADF,EAEE,iBAFF,EAGE,4FAHF,CArBQ,EA0BR,CACE,EADF,EAEE,0BAFF,EAGE,yIAHF,CA1BQ,EA+BR,CAAC,GAAD,EAAM,MAAN,EAAc,4BAAd,CA/BQ,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AAL,CAAgBiB,MAAhB,CAAuB;MAC3CZ,GAD2C;MAE3CC,KAF2C;MAG3CY,gBAAgB,EAAEX,GAAG,IAAIC,WAHkB;MAI3CA,WAAW,EAAEA,WAAW,IAAID,GAJe;MAK3CE,cAL2C;MAM3CU,cAAc,EAAER,MAN2B;MAO3CD;IAP2C,CAAvB,CAAtB;IAUA,OAAO6B,OAAP;EACD;;AAzIuC"}
1
+ {"version":3,"names":["ExportCmd","constructor","exportMain","name","description","WILDCARD_HELP","report","ids","eject","all","allVersions","originDirectly","ignoreMissingArtifacts","resume","componentsIds","nonExistOnBitMap","removedIds","missingScope","exportedLanes","ejectResults","export","includeNonStaged","resumeExportId","isEmpty","chalk","yellow","exportOutput","lanesOutput","length","bold","green","join","nonExistOnBitMapOutput","idsStr","map","id","toString","removedOutput","title","missingScopeOutput","ejectOutput","output","ejectTemplate","json","results"],"sources":["export-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport ejectTemplate from '@teambit/legacy/dist/cli/templates/eject-template';\nimport { WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\nimport { ExportMain } 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:\n 'component IDs, component names, or component patterns (separated by space). Use patterns to export groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription = `bit export => export all staged components to their current scope, if checked out to a lane, export the lane as well\n \\`bit export [id...]\\` => export the given ids to their current scope\n ${WILDCARD_HELP('export remote-scope')}`;\n alias = 'e';\n helpUrl = 'components/exporting-components';\n options = [\n [\n 'e',\n 'eject',\n 'replace the exported components with their corresponding packages (to use these components without further maintaining them)',\n ],\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 'EXPERIMENTAL. 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 'ignore-missing-artifacts',\n \"EXPERIMENTAL. don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote\",\n ],\n ['j', 'json', 'show output in json format'],\n ] as CommandOptions;\n loader = true;\n migration = 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 }: any\n ): Promise<string> {\n const { componentsIds, nonExistOnBitMap, removedIds, missingScope, exportedLanes, ejectResults } =\n 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 if (isEmpty(componentsIds) && isEmpty(nonExistOnBitMap) && isEmpty(missingScope)) {\n return chalk.yellow('nothing to export');\n }\n const exportOutput = () => {\n if (isEmpty(componentsIds)) return '';\n const lanesOutput = exportedLanes.length ? ` from lane ${chalk.bold(exportedLanes[0].name)}` : '';\n return chalk.green(\n `exported the following ${componentsIds.length} component(s)${lanesOutput}:\\n${chalk.bold(\n componentsIds.join('\\n')\n )}`\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 title = chalk.bold(`\\n\\nthe following component(s) have been marked as removed on the remote\\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: ${chalk.bold(\n idsStr\n )}.\\nplease specify <remote> to export them, 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\n return nonExistOnBitMapOutput() + missingScopeOutput() + exportOutput() + ejectOutput() + removedOutput();\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 ) {\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,SAAN,CAAmC;EAqDxCC,WAAW,CAASC,UAAT,EAAiC;IAAA,KAAxBA,UAAwB,GAAxBA,UAAwB;IAAA,8CApDrC,gCAoDqC;IAAA,qDAnD9B,uDAmD8B;IAAA,mDAlDhC,CACV;MACEC,IAAI,EAAE,uBADR;MAEEC,WAAW,EACT;IAHJ,CADU,CAkDgC;IAAA,6DA3CrB;AACzB;AACA,IAAI,IAAAC,0BAAA,EAAc,qBAAd,CAAqC,EAyCK;IAAA,+CAxCpC,GAwCoC;IAAA,iDAv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AAxC,CAA6C,IAA7C,CAAf;MACA,OAAOP,gBAAA,CAAMC,MAAN,CACJ,iDAAgDD,gBAAA,CAAMK,IAAN,CAC/CI,MAD+C,CAE/C,iGAHG,CAAP;IAKD,CARD;;IASA,MAAMO,WAAW,GAAG,MAAM;MACxB,IAAI,CAACrB,YAAL,EAAmB,OAAO,EAAP;MACnB,MAAMsB,MAAM,GAAG,IAAAC,wBAAA,EAAcvB,YAAd,CAAf;MACA,OAAQ,KAAIsB,MAAO,EAAnB;IACD,CAJD;;IAMA,OAAOT,sBAAsB,KAAKO,kBAAkB,EAA7C,GAAkDb,YAAY,EAA9D,GAAmEc,WAAW,EAA9E,GAAmFH,aAAa,EAAvG;EACD;;EAES,MAAJM,IAAI,CACR,CAACpC,GAAG,GAAG,EAAP,CADQ,EAER;IACEC,KAAK,GAAG,KADV;IAEEC,GAAG,GAAG,KAFR;IAGEC,WAAW,GAAG,KAHhB;IAIEC,cAAc,GAAG,KAJnB;IAKEC,sBAAsB,GAAG,KAL3B;IAMEC;EANF,CAFQ,EAUR;IACA,MAAM+B,OAAO,GAAG,MAAM,KAAK1C,UAAL,CAAgBkB,MAAhB,CAAuB;MAC3Cb,GAD2C;MAE3CC,KAF2C;MAG3Ca,gBAAgB,EAAEZ,GAAG,IAAIC,WAHkB;MAI3CA,WAAW,EAAEA,WAAW,IAAID,GAJe;MAK3CE,cAL2C;MAM3CW,cAAc,EAAET,MAN2B;MAO3CD;IAP2C,CAAvB,CAAtB;IAUA,OAAOgC,OAAP;EACD;;AA9IuC"}
@@ -1,6 +1,8 @@
1
1
  import { CLIMain } from '@teambit/cli';
2
2
  import { ScopeMain } from '@teambit/scope';
3
- import { BitId } from '@teambit/legacy/dist/bit-id';
3
+ import { BitId, BitIds } from '@teambit/legacy/dist/bit-id';
4
+ import { Consumer } from '@teambit/legacy/dist/consumer';
5
+ import { RemoveMain } from '@teambit/remove';
4
6
  import { Lane } from '@teambit/legacy/dist/scope/models';
5
7
  import { Workspace } from '@teambit/workspace';
6
8
  declare type ExportParams = {
@@ -14,10 +16,12 @@ declare type ExportParams = {
14
16
  };
15
17
  export declare class ExportMain {
16
18
  private workspace;
17
- constructor(workspace: Workspace);
19
+ private remove;
20
+ constructor(workspace: Workspace, remove: RemoveMain);
18
21
  export(params: ExportParams): Promise<{
19
22
  componentsIds: BitId[];
20
23
  nonExistOnBitMap: BitId[];
24
+ removedIds: BitIds;
21
25
  missingScope: BitId[];
22
26
  ejectResults: any;
23
27
  exportedLanes: Lane[];
@@ -26,8 +30,11 @@ export declare class ExportMain {
26
30
  private removeFromStagedConfig;
27
31
  private getComponentsToExport;
28
32
  private getIdsWithFutureScope;
33
+ private getLaneCompIdsToExport;
34
+ private getRemovedStagedBitIds;
29
35
  static runtime: import("@teambit/harmony").RuntimeDefinition;
30
36
  static dependencies: import("@teambit/harmony").Aspect[];
31
- static provider([cli, scope, workspace]: [CLIMain, ScopeMain, Workspace]): Promise<ExportMain>;
37
+ static provider([cli, scope, workspace, remove]: [CLIMain, ScopeMain, Workspace, RemoveMain]): Promise<ExportMain>;
32
38
  }
39
+ export declare function isUserTryingToExportLanes(consumer: Consumer): boolean;
33
40
  export {};
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", {
10
10
  value: true
11
11
  });
12
12
  exports.ExportMain = void 0;
13
+ exports.isUserTryingToExportLanes = isUserTryingToExportLanes;
13
14
 
14
15
  function _objectWithoutProperties2() {
15
16
  const data = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
@@ -151,30 +152,30 @@ function _componentsList() {
151
152
  return data;
152
153
  }
153
154
 
154
- function _exportLanes() {
155
- const data = require("@teambit/legacy/dist/consumer/lanes/export-lanes");
155
+ function _generalError() {
156
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
156
157
 
157
- _exportLanes = function () {
158
+ _generalError = function () {
158
159
  return data;
159
160
  };
160
161
 
161
162
  return data;
162
163
  }
163
164
 
164
- function _generalError() {
165
- const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
165
+ function _hooks() {
166
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/hooks"));
166
167
 
167
- _generalError = function () {
168
+ _hooks = function () {
168
169
  return data;
169
170
  };
170
171
 
171
172
  return data;
172
173
  }
173
174
 
174
- function _hooks() {
175
- const data = _interopRequireDefault(require("@teambit/legacy/dist/hooks"));
175
+ function _remove() {
176
+ const data = require("@teambit/remove");
176
177
 
177
- _hooks = function () {
178
+ _remove = function () {
178
179
  return data;
179
180
  };
180
181
 
@@ -288,8 +289,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
288
289
  const HooksManagerInstance = _hooks().default.getInstance();
289
290
 
290
291
  class ExportMain {
291
- constructor(workspace) {
292
+ constructor(workspace, remove) {
292
293
  this.workspace = workspace;
294
+ this.remove = remove;
293
295
  }
294
296
 
295
297
  async export(params) {
@@ -299,6 +301,7 @@ class ExportMain {
299
301
  nonExistOnBitMap,
300
302
  missingScope,
301
303
  exported,
304
+ removedIds,
302
305
  exportedLanes
303
306
  } = await this.exportComponents(params);
304
307
  let ejectResults;
@@ -306,6 +309,7 @@ class ExportMain {
306
309
  const exportResults = {
307
310
  componentsIds: exported,
308
311
  nonExistOnBitMap,
312
+ removedIds,
309
313
  missingScope,
310
314
  ejectResults,
311
315
  exportedLanes
@@ -341,6 +345,7 @@ class ExportMain {
341
345
  return {
342
346
  updatedIds: [],
343
347
  nonExistOnBitMap: [],
348
+ removedIds: new (_bitId().BitIds)(),
344
349
  missingScope,
345
350
  exported: [],
346
351
  newIdsOnRemote: [],
@@ -366,14 +371,15 @@ class ExportMain {
366
371
  idsWithFutureScope,
367
372
  isOnMain
368
373
  }));
369
- if (laneObject) await (0, _exportLanes().updateLanesAfterExport)(consumer, laneObject);
374
+ if (laneObject) await updateLanesAfterExport(consumer, laneObject);
375
+ const removedIds = await this.getRemovedStagedBitIds();
370
376
 
371
377
  const {
372
378
  updatedIds,
373
379
  nonExistOnBitMap
374
380
  } = _updateIdsOnBitMap(consumer.bitMap, updatedLocally);
375
381
 
376
- await this.removeFromStagedConfig(updatedIds);
382
+ await this.removeFromStagedConfig([...updatedIds, ...nonExistOnBitMap]);
377
383
  await linkComponents(updatedIds, consumer);
378
384
 
379
385
  _analytics().Analytics.setExtraData('num_components', exported.length); // it is important to have consumer.onDestroy() before running the eject operation, we want the
@@ -384,7 +390,8 @@ class ExportMain {
384
390
  await consumer.onDestroy();
385
391
  return {
386
392
  updatedIds,
387
- nonExistOnBitMap,
393
+ nonExistOnBitMap: nonExistOnBitMap.filter(id => !removedIds.hasWithoutVersion(id)),
394
+ removedIds,
388
395
  missingScope,
389
396
  exported,
390
397
  newIdsOnRemote,
@@ -420,7 +427,7 @@ class ExportMain {
420
427
  };
421
428
  };
422
429
 
423
- if ((0, _exportLanes().isUserTryingToExportLanes)(consumer)) {
430
+ if (isUserTryingToExportLanes(consumer)) {
424
431
  if (ids.length) {
425
432
  throw new (_generalError().default)(`when checked out to a lane, all its components are exported. please omit the ids`);
426
433
  }
@@ -428,7 +435,7 @@ class ExportMain {
428
435
  const {
429
436
  componentsToExport,
430
437
  laneObject
431
- } = await (0, _exportLanes().getLaneCompIdsToExport)(consumer, includeNonStaged);
438
+ } = await this.getLaneCompIdsToExport(consumer, includeNonStaged);
432
439
  const loaderMsg = componentsToExport.length > 1 ? _loaderMessages().BEFORE_EXPORTS : _loaderMessages().BEFORE_EXPORT;
433
440
 
434
441
  _loader().default.start(loaderMsg);
@@ -483,8 +490,35 @@ class ExportMain {
483
490
  return _bitId().BitIds.fromArray(idsArray);
484
491
  }
485
492
 
486
- static async provider([cli, scope, workspace]) {
487
- const exportMain = new ExportMain(workspace);
493
+ async getLaneCompIdsToExport(consumer, includeNonStaged) {
494
+ const currentLaneId = consumer.getCurrentLaneId();
495
+ const laneObject = await consumer.scope.loadLane(currentLaneId);
496
+
497
+ if (!laneObject) {
498
+ throw new Error(`fatal: unable to load the current lane object (${currentLaneId.toString()})`);
499
+ }
500
+
501
+ _loader().default.start(_loaderMessages().BEFORE_LOADING_COMPONENTS);
502
+
503
+ const componentsList = new (_componentsList().default)(consumer);
504
+ const componentsToExportWithoutRemoved = includeNonStaged ? await componentsList.listNonNewComponentsIds() : await componentsList.listExportPendingComponentsIds(laneObject);
505
+ const removedStagedBitIds = await this.getRemovedStagedBitIds();
506
+
507
+ const componentsToExport = _bitId().BitIds.uniqFromArray([...componentsToExportWithoutRemoved, ...removedStagedBitIds]);
508
+
509
+ return {
510
+ componentsToExport,
511
+ laneObject
512
+ };
513
+ }
514
+
515
+ async getRemovedStagedBitIds() {
516
+ const removedStaged = await this.remove.getRemovedStaged();
517
+ return _bitId().BitIds.fromArray(removedStaged.map(r => r._legacy).map(id => id.changeVersion(undefined)));
518
+ }
519
+
520
+ static async provider([cli, scope, workspace, remove]) {
521
+ const exportMain = new ExportMain(workspace, remove);
488
522
  cli.register(new (_resumeExportCmd().ResumeExportCmd)(scope), new (_exportCmd().ExportCmd)(exportMain));
489
523
  return exportMain;
490
524
  }
@@ -493,7 +527,7 @@ class ExportMain {
493
527
 
494
528
  exports.ExportMain = ExportMain;
495
529
  (0, _defineProperty2().default)(ExportMain, "runtime", _cli().MainRuntime);
496
- (0, _defineProperty2().default)(ExportMain, "dependencies", [_cli().CLIAspect, _scope().default, _workspace().default]);
530
+ (0, _defineProperty2().default)(ExportMain, "dependencies", [_cli().CLIAspect, _scope().default, _workspace().default, _remove().RemoveAspect]);
497
531
 
498
532
  _export().ExportAspect.addRuntime(ExportMain);
499
533
 
@@ -568,4 +602,21 @@ function _throwForUnsnappedLaneReadme(lane) {
568
602
  }
569
603
  }
570
604
 
605
+ async function updateLanesAfterExport(consumer, lane) {
606
+ const currentLane = consumer.getCurrentLaneId();
607
+ const isCurrentLane = lane.name === currentLane.name;
608
+
609
+ if (!isCurrentLane) {
610
+ throw new Error(`updateLanesAfterExport should get called only with current lane, got ${lane.name}, current ${currentLane.name}`);
611
+ }
612
+
613
+ consumer.setCurrentLane(lane.toLaneId(), true);
614
+ consumer.scope.scopeJson.removeLaneFromNew(lane.name);
615
+ lane.isNew = false;
616
+ }
617
+
618
+ function isUserTryingToExportLanes(consumer) {
619
+ return consumer.isOnLane();
620
+ }
621
+
571
622
  //# sourceMappingURL=export.main.runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HooksManagerInstance","HooksManager","getInstance","ExportMain","constructor","workspace","export","params","triggerHook","PRE_EXPORT_HOOK","updatedIds","nonExistOnBitMap","missingScope","exported","exportedLanes","exportComponents","ejectResults","eject","ejectExportedComponents","exportResults","componentsIds","POST_EXPORT_HOOK","Scope","onPostExport","catch","err","logger","error","ids","includeNonStaged","originDirectly","ConsumerNotFound","consumer","idsToExport","idsWithFutureScope","laneObject","getComponentsToExport","R","isEmpty","newIdsOnRemote","readmeComponent","_throwForUnsnappedLaneReadme","isOnMain","updatedLocally","exportMany","scope","updateLanesAfterExport","_updateIdsOnBitMap","bitMap","removeFromStagedConfig","linkComponents","Analytics","setExtraData","length","onDestroy","componentIds","resolveMultipleComponentIds","stagedConfig","getStagedConfig","map","compId","removeComponentConfig","write","componentsList","ComponentsList","idsHaveWildcard","hasWildcard","filterNonScopeIfNeeded","bitIds","getIdsWithFutureScope","partition","id","idWithFutureScope","searchWithoutScopeAndVersion","Error","toString","hasScope","BitIds","fromArray","isUserTryingToExportLanes","GeneralError","componentsToExport","getLaneCompIdsToExport","loaderMsg","BEFORE_EXPORTS","BEFORE_EXPORT","loader","start","filtered","BEFORE_LOADING_COMPONENTS","exportPendingComponents","listNonNewComponentsIds","listExportPendingComponentsIds","filterComponentsByWildcard","parsedIds","Promise","all","getParsedId","statuses","getManyComponentsStatuses","forEach","status","nested","idsArrayP","componentId","resolveComponentId","finalScope","componentDefaultScope","changeScope","idsArray","provider","cli","exportMain","register","ResumeExportCmd","ExportCmd","MainRuntime","CLIAspect","ScopeAspect","WorkspaceAspect","ExportAspect","addRuntime","componentsId","resultId","updateComponentId","hasVersion","push","parsedId","components","loadComponentFromModel","nodeModuleLinker","NodeModuleLinker","link","loadConsumer","undefined","ejectComponents","EjectComponents","ejectErr","c","join","msg","lane","isValid","head","getComponent","getComponentHead","isEqual","BitError","name"],"sources":["export.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport {\n BEFORE_EXPORT,\n BEFORE_EXPORTS,\n BEFORE_LOADING_COMPONENTS,\n} from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { POST_EXPORT_HOOK, PRE_EXPORT_HOOK } from '@teambit/legacy/dist/constants';\nimport { Consumer, loadConsumer } from '@teambit/legacy/dist/consumer';\nimport BitMap from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport EjectComponents, { EjectResults } from '@teambit/legacy/dist/consumer/component-ops/eject-components';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n getLaneCompIdsToExport,\n isUserTryingToExportLanes,\n updateLanesAfterExport,\n} from '@teambit/legacy/dist/consumer/lanes/export-lanes';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport HooksManager from '@teambit/legacy/dist/hooks';\nimport { NodeModuleLinker } from '@teambit/legacy/dist/links';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { exportMany } from '@teambit/legacy/dist/scope/component-ops/export-scope-components';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { LaneReadmeComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { ExportAspect } from './export.aspect';\nimport { ExportCmd } from './export-cmd';\nimport { ResumeExportCmd } from './resume-export-cmd';\n\nconst HooksManagerInstance = HooksManager.getInstance();\n\ntype ExportParams = {\n ids: string[];\n eject: boolean;\n allVersions: boolean;\n originDirectly: boolean;\n includeNonStaged: boolean;\n resumeExportId: string | undefined;\n ignoreMissingArtifacts: boolean;\n};\n\nexport class ExportMain {\n constructor(private workspace: Workspace) {}\n\n async export(params: ExportParams) {\n HooksManagerInstance.triggerHook(PRE_EXPORT_HOOK, params);\n const { updatedIds, nonExistOnBitMap, missingScope, exported, exportedLanes } = await this.exportComponents(params);\n let ejectResults;\n if (params.eject) ejectResults = await ejectExportedComponents(updatedIds);\n const exportResults = {\n componentsIds: exported,\n nonExistOnBitMap,\n missingScope,\n ejectResults,\n exportedLanes,\n };\n HooksManagerInstance.triggerHook(POST_EXPORT_HOOK, exportResults);\n if (Scope.onPostExport) {\n await Scope.onPostExport(exported, exportedLanes).catch((err) => {\n logger.error('fatal: onPostExport encountered an error (this error does not stop the process)', err);\n });\n }\n return exportResults;\n }\n\n private async exportComponents({ ids, includeNonStaged, originDirectly, ...params }: ExportParams): Promise<{\n updatedIds: BitId[];\n nonExistOnBitMap: BitId[];\n missingScope: BitId[];\n exported: BitId[];\n exportedLanes: Lane[];\n newIdsOnRemote: BitId[];\n }> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n const { idsToExport, missingScope, idsWithFutureScope, laneObject } = await this.getComponentsToExport(\n ids,\n includeNonStaged\n );\n\n if (R.isEmpty(idsToExport)) {\n return {\n updatedIds: [],\n nonExistOnBitMap: [],\n missingScope,\n exported: [],\n newIdsOnRemote: [],\n exportedLanes: [],\n };\n }\n\n // validate lane readme component and ensure it has been snapped\n if (laneObject?.readmeComponent) {\n _throwForUnsnappedLaneReadme(laneObject);\n }\n const isOnMain = consumer.isOnMain();\n const { exported, updatedLocally, newIdsOnRemote } = await exportMany({\n ...params,\n scope: consumer.scope,\n ids: idsToExport,\n laneObject,\n originDirectly,\n idsWithFutureScope,\n isOnMain,\n });\n if (laneObject) await updateLanesAfterExport(consumer, laneObject);\n const { updatedIds, nonExistOnBitMap } = _updateIdsOnBitMap(consumer.bitMap, updatedLocally);\n await this.removeFromStagedConfig(updatedIds);\n await linkComponents(updatedIds, consumer);\n Analytics.setExtraData('num_components', exported.length);\n // it is important to have consumer.onDestroy() before running the eject operation, we want the\n // export and eject operations to function independently. we don't want to lose the changes to\n // .bitmap file done by the export action in case the eject action has failed.\n await consumer.onDestroy();\n return {\n updatedIds,\n nonExistOnBitMap,\n missingScope,\n exported,\n newIdsOnRemote,\n exportedLanes: laneObject ? [laneObject] : [],\n };\n }\n\n private async removeFromStagedConfig(ids: BitId[]) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(ids);\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n componentIds.map((compId) => stagedConfig.removeComponentConfig(compId));\n await stagedConfig.write();\n }\n\n private async getComponentsToExport(\n ids: string[],\n includeNonStaged: boolean\n ): Promise<{ idsToExport: BitIds; missingScope: BitId[]; idsWithFutureScope: BitIds; laneObject?: Lane }> {\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n const idsHaveWildcard = hasWildcard(ids);\n const filterNonScopeIfNeeded = async (\n bitIds: BitIds\n ): Promise<{ idsToExport: BitIds; missingScope: BitId[]; idsWithFutureScope: BitIds }> => {\n const idsWithFutureScope = await this.getIdsWithFutureScope(bitIds);\n const [idsToExport, missingScope] = R.partition((id) => {\n const idWithFutureScope = idsWithFutureScope.searchWithoutScopeAndVersion(id);\n if (!idWithFutureScope) throw new Error(`idsWithFutureScope is missing ${id.toString()}`);\n return idWithFutureScope.hasScope();\n }, bitIds);\n return { idsToExport: BitIds.fromArray(idsToExport), missingScope, idsWithFutureScope };\n };\n if (isUserTryingToExportLanes(consumer)) {\n if (ids.length) {\n throw new GeneralError(`when checked out to a lane, all its components are exported. please omit the ids`);\n }\n const { componentsToExport, laneObject } = await getLaneCompIdsToExport(consumer, includeNonStaged);\n const loaderMsg = componentsToExport.length > 1 ? BEFORE_EXPORTS : BEFORE_EXPORT;\n loader.start(loaderMsg);\n const filtered = await filterNonScopeIfNeeded(componentsToExport);\n return { ...filtered, laneObject };\n }\n if (!ids.length || idsHaveWildcard) {\n loader.start(BEFORE_LOADING_COMPONENTS);\n const exportPendingComponents: BitIds = includeNonStaged\n ? await componentsList.listNonNewComponentsIds()\n : await componentsList.listExportPendingComponentsIds();\n const componentsToExport = idsHaveWildcard\n ? ComponentsList.filterComponentsByWildcard(exportPendingComponents, ids)\n : exportPendingComponents;\n const loaderMsg = componentsToExport.length > 1 ? BEFORE_EXPORTS : BEFORE_EXPORT;\n loader.start(loaderMsg);\n return filterNonScopeIfNeeded(componentsToExport);\n }\n loader.start(BEFORE_EXPORT); // show single export\n const parsedIds = await Promise.all(ids.map((id) => getParsedId(consumer, id)));\n const statuses = await consumer.getManyComponentsStatuses(parsedIds);\n statuses.forEach(({ id, status }) => {\n if (status.nested) {\n throw new GeneralError(\n `unable to export \"${id.toString()}\", the component is not fully available. please use \"bit import\" first`\n );\n }\n });\n return filterNonScopeIfNeeded(BitIds.fromArray(parsedIds));\n }\n\n private async getIdsWithFutureScope(ids: BitIds): Promise<BitIds> {\n const idsArrayP = ids.map(async (id) => {\n if (id.hasScope()) return id;\n const componentId = await this.workspace.resolveComponentId(id);\n const finalScope = await this.workspace.componentDefaultScope(componentId);\n if (finalScope) {\n return id.changeScope(finalScope);\n }\n return id;\n });\n const idsArray = await Promise.all(idsArrayP);\n return BitIds.fromArray(idsArray);\n }\n\n static runtime = MainRuntime;\n static dependencies = [CLIAspect, ScopeAspect, WorkspaceAspect];\n static async provider([cli, scope, workspace]: [CLIMain, ScopeMain, Workspace]) {\n const exportMain = new ExportMain(workspace);\n cli.register(new ResumeExportCmd(scope), new ExportCmd(exportMain));\n return exportMain;\n }\n}\n\nExportAspect.addRuntime(ExportMain);\n\nfunction _updateIdsOnBitMap(bitMap: BitMap, componentsIds: BitIds): { updatedIds: BitId[]; nonExistOnBitMap: BitIds } {\n const updatedIds = [];\n const nonExistOnBitMap = new BitIds();\n componentsIds.forEach((componentsId) => {\n const resultId = bitMap.updateComponentId(componentsId, true);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (resultId.hasVersion()) updatedIds.push(resultId);\n else nonExistOnBitMap.push(resultId);\n });\n return { updatedIds, nonExistOnBitMap };\n}\n\nasync function getParsedId(consumer: Consumer, id: string): Promise<BitId> {\n // reason why not calling `consumer.getParsedId()` first is because a component might not be on\n // .bitmap and only in the scope. we support this case and enable to export\n const parsedId: BitId = await consumer.scope.getParsedId(id);\n if (parsedId.hasScope()) return parsedId;\n // parsing id from the scope, doesn't provide the scope-name in case it's missing, in this case\n // get the id including the scope from the consumer.\n try {\n return consumer.getParsedId(id);\n } catch (err: any) {\n // not in the consumer, just return the one parsed without the scope name\n return parsedId;\n }\n}\n\nasync function linkComponents(ids: BitId[], consumer: Consumer): Promise<void> {\n // we don't have much of a choice here, we have to load all the exported components in order to link them\n // some of the components might be authored, some might be imported.\n // when a component has dists, we need the consumer-component object to retrieve the dists info.\n const components = await Promise.all(ids.map((id) => consumer.loadComponentFromModel(id)));\n const nodeModuleLinker = new NodeModuleLinker(components, consumer, consumer.bitMap);\n await nodeModuleLinker.link();\n}\n\nasync function ejectExportedComponents(componentsIds): Promise<EjectResults> {\n const consumer: Consumer = await loadConsumer(undefined, true);\n let ejectResults: EjectResults;\n try {\n const ejectComponents = new EjectComponents(consumer, componentsIds);\n ejectResults = await ejectComponents.eject();\n } catch (err: any) {\n const ejectErr = `The components ${componentsIds.map((c) => c.toString()).join(', ')} were exported successfully.\n However, the eject operation has failed due to an error: ${err.msg || err}`;\n logger.error(ejectErr, err);\n throw new Error(ejectErr);\n }\n // run the consumer.onDestroy() again, to write the changes done by the eject action to .bitmap\n await consumer.onDestroy();\n return ejectResults;\n}\n\nfunction _throwForUnsnappedLaneReadme(lane: Lane) {\n const readmeComponent = lane.readmeComponent as LaneReadmeComponent;\n\n const isValid =\n readmeComponent?.head &&\n lane.getComponent(readmeComponent.id) &&\n lane.getComponentHead(readmeComponent.id)?.isEqual(readmeComponent?.head);\n\n if (!isValid) {\n throw new BitError(\n `${lane?.name} has a readme component ${readmeComponent.id} that hasn't been snapped on the lane.\n Please run either snap -a or snap ${readmeComponent.id} to snap the component on the lane before exporting it.`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AA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,CAACsB,SAAT,EAAN;EACA,OAAOtC,YAAP;AACD;;AAED,SAASyB,4BAAT,CAAsCoG,IAAtC,EAAkD;EAAA;;EAChD,MAAMrG,eAAe,GAAGqG,IAAI,CAACrG,eAA7B;EAEA,MAAMsG,OAAO,GACX,CAAAtG,eAAe,SAAf,IAAAA,eAAe,WAAf,YAAAA,eAAe,CAAEuG,IAAjB,KACAF,IAAI,CAACG,YAAL,CAAkBxG,eAAe,CAAC+B,EAAlC,CADA,8BAEAsE,IAAI,CAACI,gBAAL,CAAsBzG,eAAe,CAAC+B,EAAtC,CAFA,0DAEA,sBAA2C2E,OAA3C,CAAmD1G,eAAnD,aAAmDA,eAAnD,uBAAmDA,eAAe,CAAEuG,IAApE,CAFA,CADF;;EAKA,IAAI,CAACD,OAAL,EAAc;IACZ,MAAM,KAAIK,oBAAJ,EACH,GAAEN,IAAH,aAAGA,IAAH,uBAAGA,IAAI,CAAEO,IAAK,2BAA0B5G,eAAe,CAAC+B,EAAG;AACjE,0CAA0C/B,eAAe,CAAC+B,EAAG,yDAFnD,CAAN;EAID;AACF"}
1
+ {"version":3,"names":["HooksManagerInstance","HooksManager","getInstance","ExportMain","constructor","workspace","remove","export","params","triggerHook","PRE_EXPORT_HOOK","updatedIds","nonExistOnBitMap","missingScope","exported","removedIds","exportedLanes","exportComponents","ejectResults","eject","ejectExportedComponents","exportResults","componentsIds","POST_EXPORT_HOOK","Scope","onPostExport","catch","err","logger","error","ids","includeNonStaged","originDirectly","ConsumerNotFound","consumer","idsToExport","idsWithFutureScope","laneObject","getComponentsToExport","R","isEmpty","BitIds","newIdsOnRemote","readmeComponent","_throwForUnsnappedLaneReadme","isOnMain","updatedLocally","exportMany","scope","updateLanesAfterExport","getRemovedStagedBitIds","_updateIdsOnBitMap","bitMap","removeFromStagedConfig","linkComponents","Analytics","setExtraData","length","onDestroy","filter","id","hasWithoutVersion","componentIds","resolveMultipleComponentIds","stagedConfig","getStagedConfig","map","compId","removeComponentConfig","write","componentsList","ComponentsList","idsHaveWildcard","hasWildcard","filterNonScopeIfNeeded","bitIds","getIdsWithFutureScope","partition","idWithFutureScope","searchWithoutScopeAndVersion","Error","toString","hasScope","fromArray","isUserTryingToExportLanes","GeneralError","componentsToExport","getLaneCompIdsToExport","loaderMsg","BEFORE_EXPORTS","BEFORE_EXPORT","loader","start","filtered","BEFORE_LOADING_COMPONENTS","exportPendingComponents","listNonNewComponentsIds","listExportPendingComponentsIds","filterComponentsByWildcard","parsedIds","Promise","all","getParsedId","statuses","getManyComponentsStatuses","forEach","status","nested","idsArrayP","componentId","resolveComponentId","finalScope","componentDefaultScope","changeScope","idsArray","currentLaneId","getCurrentLaneId","loadLane","componentsToExportWithoutRemoved","removedStagedBitIds","uniqFromArray","removedStaged","getRemovedStaged","r","_legacy","changeVersion","undefined","provider","cli","exportMain","register","ResumeExportCmd","ExportCmd","MainRuntime","CLIAspect","ScopeAspect","WorkspaceAspect","RemoveAspect","ExportAspect","addRuntime","componentsId","resultId","updateComponentId","hasVersion","push","parsedId","components","loadComponentFromModel","nodeModuleLinker","NodeModuleLinker","link","loadConsumer","ejectComponents","EjectComponents","ejectErr","c","join","msg","lane","isValid","head","getComponent","getComponentHead","isEqual","BitError","name","currentLane","isCurrentLane","setCurrentLane","toLaneId","scopeJson","removeLaneFromNew","isNew","isOnLane"],"sources":["export.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport {\n BEFORE_EXPORT,\n BEFORE_EXPORTS,\n BEFORE_LOADING_COMPONENTS,\n} from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { POST_EXPORT_HOOK, PRE_EXPORT_HOOK } from '@teambit/legacy/dist/constants';\nimport { Consumer, loadConsumer } from '@teambit/legacy/dist/consumer';\nimport BitMap from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport EjectComponents, { EjectResults } from '@teambit/legacy/dist/consumer/component-ops/eject-components';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport HooksManager from '@teambit/legacy/dist/hooks';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { NodeModuleLinker } from '@teambit/legacy/dist/links';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { exportMany } from '@teambit/legacy/dist/scope/component-ops/export-scope-components';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { LaneReadmeComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { ExportAspect } from './export.aspect';\nimport { ExportCmd } from './export-cmd';\nimport { ResumeExportCmd } from './resume-export-cmd';\n\nconst HooksManagerInstance = HooksManager.getInstance();\n\ntype ExportParams = {\n ids: string[];\n eject: boolean;\n allVersions: boolean;\n originDirectly: boolean;\n includeNonStaged: boolean;\n resumeExportId: string | undefined;\n ignoreMissingArtifacts: boolean;\n};\n\nexport class ExportMain {\n constructor(private workspace: Workspace, private remove: RemoveMain) {}\n\n async export(params: ExportParams) {\n HooksManagerInstance.triggerHook(PRE_EXPORT_HOOK, params);\n const { updatedIds, nonExistOnBitMap, missingScope, exported, removedIds, exportedLanes } =\n await this.exportComponents(params);\n let ejectResults;\n if (params.eject) ejectResults = await ejectExportedComponents(updatedIds);\n const exportResults = {\n componentsIds: exported,\n nonExistOnBitMap,\n removedIds,\n missingScope,\n ejectResults,\n exportedLanes,\n };\n HooksManagerInstance.triggerHook(POST_EXPORT_HOOK, exportResults);\n if (Scope.onPostExport) {\n await Scope.onPostExport(exported, exportedLanes).catch((err) => {\n logger.error('fatal: onPostExport encountered an error (this error does not stop the process)', err);\n });\n }\n return exportResults;\n }\n\n private async exportComponents({ ids, includeNonStaged, originDirectly, ...params }: ExportParams): Promise<{\n updatedIds: BitId[];\n nonExistOnBitMap: BitId[];\n removedIds: BitIds;\n missingScope: BitId[];\n exported: BitId[];\n exportedLanes: Lane[];\n newIdsOnRemote: BitId[];\n }> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n const { idsToExport, missingScope, idsWithFutureScope, laneObject } = await this.getComponentsToExport(\n ids,\n includeNonStaged\n );\n\n if (R.isEmpty(idsToExport)) {\n return {\n updatedIds: [],\n nonExistOnBitMap: [],\n removedIds: new BitIds(),\n missingScope,\n exported: [],\n newIdsOnRemote: [],\n exportedLanes: [],\n };\n }\n\n // validate lane readme component and ensure it has been snapped\n if (laneObject?.readmeComponent) {\n _throwForUnsnappedLaneReadme(laneObject);\n }\n const isOnMain = consumer.isOnMain();\n const { exported, updatedLocally, newIdsOnRemote } = await exportMany({\n ...params,\n scope: consumer.scope,\n ids: idsToExport,\n laneObject,\n originDirectly,\n idsWithFutureScope,\n isOnMain,\n });\n if (laneObject) await updateLanesAfterExport(consumer, laneObject);\n const removedIds = await this.getRemovedStagedBitIds();\n const { updatedIds, nonExistOnBitMap } = _updateIdsOnBitMap(consumer.bitMap, updatedLocally);\n await this.removeFromStagedConfig([...updatedIds, ...nonExistOnBitMap]);\n await linkComponents(updatedIds, consumer);\n Analytics.setExtraData('num_components', exported.length);\n // it is important to have consumer.onDestroy() before running the eject operation, we want the\n // export and eject operations to function independently. we don't want to lose the changes to\n // .bitmap file done by the export action in case the eject action has failed.\n await consumer.onDestroy();\n return {\n updatedIds,\n nonExistOnBitMap: nonExistOnBitMap.filter((id) => !removedIds.hasWithoutVersion(id)),\n removedIds,\n missingScope,\n exported,\n newIdsOnRemote,\n exportedLanes: laneObject ? [laneObject] : [],\n };\n }\n\n private async removeFromStagedConfig(ids: BitId[]) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(ids);\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n componentIds.map((compId) => stagedConfig.removeComponentConfig(compId));\n await stagedConfig.write();\n }\n\n private async getComponentsToExport(\n ids: string[],\n includeNonStaged: boolean\n ): Promise<{ idsToExport: BitIds; missingScope: BitId[]; idsWithFutureScope: BitIds; laneObject?: Lane }> {\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n const idsHaveWildcard = hasWildcard(ids);\n const filterNonScopeIfNeeded = async (\n bitIds: BitIds\n ): Promise<{ idsToExport: BitIds; missingScope: BitId[]; idsWithFutureScope: BitIds }> => {\n const idsWithFutureScope = await this.getIdsWithFutureScope(bitIds);\n const [idsToExport, missingScope] = R.partition((id) => {\n const idWithFutureScope = idsWithFutureScope.searchWithoutScopeAndVersion(id);\n if (!idWithFutureScope) throw new Error(`idsWithFutureScope is missing ${id.toString()}`);\n return idWithFutureScope.hasScope();\n }, bitIds);\n return { idsToExport: BitIds.fromArray(idsToExport), missingScope, idsWithFutureScope };\n };\n if (isUserTryingToExportLanes(consumer)) {\n if (ids.length) {\n throw new GeneralError(`when checked out to a lane, all its components are exported. please omit the ids`);\n }\n const { componentsToExport, laneObject } = await this.getLaneCompIdsToExport(consumer, includeNonStaged);\n const loaderMsg = componentsToExport.length > 1 ? BEFORE_EXPORTS : BEFORE_EXPORT;\n loader.start(loaderMsg);\n const filtered = await filterNonScopeIfNeeded(componentsToExport);\n return { ...filtered, laneObject };\n }\n if (!ids.length || idsHaveWildcard) {\n loader.start(BEFORE_LOADING_COMPONENTS);\n const exportPendingComponents: BitIds = includeNonStaged\n ? await componentsList.listNonNewComponentsIds()\n : await componentsList.listExportPendingComponentsIds();\n const componentsToExport = idsHaveWildcard\n ? ComponentsList.filterComponentsByWildcard(exportPendingComponents, ids)\n : exportPendingComponents;\n const loaderMsg = componentsToExport.length > 1 ? BEFORE_EXPORTS : BEFORE_EXPORT;\n loader.start(loaderMsg);\n return filterNonScopeIfNeeded(componentsToExport);\n }\n loader.start(BEFORE_EXPORT); // show single export\n const parsedIds = await Promise.all(ids.map((id) => getParsedId(consumer, id)));\n const statuses = await consumer.getManyComponentsStatuses(parsedIds);\n statuses.forEach(({ id, status }) => {\n if (status.nested) {\n throw new GeneralError(\n `unable to export \"${id.toString()}\", the component is not fully available. please use \"bit import\" first`\n );\n }\n });\n return filterNonScopeIfNeeded(BitIds.fromArray(parsedIds));\n }\n\n private async getIdsWithFutureScope(ids: BitIds): Promise<BitIds> {\n const idsArrayP = ids.map(async (id) => {\n if (id.hasScope()) return id;\n const componentId = await this.workspace.resolveComponentId(id);\n const finalScope = await this.workspace.componentDefaultScope(componentId);\n if (finalScope) {\n return id.changeScope(finalScope);\n }\n return id;\n });\n const idsArray = await Promise.all(idsArrayP);\n return BitIds.fromArray(idsArray);\n }\n\n private async getLaneCompIdsToExport(\n consumer: Consumer,\n includeNonStaged: boolean\n ): Promise<{ componentsToExport: BitIds; laneObject: Lane }> {\n const currentLaneId = consumer.getCurrentLaneId();\n const laneObject = await consumer.scope.loadLane(currentLaneId);\n if (!laneObject) {\n throw new Error(`fatal: unable to load the current lane object (${currentLaneId.toString()})`);\n }\n loader.start(BEFORE_LOADING_COMPONENTS);\n const componentsList = new ComponentsList(consumer);\n const componentsToExportWithoutRemoved = includeNonStaged\n ? await componentsList.listNonNewComponentsIds()\n : await componentsList.listExportPendingComponentsIds(laneObject);\n const removedStagedBitIds = await this.getRemovedStagedBitIds();\n const componentsToExport = BitIds.uniqFromArray([...componentsToExportWithoutRemoved, ...removedStagedBitIds]);\n return { componentsToExport, laneObject };\n }\n\n private async getRemovedStagedBitIds(): Promise<BitIds> {\n const removedStaged = await this.remove.getRemovedStaged();\n return BitIds.fromArray(removedStaged.map((r) => r._legacy).map((id) => id.changeVersion(undefined)));\n }\n\n static runtime = MainRuntime;\n static dependencies = [CLIAspect, ScopeAspect, WorkspaceAspect, RemoveAspect];\n static async provider([cli, scope, workspace, remove]: [CLIMain, ScopeMain, Workspace, RemoveMain]) {\n const exportMain = new ExportMain(workspace, remove);\n cli.register(new ResumeExportCmd(scope), new ExportCmd(exportMain));\n return exportMain;\n }\n}\n\nExportAspect.addRuntime(ExportMain);\n\nfunction _updateIdsOnBitMap(bitMap: BitMap, componentsIds: BitIds): { updatedIds: BitId[]; nonExistOnBitMap: BitIds } {\n const updatedIds = [];\n const nonExistOnBitMap = new BitIds();\n componentsIds.forEach((componentsId) => {\n const resultId = bitMap.updateComponentId(componentsId, true);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (resultId.hasVersion()) updatedIds.push(resultId);\n else nonExistOnBitMap.push(resultId);\n });\n return { updatedIds, nonExistOnBitMap };\n}\n\nasync function getParsedId(consumer: Consumer, id: string): Promise<BitId> {\n // reason why not calling `consumer.getParsedId()` first is because a component might not be on\n // .bitmap and only in the scope. we support this case and enable to export\n const parsedId: BitId = await consumer.scope.getParsedId(id);\n if (parsedId.hasScope()) return parsedId;\n // parsing id from the scope, doesn't provide the scope-name in case it's missing, in this case\n // get the id including the scope from the consumer.\n try {\n return consumer.getParsedId(id);\n } catch (err: any) {\n // not in the consumer, just return the one parsed without the scope name\n return parsedId;\n }\n}\n\nasync function linkComponents(ids: BitId[], consumer: Consumer): Promise<void> {\n // we don't have much of a choice here, we have to load all the exported components in order to link them\n // some of the components might be authored, some might be imported.\n // when a component has dists, we need the consumer-component object to retrieve the dists info.\n const components = await Promise.all(ids.map((id) => consumer.loadComponentFromModel(id)));\n const nodeModuleLinker = new NodeModuleLinker(components, consumer, consumer.bitMap);\n await nodeModuleLinker.link();\n}\n\nasync function ejectExportedComponents(componentsIds): Promise<EjectResults> {\n const consumer: Consumer = await loadConsumer(undefined, true);\n let ejectResults: EjectResults;\n try {\n const ejectComponents = new EjectComponents(consumer, componentsIds);\n ejectResults = await ejectComponents.eject();\n } catch (err: any) {\n const ejectErr = `The components ${componentsIds.map((c) => c.toString()).join(', ')} were exported successfully.\n However, the eject operation has failed due to an error: ${err.msg || err}`;\n logger.error(ejectErr, err);\n throw new Error(ejectErr);\n }\n // run the consumer.onDestroy() again, to write the changes done by the eject action to .bitmap\n await consumer.onDestroy();\n return ejectResults;\n}\n\nfunction _throwForUnsnappedLaneReadme(lane: Lane) {\n const readmeComponent = lane.readmeComponent as LaneReadmeComponent;\n\n const isValid =\n readmeComponent?.head &&\n lane.getComponent(readmeComponent.id) &&\n lane.getComponentHead(readmeComponent.id)?.isEqual(readmeComponent?.head);\n\n if (!isValid) {\n throw new BitError(\n `${lane?.name} has a readme component ${readmeComponent.id} that hasn't been snapped on the lane.\n Please run either snap -a or snap ${readmeComponent.id} to snap the component on the lane before exporting it.`\n );\n }\n}\n\nasync function updateLanesAfterExport(consumer: Consumer, lane: Lane) {\n const currentLane = consumer.getCurrentLaneId();\n const isCurrentLane = lane.name === currentLane.name;\n if (!isCurrentLane) {\n throw new Error(\n `updateLanesAfterExport should get called only with current lane, got ${lane.name}, current ${currentLane.name}`\n );\n }\n consumer.setCurrentLane(lane.toLaneId(), true);\n consumer.scope.scopeJson.removeLaneFromNew(lane.name);\n lane.isNew = false;\n}\n\nexport function isUserTryingToExportLanes(consumer: Consumer) {\n return consumer.isOnLane();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;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CAAEqH,IAApE,CAFA,CADF;;EAKA,IAAI,CAACD,OAAL,EAAc;IACZ,MAAM,KAAIK,oBAAJ,EACH,GAAEN,IAAH,aAAGA,IAAH,uBAAGA,IAAI,CAAEO,IAAK,2BAA0B1H,eAAe,CAACiB,EAAG;AACjE,0CAA0CjB,eAAe,CAACiB,EAAG,yDAFnD,CAAN;EAID;AACF;;AAED,eAAeX,sBAAf,CAAsCf,QAAtC,EAA0D4H,IAA1D,EAAsE;EACpE,MAAMQ,WAAW,GAAGpI,QAAQ,CAACkF,gBAAT,EAApB;EACA,MAAMmD,aAAa,GAAGT,IAAI,CAACO,IAAL,KAAcC,WAAW,CAACD,IAAhD;;EACA,IAAI,CAACE,aAAL,EAAoB;IAClB,MAAM,IAAIvF,KAAJ,CACH,wEAAuE8E,IAAI,CAACO,IAAK,aAAYC,WAAW,CAACD,IAAK,EAD3G,CAAN;EAGD;;EACDnI,QAAQ,CAACsI,cAAT,CAAwBV,IAAI,CAACW,QAAL,EAAxB,EAAyC,IAAzC;EACAvI,QAAQ,CAACc,KAAT,CAAe0H,SAAf,CAAyBC,iBAAzB,CAA2Cb,IAAI,CAACO,IAAhD;EACAP,IAAI,CAACc,KAAL,GAAa,KAAb;AACD;;AAEM,SAASxF,yBAAT,CAAmClD,QAAnC,EAAuD;EAC5D,OAAOA,QAAQ,CAAC2I,QAAT,EAAP;AACD"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/export",
3
- "version": "0.0.830",
3
+ "version": "0.0.833",
4
4
  "homepage": "https://bit.dev/teambit/scope/export",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.scope",
8
8
  "name": "export",
9
- "version": "0.0.830"
9
+ "version": "0.0.833"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -15,10 +15,11 @@
15
15
  "@babel/runtime": "7.12.18",
16
16
  "core-js": "^3.0.0",
17
17
  "@teambit/harmony": "0.3.3",
18
- "@teambit/cli": "0.0.555",
19
- "@teambit/bit-error": "0.0.394",
20
- "@teambit/scope": "0.0.830",
21
- "@teambit/workspace": "0.0.830"
18
+ "@teambit/cli": "0.0.558",
19
+ "@teambit/bit-error": "0.0.396",
20
+ "@teambit/remove": "0.0.10",
21
+ "@teambit/scope": "0.0.833",
22
+ "@teambit/workspace": "0.0.833"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/lodash": "4.14.165",
@@ -30,7 +31,7 @@
30
31
  "@types/node": "12.20.4"
31
32
  },
32
33
  "peerDependencies": {
33
- "@teambit/legacy": "1.0.338",
34
+ "@teambit/legacy": "1.0.341",
34
35
  "react-dom": "^16.8.0 || ^17.0.0",
35
36
  "react": "^16.8.0 || ^17.0.0"
36
37
  },
@@ -52,8 +53,6 @@
52
53
  "react",
53
54
  "react-components",
54
55
  "angular",
55
- "angular-components",
56
- "vue",
57
- "vue-components"
56
+ "angular-components"
58
57
  ]
59
58
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.830/dist/export.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.830/dist/export.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.833/dist/export.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.833/dist/export.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];