@teambit/forking 0.0.338 → 0.0.340
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ function _legacyBitId() {
|
|
40
40
|
return data;
|
41
41
|
}
|
42
42
|
function _workspace() {
|
43
|
-
const data =
|
43
|
+
const data = _interopRequireWildcard(require("@teambit/workspace"));
|
44
44
|
_workspace = function () {
|
45
45
|
return data;
|
46
46
|
};
|
@@ -53,13 +53,6 @@ function _bitId() {
|
|
53
53
|
};
|
54
54
|
return data;
|
55
55
|
}
|
56
|
-
function _exceptions() {
|
57
|
-
const data = require("@teambit/legacy/dist/consumer/exceptions");
|
58
|
-
_exceptions = function () {
|
59
|
-
return data;
|
60
|
-
};
|
61
|
-
return data;
|
62
|
-
}
|
63
56
|
function _lodash() {
|
64
57
|
const data = require("lodash");
|
65
58
|
_lodash = function () {
|
@@ -178,7 +171,7 @@ class ForkingMain {
|
|
178
171
|
* if refactor option is enable, change the source-code to update all dependencies with the new name.
|
179
172
|
*/
|
180
173
|
async fork(sourceId, targetId, options) {
|
181
|
-
if (!this.workspace) throw new (
|
174
|
+
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
182
175
|
const sourceCompId = await this.workspace.resolveComponentId(sourceId);
|
183
176
|
const exists = this.workspace.exists(sourceCompId);
|
184
177
|
if (exists) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ForkingMain","constructor","workspace","install","dependencyResolver","newComponentHelper","refactoring","pkg","fork","sourceId","targetId","options","ConsumerNotFound","sourceCompId","resolveComponentId","exists","existingInWorkspace","get","forkExistingInWorkspace","sourceIdWithScope","_legacy","scope","ComponentID","fromLegacy","BitId","parse","targetCompId","component","forkRemoteComponent","saveDeps","skipDependencyInstallation","installDeps","getForkInfo","forkConfig","state","aspects","ForkingAspect","id","config","forkedFrom","fromObject","forkMultipleFromRemote","componentsToFork","results","pMapSeries","path","refactorMultipleAndInstall","oldPackages","stringsToReplace","map","oldPackageName","getPackageName","push","newName","fullName","replace","scopeToReplace","newPackageName","oldStr","newStr","toStringWithoutVersion","flat","allComponents","list","refactor","changedComponents","replaceMultipleStrings","Promise","all","comp","write","forkedComponents","result","policy","extractDeps","policyFlatAndUnique","uniqBy","policyWithoutWorkspaceComps","filter","dep","includes","dependencyId","addToRootPolicy","updateExisting","persistConfig","forkScope","originalScope","newScope","idsFromOriginalScope","listRemoteScope","length","Error","workspaceIds","listIds","workspaceBitIds","BitIds","fromArray","forEach","existInWorkspace","searchWithoutScopeAndVersion","toString","multipleForkInfo","components","getManyRemoteComponents","getConfig","name","writeAndAddNewComp","info","existing","getNewComponentId","undefined","refactorDependencyName","BitError","targetName","getRemoteComponent","workspacePolicyEntries","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","deps","getDependencies","source","lifecycleType","lifecycle","value","version","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","forkingMain","register","ForkCmd","forkingSchema","registerShowFragments","ForkingFragment","scopeCommand","getCommand","commands","ScopeForkCmd","CLIAspect","WorkspaceAspect","DependencyResolverAspect","ComponentAspect","NewComponentHelperAspect","GraphqlAspect","RefactoringAspect","PkgAspect","InstallAspect","MainRuntime","addRuntime"],"sources":["forking.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { uniqBy } from 'lodash';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport { ComponentIdObj } from '@teambit/component-id';\nimport GraphqlAspect, { GraphqlMain } from '@teambit/graphql';\nimport RefactoringAspect, { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport pMapSeries from 'p-map-series';\nimport PkgAspect, { PkgMain } from '@teambit/pkg';\nimport { BitError } from '@teambit/bit-error';\nimport NewComponentHelperAspect, { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { ForkCmd, ForkOptions } from './fork.cmd';\nimport { ForkingAspect } from './forking.aspect';\nimport { ForkingFragment } from './forking.fragment';\nimport { forkingSchema } from './forking.graphql';\nimport { ScopeForkCmd } from './scope-fork.cmd';\n\nexport type ForkInfo = {\n forkedFrom: ComponentID;\n};\n\ntype MultipleForkInfo = {\n targetCompId: ComponentID;\n sourceId: string;\n component: Component;\n};\n\ntype MultipleComponentsToFork = Array<{\n sourceId: string;\n targetId?: string; // if not specify, it'll be the same as the source\n path?: string; // if not specify, use the default component path\n}>;\n\ntype MultipleForkOptions = {\n refactor?: boolean;\n scope?: string; // different scope-name than the original components\n install?: boolean; // whether to run \"bit install\" once done.\n};\n\nexport class ForkingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private dependencyResolver: DependencyResolverMain,\n private newComponentHelper: NewComponentHelperMain,\n private refactoring: RefactoringMain,\n private pkg: PkgMain\n ) {}\n\n /**\n * create a new copy of existing/remote component.\n * the new component holds a reference to the old one for future reference.\n * if refactor option is enable, change the source-code to update all dependencies with the new name.\n */\n async fork(sourceId: string, targetId?: string, options?: ForkOptions): Promise<ComponentID> {\n if (!this.workspace) throw new ConsumerNotFound();\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const exists = this.workspace.exists(sourceCompId);\n if (exists) {\n const existingInWorkspace = await this.workspace.get(sourceCompId);\n return this.forkExistingInWorkspace(existingInWorkspace, targetId, options);\n }\n const sourceIdWithScope = sourceCompId._legacy.scope\n ? sourceCompId\n : ComponentID.fromLegacy(BitId.parse(sourceId, true));\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, options);\n await this.saveDeps(component);\n if (!options?.skipDependencyInstallation) await this.installDeps();\n return targetCompId;\n }\n\n /**\n * get the forking data, such as the source where a component was forked from\n */\n getForkInfo(component: Component): ForkInfo | null {\n const forkConfig = component.state.aspects.get(ForkingAspect.id)?.config as ForkConfig | undefined;\n if (!forkConfig) return null;\n return {\n forkedFrom: ComponentID.fromObject(forkConfig.forkedFrom),\n };\n }\n\n async forkMultipleFromRemote(componentsToFork: MultipleComponentsToFork, options: MultipleForkOptions = {}) {\n const { scope } = options;\n const results = await pMapSeries(componentsToFork, async ({ sourceId, targetId, path }) => {\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const sourceIdWithScope = sourceCompId._legacy.scope\n ? sourceCompId\n : ComponentID.fromLegacy(BitId.parse(sourceId, true));\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, { scope, path });\n return { targetCompId, sourceId, component };\n });\n await this.refactorMultipleAndInstall(results, options);\n }\n\n private async refactorMultipleAndInstall(results: MultipleForkInfo[], options: MultipleForkOptions = {}) {\n const oldPackages: string[] = [];\n const stringsToReplace: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId, component }) => {\n const oldPackageName = this.pkg.getPackageName(component);\n oldPackages.push(oldPackageName);\n const newName = targetCompId.fullName.replace(/\\//g, '.');\n const scopeToReplace = targetCompId.scope.replace('.', '/');\n const newPackageName = `@${scopeToReplace}.${newName}`;\n return [\n { oldStr: oldPackageName, newStr: newPackageName },\n { oldStr: sourceId, newStr: targetCompId.toStringWithoutVersion() },\n ];\n })\n .flat();\n const allComponents = await this.workspace.list();\n if (options.refactor) {\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(allComponents, stringsToReplace);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n const forkedComponents = results.map((result) => result.component);\n const policy = await Promise.all(forkedComponents.map((comp) => this.extractDeps(comp)));\n const policyFlatAndUnique = uniqBy(policy.flat(), 'dependencyId');\n const policyWithoutWorkspaceComps = policyFlatAndUnique.filter((dep) => !oldPackages.includes(dep.dependencyId));\n this.dependencyResolver.addToRootPolicy(policyWithoutWorkspaceComps, { updateExisting: true });\n await this.dependencyResolver.persistConfig(this.workspace.path);\n if (options.install) {\n await this.installDeps();\n }\n }\n\n /**\n * fork all components of the given scope\n */\n async forkScope(originalScope: string, newScope: string): Promise<ComponentID[]> {\n const idsFromOriginalScope = await this.workspace.scope.listRemoteScope(originalScope);\n if (!idsFromOriginalScope.length) {\n throw new Error(`unable to find components to fork from ${originalScope}`);\n }\n const workspaceIds = await this.workspace.listIds();\n const workspaceBitIds = BitIds.fromArray(workspaceIds.map((id) => id._legacy));\n idsFromOriginalScope.forEach((id) => {\n const existInWorkspace = workspaceBitIds.searchWithoutScopeAndVersion(id._legacy);\n if (existInWorkspace) {\n throw new Error(\n `unable to fork \"${id.toString()}\". the workspace has a component \"${existInWorkspace.toString()}\" with the same name`\n );\n }\n });\n const multipleForkInfo: MultipleForkInfo[] = [];\n const components = await this.workspace.scope.getManyRemoteComponents(idsFromOriginalScope);\n await pMapSeries(components, async (component) => {\n const config = await this.getConfig(component);\n const targetCompId = ComponentID.fromObject({ name: component.id.fullName }, newScope);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, { scope: newScope }, config);\n multipleForkInfo.push({ targetCompId, sourceId: component.id.toStringWithoutVersion(), component });\n });\n await this.refactorMultipleAndInstall(multipleForkInfo, { refactor: true, install: true });\n return multipleForkInfo.map((info) => info.targetCompId);\n }\n\n private async forkExistingInWorkspace(existing: Component, targetId?: string, options?: ForkOptions) {\n if (!targetId) {\n throw new Error(`error: unable to create \"${existing.id.toStringWithoutVersion()}\" component, a component with the same name already exists.\nplease specify the target-id arg`);\n }\n const targetCompId = this.newComponentHelper.getNewComponentId(targetId, undefined, options?.scope);\n\n const config = await this.getConfig(existing);\n await this.newComponentHelper.writeAndAddNewComp(existing, targetCompId, options, config);\n if (options?.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, existing.id, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n return targetCompId;\n }\n\n private async forkRemoteComponent(\n sourceId: ComponentID,\n targetId?: string,\n options?: ForkOptions\n ): Promise<{\n targetCompId: ComponentID;\n component: Component;\n }> {\n if (options?.refactor) {\n throw new BitError(`the component ${sourceId.toStringWithoutVersion()} is not in the workspace, you can't use the --refactor flag.\nthe reason is that the refactor changes the components using ${sourceId.toStringWithoutVersion()}, since it's not in the workspace, no components were using it, so nothing to refactor`);\n }\n const targetName = targetId || sourceId.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope);\n const component = await this.workspace.scope.getRemoteComponent(sourceId);\n await this.refactoring.replaceMultipleStrings(\n [component],\n [\n {\n oldStr: sourceId.toStringWithoutVersion(),\n newStr: targetCompId.toStringWithoutVersion(),\n },\n ]\n );\n const config = await this.getConfig(component);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, options, config);\n\n return { targetCompId, component };\n }\n\n private async saveDeps(component: Component) {\n const workspacePolicyEntries = await this.extractDeps(component);\n this.dependencyResolver.addToRootPolicy(workspacePolicyEntries, { updateExisting: true });\n await this.dependencyResolver.persistConfig(this.workspace.path);\n }\n\n private async installDeps() {\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\n\n private async extractDeps(component: Component) {\n const deps = await this.dependencyResolver.getDependencies(component);\n return deps\n .filter((dep) => dep.source === 'auto')\n .map((dep) => ({\n dependencyId: dep.getPackageName?.() || dep.id,\n lifecycleType: dep.lifecycle === 'dev' ? 'runtime' : dep.lifecycle,\n value: {\n version: dep.version,\n },\n }));\n }\n\n private async getConfig(comp: Component) {\n const fromExisting = await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n return {\n ...fromExisting,\n [ForkingAspect.id]: {\n forkedFrom: comp.id.toObject(),\n },\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n ComponentAspect,\n NewComponentHelperAspect,\n GraphqlAspect,\n RefactoringAspect,\n PkgAspect,\n InstallAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n dependencyResolver,\n componentMain,\n newComponentHelper,\n graphql,\n refactoring,\n pkg,\n install,\n ]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n ComponentMain,\n NewComponentHelperMain,\n GraphqlMain,\n RefactoringMain,\n PkgMain,\n InstallMain\n ]) {\n const forkingMain = new ForkingMain(workspace, install, dependencyResolver, newComponentHelper, refactoring, pkg);\n cli.register(new ForkCmd(forkingMain));\n graphql.register(forkingSchema(forkingMain));\n componentMain.registerShowFragments([new ForkingFragment(forkingMain)]);\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeForkCmd(forkingMain));\n\n return forkingMain;\n }\n}\n\nForkingAspect.addRuntime(ForkingMain);\n\nexport type ForkConfig = {\n forkedFrom: ComponentIdObj;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EA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EACHjI,SAAS,EACTE,kBAAkB,EAClBgI,aAAa,EACb/H,kBAAkB,EAClBgI,OAAO,EACP/H,WAAW,EACXC,GAAG,EACHJ,OAAO,CAWR,EAAE;IAAA;IACD,MAAMmI,WAAW,GAAG,IAAItI,WAAW,CAACE,SAAS,EAAEC,OAAO,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,GAAG,CAAC;IACjH4H,GAAG,CAACI,QAAQ,CAAC,KAAIC,eAAO,EAACF,WAAW,CAAC,CAAC;IACtCD,OAAO,CAACE,QAAQ,CAAC,IAAAE,yBAAa,EAACH,WAAW,CAAC,CAAC;IAC5CF,aAAa,CAACM,qBAAqB,CAAC,CAAC,KAAIC,2BAAe,EAACL,WAAW,CAAC,CAAC,CAAC;IAEvE,MAAMM,YAAY,GAAGT,GAAG,CAACU,UAAU,CAAC,OAAO,CAAC;IAC5CD,YAAY,aAAZA,YAAY,gDAAZA,YAAY,CAAEE,QAAQ,0DAAtB,sBAAwB1F,IAAI,CAAC,KAAI2F,yBAAY,EAACT,WAAW,CAAC,CAAC;IAE3D,OAAOA,WAAW;EACpB;AACF;AAAC;AAAA,gCAvPYtI,WAAW,WA2MP,EAAE;AAAA,gCA3MNA,WAAW,kBA4MA,CACpBgJ,gBAAS,EACTC,oBAAe,EACfC,8CAAwB,EACxBC,oBAAe,EACfC,6BAAwB,EACxBC,kBAAa,EACbC,sBAAiB,EACjBC,cAAS,EACTC,wBAAa,CACd;AAAA,gCAtNUxJ,WAAW,aAuNLyJ,kBAAW;AAkC9BrH,wBAAa,CAACsH,UAAU,CAAC1J,WAAW,CAAC"}
|
1
|
+
{"version":3,"names":["ForkingMain","constructor","workspace","install","dependencyResolver","newComponentHelper","refactoring","pkg","fork","sourceId","targetId","options","OutsideWorkspaceError","sourceCompId","resolveComponentId","exists","existingInWorkspace","get","forkExistingInWorkspace","sourceIdWithScope","_legacy","scope","ComponentID","fromLegacy","BitId","parse","targetCompId","component","forkRemoteComponent","saveDeps","skipDependencyInstallation","installDeps","getForkInfo","forkConfig","state","aspects","ForkingAspect","id","config","forkedFrom","fromObject","forkMultipleFromRemote","componentsToFork","results","pMapSeries","path","refactorMultipleAndInstall","oldPackages","stringsToReplace","map","oldPackageName","getPackageName","push","newName","fullName","replace","scopeToReplace","newPackageName","oldStr","newStr","toStringWithoutVersion","flat","allComponents","list","refactor","changedComponents","replaceMultipleStrings","Promise","all","comp","write","forkedComponents","result","policy","extractDeps","policyFlatAndUnique","uniqBy","policyWithoutWorkspaceComps","filter","dep","includes","dependencyId","addToRootPolicy","updateExisting","persistConfig","forkScope","originalScope","newScope","idsFromOriginalScope","listRemoteScope","length","Error","workspaceIds","listIds","workspaceBitIds","BitIds","fromArray","forEach","existInWorkspace","searchWithoutScopeAndVersion","toString","multipleForkInfo","components","getManyRemoteComponents","getConfig","name","writeAndAddNewComp","info","existing","getNewComponentId","undefined","refactorDependencyName","BitError","targetName","getRemoteComponent","workspacePolicyEntries","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","deps","getDependencies","source","lifecycleType","lifecycle","value","version","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","forkingMain","register","ForkCmd","forkingSchema","registerShowFragments","ForkingFragment","scopeCommand","getCommand","commands","ScopeForkCmd","CLIAspect","WorkspaceAspect","DependencyResolverAspect","ComponentAspect","NewComponentHelperAspect","GraphqlAspect","RefactoringAspect","PkgAspect","InstallAspect","MainRuntime","addRuntime"],"sources":["forking.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { uniqBy } from 'lodash';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport { ComponentIdObj } from '@teambit/component-id';\nimport GraphqlAspect, { GraphqlMain } from '@teambit/graphql';\nimport RefactoringAspect, { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport pMapSeries from 'p-map-series';\nimport PkgAspect, { PkgMain } from '@teambit/pkg';\nimport { BitError } from '@teambit/bit-error';\nimport NewComponentHelperAspect, { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { ForkCmd, ForkOptions } from './fork.cmd';\nimport { ForkingAspect } from './forking.aspect';\nimport { ForkingFragment } from './forking.fragment';\nimport { forkingSchema } from './forking.graphql';\nimport { ScopeForkCmd } from './scope-fork.cmd';\n\nexport type ForkInfo = {\n forkedFrom: ComponentID;\n};\n\ntype MultipleForkInfo = {\n targetCompId: ComponentID;\n sourceId: string;\n component: Component;\n};\n\ntype MultipleComponentsToFork = Array<{\n sourceId: string;\n targetId?: string; // if not specify, it'll be the same as the source\n path?: string; // if not specify, use the default component path\n}>;\n\ntype MultipleForkOptions = {\n refactor?: boolean;\n scope?: string; // different scope-name than the original components\n install?: boolean; // whether to run \"bit install\" once done.\n};\n\nexport class ForkingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private dependencyResolver: DependencyResolverMain,\n private newComponentHelper: NewComponentHelperMain,\n private refactoring: RefactoringMain,\n private pkg: PkgMain\n ) {}\n\n /**\n * create a new copy of existing/remote component.\n * the new component holds a reference to the old one for future reference.\n * if refactor option is enable, change the source-code to update all dependencies with the new name.\n */\n async fork(sourceId: string, targetId?: string, options?: ForkOptions): Promise<ComponentID> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const exists = this.workspace.exists(sourceCompId);\n if (exists) {\n const existingInWorkspace = await this.workspace.get(sourceCompId);\n return this.forkExistingInWorkspace(existingInWorkspace, targetId, options);\n }\n const sourceIdWithScope = sourceCompId._legacy.scope\n ? sourceCompId\n : ComponentID.fromLegacy(BitId.parse(sourceId, true));\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, options);\n await this.saveDeps(component);\n if (!options?.skipDependencyInstallation) await this.installDeps();\n return targetCompId;\n }\n\n /**\n * get the forking data, such as the source where a component was forked from\n */\n getForkInfo(component: Component): ForkInfo | null {\n const forkConfig = component.state.aspects.get(ForkingAspect.id)?.config as ForkConfig | undefined;\n if (!forkConfig) return null;\n return {\n forkedFrom: ComponentID.fromObject(forkConfig.forkedFrom),\n };\n }\n\n async forkMultipleFromRemote(componentsToFork: MultipleComponentsToFork, options: MultipleForkOptions = {}) {\n const { scope } = options;\n const results = await pMapSeries(componentsToFork, async ({ sourceId, targetId, path }) => {\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const sourceIdWithScope = sourceCompId._legacy.scope\n ? sourceCompId\n : ComponentID.fromLegacy(BitId.parse(sourceId, true));\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, { scope, path });\n return { targetCompId, sourceId, component };\n });\n await this.refactorMultipleAndInstall(results, options);\n }\n\n private async refactorMultipleAndInstall(results: MultipleForkInfo[], options: MultipleForkOptions = {}) {\n const oldPackages: string[] = [];\n const stringsToReplace: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId, component }) => {\n const oldPackageName = this.pkg.getPackageName(component);\n oldPackages.push(oldPackageName);\n const newName = targetCompId.fullName.replace(/\\//g, '.');\n const scopeToReplace = targetCompId.scope.replace('.', '/');\n const newPackageName = `@${scopeToReplace}.${newName}`;\n return [\n { oldStr: oldPackageName, newStr: newPackageName },\n { oldStr: sourceId, newStr: targetCompId.toStringWithoutVersion() },\n ];\n })\n .flat();\n const allComponents = await this.workspace.list();\n if (options.refactor) {\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(allComponents, stringsToReplace);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n const forkedComponents = results.map((result) => result.component);\n const policy = await Promise.all(forkedComponents.map((comp) => this.extractDeps(comp)));\n const policyFlatAndUnique = uniqBy(policy.flat(), 'dependencyId');\n const policyWithoutWorkspaceComps = policyFlatAndUnique.filter((dep) => !oldPackages.includes(dep.dependencyId));\n this.dependencyResolver.addToRootPolicy(policyWithoutWorkspaceComps, { updateExisting: true });\n await this.dependencyResolver.persistConfig(this.workspace.path);\n if (options.install) {\n await this.installDeps();\n }\n }\n\n /**\n * fork all components of the given scope\n */\n async forkScope(originalScope: string, newScope: string): Promise<ComponentID[]> {\n const idsFromOriginalScope = await this.workspace.scope.listRemoteScope(originalScope);\n if (!idsFromOriginalScope.length) {\n throw new Error(`unable to find components to fork from ${originalScope}`);\n }\n const workspaceIds = await this.workspace.listIds();\n const workspaceBitIds = BitIds.fromArray(workspaceIds.map((id) => id._legacy));\n idsFromOriginalScope.forEach((id) => {\n const existInWorkspace = workspaceBitIds.searchWithoutScopeAndVersion(id._legacy);\n if (existInWorkspace) {\n throw new Error(\n `unable to fork \"${id.toString()}\". the workspace has a component \"${existInWorkspace.toString()}\" with the same name`\n );\n }\n });\n const multipleForkInfo: MultipleForkInfo[] = [];\n const components = await this.workspace.scope.getManyRemoteComponents(idsFromOriginalScope);\n await pMapSeries(components, async (component) => {\n const config = await this.getConfig(component);\n const targetCompId = ComponentID.fromObject({ name: component.id.fullName }, newScope);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, { scope: newScope }, config);\n multipleForkInfo.push({ targetCompId, sourceId: component.id.toStringWithoutVersion(), component });\n });\n await this.refactorMultipleAndInstall(multipleForkInfo, { refactor: true, install: true });\n return multipleForkInfo.map((info) => info.targetCompId);\n }\n\n private async forkExistingInWorkspace(existing: Component, targetId?: string, options?: ForkOptions) {\n if (!targetId) {\n throw new Error(`error: unable to create \"${existing.id.toStringWithoutVersion()}\" component, a component with the same name already exists.\nplease specify the target-id arg`);\n }\n const targetCompId = this.newComponentHelper.getNewComponentId(targetId, undefined, options?.scope);\n\n const config = await this.getConfig(existing);\n await this.newComponentHelper.writeAndAddNewComp(existing, targetCompId, options, config);\n if (options?.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, existing.id, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n return targetCompId;\n }\n\n private async forkRemoteComponent(\n sourceId: ComponentID,\n targetId?: string,\n options?: ForkOptions\n ): Promise<{\n targetCompId: ComponentID;\n component: Component;\n }> {\n if (options?.refactor) {\n throw new BitError(`the component ${sourceId.toStringWithoutVersion()} is not in the workspace, you can't use the --refactor flag.\nthe reason is that the refactor changes the components using ${sourceId.toStringWithoutVersion()}, since it's not in the workspace, no components were using it, so nothing to refactor`);\n }\n const targetName = targetId || sourceId.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope);\n const component = await this.workspace.scope.getRemoteComponent(sourceId);\n await this.refactoring.replaceMultipleStrings(\n [component],\n [\n {\n oldStr: sourceId.toStringWithoutVersion(),\n newStr: targetCompId.toStringWithoutVersion(),\n },\n ]\n );\n const config = await this.getConfig(component);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, options, config);\n\n return { targetCompId, component };\n }\n\n private async saveDeps(component: Component) {\n const workspacePolicyEntries = await this.extractDeps(component);\n this.dependencyResolver.addToRootPolicy(workspacePolicyEntries, { updateExisting: true });\n await this.dependencyResolver.persistConfig(this.workspace.path);\n }\n\n private async installDeps() {\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\n\n private async extractDeps(component: Component) {\n const deps = await this.dependencyResolver.getDependencies(component);\n return deps\n .filter((dep) => dep.source === 'auto')\n .map((dep) => ({\n dependencyId: dep.getPackageName?.() || dep.id,\n lifecycleType: dep.lifecycle === 'dev' ? 'runtime' : dep.lifecycle,\n value: {\n version: dep.version,\n },\n }));\n }\n\n private async getConfig(comp: Component) {\n const fromExisting = await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n return {\n ...fromExisting,\n [ForkingAspect.id]: {\n forkedFrom: comp.id.toObject(),\n },\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n ComponentAspect,\n NewComponentHelperAspect,\n GraphqlAspect,\n RefactoringAspect,\n PkgAspect,\n InstallAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n dependencyResolver,\n componentMain,\n newComponentHelper,\n graphql,\n refactoring,\n pkg,\n install,\n ]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n ComponentMain,\n NewComponentHelperMain,\n GraphqlMain,\n RefactoringMain,\n PkgMain,\n InstallMain\n ]) {\n const forkingMain = new ForkingMain(workspace, install, dependencyResolver, newComponentHelper, refactoring, pkg);\n cli.register(new ForkCmd(forkingMain));\n graphql.register(forkingSchema(forkingMain));\n componentMain.registerShowFragments([new ForkingFragment(forkingMain)]);\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeForkCmd(forkingMain));\n\n return forkingMain;\n }\n}\n\nForkingAspect.addRuntime(ForkingMain);\n\nexport type ForkConfig = {\n forkedFrom: ComponentIdObj;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAC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AQ;MAC9B;IAAC;EAEL;EAeA,aAAaC,QAAQ,CAAC,CACpBC,GAAG,EACHjI,SAAS,EACTE,kBAAkB,EAClBgI,aAAa,EACb/H,kBAAkB,EAClBgI,OAAO,EACP/H,WAAW,EACXC,GAAG,EACHJ,OAAO,CAWR,EAAE;IAAA;IACD,MAAMmI,WAAW,GAAG,IAAItI,WAAW,CAACE,SAAS,EAAEC,OAAO,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,GAAG,CAAC;IACjH4H,GAAG,CAACI,QAAQ,CAAC,KAAIC,eAAO,EAACF,WAAW,CAAC,CAAC;IACtCD,OAAO,CAACE,QAAQ,CAAC,IAAAE,yBAAa,EAACH,WAAW,CAAC,CAAC;IAC5CF,aAAa,CAACM,qBAAqB,CAAC,CAAC,KAAIC,2BAAe,EAACL,WAAW,CAAC,CAAC,CAAC;IAEvE,MAAMM,YAAY,GAAGT,GAAG,CAACU,UAAU,CAAC,OAAO,CAAC;IAC5CD,YAAY,aAAZA,YAAY,gDAAZA,YAAY,CAAEE,QAAQ,0DAAtB,sBAAwB1F,IAAI,CAAC,KAAI2F,yBAAY,EAACT,WAAW,CAAC,CAAC;IAE3D,OAAOA,WAAW;EACpB;AACF;AAAC;AAAA,gCAvPYtI,WAAW,WA2MP,EAAE;AAAA,gCA3MNA,WAAW,kBA4MA,CACpBgJ,gBAAS,EACTC,oBAAe,EACfC,8CAAwB,EACxBC,oBAAe,EACfC,6BAAwB,EACxBC,kBAAa,EACbC,sBAAiB,EACjBC,cAAS,EACTC,wBAAa,CACd;AAAA,gCAtNUxJ,WAAW,aAuNLyJ,kBAAW;AAkC9BrH,wBAAa,CAACsH,UAAU,CAAC1J,WAAW,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_forking@0.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_forking@0.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_forking@0.0.340/dist/forking.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_forking@0.0.340/dist/forking.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/forking",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.340",
|
4
4
|
"homepage": "https://bit.dev/teambit/component/forking",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "forking",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.340"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -16,18 +16,18 @@
|
|
16
16
|
"core-js": "^3.0.0",
|
17
17
|
"@babel/runtime": "7.20.0",
|
18
18
|
"@teambit/harmony": "0.4.6",
|
19
|
-
"@teambit/cli": "0.0.
|
20
|
-
"@teambit/component": "0.0.
|
21
|
-
"@teambit/graphql": "0.0.
|
19
|
+
"@teambit/cli": "0.0.627",
|
20
|
+
"@teambit/component": "0.0.936",
|
21
|
+
"@teambit/graphql": "0.0.936",
|
22
22
|
"@teambit/bit-error": "0.0.402",
|
23
23
|
"@teambit/component-id": "0.0.425",
|
24
|
-
"@teambit/dependency-resolver": "0.0.
|
25
|
-
"@teambit/install": "0.0.
|
24
|
+
"@teambit/dependency-resolver": "0.0.936",
|
25
|
+
"@teambit/install": "0.0.74",
|
26
26
|
"@teambit/legacy-bit-id": "0.0.421",
|
27
|
-
"@teambit/new-component-helper": "0.0.
|
28
|
-
"@teambit/pkg": "0.0.
|
29
|
-
"@teambit/refactoring": "0.0.
|
30
|
-
"@teambit/workspace": "0.0.
|
27
|
+
"@teambit/new-component-helper": "0.0.340",
|
28
|
+
"@teambit/pkg": "0.0.936",
|
29
|
+
"@teambit/refactoring": "0.0.233",
|
30
|
+
"@teambit/workspace": "0.0.936"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
33
|
"@types/react": "^17.0.8",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"@types/testing-library__jest-dom": "5.9.5"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
42
|
-
"@teambit/legacy": "1.0.
|
42
|
+
"@teambit/legacy": "1.0.408",
|
43
43
|
"react": "^16.8.0 || ^17.0.0",
|
44
44
|
"react-dom": "^16.8.0 || ^17.0.0"
|
45
45
|
},
|
Binary file
|