@teambit/forking 1.0.282 → 1.0.283

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/forking@1.0.282" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.component/forking@1.0.283" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </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/forking-preview"]=t():e["teambit.component/forking-preview"]=t()}(self,(()=>(()=>{"use strict";var e={21687:(e,t,o)=>{var n={id:"teambit.component/forking@1.0.282",homepage:"https://bit.cloud/teambit/component/forking",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/forking.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:()=>d,compositions_metadata:()=>l,overview:()=>u});var e={};o.r(e),o.d(e,{default:()=>f});var t=o(21687);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function c(){return c=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},c.apply(this,arguments)}var a={},s="wrapper";function f(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={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;o[n]=e[n]}return o}(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,c({},a,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}f.isMDXComponent=!0;const d=[t],u=[e],l={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/forking-preview"]=t():e["teambit.component/forking-preview"]=t()}(self,(()=>(()=>{"use strict";var e={72682:(e,t,o)=>{var n={id:"teambit.component/forking@1.0.283",homepage:"https://bit.cloud/teambit/component/forking",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 a=()=>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/forking.svg"}));a.__bit_component=n,t.Logo=a},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:()=>l,overview:()=>d});var e={};o.r(e),o.d(e,{default:()=>f});var t=o(72682);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var a=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c.apply(null,arguments)}var p={},s="wrapper";function f(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;o[n]=e[n]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||{}.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,a);return(0,r.mdx)(s,c({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}f.isMDXComponent=!0;const u=[t],d=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
@@ -2166,7 +2166,7 @@
2166
2166
  "componentId": {
2167
2167
  "scope": "teambit.component",
2168
2168
  "name": "forking",
2169
- "version": "1.0.282"
2169
+ "version": "1.0.283"
2170
2170
  },
2171
2171
  "taggedModuleExports": []
2172
2172
  }
package/dist/fork.cmd.js CHANGED
@@ -11,8 +11,8 @@ function _chalk() {
11
11
  };
12
12
  return data;
