@teambit/renaming 1.0.204 → 1.0.206

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,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="1" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/renaming@1.0.204" tests="1" failures="0" errors="0" skipped="0">
3
+ <testsuite name="teambit.component/renaming@1.0.206" tests="1" failures="0" errors="0" skipped="0">
4
4
  <testcase classname="dist/renaming.spec.js" name="should bring the files back"/>
5
5
  </testsuite>
6
6
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/renaming-preview"]=t():e["teambit.component/renaming-preview"]=t()}(self,(()=>(()=>{"use strict";var e={82232:(e,t,o)=>{var n={id:"teambit.component/renaming@1.0.204",homepage:"https://bit.cloud/teambit/component/renaming",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const p=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/rename.svg"}));p.__bit_component=n,t.Logo=p},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>u,compositions_metadata:()=>f,overview:()=>m});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(82232);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a.apply(this,arguments)}var c={},s="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,r.mdx)(s,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],m=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/renaming-preview"]=t():e["teambit.component/renaming-preview"]=t()}(self,(()=>(()=>{"use strict";var e={73162:(e,t,o)=>{var n={id:"teambit.component/renaming@1.0.206",homepage:"https://bit.cloud/teambit/component/renaming",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const p=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/rename.svg"}));p.__bit_component=n,t.Logo=p},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>u,compositions_metadata:()=>f,overview:()=>m});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(73162);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a.apply(this,arguments)}var c={},s="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,r.mdx)(s,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],m=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
@@ -497,7 +497,7 @@
497
497
  "__schema": "FunctionLikeSchema",
498
498
  "location": {
499
499
  "filePath": "renaming.main.runtime.ts",
500
- "line": 178,
500
+ "line": 179,
501
501
  "character": 3
502
502
  },
503
503
  "signature": "(method) RenamingMain.getRenamingInfo(component: Component): RenamingInfo | null",
@@ -507,7 +507,7 @@
507
507
  "__schema": "ParameterSchema",
508
508
  "location": {
509
509
  "filePath": "renaming.main.runtime.ts",
510
- "line": 178,
510
+ "line": 179,
511
511
  "character": 19
512
512
  },
513
513
  "name": "component",
@@ -515,7 +515,7 @@
515
515
  "__schema": "TypeRefSchema",
516
516
  "location": {
517
517
  "filePath": "renaming.main.runtime.ts",
518
- "line": 178,
518
+ "line": 179,
519
519
  "character": 30
520
520
  },
521
521
  "name": "Component",
@@ -532,7 +532,7 @@
532
532
  "__schema": "TypeUnionSchema",
533
533
  "location": {
534
534
  "filePath": "renaming.main.runtime.ts",
535
- "line": 178,
535
+ "line": 179,
536
536
  "character": 42
537
537
  },
538
538
  "types": [
@@ -540,7 +540,7 @@
540
540
  "__schema": "TypeRefSchema",
541
541
  "location": {
542
542
  "filePath": "renaming.main.runtime.ts",
543
- "line": 178,
543
+ "line": 179,
544
544
  "character": 42
545
545
  },
546
546
  "name": "RenamingInfo",
@@ -550,7 +550,7 @@
550
550
  "__schema": "LiteralTypeSchema",
551
551
  "location": {
552
552
  "filePath": "renaming.main.runtime.ts",
553
- "line": 178,
553
+ "line": 179,
554
554
  "character": 57
555
555
  },
556
556
  "name": "null"
@@ -570,13 +570,13 @@
570
570
  "__schema": "DocSchema",
571
571
  "location": {
572
572
  "filePath": "renaming.main.runtime.ts",
573
- "line": 186,
573
+ "line": 187,
574
574
  "character": 3
575
575
  },
576
- "raw": "/**\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 */",
577
- "comment": "change the default-scope for new components. optionally (if refactor is true), change the source code to match the\nnew scope-name.\nkeep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors\nthrown in such cases in this method."
576
+ "raw": "/**\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 */",
577
+ "comment": "change the default-scope for new components.\nfor tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.\noptionally (if refactor is true), change the source code to match the new scope-name."
578
578
  },
