@teambit/eject 1.0.188 → 1.0.189

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"names":["_componentId","data","require","_defaultErrorHandler","_interopRequireDefault","_scopeRemotes","_componentIdToPackageName","packageJsonUtils","_interopRequireWildcard","_dataToPersist","_removePath","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","ComponentsEjector","constructor","workspace","install","logger","componentsIds","ejectOptions","consumer","idsToEject","ComponentIdList","failedComponents","modifiedComponents","stagedComponents","notExportedComponents","selfHostedExportedComponents","eject","decideWhichComponentsToEject","debug","length","loadComponentsToEject","_validateIdsHaveScopesAndVersions","removeComponentsFromNodeModules","untrackComponents","installPackages","removeComponentsFiles","writeBitMap","ejectedComponents","setStatusLine","remotes","getScopeRemotes","scope","hubExportedComponents","forEach","componentId","bitId","isExported","push","isHub","force","Promise","all","map","id","componentStatus","getComponentStatusById","modified","staged","err","throwEjectError","toString","consoleSuccess","components","loadComponents","componentsToEject","action","skipDependencyInstallation","packages","getPackagesToInstall","c","componentIdToPackageName","_buildExceptionMessageWithRollbackData","keepFiles","dataToPersist","DataToPersist","component","componentMap","Error","rootDir","removePath","RemovePath","addBasePath","getPath","persistAllToFS","cleanFromBitMap","message","originalError","originalErrorMessage","defaultErrorHandler","error","hasScope","hasVersion","exports"],"sources":["components-ejector.ts"],"sourcesContent":["/**\n * a classic use case of eject is when a user imports a component using `bit import` to update it,\n * but the user has no intention to have the code as part of the project source code.\n * the eject provides the option to delete the component locally and install it via the NPM client.\n *\n * an implementation note, the entire process is done with rollback in mind.\n * since installing the component via NPM client is an error prone process, we do it first, before\n * removing the component files, so then it's easier to rollback.\n */\nimport { Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport defaultErrorHandler from '@teambit/legacy/dist/cli/default-error-handler';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { Logger } from '@teambit/logger';\nimport { InstallMain } from '@teambit/install';\n\nexport type EjectResults = {\n ejectedComponents: ComponentIdList;\n failedComponents: FailedComponents;\n};\n\nexport type EjectOptions = {\n force?: boolean; // eject although a component is modified/staged\n keepFiles?: boolean; // keep component files on the workspace\n skipDependencyInstallation?: boolean; // skip installing the dependencies\n};\n\ntype FailedComponents = {\n modifiedComponents: ComponentIdList;\n stagedComponents: ComponentIdList;\n notExportedComponents: ComponentIdList;\n selfHostedExportedComponents: ComponentIdList;\n};\n\nexport class ComponentsEjector {\n consumer: Consumer;\n idsToEject: ComponentIdList;\n componentsToEject: Component[] = [];\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n notEjectedDependents: Array<{ dependent: Component; ejectedDependencies: Component[] }>;\n failedComponents: FailedComponents;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n packageJsonFilesBeforeChanges: PackageJsonFile[]; // for rollback in case of errors\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private logger: Logger,\n private componentsIds: ComponentID[],\n private ejectOptions: EjectOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.idsToEject = new ComponentIdList();\n this.failedComponents = {\n modifiedComponents: new ComponentIdList(),\n stagedComponents: new ComponentIdList(),\n notExportedComponents: new ComponentIdList(),\n selfHostedExportedComponents: new ComponentIdList(),\n };\n }\n\n async eject(): Promise<EjectResults> {\n await this.decideWhichComponentsToEject();\n this.logger.debug(`${this.idsToEject.length} to eject`);\n await this.loadComponentsToEject();\n if (this.idsToEject.length) {\n this._validateIdsHaveScopesAndVersions();\n await this.removeComponentsFromNodeModules();\n await this.untrackComponents();\n await this.installPackages();\n await this.removeComponentsFiles();\n await this.consumer.writeBitMap();\n }\n this.logger.debug('eject: completed successfully');\n return {\n ejectedComponents: this.idsToEject,\n failedComponents: this.failedComponents,\n };\n }\n\n async decideWhichComponentsToEject(): Promise<void> {\n this.logger.setStatusLine('Eject: getting the components status');\n if (!this.componentsIds.length) return;\n const remotes = await getScopeRemotes(this.consumer.scope);\n const hubExportedComponents = new ComponentIdList();\n this.componentsIds.forEach((componentId) => {\n const bitId = componentId;\n if (!this.workspace.isExported(bitId)) this.failedComponents.notExportedComponents.push(bitId);\n else if (remotes.isHub(bitId.scope as string)) hubExportedComponents.push(bitId);\n else this.failedComponents.selfHostedExportedComponents.push(bitId);\n });\n if (this.ejectOptions.force) {\n this.idsToEject = hubExportedComponents;\n } else {\n await Promise.all(\n hubExportedComponents.map(async (id) => {\n try {\n const componentStatus = await this.workspace.getComponentStatusById(id);\n if (componentStatus.modified) this.failedComponents.modifiedComponents.push(id);\n else if (componentStatus.staged) this.failedComponents.stagedComponents.push(id);\n else this.idsToEject.push(id);\n } catch (err: any) {\n this.throwEjectError(\n `eject operation failed getting the status of ${id.toString()}, no action has been done.\n please fix the issue to continue.`,\n err\n );\n }\n })\n );\n }\n this.logger.consoleSuccess();\n }\n\n async loadComponentsToEject() {\n const { components } = await this.consumer.loadComponents(this.idsToEject);\n this.componentsToEject = components;\n }\n\n async removeComponentsFromNodeModules() {\n const action = 'Eject: removing the existing components from node_modules';\n this.logger.setStatusLine(action);\n this.logger.debug(action);\n await packageJsonUtils.removeComponentsFromNodeModules(this.consumer, this.componentsToEject);\n this.logger.consoleSuccess(action);\n }\n\n async installPackages() {\n if (this.ejectOptions.skipDependencyInstallation) return;\n this.logger.setStatusLine('Eject: installing packages using the package-manager');\n const packages = this.getPackagesToInstall();\n await this.install.install(packages);\n }\n\n getPackagesToInstall(): string[] {\n return this.componentsToEject.map((c) => componentIdToPackageName(c));\n }\n\n _buildExceptionMessageWithRollbackData(action: string): string {\n return `eject failed ${action}.\nyour package.json (if existed) has been restored, however, some bit generated data may have been deleted, please run \"bit link\" to restore them.`;\n }\n\n /**\n * as part of the 'eject' operation, a component is removed locally. as opposed to the remove\n * command, in this case, no need to remove the objects from the scope, only remove from the\n * filesystem, which means, delete the component files, untrack from .bitmap and clean\n * package.json and bit.json traces.\n */\n private async removeComponentsFiles() {\n if (this.ejectOptions.keepFiles) {\n return;\n }\n this.logger.setStatusLine('Eject: removing the components files from the filesystem');\n const dataToPersist = new DataToPersist();\n this.componentsToEject.forEach((component) => {\n const componentMap = component.componentMap;\n if (!componentMap) {\n throw new Error('ComponentEjector.removeComponentsFiles expect a component to have componentMap prop');\n }\n const rootDir = componentMap.rootDir;\n if (!rootDir) {\n throw new Error('ComponentEjector.removeComponentsFiles expect a componentMap to have rootDir');\n }\n dataToPersist.removePath(new RemovePath(rootDir, true));\n });\n dataToPersist.addBasePath(this.consumer.getPath());\n await dataToPersist.persistAllToFS();\n this.logger.consoleSuccess();\n }\n\n private async untrackComponents() {\n this.logger.debug('eject: removing the components from the .bitmap');\n await this.consumer.cleanFromBitMap(this.idsToEject);\n }\n\n throwEjectError(message: string, originalError: Error) {\n const { message: originalErrorMessage } = defaultErrorHandler(originalError);\n this.logger.error(`eject has stopped due to an error ${originalErrorMessage}`, originalError);\n throw new Error(`${message}\n\ngot the following error: ${originalErrorMessage}`);\n }\n\n _validateIdsHaveScopesAndVersions() {\n this.idsToEject.forEach((id) => {\n if (!id.hasScope() || !id.hasVersion()) {\n throw new TypeError(`EjectComponents expects ids with scope and version, got ${id.toString()}`);\n }\n });\n }\n}\n"],"mappings":";;;;;;AAWA,SAAAA,aAAA;EA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AAE,CAACO,QAAQ,CAAC,CAAE,EAAC,CAAC;MACjG;IACF,CAAC,CAAC;EACJ;AACF;AAACgC,OAAA,CAAAjF,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"names":["_componentId","data","require","_defaultErrorHandler","_interopRequireDefault","_scopeRemotes","_componentIdToPackageName","packageJsonUtils","_interopRequireWildcard","_dataToPersist","_removePath","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","ComponentsEjector","constructor","workspace","install","logger","componentsIds","ejectOptions","consumer","idsToEject","ComponentIdList","failedComponents","modifiedComponents","stagedComponents","notExportedComponents","selfHostedExportedComponents","eject","decideWhichComponentsToEject","debug","length","loadComponentsToEject","_validateIdsHaveScopesAndVersions","removeComponentsFromNodeModules","untrackComponents","installPackages","removeComponentsFiles","writeBitMap","ejectedComponents","setStatusLine","remotes","getScopeRemotes","scope","hubExportedComponents","forEach","componentId","bitId","isExported","push","isHub","force","Promise","all","map","id","componentStatus","getComponentStatusById","modified","staged","err","throwEjectError","toString","consoleSuccess","components","loadComponents","componentsToEject","action","skipDependencyInstallation","packages","getPackagesToInstall","c","componentIdToPackageName","_buildExceptionMessageWithRollbackData","keepFiles","dataToPersist","DataToPersist","component","componentMap","Error","rootDir","removePath","RemovePath","addBasePath","getPath","persistAllToFS","cleanFromBitMap","message","originalError","originalErrorMessage","defaultErrorHandler","error","hasScope","hasVersion","exports"],"sources":["components-ejector.ts"],"sourcesContent":["/**\n * a classic use case of eject is when a user imports a component using `bit import` to update it,\n * but the user has no intention to have the code as part of the project source code.\n * the eject provides the option to delete the component locally and install it via the NPM client.\n *\n * an implementation note, the entire process is done with rollback in mind.\n * since installing the component via NPM client is an error prone process, we do it first, before\n * removing the component files, so then it's easier to rollback.\n */\nimport { Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport defaultErrorHandler from '@teambit/legacy/dist/cli/default-error-handler';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { Logger } from '@teambit/logger';\nimport { InstallMain } from '@teambit/install';\n\nexport type EjectResults = {\n ejectedComponents: ComponentIdList;\n failedComponents: FailedComponents;\n};\n\nexport type EjectOptions = {\n force?: boolean; // eject although a component is modified/staged\n keepFiles?: boolean; // keep component files on the workspace\n skipDependencyInstallation?: boolean; // skip installing the dependencies\n};\n\ntype FailedComponents = {\n modifiedComponents: ComponentIdList;\n stagedComponents: ComponentIdList;\n notExportedComponents: ComponentIdList;\n selfHostedExportedComponents: ComponentIdList;\n};\n\nexport class ComponentsEjector {\n consumer: Consumer;\n idsToEject: ComponentIdList;\n componentsToEject: Component[] = [];\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n notEjectedDependents: Array<{ dependent: Component; ejectedDependencies: Component[] }>;\n failedComponents: FailedComponents;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n packageJsonFilesBeforeChanges: PackageJsonFile[]; // for rollback in case of errors\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private logger: Logger,\n private componentsIds: ComponentID[],\n private ejectOptions: EjectOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.idsToEject = new ComponentIdList();\n this.failedComponents = {\n modifiedComponents: new ComponentIdList(),\n stagedComponents: new ComponentIdList(),\n notExportedComponents: new ComponentIdList(),\n selfHostedExportedComponents: new ComponentIdList(),\n };\n }\n\n async eject(): Promise<EjectResults> {\n await this.decideWhichComponentsToEject();\n this.logger.debug(`${this.idsToEject.length} to eject`);\n await this.loadComponentsToEject();\n if (this.idsToEject.length) {\n this._validateIdsHaveScopesAndVersions();\n await this.removeComponentsFromNodeModules();\n await this.untrackComponents();\n await this.installPackages();\n await this.removeComponentsFiles();\n await this.consumer.writeBitMap();\n }\n this.logger.debug('eject: completed successfully');\n return {\n ejectedComponents: this.idsToEject,\n failedComponents: this.failedComponents,\n };\n }\n\n async decideWhichComponentsToEject(): Promise<void> {\n this.logger.setStatusLine('Eject: getting the components status');\n if (!this.componentsIds.length) return;\n const remotes = await getScopeRemotes(this.consumer.scope);\n const hubExportedComponents = new ComponentIdList();\n this.componentsIds.forEach((componentId) => {\n const bitId = componentId;\n if (!this.workspace.isExported(bitId)) this.failedComponents.notExportedComponents.push(bitId);\n else if (remotes.isHub(bitId.scope as string)) hubExportedComponents.push(bitId);\n else this.failedComponents.selfHostedExportedComponents.push(bitId);\n });\n if (this.ejectOptions.force) {\n this.idsToEject = hubExportedComponents;\n } else {\n await Promise.all(\n hubExportedComponents.map(async (id) => {\n try {\n const componentStatus = await this.workspace.getComponentStatusById(id);\n if (componentStatus.modified) this.failedComponents.modifiedComponents.push(id);\n else if (componentStatus.staged) this.failedComponents.stagedComponents.push(id);\n else this.idsToEject.push(id);\n } catch (err: any) {\n this.throwEjectError(\n `eject operation failed getting the status of ${id.toString()}, no action has been done.\n please fix the issue to continue.`,\n err\n );\n }\n })\n );\n }\n this.logger.consoleSuccess();\n }\n\n async loadComponentsToEject() {\n const { components } = await this.consumer.loadComponents(this.idsToEject);\n this.componentsToEject = components;\n }\n\n async removeComponentsFromNodeModules() {\n const action = 'Eject: removing the existing components from node_modules';\n this.logger.setStatusLine(action);\n this.logger.debug(action);\n await packageJsonUtils.removeComponentsFromNodeModules(this.consumer, this.componentsToEject);\n this.logger.consoleSuccess(action);\n }\n\n async installPackages() {\n if (this.ejectOptions.skipDependencyInstallation) return;\n this.logger.setStatusLine('Eject: installing packages using the package-manager');\n const packages = this.getPackagesToInstall();\n await this.install.install(packages);\n }\n\n getPackagesToInstall(): string[] {\n return this.componentsToEject.map((c) => componentIdToPackageName(c));\n }\n\n _buildExceptionMessageWithRollbackData(action: string): string {\n return `eject failed ${action}.\nyour package.json (if existed) has been restored, however, some bit generated data may have been deleted, please run \"bit link\" to restore them.`;\n }\n\n /**\n * as part of the 'eject' operation, a component is removed locally. as opposed to the remove\n * command, in this case, no need to remove the objects from the scope, only remove from the\n * filesystem, which means, delete the component files, untrack from .bitmap and clean\n * package.json and bit.json traces.\n */\n private async removeComponentsFiles() {\n if (this.ejectOptions.keepFiles) {\n return;\n }\n this.logger.setStatusLine('Eject: removing the components files from the filesystem');\n const dataToPersist = new DataToPersist();\n this.componentsToEject.forEach((component) => {\n const componentMap = component.componentMap;\n if (!componentMap) {\n throw new Error('ComponentEjector.removeComponentsFiles expect a component to have componentMap prop');\n }\n const rootDir = componentMap.rootDir;\n if (!rootDir) {\n throw new Error('ComponentEjector.removeComponentsFiles expect a componentMap to have rootDir');\n }\n dataToPersist.removePath(new RemovePath(rootDir, true));\n });\n dataToPersist.addBasePath(this.consumer.getPath());\n await dataToPersist.persistAllToFS();\n this.logger.consoleSuccess();\n }\n\n private async untrackComponents() {\n this.logger.debug('eject: removing the components from the .bitmap');\n await this.consumer.cleanFromBitMap(this.idsToEject);\n }\n\n throwEjectError(message: string, originalError: Error) {\n const { message: originalErrorMessage } = defaultErrorHandler(originalError);\n this.logger.error(`eject has stopped due to an error ${originalErrorMessage}`, originalError);\n throw new Error(`${message}\n\ngot the following error: ${originalErrorMessage}`);\n }\n\n _validateIdsHaveScopesAndVersions() {\n this.idsToEject.forEach((id) => {\n if (!id.hasScope() || !id.hasVersion()) {\n throw new TypeError(`EjectComponents expects ids with scope and version, got ${id.toString()}`);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AC,EAAE;QACtC,MAAM,IAAIlF,SAAS,CAAE,2DAA0D4C,EAAE,CAACO,QAAQ,CAAC,CAAE,EAAC,CAAC;MACjG;IACF,CAAC,CAAC;EACJ;AACF;AAACgC,OAAA,CAAAjF,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","data","require","_ejectTemplate","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","EjectCmd","constructor","ejectMain","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","force","json","keepFiles","skipDependencyInstallation","componentIds","idsByPattern","ejectResults","eject","JSON","stringify","ejectTemplate","exports"],"sources":["eject-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { ejectTemplate } from './eject-template';\nimport { EjectMain } from './eject.main.runtime';\n\nexport class EjectCmd implements Command {\n name = 'eject <component-pattern>';\n description = 'remove component from the workspace and install it instead as a regular npm package.';\n extendedDescription = 'By default the component files will be removed from the workspace';\n helpUrl = 'reference/components/exporting-components#ejecting-components';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = 'E';\n options = [\n [\n 'f',\n 'force',\n 'ignore local changes/versions. eject component/s even when they are staged or modified. Note: unexported tags/snaps will be lost',\n ],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies'],\n ['j', 'json', 'print the results in JSON format'],\n ['', 'keep-files', 'keep the component files in the workspace intact'],\n ] as CommandOptions;\n loader = true;\n group = 'development';\n\n constructor(private ejectMain: EjectMain, private workspace: Workspace) {}\n\n async report(\n [pattern]: [string],\n {\n force = false,\n json = false,\n keepFiles = false,\n skipDependencyInstallation,\n }: {\n force: boolean;\n json: boolean;\n keepFiles: boolean;\n skipDependencyInstallation?: boolean;\n }\n ): Promise<string> {\n const componentIds = await this.workspace.idsByPattern(pattern);\n const ejectResults = await this.ejectMain.eject(componentIds, { force, keepFiles, skipDependencyInstallation });\n if (json) return JSON.stringify(ejectResults, null, 2);\n return ejectTemplate(ejectResults);\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiD,SAAAG,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA;AAG1C,MAAMW,QAAQ,CAAoB;EAyBvCC,WAAWA,CAASC,SAAoB,EAAUC,SAAoB,EAAE;IAAA,KAApDD,SAAoB,GAApBA,SAAoB;IAAA,KAAUC,SAAoB,GAApBA,SAAoB;IAAAxB,eAAA,eAxB/D,2BAA2B;IAAAA,eAAA,sBACpB,sFAAsF;IAAAA,eAAA,8BAC9E,mEAAmE;IAAAA,eAAA,kBAC/E,+DAA+D;IAAAA,eAAA,oBAC7D,CACV;MACEyB,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA3B,eAAA,gBACO,GAAG;IAAAA,eAAA,kBACD,CACR,CACE,GAAG,EACH,OAAO,EACP,kIAAkI,CACnI,EACD,CAAC,GAAG,EAAE,8BAA8B,EAAE,kCAAkC,CAAC,EACzE,CAAC,GAAG,EAAE,MAAM,EAAE,kCAAkC,CAAC,EACjD,CAAC,EAAE,EAAE,YAAY,EAAE,kDAAkD,CAAC,CACvE;IAAAA,eAAA,iBACQ,IAAI;IAAAA,eAAA,gBACL,aAAa;EAEoD;EAEzE,MAAM4B,MAAMA,CACV,CAACC,OAAO,CAAW,EACnB;IACEC,KAAK,GAAG,KAAK;IACbC,IAAI,GAAG,KAAK;IACZC,SAAS,GAAG,KAAK;IACjBC;EAMF,CAAC,EACgB;IACjB,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACV,SAAS,CAACW,YAAY,CAACN,OAAO,CAAC;IAC/D,MAAMO,YAAY,GAAG,MAAM,IAAI,CAACb,SAAS,CAACc,KAAK,CAACH,YAAY,EAAE;MAAEJ,KAAK;MAAEE,SAAS;MAAEC;IAA2B,CAAC,CAAC;IAC/G,IAAIF,IAAI,EAAE,OAAOO,IAAI,CAACC,SAAS,CAACH,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,IAAAI,8BAAa,EAACJ,YAAY,CAAC;EACpC;AACF;AAACK,OAAA,CAAApB,QAAA,GAAAA,QAAA"}
1
+ {"version":3,"names":["_constants","data","require","_ejectTemplate","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","EjectCmd","constructor","ejectMain","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","force","json","keepFiles","skipDependencyInstallation","componentIds","idsByPattern","ejectResults","eject","JSON","stringify","ejectTemplate","exports"],"sources":["eject-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { ejectTemplate } from './eject-template';\nimport { EjectMain } from './eject.main.runtime';\n\nexport class EjectCmd implements Command {\n name = 'eject <component-pattern>';\n description = 'remove component from the workspace and install it instead as a regular npm package.';\n extendedDescription = 'By default the component files will be removed from the workspace';\n helpUrl = 'reference/components/exporting-components#ejecting-components';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = 'E';\n options = [\n [\n 'f',\n 'force',\n 'ignore local changes/versions. eject component/s even when they are staged or modified. Note: unexported tags/snaps will be lost',\n ],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies'],\n ['j', 'json', 'print the results in JSON format'],\n ['', 'keep-files', 'keep the component files in the workspace intact'],\n ] as CommandOptions;\n loader = true;\n group = 'development';\n\n constructor(private ejectMain: EjectMain, private workspace: Workspace) {}\n\n async report(\n [pattern]: [string],\n {\n force = false,\n json = false,\n keepFiles = false,\n skipDependencyInstallation,\n }: {\n force: boolean;\n json: boolean;\n keepFiles: boolean;\n skipDependencyInstallation?: boolean;\n }\n ): Promise<string> {\n const componentIds = await this.workspace.idsByPattern(pattern);\n const ejectResults = await this.ejectMain.eject(componentIds, { force, keepFiles, skipDependencyInstallation });\n if (json) return JSON.stringify(ejectResults, null, 2);\n return ejectTemplate(ejectResults);\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,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mB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA3B,eAAA,gBACO,GAAG;IAAAA,eAAA,kBACD,CACR,CACE,GAAG,EACH,OAAO,EACP,kIAAkI,CACnI,EACD,CAAC,GAAG,EAAE,8BAA8B,EAAE,kCAAkC,CAAC,EACzE,CAAC,GAAG,EAAE,MAAM,EAAE,kCAAkC,CAAC,EACjD,CAAC,EAAE,EAAE,YAAY,EAAE,kDAAkD,CAAC,CACvE;IAAAA,eAAA,iBACQ,IAAI;IAAAA,eAAA,gBACL,aAAa;EAEoD;EAEzE,MAAM4B,MAAMA,CACV,CAACC,OAAO,CAAW,EACnB;IACEC,KAAK,GAAG,KAAK;IACbC,IAAI,GAAG,KAAK;IACZC,SAAS,GAAG,KAAK;IACjBC;EAMF,CAAC,EACgB;IACjB,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACV,SAAS,CAACW,YAAY,CAACN,OAAO,CAAC;IAC/D,MAAMO,YAAY,GAAG,MAAM,IAAI,CAACb,SAAS,CAACc,KAAK,CAACH,YAAY,EAAE;MAAEJ,KAAK;MAAEE,SAAS;MAAEC;IAA2B,CAAC,CAAC;IAC/G,IAAIF,IAAI,EAAE,OAAOO,IAAI,CAACC,SAAS,CAACH,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,IAAAI,8BAAa,EAACJ,YAAY,CAAC;EACpC;AACF;AAACK,OAAA,CAAApB,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","obj","__esModule","default","successEjectMessage","exports","failureEjectMessage","ejectTemplate","ejectResults","getEjectedOutput","ejectedComponents","length","chalk","green","bold","toString","getFailureOutput","failures","failedComponents","title","red","modified","modifiedComponents","staged","stagedComponents","notExported","notExportedComponents","selfHosted","selfHostedExportedComponents","getCloudDomain","body","underline"],"sources":["eject-template.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { getCloudDomain } from '@teambit/legacy/dist/constants';\nimport { EjectResults } from './components-ejector';\n\nexport const successEjectMessage = 'successfully ejected the following components';\nexport const failureEjectMessage = 'failed to eject the following components';\n\nexport function ejectTemplate(ejectResults: EjectResults): string {\n const getEjectedOutput = () => {\n if (!ejectResults.ejectedComponents.length) return '';\n return chalk.green(`${successEjectMessage} ${chalk.bold(ejectResults.ejectedComponents.toString())}\\n`);\n };\n const getFailureOutput = () => {\n const failures = ejectResults.failedComponents;\n const title = chalk.red(`${failureEjectMessage}\\n`);\n const modified = failures.modifiedComponents.length\n ? `stopped the eject process for the following components because they have local changes.\n${chalk.bold(failures.modifiedComponents.toString())}\nejecting modified components discards all local, unstaged, changes.\nuse 'bit diff <component id>' to see the changes and decide if to 'bit tag' them or not.\nuse the '--force' flag to discard local modifications and proceed with the eject process.\\n`\n : '';\n const staged = failures.stagedComponents.length\n ? `components with local versions (use --force to ignore): ${failures.stagedComponents.toString()}\\n`\n : '';\n const notExported = failures.notExportedComponents.length\n ? `local components that were not exported yet: ${failures.notExportedComponents.toString()}\\n`\n : '';\n const selfHosted = failures.selfHostedExportedComponents.length\n ? `components that were exported to a self hosted scope (not ${getCloudDomain()}): ${failures.selfHostedExportedComponents.toString()}\\n`\n : '';\n const body = modified + staged + notExported + selfHosted;\n if (body) return chalk.underline(title) + chalk.red(body);\n return '';\n };\n return getEjectedOutput() + getFailureOutput();\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,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,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ACW,4BAA4B,CAACb,QAAQ,CAAC,CAAE,IAAG,GACvI,EAAE;IACN,MAAMe,IAAI,GAAGT,QAAQ,GAAGE,MAAM,GAAGE,WAAW,GAAGE,UAAU;IACzD,IAAIG,IAAI,EAAE,OAAOlB,gBAAK,CAACmB,SAAS,CAACZ,KAAK,CAAC,GAAGP,gBAAK,CAACQ,GAAG,CAACU,IAAI,CAAC;IACzD,OAAO,EAAE;EACX,CAAC;EACD,OAAOrB,gBAAgB,CAAC,CAAC,GAAGO,gBAAgB,CAAC,CAAC;AAChD"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","obj","__esModule","default","successEjectMessage","exports","failureEjectMessage","ejectTemplate","ejectResults","getEjectedOutput","ejectedComponents","length","chalk","green","bold","toString","getFailureOutput","failures","failedComponents","title","red","modified","modifiedComponents","staged","stagedComponents","notExported","notExportedComponents","selfHosted","selfHostedExportedComponents","getCloudDomain","body","underline"],"sources":["eject-template.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { getCloudDomain } from '@teambit/legacy/dist/constants';\nimport { EjectResults } from './components-ejector';\n\nexport const successEjectMessage = 'successfully ejected the following components';\nexport const failureEjectMessage = 'failed to eject the following components';\n\nexport function ejectTemplate(ejectResults: EjectResults): string {\n const getEjectedOutput = () => {\n if (!ejectResults.ejectedComponents.length) return '';\n return chalk.green(`${successEjectMessage} ${chalk.bold(ejectResults.ejectedComponents.toString())}\\n`);\n };\n const getFailureOutput = () => {\n const failures = ejectResults.failedComponents;\n const title = chalk.red(`${failureEjectMessage}\\n`);\n const modified = failures.modifiedComponents.length\n ? `stopped the eject process for the following components because they have local changes.\n${chalk.bold(failures.modifiedComponents.toString())}\nejecting modified components discards all local, unstaged, changes.\nuse 'bit diff <component id>' to see the changes and decide if to 'bit tag' them or not.\nuse the '--force' flag to discard local modifications and proceed with the eject process.\\n`\n : '';\n const staged = failures.stagedComponents.length\n ? `components with local versions (use --force to ignore): ${failures.stagedComponents.toString()}\\n`\n : '';\n const notExported = failures.notExportedComponents.length\n ? `local components that were not exported yet: ${failures.notExportedComponents.toString()}\\n`\n : '';\n const selfHosted = failures.selfHostedExportedComponents.length\n ? `components that were exported to a self hosted scope (not ${getCloudDomain()}): ${failures.selfHostedExportedComponents.toString()}\\n`\n : '';\n const body = modified + staged + notExported + selfHosted;\n if (body) return chalk.underline(title) + chalk.red(body);\n return '';\n };\n return getEjectedOutput() + getFailureOutput();\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,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGzD,MAAMG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,+CAA+C;AAC3E,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,0CAA0C;AAEtE,SAASC,aAAaA,CAACC,YAA0B,EAAU;EAChE,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,IAAI,CAACD,YAAY,CAACE,iBAAiB,CAACC,MAAM,EAAE,OAAO,EAAE;IACrD,OAAOC,gBAAK,CAACC,KAAK,CAAE,GAAET,mBAAoB,IAAGQ,gBAAK,CAACE,IAAI,CAACN,YAAY,CAACE,iBAAiB,CAACK,QAAQ,CAAC,CAAC,CAAE,IAAG,CAAC;EACzG,CAAC;EACD,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,MAAMC,QAAQ,GAAGT,YAAY,CAACU,gBAAgB;IAC9C,MAAMC,KAAK,GAAGP,gBAAK,CAACQ,GAAG,CAAE,GAAEd,mBAAoB,IAAG,CAAC;IACnD,MAAMe,QAAQ,GAAGJ,QAAQ,CAACK,kBAAkB,CAACX,MAAM,GAC9C;AACT,EAAEC,gBAAK,CAACE,IAAI,CAACG,QAAQ,CAACK,kBAAkB,CAACP,QAAQ,CAAC,CAAC,CAAE;AACrD;AACA;AACA,4FAA4F,GACpF,EAAE;IACN,MAAMQ,MAAM,GAAGN,QAAQ,CAACO,gBAAgB,CAACb,MAAM,GAC1C,2DAA0DM,QAAQ,CAACO,gBAAgB,CAACT,QAAQ,CAAC,CAAE,IAAG,GACnG,EAAE;IACN,MAAMU,WAAW,GAAGR,QAAQ,CAACS,qBAAqB,CAACf,MAAM,GACpD,gDAA+CM,QAAQ,CAACS,qBAAqB,CAACX,QAAQ,CAAC,CAAE,IAAG,GAC7F,EAAE;IACN,MAAMY,UAAU,GAAGV,QAAQ,CAACW,4BAA4B,CAACjB,MAAM,GAC1D,6DAA4D,IAAAkB,2BAAc,EAAC,CAAE,MAAKZ,QAAQ,CAACW,4BAA4B,CAACb,QAAQ,CAAC,CAAE,IAAG,GACvI,EAAE;IACN,MAAMe,IAAI,GAAGT,QAAQ,GAAGE,MAAM,GAAGE,WAAW,GAAGE,UAAU;IACzD,IAAIG,IAAI,EAAE,OAAOlB,gBAAK,CAACmB,SAAS,CAACZ,KAAK,CAAC,GAAGP,gBAAK,CAACQ,GAAG,CAACU,IAAI,CAAC;IACzD,OAAO,EAAE;EACX,CAAC;EACD,OAAOrB,gBAAgB,CAAC,CAAC,GAAGO,gBAAgB,CAAC,CAAC;AAChD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_harmony","data","require","EjectAspect","exports","Aspect","create","id"],"sources":["eject.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const EjectAspect = Aspect.create({\n id: 'teambit.workspace/eject',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAE;AACN,CAAC,CAAC"}
1
+ {"version":3,"names":["_harmony","data","require","EjectAspect","exports","Aspect","create","id"],"sources":["eject.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const EjectAspect = Aspect.create({\n id: 'teambit.workspace/eject',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["eject.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/eject.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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;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;AAAmD,CAAE,CACjF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA"}
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["eject.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/eject.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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;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;AAAmD,CAAE,CACjF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_logger","_workspace","_install","_ejectCmd","_eject","_componentsEjector","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","EjectMain","constructor","workspace","install","logger","eject","componentIds","ejectOptions","OutsideWorkspaceError","componentEjector","ComponentsEjector","provider","cli","loggerMain","createLogger","EjectAspect","id","ejectMain","register","EjectCmd","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","InstallAspect","addRuntime"],"sources":["eject.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { EjectCmd } from './eject-cmd';\nimport { EjectAspect } from './eject.aspect';\nimport { ComponentsEjector, EjectOptions, EjectResults } from './components-ejector';\n\nexport class EjectMain {\n constructor(private workspace: Workspace, private install: InstallMain, private logger: Logger) {}\n async eject(componentIds: ComponentID[], ejectOptions: EjectOptions = {}): Promise<EjectResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentEjector = new ComponentsEjector(\n this.workspace,\n this.install,\n this.logger,\n componentIds,\n ejectOptions\n );\n return componentEjector.eject();\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, InstallAspect];\n\n static async provider([cli, workspace, loggerMain, install]: [CLIMain, Workspace, LoggerMain, InstallMain]) {\n const logger = loggerMain.createLogger(EjectAspect.id);\n const ejectMain = new EjectMain(workspace, install, logger);\n cli.register(new EjectCmd(ejectMain, workspace));\n\n return ejectMain;\n }\n}\n\nEjectAspect.addRuntime(EjectMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA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AArB,eAAA,CAzBYqB,SAAS,aAcHqB,kBAAW;AAAA1C,eAAA,CAdjBqB,SAAS,kBAgBE,CAACsB,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,wBAAa,CAAC;AAWjFV,oBAAW,CAACW,UAAU,CAAC1B,SAAS,CAAC"}
1
+ {"version":3,"names":["_cli","data","require","_logger","_workspace","_install","_ejectCmd","_eject","_componentsEjector","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","EjectMain","constructor","workspace","install","logger","eject","componentIds","ejectOptions","OutsideWorkspaceError","componentEjector","ComponentsEjector","provider","cli","loggerMain","createLogger","EjectAspect","id","ejectMain","register","EjectCmd","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","InstallAspect","addRuntime"],"sources":["eject.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { EjectCmd } from './eject-cmd';\nimport { EjectAspect } from './eject.aspect';\nimport { ComponentsEjector, EjectOptions, EjectResults } from './components-ejector';\n\nexport class EjectMain {\n constructor(private workspace: Workspace, private install: InstallMain, private logger: Logger) {}\n async eject(componentIds: ComponentID[], ejectOptions: EjectOptions = {}): Promise<EjectResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentEjector = new ComponentsEjector(\n this.workspace,\n this.install,\n this.logger,\n componentIds,\n ejectOptions\n );\n return componentEjector.eject();\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, InstallAspect];\n\n static async provider([cli, workspace, loggerMain, install]: [CLIMain, Workspace, LoggerMain, InstallMain]) {\n const logger = loggerMain.createLogger(EjectAspect.id);\n const ejectMain = new EjectMain(workspace, install, logger);\n cli.register(new EjectCmd(ejectMain, workspace));\n\n return ejectMain;\n }\n}\n\nEjectAspect.addRuntime(EjectMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,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,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,mBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,kBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqF,SAAAQ,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,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,oBAAW,CAACC,EAAE,CAAC;IACtD,MAAMC,SAAS,GAAG,IAAIjB,SAAS,CAACE,SAAS,EAAEC,OAAO,EAAEC,MAAM,CAAC;IAC3DQ,GAAG,CAACM,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,SAAS,EAAEf,SAAS,CAAC,CAAC;IAEhD,OAAOe,SAAS;EAClB;AACF;AAACG,OAAA,CAAApB,SAAA,GAAAA,SAAA;AAAArB,eAAA,CAzBYqB,SAAS,aAcHqB,kBAAW;AAAA1C,eAAA,CAdjBqB,SAAS,kBAgBE,CAACsB,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,wBAAa,CAAC;AAWjFV,oBAAW,CAACW,UAAU,CAAC1B,SAAS,CAAC","ignoreList":[]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_ejectTemplate","data","require","_eject"],"sources":["index.ts"],"sourcesContent":["export type { EjectMain } from './eject.main.runtime';\nexport type { EjectResults } from './components-ejector';\nexport { successEjectMessage, ejectTemplate } from './eject-template';\nexport { EjectAspect } from './eject.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
1
+ {"version":3,"names":["_ejectTemplate","data","require","_eject"],"sources":["index.ts"],"sourcesContent":["export type { EjectMain } from './eject.main.runtime';\nexport type { EjectResults } from './components-ejector';\nexport { successEjectMessage, ejectTemplate } from './eject-template';\nexport { EjectAspect } from './eject.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.workspace_eject@1.0.189/dist/eject.composition.js';
2
+ import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.workspace_eject@1.0.189/dist/eject.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@teambit/eject",
3
- "version": "1.0.188",
3
+ "version": "1.0.189",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/eject",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "eject",
9
- "version": "1.0.188"
9
+ "version": "1.0.189"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
13
13
  "@teambit/component-id": "1.2.0",
14
14
  "@teambit/harmony": "0.4.6",
15
- "@teambit/install": "1.0.188",
16
- "@teambit/logger": "0.0.948",
17
- "@teambit/workspace": "1.0.188",
18
- "@teambit/cli": "0.0.855"
15
+ "@teambit/install": "1.0.189",
16
+ "@teambit/logger": "0.0.949",
17
+ "@teambit/workspace": "1.0.189",
18
+ "@teambit/cli": "0.0.856"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/mocha": "9.1.0",
22
22
  "chai": "4.3.0",
23
- "@teambit/harmony.envs.core-aspect-env": "0.0.25"
23
+ "@teambit/harmony.envs.core-aspect-env": "0.0.27"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^17.0.0 || ^18.0.0",
@@ -1,7 +0,0 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_eject@1.0.188/dist/eject.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_eject@1.0.188/dist/eject.docs.mdx';
3
-
4
- export const compositions = [compositions_0];
5
- export const overview = [overview_0];
6
-
7
- export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};