13
13
  }
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
17
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
18
  class ForkCmd {
@@ -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","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ForkCmd","constructor","forking","name","description","report","sourceId","targetId","options","results","fork","targetIdStr","toString","chalk","green","bold","exports"],"sources":["fork.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentConfig } from '@teambit/generator';\nimport chalk from 'chalk';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport type ForkOptions = {\n scope?: string;\n path?: string;\n refactor?: boolean;\n skipDependencyInstallation?: boolean;\n skipConfig?: boolean;\n preserve?: boolean;\n noLink?: boolean;\n env?: string;\n config?: ComponentConfig;\n ast?: boolean;\n};\n\nexport class ForkCmd implements Command {\n name = 'fork <source-component-id> [target-component-name]';\n description = 'create a new component forked from an existing one (copies source files and configs)';\n helpUrl = 'docs/getting-started/collaborate/importing-components#fork-a-component';\n arguments = [\n { name: 'source-component-id', description: 'the component id of the source component' },\n {\n name: 'target-component-name',\n description:\n \"the name for the new component (component name without scope, e.g. name/spaces/my-button). to set a different scope, use the '--scope' flag\",\n },\n ];\n group = 'collaborate';\n skipWorkspace = true;\n alias = '';\n\n options = [\n ['s', 'scope <string>', 'default scope for the new component'],\n [\n 'p',\n 'path <string>',\n 'relative path in the workspace for the new component. by default the path is `<scope>/<namespace>/<name>`',\n ],\n ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['e', 'env <string>', 'set the environment for the new component'],\n [\n '',\n 'skip-config',\n 'do not copy the config (aspects-config, env, etc) to the new component. helpful when it fails during aspect loading',\n ],\n ['', 'preserve', 'avoid refactoring file and variable/class names according to the new component name'],\n ['', 'no-link', 'avoid saving a reference to the original component'],\n ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'],\n ] as CommandOptions;\n\n example: [\n {\n cmd: 'fork teambit.base-ui/input/button ui/button';\n description: \"create a component named 'ui/button', forked from the remote 'input/button' component\";\n }\n ];\n loader = true;\n remoteOp = true;\n\n constructor(private forking: ForkingMain) {}\n\n async report([sourceId, targetId]: [string, string], options: ForkOptions): Promise<string> {\n const results = await this.forking.fork(sourceId, targetId, options);\n const targetIdStr = results.toString();\n return chalk.green(`successfully forked ${chalk.bold(targetIdStr)} from ${chalk.bold(sourceId)}`);\n }\n}\n"],"mappings":";;;;;;AAEA,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,GA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AAoD,CAAC,EAC3F,CAAC,GAAG,EAAE,cAAc,EAAE,2CAA2C,CAAC,EAClE,CACE,EAAE,EACF,aAAa,EACb,qHAAqH,CACtH,EACD,CAAC,EAAE,EAAE,UAAU,EAAE,qFAAqF,CAAC,EACvG,CAAC,EAAE,EAAE,SAAS,EAAE,oDAAoD,CAAC,EACrE,CAAC,EAAE,EAAE,KAAK,EAAE,2DAA2D,CAAC,CACzE;IAAAA,eAAA;IAAAA,eAAA,iBAQQ,IAAI;IAAAA,eAAA,mBACF,IAAI;EAE4B;EAE3C,MAAMyB,MAAMA,CAAC,CAACC,QAAQ,EAAEC,QAAQ,CAAmB,EAAEC,OAAoB,EAAmB;IAC1F,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACP,OAAO,CAACQ,IAAI,CAACJ,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,CAAC;IACpE,MAAMG,WAAW,GAAGF,OAAO,CAACG,QAAQ,CAAC,CAAC;IACtC,OAAOC,gBAAK,CAACC,KAAK,CAAE,uBAAsBD,gBAAK,CAACE,IAAI,CAACJ,WAAW,CAAE,SAAQE,gBAAK,CAACE,IAAI,CAACT,QAAQ,CAAE,EAAC,CAAC;EACnG;AACF;AAACU,OAAA,CAAAhB,OAAA,GAAAA,OAAA","ignoreList":[]}
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","ForkCmd","constructor","forking","name","description","report","sourceId","targetId","options","results","fork","targetIdStr","toString","chalk","green","bold","exports"],"sources":["fork.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentConfig } from '@teambit/generator';\nimport chalk from 'chalk';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport type ForkOptions = {\n scope?: string;\n path?: string;\n refactor?: boolean;\n skipDependencyInstallation?: boolean;\n skipConfig?: boolean;\n preserve?: boolean;\n noLink?: boolean;\n env?: string;\n config?: ComponentConfig;\n ast?: boolean;\n};\n\nexport class ForkCmd implements Command {\n name = 'fork <source-component-id> [target-component-name]';\n description = 'create a new component forked from an existing one (copies source files and configs)';\n helpUrl = 'docs/getting-started/collaborate/importing-components#fork-a-component';\n arguments = [\n { name: 'source-component-id', description: 'the component id of the source component' },\n {\n name: 'target-component-name',\n description:\n \"the name for the new component (component name without scope, e.g. name/spaces/my-button). to set a different scope, use the '--scope' flag\",\n },\n ];\n group = 'collaborate';\n skipWorkspace = true;\n alias = '';\n\n options = [\n ['s', 'scope <string>', 'default scope for the new component'],\n [\n 'p',\n 'path <string>',\n 'relative path in the workspace for the new component. by default the path is `<scope>/<namespace>/<name>`',\n ],\n ['r', 'refactor', 'update the import/require statements in all dependent components (in the same workspace)'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['e', 'env <string>', 'set the environment for the new component'],\n [\n '',\n 'skip-config',\n 'do not copy the config (aspects-config, env, etc) to the new component. helpful when it fails during aspect loading',\n ],\n ['', 'preserve', 'avoid refactoring file and variable/class names according to the new component name'],\n ['', 'no-link', 'avoid saving a reference to the original component'],\n ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'],\n ] as CommandOptions;\n\n example: [\n {\n cmd: 'fork teambit.base-ui/input/button ui/button';\n description: \"create a component named 'ui/button', forked from the remote 'input/button' component\";\n }\n ];\n loader = true;\n remoteOp = true;\n\n constructor(private forking: ForkingMain) {}\n\n async report([sourceId, targetId]: [string, string], options: ForkOptions): Promise<string> {\n const results = await this.forking.fork(sourceId, targetId, options);\n const targetIdStr = results.toString();\n return chalk.green(`successfully forked ${chalk.bold(targetIdStr)} from ${chalk.bold(sourceId)}`);\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAA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A,eAAA,gBACZ,EAAE;IAAAA,eAAA,kBAEA,CACR,CAAC,GAAG,EAAE,gBAAgB,EAAE,qCAAqC,CAAC,EAC9D,CACE,GAAG,EACH,eAAe,EACf,2GAA2G,CAC5G,EACD,CAAC,GAAG,EAAE,UAAU,EAAE,0FAA0F,CAAC,EAC7G,CAAC,GAAG,EAAE,8BAA8B,EAAE,oDAAoD,CAAC,EAC3F,CAAC,GAAG,EAAE,cAAc,EAAE,2CAA2C,CAAC,EAClE,CACE,EAAE,EACF,aAAa,EACb,qHAAqH,CACtH,EACD,CAAC,EAAE,EAAE,UAAU,EAAE,qFAAqF,CAAC,EACvG,CAAC,EAAE,EAAE,SAAS,EAAE,oDAAoD,CAAC,EACrE,CAAC,EAAE,EAAE,KAAK,EAAE,2DAA2D,CAAC,CACzE;IAAAA,eAAA;IAAAA,eAAA,iBAQQ,IAAI;IAAAA,eAAA,mBACF,IAAI;EAE4B;EAE3C,MAAMuB,MAAMA,CAAC,CAACC,QAAQ,EAAEC,QAAQ,CAAmB,EAAEC,OAAoB,EAAmB;IAC1F,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACP,OAAO,CAACQ,IAAI,CAACJ,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,CAAC;IACpE,MAAMG,WAAW,GAAGF,OAAO,CAACG,QAAQ,CAAC,CAAC;IACtC,OAAOC,gBAAK,CAACC,KAAK,CAAC,uBAAuBD,gBAAK,CAACE,IAAI,CAACJ,WAAW,CAAC,SAASE,gBAAK,CAACE,IAAI,CAACT,QAAQ,CAAC,EAAE,CAAC;EACnG;AACF;AAACU,OAAA,CAAAhB,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -11,7 +11,7 @@ function _react() {
11
11
  };
12
12
  return data;
13
13
  }
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
16
16
  style: {
17
17
  height: '100%',
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["forking.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/forking.svg\" />\n </div>\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;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAqD,CAAE,CACnF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["forking.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/forking.svg\" />\n </div>\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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAqD,CAAE,CACnF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ForkingFragment = void 0;
7
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  class ForkingFragment {
@@ -1 +1 @@
1
- {"version":3,"names":["ForkingFragment","constructor","forking","_defineProperty","renderRow","component","forkingInfo","getForkInfo","content","forkedFrom","toString","title","json","exports"],"sources":["forking.fragment.ts"],"sourcesContent":["import { Component, ShowFragment } from '@teambit/component';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport class ForkingFragment implements ShowFragment {\n constructor(private forking: ForkingMain) {}\n\n title = 'forking';\n\n async renderRow(component: Component) {\n const forkingInfo = this.forking.getForkInfo(component);\n const content = forkingInfo ? `origin: ${forkingInfo.forkedFrom.toString()}` : '';\n return {\n title: this.title,\n content,\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: this.forking.getForkInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,eAAe,CAAyB;EACnDC,WAAWA,CAASC,OAAoB,EAAE;IAAA,KAAtBA,OAAoB,GAApBA,OAAoB;IAAAC,eAAA,gBAEhC,SAAS;IAAAA,eAAA,iBAkBR,CAAC;EApBiC;EAI3C,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,WAAW,CAACF,SAAS,CAAC;IACvD,MAAMG,OAAO,GAAGF,WAAW,GAAI,WAAUA,WAAW,CAACG,UAAU,CAACC,QAAQ,CAAC,CAAE,EAAC,GAAG,EAAE;IACjF,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBH;IACF,CAAC;EACH;EAEA,MAAMI,IAAIA,CAACP,SAAoB,EAAE;IAC/B,OAAO;MACLM,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,IAAI,EAAE,IAAI,CAACV,OAAO,CAACK,WAAW,CAACF,SAAS;IAC1C,CAAC;EACH;AAGF;AAACQ,OAAA,CAAAb,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["ForkingFragment","constructor","forking","_defineProperty","renderRow","component","forkingInfo","getForkInfo","content","forkedFrom","toString","title","json","exports"],"sources":["forking.fragment.ts"],"sourcesContent":["import { Component, ShowFragment } from '@teambit/component';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport class ForkingFragment implements ShowFragment {\n constructor(private forking: ForkingMain) {}\n\n title = 'forking';\n\n async renderRow(component: Component) {\n const forkingInfo = this.forking.getForkInfo(component);\n const content = forkingInfo ? `origin: ${forkingInfo.forkedFrom.toString()}` : '';\n return {\n title: this.title,\n content,\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: this.forking.getForkInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,eAAe,CAAyB;EACnDC,WAAWA,CAASC,OAAoB,EAAE;IAAA,KAAtBA,OAAoB,GAApBA,OAAoB;IAAAC,eAAA,gBAEhC,SAAS;IAAAA,eAAA,iBAkBR,CAAC;EApBiC;EAI3C,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,WAAW,CAACF,SAAS,CAAC;IACvD,MAAMG,OAAO,GAAGF,WAAW,GAAG,WAAWA,WAAW,CAACG,UAAU,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE;IACjF,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBH;IACF,CAAC;EACH;EAEA,MAAMI,IAAIA,CAACP,SAAoB,EAAE;IAC/B,OAAO;MACLM,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,IAAI,EAAE,IAAI,CAACV,OAAO,CAACK,WAAW,CAACF,SAAS;IAC1C,CAAC;EACH;AAGF;AAACQ,OAAA,CAAAb,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_graphqlTag","data","require","forkingSchema","forking","typeDefs","gql","resolvers","Component","component","forkInfo","getForkInfo","forkedFrom","toString"],"sources":["forking.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport function forkingSchema(forking: ForkingMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n forking: ForkingInfo\n }\n\n type ForkingInfo {\n forkedFrom: String\n }\n `,\n resolvers: {\n Component: {\n forking: (component: Component) => {\n const forkInfo = forking.getForkInfo(component);\n return {\n forkedFrom: forkInfo?.forkedFrom.toString(),\n };\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,SAASE,aAAaA,CAACC,OAAoB,EAAU;EAC1D,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTJ,OAAO,EAAGK,SAAoB,IAAK;UACjC,MAAMC,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACF,SAAS,CAAC;UAC/C,OAAO;YACLG,UAAU,EAAEF,QAAQ,EAAEE,UAAU,CAACC,QAAQ,CAAC;UAC5C,CAAC;QACH;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_graphqlTag","data","require","forkingSchema","forking","typeDefs","gql","resolvers","Component","component","forkInfo","getForkInfo","forkedFrom","toString"],"sources":["forking.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport function forkingSchema(forking: ForkingMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n forking: ForkingInfo\n }\n\n type ForkingInfo {\n forkedFrom: String\n }\n `,\n resolvers: {\n Component: {\n forking: (component: Component) => {\n const forkInfo = forking.getForkInfo(component);\n return {\n forkedFrom: forkInfo?.forkedFrom.toString(),\n };\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,SAASE,aAAaA,CAACC,OAAoB,EAAU;EAC1D,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTJ,OAAO,EAAGK,SAAoB,IAAK;UACjC,MAAMC,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACF,SAAS,CAAC;UAC/C,OAAO;YACLG,UAAU,EAAEF,QAAQ,EAAEE,UAAU,CAACC,QAAQ,CAAC;UAC5C,CAAC;QACH;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -158,10 +158,10 @@ function _scopeFork() {
158
158
  };
159
159
  return data;
160
160
  }
161
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
161
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
162
162
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
163
163
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
164
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
164
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
165
165
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
166
166
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
167
167
  class ForkingMain {
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_cli","_typescript","_component","_dependencyResolver","_graphql","_componentVersion","_install","_componentId","_newComponentHelper","_pkg","_refactoring","_workspace","_componentPackageVersion","_lodash","_pMapSeries","_interopRequireDefault","_semver","_fork","_forking","_forking2","_forking3","_scopeFork","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","Symbol","toPrimitive","call","TypeError","String","Number","ForkingMain","constructor","workspace","install","dependencyResolver","newComponentHelper","refactoring","pkg","fork","sourceId","targetId","options","OutsideWorkspaceError","sourceCompId","resolveComponentId","exists","existingInWorkspace","get","forkExistingInWorkspace","sourceIdWithScope","_legacy","scope","ComponentID","fromString","targetCompId","component","forkRemoteComponent","saveDeps","skipDependencyInstallation","installDeps","getForkInfo","forkConfig","state","aspects","ForkingAspect","id","config","forkedFrom","fromObject","forkMultipleFromRemote","componentsToFork","componentsToForkSorted","sortComponentsToFork","results","pMapSeries","path","env","targetScope","refactorMultipleAndInstall","sort","a","b","oldPackages","stringsToReplace","map","oldPackageName","getPackageName","newName","fullName","replace","scopeToReplace","newPackageName","oldStr","newStr","toStringWithoutVersion","flat","stringsToReplaceForVariable","name","getStringReplacementsForVariablesAndClasses","allComponents","list","refactor","changedComponents","replaceMultipleStrings","ast","importTransformer","exportTransformer","undefined","Promise","all","comp","write","changedComponentsVariables","forkedComponents","result","policy","extractDeps","policyFlatAndUnique","uniqBy","policyWithoutWorkspaceComps","dep","includes","dependencyId","addToRootPolicy","updateExisting","persistConfig","forkScope","originalScope","newOptionalScope","pattern","newScope","defaultScope","allIdsFromOriginalScope","listRemoteScope","Error","getPatternWithScopeName","startsWith","patternWithScopeName","idsFromOriginalScope","filterIdsFromPoolIdsByPattern","workspaceIds","listIds","workspaceBitIds","ComponentIdList","fromArray","existInWorkspace","searchWithoutVersion","toString","multipleForkInfo","components","getManyRemoteComponents","getConfig","writeAndAddNewComp","incrementPathIfConflicted","info","existing","getNewComponentId","refactorDependencyName","shouldRefactorVariablesAndClasses","BitError","targetName","getRemoteComponent","preserve","refactorVariableAndClasses","refactorFilenames","workspacePolicyEntries","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","deps","getDependencies","excludePackages","excludeCompIds","getCompIdsThatShouldNotBeInPolicy","source","ComponentDependency","compIdStr","componentId","parsedVersion","parse","version","versionWithPrefix","getVersionWithSavePrefix","isHash","snapToSemver","lifecycleType","lifecycle","fromExisting","skipConfig","getConfigFromExistingToNewComponent","linkToOriginal","noLink","toObject","provider","cli","componentMain","graphql","forkingMain","register","ForkCmd","forkingSchema","registerShowFragments","ForkingFragment","scopeCommand","getCommand","commands","ScopeForkCmd","exports","CLIAspect","WorkspaceAspect","DependencyResolverAspect","ComponentAspect","NewComponentHelperAspect","GraphqlAspect","RefactoringAspect","PkgAspect","InstallAspect","MainRuntime","addRuntime"],"sources":["forking.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { importTransformer, exportTransformer } from '@teambit/typescript';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { ComponentDependency, DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ComponentConfig } from '@teambit/generator';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { isHash } from '@teambit/component-version';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { ComponentID, ComponentIdObj, ComponentIdList } from '@teambit/component-id';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { PkgAspect, PkgMain } from '@teambit/pkg';\nimport { RefactoringAspect, MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { uniqBy } from 'lodash';\nimport pMapSeries from 'p-map-series';\nimport { parse } from 'semver';\nimport { ForkCmd, ForkOptions } from './fork.cmd';\nimport { ForkingAspect } from './forking.aspect';\nimport { ForkingFragment } from './forking.fragment';\nimport { forkingSchema } from './forking.graphql';\nimport { ScopeForkCmd, ScopeForkOptions } from './scope-fork.cmd';\n\nexport type ForkInfo = {\n forkedFrom: ComponentID;\n};\n\ntype MultipleForkInfo = {\n targetCompId: ComponentID;\n sourceId: string;\n component: Component;\n};\n\ntype MultipleComponentsToFork = Array<{\n sourceId: string;\n targetId?: string; // if not specified, it'll be the same as the source\n targetScope?: string; // if not specified, it'll be taken from the options or from the default scope\n path?: string; // if not specified, use the default component path\n env?: string; // if not specified, use the default env\n config?: ComponentConfig; // if specified, adds to/overrides the existing config\n}>;\n\ntype MultipleForkOptions = {\n refactor?: boolean;\n scope?: string; // different scope-name than the original components\n install?: boolean; // whether to run \"bit install\" once done.\n ast?: boolean; // whether to use AST to transform files instead of regex\n};\n\nexport class ForkingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private dependencyResolver: DependencyResolverMain,\n private newComponentHelper: NewComponentHelperMain,\n private refactoring: RefactoringMain,\n private pkg: PkgMain\n ) {}\n\n /**\n * create a new copy of existing/remote component.\n * the new component holds a reference to the old one for future reference.\n * if refactor option is enable, change the source-code to update all dependencies with the new name.\n */\n async fork(sourceId: string, targetId?: string, options?: ForkOptions): Promise<ComponentID> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const exists = this.workspace.exists(sourceCompId);\n if (exists) {\n const existingInWorkspace = await this.workspace.get(sourceCompId);\n return this.forkExistingInWorkspace(existingInWorkspace, targetId, options);\n }\n const sourceIdWithScope = sourceCompId._legacy.scope ? sourceCompId : ComponentID.fromString(sourceId);\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, options);\n await this.saveDeps(component);\n if (!options?.skipDependencyInstallation) await this.installDeps();\n return targetCompId;\n }\n\n /**\n * get the forking data, such as the source where a component was forked from\n */\n getForkInfo(component: Component): ForkInfo | null {\n const forkConfig = component.state.aspects.get(ForkingAspect.id)?.config as ForkConfig | undefined;\n if (!forkConfig) return null;\n return {\n forkedFrom: ComponentID.fromObject(forkConfig.forkedFrom),\n };\n }\n\n async forkMultipleFromRemote(componentsToFork: MultipleComponentsToFork, options: MultipleForkOptions = {}) {\n const componentsToForkSorted = this.sortComponentsToFork(componentsToFork);\n const { scope } = options;\n const results = await pMapSeries(\n componentsToForkSorted,\n async ({ sourceId, targetId, path, env, config, targetScope }) => {\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const sourceIdWithScope = sourceCompId._legacy.scope ? sourceCompId : ComponentID.fromString(sourceId);\n const { targetCompId, component } = await this.forkRemoteComponent(\n sourceIdWithScope,\n targetId,\n {\n scope: targetScope || scope,\n path,\n env,\n config,\n },\n false\n );\n return { targetCompId, sourceId, component };\n }\n );\n await this.refactorMultipleAndInstall(results, options);\n }\n\n /**\n * sort the components to fork so that components without \"env\" prop will be forked first.\n * this way, if some components are envs, their \"env\" prop is empty and will be forked first, then components that\n * depends on them.\n * otherwise, forking the components first result in errors when loading them as their envs are missing at that point\n */\n private sortComponentsToFork(componentsToFork: MultipleComponentsToFork) {\n return componentsToFork.sort((a, b) => {\n if (a.env && b.env) return 0;\n if (a.env) return 1;\n return -1;\n });\n }\n\n private async refactorMultipleAndInstall(results: MultipleForkInfo[], options: MultipleForkOptions = {}) {\n const oldPackages: string[] = [];\n const stringsToReplace: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId, component }) => {\n const oldPackageName = this.pkg.getPackageName(component);\n oldPackages.push(oldPackageName);\n const newName = targetCompId.fullName.replace(/\\//g, '.');\n const scopeToReplace = targetCompId.scope.replace('.', '/');\n const newPackageName = `@${scopeToReplace}.${newName}`;\n return [\n { oldStr: oldPackageName, newStr: newPackageName },\n { oldStr: sourceId, newStr: targetCompId.toStringWithoutVersion() },\n ];\n })\n .flat();\n\n const stringsToReplaceForVariable: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId }) => {\n const sourceCompId = ComponentID.fromString(sourceId);\n if (sourceCompId.name === targetCompId.name) return [];\n return this.refactoring.getStringReplacementsForVariablesAndClasses(sourceCompId, targetCompId);\n })\n .flat();\n\n const allComponents = await this.workspace.list();\n if (options.refactor) {\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(\n allComponents,\n stringsToReplace,\n options.ast ? [importTransformer, exportTransformer] : undefined\n );\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n\n const { changedComponents: changedComponentsVariables } = await this.refactoring.replaceMultipleStrings(\n allComponents,\n stringsToReplaceForVariable,\n options.ast ? [importTransformer, exportTransformer] : undefined,\n true\n );\n\n await Promise.all(changedComponentsVariables.map((comp) => this.workspace.write(comp)));\n }\n const forkedComponents = results.map((result) => result.component);\n const policy = await Promise.all(forkedComponents.map((comp) => this.extractDeps(comp)));\n const policyFlatAndUnique = uniqBy(policy.flat(), 'dependencyId');\n const policyWithoutWorkspaceComps = policyFlatAndUnique.filter((dep) => !oldPackages.includes(dep.dependencyId));\n this.dependencyResolver.addToRootPolicy(policyWithoutWorkspaceComps, { updateExisting: true });\n await this.dependencyResolver.persistConfig('fork');\n if (options.install) {\n await this.installDeps();\n }\n }\n\n /**\n * fork all components of the given scope\n */\n async forkScope(\n originalScope: string,\n newOptionalScope?: string, // if not specified, it'll be the default scope\n pattern?: string,\n options?: ScopeForkOptions\n ): Promise<ComponentID[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const newScope = newOptionalScope || this.workspace.defaultScope;\n const allIdsFromOriginalScope = await this.workspace.scope.listRemoteScope(originalScope);\n if (!allIdsFromOriginalScope.length) {\n throw new Error(`unable to find components to fork from ${originalScope}`);\n }\n const getPatternWithScopeName = () => {\n if (!pattern) return undefined;\n if (pattern.startsWith(`${originalScope}/`)) return pattern;\n return `${originalScope}/${pattern}`;\n };\n const patternWithScopeName = getPatternWithScopeName();\n const idsFromOriginalScope = patternWithScopeName\n ? await this.workspace.scope.filterIdsFromPoolIdsByPattern(patternWithScopeName, allIdsFromOriginalScope)\n : allIdsFromOriginalScope;\n const workspaceIds = this.workspace.listIds();\n const workspaceBitIds = ComponentIdList.fromArray(workspaceIds.map((id) => id));\n idsFromOriginalScope.forEach((id) => {\n const existInWorkspace = workspaceBitIds.searchWithoutVersion(id);\n if (existInWorkspace) {\n throw new Error(\n `unable to fork \"${id.toString()}\". the workspace has a component \"${existInWorkspace.toString()}\" with the same name and same scope`\n );\n }\n });\n const multipleForkInfo: MultipleForkInfo[] = [];\n const components = await this.workspace.scope.getManyRemoteComponents(idsFromOriginalScope);\n await pMapSeries(components, async (component) => {\n const config = await this.getConfig(component);\n const targetCompId = ComponentID.fromObject({ name: component.id.fullName }, newScope);\n await this.newComponentHelper.writeAndAddNewComp(\n component,\n targetCompId,\n {\n scope: newScope,\n incrementPathIfConflicted: true,\n },\n config\n );\n multipleForkInfo.push({ targetCompId, sourceId: component.id.toStringWithoutVersion(), component });\n });\n await this.refactorMultipleAndInstall(multipleForkInfo, {\n refactor: true,\n install: !options?.skipDependencyInstallation,\n ast: options?.ast,\n });\n return multipleForkInfo.map((info) => info.targetCompId);\n }\n\n private async forkExistingInWorkspace(existing: Component, targetId?: string, options?: ForkOptions) {\n targetId = targetId || existing.id.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetId, undefined, options?.scope);\n\n const config = await this.getConfig(existing, options);\n await this.newComponentHelper.writeAndAddNewComp(existing, targetCompId, options, config);\n if (options?.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, existing.id, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n return targetCompId;\n }\n\n private async forkRemoteComponent(\n sourceId: ComponentID,\n targetId?: string,\n options?: ForkOptions,\n shouldRefactorVariablesAndClasses = true\n ): Promise<{\n targetCompId: ComponentID;\n component: Component;\n }> {\n if (options?.refactor) {\n throw new BitError(`the component ${sourceId.toStringWithoutVersion()} is not in the workspace, you can't use the --refactor flag.\nthe reason is that the refactor changes the components using ${sourceId.toStringWithoutVersion()}, since it's not in the workspace, no components were using it, so nothing to refactor`);\n }\n const targetName = targetId || sourceId.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope);\n const component = await this.workspace.scope.getRemoteComponent(sourceId);\n await this.refactoring.replaceMultipleStrings(\n [component],\n [\n {\n oldStr: sourceId.toStringWithoutVersion(),\n newStr: targetCompId.toStringWithoutVersion(),\n },\n ],\n options?.ast ? [importTransformer, exportTransformer] : undefined\n );\n if (!options?.preserve) {\n if (shouldRefactorVariablesAndClasses) {\n await this.refactoring.refactorVariableAndClasses(component, sourceId, targetCompId, options);\n }\n this.refactoring.refactorFilenames(component, sourceId, targetCompId);\n }\n const config = await this.getConfig(component, options);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, options, config);\n\n return { targetCompId, component };\n }\n\n private async saveDeps(component: Component) {\n const workspacePolicyEntries = this.extractDeps(component);\n this.dependencyResolver.addToRootPolicy(workspacePolicyEntries, { updateExisting: true });\n await this.dependencyResolver.persistConfig('fork (save deps)');\n }\n\n private async installDeps() {\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\n\n private extractDeps(component: Component) {\n const deps = this.dependencyResolver.getDependencies(component);\n const excludePackages = ['@teambit/legacy'];\n const excludeCompIds = this.dependencyResolver.getCompIdsThatShouldNotBeInPolicy();\n return deps\n .filter((dep) => dep.source === 'auto')\n .filter((dep) => {\n if (dep instanceof ComponentDependency) {\n const compIdStr = dep.componentId.toStringWithoutVersion();\n return !excludeCompIds.includes(compIdStr);\n }\n return !excludePackages.includes(dep.id);\n })\n .map((dep) => {\n const parsedVersion = parse(dep.version);\n const versionWithPrefix = parsedVersion\n ? this.dependencyResolver.getVersionWithSavePrefix({ version: dep.version })\n : dep.version;\n const version = isHash(versionWithPrefix) ? snapToSemver(versionWithPrefix) : versionWithPrefix;\n return {\n dependencyId: dep.getPackageName?.() || dep.id,\n lifecycleType: dep.lifecycle === 'dev' ? 'runtime' : dep.lifecycle,\n value: {\n version,\n },\n };\n });\n }\n\n private async getConfig(comp: Component, options?: ForkOptions) {\n const config = options?.config || {};\n const fromExisting = options?.skipConfig\n ? {}\n : await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n const linkToOriginal = options?.noLink ? {} : { [ForkingAspect.id]: { forkedFrom: comp.id.toObject() } };\n return {\n ...fromExisting,\n ...linkToOriginal,\n ...config,\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n ComponentAspect,\n NewComponentHelperAspect,\n GraphqlAspect,\n RefactoringAspect,\n PkgAspect,\n InstallAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n dependencyResolver,\n componentMain,\n newComponentHelper,\n graphql,\n refactoring,\n pkg,\n install,\n ]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n ComponentMain,\n NewComponentHelperMain,\n GraphqlMain,\n RefactoringMain,\n PkgMain,\n InstallMain\n ]) {\n const forkingMain = new ForkingMain(workspace, install, dependencyResolver, newComponentHelper, refactoring, pkg);\n cli.register(new ForkCmd(forkingMain));\n graphql.register(forkingSchema(forkingMain));\n componentMain.registerShowFragments([new ForkingFragment(forkingMain)]);\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeForkCmd(forkingMain));\n\n return forkingMain;\n }\n}\n\nForkingAspect.addRuntime(ForkingMain);\n\nexport type ForkConfig = {\n forkedFrom: ComponentIdObj;\n};\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,oBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,mBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,kBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,iBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,I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BmL,gBAAS,EACTC,4BAAe,EACfC,8CAAwB,EACxBC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,gCAAiB,EACjBC,gBAAS,EACTC,wBAAa,CACd;AAAA5M,eAAA,CAxTUiB,WAAW,aAyTL4L,kBAAW;AAkC9B1J,wBAAa,CAAC2J,UAAU,CAAC7L,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","_cli","_typescript","_component","_dependencyResolver","_graphql","_componentVersion","_install","_componentId","_newComponentHelper","_pkg","_refactoring","_workspace","_componentPackageVersion","_lodash","_pMapSeries","_interopRequireDefault","_semver","_fork","_forking","_forking2","_forking3","_scopeFork","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","ForkingMain","constructor","workspace","install","dependencyResolver","newComponentHelper","refactoring","pkg","fork","sourceId","targetId","options","OutsideWorkspaceError","sourceCompId","resolveComponentId","exists","existingInWorkspace","get","forkExistingInWorkspace","sourceIdWithScope","_legacy","scope","ComponentID","fromString","targetCompId","component","forkRemoteComponent","saveDeps","skipDependencyInstallation","installDeps","getForkInfo","forkConfig","state","aspects","ForkingAspect","id","config","forkedFrom","fromObject","forkMultipleFromRemote","componentsToFork","componentsToForkSorted","sortComponentsToFork","results","pMapSeries","path","env","targetScope","refactorMultipleAndInstall","sort","a","b","oldPackages","stringsToReplace","map","oldPackageName","getPackageName","newName","fullName","replace","scopeToReplace","newPackageName","oldStr","newStr","toStringWithoutVersion","flat","stringsToReplaceForVariable","name","getStringReplacementsForVariablesAndClasses","allComponents","list","refactor","changedComponents","replaceMultipleStrings","ast","importTransformer","exportTransformer","undefined","Promise","all","comp","write","changedComponentsVariables","forkedComponents","result","policy","extractDeps","policyFlatAndUnique","uniqBy","policyWithoutWorkspaceComps","dep","includes","dependencyId","addToRootPolicy","updateExisting","persistConfig","forkScope","originalScope","newOptionalScope","pattern","newScope","defaultScope","allIdsFromOriginalScope","listRemoteScope","Error","getPatternWithScopeName","startsWith","patternWithScopeName","idsFromOriginalScope","filterIdsFromPoolIdsByPattern","workspaceIds","listIds","workspaceBitIds","ComponentIdList","fromArray","existInWorkspace","searchWithoutVersion","toString","multipleForkInfo","components","getManyRemoteComponents","getConfig","writeAndAddNewComp","incrementPathIfConflicted","info","existing","getNewComponentId","refactorDependencyName","shouldRefactorVariablesAndClasses","BitError","targetName","getRemoteComponent","preserve","refactorVariableAndClasses","refactorFilenames","workspacePolicyEntries","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","deps","getDependencies","excludePackages","excludeCompIds","getCompIdsThatShouldNotBeInPolicy","source","ComponentDependency","compIdStr","componentId","parsedVersion","parse","version","versionWithPrefix","getVersionWithSavePrefix","isHash","snapToSemver","lifecycleType","lifecycle","fromExisting","skipConfig","getConfigFromExistingToNewComponent","linkToOriginal","noLink","toObject","provider","cli","componentMain","graphql","forkingMain","register","ForkCmd","forkingSchema","registerShowFragments","ForkingFragment","scopeCommand","getCommand","commands","ScopeForkCmd","exports","CLIAspect","WorkspaceAspect","DependencyResolverAspect","ComponentAspect","NewComponentHelperAspect","GraphqlAspect","RefactoringAspect","PkgAspect","InstallAspect","MainRuntime","addRuntime"],"sources":["forking.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { importTransformer, exportTransformer } from '@teambit/typescript';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { ComponentDependency, DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ComponentConfig } from '@teambit/generator';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { isHash } from '@teambit/component-version';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { ComponentID, ComponentIdObj, ComponentIdList } from '@teambit/component-id';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { PkgAspect, PkgMain } from '@teambit/pkg';\nimport { RefactoringAspect, MultipleStringsReplacement, RefactoringMain } from '@teambit/refactoring';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { uniqBy } from 'lodash';\nimport pMapSeries from 'p-map-series';\nimport { parse } from 'semver';\nimport { ForkCmd, ForkOptions } from './fork.cmd';\nimport { ForkingAspect } from './forking.aspect';\nimport { ForkingFragment } from './forking.fragment';\nimport { forkingSchema } from './forking.graphql';\nimport { ScopeForkCmd, ScopeForkOptions } from './scope-fork.cmd';\n\nexport type ForkInfo = {\n forkedFrom: ComponentID;\n};\n\ntype MultipleForkInfo = {\n targetCompId: ComponentID;\n sourceId: string;\n component: Component;\n};\n\ntype MultipleComponentsToFork = Array<{\n sourceId: string;\n targetId?: string; // if not specified, it'll be the same as the source\n targetScope?: string; // if not specified, it'll be taken from the options or from the default scope\n path?: string; // if not specified, use the default component path\n env?: string; // if not specified, use the default env\n config?: ComponentConfig; // if specified, adds to/overrides the existing config\n}>;\n\ntype MultipleForkOptions = {\n refactor?: boolean;\n scope?: string; // different scope-name than the original components\n install?: boolean; // whether to run \"bit install\" once done.\n ast?: boolean; // whether to use AST to transform files instead of regex\n};\n\nexport class ForkingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private dependencyResolver: DependencyResolverMain,\n private newComponentHelper: NewComponentHelperMain,\n private refactoring: RefactoringMain,\n private pkg: PkgMain\n ) {}\n\n /**\n * create a new copy of existing/remote component.\n * the new component holds a reference to the old one for future reference.\n * if refactor option is enable, change the source-code to update all dependencies with the new name.\n */\n async fork(sourceId: string, targetId?: string, options?: ForkOptions): Promise<ComponentID> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const exists = this.workspace.exists(sourceCompId);\n if (exists) {\n const existingInWorkspace = await this.workspace.get(sourceCompId);\n return this.forkExistingInWorkspace(existingInWorkspace, targetId, options);\n }\n const sourceIdWithScope = sourceCompId._legacy.scope ? sourceCompId : ComponentID.fromString(sourceId);\n const { targetCompId, component } = await this.forkRemoteComponent(sourceIdWithScope, targetId, options);\n await this.saveDeps(component);\n if (!options?.skipDependencyInstallation) await this.installDeps();\n return targetCompId;\n }\n\n /**\n * get the forking data, such as the source where a component was forked from\n */\n getForkInfo(component: Component): ForkInfo | null {\n const forkConfig = component.state.aspects.get(ForkingAspect.id)?.config as ForkConfig | undefined;\n if (!forkConfig) return null;\n return {\n forkedFrom: ComponentID.fromObject(forkConfig.forkedFrom),\n };\n }\n\n async forkMultipleFromRemote(componentsToFork: MultipleComponentsToFork, options: MultipleForkOptions = {}) {\n const componentsToForkSorted = this.sortComponentsToFork(componentsToFork);\n const { scope } = options;\n const results = await pMapSeries(\n componentsToForkSorted,\n async ({ sourceId, targetId, path, env, config, targetScope }) => {\n const sourceCompId = await this.workspace.resolveComponentId(sourceId);\n const sourceIdWithScope = sourceCompId._legacy.scope ? sourceCompId : ComponentID.fromString(sourceId);\n const { targetCompId, component } = await this.forkRemoteComponent(\n sourceIdWithScope,\n targetId,\n {\n scope: targetScope || scope,\n path,\n env,\n config,\n },\n false\n );\n return { targetCompId, sourceId, component };\n }\n );\n await this.refactorMultipleAndInstall(results, options);\n }\n\n /**\n * sort the components to fork so that components without \"env\" prop will be forked first.\n * this way, if some components are envs, their \"env\" prop is empty and will be forked first, then components that\n * depends on them.\n * otherwise, forking the components first result in errors when loading them as their envs are missing at that point\n */\n private sortComponentsToFork(componentsToFork: MultipleComponentsToFork) {\n return componentsToFork.sort((a, b) => {\n if (a.env && b.env) return 0;\n if (a.env) return 1;\n return -1;\n });\n }\n\n private async refactorMultipleAndInstall(results: MultipleForkInfo[], options: MultipleForkOptions = {}) {\n const oldPackages: string[] = [];\n const stringsToReplace: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId, component }) => {\n const oldPackageName = this.pkg.getPackageName(component);\n oldPackages.push(oldPackageName);\n const newName = targetCompId.fullName.replace(/\\//g, '.');\n const scopeToReplace = targetCompId.scope.replace('.', '/');\n const newPackageName = `@${scopeToReplace}.${newName}`;\n return [\n { oldStr: oldPackageName, newStr: newPackageName },\n { oldStr: sourceId, newStr: targetCompId.toStringWithoutVersion() },\n ];\n })\n .flat();\n\n const stringsToReplaceForVariable: MultipleStringsReplacement = results\n .map(({ targetCompId, sourceId }) => {\n const sourceCompId = ComponentID.fromString(sourceId);\n if (sourceCompId.name === targetCompId.name) return [];\n return this.refactoring.getStringReplacementsForVariablesAndClasses(sourceCompId, targetCompId);\n })\n .flat();\n\n const allComponents = await this.workspace.list();\n if (options.refactor) {\n const { changedComponents } = await this.refactoring.replaceMultipleStrings(\n allComponents,\n stringsToReplace,\n options.ast ? [importTransformer, exportTransformer] : undefined\n );\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n\n const { changedComponents: changedComponentsVariables } = await this.refactoring.replaceMultipleStrings(\n allComponents,\n stringsToReplaceForVariable,\n options.ast ? [importTransformer, exportTransformer] : undefined,\n true\n );\n\n await Promise.all(changedComponentsVariables.map((comp) => this.workspace.write(comp)));\n }\n const forkedComponents = results.map((result) => result.component);\n const policy = await Promise.all(forkedComponents.map((comp) => this.extractDeps(comp)));\n const policyFlatAndUnique = uniqBy(policy.flat(), 'dependencyId');\n const policyWithoutWorkspaceComps = policyFlatAndUnique.filter((dep) => !oldPackages.includes(dep.dependencyId));\n this.dependencyResolver.addToRootPolicy(policyWithoutWorkspaceComps, { updateExisting: true });\n await this.dependencyResolver.persistConfig('fork');\n if (options.install) {\n await this.installDeps();\n }\n }\n\n /**\n * fork all components of the given scope\n */\n async forkScope(\n originalScope: string,\n newOptionalScope?: string, // if not specified, it'll be the default scope\n pattern?: string,\n options?: ScopeForkOptions\n ): Promise<ComponentID[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const newScope = newOptionalScope || this.workspace.defaultScope;\n const allIdsFromOriginalScope = await this.workspace.scope.listRemoteScope(originalScope);\n if (!allIdsFromOriginalScope.length) {\n throw new Error(`unable to find components to fork from ${originalScope}`);\n }\n const getPatternWithScopeName = () => {\n if (!pattern) return undefined;\n if (pattern.startsWith(`${originalScope}/`)) return pattern;\n return `${originalScope}/${pattern}`;\n };\n const patternWithScopeName = getPatternWithScopeName();\n const idsFromOriginalScope = patternWithScopeName\n ? await this.workspace.scope.filterIdsFromPoolIdsByPattern(patternWithScopeName, allIdsFromOriginalScope)\n : allIdsFromOriginalScope;\n const workspaceIds = this.workspace.listIds();\n const workspaceBitIds = ComponentIdList.fromArray(workspaceIds.map((id) => id));\n idsFromOriginalScope.forEach((id) => {\n const existInWorkspace = workspaceBitIds.searchWithoutVersion(id);\n if (existInWorkspace) {\n throw new Error(\n `unable to fork \"${id.toString()}\". the workspace has a component \"${existInWorkspace.toString()}\" with the same name and same scope`\n );\n }\n });\n const multipleForkInfo: MultipleForkInfo[] = [];\n const components = await this.workspace.scope.getManyRemoteComponents(idsFromOriginalScope);\n await pMapSeries(components, async (component) => {\n const config = await this.getConfig(component);\n const targetCompId = ComponentID.fromObject({ name: component.id.fullName }, newScope);\n await this.newComponentHelper.writeAndAddNewComp(\n component,\n targetCompId,\n {\n scope: newScope,\n incrementPathIfConflicted: true,\n },\n config\n );\n multipleForkInfo.push({ targetCompId, sourceId: component.id.toStringWithoutVersion(), component });\n });\n await this.refactorMultipleAndInstall(multipleForkInfo, {\n refactor: true,\n install: !options?.skipDependencyInstallation,\n ast: options?.ast,\n });\n return multipleForkInfo.map((info) => info.targetCompId);\n }\n\n private async forkExistingInWorkspace(existing: Component, targetId?: string, options?: ForkOptions) {\n targetId = targetId || existing.id.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetId, undefined, options?.scope);\n\n const config = await this.getConfig(existing, options);\n await this.newComponentHelper.writeAndAddNewComp(existing, targetCompId, options, config);\n if (options?.refactor) {\n const allComponents = await this.workspace.list();\n const { changedComponents } = await this.refactoring.refactorDependencyName(allComponents, existing.id, targetId);\n await Promise.all(changedComponents.map((comp) => this.workspace.write(comp)));\n }\n return targetCompId;\n }\n\n private async forkRemoteComponent(\n sourceId: ComponentID,\n targetId?: string,\n options?: ForkOptions,\n shouldRefactorVariablesAndClasses = true\n ): Promise<{\n targetCompId: ComponentID;\n component: Component;\n }> {\n if (options?.refactor) {\n throw new BitError(`the component ${sourceId.toStringWithoutVersion()} is not in the workspace, you can't use the --refactor flag.\nthe reason is that the refactor changes the components using ${sourceId.toStringWithoutVersion()}, since it's not in the workspace, no components were using it, so nothing to refactor`);\n }\n const targetName = targetId || sourceId.fullName;\n const targetCompId = this.newComponentHelper.getNewComponentId(targetName, undefined, options?.scope);\n const component = await this.workspace.scope.getRemoteComponent(sourceId);\n await this.refactoring.replaceMultipleStrings(\n [component],\n [\n {\n oldStr: sourceId.toStringWithoutVersion(),\n newStr: targetCompId.toStringWithoutVersion(),\n },\n ],\n options?.ast ? [importTransformer, exportTransformer] : undefined\n );\n if (!options?.preserve) {\n if (shouldRefactorVariablesAndClasses) {\n await this.refactoring.refactorVariableAndClasses(component, sourceId, targetCompId, options);\n }\n this.refactoring.refactorFilenames(component, sourceId, targetCompId);\n }\n const config = await this.getConfig(component, options);\n await this.newComponentHelper.writeAndAddNewComp(component, targetCompId, options, config);\n\n return { targetCompId, component };\n }\n\n private async saveDeps(component: Component) {\n const workspacePolicyEntries = this.extractDeps(component);\n this.dependencyResolver.addToRootPolicy(workspacePolicyEntries, { updateExisting: true });\n await this.dependencyResolver.persistConfig('fork (save deps)');\n }\n\n private async installDeps() {\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\n\n private extractDeps(component: Component) {\n const deps = this.dependencyResolver.getDependencies(component);\n const excludePackages = ['@teambit/legacy'];\n const excludeCompIds = this.dependencyResolver.getCompIdsThatShouldNotBeInPolicy();\n return deps\n .filter((dep) => dep.source === 'auto')\n .filter((dep) => {\n if (dep instanceof ComponentDependency) {\n const compIdStr = dep.componentId.toStringWithoutVersion();\n return !excludeCompIds.includes(compIdStr);\n }\n return !excludePackages.includes(dep.id);\n })\n .map((dep) => {\n const parsedVersion = parse(dep.version);\n const versionWithPrefix = parsedVersion\n ? this.dependencyResolver.getVersionWithSavePrefix({ version: dep.version })\n : dep.version;\n const version = isHash(versionWithPrefix) ? snapToSemver(versionWithPrefix) : versionWithPrefix;\n return {\n dependencyId: dep.getPackageName?.() || dep.id,\n lifecycleType: dep.lifecycle === 'dev' ? 'runtime' : dep.lifecycle,\n value: {\n version,\n },\n };\n });\n }\n\n private async getConfig(comp: Component, options?: ForkOptions) {\n const config = options?.config || {};\n const fromExisting = options?.skipConfig\n ? {}\n : await this.newComponentHelper.getConfigFromExistingToNewComponent(comp);\n const linkToOriginal = options?.noLink ? {} : { [ForkingAspect.id]: { forkedFrom: comp.id.toObject() } };\n return {\n ...fromExisting,\n ...linkToOriginal,\n ...config,\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n ComponentAspect,\n NewComponentHelperAspect,\n GraphqlAspect,\n RefactoringAspect,\n PkgAspect,\n InstallAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n dependencyResolver,\n componentMain,\n newComponentHelper,\n graphql,\n refactoring,\n pkg,\n install,\n ]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n ComponentMain,\n NewComponentHelperMain,\n GraphqlMain,\n RefactoringMain,\n PkgMain,\n InstallMain\n ]) {\n const forkingMain = new ForkingMain(workspace, install, dependencyResolver, newComponentHelper, refactoring, pkg);\n cli.register(new ForkCmd(forkingMain));\n graphql.register(forkingSchema(forkingMain));\n componentMain.registerShowFragments([new ForkingFragment(forkingMain)]);\n\n const scopeCommand = cli.getCommand('scope');\n scopeCommand?.commands?.push(new ScopeForkCmd(forkingMain));\n\n return forkingMain;\n }\n}\n\nForkingAspect.addRuntime(ForkingMain);\n\nexport type ForkConfig = {\n forkedFrom: ComponentIdObj;\n};\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,oBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,mBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,kBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,iBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,aAAA;EAAA,MAAAT,IA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AAiB,EACjBC,gBAAS,EACTC,wBAAa,CACd;AAAA3M,eAAA,CAxTUgB,WAAW,aAyTL4L,kBAAW;AAkC9B1J,wBAAa,CAAC2J,UAAU,CAAC7L,WAAW,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_forking@1.0.282/dist/forking.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_forking@1.0.282/dist/forking.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_forking@1.0.283/dist/forking.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_forking@1.0.283/dist/forking.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -18,8 +18,8 @@ function _chalk() {
18
18
  };
19
19
  return data;
20
20
  }
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
23
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
24
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
25
  class ScopeForkCmd {
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","data","require","_chalk","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ScopeForkCmd","constructor","forking","name","description","COMPONENT_PATTERN_HELP","report","originalScope","newScope","pattern","options","forkedIds","forkScope","title","chalk","green","bold","scope","map","id","toString","join","exports"],"sources":["scope-fork.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport type ScopeForkOptions = {\n ast?: boolean;\n skipDependencyInstallation?: boolean;\n};\nexport class ScopeForkCmd implements Command {\n name = 'fork <original-scope> [new-scope] [pattern]';\n arguments = [\n {\n name: 'original-scope',\n description: 'the original scope to fork',\n },\n {\n name: 'new-scope',\n description: 'the new scope to fork to, default to the default-scope of the workspace',\n },\n {\n name: 'pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'fork all components of the original-scope and refactor the source-code to use the new scope name';\n extendedDescription = 'optionally, provide [pattern] to limit the fork to specific components';\n options = [\n ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private forking: ForkingMain) {}\n\n async report([originalScope, newScope, pattern]: [string, string, string], options: ScopeForkOptions) {\n const forkedIds = await this.forking.forkScope(originalScope, newScope, pattern, options);\n const title = chalk.green(\n `successfully forked ${chalk.bold(originalScope)} into ${chalk.bold(\n newScope || forkedIds[0].scope\n )}. the following components were created`\n );\n return `${title}\\n${forkedIds.map((id) => id.toString()).join('\\n')}`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EA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C,WAAW,EAAE;IACf,CAAC,EACD;MACED,IAAI,EAAE,SAAS;MACfC,WAAW,EAAEC;IACf,CAAC,CACF;IAAAzB,eAAA,sBACa,kGAAkG;IAAAA,eAAA,8BAC1F,wEAAwE;IAAAA,eAAA,kBACpF,CACR,CAAC,EAAE,EAAE,KAAK,EAAE,2DAA2D,CAAC,EACxE,CAAC,GAAG,EAAE,8BAA8B,EAAE,oDAAoD,CAAC,CAC5F;IAAAA,eAAA,gBACO,aAAa;EAEsB;EAE3C,MAAM0B,MAAMA,CAAC,CAACC,aAAa,EAAEC,QAAQ,EAAEC,OAAO,CAA2B,EAAEC,OAAyB,EAAE;IACpG,MAAMC,SAAS,GAAG,MAAM,IAAI,CAACT,OAAO,CAACU,SAAS,CAACL,aAAa,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;IACzF,MAAMG,KAAK,GAAGC,gBAAK,CAACC,KAAK,CACtB,uBAAsBD,gBAAK,CAACE,IAAI,CAACT,aAAa,CAAE,SAAQO,gBAAK,CAACE,IAAI,CACjER,QAAQ,IAAIG,SAAS,CAAC,CAAC,CAAC,CAACM,KAC3B,CAAE,yCACJ,CAAC;IACD,OAAQ,GAAEJ,KAAM,KAAIF,SAAS,CAACO,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAACC,QAAQ,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAE,EAAC;EACvE;AACF;AAACC,OAAA,CAAAtB,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_constants","data","require","_chalk","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeForkCmd","constructor","forking","name","description","COMPONENT_PATTERN_HELP","report","originalScope","newScope","pattern","options","forkedIds","forkScope","title","chalk","green","bold","scope","map","id","toString","join","exports"],"sources":["scope-fork.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { ForkingMain } from './forking.main.runtime';\n\nexport type ScopeForkOptions = {\n ast?: boolean;\n skipDependencyInstallation?: boolean;\n};\nexport class ScopeForkCmd implements Command {\n name = 'fork <original-scope> [new-scope] [pattern]';\n arguments = [\n {\n name: 'original-scope',\n description: 'the original scope to fork',\n },\n {\n name: 'new-scope',\n description: 'the new scope to fork to, default to the default-scope of the workspace',\n },\n {\n name: 'pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'fork all components of the original-scope and refactor the source-code to use the new scope name';\n extendedDescription = 'optionally, provide [pattern] to limit the fork to specific components';\n options = [\n ['', 'ast', 'EXPERIMENTAL. use ast to transform files instead of regex'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private forking: ForkingMain) {}\n\n async report([originalScope, newScope, pattern]: [string, string, string], options: ScopeForkOptions) {\n const forkedIds = await this.forking.forkScope(originalScope, newScope, pattern, options);\n const title = chalk.green(\n `successfully forked ${chalk.bold(originalScope)} into ${chalk.bold(\n newScope || forkedIds[0].scope\n )}. the following components were created`\n );\n return `${title}\\n${forkedIds.map((id) => id.toString()).join('\\n')}`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAA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gBACO,aAAa;EAEsB;EAE3C,MAAMwB,MAAMA,CAAC,CAACC,aAAa,EAAEC,QAAQ,EAAEC,OAAO,CAA2B,EAAEC,OAAyB,EAAE;IACpG,MAAMC,SAAS,GAAG,MAAM,IAAI,CAACT,OAAO,CAACU,SAAS,CAACL,aAAa,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;IACzF,MAAMG,KAAK,GAAGC,gBAAK,CAACC,KAAK,CACvB,uBAAuBD,gBAAK,CAACE,IAAI,CAACT,aAAa,CAAC,SAASO,gBAAK,CAACE,IAAI,CACjER,QAAQ,IAAIG,SAAS,CAAC,CAAC,CAAC,CAACM,KAC3B,CAAC,yCACH,CAAC;IACD,OAAO,GAAGJ,KAAK,KAAKF,SAAS,CAACO,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAACC,QAAQ,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE;EACvE;AACF;AAACC,OAAA,CAAAtB,YAAA,GAAAA,YAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/forking",
3
- "version": "1.0.282",
3
+ "version": "1.0.283",
4
4
  "homepage": "https://bit.cloud/teambit/component/forking",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "forking",
9
- "version": "1.0.282"
9
+ "version": "1.0.283"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,17 +19,17 @@
19
19
  "@teambit/component-id": "1.2.0",
20
20
  "@teambit/component-version": "1.0.3",
21
21
  "@teambit/cli": "0.0.865",
22
- "@teambit/generator": "1.0.283",
23
- "@teambit/component": "1.0.282",
24
- "@teambit/graphql": "1.0.282",
22
+ "@teambit/generator": "1.0.284",
23
+ "@teambit/component": "1.0.283",
24
+ "@teambit/graphql": "1.0.283",
25
25
  "@teambit/component-package-version": "0.0.433",
26
- "@teambit/dependency-resolver": "1.0.282",
27
- "@teambit/install": "1.0.282",
28
- "@teambit/new-component-helper": "1.0.282",
29
- "@teambit/pkg": "1.0.282",
30
- "@teambit/refactoring": "1.0.282",
31
- "@teambit/typescript": "1.0.282",
32
- "@teambit/workspace": "1.0.282"
26
+ "@teambit/dependency-resolver": "1.0.283",
27
+ "@teambit/install": "1.0.283",
28
+ "@teambit/new-component-helper": "1.0.283",
29
+ "@teambit/pkg": "1.0.283",
30
+ "@teambit/refactoring": "1.0.283",
31
+ "@teambit/typescript": "1.0.283",
32
+ "@teambit/workspace": "1.0.283"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/lodash": "4.14.165",