@teambit/importer 1.0.317 → 1.0.319

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"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","dependenciesHead","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","importHeadDependenciesDirectly","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 dependenciesHead?: 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 ['', 'dependencies-head', 'same as --dependencies, except it imports the dependencies with their head version'],\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 dependenciesHead = 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 && dependenciesHead) {\n throw new BitError('you have to specify ids to use \"--dependencies-head\" 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 importHeadDependenciesDirectly: dependenciesHead,\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 `- 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CAAEwG,CAAC,IAAKA,CAAC,CAAChG,QAAQ,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GACnG,EAAE;EACN,IAAIL,MAAM,KAAK,YAAY,IAAI,CAAC8F,WAAW,IAAI,CAAChB,UAAU,IAAI,CAACc,eAAe,IAAI,CAACC,OAAO,EAAE;IAC1F,OAAOpC,SAAS;EAClB;EACA,OAAO3E,gBAAK,CAACkH,GAAG,CACd,KAAKlH,gBAAK,CAACmC,KAAK,CAACjB,MAAM,CAAC,IAAIlB,gBAAK,CAACiG,IAAI,CACpCnF,EACF,CAAC,IAAIqF,QAAQ,GAAGE,WAAW,IAAIS,eAAe,GAAGd,UAAU,GAAGe,OAAO,IAAIC,WAAW,EACtF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_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","dependenciesHead","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","importHeadDependenciesDirectly","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 {\n installationErrorOutput,\n compilationErrorOutput,\n getWorkspaceConfigUpdateOutput,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/merging';\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 dependenciesHead?: 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 ['', 'dependencies-head', 'same as --dependencies, except it imports the dependencies with their head version'],\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 dependenciesHead = 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 && dependenciesHead) {\n throw new BitError('you have to specify ids to use \"--dependencies-head\" 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 importHeadDependenciesDirectly: dependenciesHead,\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,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAA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;EACvG,MAAM8G,OAAO,GAAG1H,aAAa,CAAC0H,OAAO,GAAG/G,gBAAK,CAAC6F,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;EACjE,MAAMmB,WAAW,GAAG3H,aAAa,CAAC2H,WAAW,CAACjH,MAAM,GAChDC,gBAAK,CAAC6F,GAAG,CAAC,yBAAyBxG,aAAa,CAAC2H,WAAW,CAACvG,GAAG,CAAEwG,CAAC,IAAKA,CAAC,CAAChG,QAAQ,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GACnG,EAAE;EACN,IAAIL,MAAM,KAAK,YAAY,IAAI,CAAC8F,WAAW,IAAI,CAAChB,UAAU,IAAI,CAACc,eAAe,IAAI,CAACC,OAAO,EAAE;IAC1F,OAAOpC,SAAS;EAClB;EACA,OAAO3E,gBAAK,CAACkH,GAAG,CACd,KAAKlH,gBAAK,CAACmC,KAAK,CAACjB,MAAM,CAAC,IAAIlB,gBAAK,CAACiG,IAAI,CACpCnF,EACF,CAAC,IAAIqF,QAAQ,GAAGE,WAAW,IAAIS,eAAe,GAAGd,UAAU,GAAGe,OAAO,IAAIC,WAAW,EACtF,CAAC;AACH","ignoreList":[]}
@@ -11,6 +11,7 @@ import { ComponentID } from '@teambit/component-id';
11
11
  import { Lane } from '@teambit/legacy/dist/scope/models';
12
12
  import { GraphMain } from '@teambit/graph';
13
13
  import { ImportOptions, ImportResult } from './import-components';
