@teambit/renaming 1.0.966 → 1.0.967
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.
- package/dist/{preview-1776960512780.js → preview-1777305358679.js} +2 -2
- package/dist/rename.cmd.d.ts +1 -0
- package/dist/rename.cmd.js.map +1 -1
- package/dist/renaming.main.runtime.d.ts +2 -0
- package/dist/renaming.main.runtime.js +30 -2
- package/dist/renaming.main.runtime.js.map +1 -1
- package/dist/renaming.spec.js +3 -1
- package/dist/renaming.spec.js.map +1 -1
- package/dist/scope-rename.cmd.d.ts +3 -1
- package/dist/scope-rename.cmd.js +6 -3
- package/dist/scope-rename.cmd.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_renaming@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_renaming@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_renaming@1.0.967/dist/renaming.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_renaming@1.0.967/dist/renaming.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/rename.cmd.d.ts
CHANGED
package/dist/rename.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cli","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RenameCmd","constructor","renaming","name","description","report","sourceId","targetId","options","results","rename","formatSuccessSummary","chalk","bold","toString","exports"],"sources":["rename.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary } from '@teambit/cli';\nimport type { RenamingMain } from './renaming.main.runtime';\n\nexport type RenameOptions = {\n scope?: string;\n path?: string;\n refactor?: boolean;\n preserve?: boolean;\n ast?: boolean;\n deprecate?: boolean;\n};\n\nexport class RenameCmd implements Command {\n name = 'rename <current-name> <new-name>';\n description = 'change a component name';\n extendedDescription = `renames a component and optionally refactors dependent code to use the new name.\nfor exported components: creates a new component with the new name and marks the original as deleted.\nfor local components: simply renames the existing component in place.`;\n helpUrl = 'reference/components/renaming-components';\n arguments = [\n {\n name: 'current-name',\n description: 'the current component name (without its scope name)',\n },\n {\n name: 'new-name',\n description: \"the new component name (without its scope name. use --scope to define the new component's scope)\",\n },\n ];\n group = 'component-development';\n skipWorkspace = true;\n alias = '';\n options = [\n ['s', 'scope <scope-name>', 'define the scope for the new component'],\n ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'],\n ['', 'preserve', 'avoid renaming files and variables/classes according to the new component name'],\n ['', 'ast', 'use ast to transform files instead of regex'],\n ['', 'delete', 'DEPRECATED. this is now the default'],\n ['', 'deprecate', 'instead of deleting the original component, deprecating it'],\n [\n 'p',\n 'path <relative-path>',\n 'relative path in the workspace to place new component in. by default, the directory of the new component is from your workspace\\'s \"defaultScope\" value',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(private renaming: RenamingMain) {}\n\n async report([sourceId, targetId]: [string, string], options: RenameOptions): Promise<string> {\n const results = await this.renaming.rename(sourceId, targetId, options);\n return formatSuccessSummary(\n `renamed ${chalk.bold(results.sourceId.toString())} to ${chalk.bold(results.targetId.toString())}`\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cli","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RenameCmd","constructor","renaming","name","description","report","sourceId","targetId","options","results","rename","formatSuccessSummary","chalk","bold","toString","exports"],"sources":["rename.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary } from '@teambit/cli';\nimport type { RenamingMain } from './renaming.main.runtime';\n\nexport type RenameOptions = {\n scope?: string;\n path?: string;\n refactor?: boolean;\n preserve?: boolean;\n ast?: boolean;\n deprecate?: boolean;\n skipCompile?: boolean;\n};\n\nexport class RenameCmd implements Command {\n name = 'rename <current-name> <new-name>';\n description = 'change a component name';\n extendedDescription = `renames a component and optionally refactors dependent code to use the new name.\nfor exported components: creates a new component with the new name and marks the original as deleted.\nfor local components: simply renames the existing component in place.`;\n helpUrl = 'reference/components/renaming-components';\n arguments = [\n {\n name: 'current-name',\n description: 'the current component name (without its scope name)',\n },\n {\n name: 'new-name',\n description: \"the new component name (without its scope name. use --scope to define the new component's scope)\",\n },\n ];\n group = 'component-development';\n skipWorkspace = true;\n alias = '';\n options = [\n ['s', 'scope <scope-name>', 'define the scope for the new component'],\n ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'],\n ['', 'preserve', 'avoid renaming files and variables/classes according to the new component name'],\n ['', 'ast', 'use ast to transform files instead of regex'],\n ['', 'delete', 'DEPRECATED. this is now the default'],\n ['', 'deprecate', 'instead of deleting the original component, deprecating it'],\n [\n 'p',\n 'path <relative-path>',\n 'relative path in the workspace to place new component in. by default, the directory of the new component is from your workspace\\'s \"defaultScope\" value',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(private renaming: RenamingMain) {}\n\n async report([sourceId, targetId]: [string, string], options: RenameOptions): Promise<string> {\n const results = await this.renaming.rename(sourceId, targetId, options);\n return formatSuccessSummary(\n `renamed ${chalk.bold(results.sourceId.toString())} to ${chalk.bold(results.targetId.toString())}`\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAE,OA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U;MAChBC,WAAW,EAAE;IACf,CAAC,CACF;IAAAtB,eAAA,gBACO,uBAAuB;IAAAA,eAAA,wBACf,IAAI;IAAAA,eAAA,gBACZ,EAAE;IAAAA,eAAA,kBACA,CACR,CAAC,GAAG,EAAE,oBAAoB,EAAE,wCAAwC,CAAC,EACrE,CAAC,GAAG,EAAE,UAAU,EAAE,0FAA0F,CAAC,EAC7G,CAAC,EAAE,EAAE,UAAU,EAAE,gFAAgF,CAAC,EAClG,CAAC,EAAE,EAAE,KAAK,EAAE,6CAA6C,CAAC,EAC1D,CAAC,EAAE,EAAE,QAAQ,EAAE,qCAAqC,CAAC,EACrD,CAAC,EAAE,EAAE,WAAW,EAAE,4DAA4D,CAAC,EAC/E,CACE,GAAG,EACH,sBAAsB,EACtB,yJAAyJ,CAC1J,CACF;IAAAA,eAAA,iBACQ,IAAI;IAAAA,eAAA,mBACF,IAAI;EAE8B;EAE7C,MAAMuB,MAAMA,CAAC,CAACC,QAAQ,EAAEC,QAAQ,CAAmB,EAAEC,OAAsB,EAAmB;IAC5F,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACP,QAAQ,CAACQ,MAAM,CAACJ,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,CAAC;IACvE,OAAO,IAAAG,2BAAoB,EACzB,WAAWC,gBAAK,CAACC,IAAI,CAACJ,OAAO,CAACH,QAAQ,CAACQ,QAAQ,CAAC,CAAC,CAAC,OAAOF,gBAAK,CAACC,IAAI,CAACJ,OAAO,CAACF,QAAQ,CAACO,QAAQ,CAAC,CAAC,CAAC,EAClG,CAAC;EACH;AACF;AAACC,OAAA,CAAAf,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -54,6 +54,7 @@ export declare class RenamingMain {
|
|
|
54
54
|
refactor?: boolean;
|
|
55
55
|
deprecate?: boolean;
|
|
56
56
|
preserve?: boolean;
|
|
57
|
+
skipDependencyInstallation?: boolean;
|
|
57
58
|
}): Promise<RenameResult>;
|
|
58
59
|
/**
|
|
59
60
|
* change the default-scope for new components. optionally (if refactor is true), change the source code to match the
|
|
@@ -68,6 +69,7 @@ export declare class RenamingMain {
|
|
|
68
69
|
private renameAspectIdsInWorkspaceConfig;
|
|
69
70
|
private changeEnvsAccordingToNewIds;
|
|
70
71
|
private deleteLinkFromNodeModules;
|
|
72
|
+
private installDepsGracefully;
|
|
71
73
|
private compileGracefully;
|
|
72
74
|
private renameOwnerInScopeName;
|
|
73
75
|
private getConfig;
|
|
@@ -348,7 +348,9 @@ make sure this argument is the name only, without the scope-name. to change the
|
|
|
348
348
|
targetComp
|
|
349
349
|
}) => targetComp));
|
|
350
350
|
await (0, _workspaceModules().linkToNodeModulesByComponents)(targetComps, this.workspace); // link the new-name to node-modules
|
|
351
|
-
|
|
351
|
+
if (!options.skipCompile) {
|
|
352
|
+
await this.compileGracefully(targetComps.map(c => c.id));
|
|
353
|
+
}
|
|
352
354
|
return {
|
|
353
355
|
refactoredIds,
|
|
354
356
|
renameData
|
|
@@ -386,7 +388,20 @@ make sure this argument is the name only, without the scope-name. to change the
|
|
|
386
388
|
targetId
|
|
387
389
|
};
|
|
388
390
|
});
|
|
389
|
-
|
|
391
|
+
// defer compilation until after install, so newly-required deps are available.
|
|
392
|
+
const result = await this.renameMultiple(multipleIds, _objectSpread(_objectSpread({}, options), {}, {
|
|
393
|
+
skipCompile: true
|
|
394
|
+
}));
|
|
395
|
+
const targetIds = result.renameData.map(({
|
|
396
|
+
targetId
|
|
397
|
+
}) => targetId);
|
|
398
|
+
if (!options.skipDependencyInstallation && targetIds.length) {
|
|
399
|
+
await this.installDepsGracefully();
|
|
400
|
+
}
|
|
401
|
+
if (targetIds.length) {
|
|
402
|
+
await this.compileGracefully(targetIds);
|
|
403
|
+
}
|
|
404
|
+
return result;
|
|
390
405
|
}
|
|
391
406
|
|
|
392
407
|
/**
|
|
@@ -444,6 +459,19 @@ make sure this argument is the name only, without the scope-name. to change the
|
|
|
444
459
|
async deleteLinkFromNodeModules(packageName) {
|
|
445
460
|
await _fsExtra().default.remove(_path().default.join(this.workspace.path, 'node_modules', packageName));
|
|
446
461
|
}
|
|
462
|
+
async installDepsGracefully() {
|
|
463
|
+
try {
|
|
464
|
+
await this.install.install(undefined, {
|
|
465
|
+
dedupe: true,
|
|
466
|
+
import: false,
|
|
467
|
+
copyPeerToRuntimeOnRoot: true,
|
|
468
|
+
copyPeerToRuntimeOnComponents: false,
|
|
469
|
+
updateExisting: false
|
|
470
|
+
});
|
|
471
|
+
} catch (err) {
|
|
472
|
+
this.logger.consoleFailure(`failed installing dependencies. error: ${err.message}. run "bit install" to retry.`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
447
475
|
async compileGracefully(ids) {
|
|
448
476
|
try {
|
|
449
477
|
await this.compiler.compileOnWorkspace(ids);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_config","_logger","_workspaceModules","_cli","_component","_deprecation","_graphql","_lodash","_compiler","_envs","_newComponentHelper","_remove","_refactoring","_componentWriter","_workspace","_pMapSeries","_install","_legacyBitId","_rename","_renaming","_renaming2","_renaming3","_scopeRename","_oldScopeNotFound","_scopeRenameOwner","_renamingTagged","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RenamingMain","constructor","workspace","install","newComponentHelper","deprecation","refactoring","config","componentWriter","compiler","logger","envs","remove","rename","sourceIdStr","targetName","options","isValidIdChunk","includes","Error","InvalidName","sourceId","resolveComponentId","targetId","getNewComponentId","undefined","scope","renameMultiple","multipleIds","renameData","stagedComps","hasVersion","isExported","idsStr","map","toString","RenamingTagged","pMapSeries","isTagged","sourceComp","get","isEnv","sourcePackageName","componentPackageName","sourcePkg","compIdsUsingItAsEnv","getComponentsUsingEnv","c","id","preserve","refactorVariableAndClasses","refactorFilenames","getConfig","writeAndAddNewComp","deprecate","deleteComps","updateMain","bitMap","renameNewComponent","deleteLinkFromNodeModules","write","renameAspectIdsInWorkspaceConfig","_reloadConsumer","changeEnvsAccordingToNewIds","itemData","targetComp","targetPkg","refactoredIds","refactor","allComponents","list","packagesToReplace","oldStr","newStr","changedComponents","replaceMultipleStrings","Promise","all","comp","compPath","getNewComponentPath","writeMany","components","state","_consumer","skipDependencyInstallation","writeToPath","path","join","reasonForBitmapChange","renameAspectInConfig","targetComps","compact","linkToNodeModulesByComponents","compileGracefully","getRenamingInfo","component","renameConfig","aspects","RenamingAspect","renamedFrom","ComponentID","fromObject","renameScope","oldScope","newScope","OutsideWorkspaceError","allComponentsIds","listIds","componentsUsingOldScope","compId","defaultScope","OldScopeNotFound","setDefaultScope","name","fullName","renameOwner","oldOwner","newOwner","isScopeUsesOldOwner","startsWith","oldWorkspaceDefaultScope","newWorkspaceDefaultScope","renameOwnerInScopeName","hasScope","changeScope","changeDefaultScope","ids","workspaceConfig","wereChangesDone","renameId","renameExtensionInRaw","toStringWithoutVersion","hasChanged","some","isChanged","reasonForChange","renameItem","componentIds","newEnvId","newComponentIds","found","find","isEqualWithoutVersion","setEnvToComponents","packageName","fs","compileOnWorkspace","err","consoleFailure","message","scopeName","replace","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","loggerMain","createLogger","renaming","register","RenameCmd","scopeCommand","getCommand","commands","ScopeRenameCmd","ScopeRenameOwnerCmd","renamingSchema","registerShowFragments","RenamingFragment","exports","CLIAspect","WorkspaceAspect","DeprecationAspect","NewComponentHelperAspect","ComponentAspect","GraphqlAspect","RefactoringAspect","InstallAspect","ConfigAspect","ComponentWriterAspect","CompilerAspect","LoggerAspect","EnvsAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["renaming.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport type { ConfigMain } from '@teambit/config';\nimport { ConfigAspect } from '@teambit/config';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { DeprecationMain } from '@teambit/deprecation';\nimport { DeprecationAspect } from '@teambit/deprecation';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport { compact } from 'lodash';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { NewComponentHelperAspect } from '@teambit/new-component-helper';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport type { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { RefactoringAspect } from '@teambit/refactoring';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport type { InstallMain } from '@teambit/install';\nimport { InstallAspect } from '@teambit/install';\nimport { isValidIdChunk, InvalidName } from '@teambit/legacy-bit-id';\nimport type { RenameOptions } from './rename.cmd';\nimport { RenameCmd } from './rename.cmd';\nimport { RenamingAspect } from './renaming.aspect';\nimport { RenamingFragment } from './renaming.fragment';\nimport { renamingSchema } from './renaming.graphql';\nimport { ScopeRenameCmd } from './scope-rename.cmd';\nimport { OldScopeNotFound } from './exceptions/old-scope-not-found';\nimport { ScopeRenameOwnerCmd } from './scope-rename-owner.cmd';\nimport { RenamingTagged } from './exceptions/renaming-tagged';\n\ntype RenameId = { sourceId: ComponentID; targetId: ComponentID };\ntype RenameData = RenameId & {\n sourcePkg: string;\n isTagged: boolean;\n targetPkg?: string;\n targetComp?: Component;\n compIdsUsingItAsEnv?: ComponentID[];\n};\nexport type RenameResult = { renameData: RenameData[]; refactoredIds: ComponentID[] };\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 private componentWriter: ComponentWriterMain,\n private compiler: CompilerMain,\n private logger: Logger,\n private envs: EnvsMain,\n private remove: RemoveMain\n ) {}\n\n async rename(\n sourceIdStr: string,\n targetName: string,\n options: RenameOptions = {}\n ): Promise<RenameDependencyNameResult> {\n if (!isValidIdChunk(targetName)) {\n if (targetName.includes('.'))\n throw new Error(`error: new-name argument \"${targetName}\" includes a dot.\nmake sure this argument is the name only, without the scope-name. to change the scope-name, use --scope flag`);\n throw new InvalidName(targetName);\n }\n const sourceId = await this.workspace.resolveComponentId(sourceIdStr);\n const targetId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope || sourceId.scope);\n await this.renameMultiple([{ sourceId, targetId }], options);\n\n return {\n sourceId,\n targetId,\n };\n }\n\n async renameMultiple(multipleIds: RenameId[], options: RenameOptions): Promise<RenameResult> {\n const renameData: RenameData[] = [];\n\n const stagedComps = multipleIds.filter(\n ({ sourceId }) => sourceId.hasVersion() && !this.workspace.isExported(sourceId)\n );\n\n if (stagedComps.length) {\n const idsStr = stagedComps.map(({ sourceId }) => sourceId.toString());\n throw new RenamingTagged(idsStr);\n }\n\n await pMapSeries(multipleIds, async ({ sourceId, targetId }) => {\n const isTagged = sourceId.hasVersion();\n const sourceComp = await this.workspace.get(sourceId);\n const isEnv = this.envs.isEnv(sourceComp);\n const sourcePackageName = this.workspace.componentPackageName(sourceComp);\n renameData.push({\n sourceId,\n targetId,\n sourcePkg: sourcePackageName,\n isTagged,\n compIdsUsingItAsEnv: isEnv\n ? (await this.workspace.getComponentsUsingEnv(sourceId.toString(), true)).map((c) => c.id)\n : undefined,\n });\n });\n\n await pMapSeries(renameData, async ({ sourceId, targetId, isTagged, sourcePkg }) => {\n const sourceComp = await this.workspace.get(sourceId);\n if (!options.preserve) {\n await this.refactoring.refactorVariableAndClasses(sourceComp, sourceId, targetId);\n this.refactoring.refactorFilenames(sourceComp, sourceId, targetId);\n }\n if (isTagged) {\n const config = await this.getConfig(sourceComp);\n await this.newComponentHelper.writeAndAddNewComp(sourceComp, targetId, options, config);\n options.deprecate\n ? await this.deprecation.deprecate(sourceId, targetId)\n : await this.remove.deleteComps(sourceId.toString(), { updateMain: true });\n } else {\n this.workspace.bitMap.renameNewComponent(sourceId, targetId);\n await this.deleteLinkFromNodeModules(sourcePkg);\n }\n });\n await this.workspace.bitMap.write(`rename`);\n await this.renameAspectIdsInWorkspaceConfig(multipleIds);\n await this.workspace._reloadConsumer(); // in order to reload .bitmap file and clear all caches.\n await this.changeEnvsAccordingToNewIds(renameData);\n await pMapSeries(renameData, async (itemData) => {\n itemData.targetComp = await this.workspace.get(itemData.targetId);\n itemData.targetPkg = this.workspace.componentPackageName(itemData.targetComp);\n });\n\n const refactoredIds: ComponentID[] = [];\n if (options.refactor) {\n const allComponents = await this.workspace.list();\n const packagesToReplace: MultipleStringsReplacement = renameData.map(({ sourcePkg, targetPkg }) => {\n if (!targetPkg) throw new Error(`renameMultiple, targetPkg is missing`);\n return {\n // replace only packages ending with slash, quote or double-quote. otherwise, it could replace part of other packages.\n oldStr: `${sourcePkg}(['\"/])`,\n newStr: `${targetPkg}$1`,\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 if (!options.preserve) {\n await pMapSeries(renameData, async ({ sourceId, targetId, targetComp, isTagged }) => {\n if (isTagged) {\n // we have done this logic already for tagged components before. (search for refactorVariableAndClasses).\n return;\n }\n if (!targetComp) throw new Error(`renameMultiple, targetComp is missing`);\n await this.refactoring.refactorVariableAndClasses(targetComp, sourceId, targetId, options);\n const compPath = this.newComponentHelper.getNewComponentPath(targetId);\n this.refactoring.refactorFilenames(targetComp, sourceId, targetId);\n await this.componentWriter.writeMany({\n components: [targetComp.state._consumer],\n skipDependencyInstallation: true,\n writeToPath: path.join(this.workspace.path, compPath),\n reasonForBitmapChange: 'rename',\n });\n });\n }\n\n multipleIds.forEach(({ sourceId, targetId }) => {\n this.workspace.bitMap.renameAspectInConfig(sourceId, targetId);\n });\n\n await this.workspace.bitMap.write(`rename`);\n\n const targetComps = compact(renameData.map(({ targetComp }) => targetComp));\n await linkToNodeModulesByComponents(targetComps, this.workspace); // link the new-name to node-modules\n await this.compileGracefully(targetComps.map((c) => c.id));\n\n return { refactoredIds, renameData };\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.\n * for tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.\n * optionally (if refactor is true), change the source code to match the new scope-name.\n */\n async renameScope(\n oldScope: string,\n newScope: string,\n options: { refactor?: boolean; deprecate?: boolean; preserve?: boolean } = {}\n ): Promise<RenameResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const allComponentsIds = this.workspace.listIds();\n const componentsUsingOldScope = allComponentsIds.filter((compId) => compId.scope === oldScope);\n if (!componentsUsingOldScope.length && this.workspace.defaultScope !== oldScope) {\n throw new OldScopeNotFound(oldScope);\n }\n if (this.workspace.defaultScope === oldScope) {\n await this.workspace.setDefaultScope(newScope, false);\n }\n const multipleIds: RenameId[] = componentsUsingOldScope.map((compId) => {\n const targetId = ComponentID.fromObject({ name: compId.fullName }, newScope);\n return { sourceId: compId, targetId };\n });\n return this.renameMultiple(multipleIds, options);\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 renameOwner(\n oldOwner: string,\n newOwner: string,\n options: { refactor?: boolean; ast?: boolean }\n ): Promise<RenameResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const isScopeUsesOldOwner = (scope: string) => scope.startsWith(`${oldOwner}.`);\n const allComponentsIds = this.workspace.listIds();\n const componentsUsingOldScope = allComponentsIds.filter((compId) => isScopeUsesOldOwner(compId.scope));\n if (!componentsUsingOldScope.length && !isScopeUsesOldOwner(this.workspace.defaultScope)) {\n throw new OldScopeNotFound(oldOwner);\n }\n const oldWorkspaceDefaultScope = this.workspace.defaultScope;\n const newWorkspaceDefaultScope = isScopeUsesOldOwner(oldWorkspaceDefaultScope)\n ? this.renameOwnerInScopeName(oldWorkspaceDefaultScope, oldOwner, newOwner)\n : undefined;\n if (newWorkspaceDefaultScope) {\n await this.workspace.setDefaultScope(newWorkspaceDefaultScope, false);\n }\n const multipleIds: RenameId[] = componentsUsingOldScope.map((compId) => {\n const newScope = this.renameOwnerInScopeName(compId.scope, oldOwner, newOwner);\n const targetId = compId.hasScope() ? compId.changeScope(newScope) : compId.changeDefaultScope(newScope);\n return { sourceId: compId, targetId };\n });\n return this.renameMultiple(multipleIds, { ...options, preserve: true });\n }\n\n private async renameAspectIdsInWorkspaceConfig(ids: RenameId[]) {\n const config = this.config.workspaceConfig;\n if (!config) throw new Error('unable to get workspace config');\n const wereChangesDone = ids.map((renameId) =>\n config.renameExtensionInRaw(\n renameId.sourceId.toStringWithoutVersion(),\n renameId.targetId.toStringWithoutVersion()\n )\n );\n const hasChanged = wereChangesDone.some((isChanged) => isChanged);\n if (hasChanged) await config.write({ reasonForChange: 'rename' });\n }\n private async changeEnvsAccordingToNewIds(renameData: RenameData[]) {\n await pMapSeries(renameData, async (renameItem) => {\n const componentIds = renameItem.compIdsUsingItAsEnv;\n if (!componentIds?.length) return;\n const newEnvId = renameItem.targetId;\n const newComponentIds = componentIds.map((id) => {\n const found = renameData.find((r) => r.sourceId.isEqualWithoutVersion(id));\n return found ? found.targetId : id;\n });\n await this.workspace.setEnvToComponents(newEnvId, newComponentIds);\n });\n }\n private async deleteLinkFromNodeModules(packageName: string) {\n await fs.remove(path.join(this.workspace.path, 'node_modules', packageName));\n }\n private async compileGracefully(ids: ComponentID[]) {\n try {\n await this.compiler.compileOnWorkspace(ids);\n } catch (err: any) {\n const idsStr = ids.map((id) => id.toString()).join(', ');\n this.logger.consoleFailure(`failed compiling the component(s) ${idsStr}. error: ${err.message}`);\n }\n }\n\n private renameOwnerInScopeName(scopeName: string, oldOwner: string, newOwner: string): string {\n return scopeName.replace(`${oldOwner}.`, `${newOwner}.`);\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 ComponentWriterAspect,\n CompilerAspect,\n LoggerAspect,\n EnvsAspect,\n RemoveAspect,\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 componentWriter,\n compiler,\n loggerMain,\n envs,\n remove,\n ]: [\n CLIMain,\n Workspace,\n DeprecationMain,\n NewComponentHelperMain,\n ComponentMain,\n GraphqlMain,\n RefactoringMain,\n InstallMain,\n ConfigMain,\n ComponentWriterMain,\n CompilerMain,\n LoggerMain,\n EnvsMain,\n RemoveMain,\n ]) {\n const logger = loggerMain.createLogger(RenamingAspect.id);\n const renaming = new RenamingMain(\n workspace,\n install,\n newComponentHelper,\n deprecation,\n refactoring,\n config,\n componentWriter,\n compiler,\n logger,\n envs,\n remove\n );\n cli.register(new RenameCmd(renaming));\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeRenameCmd(renaming));\n scopeCommand?.commands?.push(new ScopeRenameOwnerCmd(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 default RenamingMain;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAA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I,QAAQ,CAAC,MAAM,IAAAO,2BAAc,EAACR,QAAQ,CAAC,CAAC;IAChDJ,aAAa,CAACa,qBAAqB,CAAC,CAAC,KAAIC,6BAAgB,EAACV,QAAQ,CAAC,CAAC,CAAC;IACrE,OAAOA,QAAQ;EACjB;AACF;AAACW,OAAA,CAAA7K,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CAzUYgB,YAAY,WAgQR,EAAE;AAAAhB,eAAA,CAhQNgB,YAAY,kBAiQD,CACpB8K,gBAAS,EACTC,4BAAe,EACfC,gCAAiB,EACjBC,8CAAwB,EACxBC,4BAAe,EACfC,wBAAa,EACbC,gCAAiB,EACjBC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,0BAAc,EACdC,sBAAY,EACZC,kBAAU,EACVC,sBAAY,CACb;AAAA3M,eAAA,CAhRUgB,YAAY,aAiRN4L,kBAAW;AA0D9BzF,0BAAc,CAAC0F,UAAU,CAAC7L,YAAY,CAAC;AAAC,IAAA8L,QAAA,GAAAjB,OAAA,CAAA9M,OAAA,GAQzBiC,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_config","_logger","_workspaceModules","_cli","_component","_deprecation","_graphql","_lodash","_compiler","_envs","_newComponentHelper","_remove","_refactoring","_componentWriter","_workspace","_pMapSeries","_install","_legacyBitId","_rename","_renaming","_renaming2","_renaming3","_scopeRename","_oldScopeNotFound","_scopeRenameOwner","_renamingTagged","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RenamingMain","constructor","workspace","install","newComponentHelper","deprecation","refactoring","config","componentWriter","compiler","logger","envs","remove","rename","sourceIdStr","targetName","options","isValidIdChunk","includes","Error","InvalidName","sourceId","resolveComponentId","targetId","getNewComponentId","undefined","scope","renameMultiple","multipleIds","renameData","stagedComps","hasVersion","isExported","idsStr","map","toString","RenamingTagged","pMapSeries","isTagged","sourceComp","get","isEnv","sourcePackageName","componentPackageName","sourcePkg","compIdsUsingItAsEnv","getComponentsUsingEnv","c","id","preserve","refactorVariableAndClasses","refactorFilenames","getConfig","writeAndAddNewComp","deprecate","deleteComps","updateMain","bitMap","renameNewComponent","deleteLinkFromNodeModules","write","renameAspectIdsInWorkspaceConfig","_reloadConsumer","changeEnvsAccordingToNewIds","itemData","targetComp","targetPkg","refactoredIds","refactor","allComponents","list","packagesToReplace","oldStr","newStr","changedComponents","replaceMultipleStrings","Promise","all","comp","compPath","getNewComponentPath","writeMany","components","state","_consumer","skipDependencyInstallation","writeToPath","path","join","reasonForBitmapChange","renameAspectInConfig","targetComps","compact","linkToNodeModulesByComponents","skipCompile","compileGracefully","getRenamingInfo","component","renameConfig","aspects","RenamingAspect","renamedFrom","ComponentID","fromObject","renameScope","oldScope","newScope","OutsideWorkspaceError","allComponentsIds","listIds","componentsUsingOldScope","compId","defaultScope","OldScopeNotFound","setDefaultScope","name","fullName","result","targetIds","installDepsGracefully","renameOwner","oldOwner","newOwner","isScopeUsesOldOwner","startsWith","oldWorkspaceDefaultScope","newWorkspaceDefaultScope","renameOwnerInScopeName","hasScope","changeScope","changeDefaultScope","ids","workspaceConfig","wereChangesDone","renameId","renameExtensionInRaw","toStringWithoutVersion","hasChanged","some","isChanged","reasonForChange","renameItem","componentIds","newEnvId","newComponentIds","found","find","isEqualWithoutVersion","setEnvToComponents","packageName","fs","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","updateExisting","err","consoleFailure","message","compileOnWorkspace","scopeName","replace","fromExisting","getConfigFromExistingToNewComponent","toObject","provider","cli","componentMain","graphql","loggerMain","createLogger","renaming","register","RenameCmd","scopeCommand","getCommand","commands","ScopeRenameCmd","ScopeRenameOwnerCmd","renamingSchema","registerShowFragments","RenamingFragment","exports","CLIAspect","WorkspaceAspect","DeprecationAspect","NewComponentHelperAspect","ComponentAspect","GraphqlAspect","RefactoringAspect","InstallAspect","ConfigAspect","ComponentWriterAspect","CompilerAspect","LoggerAspect","EnvsAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["renaming.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport type { ConfigMain } from '@teambit/config';\nimport { ConfigAspect } from '@teambit/config';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { DeprecationMain } from '@teambit/deprecation';\nimport { DeprecationAspect } from '@teambit/deprecation';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport { compact } from 'lodash';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { NewComponentHelperAspect } from '@teambit/new-component-helper';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport type { MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { RefactoringAspect } from '@teambit/refactoring';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport type { InstallMain } from '@teambit/install';\nimport { InstallAspect } from '@teambit/install';\nimport { isValidIdChunk, InvalidName } from '@teambit/legacy-bit-id';\nimport type { RenameOptions } from './rename.cmd';\nimport { RenameCmd } from './rename.cmd';\nimport { RenamingAspect } from './renaming.aspect';\nimport { RenamingFragment } from './renaming.fragment';\nimport { renamingSchema } from './renaming.graphql';\nimport { ScopeRenameCmd } from './scope-rename.cmd';\nimport { OldScopeNotFound } from './exceptions/old-scope-not-found';\nimport { ScopeRenameOwnerCmd } from './scope-rename-owner.cmd';\nimport { RenamingTagged } from './exceptions/renaming-tagged';\n\ntype RenameId = { sourceId: ComponentID; targetId: ComponentID };\ntype RenameData = RenameId & {\n sourcePkg: string;\n isTagged: boolean;\n targetPkg?: string;\n targetComp?: Component;\n compIdsUsingItAsEnv?: ComponentID[];\n};\nexport type RenameResult = { renameData: RenameData[]; refactoredIds: ComponentID[] };\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 private componentWriter: ComponentWriterMain,\n private compiler: CompilerMain,\n private logger: Logger,\n private envs: EnvsMain,\n private remove: RemoveMain\n ) {}\n\n async rename(\n sourceIdStr: string,\n targetName: string,\n options: RenameOptions = {}\n ): Promise<RenameDependencyNameResult> {\n if (!isValidIdChunk(targetName)) {\n if (targetName.includes('.'))\n throw new Error(`error: new-name argument \"${targetName}\" includes a dot.\nmake sure this argument is the name only, without the scope-name. to change the scope-name, use --scope flag`);\n throw new InvalidName(targetName);\n }\n const sourceId = await this.workspace.resolveComponentId(sourceIdStr);\n const targetId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope || sourceId.scope);\n await this.renameMultiple([{ sourceId, targetId }], options);\n\n return {\n sourceId,\n targetId,\n };\n }\n\n async renameMultiple(multipleIds: RenameId[], options: RenameOptions): Promise<RenameResult> {\n const renameData: RenameData[] = [];\n\n const stagedComps = multipleIds.filter(\n ({ sourceId }) => sourceId.hasVersion() && !this.workspace.isExported(sourceId)\n );\n\n if (stagedComps.length) {\n const idsStr = stagedComps.map(({ sourceId }) => sourceId.toString());\n throw new RenamingTagged(idsStr);\n }\n\n await pMapSeries(multipleIds, async ({ sourceId, targetId }) => {\n const isTagged = sourceId.hasVersion();\n const sourceComp = await this.workspace.get(sourceId);\n const isEnv = this.envs.isEnv(sourceComp);\n const sourcePackageName = this.workspace.componentPackageName(sourceComp);\n renameData.push({\n sourceId,\n targetId,\n sourcePkg: sourcePackageName,\n isTagged,\n compIdsUsingItAsEnv: isEnv\n ? (await this.workspace.getComponentsUsingEnv(sourceId.toString(), true)).map((c) => c.id)\n : undefined,\n });\n });\n\n await pMapSeries(renameData, async ({ sourceId, targetId, isTagged, sourcePkg }) => {\n const sourceComp = await this.workspace.get(sourceId);\n if (!options.preserve) {\n await this.refactoring.refactorVariableAndClasses(sourceComp, sourceId, targetId);\n this.refactoring.refactorFilenames(sourceComp, sourceId, targetId);\n }\n if (isTagged) {\n const config = await this.getConfig(sourceComp);\n await this.newComponentHelper.writeAndAddNewComp(sourceComp, targetId, options, config);\n options.deprecate\n ? await this.deprecation.deprecate(sourceId, targetId)\n : await this.remove.deleteComps(sourceId.toString(), { updateMain: true });\n } else {\n this.workspace.bitMap.renameNewComponent(sourceId, targetId);\n await this.deleteLinkFromNodeModules(sourcePkg);\n }\n });\n await this.workspace.bitMap.write(`rename`);\n await this.renameAspectIdsInWorkspaceConfig(multipleIds);\n await this.workspace._reloadConsumer(); // in order to reload .bitmap file and clear all caches.\n await this.changeEnvsAccordingToNewIds(renameData);\n await pMapSeries(renameData, async (itemData) => {\n itemData.targetComp = await this.workspace.get(itemData.targetId);\n itemData.targetPkg = this.workspace.componentPackageName(itemData.targetComp);\n });\n\n const refactoredIds: ComponentID[] = [];\n if (options.refactor) {\n const allComponents = await this.workspace.list();\n const packagesToReplace: MultipleStringsReplacement = renameData.map(({ sourcePkg, targetPkg }) => {\n if (!targetPkg) throw new Error(`renameMultiple, targetPkg is missing`);\n return {\n // replace only packages ending with slash, quote or double-quote. otherwise, it could replace part of other packages.\n oldStr: `${sourcePkg}(['\"/])`,\n newStr: `${targetPkg}$1`,\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 if (!options.preserve) {\n await pMapSeries(renameData, async ({ sourceId, targetId, targetComp, isTagged }) => {\n if (isTagged) {\n // we have done this logic already for tagged components before. (search for refactorVariableAndClasses).\n return;\n }\n if (!targetComp) throw new Error(`renameMultiple, targetComp is missing`);\n await this.refactoring.refactorVariableAndClasses(targetComp, sourceId, targetId, options);\n const compPath = this.newComponentHelper.getNewComponentPath(targetId);\n this.refactoring.refactorFilenames(targetComp, sourceId, targetId);\n await this.componentWriter.writeMany({\n components: [targetComp.state._consumer],\n skipDependencyInstallation: true,\n writeToPath: path.join(this.workspace.path, compPath),\n reasonForBitmapChange: 'rename',\n });\n });\n }\n\n multipleIds.forEach(({ sourceId, targetId }) => {\n this.workspace.bitMap.renameAspectInConfig(sourceId, targetId);\n });\n\n await this.workspace.bitMap.write(`rename`);\n\n const targetComps = compact(renameData.map(({ targetComp }) => targetComp));\n await linkToNodeModulesByComponents(targetComps, this.workspace); // link the new-name to node-modules\n if (!options.skipCompile) {\n await this.compileGracefully(targetComps.map((c) => c.id));\n }\n\n return { refactoredIds, renameData };\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.\n * for tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.\n * optionally (if refactor is true), change the source code to match the new scope-name.\n */\n async renameScope(\n oldScope: string,\n newScope: string,\n options: {\n refactor?: boolean;\n deprecate?: boolean;\n preserve?: boolean;\n skipDependencyInstallation?: boolean;\n } = {}\n ): Promise<RenameResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const allComponentsIds = this.workspace.listIds();\n const componentsUsingOldScope = allComponentsIds.filter((compId) => compId.scope === oldScope);\n if (!componentsUsingOldScope.length && this.workspace.defaultScope !== oldScope) {\n throw new OldScopeNotFound(oldScope);\n }\n if (this.workspace.defaultScope === oldScope) {\n await this.workspace.setDefaultScope(newScope, false);\n }\n const multipleIds: RenameId[] = componentsUsingOldScope.map((compId) => {\n const targetId = ComponentID.fromObject({ name: compId.fullName }, newScope);\n return { sourceId: compId, targetId };\n });\n // defer compilation until after install, so newly-required deps are available.\n const result = await this.renameMultiple(multipleIds, { ...options, skipCompile: true });\n const targetIds = result.renameData.map(({ targetId }) => targetId);\n if (!options.skipDependencyInstallation && targetIds.length) {\n await this.installDepsGracefully();\n }\n if (targetIds.length) {\n await this.compileGracefully(targetIds);\n }\n return result;\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 renameOwner(\n oldOwner: string,\n newOwner: string,\n options: { refactor?: boolean; ast?: boolean }\n ): Promise<RenameResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const isScopeUsesOldOwner = (scope: string) => scope.startsWith(`${oldOwner}.`);\n const allComponentsIds = this.workspace.listIds();\n const componentsUsingOldScope = allComponentsIds.filter((compId) => isScopeUsesOldOwner(compId.scope));\n if (!componentsUsingOldScope.length && !isScopeUsesOldOwner(this.workspace.defaultScope)) {\n throw new OldScopeNotFound(oldOwner);\n }\n const oldWorkspaceDefaultScope = this.workspace.defaultScope;\n const newWorkspaceDefaultScope = isScopeUsesOldOwner(oldWorkspaceDefaultScope)\n ? this.renameOwnerInScopeName(oldWorkspaceDefaultScope, oldOwner, newOwner)\n : undefined;\n if (newWorkspaceDefaultScope) {\n await this.workspace.setDefaultScope(newWorkspaceDefaultScope, false);\n }\n const multipleIds: RenameId[] = componentsUsingOldScope.map((compId) => {\n const newScope = this.renameOwnerInScopeName(compId.scope, oldOwner, newOwner);\n const targetId = compId.hasScope() ? compId.changeScope(newScope) : compId.changeDefaultScope(newScope);\n return { sourceId: compId, targetId };\n });\n return this.renameMultiple(multipleIds, { ...options, preserve: true });\n }\n\n private async renameAspectIdsInWorkspaceConfig(ids: RenameId[]) {\n const config = this.config.workspaceConfig;\n if (!config) throw new Error('unable to get workspace config');\n const wereChangesDone = ids.map((renameId) =>\n config.renameExtensionInRaw(\n renameId.sourceId.toStringWithoutVersion(),\n renameId.targetId.toStringWithoutVersion()\n )\n );\n const hasChanged = wereChangesDone.some((isChanged) => isChanged);\n if (hasChanged) await config.write({ reasonForChange: 'rename' });\n }\n private async changeEnvsAccordingToNewIds(renameData: RenameData[]) {\n await pMapSeries(renameData, async (renameItem) => {\n const componentIds = renameItem.compIdsUsingItAsEnv;\n if (!componentIds?.length) return;\n const newEnvId = renameItem.targetId;\n const newComponentIds = componentIds.map((id) => {\n const found = renameData.find((r) => r.sourceId.isEqualWithoutVersion(id));\n return found ? found.targetId : id;\n });\n await this.workspace.setEnvToComponents(newEnvId, newComponentIds);\n });\n }\n private async deleteLinkFromNodeModules(packageName: string) {\n await fs.remove(path.join(this.workspace.path, 'node_modules', packageName));\n }\n private async installDepsGracefully() {\n try {\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n } catch (err: any) {\n this.logger.consoleFailure(`failed installing dependencies. error: ${err.message}. run \"bit install\" to retry.`);\n }\n }\n\n private async compileGracefully(ids: ComponentID[]) {\n try {\n await this.compiler.compileOnWorkspace(ids);\n } catch (err: any) {\n const idsStr = ids.map((id) => id.toString()).join(', ');\n this.logger.consoleFailure(`failed compiling the component(s) ${idsStr}. error: ${err.message}`);\n }\n }\n\n private renameOwnerInScopeName(scopeName: string, oldOwner: string, newOwner: string): string {\n return scopeName.replace(`${oldOwner}.`, `${newOwner}.`);\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 ComponentWriterAspect,\n CompilerAspect,\n LoggerAspect,\n EnvsAspect,\n RemoveAspect,\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 componentWriter,\n compiler,\n loggerMain,\n envs,\n remove,\n ]: [\n CLIMain,\n Workspace,\n DeprecationMain,\n NewComponentHelperMain,\n ComponentMain,\n GraphqlMain,\n RefactoringMain,\n InstallMain,\n ConfigMain,\n ComponentWriterMain,\n CompilerMain,\n LoggerMain,\n EnvsMain,\n RemoveMain,\n ]) {\n const logger = loggerMain.createLogger(RenamingAspect.id);\n const renaming = new RenamingMain(\n workspace,\n install,\n newComponentHelper,\n deprecation,\n refactoring,\n config,\n componentWriter,\n compiler,\n logger,\n envs,\n remove\n );\n cli.register(new RenameCmd(renaming));\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeRenameCmd(renaming));\n scopeCommand?.commands?.push(new ScopeRenameOwnerCmd(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 default RenamingMain;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,G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J,GAAG,CAACM,QAAQ,CAAC,KAAIC,mBAAS,EAACF,QAAQ,CAAC,CAAC;IAErC,MAAMG,YAAY,GAAGR,GAAG,CAACS,UAAU,CAAC,OAAO,CAAC;IAC5CD,YAAY,EAAEE,QAAQ,EAAEtM,IAAI,CAAC,KAAIuM,6BAAc,EAACN,QAAQ,CAAC,CAAC;IAC1DG,YAAY,EAAEE,QAAQ,EAAEtM,IAAI,CAAC,KAAIwM,uCAAmB,EAACP,QAAQ,CAAC,CAAC;IAE/DH,OAAO,CAACI,QAAQ,CAAC,MAAM,IAAAO,2BAAc,EAACR,QAAQ,CAAC,CAAC;IAChDJ,aAAa,CAACa,qBAAqB,CAAC,CAAC,KAAIC,6BAAgB,EAACV,QAAQ,CAAC,CAAC,CAAC;IACrE,OAAOA,QAAQ;EACjB;AACF;AAACW,OAAA,CAAAtL,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CAvWYgB,YAAY,WA8RR,EAAE;AAAAhB,eAAA,CA9RNgB,YAAY,kBA+RD,CACpBuL,gBAAS,EACTC,4BAAe,EACfC,gCAAiB,EACjBC,8CAAwB,EACxBC,4BAAe,EACfC,wBAAa,EACbC,gCAAiB,EACjBC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,0BAAc,EACdC,sBAAY,EACZC,kBAAU,EACVC,sBAAY,CACb;AAAApN,eAAA,CA9SUgB,YAAY,aA+SNqM,kBAAW;AA0D9BjG,0BAAc,CAACkG,UAAU,CAACtM,YAAY,CAAC;AAAC,IAAAuM,QAAA,GAAAjB,OAAA,CAAAvN,OAAA,GAQzBiC,YAAY","ignoreList":[]}
|
package/dist/renaming.spec.js
CHANGED
|
@@ -59,7 +59,9 @@ describe('Renaming Aspect', function () {
|
|
|
59
59
|
renaming = harmony.get(_renaming().RenamingAspect.id);
|
|
60
60
|
workspace = harmony.get(_workspace().WorkspaceAspect.id);
|
|
61
61
|
await renaming.rename('comp1', 'ui/comp1');
|
|
62
|
-
await renaming.renameScope(workspaceData.remoteScopeName, 'another-scope-name'
|
|
62
|
+
await renaming.renameScope(workspaceData.remoteScopeName, 'another-scope-name', {
|
|
63
|
+
skipDependencyInstallation: true
|
|
64
|
+
});
|
|
63
65
|
});
|
|
64
66
|
after(async () => {
|
|
65
67
|
await (0, _workspaceTesting().destroyWorkspace)(workspaceData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chai","data","require","_harmonyTesting","_workspace","_workspaceTesting","_componentTesting","_renaming","use","describe","timeout","renaming","workspace","workspaceData","before","mockWorkspace","workspacePath","mockComponents","harmony","loadManyAspects","WorkspaceAspect","RenamingAspect","get","id","rename","renameScope","remoteScopeName","after","destroyWorkspace","it","ids","listIds","expect","scope","to","equal","fullName"],"sources":["renaming.spec.ts"],"sourcesContent":["import { expect, use } from 'chai';\nimport { loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockWorkspace, destroyWorkspace } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport type { RenamingMain } from './renaming.main.runtime';\nimport { RenamingAspect } from './renaming.aspect';\n\nuse(require('chai-fs'));\n\ndescribe('Renaming Aspect', function () {\n this.timeout(0);\n\n describe('rename scope when a component id has a namespace', () => {\n let renaming: RenamingMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n\n const harmony = await loadManyAspects([WorkspaceAspect, RenamingAspect], workspacePath);\n renaming = harmony.get<RenamingMain>(RenamingAspect.id);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n\n await renaming.rename('comp1', 'ui/comp1');\n await renaming.renameScope(workspaceData.remoteScopeName, 'another-scope-name');\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n // previously, it was throwing MissingBitMapComponent due to incorrect replacement of \"ui/comp1\" with \"comp1\"\n it('should bring the files back', async () => {\n const ids = await workspace.listIds();\n expect(ids[0].scope).to.equal('another-scope-name');\n expect(ids[0].fullName).to.equal('ui/comp1');\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAO,WAAG,EAACN,OAAO,CAAC,SAAS,CAAC,CAAC;AAEvBO,QAAQ,CAAC,iBAAiB,EAAE,YAAY;EACtC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAEfD,QAAQ,CAAC,kDAAkD,EAAE,MAAM;IACjE,IAAIE,QAAsB;IAC1B,IAAIC,SAAoB;IACxB,IAAIC,aAA4B;IAChCC,MAAM,CAAC,YAAY;MACjBD,aAAa,GAAG,IAAAE,iCAAa,EAAC,CAAC;MAC/B,MAAM;QAAEC;MAAc,CAAC,GAAGH,aAAa;MACvC,MAAM,IAAAI,kCAAc,EAACD,aAAa,CAAC;MAEnC,MAAME,OAAO,GAAG,MAAM,IAAAC,iCAAe,EAAC,CAACC,4BAAe,EAAEC,0BAAc,CAAC,EAAEL,aAAa,CAAC;MACvFL,QAAQ,GAAGO,OAAO,CAACI,GAAG,CAAeD,0BAAc,CAACE,EAAE,CAAC;MACvDX,SAAS,GAAGM,OAAO,CAACI,GAAG,CAAYF,4BAAe,CAACG,EAAE,CAAC;MAEtD,MAAMZ,QAAQ,CAACa,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC;MAC1C,MAAMb,QAAQ,CAACc,WAAW,CAACZ,aAAa,CAACa,eAAe,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_harmonyTesting","_workspace","_workspaceTesting","_componentTesting","_renaming","use","describe","timeout","renaming","workspace","workspaceData","before","mockWorkspace","workspacePath","mockComponents","harmony","loadManyAspects","WorkspaceAspect","RenamingAspect","get","id","rename","renameScope","remoteScopeName","skipDependencyInstallation","after","destroyWorkspace","it","ids","listIds","expect","scope","to","equal","fullName"],"sources":["renaming.spec.ts"],"sourcesContent":["import { expect, use } from 'chai';\nimport { loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockWorkspace, destroyWorkspace } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport type { RenamingMain } from './renaming.main.runtime';\nimport { RenamingAspect } from './renaming.aspect';\n\nuse(require('chai-fs'));\n\ndescribe('Renaming Aspect', function () {\n this.timeout(0);\n\n describe('rename scope when a component id has a namespace', () => {\n let renaming: RenamingMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n\n const harmony = await loadManyAspects([WorkspaceAspect, RenamingAspect], workspacePath);\n renaming = harmony.get<RenamingMain>(RenamingAspect.id);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n\n await renaming.rename('comp1', 'ui/comp1');\n await renaming.renameScope(workspaceData.remoteScopeName, 'another-scope-name', {\n skipDependencyInstallation: true,\n });\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n // previously, it was throwing MissingBitMapComponent due to incorrect replacement of \"ui/comp1\" with \"comp1\"\n it('should bring the files back', async () => {\n const ids = await workspace.listIds();\n expect(ids[0].scope).to.equal('another-scope-name');\n expect(ids[0].fullName).to.equal('ui/comp1');\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,SAAA,YAAAA,CAAA;I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AAM,EAACF,GAAG,CAAC,CAAC,CAAC,CAACM,QAAQ,CAAC,CAACF,EAAE,CAACC,KAAK,CAAC,UAAU,CAAC;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,11 +11,13 @@ export declare class ScopeRenameCmd implements Command {
|
|
|
11
11
|
}[];
|
|
12
12
|
options: CommandOptions;
|
|
13
13
|
group: string;
|
|
14
|
+
loader: boolean;
|
|
14
15
|
constructor(renaming: RenamingMain);
|
|
15
|
-
report([oldName, newName]: [string, string], { refactor, deprecate, preserve }: {
|
|
16
|
+
report([oldName, newName]: [string, string], { refactor, deprecate, preserve, skipDependencyInstallation, }: {
|
|
16
17
|
refactor?: boolean;
|
|
17
18
|
deprecate?: boolean;
|
|
18
19
|
preserve?: boolean;
|
|
20
|
+
skipDependencyInstallation?: boolean;
|
|
19
21
|
}): Promise<string>;
|
|
20
22
|
}
|
|
21
23
|
export declare function renameScopeOutput(renameResult: RenameResult): string;
|
package/dist/scope-rename.cmd.js
CHANGED
|
@@ -30,18 +30,21 @@ as a result of this change`);
|
|
|
30
30
|
name: 'new-scope-name',
|
|
31
31
|
description: 'a new scope name to replace the current scope name'
|
|
32
32
|
}]);
|
|
33
|
-
_defineProperty(this, "options", [['', 'preserve', 'avoid renaming files and variables/classes according to the new scope name'], ['r', 'refactor', 'update the import statements in all dependent components to the new package name (i.e. with the new scope name)'], ['', 'deprecate', 'for exported components, instead of deleting the original components, deprecating them']]);
|
|
33
|
+
_defineProperty(this, "options", [['', 'preserve', 'avoid renaming files and variables/classes according to the new scope name'], ['r', 'refactor', 'update the import statements in all dependent components to the new package name (i.e. with the new scope name)'], ['', 'deprecate', 'for exported components, instead of deleting the original components, deprecating them'], ['x', 'skip-dependency-installation', 'do not install dependencies after the rename']]);
|
|
34
34
|
_defineProperty(this, "group", 'component-config');
|
|
35
|
+
_defineProperty(this, "loader", true);
|
|
35
36
|
}
|
|
36
37
|
async report([oldName, newName], {
|
|
37
38
|
refactor,
|
|
38
39
|
deprecate,
|
|
39
|
-
preserve
|
|
40
|
+
preserve,
|
|
41
|
+
skipDependencyInstallation
|
|
40
42
|
}) {
|
|
41
43
|
const result = await this.renaming.renameScope(oldName, newName, {
|
|
42
44
|
refactor,
|
|
43
45
|
deprecate,
|
|
44
|
-
preserve
|
|
46
|
+
preserve,
|
|
47
|
+
skipDependencyInstallation
|
|
45
48
|
});
|
|
46
49
|
const renameOutput = renameScopeOutput(result);
|
|
47
50
|
return (0, _cli().joinSections)([(0, _cli().formatSuccessSummary)(`replaced "${oldName}" scope with "${newName}"`), renameOutput]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeRenameCmd","constructor","renaming","name","description","report","oldName","newName","refactor","deprecate","preserve","result","renameScope","renameOutput","renameScopeOutput","joinSections","formatSuccessSummary","exports","renameResult","renameData","refactoredIds","renamedSection","length","formatTitle","map","item","formatItem","sourceId","toStringWithoutVersion","isTagged","targetId","toString","join","refactoredSection","id"],"sources":["scope-rename.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatTitle, formatItem, formatSuccessSummary, joinSections } from '@teambit/cli';\nimport type { RenameResult, RenamingMain } from './renaming.main.runtime';\n\nexport class ScopeRenameCmd implements Command {\n name = 'rename <current-scope-name> <new-scope-name>';\n description =\n \"rename the scope name for all components with the specified 'current scope name'. if exported, create new components and delete the original ones\";\n extendedDescription = `Note: if \\`<current-scope-name>\\` is also the defaultScope for the workspace, this command will set \\`<new-scope-name>\\`\nas the defaultScope instead, and that will then be set for all components by default. You may see updates in your .bitmap file\nas a result of this change`;\n arguments = [\n { name: 'current-scope-name', description: 'the scope name to be replaced by another scope name' },\n { name: 'new-scope-name', description: 'a new scope name to replace the current scope name' },\n ];\n options = [\n ['', 'preserve', 'avoid renaming files and variables/classes according to the new scope name'],\n [\n 'r',\n 'refactor',\n 'update the import statements in all dependent components to the new package name (i.e. with the new scope name)',\n ],\n ['', 'deprecate', 'for exported components, instead of deleting the original components, deprecating them'],\n ] as CommandOptions;\n group = 'component-config';\n\n constructor(private renaming: RenamingMain) {}\n\n async report(\n [oldName, newName]: [string, string],\n {
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeRenameCmd","constructor","renaming","name","description","report","oldName","newName","refactor","deprecate","preserve","skipDependencyInstallation","result","renameScope","renameOutput","renameScopeOutput","joinSections","formatSuccessSummary","exports","renameResult","renameData","refactoredIds","renamedSection","length","formatTitle","map","item","formatItem","sourceId","toStringWithoutVersion","isTagged","targetId","toString","join","refactoredSection","id"],"sources":["scope-rename.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatTitle, formatItem, formatSuccessSummary, joinSections } from '@teambit/cli';\nimport type { RenameResult, RenamingMain } from './renaming.main.runtime';\n\nexport class ScopeRenameCmd implements Command {\n name = 'rename <current-scope-name> <new-scope-name>';\n description =\n \"rename the scope name for all components with the specified 'current scope name'. if exported, create new components and delete the original ones\";\n extendedDescription = `Note: if \\`<current-scope-name>\\` is also the defaultScope for the workspace, this command will set \\`<new-scope-name>\\`\nas the defaultScope instead, and that will then be set for all components by default. You may see updates in your .bitmap file\nas a result of this change`;\n arguments = [\n { name: 'current-scope-name', description: 'the scope name to be replaced by another scope name' },\n { name: 'new-scope-name', description: 'a new scope name to replace the current scope name' },\n ];\n options = [\n ['', 'preserve', 'avoid renaming files and variables/classes according to the new scope name'],\n [\n 'r',\n 'refactor',\n 'update the import statements in all dependent components to the new package name (i.e. with the new scope name)',\n ],\n ['', 'deprecate', 'for exported components, instead of deleting the original components, deprecating them'],\n ['x', 'skip-dependency-installation', 'do not install dependencies after the rename'],\n ] as CommandOptions;\n group = 'component-config';\n loader = true;\n\n constructor(private renaming: RenamingMain) {}\n\n async report(\n [oldName, newName]: [string, string],\n {\n refactor,\n deprecate,\n preserve,\n skipDependencyInstallation,\n }: { refactor?: boolean; deprecate?: boolean; preserve?: boolean; skipDependencyInstallation?: boolean }\n ) {\n const result = await this.renaming.renameScope(oldName, newName, {\n refactor,\n deprecate,\n preserve,\n skipDependencyInstallation,\n });\n const renameOutput = renameScopeOutput(result);\n return joinSections([formatSuccessSummary(`replaced \"${oldName}\" scope with \"${newName}\"`), renameOutput]);\n }\n}\n\nexport function renameScopeOutput(renameResult: RenameResult): string {\n const { renameData, refactoredIds } = renameResult;\n const renamedSection = renameData.length\n ? [\n formatTitle(`affected components (${renameData.length})`),\n ...renameData.map((item) =>\n formatItem(\n `${item.sourceId.toStringWithoutVersion()} ${item.isTagged ? '(deprecated) ' : ''}-> ${item.targetId.toString()}`\n )\n ),\n ].join('\\n')\n : '';\n const refactoredSection = refactoredIds.length\n ? [\n formatTitle(`refactored components (${refactoredIds.length})`),\n ...refactoredIds.map((id) => formatItem(id.toString())),\n ].join('\\n')\n : '';\n return joinSections([renamedSection, refactoredSection]);\n}\n"],"mappings":";;;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2F,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YA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1
|
{
|
|
2
2
|
"name": "@teambit/renaming",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.967",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/renaming",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "renaming",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.967"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -16,22 +16,22 @@
|
|
|
16
16
|
"p-map-series": "2.1.0",
|
|
17
17
|
"@teambit/cli": "0.0.1320",
|
|
18
18
|
"@teambit/harmony": "0.4.7",
|
|
19
|
-
"@teambit/config": "0.0.1495",
|
|
20
|
-
"@teambit/legacy-bit-id": "1.1.3",
|
|
21
|
-
"@teambit/logger": "0.0.1413",
|
|
22
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.341",
|
|
23
|
-
"@teambit/bit-error": "0.0.404",
|
|
24
19
|
"@teambit/component": "1.0.966",
|
|
25
20
|
"@teambit/graphql": "1.0.966",
|
|
26
21
|
"@teambit/compiler": "1.0.966",
|
|
27
22
|
"@teambit/component-writer": "1.0.966",
|
|
23
|
+
"@teambit/config": "0.0.1495",
|
|
28
24
|
"@teambit/deprecation": "1.0.966",
|
|
29
25
|
"@teambit/envs": "1.0.966",
|
|
30
26
|
"@teambit/install": "1.0.966",
|
|
27
|
+
"@teambit/legacy-bit-id": "1.1.3",
|
|
28
|
+
"@teambit/logger": "0.0.1413",
|
|
31
29
|
"@teambit/new-component-helper": "1.0.966",
|
|
32
30
|
"@teambit/refactoring": "1.0.966",
|
|
33
31
|
"@teambit/remove": "1.0.966",
|
|
34
|
-
"@teambit/workspace": "
|
|
32
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.341",
|
|
33
|
+
"@teambit/workspace": "1.0.966",
|
|
34
|
+
"@teambit/bit-error": "0.0.404"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/fs-extra": "9.0.7",
|