@teambit/export 0.0.770 → 0.0.773

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.
@@ -14,8 +14,8 @@ export declare class ExportCmd implements Command {
14
14
  group: string;
15
15
  remoteOp: boolean;
16
16
  constructor(docsDomain: string);
17
- report([remote, ids]: [string, string[]], { eject, includeDependencies, setCurrentScope, all, allVersions, originDirectly, force, rewire, ignoreMissingArtifacts, resume, }: any): Promise<string>;
18
- json([remote, ids]: [string, string[]], { eject, includeDependencies, setCurrentScope, all, allVersions, originDirectly, force, rewire, ignoreMissingArtifacts, resume, }: any): Promise<{
17
+ report([ids]: [string[]], { eject, all, allVersions, originDirectly, ignoreMissingArtifacts, resume, }: any): Promise<string>;
18
+ json([ids]: [string[]], { eject, all, allVersions, originDirectly, ignoreMissingArtifacts, resume, }: any): Promise<{
19
19
  componentsIds: import("@teambit/legacy/dist/bit-id").BitId[];
20
20
  nonExistOnBitMap: import("@teambit/legacy/dist/bit-id").BitId[];
21
21
  missingScope: import("@teambit/legacy/dist/bit-id").BitId[];
@@ -51,16 +51,6 @@ function _constants() {
51
51
  return data;
52
52
  }
53
53
 
54
- function _generalError() {
55
- const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
56
-
57
- _generalError = function () {
58
- return data;
59
- };
60
-
61
- return data;
62
- }
63
-
64
54
  function _chalk() {
65
55
  const data = _interopRequireDefault(require("chalk"));
66
56
 
@@ -83,18 +73,15 @@ function _lodash() {
83
73
 
84
74
  class ExportCmd {
85
75
  constructor(docsDomain) {
86
- (0, _defineProperty2().default)(this, "name", 'export [remote] [component-names...]');
76
+ (0, _defineProperty2().default)(this, "name", 'export [component-names...]');
87
77
  (0, _defineProperty2().default)(this, "description", 'export components from the workspace to remote scopes');
88
78
  (0, _defineProperty2().default)(this, "arguments", [{
89
- name: 'remote',
90
- description: 'LEGACY ONLY.'
91
- }, {
92
79
  name: 'component-names...',
93
80
  description: 'a list of component names or component IDs (separated by space). By default, all new component versions are exported.'
94
81
  }]);
95
82
  (0, _defineProperty2().default)(this, "extendedDescription", void 0);
96
83
  (0, _defineProperty2().default)(this, "alias", 'e');
97
- (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'], ['d', 'include-dependencies', "LEGACY ONLY. include the component's dependencies as part of the export to the remote scope"], ['s', 'set-current-scope', "LEGACY ONLY. ensure the component's remote scope is set according to the target location"], ['r', 'rewire', 'LEGACY ONLY. when exporting to a different or new scope, replace import/require statements in the source code to match the new scope'], ['f', 'force', 'force changing a component remote without asking for a confirmation'], ['', 'all-versions', 'export not only staged versions but all of them'], ['', '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']]);
84
+ (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'], ['', 'all-versions', 'export not only staged versions but all of them'], ['', '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']]);
98
85
  (0, _defineProperty2().default)(this, "loader", true);
99
86
  (0, _defineProperty2().default)(this, "migration", true);
100
87
  (0, _defineProperty2().default)(this, "group", 'collaborate');
@@ -106,28 +93,14 @@ https://${docsDomain}/components/exporting-components
106
93
  ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
107
94
  }
108
95
 
109
- async report([remote, ids = []], {
96
+ async report([ids = []], {
110
97
  eject = false,
111
- includeDependencies = false,
112
- setCurrentScope = false,
113
98
  all = false,
114
99
  allVersions = false,
115
100
  originDirectly = false,
116
- force = false,
117
- rewire = false,
118
101
  ignoreMissingArtifacts = false,
119
102
  resume
120
103
  }) {
121
- const currentScope = !remote || remote === _constants().CURRENT_UPSTREAM;
122
-
123
- if (currentScope && remote) {
124
- remote = '';
125
- }
126
-
127
- if (includeDependencies && !remote) {
128
- throw new (_generalError().default)('to use --includeDependencies, please specify a remote (the default remote gets already the dependencies)');
129
- }
130
-
131
104
  const {
132
105
  componentsIds,
133
106
  nonExistOnBitMap,
@@ -136,15 +109,10 @@ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
136
109
  ejectResults
137
110
  } = await (0, _consumer().exportAction)({
138
111
  ids,
139
- remote,
140
112
  eject,
141
- includeDependencies,
142
- setCurrentScope,
143
113
  includeNonStaged: all || allVersions,
144
114
  allVersions: allVersions || all,
145
115
  originDirectly,
146
- codemod: rewire,
147
- force,
148
116
  resumeExportId: resume,
149
117
  ignoreMissingArtifacts
150
118
  });
@@ -156,13 +124,12 @@ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
156
124
  const exportOutput = () => {
157
125
  if ((0, _lodash().isEmpty)(componentsIds)) return '';
158
126
  const lanesOutput = exportedLanes.length ? ` from lane ${_chalk().default.bold(exportedLanes[0].name)}` : '';
159
- if (remote) return _chalk().default.green(`exported ${componentsIds.length} components${lanesOutput} to scope ${_chalk().default.bold(remote)}`);
160
127
  return _chalk().default.green(`exported the following ${componentsIds.length} component(s)${lanesOutput}:\n${_chalk().default.bold(componentsIds.join('\n'))}`);
161
128
  };
162
129
 
163
130
  const nonExistOnBitMapOutput = () => {
164
131
  // if includeDependencies is true, the nonExistOnBitMap might be the dependencies
165
- if ((0, _lodash().isEmpty)(nonExistOnBitMap) || includeDependencies) return '';
132
+ if ((0, _lodash().isEmpty)(nonExistOnBitMap)) return '';
166
133
  const idsStr = nonExistOnBitMap.map(id => id.toString()).join(', ');
167
134
  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`);
168
135
  };
@@ -182,39 +149,20 @@ ${(0, _constants().WILDCARD_HELP)('export remote-scope')}`;
182
149
  return nonExistOnBitMapOutput() + missingScopeOutput() + exportOutput() + ejectOutput();
183
150
  }
184
151
 
185
- async json([remote, ids = []], {
152
+ async json([ids = []], {
186
153
  eject = false,
187
- includeDependencies = false,
188
- setCurrentScope = false,
189
154
  all = false,
190
155
  allVersions = false,
191
156
  originDirectly = false,
192
- force = false,
193
- rewire = false,
194
157
  ignoreMissingArtifacts = false,
195
158
  resume
196
159
  }) {
197
- const currentScope = !remote || remote === _constants().CURRENT_UPSTREAM;
198
-
199
- if (currentScope && remote) {
200
- remote = '';
201
- }
202
-
203
- if (includeDependencies && !remote) {
204
- throw new (_generalError().default)('to use --includeDependencies, please specify a remote (the default remote gets already the dependencies)');
205
- }
206
-
207
160
  const results = await (0, _consumer().exportAction)({
208
161
  ids,
209
- remote,
210
162
  eject,
211
- includeDependencies,
212
- setCurrentScope,
213
163
  includeNonStaged: all || allVersions,
214
164
  allVersions: allVersions || all,
215
165
  originDirectly,
216
- codemod: rewire,
217
- force,
218
166
  resumeExportId: resume,
219
167
  ignoreMissingArtifacts
220
168
  });
@@ -1 +1 @@
1
- {"version":3,"names":["ExportCmd","constructor","docsDomain","name","description","extendedDescription","WILDCARD_HELP","report","remote","ids","eject","includeDependencies","setCurrentScope","all","allVersions","originDirectly","force","rewire","ignoreMissingArtifacts","resume","currentScope","CURRENT_UPSTREAM","GeneralError","componentsIds","nonExistOnBitMap","missingScope","exportedLanes","ejectResults","exportAction","includeNonStaged","codemod","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 { CURRENT_UPSTREAM, WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\n\nexport class ExportCmd implements Command {\n name = 'export [remote] [component-names...]';\n description = 'export components from the workspace to remote scopes';\n arguments = [\n { name: 'remote', description: 'LEGACY ONLY.' },\n {\n name: 'component-names...',\n description:\n 'a list of component names or component IDs (separated by space). By default, all new component versions are exported.',\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 ['a', 'all', 'export all components, including non-staged'],\n [\n 'd',\n 'include-dependencies',\n \"LEGACY ONLY. include the component's dependencies as part of the export to the remote scope\",\n ],\n [\n 's',\n 'set-current-scope',\n \"LEGACY ONLY. ensure the component's remote scope is set according to the target location\",\n ],\n [\n 'r',\n 'rewire',\n 'LEGACY ONLY. when exporting to a different or new scope, replace import/require statements in the source code to match the new scope',\n ],\n ['f', 'force', 'force changing a component remote without asking for a confirmation'],\n ['', 'all-versions', 'export not only staged versions but all of them'],\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 [remote, ids = []]: [string, string[]],\n {\n eject = false,\n includeDependencies = false,\n setCurrentScope = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n force = false,\n rewire = false,\n ignoreMissingArtifacts = false,\n resume,\n }: any\n ): Promise<string> {\n const currentScope = !remote || remote === CURRENT_UPSTREAM;\n if (currentScope && remote) {\n remote = '';\n }\n if (includeDependencies && !remote) {\n throw new GeneralError(\n 'to use --includeDependencies, please specify a remote (the default remote gets already the dependencies)'\n );\n }\n const { componentsIds, nonExistOnBitMap, missingScope, exportedLanes, ejectResults } = await exportAction({\n ids,\n remote,\n eject,\n includeDependencies,\n setCurrentScope,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n codemod: rewire,\n force,\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 if (remote)\n return chalk.green(`exported ${componentsIds.length} components${lanesOutput} to scope ${chalk.bold(remote)}`);\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) || includeDependencies) 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 [remote, ids = []]: [string, string[]],\n {\n eject = false,\n includeDependencies = false,\n setCurrentScope = false,\n all = false,\n allVersions = false,\n originDirectly = false,\n force = false,\n rewire = false,\n ignoreMissingArtifacts = false,\n resume,\n }: any\n ) {\n const currentScope = !remote || remote === CURRENT_UPSTREAM;\n if (currentScope && remote) {\n remote = '';\n }\n if (includeDependencies && !remote) {\n throw new GeneralError(\n 'to use --includeDependencies, please specify a remote (the default remote gets already the dependencies)'\n );\n }\n const results = await exportAction({\n ids,\n remote,\n eject,\n includeDependencies,\n setCurrentScope,\n includeNonStaged: all || allVersions,\n allVersions: allVersions || all,\n originDirectly,\n codemod: rewire,\n force,\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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,SAAN,CAAmC;EA2DxCC,WAAW,CAACC,UAAD,EAAqB;IAAA,8CA1DzB,sCA0DyB;I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AAW,EAArF;EACD;;EAES,MAAJG,IAAI,CACR,CAAC1C,MAAD,EAASC,GAAG,GAAG,EAAf,CADQ,EAER;IACEC,KAAK,GAAG,KADV;IAEEC,mBAAmB,GAAG,KAFxB;IAGEC,eAAe,GAAG,KAHpB;IAIEC,GAAG,GAAG,KAJR;IAKEC,WAAW,GAAG,KALhB;IAMEC,cAAc,GAAG,KANnB;IAOEC,KAAK,GAAG,KAPV;IAQEC,MAAM,GAAG,KARX;IASEC,sBAAsB,GAAG,KAT3B;IAUEC;EAVF,CAFQ,EAcR;IACA,MAAMC,YAAY,GAAG,CAACZ,MAAD,IAAWA,MAAM,KAAKa,6BAA3C;;IACA,IAAID,YAAY,IAAIZ,MAApB,EAA4B;MAC1BA,MAAM,GAAG,EAAT;IACD;;IACD,IAAIG,mBAAmB,IAAI,CAACH,MAA5B,EAAoC;MAClC,MAAM,KAAIc,uBAAJ,EACJ,0GADI,CAAN;IAGD;;IACD,MAAM6B,OAAO,GAAG,MAAM,IAAAvB,wBAAA,EAAa;MACjCnB,GADiC;MAEjCD,MAFiC;MAGjCE,KAHiC;MAIjCC,mBAJiC;MAKjCC,eALiC;MAMjCiB,gBAAgB,EAAEhB,GAAG,IAAIC,WANQ;MAOjCA,WAAW,EAAEA,WAAW,IAAID,GAPK;MAQjCE,cARiC;MASjCe,OAAO,EAAEb,MATwB;MAUjCD,KAViC;MAWjCe,cAAc,EAAEZ,MAXiB;MAYjCD;IAZiC,CAAb,CAAtB;IAeA,OAAOiC,OAAP;EACD;;AAzLuC"}
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-names...]';\n description = 'export components from the workspace to remote scopes';\n arguments = [\n {\n name: 'component-names...',\n description:\n 'a list of component names or component IDs (separated by space). By default, all new component versions are exported.',\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 ['a', 'all', 'export all components, including non-staged'],\n ['', 'all-versions', 'export not only staged versions but all of them'],\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;;EA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AAG,MAAM;MAC/B,IAAI,IAAAd,iBAAA,EAAQN,YAAR,CAAJ,EAA2B,OAAO,EAAP;MAC3B,MAAMgB,MAAM,GAAGhB,YAAY,CAACiB,GAAb,CAAkBC,EAAD,IAAQA,EAAE,CAACC,QAAH,EAAzB,EAAwCL,IAAxC,CAA6C,IAA7C,CAAf;MACA,OAAOP,gBAAA,CAAMC,MAAN,CACJ,iDAAgDD,gBAAA,CAAMK,IAAN,CAC/CI,MAD+C,CAE/C,iGAHG,CAAP;IAKD,CARD;;IASA,MAAMK,WAAW,GAAG,MAAM;MACxB,IAAI,CAACnB,YAAL,EAAmB,OAAO,EAAP;MACnB,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,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;;AAlIuC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/export",
3
- "version": "0.0.770",
3
+ "version": "0.0.773",
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.770"
9
+ "version": "0.0.773"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,9 +14,9 @@
14
14
  "@babel/runtime": "7.12.18",
15
15
  "core-js": "^3.0.0",
16
16
  "@teambit/harmony": "0.3.3",
17
- "@teambit/cli": "0.0.509",
18
- "@teambit/community": "0.0.57",
19
- "@teambit/scope": "0.0.770"
17
+ "@teambit/cli": "0.0.512",
18
+ "@teambit/community": "0.0.60",
19
+ "@teambit/scope": "0.0.773"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/lodash": "4.14.165",
@@ -28,7 +28,7 @@
28
28
  "@types/node": "12.20.4"
29
29
  },
30
30
  "peerDependencies": {
31
- "@teambit/legacy": "1.0.289",
31
+ "@teambit/legacy": "1.0.293",
32
32
  "react-dom": "^16.8.0 || ^17.0.0",
33
33
  "react": "^16.8.0 || ^17.0.0"
34
34
  },
@@ -56,7 +56,7 @@
56
56
  "react": "-"
57
57
  },
58
58
  "peerDependencies": {
59
- "@teambit/legacy": "1.0.289",
59
+ "@teambit/legacy": "1.0.293",
60
60
  "react-dom": "^16.8.0 || ^17.0.0",
61
61
  "react": "^16.8.0 || ^17.0.0"
62
62
  }
@@ -0,0 +1,5 @@
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.773/dist/export.composition.js'
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.773/dist/export.docs.mdx'
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0]
@@ -1,2 +0,0 @@
1
- export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.770/dist/export.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@0.0.770/dist/export.docs.mdx')]