14
+ import { ListerMain } from '@teambit/lister';
14
15
  export declare class ImporterMain {
15
16
  private workspace;
16
17
  private depResolver;
@@ -19,7 +20,8 @@ export declare class ImporterMain {
19
20
  private componentWriter;
20
21
  private envs;
21
22
  readonly logger: Logger;
22
- constructor(workspace: Workspace, depResolver: DependencyResolverMain, graph: GraphMain, scope: ScopeMain, componentWriter: ComponentWriterMain, envs: EnvsMain, logger: Logger);
23
+ private lister;
24
+ constructor(workspace: Workspace, depResolver: DependencyResolverMain, graph: GraphMain, scope: ScopeMain, componentWriter: ComponentWriterMain, envs: EnvsMain, logger: Logger, lister: ListerMain);
23
25
  import(importOptions: ImportOptions, packageManagerArgs?: string[]): Promise<ImportResult>;
24
26
  /**
25
27
  * fetch objects according to the criteria set by `options` param.
@@ -63,7 +65,7 @@ export declare class ImporterMain {
63
65
  static slots: never[];
64
66
  static dependencies: import("@teambit/harmony").Aspect[];
65
67
  static runtime: import("@teambit/harmony").RuntimeDefinition;
66
- static provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain]: [
68
+ static provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain, lister,]: [
67
69
  CLIMain,
68
70
  Workspace,
69
71
  DependencyResolverMain,
@@ -72,6 +74,7 @@ export declare class ImporterMain {
72
74
  ComponentWriterMain,
73
75
  InstallMain,
74
76
  EnvsMain,
75
- LoggerMain
77
+ LoggerMain,
78
+ ListerMain
76
79
  ]): Promise<ImporterMain>;
77
80
  }
@@ -25,9 +25,9 @@ function _workspace() {
25
25
  };
26
26
  return data;
27
27
  }
28
- function _analytics() {
29
- const data = require("@teambit/legacy/dist/analytics/analytics");
30
- _analytics = function () {
28
+ function _legacy() {
29
+ const data = require("@teambit/legacy.analytics");
30
+ _legacy = function () {
31
31
  return data;
32
32
  };
33
33
  return data;
@@ -179,6 +179,13 @@ function _importComponents() {
179
179
  };
180
180
  return data;
181
181
  }
182
+ function _lister() {
183
+ const data = require("@teambit/lister");
184
+ _lister = function () {
185
+ return data;
186
+ };
187
+ return data;
188
+ }
182
189
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
183
190
  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
191
  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; }
@@ -186,7 +193,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
186
193
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
187
194
  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
195
  class ImporterMain {
189
- constructor(workspace, depResolver, graph, scope, componentWriter, envs, logger) {
196
+ constructor(workspace, depResolver, graph, scope, componentWriter, envs, logger, lister) {
190
197
  this.workspace = workspace;
191
198
  this.depResolver = depResolver;
192
199
  this.graph = graph;
@@ -194,6 +201,7 @@ class ImporterMain {
194
201
  this.componentWriter = componentWriter;
195
202
  this.envs = envs;
196
203
  this.logger = logger;
204
+ this.lister = lister;
197
205
  }
198
206
  async import(importOptions, packageManagerArgs = []) {
199
207
  if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
@@ -221,7 +229,7 @@ class ImporterMain {
221
229
  }
222
230
  const importComponents = this.createImportComponents(importOptions);
223
231
  const results = await importComponents.importComponents();
224
- _analytics().Analytics.setExtraData('num_components', results.importedIds.length);
232
+ _legacy().Analytics.setExtraData('num_components', results.importedIds.length);
225
233
  if (results.writtenComponents && results.writtenComponents.length) {
226
234
  await this.removeFromWorkspaceConfig(results.writtenComponents);
227
235
  }
@@ -341,7 +349,7 @@ class ImporterMain {
341
349
  importedIds,
342
350
  importDetails
343
351
  } = await importComponents.importComponents();
344
- _analytics().Analytics.setExtraData('num_components', importedIds.length);
352
+ _legacy().Analytics.setExtraData('num_components', importedIds.length);
345
353
  await consumer.onDestroy('import');
346
354
  return {
347
355
  importedIds,
@@ -374,7 +382,7 @@ class ImporterMain {
374
382
  }
375
383
  }
376
384
  createImportComponents(importOptions) {
377
- return new (_importComponents().default)(this.workspace, this.graph, this.componentWriter, this.envs, this.logger, importOptions);
385
+ return new (_importComponents().default)(this.workspace, this.graph, this.componentWriter, this.envs, this.logger, this.lister, importOptions);
378
386
  }
379
387
  async fetchLanes(lanes, shouldFetchFromMain, options = {}) {
380
388
  const resultFromMain = shouldFetchFromMain ? await this.importObjects(options) : {
@@ -440,9 +448,9 @@ class ImporterMain {
440
448
  getImportedPackagesNames(components) {
441
449
  return components.map(component => (0, _componentIdToPackageName().default)(component));
442
450
  }
443
- static async provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain]) {
451
+ static async provider([cli, workspace, depResolver, graph, scope, componentWriter, install, envs, loggerMain, lister]) {
444
452
  const logger = loggerMain.createLogger(_importer().ImporterAspect.id);
445
- const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, envs, logger);
453
+ const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, envs, logger, lister);
446
454
  install.registerPreInstall(async opts => {
447
455
  if (!opts?.import) return;
448
456
  logger.setStatusLine('importing missing objects');
@@ -458,7 +466,7 @@ class ImporterMain {
458
466
  }
459
467
  exports.ImporterMain = ImporterMain;
460
468
  _defineProperty(ImporterMain, "slots", []);
461
- _defineProperty(ImporterMain, "dependencies", [_cli().CLIAspect, _workspace().WorkspaceAspect, _dependencyResolver().DependencyResolverAspect, _graph().GraphAspect, _scope().ScopeAspect, _componentWriter().ComponentWriterAspect, _install().InstallAspect, _envs().EnvsAspect, _logger().LoggerAspect]);
469
+ _defineProperty(ImporterMain, "dependencies", [_cli().CLIAspect, _workspace().WorkspaceAspect, _dependencyResolver().DependencyResolverAspect, _graph().GraphAspect, _scope().ScopeAspect, _componentWriter().ComponentWriterAspect, _install().InstallAspect, _envs().EnvsAspect, _logger().LoggerAspect, _lister().ListerAspect]);
462
470
  _defineProperty(ImporterMain, "runtime", _cli().MainRuntime);
463
471
  _importer().ImporterAspect.addRuntime(ImporterMain);
464
472
 
@@ -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","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;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+ {"version":3,"names":["_cli","data","require","_dependencyResolver","_workspace","_legacy","_componentIdToPackageName","_interopRequireDefault","_legacyBitId","_pMapSeries","_envs","_componentWriter","_logger","_scope","_laneId","_scopeComponentsImporter","_artifactFiles","_install","_loader","_componentId","_scopeNotFoundOrDenied","_graph","_laneNotFound","_bitError","_import","_importer","_fetchCmd","_importComponents","_lister","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","lister","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","ListerAspect","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.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';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\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 private lister: ListerMain\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 this.lister,\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 ListerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n depResolver,\n graph,\n scope,\n componentWriter,\n install,\n envs,\n loggerMain,\n lister,\n ]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n GraphMain,\n ScopeMain,\n ComponentWriterMain,\n InstallMain,\n EnvsMain,\n LoggerMain,\n ListerMain\n ]) {\n const logger = loggerMain.createLogger(ImporterAspect.id);\n const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, envs, logger, lister);\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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BAAS,EACTC,4BAAe,EACfC,8CAAwB,EACxBC,oBAAW,EACXC,oBAAW,EACXC,wCAAqB,EACrBC,wBAAa,EACbC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,CACb;AAAArL,eAAA,CAnRUgB,YAAY,aAoRNsK,kBAAW;AAwC9BpB,0BAAc,CAACqB,UAAU,CAACvK,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.317/dist/importer.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.317/dist/importer.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.319/dist/importer.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.319/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.317",
3
+ "version": "1.0.319",
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.317"
9
+ "version": "1.0.319"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -20,18 +20,20 @@
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.317",
24
- "@teambit/logger": "0.0.987",
25
- "@teambit/workspace": "1.0.317",
26
- "@teambit/cli": "0.0.894",
27
- "@teambit/checkout": "1.0.317",
28
- "@teambit/component-writer": "1.0.317",
29
- "@teambit/config-merger": "0.0.184",
30
- "@teambit/envs": "1.0.317",
31
- "@teambit/merging": "1.0.317",
32
- "@teambit/dependency-resolver": "1.0.317",
33
- "@teambit/install": "1.0.317",
34
- "@teambit/scope": "1.0.317"
23
+ "@teambit/graph": "1.0.319",
24
+ "@teambit/logger": "0.0.989",
25
+ "@teambit/workspace": "1.0.319",
26
+ "@teambit/cli": "0.0.896",
27
+ "@teambit/merging": "1.0.319",
28
+ "@teambit/checkout": "1.0.319",
29
+ "@teambit/component-writer": "1.0.319",
30
+ "@teambit/config-merger": "0.0.186",
31
+ "@teambit/envs": "1.0.319",
32
+ "@teambit/lister": "1.0.319",
33
+ "@teambit/dependency-resolver": "1.0.319",
34
+ "@teambit/install": "1.0.319",
35
+ "@teambit/legacy.analytics": "0.0.3",
36
+ "@teambit/scope": "1.0.319"
35
37
  },
36
38
  "devDependencies": {
37
39
  "@types/lodash": "4.14.165",