@teambit/importer 1.0.282 → 1.0.284
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_scope_importer-preview.js +1 -1
- package/artifacts/schema.json +3 -3
- package/dist/dependents-getter.js +1 -1
- package/dist/dependents-getter.js.map +1 -1
- package/dist/fetch-cmd.js +2 -2
- package/dist/fetch-cmd.js.map +1 -1
- package/dist/import-components.js +2 -2
- package/dist/import-components.js.map +1 -1
- package/dist/import.cmd.js +2 -2
- package/dist/import.cmd.js.map +1 -1
- package/dist/importer.composition.js +1 -1
- package/dist/importer.composition.js.map +1 -1
- package/dist/importer.main.runtime.js +2 -2
- package/dist/importer.main.runtime.js.map +1 -1
- package/dist/{preview-1716520879631.js → preview-1716693760271.js} +2 -2
- package/package.json +12 -12
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
3
|
-
<testsuite name="teambit.scope/importer@1.0.
|
3
|
+
<testsuite name="teambit.scope/importer@1.0.284" tests="0" failures="0" errors="0" skipped="0"/>
|
4
4
|
</testsuites>
|
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.scope/importer-preview"]=t():e["teambit.scope/importer-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.scope/importer-preview"]=t():e["teambit.scope/importer-preview"]=t()}(self,(()=>(()=>{"use strict";var e={63574:(e,t,o)=>{var r={id:"teambit.scope/importer@1.0.284",homepage:"https://bit.cloud/teambit/scope/importer",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const p=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/import.svg"}));p.__bit_component=r,t.Logo=p},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{compositions:()=>d,compositions_metadata:()=>f,overview:()=>l});var e={};o.r(e),o.d(e,{default:()=>u});var t=o(63574);o(41594);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},a.apply(null,arguments)}var c={},s="wrapper";function u(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||{}.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,p);return(0,n.mdx)(s,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}u.isMDXComponent=!0;const d=[t],l=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
|
package/artifacts/schema.json
CHANGED
@@ -533,7 +533,7 @@
|
|
533
533
|
"_legacy": {
|
534
534
|
"scope": "teambit.scope",
|
535
535
|
"name": "importer",
|
536
|
-
"version": "1.0.
|
536
|
+
"version": "1.0.284"
|
537
537
|
},
|
538
538
|
"_scope": "teambit.scope"
|
539
539
|
}
|
@@ -3074,7 +3074,7 @@
|
|
3074
3074
|
"_legacy": {
|
3075
3075
|
"scope": "teambit.scope",
|
3076
3076
|
"name": "importer",
|
3077
|
-
"version": "1.0.
|
3077
|
+
"version": "1.0.284"
|
3078
3078
|
},
|
3079
3079
|
"_scope": "teambit.scope"
|
3080
3080
|
}
|
@@ -7120,7 +7120,7 @@
|
|
7120
7120
|
"componentId": {
|
7121
7121
|
"scope": "teambit.scope",
|
7122
7122
|
"name": "importer",
|
7123
|
-
"version": "1.0.
|
7123
|
+
"version": "1.0.284"
|
7124
7124
|
},
|
7125
7125
|
"taggedModuleExports": []
|
7126
7126
|
}
|
@@ -46,7 +46,7 @@ function _bitError() {
|
|
46
46
|
};
|
47
47
|
return data;
|
48
48
|
}
|
49
|
-
function _interopRequireDefault(
|
49
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
50
50
|
// @ts-ignore AutoComplete is actually there, the d.ts is probably outdated
|
51
51
|
|
52
52
|
const SHOW_ALL_PATHS_LIMIT = 10;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_yesno","data","_interopRequireDefault","require","_enquirer","_lodash","_chalk","_componentId","_bitError","obj","__esModule","default","SHOW_ALL_PATHS_LIMIT","SCROLL_LIMIT","DependentsGetter","constructor","logger","workspace","graph","options","getDependents","targetCompIds","setStatusLine","silent","dependentsAll","getGraphIds","sourceIds","listIds","getIdsForThrough","dependentsVia","undefined","split","map","idStr","trim","id","ComponentID","fromString","allPaths","findAllPathsFromSourcesToTargets","selectedPaths","promptDependents","uniqAsStrings","uniq","flat","ids","idsToFilterOut","ComponentIdList","fromArray","forEach","hasWithoutVersion","sameIds","filter","idString","startsWith","toStringWithoutVersion","idToImport","length","changeVersion","push","idsStr","toString","debug","clearStatusLine","question","join","ok","yesno","BitError","totalToShow","promptLevelByLevel","firstItems","slice","choices","path","name","value","tooManyPathsMsg","chalk","yellow","result","prompt","footer","indicator","state","choice","enabled","message","cyan","pointer","styles","dark","white","em","bgBlack","whiteBright","success","type","validate","j","down","k","up","names","cancel","Object","values","selectDependents","Error","finalPath","console","getPrompt","level","totalPaths","AutoComplete","limit","dim","header","getLevel","withinPaths","compact","sort","processLevel","paths","previousLevel","pathsWithinThisLevel","nextLevel","consoleSuccess","promptNextLevel","resultNextLevel","run","exports"],"sources":["dependents-getter.ts"],"sourcesContent":["import yesno from 'yesno';\n// @ts-ignore AutoComplete is actually there, the d.ts is probably outdated\nimport { prompt, AutoComplete } from 'enquirer';\nimport { compact, uniq } from 'lodash';\nimport chalk from 'chalk';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { GraphMain } from '@teambit/graph';\nimport { Logger } from '@teambit/logger';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportOptions } from './import-components';\n\nconst SHOW_ALL_PATHS_LIMIT = 10;\nconst SCROLL_LIMIT = 20;\n\nexport class DependentsGetter {\n constructor(\n private logger: Logger,\n private workspace: Workspace,\n private graph: GraphMain,\n private options: ImportOptions\n ) {}\n\n async getDependents(targetCompIds: ComponentID[]): Promise<ComponentID[]> {\n this.logger.setStatusLine('finding dependents');\n const { silent, dependentsAll } = this.options;\n const graph = await this.graph.getGraphIds();\n const sourceIds = this.workspace.listIds();\n const getIdsForThrough = () => {\n if (!this.options.dependentsVia) return undefined;\n return this.options.dependentsVia\n .split(',')\n .map((idStr) => idStr.trim())\n .map((id) => ComponentID.fromString(id));\n };\n const allPaths = graph.findAllPathsFromSourcesToTargets(sourceIds, targetCompIds, getIdsForThrough());\n const selectedPaths = silent || dependentsAll ? allPaths : await this.promptDependents(allPaths);\n const uniqAsStrings = uniq(selectedPaths.flat());\n\n const ids: ComponentID[] = [];\n const idsToFilterOut = ComponentIdList.fromArray([...sourceIds, ...targetCompIds]);\n uniqAsStrings.forEach((idStr) => {\n const id = ComponentID.fromString(idStr);\n if (idsToFilterOut.hasWithoutVersion(id)) return;\n const sameIds = uniqAsStrings.filter((idString) => idString.startsWith(`${id.toStringWithoutVersion()}@`));\n const idToImport = sameIds.length === 1 ? id : id.changeVersion(undefined);\n ids.push(idToImport);\n idsToFilterOut.push(idToImport);\n });\n\n const idsStr = ids.map((id) => id.toString());\n\n this.logger.debug(`found ${ids.length} component for --dependents flag`, idsStr);\n if (!this.options.silent) {\n this.logger.clearStatusLine();\n const question = idsStr.length\n ? `found the following ${ids.length} components for --dependents flag:\\n${idsStr.join('\\n')}`\n : 'unable to find dependents for the given component (probably the workspace components using it directly)';\n const ok = await yesno({\n question: `${question}\\nWould you like to continue with the import? [yes(y)/no(n)]`,\n });\n if (!ok) {\n throw new BitError('import was aborted');\n }\n }\n\n return ids;\n }\n\n private async promptDependents(allPaths: string[][]): Promise<string[][]> {\n if (!allPaths.length) return [];\n this.logger.clearStatusLine();\n\n const totalToShow = SHOW_ALL_PATHS_LIMIT;\n if (allPaths.length > totalToShow) {\n return this.promptLevelByLevel(allPaths);\n }\n const firstItems = allPaths.slice(0, totalToShow);\n const choices = firstItems.map((path) => {\n const name = path.join(' -> ');\n return { name, value: path };\n });\n const tooManyPathsMsg =\n allPaths.length > totalToShow\n ? `${chalk.yellow(\n `\\nfound ${allPaths.length} paths, showing the shortest ${totalToShow}. if the desired path is not shown, use the --dependents-via flag`\n )}`\n : '';\n const result = await prompt<{ selectDependents: Record<string, string[]> }>({\n choices,\n footer: '\\nEnter to start importing. Ctrl+C to cancel.',\n indicator: (state: any, choice: any) => ` ${choice.enabled ? '●' : '○'}`,\n message:\n 'Choose which path to include ' +\n `(Press ${chalk.cyan('<space>')} to select, ` +\n `${chalk.cyan('<a>')} to toggle all, ` +\n `${chalk.cyan('<i>')} to invert selection)${tooManyPathsMsg}`,\n name: 'selectDependents',\n pointer: '❯',\n styles: {\n dark: chalk.white,\n em: chalk.bgBlack.whiteBright,\n success: chalk.white,\n },\n type: 'multiselect',\n validate(value: string[]) {\n if (value.length === 0) {\n return 'You must choose at least one path.';\n }\n return true;\n },\n j() {\n return this.down();\n },\n k() {\n return this.up();\n },\n result(names: string[]) {\n // This is needed in order to have the values of the choices in the answer object.\n // Otherwise, only the names of the selected choices would've been included.\n return this.map(names);\n },\n cancel() {\n // By default, canceling the prompt via Ctrl+c throws an empty string.\n // The custom cancel function prevents that behavior.\n // Otherwise, Bit CLI would print an error and confuse users.\n // See related issue: https://github.com/enquirer/enquirer/issues/225\n },\n } as any);\n\n return Object.values(result.selectDependents);\n }\n\n private async promptLevelByLevel(allPaths: string[][]): Promise<string[][]> {\n if (allPaths.length < SHOW_ALL_PATHS_LIMIT) {\n throw new Error(`expected to have at least ${SHOW_ALL_PATHS_LIMIT} paths`);\n }\n const finalPath: string[] = [];\n this.logger\n .console(`found ${allPaths.length} available paths from the workspace components to the target components.\nthe following prompts will guide you to choose the desired path to import.`);\n\n const getPrompt = (choices: string[], level: number, totalPaths: number) => {\n return new AutoComplete({\n name: 'comp',\n message: `Choose which component to include`,\n limit: SCROLL_LIMIT,\n footer() {\n return choices.length >= SCROLL_LIMIT ? chalk.dim('(Scroll up and down to reveal more choices)') : '';\n },\n header() {\n if (level === 1) return '';\n return `total ${totalPaths} paths left (out of ${allPaths.length})`;\n },\n cancel() {\n // By default, canceling the prompt via Ctrl+c throws an empty string.\n // The custom cancel function prevents that behavior.\n // Otherwise, Bit CLI would print an error and confuse users.\n // See related issue: https://github.com/enquirer/enquirer/issues/225\n },\n choices,\n });\n };\n\n const getLevel = (level: number, withinPaths: string[][]): string[] => {\n return compact(uniq(withinPaths.map((path) => path[level]))).sort();\n };\n\n const processLevel = async (level: number, paths: string[][], previousLevel?: string): Promise<string[]> => {\n const pathsWithinThisLevel = previousLevel ? paths.filter((path) => path[level] === previousLevel) : paths;\n const nextLevel = getLevel(level + 1, pathsWithinThisLevel);\n if (!nextLevel.length) {\n return finalPath;\n }\n if (nextLevel.length === 1) {\n finalPath.push(nextLevel[0]);\n this.logger.consoleSuccess(`${nextLevel[0]} (auto-selected)`);\n return processLevel(level + 1, pathsWithinThisLevel, nextLevel[0]);\n }\n const promptNextLevel = getPrompt(nextLevel, level + 1, pathsWithinThisLevel.length);\n const resultNextLevel = await promptNextLevel.run();\n finalPath.push(resultNextLevel);\n return processLevel(level + 1, pathsWithinThisLevel, resultNextLevel);\n };\n\n const result = await processLevel(0, allPaths);\n\n return [result];\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAO,GAAA,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EAAE;QACrB,OAAOoD,SAAS;MAClB;MACA,IAAIiB,SAAS,CAACrE,MAAM,KAAK,CAAC,EAAE;QAC1BoD,SAAS,CAAClD,IAAI,CAACmE,SAAS,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC9G,MAAM,CAAC+G,cAAc,CAAE,GAAED,SAAS,CAAC,CAAC,CAAE,kBAAiB,CAAC;QAC7D,OAAOJ,YAAY,CAACV,KAAK,GAAG,CAAC,EAAEa,oBAAoB,EAAEC,SAAS,CAAC,CAAC,CAAC,CAAC;MACpE;MACA,MAAME,eAAe,GAAGjB,SAAS,CAACe,SAAS,EAAEd,KAAK,GAAG,CAAC,EAAEa,oBAAoB,CAACpE,MAAM,CAAC;MACpF,MAAMwE,eAAe,GAAG,MAAMD,eAAe,CAACE,GAAG,CAAC,CAAC;MACnDrB,SAAS,CAAClD,IAAI,CAACsE,eAAe,CAAC;MAC/B,OAAOP,YAAY,CAACV,KAAK,GAAG,CAAC,EAAEa,oBAAoB,EAAEI,eAAe,CAAC;IACvE,CAAC;IAED,MAAMjD,MAAM,GAAG,MAAM0C,YAAY,CAAC,CAAC,EAAEpF,QAAQ,CAAC;IAE9C,OAAO,CAAC0C,MAAM,CAAC;EACjB;AACF;AAACmD,OAAA,CAAArH,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_yesno","data","_interopRequireDefault","require","_enquirer","_lodash","_chalk","_componentId","_bitError","e","__esModule","default","SHOW_ALL_PATHS_LIMIT","SCROLL_LIMIT","DependentsGetter","constructor","logger","workspace","graph","options","getDependents","targetCompIds","setStatusLine","silent","dependentsAll","getGraphIds","sourceIds","listIds","getIdsForThrough","dependentsVia","undefined","split","map","idStr","trim","id","ComponentID","fromString","allPaths","findAllPathsFromSourcesToTargets","selectedPaths","promptDependents","uniqAsStrings","uniq","flat","ids","idsToFilterOut","ComponentIdList","fromArray","forEach","hasWithoutVersion","sameIds","filter","idString","startsWith","toStringWithoutVersion","idToImport","length","changeVersion","push","idsStr","toString","debug","clearStatusLine","question","join","ok","yesno","BitError","totalToShow","promptLevelByLevel","firstItems","slice","choices","path","name","value","tooManyPathsMsg","chalk","yellow","result","prompt","footer","indicator","state","choice","enabled","message","cyan","pointer","styles","dark","white","em","bgBlack","whiteBright","success","type","validate","j","down","k","up","names","cancel","Object","values","selectDependents","Error","finalPath","console","getPrompt","level","totalPaths","AutoComplete","limit","dim","header","getLevel","withinPaths","compact","sort","processLevel","paths","previousLevel","pathsWithinThisLevel","nextLevel","consoleSuccess","promptNextLevel","resultNextLevel","run","exports"],"sources":["dependents-getter.ts"],"sourcesContent":["import yesno from 'yesno';\n// @ts-ignore AutoComplete is actually there, the d.ts is probably outdated\nimport { prompt, AutoComplete } from 'enquirer';\nimport { compact, uniq } from 'lodash';\nimport chalk from 'chalk';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { GraphMain } from '@teambit/graph';\nimport { Logger } from '@teambit/logger';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportOptions } from './import-components';\n\nconst SHOW_ALL_PATHS_LIMIT = 10;\nconst SCROLL_LIMIT = 20;\n\nexport class DependentsGetter {\n constructor(\n private logger: Logger,\n private workspace: Workspace,\n private graph: GraphMain,\n private options: ImportOptions\n ) {}\n\n async getDependents(targetCompIds: ComponentID[]): Promise<ComponentID[]> {\n this.logger.setStatusLine('finding dependents');\n const { silent, dependentsAll } = this.options;\n const graph = await this.graph.getGraphIds();\n const sourceIds = this.workspace.listIds();\n const getIdsForThrough = () => {\n if (!this.options.dependentsVia) return undefined;\n return this.options.dependentsVia\n .split(',')\n .map((idStr) => idStr.trim())\n .map((id) => ComponentID.fromString(id));\n };\n const allPaths = graph.findAllPathsFromSourcesToTargets(sourceIds, targetCompIds, getIdsForThrough());\n const selectedPaths = silent || dependentsAll ? allPaths : await this.promptDependents(allPaths);\n const uniqAsStrings = uniq(selectedPaths.flat());\n\n const ids: ComponentID[] = [];\n const idsToFilterOut = ComponentIdList.fromArray([...sourceIds, ...targetCompIds]);\n uniqAsStrings.forEach((idStr) => {\n const id = ComponentID.fromString(idStr);\n if (idsToFilterOut.hasWithoutVersion(id)) return;\n const sameIds = uniqAsStrings.filter((idString) => idString.startsWith(`${id.toStringWithoutVersion()}@`));\n const idToImport = sameIds.length === 1 ? id : id.changeVersion(undefined);\n ids.push(idToImport);\n idsToFilterOut.push(idToImport);\n });\n\n const idsStr = ids.map((id) => id.toString());\n\n this.logger.debug(`found ${ids.length} component for --dependents flag`, idsStr);\n if (!this.options.silent) {\n this.logger.clearStatusLine();\n const question = idsStr.length\n ? `found the following ${ids.length} components for --dependents flag:\\n${idsStr.join('\\n')}`\n : 'unable to find dependents for the given component (probably the workspace components using it directly)';\n const ok = await yesno({\n question: `${question}\\nWould you like to continue with the import? [yes(y)/no(n)]`,\n });\n if (!ok) {\n throw new BitError('import was aborted');\n }\n }\n\n return ids;\n }\n\n private async promptDependents(allPaths: string[][]): Promise<string[][]> {\n if (!allPaths.length) return [];\n this.logger.clearStatusLine();\n\n const totalToShow = SHOW_ALL_PATHS_LIMIT;\n if (allPaths.length > totalToShow) {\n return this.promptLevelByLevel(allPaths);\n }\n const firstItems = allPaths.slice(0, totalToShow);\n const choices = firstItems.map((path) => {\n const name = path.join(' -> ');\n return { name, value: path };\n });\n const tooManyPathsMsg =\n allPaths.length > totalToShow\n ? `${chalk.yellow(\n `\\nfound ${allPaths.length} paths, showing the shortest ${totalToShow}. if the desired path is not shown, use the --dependents-via flag`\n )}`\n : '';\n const result = await prompt<{ selectDependents: Record<string, string[]> }>({\n choices,\n footer: '\\nEnter to start importing. Ctrl+C to cancel.',\n indicator: (state: any, choice: any) => ` ${choice.enabled ? '●' : '○'}`,\n message:\n 'Choose which path to include ' +\n `(Press ${chalk.cyan('<space>')} to select, ` +\n `${chalk.cyan('<a>')} to toggle all, ` +\n `${chalk.cyan('<i>')} to invert selection)${tooManyPathsMsg}`,\n name: 'selectDependents',\n pointer: '❯',\n styles: {\n dark: chalk.white,\n em: chalk.bgBlack.whiteBright,\n success: chalk.white,\n },\n type: 'multiselect',\n validate(value: string[]) {\n if (value.length === 0) {\n return 'You must choose at least one path.';\n }\n return true;\n },\n j() {\n return this.down();\n },\n k() {\n return this.up();\n },\n result(names: string[]) {\n // This is needed in order to have the values of the choices in the answer object.\n // Otherwise, only the names of the selected choices would've been included.\n return this.map(names);\n },\n cancel() {\n // By default, canceling the prompt via Ctrl+c throws an empty string.\n // The custom cancel function prevents that behavior.\n // Otherwise, Bit CLI would print an error and confuse users.\n // See related issue: https://github.com/enquirer/enquirer/issues/225\n },\n } as any);\n\n return Object.values(result.selectDependents);\n }\n\n private async promptLevelByLevel(allPaths: string[][]): Promise<string[][]> {\n if (allPaths.length < SHOW_ALL_PATHS_LIMIT) {\n throw new Error(`expected to have at least ${SHOW_ALL_PATHS_LIMIT} paths`);\n }\n const finalPath: string[] = [];\n this.logger\n .console(`found ${allPaths.length} available paths from the workspace components to the target components.\nthe following prompts will guide you to choose the desired path to import.`);\n\n const getPrompt = (choices: string[], level: number, totalPaths: number) => {\n return new AutoComplete({\n name: 'comp',\n message: `Choose which component to include`,\n limit: SCROLL_LIMIT,\n footer() {\n return choices.length >= SCROLL_LIMIT ? chalk.dim('(Scroll up and down to reveal more choices)') : '';\n },\n header() {\n if (level === 1) return '';\n return `total ${totalPaths} paths left (out of ${allPaths.length})`;\n },\n cancel() {\n // By default, canceling the prompt via Ctrl+c throws an empty string.\n // The custom cancel function prevents that behavior.\n // Otherwise, Bit CLI would print an error and confuse users.\n // See related issue: https://github.com/enquirer/enquirer/issues/225\n },\n choices,\n });\n };\n\n const getLevel = (level: number, withinPaths: string[][]): string[] => {\n return compact(uniq(withinPaths.map((path) => path[level]))).sort();\n };\n\n const processLevel = async (level: number, paths: string[][], previousLevel?: string): Promise<string[]> => {\n const pathsWithinThisLevel = previousLevel ? paths.filter((path) => path[level] === previousLevel) : paths;\n const nextLevel = getLevel(level + 1, pathsWithinThisLevel);\n if (!nextLevel.length) {\n return finalPath;\n }\n if (nextLevel.length === 1) {\n finalPath.push(nextLevel[0]);\n this.logger.consoleSuccess(`${nextLevel[0]} (auto-selected)`);\n return processLevel(level + 1, pathsWithinThisLevel, nextLevel[0]);\n }\n const promptNextLevel = getPrompt(nextLevel, level + 1, pathsWithinThisLevel.length);\n const resultNextLevel = await promptNextLevel.run();\n finalPath.push(resultNextLevel);\n return processLevel(level + 1, pathsWithinThisLevel, resultNextLevel);\n };\n\n const result = await processLevel(0, allPaths);\n\n return [result];\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA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AIiB,SAAS,CAACrE,MAAM,KAAK,CAAC,EAAE;QAC1BoD,SAAS,CAAClD,IAAI,CAACmE,SAAS,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC9G,MAAM,CAAC+G,cAAc,CAAC,GAAGD,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAC7D,OAAOJ,YAAY,CAACV,KAAK,GAAG,CAAC,EAAEa,oBAAoB,EAAEC,SAAS,CAAC,CAAC,CAAC,CAAC;MACpE;MACA,MAAME,eAAe,GAAGjB,SAAS,CAACe,SAAS,EAAEd,KAAK,GAAG,CAAC,EAAEa,oBAAoB,CAACpE,MAAM,CAAC;MACpF,MAAMwE,eAAe,GAAG,MAAMD,eAAe,CAACE,GAAG,CAAC,CAAC;MACnDrB,SAAS,CAAClD,IAAI,CAACsE,eAAe,CAAC;MAC/B,OAAOP,YAAY,CAACV,KAAK,GAAG,CAAC,EAAEa,oBAAoB,EAAEI,eAAe,CAAC;IACvE,CAAC;IAED,MAAMjD,MAAM,GAAG,MAAM0C,YAAY,CAAC,CAAC,EAAEpF,QAAQ,CAAC;IAE9C,OAAO,CAAC0C,MAAM,CAAC;EACjB;AACF;AAACmD,OAAA,CAAArH,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/dist/fetch-cmd.js
CHANGED
@@ -18,8 +18,8 @@ function _mergeVersion() {
|
|
18
18
|
};
|
19
19
|
return data;
|
20
20
|
}
|
21
|
-
function _interopRequireDefault(
|
22
|
-
function _defineProperty(
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
23
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
24
24
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
25
25
|
class FetchCmd {
|
package/dist/fetch-cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_mergeVersion","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_mergeVersion","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","FetchCmd","constructor","importer","report","ids","lanes","components","json","fromOriginalScope","allHistory","importedIds","importDetails","fetch","JSON","stringify","length","title","componentDependencies","map","id","details","find","c","toStringWithoutVersion","Error","toString","formatPlainComponentItemWithVersions","componentDependenciesOutput","chalk","green","concat","join","yellow","exports","bitId","status","versions","usedVersion","version","getConflictMessage","filesStatus","conflictedFiles","keys","filter","file","FileStatus","manual","bold","deprecated","missingDeps","red","d","cyan"],"sources":["fetch-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { FileStatus } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport type { ImporterMain } from './importer.main.runtime';\nimport { ImportDetails, ImportStatus } from './import-components';\n\nexport class FetchCmd implements Command {\n name = 'fetch [ids...]';\n description = `fetch remote objects and store locally`;\n extendedDescription = `for lanes, use \"/\" as a separator between the remote and the lane name, e.g. teambit.ui/fix-button`;\n alias = '';\n private = true;\n options = [\n [\n 'l',\n 'lanes',\n 'fetch component objects from lanes. note, it does not save the remote lanes objects locally, only the refs',\n ],\n ['c', 'components', 'fetch components'],\n ['', 'all-history', 'for each component, fetch all its versions. by default, only the latest version is fetched'],\n ['j', 'json', 'return the output as JSON'],\n [\n '',\n 'from-original-scopes',\n 'fetch indirect dependencies from their original scope as opposed to from their dependents',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private importer: ImporterMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n lanes = false,\n components = false,\n json = false,\n fromOriginalScope = false,\n allHistory = false,\n }: {\n lanes?: boolean;\n components?: boolean;\n json?: boolean;\n fromOriginalScope?: boolean;\n allHistory?: boolean;\n }\n ) {\n const { importedIds, importDetails } = await this.importer.fetch(\n ids,\n lanes,\n components,\n fromOriginalScope,\n allHistory\n );\n if (json) {\n return JSON.stringify({ importDetails }, null, 4);\n }\n if (importedIds.length) {\n const title =\n importedIds.length === 1\n ? 'successfully fetched one component'\n : `successfully fetched ${importedIds.length} components`;\n const componentDependencies = importedIds.map((id) => {\n const details = importDetails.find((c) => c.id === id.toStringWithoutVersion());\n if (!details) throw new Error(`missing details for component ${id.toString()}`);\n return formatPlainComponentItemWithVersions(id, details);\n });\n const componentDependenciesOutput = [chalk.green(title)].concat(componentDependencies).join('\\n');\n\n return componentDependenciesOutput;\n }\n return chalk.yellow('nothing to import');\n }\n}\n\nfunction formatPlainComponentItemWithVersions(bitId: ComponentID, importDetails: ImportDetails) {\n const status: ImportStatus = importDetails.status;\n const id = bitId.toStringWithoutVersion();\n const versions = importDetails.versions.length ? `new versions: ${importDetails.versions.join(', ')}` : '';\n const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';\n const getConflictMessage = () => {\n if (!importDetails.filesStatus) return '';\n const conflictedFiles = Object.keys(importDetails.filesStatus) // $FlowFixMe file is set\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n .filter((file) => importDetails.filesStatus[file] === FileStatus.manual);\n if (!conflictedFiles.length) return '';\n return `(the following files were saved with conflicts ${conflictedFiles\n .map((file) => chalk.bold(file))\n .join(', ')}) `;\n };\n const deprecated = importDetails.deprecated ? chalk.yellow('deprecated') : '';\n const missingDeps = importDetails.missingDeps.length\n ? chalk.red(`missing dependencies: ${importDetails.missingDeps.map((d) => d.toString()).join(', ')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I,IAAI,CAAC,KAAKC,0BAAU,CAACC,MAAM,CAAC;IAC1E,IAAI,CAACL,eAAe,CAAC1B,MAAM,EAAE,OAAO,EAAE;IACtC,OAAO,kDAAkD0B,eAAe,CACrEvB,GAAG,CAAE0B,IAAI,IAAKhB,gBAAK,CAACmB,IAAI,CAACH,IAAI,CAAC,CAAC,CAC/Bb,IAAI,CAAC,IAAI,CAAC,IAAI;EACnB,CAAC;EACD,MAAMiB,UAAU,GAAGrC,aAAa,CAACqC,UAAU,GAAGpB,gBAAK,CAACI,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE;EAC7E,MAAMiB,WAAW,GAAGtC,aAAa,CAACsC,WAAW,CAAClC,MAAM,GAChDa,gBAAK,CAACsB,GAAG,CAAC,yBAAyBvC,aAAa,CAACsC,WAAW,CAAC/B,GAAG,CAAEiC,CAAC,IAAKA,CAAC,CAAC1B,QAAQ,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GACnG,EAAE;EACN,OAAO,KAAKH,gBAAK,CAACC,KAAK,CAACM,MAAM,CAAC,IAAIP,gBAAK,CAACwB,IAAI,CAC3CjC,EACF,CAAC,IAAIiB,QAAQ,GAAGC,WAAW,IAAIE,kBAAkB,CAAC,CAAC,GAAGS,UAAU,IAAIC,WAAW,EAAE;AACnF","ignoreList":[]}
|
@@ -109,8 +109,8 @@ function _dependentsGetter() {
|
|
109
109
|
};
|
110
110
|
return data;
|
111
111
|
}
|
112
|
-
function _interopRequireDefault(
|
113
|
-
function _defineProperty(
|
112
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
113
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
114
114
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
115
115
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
116
116
|
class ImportComponents {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","_pMapSeries","_interopRequireDefault","_listScope","_componentId","_loaderMessages","_utils","_hasWildcard","_checkout","_mergeVersion","_componentsPendingMerge","_scopeComponentsImporter","_versionDependencies","_componentVersion","_lodash","_dependentsGetter","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ImportComponents","constructor","workspace","graph","componentWriter","envs","logger","options","consumer","scope","remoteLane","lanes","importComponents","result","setStatusLine","BEFORE_IMPORT_ACTION","startTime","process","hrtime","ids","length","importObjectsOnLane","consoleSuccess","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","bitIds","getBitIds","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAndSaveLaneObject","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","keys","importedComps","map","c","component","toStringWithoutVersion","forEach","compIdStr","found","includes","push","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","workspaceConfigUpdateResult","join","_throwForPotentialIssues","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","throwForComponentsFromAnotherLane","filteredComponents","_filterComponentsByFilters","_writeToFileSystem","_saveLaneDataIfNeeded","mergeLaneResults","sources","mergeLane","mergedLane","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","filterEnvs","filteredP","currentEnv","calculateEnvIdFromExtensions","extensions","currentEnvWithoutVersion","split","undefined","filtered","compact","Promise","all","modelComponent","getModelComponent","setDivergeData","divergeData","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","currentLaneId","getCurrentLaneId","currentRemoteLane","toLaneId","currentLane","getCurrentLaneObject","idsFromAnotherLane","bitId","isOnCurrentLane","isPartOfLaneHistory","isPartOfMainHistory","isIdOnMain","BitError","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importWithoutDeps","toVersionLatest","cache","includeVersionHistory","fetchHeadIfLocalIsBehind","allHistory","collectParents","includeUnexported","isLaneFromRemote","reason","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","remoteLaneIds","toComponentIds","ComponentIdList","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","has","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","getIdFromStr","fromLane","searchWithoutVersion","hasVersion","pMapSeries","existingOnLanes","filterIdsFromPoolIdsByPattern","idsFromRemote","getRemoteBitIdsByWildcards","includeDeprecated","startsWith","resolveComponentIdFromPackageName","ComponentID","fromString","getBitIdsForNonLanes","shouldImportDependents","importDependents","dependentsVia","dependentsAll","importDependenciesDirectly","dependenciesIds","getFlattenedDepsUnique","dependentsGetter","DependentsGetter","dependents","getDependents","uniqFromArray","remoteComps","scopeImporter","getManyRemoteComponents","versions","getVersions","getFlattened","flattenedDependencies","flattenedDeps","flattened","withLatest","removeMultipleVersionsKeepLatest","grouped","toGroupByIdWithoutVersion","latestVersions","latest","getLatestVersionNumber","changeVersion","LATEST_VERSION","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","_throwForModifiedOrNewComponents","flagUsed","allIds","getAllBitIdsFromAllLanes","fromArray","versionsP","getModelComponentIfExist","listVersions","fromPairs","currentVersions","detailsP","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","Boolean","isDeprecated","version","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","trackOnly","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getComponentId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","find","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","_shouldSaveLaneData","isOnLane","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setOnLanesOnly","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","skipWriteConfigFiles","writeConfigFiles","verbose","throwForExistingDir","skipWritingToFs","shouldUpdateWorkspaceConfig","reasonForBitmapChange","writeMany","exports"],"sources":["import-components.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getLatestVersionNumber, pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/checkout';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults, ManyComponentsWriterParams } from '@teambit/component-writer';\nimport { LATEST_VERSION } from '@teambit/component-version';\nimport { EnvsMain } from '@teambit/envs';\nimport { compact, difference, fromPairs } from 'lodash';\nimport { FilesStatus } from '@teambit/merging';\nimport { WorkspaceConfigUpdateResult } from '@teambit/config-merger';\nimport { Logger } from '@teambit/logger';\nimport { DependentsGetter } from './dependents-getter';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n filterEnvs?: string[];\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n writeConfigFiles: boolean; // default: true\n objectsOnly?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages, not as imported\n importDependents?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean; // don't show prompt for --dependents flag\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneId: LaneId;\n remoteLane?: Lane; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n trackOnly?: boolean;\n includeDeprecated?: boolean;\n isLaneFromRemote?: boolean; // whether the `lanes.lane` object is coming directly from the remote.\n};\ntype ComponentMergeStatus = {\n component: Component;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: ComponentID[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: ComponentID[];\n importedDeps: ComponentID[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n lane?: Lane;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private remoteLane: Lane | undefined;\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n private logger: Logger,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.remoteLane = this.options.lanes?.remoteLane;\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n const lane = this.remoteLane;\n const bitIds: ComponentIdList = await this.getBitIds();\n lane\n ? this.logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : this.logger.debug(\n `importObjectsOnLane, the lane does not exist on the remote. importing only the main components`\n );\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n if (lane) {\n await this.mergeAndSaveLaneObject(lane);\n }\n\n return this.returnCompleteResults(beforeImportVersions, versionDependenciesArr);\n }\n\n private async returnCompleteResults(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[],\n writtenComponents?: Component[],\n componentWriterResults?: ComponentWriterResults\n ): Promise<ImportResult> {\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n const missingIds: string[] = [];\n if (Object.keys(beforeImportVersions).length > versionDependenciesArr.length) {\n const importedComps = versionDependenciesArr.map((c) => c.component.id.toStringWithoutVersion());\n Object.keys(beforeImportVersions).forEach((compIdStr) => {\n const found = importedComps.includes(compIdStr);\n if (!found) missingIds.push(compIdStr);\n });\n }\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n missingIds,\n lane: this.remoteLane,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n this.logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: ComponentIdList = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.remoteLane,\n });\n if (this.remoteLane && this.options.objectsOnly) {\n await this.mergeAndSaveLaneObject(this.remoteLane);\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n const filteredComponents = await this._filterComponentsByFilters(components);\n componentWriterResults = await this._writeToFileSystem(filteredComponents);\n await this._saveLaneDataIfNeeded(filteredComponents);\n writtenComponents = filteredComponents;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private async mergeAndSaveLaneObject(lane: Lane) {\n const mergeLaneResults = await this.scope.sources.mergeLane(lane, true);\n const mergedLane = mergeLaneResults.mergeLane;\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergedLane);\n await this.scope.lanes.saveLane(mergedLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'import (merge from remote)',\n });\n }\n\n private async _filterComponentsByFilters(components: Component[]): Promise<Component[]> {\n if (!this.options.filterEnvs) return components;\n const filteredP = components.map(async (component) => {\n // If the id was requested explicitly, we don't want to filter it out\n if (this.options.ids) {\n if (\n this.options.ids.includes(component.id.toStringWithoutVersion()) ||\n this.options.ids.includes(component.id.toString())\n ) {\n return component;\n }\n }\n const currentEnv = await this.envs.calculateEnvIdFromExtensions(component.extensions);\n const currentEnvWithoutVersion = currentEnv.split('@')[0];\n if (\n this.options.filterEnvs?.includes(currentEnv) ||\n this.options.filterEnvs?.includes(currentEnvWithoutVersion)\n ) {\n return component;\n }\n return undefined;\n });\n const filtered = compact(await Promise.all(filteredP));\n return filtered;\n }\n\n async _fetchDivergeData(components: Component[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n components.map(async (component) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async throwForComponentsFromAnotherLane(bitIds: ComponentID[]) {\n if (this.options.objectsOnly) return;\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentRemoteLane = this.remoteLane?.toLaneId().isEqual(currentLaneId) ? this.remoteLane : undefined;\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idsFromAnotherLane: ComponentID[] = [];\n if (currentRemoteLane) {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isOnCurrentLane =\n (await this.scope.isPartOfLaneHistory(bitId, currentRemoteLane)) ||\n (currentLane && (await this.scope.isPartOfLaneHistory(bitId, currentLane))) ||\n (await this.scope.isPartOfMainHistory(bitId));\n if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);\n })\n );\n } else {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);\n if (!isIdOnMain) idsFromAnotherLane.push(bitId);\n })\n );\n }\n if (idsFromAnotherLane.length) {\n throw new BitError(`unable to import the following component(s) as they belong to other lane(s):\n${idsFromAnotherLane.map((id) => id.toString()).join(', ')}\nif you need this specific snap, find the lane this snap is belong to, then run \"bit lane merge <lane-id> [component-id]\" to merge this component from the lane.\nif you just want to get a quick look into this snap, create a new workspace and import it by running \"bit lane import <lane-id> --pattern <component-id>\"`);\n }\n }\n\n private async _importComponentsObjects(\n ids: ComponentIdList,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importWithoutDeps(ids.toVersionLatest(), {\n cache: false,\n lane,\n includeVersionHistory: true,\n fetchHeadIfLocalIsBehind: !this.options.allHistory,\n collectParents: this.options.allHistory,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n includeUnexported: this.options.isLaneFromRemote,\n reason: `of their latest on ${lane ? `lane ${lane.id()}` : 'main'}`,\n });\n\n this.logger.setStatusLine(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lane,\n preferDependencyGraph: !this.options.fetchDeps,\n // when user is running \"bit import\", we want to re-fetch if it wasn't built. todo: check if this can be disabled when not needed\n reFetchUnBuiltVersion: true,\n // it's possible that .bitmap is not in sync and has local tags that don't exist on the remote. later, we\n // add them to \"missingIds\" of \"importResult\" and show them to the user\n throwForSeederNotFound: false,\n reason: this.options.fetchDeps\n ? 'for getting all dependencies'\n : `for getting dependencies of components that don't have dependency-graph`,\n });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<ComponentID[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const remoteLaneIds = this.remoteLane?.toComponentIds() || new ComponentIdList();\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !remoteLaneIds.has(id));\n remoteLaneIds.push(...bitMapIdsToImport);\n\n return remoteLaneIds;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = await Promise.all(\n idsWithoutWildcard.map(async (idStr) => {\n const id = await this.getIdFromStr(idStr);\n const fromLane = remoteLaneIds.searchWithoutVersion(id);\n return fromLane && !id.hasVersion() ? fromLane : id;\n })\n );\n\n const bitIds: ComponentID[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const existingOnLanes = await this.workspace.filterIdsFromPoolIdsByPattern(idStr, remoteLaneIds, false);\n // in case the wildcard contains components from the lane, the user wants to import only them. not from main.\n // otherwise, if the wildcard translates to main components only, it's ok to import from main.\n if (existingOnLanes.length) {\n bitIds.push(...existingOnLanes);\n } else {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr, this.options.includeDeprecated);\n bitIds.push(...idsFromRemote);\n }\n });\n\n return bitIds;\n }\n\n private async getIdFromStr(id: string): Promise<ComponentID> {\n if (id.startsWith('@')) return this.workspace.resolveComponentIdFromPackageName(id);\n return ComponentID.fromString(id); // we don't support importing without a scope name\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: ComponentID[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr, this.options.includeDeprecated);\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n const id = await this.getIdFromStr(idStr);\n bitIds.push(id);\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<ComponentIdList> {\n const bitIds: ComponentID[] = this.options.lanes\n ? await this.getBitIdsForLanes()\n : await this.getBitIdsForNonLanes();\n const shouldImportDependents =\n this.options.importDependents || this.options.dependentsVia || this.options.dependentsAll;\n if (this.options.importDependenciesDirectly || shouldImportDependents) {\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = await this.getFlattenedDepsUnique(bitIds);\n bitIds.push(...dependenciesIds);\n }\n if (shouldImportDependents) {\n const dependentsGetter = new DependentsGetter(this.logger, this.workspace, this.graph, this.options);\n const dependents = await dependentsGetter.getDependents(bitIds);\n bitIds.push(...dependents);\n }\n }\n return ComponentIdList.uniqFromArray(bitIds);\n }\n\n private async getFlattenedDepsUnique(bitIds: ComponentID[]): Promise<ComponentID[]> {\n const remoteComps = await this.scope.scopeImporter.getManyRemoteComponents(bitIds);\n const versions = remoteComps.getVersions();\n const getFlattened = (): ComponentIdList => {\n if (versions.length === 1) return versions[0].flattenedDependencies;\n const flattenedDeps = versions.map((v) => v.flattenedDependencies).flat();\n return ComponentIdList.uniqFromArray(flattenedDeps);\n };\n const flattened = getFlattened();\n const withLatest = this.removeMultipleVersionsKeepLatest(flattened);\n return withLatest;\n }\n\n private removeMultipleVersionsKeepLatest(flattened: ComponentIdList): ComponentID[] {\n const grouped = flattened.toGroupByIdWithoutVersion();\n const latestVersions = Object.keys(grouped).map((key) => {\n const ids = grouped[key];\n if (ids.length === 1) return ids[0];\n const latest = getLatestVersionNumber(ids, ids[0].changeVersion(LATEST_VERSION));\n return latest;\n });\n\n return latestVersions;\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n const flagUsed = this.options.merge ? '--merge' : '--override';\n throw new Error(`bit import with no ids and ${flagUsed} flag is not supported.\nto write the components from .bitmap file according to the their remote, please use \"bit checkout reset --all\"`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n componentWriterResults = await this._writeToFileSystem(components);\n writtenComponents = components;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return ComponentIdList.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: ComponentIdList): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new BitError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = Boolean(await modelComponent.isDeprecated(this.scope.objects, id.version));\n const removed = Boolean(await component.component.component.isRemoved(this.scope.objects, id.version));\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n const importDetails: ImportDetails[] = await Promise.all(detailsP);\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: ComponentIdList): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: ComponentIdList): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge || this.options.trackOnly) return;\n const componentsStatuses = await this.workspace.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new BitError(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: ComponentIdList): void {\n ids.forEach((id: ComponentID) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local (new/staged) component with the same name.\nit's fine to have components with the same name as long as their scope names are different.\nif the component was created by mistake, remove it and import the remote one.\notherwise, if tagged/snapped, \"bit reset\" it, then bit rename it.`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.workspace.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { component, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getComponentId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n scope: this.consumer.scope,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]> {\n if (!this.options.merge) return components;\n const componentsStatusP = components.map((component: Component) => {\n return this._getMergeStatus(component);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const component = componentStatus.component;\n if (!filesStatus) return component;\n this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return component;\n });\n return compact(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(components: Component[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = this.remoteLane?.toComponentIds() || new ComponentIdList();\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setOnLanesOnly(comp.id, false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane, { laneHistoryMsg: 'import components' });\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n skipWriteConfigFiles: !this.options.writeConfigFiles,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n shouldUpdateWorksp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OAAO,CAAC4S,gBAAgB;MACpDC,OAAO,EAAE,IAAI,CAAC7S,OAAO,CAAC6S,OAAO;MAC7BC,mBAAmB,EAAE,CAAC,IAAI,CAAC9S,OAAO,CAACsM,QAAQ;MAC3CyG,eAAe,EAAE,IAAI,CAAC/S,OAAO,CAACuO,SAAS;MACvCyE,2BAA2B,EAAE,IAAI;MACjCC,qBAAqB,EAAE;IACzB,CAAC;IACD,OAAO,IAAI,CAACpT,eAAe,CAACqT,SAAS,CAACZ,wBAAwB,CAAC;EACjE;AACF;AAACa,OAAA,CAAA/U,OAAA,GAAAqB,gBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_bitError","data","require","_pMapSeries","_interopRequireDefault","_listScope","_componentId","_loaderMessages","_utils","_hasWildcard","_checkout","_mergeVersion","_componentsPendingMerge","_scopeComponentsImporter","_versionDependencies","_componentVersion","_lodash","_dependentsGetter","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ImportComponents","constructor","workspace","graph","componentWriter","envs","logger","options","consumer","scope","remoteLane","lanes","importComponents","result","setStatusLine","BEFORE_IMPORT_ACTION","startTime","process","hrtime","ids","length","importObjectsOnLane","consoleSuccess","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","bitIds","getBitIds","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAndSaveLaneObject","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","keys","importedComps","map","c","component","toStringWithoutVersion","forEach","compIdStr","found","includes","push","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","workspaceConfigUpdateResult","join","_throwForPotentialIssues","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","throwForComponentsFromAnotherLane","filteredComponents","_filterComponentsByFilters","_writeToFileSystem","_saveLaneDataIfNeeded","mergeLaneResults","sources","mergeLane","mergedLane","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","filterEnvs","filteredP","currentEnv","calculateEnvIdFromExtensions","extensions","currentEnvWithoutVersion","split","undefined","filtered","compact","Promise","all","modelComponent","getModelComponent","setDivergeData","divergeData","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","currentLaneId","getCurrentLaneId","currentRemoteLane","toLaneId","currentLane","getCurrentLaneObject","idsFromAnotherLane","bitId","isOnCurrentLane","isPartOfLaneHistory","isPartOfMainHistory","isIdOnMain","BitError","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importWithoutDeps","toVersionLatest","cache","includeVersionHistory","fetchHeadIfLocalIsBehind","allHistory","collectParents","includeUnexported","isLaneFromRemote","reason","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","remoteLaneIds","toComponentIds","ComponentIdList","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","has","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","getIdFromStr","fromLane","searchWithoutVersion","hasVersion","pMapSeries","existingOnLanes","filterIdsFromPoolIdsByPattern","idsFromRemote","getRemoteBitIdsByWildcards","includeDeprecated","startsWith","resolveComponentIdFromPackageName","ComponentID","fromString","getBitIdsForNonLanes","shouldImportDependents","importDependents","dependentsVia","dependentsAll","importDependenciesDirectly","dependenciesIds","getFlattenedDepsUnique","dependentsGetter","DependentsGetter","dependents","getDependents","uniqFromArray","remoteComps","scopeImporter","getManyRemoteComponents","versions","getVersions","getFlattened","flattenedDependencies","flattenedDeps","flattened","withLatest","removeMultipleVersionsKeepLatest","grouped","toGroupByIdWithoutVersion","latestVersions","key","latest","getLatestVersionNumber","changeVersion","LATEST_VERSION","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","_throwForModifiedOrNewComponents","flagUsed","allIds","getAllBitIdsFromAllLanes","fromArray","versionsP","getModelComponentIfExist","listVersions","fromPairs","currentVersions","detailsP","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","Boolean","isDeprecated","version","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","trackOnly","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getComponentId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","find","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","_shouldSaveLaneData","isOnLane","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setOnLanesOnly","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","skipWriteConfigFiles","writeConfigFiles","verbose","throwForExistingDir","skipWritingToFs","shouldUpdateWorkspaceConfig","reasonForBitmapChange","writeMany","exports"],"sources":["import-components.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getLatestVersionNumber, pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/checkout';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults, ManyComponentsWriterParams } from '@teambit/component-writer';\nimport { LATEST_VERSION } from '@teambit/component-version';\nimport { EnvsMain } from '@teambit/envs';\nimport { compact, difference, fromPairs } from 'lodash';\nimport { FilesStatus } from '@teambit/merging';\nimport { WorkspaceConfigUpdateResult } from '@teambit/config-merger';\nimport { Logger } from '@teambit/logger';\nimport { DependentsGetter } from './dependents-getter';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n filterEnvs?: string[];\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n writeConfigFiles: boolean; // default: true\n objectsOnly?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages, not as imported\n importDependents?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean; // don't show prompt for --dependents flag\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneId: LaneId;\n remoteLane?: Lane; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n trackOnly?: boolean;\n includeDeprecated?: boolean;\n isLaneFromRemote?: boolean; // whether the `lanes.lane` object is coming directly from the remote.\n};\ntype ComponentMergeStatus = {\n component: Component;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: ComponentID[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: ComponentID[];\n importedDeps: ComponentID[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n lane?: Lane;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private remoteLane: Lane | undefined;\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n private logger: Logger,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.remoteLane = this.options.lanes?.remoteLane;\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n const lane = this.remoteLane;\n const bitIds: ComponentIdList = await this.getBitIds();\n lane\n ? this.logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : this.logger.debug(\n `importObjectsOnLane, the lane does not exist on the remote. importing only the main components`\n );\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n if (lane) {\n await this.mergeAndSaveLaneObject(lane);\n }\n\n return this.returnCompleteResults(beforeImportVersions, versionDependenciesArr);\n }\n\n private async returnCompleteResults(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[],\n writtenComponents?: Component[],\n componentWriterResults?: ComponentWriterResults\n ): Promise<ImportResult> {\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n const missingIds: string[] = [];\n if (Object.keys(beforeImportVersions).length > versionDependenciesArr.length) {\n const importedComps = versionDependenciesArr.map((c) => c.component.id.toStringWithoutVersion());\n Object.keys(beforeImportVersions).forEach((compIdStr) => {\n const found = importedComps.includes(compIdStr);\n if (!found) missingIds.push(compIdStr);\n });\n }\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n missingIds,\n lane: this.remoteLane,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n this.logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: ComponentIdList = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.remoteLane,\n });\n if (this.remoteLane && this.options.objectsOnly) {\n await this.mergeAndSaveLaneObject(this.remoteLane);\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n const filteredComponents = await this._filterComponentsByFilters(components);\n componentWriterResults = await this._writeToFileSystem(filteredComponents);\n await this._saveLaneDataIfNeeded(filteredComponents);\n writtenComponents = filteredComponents;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private async mergeAndSaveLaneObject(lane: Lane) {\n const mergeLaneResults = await this.scope.sources.mergeLane(lane, true);\n const mergedLane = mergeLaneResults.mergeLane;\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergedLane);\n await this.scope.lanes.saveLane(mergedLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'import (merge from remote)',\n });\n }\n\n private async _filterComponentsByFilters(components: Component[]): Promise<Component[]> {\n if (!this.options.filterEnvs) return components;\n const filteredP = components.map(async (component) => {\n // If the id was requested explicitly, we don't want to filter it out\n if (this.options.ids) {\n if (\n this.options.ids.includes(component.id.toStringWithoutVersion()) ||\n this.options.ids.includes(component.id.toString())\n ) {\n return component;\n }\n }\n const currentEnv = await this.envs.calculateEnvIdFromExtensions(component.extensions);\n const currentEnvWithoutVersion = currentEnv.split('@')[0];\n if (\n this.options.filterEnvs?.includes(currentEnv) ||\n this.options.filterEnvs?.includes(currentEnvWithoutVersion)\n ) {\n return component;\n }\n return undefined;\n });\n const filtered = compact(await Promise.all(filteredP));\n return filtered;\n }\n\n async _fetchDivergeData(components: Component[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n components.map(async (component) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async throwForComponentsFromAnotherLane(bitIds: ComponentID[]) {\n if (this.options.objectsOnly) return;\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentRemoteLane = this.remoteLane?.toLaneId().isEqual(currentLaneId) ? this.remoteLane : undefined;\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idsFromAnotherLane: ComponentID[] = [];\n if (currentRemoteLane) {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isOnCurrentLane =\n (await this.scope.isPartOfLaneHistory(bitId, currentRemoteLane)) ||\n (currentLane && (await this.scope.isPartOfLaneHistory(bitId, currentLane))) ||\n (await this.scope.isPartOfMainHistory(bitId));\n if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);\n })\n );\n } else {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);\n if (!isIdOnMain) idsFromAnotherLane.push(bitId);\n })\n );\n }\n if (idsFromAnotherLane.length) {\n throw new BitError(`unable to import the following component(s) as they belong to other lane(s):\n${idsFromAnotherLane.map((id) => id.toString()).join(', ')}\nif you need this specific snap, find the lane this snap is belong to, then run \"bit lane merge <lane-id> [component-id]\" to merge this component from the lane.\nif you just want to get a quick look into this snap, create a new workspace and import it by running \"bit lane import <lane-id> --pattern <component-id>\"`);\n }\n }\n\n private async _importComponentsObjects(\n ids: ComponentIdList,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importWithoutDeps(ids.toVersionLatest(), {\n cache: false,\n lane,\n includeVersionHistory: true,\n fetchHeadIfLocalIsBehind: !this.options.allHistory,\n collectParents: this.options.allHistory,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n includeUnexported: this.options.isLaneFromRemote,\n reason: `of their latest on ${lane ? `lane ${lane.id()}` : 'main'}`,\n });\n\n this.logger.setStatusLine(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lane,\n preferDependencyGraph: !this.options.fetchDeps,\n // when user is running \"bit import\", we want to re-fetch if it wasn't built. todo: check if this can be disabled when not needed\n reFetchUnBuiltVersion: true,\n // it's possible that .bitmap is not in sync and has local tags that don't exist on the remote. later, we\n // add them to \"missingIds\" of \"importResult\" and show them to the user\n throwForSeederNotFound: false,\n reason: this.options.fetchDeps\n ? 'for getting all dependencies'\n : `for getting dependencies of components that don't have dependency-graph`,\n });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<ComponentID[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const remoteLaneIds = this.remoteLane?.toComponentIds() || new ComponentIdList();\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !remoteLaneIds.has(id));\n remoteLaneIds.push(...bitMapIdsToImport);\n\n return remoteLaneIds;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = await Promise.all(\n idsWithoutWildcard.map(async (idStr) => {\n const id = await this.getIdFromStr(idStr);\n const fromLane = remoteLaneIds.searchWithoutVersion(id);\n return fromLane && !id.hasVersion() ? fromLane : id;\n })\n );\n\n const bitIds: ComponentID[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const existingOnLanes = await this.workspace.filterIdsFromPoolIdsByPattern(idStr, remoteLaneIds, false);\n // in case the wildcard contains components from the lane, the user wants to import only them. not from main.\n // otherwise, if the wildcard translates to main components only, it's ok to import from main.\n if (existingOnLanes.length) {\n bitIds.push(...existingOnLanes);\n } else {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr, this.options.includeDeprecated);\n bitIds.push(...idsFromRemote);\n }\n });\n\n return bitIds;\n }\n\n private async getIdFromStr(id: string): Promise<ComponentID> {\n if (id.startsWith('@')) return this.workspace.resolveComponentIdFromPackageName(id);\n return ComponentID.fromString(id); // we don't support importing without a scope name\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: ComponentID[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr, this.options.includeDeprecated);\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n const id = await this.getIdFromStr(idStr);\n bitIds.push(id);\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<ComponentIdList> {\n const bitIds: ComponentID[] = this.options.lanes\n ? await this.getBitIdsForLanes()\n : await this.getBitIdsForNonLanes();\n const shouldImportDependents =\n this.options.importDependents || this.options.dependentsVia || this.options.dependentsAll;\n if (this.options.importDependenciesDirectly || shouldImportDependents) {\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = await this.getFlattenedDepsUnique(bitIds);\n bitIds.push(...dependenciesIds);\n }\n if (shouldImportDependents) {\n const dependentsGetter = new DependentsGetter(this.logger, this.workspace, this.graph, this.options);\n const dependents = await dependentsGetter.getDependents(bitIds);\n bitIds.push(...dependents);\n }\n }\n return ComponentIdList.uniqFromArray(bitIds);\n }\n\n private async getFlattenedDepsUnique(bitIds: ComponentID[]): Promise<ComponentID[]> {\n const remoteComps = await this.scope.scopeImporter.getManyRemoteComponents(bitIds);\n const versions = remoteComps.getVersions();\n const getFlattened = (): ComponentIdList => {\n if (versions.length === 1) return versions[0].flattenedDependencies;\n const flattenedDeps = versions.map((v) => v.flattenedDependencies).flat();\n return ComponentIdList.uniqFromArray(flattenedDeps);\n };\n const flattened = getFlattened();\n const withLatest = this.removeMultipleVersionsKeepLatest(flattened);\n return withLatest;\n }\n\n private removeMultipleVersionsKeepLatest(flattened: ComponentIdList): ComponentID[] {\n const grouped = flattened.toGroupByIdWithoutVersion();\n const latestVersions = Object.keys(grouped).map((key) => {\n const ids = grouped[key];\n if (ids.length === 1) return ids[0];\n const latest = getLatestVersionNumber(ids, ids[0].changeVersion(LATEST_VERSION));\n return latest;\n });\n\n return latestVersions;\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n const flagUsed = this.options.merge ? '--merge' : '--override';\n throw new Error(`bit import with no ids and ${flagUsed} flag is not supported.\nto write the components from .bitmap file according to the their remote, please use \"bit checkout reset --all\"`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n componentWriterResults = await this._writeToFileSystem(components);\n writtenComponents = components;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return ComponentIdList.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: ComponentIdList): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new BitError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = Boolean(await modelComponent.isDeprecated(this.scope.objects, id.version));\n const removed = Boolean(await component.component.component.isRemoved(this.scope.objects, id.version));\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n const importDetails: ImportDetails[] = await Promise.all(detailsP);\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: ComponentIdList): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: ComponentIdList): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge || this.options.trackOnly) return;\n const componentsStatuses = await this.workspace.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new BitError(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: ComponentIdList): void {\n ids.forEach((id: ComponentID) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local (new/staged) component with the same name.\nit's fine to have components with the same name as long as their scope names are different.\nif the component was created by mistake, remove it and import the remote one.\notherwise, if tagged/snapped, \"bit reset\" it, then bit rename it.`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.workspace.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { component, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getComponentId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n scope: this.consumer.scope,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]> {\n if (!this.options.merge) return components;\n const componentsStatusP = components.map((component: Component) => {\n return this._getMergeStatus(component);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const component = componentStatus.component;\n if (!filesStatus) return component;\n this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return component;\n });\n return compact(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(components: Component[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = this.remoteLane?.toComponentIds() || new ComponentIdList();\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setOnLanesOnly(comp.id, false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane, { laneHistoryMsg: 'import components' });\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n skipWriteConfigFiles: !this.options.writeConfigFiles,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n shouldUpdateWorkspaceConfig: true,\n reasonForBitmapChange: 'import',\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,MAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAO,YAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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AAW,EAAE,IAAI,CAACxS,OAAO,CAACwS,WAAW;MACrCC,WAAW,EAAE,IAAI,CAACzS,OAAO,CAACyS,WAAW;MACrCC,0BAA0B,EAAE,CAAC,IAAI,CAAC1S,OAAO,CAAC2S,kBAAkB;MAC5DC,oBAAoB,EAAE,CAAC,IAAI,CAAC5S,OAAO,CAAC6S,gBAAgB;MACpDC,OAAO,EAAE,IAAI,CAAC9S,OAAO,CAAC8S,OAAO;MAC7BC,mBAAmB,EAAE,CAAC,IAAI,CAAC/S,OAAO,CAACuM,QAAQ;MAC3CyG,eAAe,EAAE,IAAI,CAAChT,OAAO,CAACwO,SAAS;MACvCyE,2BAA2B,EAAE,IAAI;MACjCC,qBAAqB,EAAE;IACzB,CAAC;IACD,OAAO,IAAI,CAACrT,eAAe,CAACsT,SAAS,CAACZ,wBAAwB,CAAC;EACjE;AACF;AAACa,OAAA,CAAA9U,OAAA,GAAAmB,gBAAA","ignoreList":[]}
|
package/dist/import.cmd.js
CHANGED
@@ -53,8 +53,8 @@ function _utils() {
|
|
53
53
|
};
|
54
54
|
return data;
|
55
55
|
}
|
56
|
-
function _interopRequireDefault(
|
57
|
-
function _defineProperty(
|
56
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
57
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
58
58
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
59
59
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
60
60
|
class ImportCmd {
|
package/dist/import.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_mergeVersion","_componentId","_bitError","_utils","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ImportCmd","constructor","importer","name","description","report","ids","importFlags","importDetails","importedIds","importedDeps","installationError","compilationError","workspaceConfigUpdateResult","missingIds","cancellationMessage","lane","getImportResults","length","chalk","yellow","importedIdsUniqNoVersion","ComponentIdList","fromArray","toVersionLatest","summaryPrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","getWsConfigUpdateLogs","logs","logsStr","join","underline","upToDateSuffix","upToDateStr","summary","importOutput","compact","importedDepsOutput","displayDependencies","immutableUnshift","uniq","formatPlainComponentItem","green","output","formatMissingComponents","getWorkspaceConfigUpdateOutput","installationErrorOutput","compilationErrorOutput","json","path","objects","override","verbose","conf","skipDependencyInstallation","skipWriteConfigFiles","merge","filterEnvs","saveInLane","dependencies","dependents","dependentsDryRun","silent","dependentsVia","dependentsAll","allHistory","fetchDeps","trackOnly","includeDeprecated","logger","warn","BitError","mergeStrategy","options","keys","MergeOptions","includes","envsToFilter","split","p","trim","undefined","importOptions","Boolean","writeToPath","objectsOnly","writeConfig","installNpmPackages","writeConfigFiles","importDependenciesDirectly","importDependents","import","_packageManagerArgs","exports","missing","title","subTitle","body","red","scope","version","deprecated","cyan","getVersionsOutput","versions","latestVersion","usedVersion","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","removed","missingDeps","d","dim"],"sources":["import.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { compact, uniq } from 'lodash';\nimport { installationErrorOutput, compilationErrorOutput, getWorkspaceConfigUpdateOutput } from '@teambit/merging';\nimport {\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { immutableUnshift } from '@teambit/legacy/dist/utils';\nimport { ImporterMain } from './importer.main.runtime';\nimport { ImportOptions, ImportDetails, ImportStatus, ImportResult } from './import-components';\n\ntype ImportFlags = {\n path?: string;\n objects?: boolean;\n displayDependencies?: boolean;\n override?: boolean;\n verbose?: boolean;\n json?: boolean;\n conf?: string;\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n merge?: MergeStrategy;\n filterEnvs?: string;\n saveInLane?: boolean;\n dependencies?: boolean;\n dependents?: boolean;\n dependentsDryRun?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean;\n allHistory?: boolean;\n fetchDeps?: boolean;\n trackOnly?: boolean;\n includeDeprecated?: boolean;\n};\n\nexport class ImportCmd implements Command {\n name = 'import [component-patterns...]';\n description = 'import components from their remote scopes to the local workspace';\n helpUrl = 'reference/components/importing-components';\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'component IDs or component patterns (separated by space). Use patterns to import groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription: string;\n group = 'collaborate';\n alias = '';\n options = [\n ['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'],\n [\n 'o',\n 'objects',\n 'import components objects to the local scope without checkout (without writing them to the file system). This is the default behavior for import with no id argument',\n ],\n ['O', 'override', 'override local changes'],\n ['v', 'verbose', 'show verbose output for inspection'],\n ['j', 'json', 'return the output as JSON'],\n // ['', 'conf', 'write the configuration file (component.json) of the component'], // not working. need to fix once ComponentWriter is moved to Harmony\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n [\n 'm',\n 'merge [strategy]',\n 'merge local changes with the imported version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n [\n '',\n 'dependencies',\n 'import all dependencies (bit components only) of imported components and write them to the workspace',\n ],\n [\n '',\n 'dependents',\n 'import components found while traversing from the imported components upwards to the workspace components',\n ],\n [\n '',\n 'dependents-via <string>',\n 'same as --dependents except the traversal must go through the specified component. to specify multiple components, wrap with quotes and separate by a comma',\n ],\n [\n '',\n 'dependents-all',\n 'same as --dependents except not prompting for selecting paths but rather selecting all paths and showing final confirmation before importing',\n ],\n [\n '',\n 'dependents-dry-run',\n 'DEPRECATED. (this is the default now). same as --dependents, except it prints the found dependents and wait for confirmation before importing them',\n ],\n ['', 'silent', 'no prompt for --dependents/--dependents-via flags'],\n [\n '',\n 'filter-envs <envs>',\n 'only import components that have the specified environment (e.g., \"teambit.react/react-env\")',\n ],\n [\n '',\n 'save-in-lane',\n 'when checked out to a lane and the component is not on the remote-lane, save it in the lane (defaults to save on main)',\n ],\n [\n '',\n 'all-history',\n 'relevant for fetching all components objects. avoid optimizations, fetch all history versions, always',\n ],\n [\n '',\n 'fetch-deps',\n 'fetch dependencies (bit components) objects to the local scope, but dont add to the workspace. Useful to resolve errors about missing dependency data',\n ],\n [\n '',\n 'track-only',\n 'do not write any component files, just create .bitmap entries of the imported components. Useful when the files already exist and just want to re-add the component to the bitmap',\n ],\n ['', 'include-deprecated', 'when importing with patterns, include deprecated components (default to exclude them)'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n _packageManagerArgs: string[]; // gets populated by yargs-adapter.handler().\n\n constructor(private importer: ImporterMain) {}\n\n async report([ids = []]: [string[]], importFlags: ImportFlags): Promise<any> {\n const {\n importDetails,\n importedIds,\n importedDeps,\n installationError,\n compilationError,\n workspaceConfigUpdateResult,\n missingIds,\n cancellationMessage,\n lane,\n } = await this.getImportResults(ids, importFlags);\n if (!importedIds.length && !missingIds?.length) {\n return chalk.yellow(cancellationMessage || 'nothing to import');\n }\n const importedIdsUniqNoVersion = ComponentIdList.fromArray(importedIds).toVersionLatest();\n const summaryPrefix =\n importedIdsUniqNoVersion.length === 1\n ? 'successfully imported one component'\n : `successfully imported ${importedIdsUniqNoVersion.length} components`;\n\n let upToDateCount = 0;\n const importedComponents = importedIds.map((bitId) => {\n const details = importDetails.find((c) => c.id === bitId.toStringWithoutVersion());\n if (!details) throw new Error(`missing details for component ${bitId.toString()}`);\n if (details.status === 'up to date') {\n upToDateCount += 1;\n }\n return formatPlainComponentItemWithVersions(bitId, details);\n });\n const getWsConfigUpdateLogs = () => {\n const logs = workspaceConfigUpdateResult?.logs;\n if (!logs || !logs.length) return '';\n const logsStr = logs.join('\\n');\n return `${chalk.underline('verbose logs of workspace config update')}\\n${logsStr}`;\n };\n const upToDateSuffix = lane ? ' on the lane' : '';\n const upToDateStr = upToDateCount === 0 ? '' : `, ${upToDateCount} components are up to date${upToDateSuffix}`;\n const summary = `${summaryPrefix}${upToDateStr}`;\n const importOutput = compact(importedComponents).join('\\n');\n const importedDepsOutput =\n importFlags.displayDependencies && importedDeps.length\n ? immutableUnshift(\n uniq(importedDeps.map(formatPlainComponentItem)),\n chalk.green(`\\n\\nsuccessfully imported ${importedDeps.length} component dependencies`)\n ).join('\\n')\n : '';\n\n const output = compact([\n getWsConfigUpdateLogs(),\n importOutput,\n importedDepsOutput,\n formatMissingComponents(missingIds),\n getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n chalk.green(summary),\n ]).join('\\n\\n');\n\n return output;\n }\n\n async json([ids]: [string[]], importFlags: ImportFlags) {\n const { importDetails, installationError, missingIds } = await this.getImportResults(ids, importFlags);\n\n return { importDetails, installationError, missingIds };\n }\n\n private async getImportResults(\n ids: string[],\n {\n path,\n objects = false,\n override = false,\n verbose = false,\n conf,\n skipDependencyInstallation = false,\n skipWriteConfigFiles = false,\n merge,\n filterEnvs,\n saveInLane = false,\n dependencies = false,\n dependents = false,\n dependentsDryRun = false,\n silent,\n dependentsVia,\n dependentsAll,\n allHistory = false,\n fetchDeps = false,\n trackOnly = false,\n includeDeprecated = false,\n }: ImportFlags\n ): Promise<ImportResult> {\n if (dependentsDryRun) {\n this.importer.logger.warn(`the \"--dependents-dry-run\" flag is deprecated and is now the default behavior`);\n }\n if (objects && merge) {\n throw new BitError(' --objects and --merge flags cannot be used together');\n }\n if (override && merge) {\n throw new BitError('--override and --merge cannot be used together');\n }\n if (!ids.length && dependencies) {\n throw new BitError('you have to specify ids to use \"--dependencies\" flag');\n }\n if (!ids.length && dependents) {\n throw new BitError('you have to specify ids to use \"--dependents\" flag');\n }\n if (!ids.length && dependentsVia) {\n throw new BitError('you have to specify ids to use \"--dependents-via\" flag');\n }\n if (!ids.length && trackOnly) {\n throw new BitError('you have to specify ids to use \"--track-only\" flag');\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const options = Object.keys(MergeOptions);\n if (!options.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${options.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n\n const envsToFilter = filterEnvs ? filterEnvs.split(',').map((p) => p.trim()) : undefined;\n\n const importOptions: ImportOptions = {\n ids,\n verbose,\n merge: Boolean(merge),\n filterEnvs: envsToFilter,\n mergeStrategy,\n writeToPath: path,\n objectsOnly: objects,\n override,\n writeConfig: Boolean(conf),\n installNpmPackages: !skipDependencyInstallation,\n writeConfigFiles: !skipWriteConfigFiles,\n saveInLane,\n importDependenciesDirectly: dependencies,\n importDependents: dependents,\n dependentsVia,\n dependentsAll,\n silent,\n allHistory,\n fetchDeps,\n trackOnly,\n includeDeprecated,\n };\n return this.importer.import(importOptions, this._packageManagerArgs);\n }\n}\n\nfunction formatMissingComponents(missing?: string[]) {\n if (!missing?.length) return '';\n const title = chalk.underline('Missing Components');\n const subTitle = `The following components are missing from the remote in the requested version, try running \"bit status\" to re-sync your .bitmap file\nAlso, check that the requested version exists on main or the checked out lane`;\n const body = chalk.red(missing.join('\\n'));\n return `${title}\\n${subTitle}\\n${body}`;\n}\n\nfunction formatPlainComponentItem({ scope, name, version, deprecated }: any) {\n return chalk.cyan(\n `- ${scope ? `${scope}/` : ''}${name}@${version ? version.toString() : 'latest'} ${\n deprecated ? chalk.yellow('[deprecated]') : ''\n }`\n );\n}\n\nfunction formatPlainComponentItemWithVersions(bitId: ComponentID, importDetails: ImportDetails) {\n const status: ImportStatus = importDetails.status;\n const id = bitId.toStringWithoutVersion();\n const getVersionsOutput = () => {\n if (!importDetails.versions.length) return '';\n if (importDetails.latestVersion) {\n return `${importDetails.versions.length} new version(s) available, latest ${importDetails.latestVersion}`;\n }\n return importDetails.versions.length > 5\n ? `${importDetails.versions.length} new versions`\n : `new versions: ${importDetails.versions.join(', ')}`;\n };\n const versions = getVersionsOutput();\n const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';\n const getConflictMessage = () => {\n if (!importDetails.filesStatus) return '';\n const conflictedFiles = Object.keys(importDetails.filesStatus)\n // @ts-ignore file is set\n .filter((file) => importDetails.filesStatus[file] === FileStatus.manual);\n if (!conflictedFiles.length) return '';\n return `(the following files were saved with conflicts ${conflictedFiles\n .map((file) => chalk.bold(file))\n .join(', ')}) `;\n };\n const conflictMessage = getConflictMessage();\n const deprecated = importDetails.deprecated && !importDetails.removed ? chalk.yellow('deprecated') : '';\n const removed = importDetails.removed ? chalk.red('deleted') : '';\n const missingDeps = importDetails.missingDeps.length\n ? chalk.red(`missing dependencies: ${importDetails.missingDeps.map((d) => d.toString()).join(', ')}`)\n : '';\n if (status === 'up to date' && !missingDeps && !deprecated && !conflictMessage && !removed) {\n return undefined;\n }\n return chalk.dim(\n `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`\n );\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA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
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_mergeVersion","_componentId","_bitError","_utils","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ImportCmd","constructor","importer","name","description","report","ids","importFlags","importDetails","importedIds","importedDeps","installationError","compilationError","workspaceConfigUpdateResult","missingIds","cancellationMessage","lane","getImportResults","length","chalk","yellow","importedIdsUniqNoVersion","ComponentIdList","fromArray","toVersionLatest","summaryPrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","getWsConfigUpdateLogs","logs","logsStr","join","underline","upToDateSuffix","upToDateStr","summary","importOutput","compact","importedDepsOutput","displayDependencies","immutableUnshift","uniq","formatPlainComponentItem","green","output","formatMissingComponents","getWorkspaceConfigUpdateOutput","installationErrorOutput","compilationErrorOutput","json","path","objects","override","verbose","conf","skipDependencyInstallation","skipWriteConfigFiles","merge","filterEnvs","saveInLane","dependencies","dependents","dependentsDryRun","silent","dependentsVia","dependentsAll","allHistory","fetchDeps","trackOnly","includeDeprecated","logger","warn","BitError","mergeStrategy","options","keys","MergeOptions","includes","envsToFilter","split","p","trim","undefined","importOptions","Boolean","writeToPath","objectsOnly","writeConfig","installNpmPackages","writeConfigFiles","importDependenciesDirectly","importDependents","import","_packageManagerArgs","exports","missing","title","subTitle","body","red","scope","version","deprecated","cyan","getVersionsOutput","versions","latestVersion","usedVersion","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","removed","missingDeps","d","dim"],"sources":["import.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { compact, uniq } from 'lodash';\nimport { installationErrorOutput, compilationErrorOutput, getWorkspaceConfigUpdateOutput } from '@teambit/merging';\nimport {\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { immutableUnshift } from '@teambit/legacy/dist/utils';\nimport { ImporterMain } from './importer.main.runtime';\nimport { ImportOptions, ImportDetails, ImportStatus, ImportResult } from './import-components';\n\ntype ImportFlags = {\n path?: string;\n objects?: boolean;\n displayDependencies?: boolean;\n override?: boolean;\n verbose?: boolean;\n json?: boolean;\n conf?: string;\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n merge?: MergeStrategy;\n filterEnvs?: string;\n saveInLane?: boolean;\n dependencies?: boolean;\n dependents?: boolean;\n dependentsDryRun?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean;\n allHistory?: boolean;\n fetchDeps?: boolean;\n trackOnly?: boolean;\n includeDeprecated?: boolean;\n};\n\nexport class ImportCmd implements Command {\n name = 'import [component-patterns...]';\n description = 'import components from their remote scopes to the local workspace';\n helpUrl = 'reference/components/importing-components';\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'component IDs or component patterns (separated by space). Use patterns to import groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription: string;\n group = 'collaborate';\n alias = '';\n options = [\n ['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'],\n [\n 'o',\n 'objects',\n 'import components objects to the local scope without checkout (without writing them to the file system). This is the default behavior for import with no id argument',\n ],\n ['O', 'override', 'override local changes'],\n ['v', 'verbose', 'show verbose output for inspection'],\n ['j', 'json', 'return the output as JSON'],\n // ['', 'conf', 'write the configuration file (component.json) of the component'], // not working. need to fix once ComponentWriter is moved to Harmony\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n [\n 'm',\n 'merge [strategy]',\n 'merge local changes with the imported version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n [\n '',\n 'dependencies',\n 'import all dependencies (bit components only) of imported components and write them to the workspace',\n ],\n [\n '',\n 'dependents',\n 'import components found while traversing from the imported components upwards to the workspace components',\n ],\n [\n '',\n 'dependents-via <string>',\n 'same as --dependents except the traversal must go through the specified component. to specify multiple components, wrap with quotes and separate by a comma',\n ],\n [\n '',\n 'dependents-all',\n 'same as --dependents except not prompting for selecting paths but rather selecting all paths and showing final confirmation before importing',\n ],\n [\n '',\n 'dependents-dry-run',\n 'DEPRECATED. (this is the default now). same as --dependents, except it prints the found dependents and wait for confirmation before importing them',\n ],\n ['', 'silent', 'no prompt for --dependents/--dependents-via flags'],\n [\n '',\n 'filter-envs <envs>',\n 'only import components that have the specified environment (e.g., \"teambit.react/react-env\")',\n ],\n [\n '',\n 'save-in-lane',\n 'when checked out to a lane and the component is not on the remote-lane, save it in the lane (defaults to save on main)',\n ],\n [\n '',\n 'all-history',\n 'relevant for fetching all components objects. avoid optimizations, fetch all history versions, always',\n ],\n [\n '',\n 'fetch-deps',\n 'fetch dependencies (bit components) objects to the local scope, but dont add to the workspace. Useful to resolve errors about missing dependency data',\n ],\n [\n '',\n 'track-only',\n 'do not write any component files, just create .bitmap entries of the imported components. Useful when the files already exist and just want to re-add the component to the bitmap',\n ],\n ['', 'include-deprecated', 'when importing with patterns, include deprecated components (default to exclude them)'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n _packageManagerArgs: string[]; // gets populated by yargs-adapter.handler().\n\n constructor(private importer: ImporterMain) {}\n\n async report([ids = []]: [string[]], importFlags: ImportFlags): Promise<any> {\n const {\n importDetails,\n importedIds,\n importedDeps,\n installationError,\n compilationError,\n workspaceConfigUpdateResult,\n missingIds,\n cancellationMessage,\n lane,\n } = await this.getImportResults(ids, importFlags);\n if (!importedIds.length && !missingIds?.length) {\n return chalk.yellow(cancellationMessage || 'nothing to import');\n }\n const importedIdsUniqNoVersion = ComponentIdList.fromArray(importedIds).toVersionLatest();\n const summaryPrefix =\n importedIdsUniqNoVersion.length === 1\n ? 'successfully imported one component'\n : `successfully imported ${importedIdsUniqNoVersion.length} components`;\n\n let upToDateCount = 0;\n const importedComponents = importedIds.map((bitId) => {\n const details = importDetails.find((c) => c.id === bitId.toStringWithoutVersion());\n if (!details) throw new Error(`missing details for component ${bitId.toString()}`);\n if (details.status === 'up to date') {\n upToDateCount += 1;\n }\n return formatPlainComponentItemWithVersions(bitId, details);\n });\n const getWsConfigUpdateLogs = () => {\n const logs = workspaceConfigUpdateResult?.logs;\n if (!logs || !logs.length) return '';\n const logsStr = logs.join('\\n');\n return `${chalk.underline('verbose logs of workspace config update')}\\n${logsStr}`;\n };\n const upToDateSuffix = lane ? ' on the lane' : '';\n const upToDateStr = upToDateCount === 0 ? '' : `, ${upToDateCount} components are up to date${upToDateSuffix}`;\n const summary = `${summaryPrefix}${upToDateStr}`;\n const importOutput = compact(importedComponents).join('\\n');\n const importedDepsOutput =\n importFlags.displayDependencies && importedDeps.length\n ? immutableUnshift(\n uniq(importedDeps.map(formatPlainComponentItem)),\n chalk.green(`\\n\\nsuccessfully imported ${importedDeps.length} component dependencies`)\n ).join('\\n')\n : '';\n\n const output = compact([\n getWsConfigUpdateLogs(),\n importOutput,\n importedDepsOutput,\n formatMissingComponents(missingIds),\n getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n chalk.green(summary),\n ]).join('\\n\\n');\n\n return output;\n }\n\n async json([ids]: [string[]], importFlags: ImportFlags) {\n const { importDetails, installationError, missingIds } = await this.getImportResults(ids, importFlags);\n\n return { importDetails, installationError, missingIds };\n }\n\n private async getImportResults(\n ids: string[],\n {\n path,\n objects = false,\n override = false,\n verbose = false,\n conf,\n skipDependencyInstallation = false,\n skipWriteConfigFiles = false,\n merge,\n filterEnvs,\n saveInLane = false,\n dependencies = false,\n dependents = false,\n dependentsDryRun = false,\n silent,\n dependentsVia,\n dependentsAll,\n allHistory = false,\n fetchDeps = false,\n trackOnly = false,\n includeDeprecated = false,\n }: ImportFlags\n ): Promise<ImportResult> {\n if (dependentsDryRun) {\n this.importer.logger.warn(`the \"--dependents-dry-run\" flag is deprecated and is now the default behavior`);\n }\n if (objects && merge) {\n throw new BitError(' --objects and --merge flags cannot be used together');\n }\n if (override && merge) {\n throw new BitError('--override and --merge cannot be used together');\n }\n if (!ids.length && dependencies) {\n throw new BitError('you have to specify ids to use \"--dependencies\" flag');\n }\n if (!ids.length && dependents) {\n throw new BitError('you have to specify ids to use \"--dependents\" flag');\n }\n if (!ids.length && dependentsVia) {\n throw new BitError('you have to specify ids to use \"--dependents-via\" flag');\n }\n if (!ids.length && trackOnly) {\n throw new BitError('you have to specify ids to use \"--track-only\" flag');\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const options = Object.keys(MergeOptions);\n if (!options.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${options.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n\n const envsToFilter = filterEnvs ? filterEnvs.split(',').map((p) => p.trim()) : undefined;\n\n const importOptions: ImportOptions = {\n ids,\n verbose,\n merge: Boolean(merge),\n filterEnvs: envsToFilter,\n mergeStrategy,\n writeToPath: path,\n objectsOnly: objects,\n override,\n writeConfig: Boolean(conf),\n installNpmPackages: !skipDependencyInstallation,\n writeConfigFiles: !skipWriteConfigFiles,\n saveInLane,\n importDependenciesDirectly: dependencies,\n importDependents: dependents,\n dependentsVia,\n dependentsAll,\n silent,\n allHistory,\n fetchDeps,\n trackOnly,\n includeDeprecated,\n };\n return this.importer.import(importOptions, this._packageManagerArgs);\n }\n}\n\nfunction formatMissingComponents(missing?: string[]) {\n if (!missing?.length) return '';\n const title = chalk.underline('Missing Components');\n const subTitle = `The following components are missing from the remote in the requested version, try running \"bit status\" to re-sync your .bitmap file\nAlso, check that the requested version exists on main or the checked out lane`;\n const body = chalk.red(missing.join('\\n'));\n return `${title}\\n${subTitle}\\n${body}`;\n}\n\nfunction formatPlainComponentItem({ scope, name, version, deprecated }: any) {\n return chalk.cyan(\n `- ${scope ? `${scope}/` : ''}${name}@${version ? version.toString() : 'latest'} ${\n deprecated ? chalk.yellow('[deprecated]') : ''\n }`\n );\n}\n\nfunction formatPlainComponentItemWithVersions(bitId: ComponentID, importDetails: ImportDetails) {\n const status: ImportStatus = importDetails.status;\n const id = bitId.toStringWithoutVersion();\n const getVersionsOutput = () => {\n if (!importDetails.versions.length) return '';\n if (importDetails.latestVersion) {\n return `${importDetails.versions.length} new version(s) available, latest ${importDetails.latestVersion}`;\n }\n return importDetails.versions.length > 5\n ? `${importDetails.versions.length} new versions`\n : `new versions: ${importDetails.versions.join(', ')}`;\n };\n const versions = getVersionsOutput();\n const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';\n const getConflictMessage = () => {\n if (!importDetails.filesStatus) return '';\n const conflictedFiles = Object.keys(importDetails.filesStatus)\n // @ts-ignore file is set\n .filter((file) => importDetails.filesStatus[file] === FileStatus.manual);\n if (!conflictedFiles.length) return '';\n return `(the following files were saved with conflicts ${conflictedFiles\n .map((file) => chalk.bold(file))\n .join(', ')}) `;\n };\n const conflictMessage = getConflictMessage();\n const deprecated = importDetails.deprecated && !importDetails.removed ? chalk.yellow('deprecated') : '';\n const removed = importDetails.removed ? chalk.red('deleted') : '';\n const missingDeps = importDetails.missingDeps.length\n ? chalk.red(`missing dependencies: ${importDetails.missingDeps.map((d) => d.toString()).join(', ')}`)\n : '';\n if (status === 'up to date' && !missingDeps && !deprecated && !conflictMessage && !removed) {\n return undefined;\n }\n return chalk.dim(\n `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`\n );\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA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,7 +11,7 @@ function _react() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _interopRequireDefault(
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
16
16
|
style: {
|
17
17
|
height: '100%',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["importer.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/import.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAoD,CAAE,CAClF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
@@ -179,10 +179,10 @@ function _importComponents() {
|
|
179
179
|
};
|
180
180
|
return data;
|
181
181
|
}
|
182
|
-
function _interopRequireDefault(
|
182
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
183
183
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
184
184
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
185
|
-
function _defineProperty(
|
185
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
186
186
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
187
187
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
188
188
|
class ImporterMain {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_dependencyResolver","_workspace","_analytics","_componentIdToPackageName","_interopRequireDefault","_legacyBitId","_pMapSeries","_envs","_componentWriter","_logger","_scope","_laneId","_scopeComponentsImporter","_artifactFiles","_install","_loader","_componentId","_scopeNotFoundOrDenied","_graph","_laneNotFound","_bitError","_import","_importer","_fetchCmd","_importComponents","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ImporterMain","constructor","workspace","depResolver","graph","scope","componentWriter","envs","logger","import","importOptions","packageManagerArgs","OutsideWorkspaceError","consumer","ids","objectsOnly","isOnLane","currentRemoteLane","getCurrentRemoteLane","lanes","laneId","toLaneId","remoteLane","currentLaneId","getCurrentLaneId","importComponents","createImportComponents","results","Analytics","setExtraData","importedIds","writtenComponents","removeFromWorkspaceConfig","onDestroy","importObjects","options","installNpmPackages","writeConfigFiles","importHeadArtifactsFromLane","lane","toComponentIds","throwIfMissing","laneComps","legacyScope","getManyConsumerComponents","importAllArtifactsFromLane","err","error","id","toString","importCurrentObjects","importObjectsFromMainIfExist","cache","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","includeVersionHistory","ignoreMissingHead","fetchLaneComponents","includeUpdateDependents","toComponentIdsIncludeUpdateDependents","importMany","reason","mergeLane","sources","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","fetch","components","fromOriginalScope","allHistory","BitError","loader","start","lanesToFetch","getLanes","shouldFetchFromMain","includes","DEFAULT_LANE","fetchLanes","verbose","writeConfig","override","importDetails","remoteLaneIds","map","trackLane","getRemoteTrackedDataByLocalLane","LaneId","from","remoteScope","parse","objects","remoteLanes","getAllRemoteLaneIds","scopeComponentImporter","ScopeComponentsImporter","getInstance","importLanes","InvalidScopeName","ScopeNotFoundOrDenied","LaneNotFound","InvalidScopeNameFromRemote","stop","console","message","ImportComponents","resultFromMain","importedDeps","resultsPerLane","pMapSeries","setStatusLine","name","isLaneFromRemote","consoleSuccess","reduce","acc","curr","importLaneObject","persistIfNotExists","includeLaneHistory","laneObject","exists","loadLane","hasChanged","importObjectsByHashes","hashes","groupByScope","importManyObjects","component","importedPackageNames","getImportedPackagesNames","isRemoved","removeFromRootPolicy","persistConfig","componentIdToPackageName","provider","cli","install","loggerMain","createLogger","ImporterAspect","importerMain","registerPreInstall","opts","registerPreLink","fetchObject","register","ImportCmd","FetchCmd","exports","CLIAspect","WorkspaceAspect","DependencyResolverAspect","GraphAspect","ScopeAspect","ComponentWriterAspect","InstallAspect","EnvsAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["importer.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { InvalidScopeName, InvalidScopeNameFromRemote } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { importAllArtifactsFromLane } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { ScopeNotFoundOrDenied } from '@teambit/legacy/dist/remotes/exceptions/scope-not-found-or-denied';\nimport { GraphAspect, GraphMain } from '@teambit/graph';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportCmd } from './import.cmd';\nimport { ImporterAspect } from './importer.aspect';\nimport { FetchCmd } from './fetch-cmd';\nimport ImportComponents, { ImportOptions, ImportResult } from './import-components';\n\nexport class ImporterMain {\n constructor(\n private workspace: Workspace,\n private depResolver: DependencyResolverMain,\n private graph: GraphMain,\n private scope: ScopeMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n readonly logger: Logger\n ) {}\n\n async import(importOptions: ImportOptions, packageManagerArgs: string[] = []): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n consumer.packageManagerArgs = packageManagerArgs;\n if (!importOptions.ids.length) {\n importOptions.objectsOnly = true;\n }\n if (this.workspace.consumer.isOnLane()) {\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneId: currentRemoteLane.toLaneId(), remoteLane: currentRemoteLane };\n } else if (!importOptions.ids.length) {\n // this is probably a local lane that was never exported.\n // although no need to fetch from the lane, still, the import is needed for main (which are available on this\n // local lane)\n const currentLaneId = this.workspace.getCurrentLaneId();\n importOptions.lanes = { laneId: currentLaneId };\n }\n }\n const importComponents = this.createImportComponents(importOptions);\n const results = await importComponents.importComponents();\n Analytics.setExtraData('num_components', results.importedIds.length);\n if (results.writtenComponents && results.writtenComponents.length) {\n await this.removeFromWorkspaceConfig(results.writtenComponents);\n }\n await consumer.onDestroy('import');\n return results;\n }\n\n /**\n * fetch objects according to the criteria set by `options` param.\n * to fetch current objects according to the current lane or main, use `this.importCurrentObjects()`.\n */\n async importObjects(options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n const importOptions: ImportOptions = {\n ...options,\n objectsOnly: true,\n ids: options.ids || [],\n installNpmPackages: false,\n writeConfigFiles: false,\n };\n const importComponents = this.createImportComponents(importOptions);\n return importComponents.importComponents();\n }\n\n /**\n * given a lane object, load all components by their head on the lane, find the artifacts refs and import them from\n * the lane scope\n */\n async importHeadArtifactsFromLane(lane: Lane, ids: ComponentID[] = lane.toComponentIds(), throwIfMissing = false) {\n const laneComps = await this.scope.legacyScope.getManyConsumerComponents(ids);\n try {\n await importAllArtifactsFromLane(this.scope.legacyScope, laneComps, lane);\n } catch (err) {\n this.logger.error(`failed fetching artifacts for lane ${lane.id.toString()}`, err);\n if (throwIfMissing) throw err;\n }\n }\n\n /**\n * if on main, fetch main objects, if on lane, fetch lane objects.\n */\n async importCurrentObjects(): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n installNpmPackages: false,\n writeConfigFiles: false,\n };\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneId: currentRemoteLane.toLaneId(), remoteLane: currentRemoteLane };\n }\n const importComponents = this.createImportComponents(importOptions);\n return importComponents.importComponents();\n }\n\n async importObjectsFromMainIfExist(ids: ComponentID[], { cache } = { cache: false }) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(ids), {\n cache,\n includeVersionHistory: true,\n ignoreMissingHead: true,\n });\n }\n\n /**\n * fetch lane's components and save them in the local scope.\n * once done, merge the lane object and save it as well.\n */\n async fetchLaneComponents(lane: Lane, includeUpdateDependents = false) {\n const ids = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n await this.scope.legacyScope.scopeImporter.importMany({\n ids,\n lane,\n reason: `for fetching lane ${lane.id()}`,\n });\n const { mergeLane } = await this.scope.legacyScope.sources.mergeLane(lane, true);\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergeLane);\n await this.scope.legacyScope.lanes.saveLane(mergeLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'fetch (merge from remote)',\n });\n }\n\n async fetch(ids: string[], lanes: boolean, components: boolean, fromOriginalScope: boolean, allHistory = false) {\n if (!lanes && !components) {\n throw new BitError(\n `please provide the type of objects you would like to pull, the options are --components and --lanes`\n );\n }\n loader.start('fetching objects...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n\n if (lanes) {\n const lanesToFetch = await getLanes(this.logger);\n const shouldFetchFromMain = !ids.length || ids.includes(DEFAULT_LANE);\n return this.fetchLanes(lanesToFetch, shouldFetchFromMain, { allHistory });\n }\n\n const importOptions: ImportOptions = {\n ids,\n objectsOnly: true,\n allHistory,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n writeConfigFiles: false,\n fromOriginalScope,\n };\n\n const importComponents = this.createImportComponents(importOptions);\n const { importedIds, importDetails } = await importComponents.importComponents();\n Analytics.setExtraData('num_components', importedIds.length);\n await consumer.onDestroy('import');\n return { importedIds, importDetails };\n\n async function getLanes(logger: Logger): Promise<Lane[]> {\n let remoteLaneIds: LaneId[] = [];\n if (ids.length) {\n remoteLaneIds = ids\n .filter((id) => id !== DEFAULT_LANE)\n .map((id) => {\n const trackLane = consumer.scope.lanes.getRemoteTrackedDataByLocalLane(id);\n if (trackLane) return LaneId.from(trackLane.remoteLane, trackLane.remoteScope);\n return LaneId.parse(id);\n });\n } else {\n remoteLaneIds = await consumer.scope.objects.remoteLanes.getAllRemoteLaneIds();\n }\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(consumer.scope);\n try {\n return await scopeComponentImporter.importLanes(remoteLaneIds);\n } catch (err: any) {\n if (\n err instanceof InvalidScopeName ||\n err instanceof ScopeNotFoundOrDenied ||\n err instanceof LaneNotFound ||\n err instanceof InvalidScopeNameFromRemote\n ) {\n // the lane could be a local lane so no need to throw an error in such case\n loader.stop();\n logger.console(`unable to get lane's data from a remote due to an error:\\n${err.message}`, 'warn', 'yellow');\n } else {\n throw err;\n }\n }\n\n return [];\n }\n }\n\n private createImportComponents(importOptions: ImportOptions) {\n return new ImportComponents(\n this.workspace,\n this.graph,\n this.componentWriter,\n this.envs,\n this.logger,\n importOptions\n );\n }\n\n async fetchLanes(\n lanes: Lane[],\n shouldFetchFromMain?: boolean,\n options: Partial<ImportOptions> = {}\n ): Promise<ImportResult> {\n const resultFromMain = shouldFetchFromMain\n ? await this.importObjects(options)\n : { importedIds: [], importDetails: [], importedDeps: [] };\n const resultsPerLane = await pMapSeries(lanes, async (lane) => {\n this.logger.setStatusLine(`fetching lane ${lane.name}`);\n options.lanes = { laneId: lane.toLaneId(), remoteLane: lane };\n options.isLaneFromRemote = true;\n const results = await this.importObjects(options);\n this.logger.consoleSuccess();\n return results;\n });\n resultsPerLane.push(resultFromMain);\n const results = resultsPerLane.reduce((acc, curr) => {\n acc.importedIds.push(...curr.importedIds);\n acc.importDetails.push(...curr.importDetails);\n return acc;\n });\n return results;\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true, includeLaneHistory = false): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const results = await legacyScope.scopeImporter.importLanes([laneId], includeLaneHistory);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n laneObject.hasChanged = true;\n await legacyScope.lanes.saveLane(laneObject, { saveLaneHistory: false });\n }\n }\n\n return laneObject;\n }\n\n async importObjectsByHashes(hashes: string[], scope: string, reason?: string) {\n const groupByScope = { [scope]: hashes };\n const results = await this.scope.legacyScope.scopeImporter.importManyObjects(groupByScope, reason);\n return results;\n }\n\n private async removeFromWorkspaceConfig(component: ConsumerComponent[]) {\n const importedPackageNames = this.getImportedPackagesNames(component);\n const isRemoved = this.depResolver.removeFromRootPolicy(importedPackageNames);\n if (isRemoved) await this.depResolver.persistConfig('import (remove package)');\n }\n\n private getImportedPackagesNames(components: ConsumerComponent[]): string[] {\n return components.map((component) => componentIdToPackageName(component));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n GraphAspect,\n ScopeAspect,\n ComponentWriterAspect,\n InstallAspect,\n EnvsAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n GraphMain,\n ScopeMain,\n ComponentWriterMain,\n InstallMain,\n EnvsMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(ImporterAspect.id);\n const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, envs, logger);\n install.registerPreInstall(async (opts) => {\n if (!opts?.import) return;\n logger.setStatusLine('importing missing objects');\n await importerMain.importCurrentObjects();\n // logger.consoleSuccess();\n });\n install.registerPreLink(async (opts) => {\n if (opts?.fetchObject) await importerMain.importCurrentObjects();\n });\n cli.register(new ImportCmd(importerMain), new FetchCmd(importerMain));\n return importerMain;\n }\n}\n\nImporterAspect.addRuntime(ImporterMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA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C,IAAI,IAAK;MACzC,IAAI,CAACA,IAAI,EAAE3I,MAAM,EAAE;MACnBD,MAAM,CAAC2G,aAAa,CAAC,2BAA2B,CAAC;MACjD,MAAM+B,YAAY,CAAChG,oBAAoB,CAAC,CAAC;MACzC;IACF,CAAC,CAAC;IACF4F,OAAO,CAACO,eAAe,CAAC,MAAOD,IAAI,IAAK;MACtC,IAAIA,IAAI,EAAEE,WAAW,EAAE,MAAMJ,YAAY,CAAChG,oBAAoB,CAAC,CAAC;IAClE,CAAC,CAAC;IACF2F,GAAG,CAACU,QAAQ,CAAC,KAAIC,mBAAS,EAACN,YAAY,CAAC,EAAE,KAAIO,oBAAQ,EAACP,YAAY,CAAC,CAAC;IACrE,OAAOA,YAAY;EACrB;AACF;AAACQ,OAAA,CAAA1J,YAAA,GAAAA,YAAA;AAAAjB,eAAA,CA3SYiB,YAAY,WAqQR,EAAE;AAAAjB,eAAA,CArQNiB,YAAY,kBAsQD,CACpB2J,gBAAS,EACTC,4BAAe,EACfC,8CAAwB,EACxBC,oBAAW,EACXC,oBAAW,EACXC,wCAAqB,EACrBC,wBAAa,EACbC,kBAAU,EACVC,sBAAY,CACb;AAAApL,eAAA,CAhRUiB,YAAY,aAiRNoK,kBAAW;AA4B9BnB,0BAAc,CAACoB,UAAU,CAACrK,YAAY,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_cli","data","require","_dependencyResolver","_workspace","_analytics","_componentIdToPackageName","_interopRequireDefault","_legacyBitId","_pMapSeries","_envs","_componentWriter","_logger","_scope","_laneId","_scopeComponentsImporter","_artifactFiles","_install","_loader","_componentId","_scopeNotFoundOrDenied","_graph","_laneNotFound","_bitError","_import","_importer","_fetchCmd","_importComponents","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ImporterMain","constructor","workspace","depResolver","graph","scope","componentWriter","envs","logger","import","importOptions","packageManagerArgs","OutsideWorkspaceError","consumer","ids","objectsOnly","isOnLane","currentRemoteLane","getCurrentRemoteLane","lanes","laneId","toLaneId","remoteLane","currentLaneId","getCurrentLaneId","importComponents","createImportComponents","results","Analytics","setExtraData","importedIds","writtenComponents","removeFromWorkspaceConfig","onDestroy","importObjects","options","installNpmPackages","writeConfigFiles","importHeadArtifactsFromLane","lane","toComponentIds","throwIfMissing","laneComps","legacyScope","getManyConsumerComponents","importAllArtifactsFromLane","err","error","id","toString","importCurrentObjects","importObjectsFromMainIfExist","cache","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","includeVersionHistory","ignoreMissingHead","fetchLaneComponents","includeUpdateDependents","toComponentIdsIncludeUpdateDependents","importMany","reason","mergeLane","sources","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","fetch","components","fromOriginalScope","allHistory","BitError","loader","start","lanesToFetch","getLanes","shouldFetchFromMain","includes","DEFAULT_LANE","fetchLanes","verbose","writeConfig","override","importDetails","remoteLaneIds","map","trackLane","getRemoteTrackedDataByLocalLane","LaneId","from","remoteScope","parse","objects","remoteLanes","getAllRemoteLaneIds","scopeComponentImporter","ScopeComponentsImporter","getInstance","importLanes","InvalidScopeName","ScopeNotFoundOrDenied","LaneNotFound","InvalidScopeNameFromRemote","stop","console","message","ImportComponents","resultFromMain","importedDeps","resultsPerLane","pMapSeries","setStatusLine","name","isLaneFromRemote","consoleSuccess","reduce","acc","curr","importLaneObject","persistIfNotExists","includeLaneHistory","laneObject","exists","loadLane","hasChanged","importObjectsByHashes","hashes","groupByScope","importManyObjects","component","importedPackageNames","getImportedPackagesNames","isRemoved","removeFromRootPolicy","persistConfig","componentIdToPackageName","provider","cli","install","loggerMain","createLogger","ImporterAspect","importerMain","registerPreInstall","opts","registerPreLink","fetchObject","register","ImportCmd","FetchCmd","exports","CLIAspect","WorkspaceAspect","DependencyResolverAspect","GraphAspect","ScopeAspect","ComponentWriterAspect","InstallAspect","EnvsAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["importer.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { InvalidScopeName, InvalidScopeNameFromRemote } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { importAllArtifactsFromLane } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { ScopeNotFoundOrDenied } from '@teambit/legacy/dist/remotes/exceptions/scope-not-found-or-denied';\nimport { GraphAspect, GraphMain } from '@teambit/graph';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportCmd } from './import.cmd';\nimport { ImporterAspect } from './importer.aspect';\nimport { FetchCmd } from './fetch-cmd';\nimport ImportComponents, { ImportOptions, ImportResult } from './import-components';\n\nexport class ImporterMain {\n constructor(\n private workspace: Workspace,\n private depResolver: DependencyResolverMain,\n private graph: GraphMain,\n private scope: ScopeMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n readonly logger: Logger\n ) {}\n\n async import(importOptions: ImportOptions, packageManagerArgs: string[] = []): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n consumer.packageManagerArgs = packageManagerArgs;\n if (!importOptions.ids.length) {\n importOptions.objectsOnly = true;\n }\n if (this.workspace.consumer.isOnLane()) {\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneId: currentRemoteLane.toLaneId(), remoteLane: currentRemoteLane };\n } else if (!importOptions.ids.length) {\n // this is probably a local lane that was never exported.\n // although no need to fetch from the lane, still, the import is needed for main (which are available on this\n // local lane)\n const currentLaneId = this.workspace.getCurrentLaneId();\n importOptions.lanes = { laneId: currentLaneId };\n }\n }\n const importComponents = this.createImportComponents(importOptions);\n const results = await importComponents.importComponents();\n Analytics.setExtraData('num_components', results.importedIds.length);\n if (results.writtenComponents && results.writtenComponents.length) {\n await this.removeFromWorkspaceConfig(results.writtenComponents);\n }\n await consumer.onDestroy('import');\n return results;\n }\n\n /**\n * fetch objects according to the criteria set by `options` param.\n * to fetch current objects according to the current lane or main, use `this.importCurrentObjects()`.\n */\n async importObjects(options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n const importOptions: ImportOptions = {\n ...options,\n objectsOnly: true,\n ids: options.ids || [],\n installNpmPackages: false,\n writeConfigFiles: false,\n };\n const importComponents = this.createImportComponents(importOptions);\n return importComponents.importComponents();\n }\n\n /**\n * given a lane object, load all components by their head on the lane, find the artifacts refs and import them from\n * the lane scope\n */\n async importHeadArtifactsFromLane(lane: Lane, ids: ComponentID[] = lane.toComponentIds(), throwIfMissing = false) {\n const laneComps = await this.scope.legacyScope.getManyConsumerComponents(ids);\n try {\n await importAllArtifactsFromLane(this.scope.legacyScope, laneComps, lane);\n } catch (err) {\n this.logger.error(`failed fetching artifacts for lane ${lane.id.toString()}`, err);\n if (throwIfMissing) throw err;\n }\n }\n\n /**\n * if on main, fetch main objects, if on lane, fetch lane objects.\n */\n async importCurrentObjects(): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n installNpmPackages: false,\n writeConfigFiles: false,\n };\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneId: currentRemoteLane.toLaneId(), remoteLane: currentRemoteLane };\n }\n const importComponents = this.createImportComponents(importOptions);\n return importComponents.importComponents();\n }\n\n async importObjectsFromMainIfExist(ids: ComponentID[], { cache } = { cache: false }) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(ids), {\n cache,\n includeVersionHistory: true,\n ignoreMissingHead: true,\n });\n }\n\n /**\n * fetch lane's components and save them in the local scope.\n * once done, merge the lane object and save it as well.\n */\n async fetchLaneComponents(lane: Lane, includeUpdateDependents = false) {\n const ids = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n await this.scope.legacyScope.scopeImporter.importMany({\n ids,\n lane,\n reason: `for fetching lane ${lane.id()}`,\n });\n const { mergeLane } = await this.scope.legacyScope.sources.mergeLane(lane, true);\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergeLane);\n await this.scope.legacyScope.lanes.saveLane(mergeLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'fetch (merge from remote)',\n });\n }\n\n async fetch(ids: string[], lanes: boolean, components: boolean, fromOriginalScope: boolean, allHistory = false) {\n if (!lanes && !components) {\n throw new BitError(\n `please provide the type of objects you would like to pull, the options are --components and --lanes`\n );\n }\n loader.start('fetching objects...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n\n if (lanes) {\n const lanesToFetch = await getLanes(this.logger);\n const shouldFetchFromMain = !ids.length || ids.includes(DEFAULT_LANE);\n return this.fetchLanes(lanesToFetch, shouldFetchFromMain, { allHistory });\n }\n\n const importOptions: ImportOptions = {\n ids,\n objectsOnly: true,\n allHistory,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n writeConfigFiles: false,\n fromOriginalScope,\n };\n\n const importComponents = this.createImportComponents(importOptions);\n const { importedIds, importDetails } = await importComponents.importComponents();\n Analytics.setExtraData('num_components', importedIds.length);\n await consumer.onDestroy('import');\n return { importedIds, importDetails };\n\n async function getLanes(logger: Logger): Promise<Lane[]> {\n let remoteLaneIds: LaneId[] = [];\n if (ids.length) {\n remoteLaneIds = ids\n .filter((id) => id !== DEFAULT_LANE)\n .map((id) => {\n const trackLane = consumer.scope.lanes.getRemoteTrackedDataByLocalLane(id);\n if (trackLane) return LaneId.from(trackLane.remoteLane, trackLane.remoteScope);\n return LaneId.parse(id);\n });\n } else {\n remoteLaneIds = await consumer.scope.objects.remoteLanes.getAllRemoteLaneIds();\n }\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(consumer.scope);\n try {\n return await scopeComponentImporter.importLanes(remoteLaneIds);\n } catch (err: any) {\n if (\n err instanceof InvalidScopeName ||\n err instanceof ScopeNotFoundOrDenied ||\n err instanceof LaneNotFound ||\n err instanceof InvalidScopeNameFromRemote\n ) {\n // the lane could be a local lane so no need to throw an error in such case\n loader.stop();\n logger.console(`unable to get lane's data from a remote due to an error:\\n${err.message}`, 'warn', 'yellow');\n } else {\n throw err;\n }\n }\n\n return [];\n }\n }\n\n private createImportComponents(importOptions: ImportOptions) {\n return new ImportComponents(\n this.workspace,\n this.graph,\n this.componentWriter,\n this.envs,\n this.logger,\n importOptions\n );\n }\n\n async fetchLanes(\n lanes: Lane[],\n shouldFetchFromMain?: boolean,\n options: Partial<ImportOptions> = {}\n ): Promise<ImportResult> {\n const resultFromMain = shouldFetchFromMain\n ? await this.importObjects(options)\n : { importedIds: [], importDetails: [], importedDeps: [] };\n const resultsPerLane = await pMapSeries(lanes, async (lane) => {\n this.logger.setStatusLine(`fetching lane ${lane.name}`);\n options.lanes = { laneId: lane.toLaneId(), remoteLane: lane };\n options.isLaneFromRemote = true;\n const results = await this.importObjects(options);\n this.logger.consoleSuccess();\n return results;\n });\n resultsPerLane.push(resultFromMain);\n const results = resultsPerLane.reduce((acc, curr) => {\n acc.importedIds.push(...curr.importedIds);\n acc.importDetails.push(...curr.importDetails);\n return acc;\n });\n return results;\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true, includeLaneHistory = false): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const results = await legacyScope.scopeImporter.importLanes([laneId], includeLaneHistory);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n laneObject.hasChanged = true;\n await legacyScope.lanes.saveLane(laneObject, { saveLaneHistory: false });\n }\n }\n\n return laneObject;\n }\n\n async importObjectsByHashes(hashes: string[], scope: string, reason?: string) {\n const groupByScope = { [scope]: hashes };\n const results = await this.scope.legacyScope.scopeImporter.importManyObjects(groupByScope, reason);\n return results;\n }\n\n private async removeFromWorkspaceConfig(component: ConsumerComponent[]) {\n const importedPackageNames = this.getImportedPackagesNames(component);\n const isRemoved = this.depResolver.removeFromRootPolicy(importedPackageNames);\n if (isRemoved) await this.depResolver.persistConfig('import (remove package)');\n }\n\n private getImportedPackagesNames(components: ConsumerComponent[]): string[] {\n return components.map((component) => componentIdToPackageName(component));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n GraphAspect,\n ScopeAspect,\n ComponentWriterAspect,\n InstallAspect,\n EnvsAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n GraphMain,\n ScopeMain,\n ComponentWriterMain,\n InstallMain,\n EnvsMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(ImporterAspect.id);\n const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, envs, logger);\n install.registerPreInstall(async (opts) => {\n if (!opts?.import) return;\n logger.setStatusLine('importing missing objects');\n await importerMain.importCurrentObjects();\n // logger.consoleSuccess();\n });\n install.registerPreLink(async (opts) => {\n if (opts?.fetchObject) await importerMain.importCurrentObjects();\n });\n cli.register(new ImportCmd(importerMain), new FetchCmd(importerMain));\n return importerMain;\n }\n}\n\nImporterAspect.addRuntime(ImporterMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,0BAAA;EAAA,MAAAL,IAAA,GAAAM,sBAAA,CAAAL,OAAA;EAAAI,yBAAA,YAAAA,CA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D,MAAM+B,YAAY,CAAChG,oBAAoB,CAAC,CAAC;MACzC;IACF,CAAC,CAAC;IACF4F,OAAO,CAACO,eAAe,CAAC,MAAOD,IAAI,IAAK;MACtC,IAAIA,IAAI,EAAEE,WAAW,EAAE,MAAMJ,YAAY,CAAChG,oBAAoB,CAAC,CAAC;IAClE,CAAC,CAAC;IACF2F,GAAG,CAACU,QAAQ,CAAC,KAAIC,mBAAS,EAACN,YAAY,CAAC,EAAE,KAAIO,oBAAQ,EAACP,YAAY,CAAC,CAAC;IACrE,OAAOA,YAAY;EACrB;AACF;AAACQ,OAAA,CAAA1J,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CA3SYgB,YAAY,WAqQR,EAAE;AAAAhB,eAAA,CArQNgB,YAAY,kBAsQD,CACpB2J,gBAAS,EACTC,4BAAe,EACfC,8CAAwB,EACxBC,oBAAW,EACXC,oBAAW,EACXC,wCAAqB,EACrBC,wBAAa,EACbC,kBAAU,EACVC,sBAAY,CACb;AAAAnL,eAAA,CAhRUgB,YAAY,aAiRNoK,kBAAW;AA4B9BnB,0BAAc,CAACoB,UAAU,CAACrK,YAAY,CAAC","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.284/dist/importer.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.284/dist/importer.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/importer",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.284",
|
4
4
|
"homepage": "https://bit.cloud/teambit/scope/importer",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.scope",
|
8
8
|
"name": "importer",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.284"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -20,18 +20,18 @@
|
|
20
20
|
"@teambit/lane-id": "0.0.311",
|
21
21
|
"@teambit/harmony": "0.4.6",
|
22
22
|
"@teambit/legacy-bit-id": "1.1.1",
|
23
|
-
"@teambit/graph": "1.0.
|
23
|
+
"@teambit/graph": "1.0.284",
|
24
24
|
"@teambit/logger": "0.0.958",
|
25
|
-
"@teambit/workspace": "1.0.
|
25
|
+
"@teambit/workspace": "1.0.284",
|
26
26
|
"@teambit/cli": "0.0.865",
|
27
|
-
"@teambit/checkout": "1.0.
|
28
|
-
"@teambit/component-writer": "1.0.
|
29
|
-
"@teambit/config-merger": "0.0.
|
30
|
-
"@teambit/envs": "1.0.
|
31
|
-
"@teambit/merging": "1.0.
|
32
|
-
"@teambit/dependency-resolver": "1.0.
|
33
|
-
"@teambit/install": "1.0.
|
34
|
-
"@teambit/scope": "1.0.
|
27
|
+
"@teambit/checkout": "1.0.284",
|
28
|
+
"@teambit/component-writer": "1.0.284",
|
29
|
+
"@teambit/config-merger": "0.0.151",
|
30
|
+
"@teambit/envs": "1.0.284",
|
31
|
+
"@teambit/merging": "1.0.284",
|
32
|
+
"@teambit/dependency-resolver": "1.0.284",
|
33
|
+
"@teambit/install": "1.0.284",
|
34
|
+
"@teambit/scope": "1.0.284"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
37
|
"@types/lodash": "4.14.165",
|