579
- "signature": "(method) RenamingMain.renameScope(oldScope: string, newScope: string, options?: {\n refactor?: boolean;\n deprecate?: boolean;\n}): Promise<RenameResult>",
579
+ "signature": "(method) RenamingMain.renameScope(oldScope: string, newScope: string, options?: {\n refactor?: boolean;\n deprecate?: boolean;\n preserve?: boolean;\n}): Promise<RenameResult>",
580
580
  "name": "renameScope",
581
581
  "params": [
582
582
  {
@@ -674,6 +674,26 @@
674
674
  "name": "boolean"
675
675
  },
676
676
  "isOptional": true
677
+ },
678
+ {
679
+ "__schema": "VariableLikeSchema",
680
+ "location": {
681
+ "filePath": "renaming.main.runtime.ts",
682
+ "line": 195,
683
+ "character": 57
684
+ },
685
+ "signature": "(property) preserve?: boolean | undefined",
686
+ "name": "preserve",
687
+ "type": {
688
+ "__schema": "KeywordTypeSchema",
689
+ "location": {
690
+ "filePath": "renaming.main.runtime.ts",
691
+ "line": 195,
692
+ "character": 68
693
+ },
694
+ "name": "boolean"
695
+ },
696
+ "isOptional": true
677
697
  }
678
698
  ]
679
699
  },
@@ -1762,7 +1782,7 @@
1762
1782
  "__schema": "FunctionLikeSchema",
1763
1783
  "location": {
1764
1784
  "filePath": "renaming.main.runtime.ts",
1765
- "line": 178,
1785
+ "line": 179,
1766
1786
  "character": 3
1767
1787
  },
1768
1788
  "signature": "(method) RenamingMain.getRenamingInfo(component: Component): RenamingInfo | null",
@@ -1772,7 +1792,7 @@
1772
1792
  "__schema": "ParameterSchema",
1773
1793
  "location": {
1774
1794
  "filePath": "renaming.main.runtime.ts",
1775
- "line": 178,
1795
+ "line": 179,
1776
1796
  "character": 19
1777
1797
  },
1778
1798
  "name": "component",
@@ -1780,7 +1800,7 @@
1780
1800
  "__schema": "TypeRefSchema",
1781
1801
  "location": {
1782
1802
  "filePath": "renaming.main.runtime.ts",
1783
- "line": 178,
1803
+ "line": 179,
1784
1804
  "character": 30
1785
1805
  },
1786
1806
  "name": "Component",
@@ -1797,7 +1817,7 @@
1797
1817
  "__schema": "TypeUnionSchema",
1798
1818
  "location": {
1799
1819
  "filePath": "renaming.main.runtime.ts",
1800
- "line": 178,
1820
+ "line": 179,
1801
1821
  "character": 42
1802
1822
  },
1803
1823
  "types": [
@@ -1805,7 +1825,7 @@
1805
1825
  "__schema": "TypeRefSchema",
1806
1826
  "location": {
1807
1827
  "filePath": "renaming.main.runtime.ts",
1808
- "line": 178,
1828
+ "line": 179,
1809
1829
  "character": 42
1810
1830
  },
1811
1831
  "name": "RenamingInfo",
@@ -1815,7 +1835,7 @@
1815
1835
  "__schema": "LiteralTypeSchema",
1816
1836
  "location": {
1817
1837
  "filePath": "renaming.main.runtime.ts",
1818
- "line": 178,
1838
+ "line": 179,
1819
1839
  "character": 57
1820
1840
  },
1821
1841
  "name": "null"
@@ -1835,13 +1855,13 @@
1835
1855
  "__schema": "DocSchema",
1836
1856
  "location": {
1837
1857
  "filePath": "renaming.main.runtime.ts",
1838
- "line": 186,
1858
+ "line": 187,
1839
1859
  "character": 3
1840
1860
  },
1841
- "raw": "/**\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 */",
1842
- "comment": "change the default-scope for new components. optionally (if refactor is true), change the source code to match the\nnew scope-name.\nkeep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors\nthrown in such cases in this method."
1861
+ "raw": "/**\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 */",
1862
+ "comment": "change the default-scope for new components.\nfor tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.\noptionally (if refactor is true), change the source code to match the new scope-name."
1843
1863
  },
