@teambit/refactoring 1.0.622 → 1.0.624
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/refactor.cmd.js
CHANGED
@@ -23,7 +23,7 @@ class DependencyNameRefactorCmd {
|
|
23
23
|
_defineProperty(this, "name", 'dependency-name <old-id> <new-id>');
|
24
24
|
_defineProperty(this, "description", "replace the dependency's old package-name with a new one in the code");
|
25
25
|
_defineProperty(this, "options", []);
|
26
|
-
_defineProperty(this, "group", '
|
26
|
+
_defineProperty(this, "group", 'workspace-tools');
|
27
27
|
// extendedDescription = `${PATTERN_HELP('refactor dependency-name')}`;
|
28
28
|
_defineProperty(this, "extendedDescription", `the \`<old-id>\` and \`<new-id>\` arguments can be either a component-id or a package-name.`);
|
29
29
|
}
|
@@ -46,7 +46,7 @@ class RefactorCmd {
|
|
46
46
|
_defineProperty(this, "alias", '');
|
47
47
|
_defineProperty(this, "description", 'source code refactoring / codemod');
|
48
48
|
_defineProperty(this, "options", []);
|
49
|
-
_defineProperty(this, "group", '
|
49
|
+
_defineProperty(this, "group", 'workspace-tools');
|
50
50
|
_defineProperty(this, "commands", []);
|
51
51
|
}
|
52
52
|
async report([unrecognizedSubcommand]) {
|
package/dist/refactor.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DependencyNameRefactorCmd","constructor","refactoringMain","componentMain","report","oldId","newId","host","getHost","allComps","list","changedComponents","oldPackageName","newPackageName","refactorDependencyName","Promise","all","map","comp","write","c","id","toString","join","exports","RefactorCmd","unrecognizedSubcommand","chalk","red"],"sources":["refactor.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentMain } from '@teambit/component';\n// import { PATTERN_HELP } from '@teambit/legacy.constants';\nimport chalk from 'chalk';\nimport { RefactoringMain } from './refactoring.main.runtime';\n\nexport class DependencyNameRefactorCmd implements Command {\n name = 'dependency-name <old-id> <new-id>';\n description = \"replace the dependency's old package-name with a new one in the code\";\n options = [] as CommandOptions;\n group = '
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DependencyNameRefactorCmd","constructor","refactoringMain","componentMain","report","oldId","newId","host","getHost","allComps","list","changedComponents","oldPackageName","newPackageName","refactorDependencyName","Promise","all","map","comp","write","c","id","toString","join","exports","RefactorCmd","unrecognizedSubcommand","chalk","red"],"sources":["refactor.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentMain } from '@teambit/component';\n// import { PATTERN_HELP } from '@teambit/legacy.constants';\nimport chalk from 'chalk';\nimport { RefactoringMain } from './refactoring.main.runtime';\n\nexport class DependencyNameRefactorCmd implements Command {\n name = 'dependency-name <old-id> <new-id>';\n description = \"replace the dependency's old package-name with a new one in the code\";\n options = [] as CommandOptions;\n group = 'workspace-tools';\n // extendedDescription = `${PATTERN_HELP('refactor dependency-name')}`;\n extendedDescription = `the \\`<old-id>\\` and \\`<new-id>\\` arguments can be either a component-id or a package-name.`;\n\n constructor(\n private refactoringMain: RefactoringMain,\n private componentMain: ComponentMain\n ) {}\n\n async report([oldId, newId]: [string, string]) {\n const host = this.componentMain.getHost();\n const allComps = await host.list();\n const { changedComponents, oldPackageName, newPackageName } = await this.refactoringMain.refactorDependencyName(\n allComps,\n oldId,\n newId\n );\n await Promise.all(changedComponents.map((comp) => host.write(comp)));\n return `the following components have been changed (${oldPackageName} => ${newPackageName}):\\n${changedComponents\n .map((c) => c.id.toString())\n .join('\\n')}`;\n }\n}\n\nexport class RefactorCmd implements Command {\n name = 'refactor <sub-command>';\n alias = '';\n description = 'source code refactoring / codemod';\n options = [];\n group = 'workspace-tools';\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"refactor\", please run \"bit refactor --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AAIA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,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,KAJ1B;AAGA;AAIO,MAAMgB,yB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,CAAC,CAACsB,sBAAsB,CAAW,EAAE;IAC/C,OAAOC,gBAAK,CAACC,GAAG,CACd,IAAIF,sBAAsB,+FAC5B,CAAC;EACH;AACF;AAACF,OAAA,CAAAC,WAAA,GAAAA,WAAA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/refactoring",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.624",
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/refactoring",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "refactoring",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.624"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "4.1.2",
|
@@ -15,13 +15,13 @@
|
|
15
15
|
"lodash": "4.17.21",
|
16
16
|
"@teambit/harmony": "0.4.7",
|
17
17
|
"@teambit/bit-error": "0.0.404",
|
18
|
-
"@teambit/cli": "0.0.
|
19
|
-
"@teambit/component": "1.0.
|
18
|
+
"@teambit/cli": "0.0.1201",
|
19
|
+
"@teambit/component": "1.0.624",
|
20
20
|
"@teambit/component.sources": "0.0.102",
|
21
|
-
"@teambit/envs": "1.0.
|
21
|
+
"@teambit/envs": "1.0.624",
|
22
22
|
"@teambit/legacy.utils": "0.0.21",
|
23
|
-
"@teambit/pkg": "1.0.
|
24
|
-
"@teambit/typescript": "1.0.
|
23
|
+
"@teambit/pkg": "1.0.624",
|
24
|
+
"@teambit/typescript": "1.0.624"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
27
|
"@types/lodash": "4.14.165",
|
File without changes
|