@teambit/renaming 0.0.283 → 0.0.284

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.
@@ -1,3 +1,4 @@
1
+ import { ConfigMain } from '@teambit/config';
1
2
  import { CLIMain } from '@teambit/cli';
2
3
  import { Component, ComponentID, ComponentMain } from '@teambit/component';
3
4
  import { DeprecationMain } from '@teambit/deprecation';
@@ -13,7 +14,8 @@ export declare class RenamingMain {
13
14
  private newComponentHelper;
14
15
  private deprecation;
15
16
  private refactoring;
16
- constructor(workspace: Workspace, install: InstallMain, newComponentHelper: NewComponentHelperMain, deprecation: DeprecationMain, refactoring: RefactoringMain);
17
+ private config;
18
+ constructor(workspace: Workspace, install: InstallMain, newComponentHelper: NewComponentHelperMain, deprecation: DeprecationMain, refactoring: RefactoringMain, config: ConfigMain);
17
19
  rename(sourceIdStr: string, targetIdStr: string, options: RenameOptions): Promise<RenameDependencyNameResult>;
18
20
  getRenamingInfo(component: Component): RenamingInfo | null;
19
21
  /**
@@ -25,11 +27,12 @@ export declare class RenamingMain {
25
27
  renameScope(oldScope: string, newScope: string, options: {
26
28
  refactor?: boolean;
27
29
  }): Promise<RenameScopeResult>;
30
+ private renameScopeOfAspectIdsInWorkspaceConfig;
28
31
  private getConfig;
29
32
  static slots: never[];
30
33
  static dependencies: import("@teambit/harmony").Aspect[];
31
34
  static runtime: import("@teambit/harmony").RuntimeDefinition;
32
- static provider([cli, workspace, deprecation, newComponentHelper, componentMain, graphql, refactoring, install,]: [
35
+ static provider([cli, workspace, deprecation, newComponentHelper, componentMain, graphql, refactoring, install, config,]: [
33
36
  CLIMain,
34
37
  Workspace,
35
38
  DeprecationMain,
@@ -37,7 +40,8 @@ export declare class RenamingMain {
37
40
  ComponentMain,
38
41
  GraphqlMain,
39
42
  RefactoringMain,
40
- InstallMain
43
+ InstallMain,
44
+ ConfigMain
41
45
  ]): Promise<RenamingMain>;
42
46
  }
43
47
  export declare type RenameDependencyNameResult = {
@@ -41,6 +41,16 @@ function _componentIdToPackageName() {
41
41
  return data;
42
42
  }
43
43
 
44
+ function _config() {
45
+ const data = require("@teambit/config");
46
+
47
+ _config = function () {
48
+ return data;
49
+ };
50
+
51
+ return data;
52
+ }
53
+
44
54
  function _cli() {
45
55
  const data = require("@teambit/cli");
46
56
 
@@ -190,12 +200,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
190
200
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
191
201
 
192
202
  class RenamingMain {
193
- constructor(workspace, install, newComponentHelper, deprecation, refactoring) {
203
+ constructor(workspace, install, newComponentHelper, deprecation, refactoring, config) {
194
204
  this.workspace = workspace;
195
205
  this.install = install;
196
206
  this.newComponentHelper = newComponentHelper;
197
207
  this.deprecation = deprecation;
198
208
  this.refactoring = refactoring;
209
+ this.config = config;
199
210
  }
200
211
 
201
212
  async rename(sourceIdStr, targetIdStr, options) {
@@ -298,6 +309,7 @@ to be able to rename the scope, please untag the components first (using "bit re
298
309
  const {
299
310
  changedComponents
300
311
  } = await this.refactoring.replaceMultipleStrings(allComponents, packagesToReplace);
312
+ await this.renameScopeOfAspectIdsInWorkspaceConfig(componentsUsingOldScope.map(c => c.id), newScope);
301
313
  await Promise.all(changedComponents.map(comp => this.workspace.write(comp)));
302
314
  refactoredIds.push(...changedComponents.map(c => c.id));
303
315
  }
@@ -308,6 +320,17 @@ to be able to rename the scope, please untag the components first (using "bit re
308
320
  };
309
321
  }
310
322
 
323
+ async renameScopeOfAspectIdsInWorkspaceConfig(ids, newScope) {
324
+ const config = this.config.workspaceConfig;
325
+ if (!config) throw new Error('unable to get workspace config');
326
+ let hasChanged = false;
327
+ ids.forEach(id => {
328
+ const changed = config.renameExtensionInRaw(id.toStringWithoutVersion(), id._legacy.changeScope(newScope).toStringWithoutVersion());
329
+ if (changed) hasChanged = true;
330
+ });
331
+ if (hasChanged) await config.write();
332
+ }
333
+
311
334
  async getConfig(comp) {
312
335
  const fromExisting = await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);
313
336
  return _objectSpread(_objectSpread({}, fromExisting), {}, {
@@ -317,10 +340,10 @@ to be able to rename the scope, please untag the components first (using "bit re
317
340
  });
318
341
  }
319
342
 
320
- static async provider([cli, workspace, deprecation, newComponentHelper, componentMain, graphql, refactoring, install]) {
343
+ static async provider([cli, workspace, deprecation, newComponentHelper, componentMain, graphql, refactoring, install, config]) {
321
344
  var _scopeCommand$command;
322
345
 
323
- const renaming = new RenamingMain(workspace, install, newComponentHelper, deprecation, refactoring);
346
+ const renaming = new RenamingMain(workspace, install, newComponentHelper, deprecation, refactoring, config);
324
347
  cli.register(new (_rename().RenameCmd)(renaming));
325
348
  const scopeCommand = cli.getCommand('scope');
326
349
  scopeCommand === null || scopeCommand === void 0 ? void 0 : (_scopeCommand$command = scopeCommand.commands) === null || _scopeCommand$command === void 0 ? void 0 : _scopeCommand$command.push(new (_scopeRename().ScopeRenameCmd)(renaming));
@@ -333,7 +356,7 @@ to be able to rename the scope, please untag the components first (using "bit re
333
356
 
334
357
  exports.RenamingMain = RenamingMain;
335
358
  (0, _defineProperty2().default)(RenamingMain, "slots", []);
336
- (0, _defineProperty2().default)(RenamingMain, "dependencies", [_cli().CLIAspect, _workspace().default, _deprecation().DeprecationAspect, _newComponentHelper().default, _component().default, _graphql().default, _refactoring().default, _install().InstallAspect]);
359
+ (0, _defineProperty2().default)(RenamingMain, "dependencies", [_cli().CLIAspect, _workspace().default, _deprecation().DeprecationAspect, _newComponentHelper().default, _component().default, _graphql().default, _refactoring().default, _install().InstallAspect, _config().ConfigAspect]);
337
360
  (0, _defineProperty2().default)(RenamingMain, "runtime", _cli().MainRuntime);
338
361
 
339
362
  _renaming().RenamingAspect.addRuntime(RenamingMain);
@@ -1 +1 @@
1
- {"version":3,"names":["RenamingMain","constructor","workspace","install","newComponentHelper","deprecation","refactoring","rename","sourceIdStr","targetIdStr","options","sourceId","resolveComponentId","isTagged","hasVersion","sourceComp","get","targetId","getNewComponentId","undefined","scope","config","getConfig","writeAndAddNewComp","deprecate","bitMap","renameNewComponent","write","refactor","allComponents","list","changedComponents","refactorDependencyName","Promise","all","map","comp","link","getRenamingInfo","component","renameConfig","state","aspects","RenamingAspect","id","renamedFrom","ComponentID","fromObject","renameScope","oldScope","newScope","componentsUsingOldScope","filter","length","defaultScope","BitError","exported","_legacy","hasScope","idsStr","toString","join","tagged","setDefaultScope","forEach","removeDefaultScope","refactoredIds","legacyComps","c","_consumer","packagesToReplace","oldStr","componentIdToPackageName","newStr","bindingPrefix","getBindingPrefixByDefaultScope","replaceMultipleStrings","push","scopeRenamedComponentIds","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","renaming","register","RenameCmd","scopeCommand","getCommand","commands","ScopeRenameCmd","renamingSchema","registerShowFragments","RenamingFragment","CLIAspect","WorkspaceAspect","DeprecationAspect","NewComponentHelperAspect","ComponentAspect","GraphqlAspect","RefactoringAspect","InstallAspect","MainRuntime","addRuntime"],"sources":["renaming.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport { DeprecationAspect, DeprecationMain } from '@teambit/deprecation';\nimport GraphqlAspect, { GraphqlMain } from '@teambit/graphql';\nimport NewComponentHelperAspect, { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport RefactoringAspect, { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { getBindingPrefixByDefaultScope } from '@teambit/legacy/dist/consumer/config/component-config';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { RenameCmd, RenameOptions } from './rename.cmd';\nimport { RenamingAspect } from './renaming.aspect';\nimport { RenamingFragment } from './renaming.fragment';\nimport { renamingSchema } from './renaming.graphql';\nimport { ScopeRenameCmd } from './scope-rename.cmd';\n\nexport class RenamingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private newComponentHelper: NewComponentHelperMain,\n private deprecation: DeprecationMain,\n private refactoring: RefactoringMain\n ) {}\n\n async rename(sourceIdStr: string, targetIdStr: string, options: RenameOptions): Promise<RenameDependencyNameResult> {\n const sourceId = await this.workspace.resolveComponentId(sourceIdStr);\n const isTagged = sourceId.hasVersion();\n const sourceComp = await this.workspace.get(sourceId);\n const targetId = this.newComponentHelper.getNewComponentId(targetIdStr, undefined, options?.scope);\n if (isTagged) {\n const config = await this.getConfig(sourceComp);\n await this.newComponentHelper.writeAndAddNewComp(sourceComp, targetId, options, config);\n await this.deprecation.deprecate(sourceId, targetId);\n } else {\n this.workspace.bitMap.renameNewComponent(sourceId, targetId);\n await this.workspace.bitMap.write();\n }\n if (options.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, sourceId, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n\n await this.install.link();\n\n return {\n sourceId,\n targetId,\n };\n }\n\n getRenamingInfo(component: Component): RenamingInfo | null {\n const renameConfig = component.state.aspects.get(RenamingAspect.id)?.config as RenamingInfo | undefined;\n if (!renameConfig) return null;\n return {\n renamedFrom: ComponentID.fromObject(renameConfig.renamedFrom),\n };\n }\n\n /**\n * change the default-scope for new components. optionally (if refactor is true), change the source code to match the\n * new scope-name.\n * keep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors\n * thrown in such cases in this method.\n */\n async renameScope(oldScope: string, newScope: string, options: { refactor?: boolean }): Promise<RenameScopeResult> {\n const allComponents = await this.workspace.list();\n const componentsUsingOldScope = allComponents.filter((comp) => comp.id.scope === oldScope);\n if (!componentsUsingOldScope.length && this.workspace.defaultScope !== oldScope) {\n throw new BitError(\n `none of the components is using \"${oldScope}\". also, the workspace is not configured with \"${oldScope}\"`\n );\n }\n // verify they're all new.\n const exported = componentsUsingOldScope.filter((comp) => comp.id._legacy.hasScope());\n if (exported.length) {\n const idsStr = exported.map((comp) => comp.id.toString()).join(', ');\n throw new BitError(`unable to rename the scope for the following exported components:\\n${idsStr}\nbecause these components were exported already, other components may use them and they'll break upon rename.\ninstead, deprecate the above components (using \"bit deprecate\"), tag, export and then eject them.\nonce they are not in the workspace, you can fork them (\"bit fork\") with the new scope-name`);\n }\n const tagged = componentsUsingOldScope.filter((comp) => comp.id.hasVersion());\n if (tagged.length) {\n const idsStr = tagged.map((comp) => comp.id.toString()).join(', ');\n throw new BitError(`unable to rename the scope for the following tagged components:\\n${idsStr}\nbecause these components were tagged, the objects have the dependencies data of the old-scope.\nto be able to rename the scope, please untag the components first (using \"bit reset\" command)`);\n }\n if (this.workspace.defaultScope === oldScope) {\n await this.workspace.setDefaultScope(newScope);\n componentsUsingOldScope.forEach((comp) => this.workspace.bitMap.removeDefaultScope(comp.id));\n } else {\n componentsUsingOldScope.forEach((comp) => this.workspace.bitMap.setDefaultScope(comp.id, newScope));\n }\n await this.workspace.bitMap.write();\n const refactoredIds: ComponentID[] = [];\n if (options.refactor) {\n const legacyComps = componentsUsingOldScope.map((c) => c.state._consumer);\n const packagesToReplace: MultipleStringsReplacement = legacyComps.map((comp) => {\n return {\n oldStr: componentIdToPackageName(comp),\n newStr: componentIdToPackageName({\n ...comp,\n bindingPrefix: getBindingPrefixByDefaultScope(newScope),\n id: comp.id,\n defaultScope: newScope,\n }),\n };\n });\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(allComponents, packagesToReplace);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n refactoredIds.push(...changedComponents.map((c) => c.id));\n }\n\n return { scopeRenamedComponentIds: componentsUsingOldScope.map((comp) => comp.id), refactoredIds };\n }\n\n private async getConfig(comp: Component) {\n const fromExisting = await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n return {\n ...fromExisting,\n [RenamingAspect.id]: {\n renamedFrom: comp.id.toObject(),\n },\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DeprecationAspect,\n NewComponentHelperAspect,\n ComponentAspect,\n GraphqlAspect,\n RefactoringAspect,\n InstallAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n deprecation,\n newComponentHelper,\n componentMain,\n graphql,\n refactoring,\n install,\n ]: [\n CLIMain,\n Workspace,\n DeprecationMain,\n NewComponentHelperMain,\n ComponentMain,\n GraphqlMain,\n RefactoringMain,\n InstallMain\n ]) {\n const renaming = new RenamingMain(workspace, install, newComponentHelper, deprecation, refactoring);\n cli.register(new RenameCmd(renaming));\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeRenameCmd(renaming));\n\n graphql.register(renamingSchema(renaming));\n componentMain.registerShowFragments([new RenamingFragment(renaming)]);\n return renaming;\n }\n}\n\nRenamingAspect.addRuntime(RenamingMain);\n\nexport type RenameDependencyNameResult = { sourceId: ComponentID; targetId: ComponentID };\n\nexport type RenamingInfo = {\n renamedFrom: ComponentID;\n};\n\nexport type RenameScopeResult = { scopeRenamedComponentIds: ComponentID[]; refactoredIds: ComponentID[] };\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;E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a,CAACU,qBAAd,CAAoC,CAAC,KAAIC,6BAAJ,EAAqBT,QAArB,CAAD,CAApC;IACA,OAAOA,QAAP;EACD;;AAzJuB;;;gCAAbtF,Y,WAiHI,E;gCAjHJA,Y,kBAkHW,CACpBgG,gBADoB,EAEpBC,oBAFoB,EAGpBC,gCAHoB,EAIpBC,6BAJoB,EAKpBC,oBALoB,EAMpBC,kBANoB,EAOpBC,sBAPoB,EAQpBC,wBARoB,C;gCAlHXvG,Y,aA4HMwG,kB;;AAgCnB7D,0BAAA,CAAe8D,UAAf,CAA0BzG,YAA1B"}
1
+ {"version":3,"names":["RenamingMain","constructor","workspace","install","newComponentHelper","deprecation","refactoring","config","rename","sourceIdStr","targetIdStr","options","sourceId","resolveComponentId","isTagged","hasVersion","sourceComp","get","targetId","getNewComponentId","undefined","scope","getConfig","writeAndAddNewComp","deprecate","bitMap","renameNewComponent","write","refactor","allComponents","list","changedComponents","refactorDependencyName","Promise","all","map","comp","link","getRenamingInfo","component","renameConfig","state","aspects","RenamingAspect","id","renamedFrom","ComponentID","fromObject","renameScope","oldScope","newScope","componentsUsingOldScope","filter","length","defaultScope","BitError","exported","_legacy","hasScope","idsStr","toString","join","tagged","setDefaultScope","forEach","removeDefaultScope","refactoredIds","legacyComps","c","_consumer","packagesToReplace","oldStr","componentIdToPackageName","newStr","bindingPrefix","getBindingPrefixByDefaultScope","replaceMultipleStrings","renameScopeOfAspectIdsInWorkspaceConfig","push","scopeRenamedComponentIds","ids","workspaceConfig","Error","hasChanged","changed","renameExtensionInRaw","toStringWithoutVersion","changeScope","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","renaming","register","RenameCmd","scopeCommand","getCommand","commands","ScopeRenameCmd","renamingSchema","registerShowFragments","RenamingFragment","CLIAspect","WorkspaceAspect","DeprecationAspect","NewComponentHelperAspect","ComponentAspect","GraphqlAspect","RefactoringAspect","InstallAspect","ConfigAspect","MainRuntime","addRuntime"],"sources":["renaming.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { ConfigAspect, ConfigMain } from '@teambit/config';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport { DeprecationAspect, DeprecationMain } from '@teambit/deprecation';\nimport GraphqlAspect, { GraphqlMain } from '@teambit/graphql';\nimport NewComponentHelperAspect, { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport RefactoringAspect, { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { getBindingPrefixByDefaultScope } from '@teambit/legacy/dist/consumer/config/component-config';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { RenameCmd, RenameOptions } from './rename.cmd';\nimport { RenamingAspect } from './renaming.aspect';\nimport { RenamingFragment } from './renaming.fragment';\nimport { renamingSchema } from './renaming.graphql';\nimport { ScopeRenameCmd } from './scope-rename.cmd';\n\nexport class RenamingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private newComponentHelper: NewComponentHelperMain,\n private deprecation: DeprecationMain,\n private refactoring: RefactoringMain,\n private config: ConfigMain\n ) {}\n\n async rename(sourceIdStr: string, targetIdStr: string, options: RenameOptions): Promise<RenameDependencyNameResult> {\n const sourceId = await this.workspace.resolveComponentId(sourceIdStr);\n const isTagged = sourceId.hasVersion();\n const sourceComp = await this.workspace.get(sourceId);\n const targetId = this.newComponentHelper.getNewComponentId(targetIdStr, undefined, options?.scope);\n if (isTagged) {\n const config = await this.getConfig(sourceComp);\n await this.newComponentHelper.writeAndAddNewComp(sourceComp, targetId, options, config);\n await this.deprecation.deprecate(sourceId, targetId);\n } else {\n this.workspace.bitMap.renameNewComponent(sourceId, targetId);\n await this.workspace.bitMap.write();\n }\n if (options.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, sourceId, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n\n await this.install.link();\n\n return {\n sourceId,\n targetId,\n };\n }\n\n getRenamingInfo(component: Component): RenamingInfo | null {\n const renameConfig = component.state.aspects.get(RenamingAspect.id)?.config as RenamingInfo | undefined;\n if (!renameConfig) return null;\n return {\n renamedFrom: ComponentID.fromObject(renameConfig.renamedFrom),\n };\n }\n\n /**\n * change the default-scope for new components. optionally (if refactor is true), change the source code to match the\n * new scope-name.\n * keep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors\n * thrown in such cases in this method.\n */\n async renameScope(oldScope: string, newScope: string, options: { refactor?: boolean }): Promise<RenameScopeResult> {\n const allComponents = await this.workspace.list();\n const componentsUsingOldScope = allComponents.filter((comp) => comp.id.scope === oldScope);\n if (!componentsUsingOldScope.length && this.workspace.defaultScope !== oldScope) {\n throw new BitError(\n `none of the components is using \"${oldScope}\". also, the workspace is not configured with \"${oldScope}\"`\n );\n }\n // verify they're all new.\n const exported = componentsUsingOldScope.filter((comp) => comp.id._legacy.hasScope());\n if (exported.length) {\n const idsStr = exported.map((comp) => comp.id.toString()).join(', ');\n throw new BitError(`unable to rename the scope for the following exported components:\\n${idsStr}\nbecause these components were exported already, other components may use them and they'll break upon rename.\ninstead, deprecate the above components (using \"bit deprecate\"), tag, export and then eject them.\nonce they are not in the workspace, you can fork them (\"bit fork\") with the new scope-name`);\n }\n const tagged = componentsUsingOldScope.filter((comp) => comp.id.hasVersion());\n if (tagged.length) {\n const idsStr = tagged.map((comp) => comp.id.toString()).join(', ');\n throw new BitError(`unable to rename the scope for the following tagged components:\\n${idsStr}\nbecause these components were tagged, the objects have the dependencies data of the old-scope.\nto be able to rename the scope, please untag the components first (using \"bit reset\" command)`);\n }\n if (this.workspace.defaultScope === oldScope) {\n await this.workspace.setDefaultScope(newScope);\n componentsUsingOldScope.forEach((comp) => this.workspace.bitMap.removeDefaultScope(comp.id));\n } else {\n componentsUsingOldScope.forEach((comp) => this.workspace.bitMap.setDefaultScope(comp.id, newScope));\n }\n await this.workspace.bitMap.write();\n const refactoredIds: ComponentID[] = [];\n if (options.refactor) {\n const legacyComps = componentsUsingOldScope.map((c) => c.state._consumer);\n const packagesToReplace: MultipleStringsReplacement = legacyComps.map((comp) => {\n return {\n oldStr: componentIdToPackageName(comp),\n newStr: componentIdToPackageName({\n ...comp,\n bindingPrefix: getBindingPrefixByDefaultScope(newScope),\n id: comp.id,\n defaultScope: newScope,\n }),\n };\n });\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(allComponents, packagesToReplace);\n await this.renameScopeOfAspectIdsInWorkspaceConfig(\n componentsUsingOldScope.map((c) => c.id),\n newScope\n );\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n refactoredIds.push(...changedComponents.map((c) => c.id));\n }\n\n return { scopeRenamedComponentIds: componentsUsingOldScope.map((comp) => comp.id), refactoredIds };\n }\n\n private async renameScopeOfAspectIdsInWorkspaceConfig(ids: ComponentID[], newScope: string) {\n const config = this.config.workspaceConfig;\n if (!config) throw new Error('unable to get workspace config');\n let hasChanged = false;\n ids.forEach((id) => {\n const changed = config.renameExtensionInRaw(\n id.toStringWithoutVersion(),\n id._legacy.changeScope(newScope).toStringWithoutVersion()\n );\n if (changed) hasChanged = true;\n });\n if (hasChanged) await config.write();\n }\n\n private async getConfig(comp: Component) {\n const fromExisting = await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n return {\n ...fromExisting,\n [RenamingAspect.id]: {\n renamedFrom: comp.id.toObject(),\n },\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DeprecationAspect,\n NewComponentHelperAspect,\n ComponentAspect,\n GraphqlAspect,\n RefactoringAspect,\n InstallAspect,\n ConfigAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n deprecation,\n newComponentHelper,\n componentMain,\n graphql,\n refactoring,\n install,\n config,\n ]: [\n CLIMain,\n Workspace,\n DeprecationMain,\n NewComponentHelperMain,\n ComponentMain,\n GraphqlMain,\n RefactoringMain,\n InstallMain,\n ConfigMain\n ]) {\n const renaming = new RenamingMain(workspace, install, newComponentHelper, deprecation, refactoring, config);\n cli.register(new RenameCmd(renaming));\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeRenameCmd(renaming));\n\n graphql.register(renamingSchema(renaming));\n componentMain.registerShowFragments([new RenamingFragment(renaming)]);\n return renaming;\n }\n}\n\nRenamingAspect.addRuntime(RenamingMain);\n\nexport type RenameDependencyNameResult = { sourceId: ComponentID; targetId: ComponentID };\n\nexport type RenamingInfo = {\n renamedFrom: ComponentID;\n};\n\nexport type RenameScopeResult = { scopeRenamedComponentIds: ComponentID[]; refactoredIds: ComponentID[] };\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;;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;;AACA;EAAA;;EAAA;IAAA;EA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ACAqF,GAAG,CAACI,QAAJ,CAAa,KAAIC,mBAAJ,EAAcF,QAAd,CAAb;IAEA,MAAMG,YAAY,GAAGN,GAAG,CAACO,UAAJ,CAAe,OAAf,CAArB;IACAD,YAAY,SAAZ,IAAAA,YAAY,WAAZ,qCAAAA,YAAY,CAAEE,QAAd,gFAAwBtB,IAAxB,CAA6B,KAAIuB,6BAAJ,EAAmBN,QAAnB,CAA7B;IAEAD,OAAO,CAACE,QAAR,CAAiB,IAAAM,2BAAA,EAAeP,QAAf,CAAjB;IACAF,aAAa,CAACU,qBAAd,CAAoC,CAAC,KAAIC,6BAAJ,EAAqBT,QAArB,CAAD,CAApC;IACA,OAAOA,QAAP;EACD;;AA/KuB;;;gCAAb/F,Y,WAoII,E;gCApIJA,Y,kBAqIW,CACpByG,gBADoB,EAEpBC,oBAFoB,EAGpBC,gCAHoB,EAIpBC,6BAJoB,EAKpBC,oBALoB,EAMpBC,kBANoB,EAOpBC,sBAPoB,EAQpBC,wBARoB,EASpBC,sBAToB,C;gCArIXjH,Y,aAgJMkH,kB;;AAkCnBvE,0BAAA,CAAewE,UAAf,CAA0BnH,YAA1B"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/renaming",
3
- "version": "0.0.283",
3
+ "version": "0.0.284",
4
4
  "homepage": "https://bit.dev/teambit/component/renaming",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "renaming",
9
- "version": "0.0.283"
9
+ "version": "0.0.284"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,15 +14,16 @@
14
14
  "@babel/runtime": "7.12.18",
15
15
  "core-js": "^3.0.0",
16
16
  "@teambit/harmony": "0.3.3",
17
- "@teambit/cli": "0.0.589",
18
- "@teambit/component": "0.0.879",
19
- "@teambit/graphql": "0.0.879",
17
+ "@teambit/cli": "0.0.590",
18
+ "@teambit/component": "0.0.880",
19
+ "@teambit/graphql": "0.0.880",
20
20
  "@teambit/bit-error": "0.0.400",
21
- "@teambit/deprecation": "0.0.879",
22
- "@teambit/install": "0.0.26",
23
- "@teambit/new-component-helper": "0.0.283",
24
- "@teambit/refactoring": "0.0.176",
25
- "@teambit/workspace": "0.0.879"
21
+ "@teambit/config": "0.0.603",
22
+ "@teambit/deprecation": "0.0.880",
23
+ "@teambit/install": "0.0.27",
24
+ "@teambit/new-component-helper": "0.0.284",
25
+ "@teambit/refactoring": "0.0.177",
26
+ "@teambit/workspace": "0.0.880"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/react": "^17.0.8",
@@ -33,7 +34,7 @@
33
34
  "@types/node": "12.20.4"
34
35
  },
35
36
  "peerDependencies": {
36
- "@teambit/legacy": "1.0.370",
37
+ "@teambit/legacy": "1.0.373",
37
38
  "react-dom": "^16.8.0 || ^17.0.0",
38
39
  "react": "^16.8.0 || ^17.0.0"
39
40
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@0.0.283/dist/renaming.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@0.0.283/dist/renaming.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@0.0.284/dist/renaming.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@0.0.284/dist/renaming.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];