@teambit/export 0.0.825 → 0.0.828

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.
@@ -1,5 +1,7 @@
1
1
  import { Command, CommandOptions } from '@teambit/cli';
2
+ import { ExportMain } from './export.main.runtime';
2
3
  export declare class ExportCmd implements Command {
4
+ private exportMain;
3
5
  name: string;
4
6
  description: string;
5
7
  arguments: {
@@ -8,12 +10,13 @@ export declare class ExportCmd implements Command {
8
10
  }[];
9
11
  extendedDescription: string;
10
12
  alias: string;
13
+ helpUrl: string;
11
14
  options: CommandOptions;
12
15
  loader: boolean;
13
16
  migration: boolean;
14
17
  group: string;
15
18
  remoteOp: boolean;
16
- constructor(docsDomain: string);
19
+ constructor(exportMain: ExportMain);
17
20
  report([ids]: [string[]], { eject, all, allVersions, originDirectly, ignoreMissingArtifacts, resume, }: any): Promise<string>;
18
21
  json([ids]: [string[]], { eject, all, allVersions, originDirectly, ignoreMissingArtifacts, resume, }: any): Promise<{
19
22
  componentsIds: import("@teambit/legacy/dist/bit-id").BitId[];
@@ -21,16 +21,6 @@ function _defineProperty2() {
21
21
  return data;
22
22
  }
23
23
 
24
- function _consumer() {
25
- const data = require("@teambit/legacy/dist/api/consumer");
26
-
27
- _consumer = function () {
28
- return data;
29
- };
30
-
31
- return data;
32
- }
33
-
34
24
  function _ejectTemplate() {
35
25
  const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/eject-template"));
36
26
 
@@ -72,25 +62,24 @@ function _lodash() {
72
62
  }
73
63
 
74
64
  class ExportCmd {
75
- constructor(docsDomain) {
65
+ constructor(exportMain) {
66
+ this.exportMain = exportMain;
76
67
  (0, _defineProperty2().default)(this, "name", 'export [component-patterns...]');
77
68
  (0, _defineProperty2().default)(this, "description", 'export components from the workspace to remote scopes');
78
69
  (0, _defineProperty2().default)(this, "arguments", [{
79
70
  name: 'component-patterns...',
80
71
  description: '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)'
81
72
  }]);
82
- (0, _defineProperty2().default)(this, "extendedDescription", void 0);
73
+ (0, _defineProperty2().default)(this, "extendedDescription", `bit export => export all staged components to their current scope, if checked out to a lane, export the lane as well
74
+ \`bit export [id...]\` => export the given ids to their current scope
75
+ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`);
83
76
  (0, _defineProperty2().default)(this, "alias", 'e');
77
+ (0, _defineProperty2().default)(this, "helpUrl", 'components/exporting-components');
84
78
  (0, _defineProperty2().default)(this, "options", [['e', 'eject', 'replace the exported components with their corresponding packages (to use these components without further maintaining them)'], ['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', 'EXPERIMENTAL. 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'], ['', 'ignore-missing-artifacts', "EXPERIMENTAL. don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote"], ['j', 'json', 'show output in json format']]);
85
79
  (0, _defineProperty2().default)(this, "loader", true);
86
80
  (0, _defineProperty2().default)(this, "migration", true);
87
81
  (0, _defineProperty2().default)(this, "group", 'collaborate');
88
82
  (0, _defineProperty2().default)(this, "remoteOp", true);
89
- this.extendedDescription = `bit export => export all staged components to their current scope, if checked out to a lane, export the lane as well
90
- \`bit export [id...]\` => export the given ids to their current scope
91
-
92
- https://${docsDomain}/components/exporting-components
93
- ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
94
83
  }
95
84
 
96
85
  async report([ids = []], {
@@ -107,7 +96,7 @@ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
107
96
  missingScope,
108
97
  exportedLanes,
109
98
  ejectResults
110
- } = await (0, _consumer().exportAction)({
99
+ } = await this.exportMain.export({
111
100
  ids,
112
101
  eject,
113
102
  includeNonStaged: all || allVersions,
@@ -157,7 +146,7 @@ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
157
146
  ignoreMissingArtifacts = false,
158
147
  resume
159
148
  }) {
160
- const results = await (0, _consumer().exportAction)({
149
+ const results = await this.exportMain.export({
161
150
  ids,
162
151
  eject,
163
152
  includeNonStaged: all || allVersions,
@@ -1 +1 @@
1
- {"version":3,"names":["ExportCmd","constructor","docsDomain","name","description","extendedDescription","WILDCARD_HELP","report","ids","eject","all","allVersions","originDirectly","ignoreMissingArtifacts","resume","componentsIds","nonExistOnBitMap","missingScope","exportedLanes","ejectResults","exportAction","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';\n\nimport { exportAction } from '@teambit/legacy/dist/api/consumer';\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';\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: string;\n alias = 'e';\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(docsDomain: string) {\n this.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\nhttps://${docsDomain}/components/exporting-components\n${WILDCARD_HELP('export remote-scope')}`;\n }\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 exportAction({\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 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 exportAction({\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":";;;;;;;;;;;;;;;;;;;;;;;AAEA;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;;AAEO,MAAMA,SAAN,CAAmC;EAkDxCC,WAAW,CAACC,UAAD,EAAqB;IAAA,8CAjDzB,gCAiDyB;IAAA,qDAhDlB,uDAgDkB;IAAA,mDA/CpB,CACV;MACEC,IAAI,EAAE,uBADR;MAEEC,WAAW,EACT;IAHJ,CADU,CA+CoB;IAAA;IAAA,+CAvCxB,GAuCwB;IAAA,iDAtCtB,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,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IAAI,CACR,CAACjC,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,MAAM4B,OAAO,GAAG,MAAM,IAAAtB,wBAAA,EAAa;MACjCZ,GADiC;MAEjCC,KAFiC;MAGjCY,gBAAgB,EAAEX,GAAG,IAAIC,WAHQ;MAIjCA,WAAW,EAAEA,WAAW,IAAID,GAJK;MAKjCE,cALiC;MAMjCU,cAAc,EAAER,MANiB;MAOjCD;IAPiC,CAAb,CAAtB;IAUA,OAAO6B,OAAP;EACD;;AA1IuC"}
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,IAA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MAAMoB,MAAM,GAAG,IAAAC,wBAAA,EAAcrB,YAAd,CAAf;MACA,OAAQ,KAAIoB,MAAO,EAAnB;IACD,CAJD;;IAMA,OAAOP,sBAAsB,KAAKK,kBAAkB,EAA7C,GAAkDX,YAAY,EAA9D,GAAmEY,WAAW,EAArF;EACD;;EAES,MAAJG,IAAI,CACR,CAACjC,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,MAAM4B,OAAO,GAAG,MAAM,KAAKvC,UAAL,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,8 +1,33 @@
1
1
  import { CLIMain } from '@teambit/cli';
2
2
  import { ScopeMain } from '@teambit/scope';
3
- import type { CommunityMain } from '@teambit/community';
3
+ import { BitId } from '@teambit/legacy/dist/bit-id';
4
+ import { Lane } from '@teambit/legacy/dist/scope/models';
5
+ import { Workspace } from '@teambit/workspace';
6
+ declare type ExportParams = {
7
+ ids: string[];
8
+ eject: boolean;
9
+ allVersions: boolean;
10
+ originDirectly: boolean;
11
+ includeNonStaged: boolean;
12
+ resumeExportId: string | undefined;
13
+ ignoreMissingArtifacts: boolean;
14
+ };
4
15
  export declare class ExportMain {
16
+ private workspace;
17
+ constructor(workspace: Workspace);
18
+ export(params: ExportParams): Promise<{
19
+ componentsIds: BitId[];
20
+ nonExistOnBitMap: BitId[];
21
+ missingScope: BitId[];
22
+ ejectResults: any;
23
+ exportedLanes: Lane[];
24
+ }>;
25
+ private exportComponents;
26
+ private removeFromStagedConfig;
27
+ private getComponentsToExport;
28
+ private getIdsWithFutureScope;
5
29
  static runtime: import("@teambit/harmony").RuntimeDefinition;
6
30
  static dependencies: import("@teambit/harmony").Aspect[];
7
- static provider([cli, scope, community]: [CLIMain, ScopeMain, CommunityMain]): Promise<ExportMain>;
31
+ static provider([cli, scope, workspace]: [CLIMain, ScopeMain, Workspace]): Promise<ExportMain>;
8
32
  }
33
+ export {};
@@ -11,6 +11,16 @@ Object.defineProperty(exports, "__esModule", {
11
11
  });
12
12
  exports.ExportMain = void 0;
13
13
 
14
+ function _objectWithoutProperties2() {
15
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
+
17
+ _objectWithoutProperties2 = function () {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
14
24
  function _defineProperty2() {
15
25
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
26
 
@@ -41,10 +51,200 @@ function _scope() {
41
51
  return data;
42
52
  }
43
53
 
44
- function _community() {
45
- const data = require("@teambit/community");
54
+ function _ramda() {
55
+ const data = _interopRequireDefault(require("ramda"));
56
+
57
+ _ramda = function () {
58
+ return data;
59
+ };
60
+
61
+ return data;
62
+ }
63
+
64
+ function _bitError() {
65
+ const data = require("@teambit/bit-error");
66
+
67
+ _bitError = function () {
68
+ return data;
69
+ };
70
+
71
+ return data;
72
+ }
73
+
74
+ function _analytics() {
75
+ const data = require("@teambit/legacy/dist/analytics/analytics");
76
+
77
+ _analytics = function () {
78
+ return data;
79
+ };
80
+
81
+ return data;
82
+ }
83
+
84
+ function _bitId() {
85
+ const data = require("@teambit/legacy/dist/bit-id");
86
+
87
+ _bitId = function () {
88
+ return data;
89
+ };
90
+
91
+ return data;
92
+ }
93
+
94
+ function _loader() {
95
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/loader"));
96
+
97
+ _loader = function () {
98
+ return data;
99
+ };
100
+
101
+ return data;
102
+ }
103
+
104
+ function _loaderMessages() {
105
+ const data = require("@teambit/legacy/dist/cli/loader/loader-messages");
106
+
107
+ _loaderMessages = function () {
108
+ return data;
109
+ };
110
+
111
+ return data;
112
+ }
113
+
114
+ function _constants() {
115
+ const data = require("@teambit/legacy/dist/constants");
116
+
117
+ _constants = function () {
118
+ return data;
119
+ };
120
+
121
+ return data;
122
+ }
123
+
124
+ function _consumer() {
125
+ const data = require("@teambit/legacy/dist/consumer");
126
+
127
+ _consumer = function () {
128
+ return data;
129
+ };
130
+
131
+ return data;
132
+ }
133
+
134
+ function _ejectComponents() {
135
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component-ops/eject-components"));
136
+
137
+ _ejectComponents = function () {
138
+ return data;
139
+ };
140
+
141
+ return data;
142
+ }
143
+
144
+ function _componentsList() {
145
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/components-list"));
146
+
147
+ _componentsList = function () {
148
+ return data;
149
+ };
150
+
151
+ return data;
152
+ }
153
+
154
+ function _exportLanes() {
155
+ const data = require("@teambit/legacy/dist/consumer/lanes/export-lanes");
156
+
157
+ _exportLanes = function () {
158
+ return data;
159
+ };
160
+
161
+ return data;
162
+ }
163
+
164
+ function _generalError() {
165
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
166
+
167
+ _generalError = function () {
168
+ return data;
169
+ };
170
+
171
+ return data;
172
+ }
173
+
174
+ function _hooks() {
175
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/hooks"));
176
+
177
+ _hooks = function () {
178
+ return data;
179
+ };
180
+
181
+ return data;
182
+ }
183
+
184
+ function _links() {
185
+ const data = require("@teambit/legacy/dist/links");
186
+
187
+ _links = function () {
188
+ return data;
189
+ };
190
+
191
+ return data;
192
+ }
193
+
194
+ function _logger() {
195
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/logger/logger"));
196
+
197
+ _logger = function () {
198
+ return data;
199
+ };
200
+
201
+ return data;
202
+ }
203
+
204
+ function _exportScopeComponents() {
205
+ const data = require("@teambit/legacy/dist/scope/component-ops/export-scope-components");
206
+
207
+ _exportScopeComponents = function () {
208
+ return data;
209
+ };
210
+
211
+ return data;
212
+ }
213
+
214
+ function _hasWildcard() {
215
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/utils/string/has-wildcard"));
46
216
 
47
- _community = function () {
217
+ _hasWildcard = function () {
218
+ return data;
219
+ };
220
+
221
+ return data;
222
+ }
223
+
224
+ function _scope2() {
225
+ const data = require("@teambit/legacy/dist/scope");
226
+
227
+ _scope2 = function () {
228
+ return data;
229
+ };
230
+
231
+ return data;
232
+ }
233
+
234
+ function _workspace() {
235
+ const data = _interopRequireDefault(require("@teambit/workspace"));
236
+
237
+ _workspace = function () {
238
+ return data;
239
+ };
240
+
241
+ return data;
242
+ }
243
+
244
+ function _exceptions() {
245
+ const data = require("@teambit/legacy/dist/consumer/exceptions");
246
+
247
+ _exceptions = function () {
48
248
  return data;
49
249
  };
50
250
 
@@ -81,18 +281,291 @@ function _resumeExportCmd() {
81
281
  return data;
82
282
  }
83
283
 
284
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
285
+
286
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
287
+
288
+ const HooksManagerInstance = _hooks().default.getInstance();
289
+
84
290
  class ExportMain {
85
- static async provider([cli, scope, community]) {
86
- cli.register(new (_resumeExportCmd().ResumeExportCmd)(scope), new (_exportCmd().ExportCmd)(community.getDocsDomain()));
87
- return new ExportMain();
291
+ constructor(workspace) {
292
+ this.workspace = workspace;
293
+ }
294
+
295
+ async export(params) {
296
+ HooksManagerInstance.triggerHook(_constants().PRE_EXPORT_HOOK, params);
297
+ const {
298
+ updatedIds,
299
+ nonExistOnBitMap,
300
+ missingScope,
301
+ exported,
302
+ exportedLanes
303
+ } = await this.exportComponents(params);
304
+ let ejectResults;
305
+ if (params.eject) ejectResults = await ejectExportedComponents(updatedIds);
306
+ const exportResults = {
307
+ componentsIds: exported,
308
+ nonExistOnBitMap,
309
+ missingScope,
310
+ ejectResults,
311
+ exportedLanes
312
+ };
313
+ HooksManagerInstance.triggerHook(_constants().POST_EXPORT_HOOK, exportResults);
314
+
315
+ if (_scope2().Scope.onPostExport) {
316
+ await _scope2().Scope.onPostExport(exported, exportedLanes).catch(err => {
317
+ _logger().default.error('fatal: onPostExport encountered an error (this error does not stop the process)', err);
318
+ });
319
+ }
320
+
321
+ return exportResults;
322
+ }
323
+
324
+ async exportComponents(_ref) {
325
+ let {
326
+ ids,
327
+ includeNonStaged,
328
+ originDirectly
329
+ } = _ref,
330
+ params = (0, _objectWithoutProperties2().default)(_ref, ["ids", "includeNonStaged", "originDirectly"]);
331
+ if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
332
+ const consumer = this.workspace.consumer;
333
+ const {
334
+ idsToExport,
335
+ missingScope,
336
+ idsWithFutureScope,
337
+ laneObject
338
+ } = await this.getComponentsToExport(ids, includeNonStaged);
339
+
340
+ if (_ramda().default.isEmpty(idsToExport)) {
341
+ return {
342
+ updatedIds: [],
343
+ nonExistOnBitMap: [],
344
+ missingScope,
345
+ exported: [],
346
+ newIdsOnRemote: [],
347
+ exportedLanes: []
348
+ };
349
+ } // validate lane readme component and ensure it has been snapped
350
+
351
+
352
+ if (laneObject !== null && laneObject !== void 0 && laneObject.readmeComponent) {
353
+ _throwForUnsnappedLaneReadme(laneObject);
354
+ }
355
+
356
+ const isOnMain = consumer.isOnMain();
357
+ const {
358
+ exported,
359
+ updatedLocally,
360
+ newIdsOnRemote
361
+ } = await (0, _exportScopeComponents().exportMany)(_objectSpread(_objectSpread({}, params), {}, {
362
+ scope: consumer.scope,
363
+ ids: idsToExport,
364
+ laneObject,
365
+ originDirectly,
366
+ idsWithFutureScope,
367
+ isOnMain
368
+ }));
369
+ if (laneObject) await (0, _exportLanes().updateLanesAfterExport)(consumer, laneObject);
370
+
371
+ const {
372
+ updatedIds,
373
+ nonExistOnBitMap
374
+ } = _updateIdsOnBitMap(consumer.bitMap, updatedLocally);
375
+
376
+ await this.removeFromStagedConfig(updatedIds);
377
+ await linkComponents(updatedIds, consumer);
378
+
379
+ _analytics().Analytics.setExtraData('num_components', exported.length); // it is important to have consumer.onDestroy() before running the eject operation, we want the
380
+ // export and eject operations to function independently. we don't want to lose the changes to
381
+ // .bitmap file done by the export action in case the eject action has failed.
382
+
383
+
384
+ await consumer.onDestroy();
385
+ return {
386
+ updatedIds,
387
+ nonExistOnBitMap,
388
+ missingScope,
389
+ exported,
390
+ newIdsOnRemote,
391
+ exportedLanes: laneObject ? [laneObject] : []
392
+ };
393
+ }
394
+
395
+ async removeFromStagedConfig(ids) {
396
+ const componentIds = await this.workspace.resolveMultipleComponentIds(ids);
397
+ const stagedConfig = await this.workspace.scope.getStagedConfig();
398
+ componentIds.map(compId => stagedConfig.removeComponentConfig(compId));
399
+ await stagedConfig.write();
400
+ }
401
+
402
+ async getComponentsToExport(ids, includeNonStaged) {
403
+ const consumer = this.workspace.consumer;
404
+ const componentsList = new (_componentsList().default)(consumer);
405
+ const idsHaveWildcard = (0, _hasWildcard().default)(ids);
406
+
407
+ const filterNonScopeIfNeeded = async bitIds => {
408
+ const idsWithFutureScope = await this.getIdsWithFutureScope(bitIds);
409
+
410
+ const [idsToExport, missingScope] = _ramda().default.partition(id => {
411
+ const idWithFutureScope = idsWithFutureScope.searchWithoutScopeAndVersion(id);
412
+ if (!idWithFutureScope) throw new Error(`idsWithFutureScope is missing ${id.toString()}`);
413
+ return idWithFutureScope.hasScope();
414
+ }, bitIds);
415
+
416
+ return {
417
+ idsToExport: _bitId().BitIds.fromArray(idsToExport),
418
+ missingScope,
419
+ idsWithFutureScope
420
+ };
421
+ };
422
+
423
+ if ((0, _exportLanes().isUserTryingToExportLanes)(consumer)) {
424
+ if (ids.length) {
425
+ throw new (_generalError().default)(`when checked out to a lane, all its components are exported. please omit the ids`);
426
+ }
427
+
428
+ const {
429
+ componentsToExport,
430
+ laneObject
431
+ } = await (0, _exportLanes().getLaneCompIdsToExport)(consumer, includeNonStaged);
432
+ const loaderMsg = componentsToExport.length > 1 ? _loaderMessages().BEFORE_EXPORTS : _loaderMessages().BEFORE_EXPORT;
433
+
434
+ _loader().default.start(loaderMsg);
435
+
436
+ const filtered = await filterNonScopeIfNeeded(componentsToExport);
437
+ return _objectSpread(_objectSpread({}, filtered), {}, {
438
+ laneObject
439
+ });
440
+ }
441
+
442
+ if (!ids.length || idsHaveWildcard) {
443
+ _loader().default.start(_loaderMessages().BEFORE_LOADING_COMPONENTS);
444
+
445
+ const exportPendingComponents = includeNonStaged ? await componentsList.listNonNewComponentsIds() : await componentsList.listExportPendingComponentsIds();
446
+ const componentsToExport = idsHaveWildcard ? _componentsList().default.filterComponentsByWildcard(exportPendingComponents, ids) : exportPendingComponents;
447
+ const loaderMsg = componentsToExport.length > 1 ? _loaderMessages().BEFORE_EXPORTS : _loaderMessages().BEFORE_EXPORT;
448
+
449
+ _loader().default.start(loaderMsg);
450
+
451
+ return filterNonScopeIfNeeded(componentsToExport);
452
+ }
453
+
454
+ _loader().default.start(_loaderMessages().BEFORE_EXPORT); // show single export
455
+
456
+
457
+ const parsedIds = await Promise.all(ids.map(id => getParsedId(consumer, id)));
458
+ const statuses = await consumer.getManyComponentsStatuses(parsedIds);
459
+ statuses.forEach(({
460
+ id,
461
+ status
462
+ }) => {
463
+ if (status.nested) {
464
+ throw new (_generalError().default)(`unable to export "${id.toString()}", the component is not fully available. please use "bit import" first`);
465
+ }
466
+ });
467
+ return filterNonScopeIfNeeded(_bitId().BitIds.fromArray(parsedIds));
468
+ }
469
+
470
+ async getIdsWithFutureScope(ids) {
471
+ const idsArrayP = ids.map(async id => {
472
+ if (id.hasScope()) return id;
473
+ const componentId = await this.workspace.resolveComponentId(id);
474
+ const finalScope = await this.workspace.componentDefaultScope(componentId);
475
+
476
+ if (finalScope) {
477
+ return id.changeScope(finalScope);
478
+ }
479
+
480
+ return id;
481
+ });
482
+ const idsArray = await Promise.all(idsArrayP);
483
+ return _bitId().BitIds.fromArray(idsArray);
484
+ }
485
+
486
+ static async provider([cli, scope, workspace]) {
487
+ const exportMain = new ExportMain(workspace);
488
+ cli.register(new (_resumeExportCmd().ResumeExportCmd)(scope), new (_exportCmd().ExportCmd)(exportMain));
489
+ return exportMain;
88
490
  }
89
491
 
90
492
  }
91
493
 
92
494
  exports.ExportMain = ExportMain;
93
495
  (0, _defineProperty2().default)(ExportMain, "runtime", _cli().MainRuntime);
94
- (0, _defineProperty2().default)(ExportMain, "dependencies", [_cli().CLIAspect, _scope().default, _community().CommunityAspect]);
496
+ (0, _defineProperty2().default)(ExportMain, "dependencies", [_cli().CLIAspect, _scope().default, _workspace().default]);
95
497
 
96
498
  _export().ExportAspect.addRuntime(ExportMain);
97
499
 
500
+ function _updateIdsOnBitMap(bitMap, componentsIds) {
501
+ const updatedIds = [];
502
+ const nonExistOnBitMap = new (_bitId().BitIds)();
503
+ componentsIds.forEach(componentsId => {
504
+ const resultId = bitMap.updateComponentId(componentsId, true); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
505
+
506
+ if (resultId.hasVersion()) updatedIds.push(resultId);else nonExistOnBitMap.push(resultId);
507
+ });
508
+ return {
509
+ updatedIds,
510
+ nonExistOnBitMap
511
+ };
512
+ }
513
+
514
+ async function getParsedId(consumer, id) {
515
+ // reason why not calling `consumer.getParsedId()` first is because a component might not be on
516
+ // .bitmap and only in the scope. we support this case and enable to export
517
+ const parsedId = await consumer.scope.getParsedId(id);
518
+ if (parsedId.hasScope()) return parsedId; // parsing id from the scope, doesn't provide the scope-name in case it's missing, in this case
519
+ // get the id including the scope from the consumer.
520
+
521
+ try {
522
+ return consumer.getParsedId(id);
523
+ } catch (err) {
524
+ // not in the consumer, just return the one parsed without the scope name
525
+ return parsedId;
526
+ }
527
+ }
528
+
529
+ async function linkComponents(ids, consumer) {
530
+ // we don't have much of a choice here, we have to load all the exported components in order to link them
531
+ // some of the components might be authored, some might be imported.
532
+ // when a component has dists, we need the consumer-component object to retrieve the dists info.
533
+ const components = await Promise.all(ids.map(id => consumer.loadComponentFromModel(id)));
534
+ const nodeModuleLinker = new (_links().NodeModuleLinker)(components, consumer, consumer.bitMap);
535
+ await nodeModuleLinker.link();
536
+ }
537
+
538
+ async function ejectExportedComponents(componentsIds) {
539
+ const consumer = await (0, _consumer().loadConsumer)(undefined, true);
540
+ let ejectResults;
541
+
542
+ try {
543
+ const ejectComponents = new (_ejectComponents().default)(consumer, componentsIds);
544
+ ejectResults = await ejectComponents.eject();
545
+ } catch (err) {
546
+ const ejectErr = `The components ${componentsIds.map(c => c.toString()).join(', ')} were exported successfully.
547
+ However, the eject operation has failed due to an error: ${err.msg || err}`;
548
+
549
+ _logger().default.error(ejectErr, err);
550
+
551
+ throw new Error(ejectErr);
552
+ } // run the consumer.onDestroy() again, to write the changes done by the eject action to .bitmap
553
+
554
+
555
+ await consumer.onDestroy();
556
+ return ejectResults;
557
+ }
558
+
559
+ function _throwForUnsnappedLaneReadme(lane) {
560
+ var _lane$getComponentHea;
561
+
562
+ const readmeComponent = lane.readmeComponent;
563
+ const isValid = (readmeComponent === null || readmeComponent === void 0 ? void 0 : readmeComponent.head) && lane.getComponent(readmeComponent.id) && ((_lane$getComponentHea = lane.getComponentHead(readmeComponent.id)) === null || _lane$getComponentHea === void 0 ? void 0 : _lane$getComponentHea.isEqual(readmeComponent === null || readmeComponent === void 0 ? void 0 : readmeComponent.head));
564
+
565
+ if (!isValid) {
566
+ throw new (_bitError().BitError)(`${lane === null || lane === void 0 ? void 0 : lane.name} has a readme component ${readmeComponent.id} that hasn't been snapped on the lane.
567
+ Please run either snap -a or snap ${readmeComponent.id} to snap the component on the lane before exporting it.`);
568
+ }
569
+ }
570
+
98
571
  //# sourceMappingURL=export.main.runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ExportMain","provider","cli","scope","community","register","ResumeExportCmd","ExportCmd","getDocsDomain","MainRuntime","CLIAspect","ScopeAspect","CommunityAspect","ExportAspect","addRuntime"],"sources":["export.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\n\nimport { ExportAspect } from './export.aspect';\nimport { ExportCmd } from './export-cmd';\nimport { ResumeExportCmd } from './resume-export-cmd';\n\nexport class ExportMain {\n static runtime = MainRuntime;\n\n static dependencies = [CLIAspect, ScopeAspect, CommunityAspect];\n\n static async provider([cli, scope, community]: [CLIMain, ScopeMain, CommunityMain]) {\n cli.register(new ResumeExportCmd(scope), new ExportCmd(community.getDocsDomain()));\n\n return new ExportMain();\n }\n}\n\nExportAspect.addRuntime(ExportMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,UAAN,CAAiB;EAKD,aAARC,QAAQ,CAAC,CAACC,GAAD,EAAMC,KAAN,EAAaC,SAAb,CAAD,EAA+D;IAClFF,GAAG,CAACG,QAAJ,CAAa,KAAIC,kCAAJ,EAAoBH,KAApB,CAAb,EAAyC,KAAII,sBAAJ,EAAcH,SAAS,CAACI,aAAV,EAAd,CAAzC;IAEA,OAAO,IAAIR,UAAJ,EAAP;EACD;;AATqB;;;gCAAXA,U,aACMS,kB;gCADNT,U,kBAGW,CAACU,gBAAD,EAAYC,gBAAZ,EAAyBC,4BAAzB,C;;AASxBC,sBAAA,CAAaC,UAAb,CAAwBd,UAAxB"}
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;;EAA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BAAA,CAAOC,KAAP,CAAa8G,QAAb,EAAuBhH,GAAvB;;IACA,MAAM,IAAIiD,KAAJ,CAAU+D,QAAV,CAAN;EACD,CAX0E,CAY3E;;;EACA,MAAMzG,QAAQ,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"}
package/package.json CHANGED
@@ -1,22 +1,24 @@
1
1
  {
2
2
  "name": "@teambit/export",
3
- "version": "0.0.825",
3
+ "version": "0.0.828",
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.825"
9
+ "version": "0.0.828"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
13
13
  "lodash": "4.17.21",
14
+ "ramda": "0.27.1",
14
15
  "@babel/runtime": "7.12.18",
15
16
  "core-js": "^3.0.0",
16
17
  "@teambit/harmony": "0.3.3",
17
- "@teambit/cli": "0.0.553",
18
- "@teambit/community": "0.0.101",
19
- "@teambit/scope": "0.0.825"
18
+ "@teambit/cli": "0.0.555",
19
+ "@teambit/bit-error": "0.0.394",
20
+ "@teambit/scope": "0.0.828",
21
+ "@teambit/workspace": "0.0.828"
20
22
  },
21
23
  "devDependencies": {
22
24
  "@types/lodash": "4.14.165",
@@ -28,7 +30,7 @@
28
30
  "@types/node": "12.20.4"
29
31
  },
30
32
  "peerDependencies": {
31
- "@teambit/legacy": "1.0.336",
33
+ "@teambit/legacy": "1.0.338",
32
34
  "react-dom": "^16.8.0 || ^17.0.0",
33
35
  "react": "^16.8.0 || ^17.0.0"
34
36
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.825/dist/export.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.825/dist/export.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.828/dist/export.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.828/dist/export.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];