1844
- "signature": "(method) RenamingMain.renameScope(oldScope: string, newScope: string, options?: {\n refactor?: boolean;\n deprecate?: boolean;\n}): Promise<RenameResult>",
1864
+ "signature": "(method) RenamingMain.renameScope(oldScope: string, newScope: string, options?: {\n refactor?: boolean;\n deprecate?: boolean;\n preserve?: boolean;\n}): Promise<RenameResult>",
1845
1865
  "name": "renameScope",
1846
1866
  "params": [
1847
1867
  {
@@ -1939,6 +1959,26 @@
1939
1959
  "name": "boolean"
1940
1960
  },
1941
1961
  "isOptional": true
1962
+ },
1963
+ {
1964
+ "__schema": "VariableLikeSchema",
1965
+ "location": {
1966
+ "filePath": "renaming.main.runtime.ts",
1967
+ "line": 195,
1968
+ "character": 57
1969
+ },
1970
+ "signature": "(property) preserve?: boolean | undefined",
1971
+ "name": "preserve",
1972
+ "type": {
1973
+ "__schema": "KeywordTypeSchema",
1974
+ "location": {
1975
+ "filePath": "renaming.main.runtime.ts",
1976
+ "line": 195,
1977
+ "character": 68
1978
+ },
1979
+ "name": "boolean"
1980
+ },
1981
+ "isOptional": true
1942
1982
  }
1943
1983
  ]
1944
1984
  },
@@ -2815,7 +2855,7 @@
2815
2855
  "componentId": {
2816
2856
  "scope": "teambit.component",
2817
2857
  "name": "renaming",
2818
- "version": "1.0.204"
2858
+ "version": "1.0.206"
2819
2859
  },
2820
2860
  "taggedModuleExports": []
2821
2861
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@1.0.204/dist/renaming.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@1.0.204/dist/renaming.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@1.0.206/dist/renaming.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_renaming@1.0.206/dist/renaming.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -31,7 +31,7 @@ class RenameCmd {
31
31
  _defineProperty(this, "group", 'collaborate');
32
32
  _defineProperty(this, "skipWorkspace", true);
33
33
  _defineProperty(this, "alias", '');
34
- _defineProperty(this, "options", [['s', 'scope <scope-name>', 'define the scope for the newly created component'], ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'], ['', 'preserve', 'avoid renaming files and variables/classes according to the new component name'], ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'], ['', 'delete', 'DEPRECATED. this is now the default'], ['', 'deprecate', 'instead of deleting the original component, deprecating it'], ['p', 'path <relative-path>', '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']]);
34
+ _defineProperty(this, "options", [['s', 'scope <scope-name>', 'define the scope for the new component'], ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'], ['', 'preserve', 'avoid renaming files and variables/classes according to the new component name'], ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'], ['', 'delete', 'DEPRECATED. this is now the default'], ['', 'deprecate', 'instead of deleting the original component, deprecating it'], ['p', 'path <relative-path>', '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']]);
35
35
  _defineProperty(this, "loader", true);
36
36
  _defineProperty(this, "remoteOp", true);
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","RenameCmd","constructor","renaming","name","description","report","sourceId","targetId","options","results","rename","chalk","green","bold","toString","exports"],"sources":["rename.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { RenamingMain } from '.';\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 =\n 'rename component. if exported, create a new component and delete the original component. otherwise just renames current component';\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 = 'collaborate';\n skipWorkspace = true;\n alias = '';\n options = [\n ['s', 'scope <scope-name>', 'define the scope for the newly created 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', 'EXPERIMENTAL. 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 chalk.green(\n `successfully 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;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GA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,CAAC,EAC7G,CAAC,EAAE,EAAE,UAAU,EAAE,gFAAgF,CAAC,EAClG,CAAC,EAAE,EAAE,KAAK,EAAE,2DAA2D,CAAC,EACxE,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,MAAMyB,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,OAAOG,gBAAK,CAACC,KAAK,CACf,wBAAuBD,gBAAK,CAACE,IAAI,CAACJ,OAAO,CAACH,QAAQ,CAACQ,QAAQ,CAAC,CAAC,CAAE,OAAMH,gBAAK,CAACE,IAAI,CAACJ,OAAO,CAACF,QAAQ,CAACO,QAAQ,CAAC,CAAC,CAAE,EAChH,CAAC;EACH;AACF;AAACC,OAAA,CAAAf,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","RenameCmd","constructor","renaming","name","description","report","sourceId","targetId","options","results","rename","chalk","green","bold","toString","exports"],"sources":["rename.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { RenamingMain } from '.';\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 =\n 'rename component. if exported, create a new component and delete the original component. otherwise just renames current component';\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 = 'collaborate';\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', 'EXPERIMENTAL. 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 chalk.green(\n `successfully 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;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,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qC,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,MAAMyB,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,OAAOG,gBAAK,CAACC,KAAK,CACf,wBAAuBD,gBAAK,CAACE,IAAI,CAACJ,OAAO,CAACH,QAAQ,CAACQ,QAAQ,CAAC,CAAC,CAAE,OAAMH,gBAAK,CAACE,IAAI,CAACJ,OAAO,CAACF,QAAQ,CAACO,QAAQ,CAAC,CAAC,CAAE,EAChH,CAAC;EACH;AACF;AAACC,OAAA,CAAAf,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -45,14 +45,14 @@ export declare class RenamingMain {
45
45
  renameMultiple(multipleIds: RenameId[], options: RenameOptions): Promise<RenameResult>;
46
46
  getRenamingInfo(component: Component): RenamingInfo | null;
47
47
  /**
48
- * change the default-scope for new components. optionally (if refactor is true), change the source code to match the
49
- * new scope-name.
50
- * keep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors
51
- * thrown in such cases in this method.
48
+ * change the default-scope for new components.
49
+ * for tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.
50
+ * optionally (if refactor is true), change the source code to match the new scope-name.
52
51
  */
53
52
  renameScope(oldScope: string, newScope: string, options?: {
54
53
  refactor?: boolean;
55
54
  deprecate?: boolean;
55
+ preserve?: boolean;
56
56
  }): Promise<RenameResult>;
57
57
  /**
58
58
  * change the default-scope for new components. optionally (if refactor is true), change the source code to match the
@@ -325,11 +325,12 @@ make sure this argument is the name only, without the scope-name. to change the
325
325
  }
326
326
  if (!targetComp) throw new Error(`renameMultiple, targetComp is missing`);
327
327
  await this.refactoring.refactorVariableAndClasses(targetComp, sourceId, targetId, options);
328
+ const compPath = this.newComponentHelper.getNewComponentPath(targetId);
328
329
  this.refactoring.refactorFilenames(targetComp, sourceId, targetId);
329
330
  await this.componentWriter.writeMany({
330
331
  components: [targetComp.state._consumer],
331
332
  skipDependencyInstallation: true,
332
- writeToPath: this.newComponentHelper.getNewComponentPath(targetId),
333
+ writeToPath: _path().default.join(this.workspace.path, compPath),
333
334
  reasonForBitmapChange: 'rename'
334
335
  });
335
336
  });
@@ -360,10 +361,9 @@ make sure this argument is the name only, without the scope-name. to change the
360
361
  }
361
362
 
362
363
  /**
363
- * change the default-scope for new components. optionally (if refactor is true), change the source code to match the
364
- * new scope-name.
365
- * keep in mind that this is working for new components only, for tagged/exported it's impossible. See the errors
366
- * thrown in such cases in this method.
364
+ * change the default-scope for new components.
365
+ * for tagged/exported components, delete (or deprecate - depends on the flag) the original ones and create new ones.
366
+ * optionally (if refactor is true), change the source code to match the new scope-name.
367
367
  */
368
368
  async renameScope(oldScope, newScope, options = {}) {
369
369
  const allComponentsIds = this.workspace.listIds();
@@ -383,9 +383,7 @@ make sure this argument is the name only, without the scope-name. to change the
383
383
  targetId
384
384
  };
385
385
  });
386
- return this.renameMultiple(multipleIds, _objectSpread(_objectSpread({}, options), {}, {
387
- preserve: true
388
- }));
386
+ return this.renameMultiple(multipleIds, options);
389
387
  }
390
388
 
391
389
  /**
@@ -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","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","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","bitMap","renameNewComponent","deleteLinkFromNodeModules","write","renameAspectIdsInWorkspaceConfig","_reloadConsumer","changeEnvsAccordingToNewIds","itemData","targetComp","targetPkg","refactoredIds","refactor","allComponents","list","packagesToReplace","oldStr","newStr","changedComponents","replaceMultipleStrings","Promise","all","comp","writeMany","components","state","_consumer","skipDependencyInstallation","writeToPath","getNewComponentPath","reasonForBitmapChange","renameAspectInConfig","targetComps","compact","linkToNodeModulesByComponents","compileGracefully","getRenamingInfo","component","renameConfig","aspects","RenamingAspect","renamedFrom","ComponentID","fromObject","renameScope","oldScope","newScope","allComponentsIds","listIds","componentsUsingOldScope","compId","defaultScope","OldScopeNotFound","setDefaultScope","name","fullName","renameOwner","oldOwner","newOwner","isScopeUsesOldOwner","startsWith","oldWorkspaceDefaultScope","newWorkspaceDefaultScope","renameOwnerInScopeName","hasScope","changeScope","changeDefaultScope","ids","workspaceConfig","hasChanged","some","renameId","renameExtensionInRaw","toStringWithoutVersion","reasonForChange","renameItem","componentIds","newEnvId","newComponentIds","found","find","isEqualWithoutVersion","setEnvToComponents","packageName","fs","path","join","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 { ConfigAspect, ConfigMain } from '@teambit/config';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\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 { compact } from 'lodash';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { RefactoringAspect, MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { isValidIdChunk, InvalidName } from '@teambit/legacy-bit-id';\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';\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());\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 this.refactoring.refactorFilenames(targetComp, sourceId, targetId);\n await this.componentWriter.writeMany({\n components: [targetComp.state._consumer],\n skipDependencyInstallation: true,\n writeToPath: this.newComponentHelper.getNewComponentPath(targetId),\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. 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(\n oldScope: string,\n newScope: string,\n options: { refactor?: boolean; deprecate?: boolean } = {}\n ): Promise<RenameResult> {\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, preserve: true });\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 const isScopeUsesOldOwner = (scope: string) => scope.startsWith(`${oldOwner}.`);\n\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 hasChanged = ids.some((renameId) =>\n config.renameExtensionInRaw(\n renameId.sourceId.toStringWithoutVersion(),\n renameId.targetId.toStringWithoutVersion()\n )\n );\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;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;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AAe,EACfC,wBAAa,EACbC,gCAAiB,EACjBC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,0BAAc,EACdC,sBAAY,EACZC,kBAAU,EACVC,sBAAY,CACb;AAAAvM,eAAA,CA9QUiB,YAAY,aA+QNuL,kBAAW;AA0D9BxF,0BAAc,CAACyF,UAAU,CAACxL,YAAY,CAAC;AAAC,IAAAyL,QAAA,GAAAjB,OAAA,CAAA3M,OAAA,GAQzBmC,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","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","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","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","allComponentsIds","listIds","componentsUsingOldScope","compId","defaultScope","OldScopeNotFound","setDefaultScope","name","fullName","renameOwner","oldOwner","newOwner","isScopeUsesOldOwner","startsWith","oldWorkspaceDefaultScope","newWorkspaceDefaultScope","renameOwnerInScopeName","hasScope","changeScope","changeDefaultScope","ids","workspaceConfig","hasChanged","some","renameId","renameExtensionInRaw","toStringWithoutVersion","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 { ConfigAspect, ConfigMain } from '@teambit/config';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\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 { compact } from 'lodash';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { RefactoringAspect, MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { isValidIdChunk, InvalidName } from '@teambit/legacy-bit-id';\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';\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());\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 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 const isScopeUsesOldOwner = (scope: string) => scope.startsWith(`${oldOwner}.`);\n\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 hasChanged = ids.some((renameId) =>\n config.renameExtensionInRaw(\n renameId.sourceId.toStringWithoutVersion(),\n renameId.targetId.toStringWithoutVersion()\n )\n );\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,M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AS,EAACF,QAAQ,CAAC,CAAC;IAErC,MAAMG,YAAY,GAAGR,GAAG,CAACS,UAAU,CAAC,OAAO,CAAC;IAC5CD,YAAY,EAAEE,QAAQ,EAAE1L,IAAI,CAAC,KAAI2L,6BAAc,EAACN,QAAQ,CAAC,CAAC;IAC1DG,YAAY,EAAEE,QAAQ,EAAE1L,IAAI,CAAC,KAAI4L,uCAAmB,EAACP,QAAQ,CAAC,CAAC;IAE/DH,OAAO,CAACI,QAAQ,CAAC,IAAAO,2BAAc,EAACR,QAAQ,CAAC,CAAC;IAC1CJ,aAAa,CAACa,qBAAqB,CAAC,CAAC,KAAIC,6BAAgB,EAACV,QAAQ,CAAC,CAAC,CAAC;IACrE,OAAOA,QAAQ;EACjB;AACF;AAACW,OAAA,CAAAzK,YAAA,GAAAA,YAAA;AAAAjB,eAAA,CAvUYiB,YAAY,WA8PR,EAAE;AAAAjB,eAAA,CA9PNiB,YAAY,kBA+PD,CACpB0K,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;AAAAxM,eAAA,CA9QUiB,YAAY,aA+QNwL,kBAAW;AA0D9BtF,0BAAc,CAACuF,UAAU,CAACzL,YAAY,CAAC;AAAC,IAAA0L,QAAA,GAAAjB,OAAA,CAAA5M,OAAA,GAQzBmC,YAAY","ignoreList":[]}
@@ -12,9 +12,10 @@ export declare class ScopeRenameCmd implements Command {
12
12
  options: CommandOptions;
13
13
  group: string;
14
14
  constructor(renaming: RenamingMain);
15
- report([oldName, newName]: [string, string], { refactor, deprecate }: {
15
+ report([oldName, newName]: [string, string], { refactor, deprecate, preserve }: {
16
16
  refactor?: boolean;
17
17
  deprecate?: boolean;
18
+ preserve?: boolean;
18
19
  }): Promise<string>;
19
20
  }
20
21
  export declare function renameScopeOutput(renameResult: RenameResult): string;
@@ -20,7 +20,7 @@ class ScopeRenameCmd {
20
20
  constructor(renaming) {
21
21
  this.renaming = renaming;
22
22
  _defineProperty(this, "name", 'rename <current-scope-name> <new-scope-name>');
23
- _defineProperty(this, "description", "rename the scope name for all components with the specified 'current scope name', if exported, create new components and deprecate the original ones");
23
+ _defineProperty(this, "description", "rename the scope name for all components with the specified 'current scope name'. if exported, create new components and delete the original ones");
24
24
  _defineProperty(this, "extendedDescription", `Note: if \`<current-scope-name>\` is also the defaultScope for the workspace, this command will set \`<new-scope-name>\`
25
25
  as the defaultScope instead, and that will then be set for all components by default. You may see updates in your .bitmap file
26
26
  as a result of this change`);
@@ -31,16 +31,18 @@ as a result of this change`);
31
31
  name: 'new-scope-name',
32
32
  description: 'a new scope name to replace the current scope name'
33
33
  }]);
34
- _defineProperty(this, "options", [['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']]);
34
+ _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']]);
35
35
  _defineProperty(this, "group", 'development');
36
36
  }
37
37
  async report([oldName, newName], {
38
38
  refactor,
39
- deprecate
39
+ deprecate,
40
+ preserve
40
41
  }) {
41
42
  const result = await this.renaming.renameScope(oldName, newName, {
42
43
  refactor,
43
- deprecate
44
+ deprecate,
45
+ preserve
44
46
  });
45
47
  const title = _chalk().default.green(`successfully replaced "${oldName}" scope with "${newName}"`);
46
48
  const renameOutput = renameScopeOutput(result);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ScopeRenameCmd","constructor","renaming","name","description","report","oldName","newName","refactor","deprecate","result","renameScope","title","chalk","green","renameOutput","renameScopeOutput","exports","renameResult","renameData","refactoredIds","renamedIdsStr","length","bold","map","item","sourceId","toStringWithoutVersion","isTagged","targetId","toString","join","refactoredStr"],"sources":["scope-rename.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { 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 deprecate 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 [\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 = 'development';\n\n constructor(private renaming: RenamingMain) {}\n\n async report(\n [oldName, newName]: [string, string],\n { refactor, deprecate }: { refactor?: boolean; deprecate?: boolean }\n ) {\n const result = await this.renaming.renameScope(oldName, newName, { refactor, deprecate });\n const title = chalk.green(`successfully replaced \"${oldName}\" scope with \"${newName}\"`);\n const renameOutput = renameScopeOutput(result);\n return `${title}\\n${renameOutput}`;\n }\n}\n\nexport function renameScopeOutput(renameResult: RenameResult): string {\n const { renameData, refactoredIds } = renameResult;\n const renamedIdsStr = renameData.length\n ? `\\n${chalk.bold('the following components were affected by this scope-name change:')}\\n${renameData\n .map(\n (item) =>\n `${item.sourceId.toStringWithoutVersion()} ${\n item.isTagged ? '(deprecated) ' : ''\n }-> ${item.targetId.toString()}`\n )\n .join('\\n')}`\n : '';\n const refactoredStr = refactoredIds.length\n ? `\\n\\n${chalk.bold('the following components have been refactored:')}\\n${refactoredIds.join('\\n')}`\n : '';\n return renamedIdsStr + refactoredStr;\n}\n"],"mappings":";;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA;AAGnB,MAAMW,cAAc,CAAoB;EAqB7CC,WAAWA,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAAtB,eAA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nC,MAAKH,IAAI,CAACI,QAAQ,CAACC,QAAQ,CAAC,CAAE,EACnC,CAAC,CACAC,IAAI,CAAC,IAAI,CAAE,EAAC,GACf,EAAE;EACN,MAAMC,aAAa,GAAGZ,aAAa,CAACE,MAAM,GACrC,OAAMT,gBAAK,CAACU,IAAI,CAAC,gDAAgD,CAAE,KAAIH,aAAa,CAACW,IAAI,CAAC,IAAI,CAAE,EAAC,GAClG,EAAE;EACN,OAAOV,aAAa,GAAGW,aAAa;AACtC","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ScopeRenameCmd","constructor","renaming","name","description","report","oldName","newName","refactor","deprecate","preserve","result","renameScope","title","chalk","green","renameOutput","renameScopeOutput","exports","renameResult","renameData","refactoredIds","renamedIdsStr","length","bold","map","item","sourceId","toStringWithoutVersion","isTagged","targetId","toString","join","refactoredStr"],"sources":["scope-rename.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { 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 = 'development';\n\n constructor(private renaming: RenamingMain) {}\n\n async report(\n [oldName, newName]: [string, string],\n { refactor, deprecate, preserve }: { refactor?: boolean; deprecate?: boolean; preserve?: boolean }\n ) {\n const result = await this.renaming.renameScope(oldName, newName, { refactor, deprecate, preserve });\n const title = chalk.green(`successfully replaced \"${oldName}\" scope with \"${newName}\"`);\n const renameOutput = renameScopeOutput(result);\n return `${title}\\n${renameOutput}`;\n }\n}\n\nexport function renameScopeOutput(renameResult: RenameResult): string {\n const { renameData, refactoredIds } = renameResult;\n const renamedIdsStr = renameData.length\n ? `\\n${chalk.bold('the following components were affected by this scope-name change:')}\\n${renameData\n .map(\n (item) =>\n `${item.sourceId.toStringWithoutVersion()} ${\n item.isTagged ? '(deprecated) ' : ''\n }-> ${item.targetId.toString()}`\n )\n .join('\\n')}`\n : '';\n const refactoredStr = refactoredIds.length\n ? `\\n\\n${chalk.bold('the following components have been refactored:')}\\n${refactoredIds.join('\\n')}`\n : '';\n return renamedIdsStr + refactoredStr;\n}\n"],"mappings":";;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;A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C,SAAS;MAAEC;IAAS,CAAC,CAAC;IACnG,MAAMG,KAAK,GAAGC,gBAAK,CAACC,KAAK,CAAE,0BAAyBT,OAAQ,iBAAgBC,OAAQ,GAAE,CAAC;IACvF,MAAMS,YAAY,GAAGC,iBAAiB,CAACN,MAAM,CAAC;IAC9C,OAAQ,GAAEE,KAAM,KAAIG,YAAa,EAAC;EACpC;AACF;AAACE,OAAA,CAAAlB,cAAA,GAAAA,cAAA;AAEM,SAASiB,iBAAiBA,CAACE,YAA0B,EAAU;EACpE,MAAM;IAAEC,UAAU;IAAEC;EAAc,CAAC,GAAGF,YAAY;EAClD,MAAMG,aAAa,GAAGF,UAAU,CAACG,MAAM,GAClC,KAAIT,gBAAK,CAACU,IAAI,CAAC,mEAAmE,CAAE,KAAIJ,UAAU,CAChGK,GAAG,CACDC,IAAI,IACF,GAAEA,IAAI,CAACC,QAAQ,CAACC,sBAAsB,CAAC,CAAE,IACxCF,IAAI,CAACG,QAAQ,GAAG,eAAe,GAAG,EACnC,MAAKH,IAAI,CAACI,QAAQ,CAACC,QAAQ,CAAC,CAAE,EACnC,CAAC,CACAC,IAAI,CAAC,IAAI,CAAE,EAAC,GACf,EAAE;EACN,MAAMC,aAAa,GAAGZ,aAAa,CAACE,MAAM,GACrC,OAAMT,gBAAK,CAACU,IAAI,CAAC,gDAAgD,CAAE,KAAIH,aAAa,CAACW,IAAI,CAAC,IAAI,CAAE,EAAC,GAClG,EAAE;EACN,OAAOV,aAAa,GAAGW,aAAa;AACtC","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/renaming",
3
- "version": "1.0.204",
3
+ "version": "1.0.206",
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.204"
9
+ "version": "1.0.206"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -18,20 +18,20 @@
18
18
  "@teambit/legacy-bit-id": "1.1.1",
19
19
  "@teambit/bit-error": "0.0.404",
20
20
  "@teambit/cli": "0.0.858",
21
- "@teambit/component": "1.0.204",
22
- "@teambit/graphql": "1.0.204",
23
- "@teambit/compiler": "1.0.204",
24
- "@teambit/component-writer": "1.0.204",
25
- "@teambit/config": "0.0.955",
26
- "@teambit/deprecation": "1.0.204",
27
- "@teambit/envs": "1.0.204",
28
- "@teambit/install": "1.0.204",
21
+ "@teambit/component": "1.0.206",
22
+ "@teambit/graphql": "1.0.206",
23
+ "@teambit/compiler": "1.0.206",
24
+ "@teambit/component-writer": "1.0.206",
25
+ "@teambit/config": "0.0.957",
26
+ "@teambit/deprecation": "1.0.206",
27
+ "@teambit/envs": "1.0.206",
28
+ "@teambit/install": "1.0.206",
29
29
  "@teambit/logger": "0.0.951",
30
- "@teambit/new-component-helper": "1.0.204",
31
- "@teambit/refactoring": "1.0.204",
32
- "@teambit/remove": "1.0.204",
30
+ "@teambit/new-component-helper": "1.0.206",
31
+ "@teambit/refactoring": "1.0.206",
32
+ "@teambit/remove": "1.0.206",
33
33
  "@teambit/workspace.modules.node-modules-linker": "0.0.165",
34
- "@teambit/workspace": "1.0.204"
34
+ "@teambit/workspace": "1.0.206"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/fs-extra": "9.0.7",