@teambit/variants 0.0.1268 → 0.0.1270

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,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.workspace/variants@0.0.1268" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.workspace/variants@0.0.1270" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.workspace/variants-preview"]=n():e["teambit.workspace/variants-preview"]=n()}(self,(()=>(()=>{"use strict";var e={92352:function(e,n,t){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Variants=void 0;var o=t(76593);Object.defineProperty(n,"Variants",{enumerable:!0,get:function(){return a(o).default}}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a(o).default}})},76593:(e,n,t)=>{var a={id:"teambit.workspace/content/variants@1.95.9",homepage:"https://bit.dev/teambit/workspace/content/variants",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=d,s(t(41594));var o=t(5016),r=t(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},l.apply(this,arguments)}function c(e,n){if(null==e)return{};var t,a,o=p(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function p(e,n){if(null==e)return{};var t,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(o[t]=e[t]);return o}s.__bit_component=a,l.__bit_component=a,c.__bit_component=a,p.__bit_component=a;var m={},u="wrapper";function d(e){var n=e.components,t=c(e,i);return(0,o.mdx)(u,l({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("h1",null,"Variants"),(0,o.mdx)("p",null,"'Variants' enables you to configure groups of components with ",(0,o.mdx)("a",{parentName:"p",href:"/components/component-config"},"Component configuration"),".\nComponents are selected using their common directory path or namespace, and applied, collectively, with configurations (i.e, pairs of Aspects and their corresponding configs)."),(0,o.mdx)("p",null,"Since each component can be selected more than once using different selectors, Variants looks for all available configurations and ",(0,o.mdx)("a",{parentName:"p",href:"#merging-configurations"},"merges them together"),"."),(0,o.mdx)("p",null,"Use Variants as an efficient alternative to manually configuring each component's ",(0,o.mdx)("inlineCode",{parentName:"p"},"component.json"),"."),(0,o.mdx)("h2",null,"Variants Selector Examples"),(0,o.mdx)("h3",null,"Configure components in a directory"),(0,o.mdx)("p",null,"To select a group of components using a directory path, use the relative path to the components' parent directory from the workspace root. In the following example, all components under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"components/utility-functions")," directory\n(and any sub-directories) will be included in this set:"),(0,o.mdx)("p",null,"This examples configures all components contained in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"design")," directory with the ",(0,o.mdx)("a",{parentName:"p",href:"/react"},"React env"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "design": {\n "teambit.react/react": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Configure components using Namespaces"),(0,o.mdx)("p",null,"This option is recommended as it decouples your components' configurations from the workspace's file structure. It handles components using fundamental definitions that pertain to function and purpose, via their namespace.\nThe namespace selector behaves like a glob pattern, with the component name (including its namespace) being the equivalent of a file path being matched against the pattern.\nSpecifically, this means that namespace selectors support the location-specific ",(0,o.mdx)("inlineCode",{parentName:"p"},"*")," matcher, and the 'anywhere' ",(0,o.mdx)("inlineCode",{parentName:"p"},"**")," matcher for matching the component name."),(0,o.mdx)("p",null,"In the following example, any component under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," namespace (and it's sub-namespaces) will be included in this rule set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "{utility-functions/**}": { // Match any component name starts with utility-functions\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("p",null,"In the following example however, only components ",(0,o.mdx)("strong",{parentName:"p"},"directly")," under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," namespace will be included in this rule set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "{utility-functions/*}": { // Match utility-functions/sort-array but not utility-functions/string/reverse\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Grouping selectors"),(0,o.mdx)("p",null,"You can add several sets for the same variant configuration by grouping selectors together:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Multiple directory paths"',title:'"Multiple',directory:!0,'paths"':!0},'"teambit.workspace/variants": {\n "components/utils, components/react-ui": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Multiple namespaces"',title:'"Multiple','namespaces"':!0},'"teambit.workspace/variants": {\n "{utility-functions/**}, {react-ui/**}": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Paths and namespaces"',title:'"Paths',and:!0,'namespaces"':!0},'"teambit.workspace/variants": {\n "{utility-functions/**}, {react-ui/**}, components/utils, components/react-ui": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Exclude directories/components from a rule"),(0,o.mdx)("p",null,"Using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"!")," deselector you can exclude a set of components from a selector.\nThe ",(0,o.mdx)("inlineCode",{parentName:"p"},"!")," deselector works both for directories and namespaces, for example:"),(0,o.mdx)("h4",null,"Exclude a sub-directory directory from a rule"),(0,o.mdx)("p",null,"For example, apply the ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/node")," environment on the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," set, but exclude the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions/react-utils")," folder from that set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/utility-functions, !components/utility-functions/react-utils": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h4",null,"Exclude namespaces from a rule"),(0,o.mdx)("p",null,"The following example applies the ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/node")," environment on every component under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utils")," namespace, but excludes the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utils/react")," namespace and its children from this set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "{utils/**}, !{utils/react/**}": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Special Variants"),(0,o.mdx)("h4",null,"The Wildcard (","*",") variant"),(0,o.mdx)("p",null,"To select all components in your workspace use the wildcard variant ",(0,o.mdx)("inlineCode",{parentName:"p"},"*"),". This is useful when you want to apply very general configurations, especially default or backup configurations,\non all components. Using this selector can produce unexpected consequences if the rules aren't general enough, so we recommend using this selector sparingly!\nFor example:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "*": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h2",null,"Merging Configurations"),(0,o.mdx)("p",null,"The merging process is similar to the way CSS rules are handled. Rules are cascaded from the selected group to all its members. When the same component is applied with conflicting configs (using multiple selectors),\nthe most specific variant (selector) overrides the more general ones."),(0,o.mdx)("p",null,"In the following example, ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-org.my-scope/ui/inputs/button")," is selected using two different selectors (",(0,o.mdx)("inlineCode",{parentName:"p"},"{ui\\**}")," and ",(0,o.mdx)("inlineCode",{parentName:"p"},"{*\\inputs\\**}"),"), and configured with conflicting configurations."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "{ui/**}": {\n "teambit.preview/preview": {\n "disabled": true\n }\n },\n "{*/inputs/**}": {\n "teambit.preview/preview": {\n "disabled": false\n }\n }\n }\n}\n')),(0,o.mdx)("p",null,"The more specific selector ",(0,o.mdx)("inlineCode",{parentName:"p"},'"{*/inputs/*}"')," will override the more general one ",(0,o.mdx)("inlineCode",{parentName:"p"},'"{ui/**}"'),". This will result in configuring ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-org.my-scope/ui/inputs/button")," with ",(0,o.mdx)("inlineCode",{parentName:"p"},'"teambit.preview/preview": {"disabled": false}'),"."),(0,o.mdx)("h2",null,"Variants Flags"),(0,o.mdx)("h3",null,"Propagate"),(0,o.mdx)("p",null,"When using selectors which can propagate down to sub-sets, such as with directory selectors (where all sub-directories are included) or {namespace/","*","*","} type selectors,\nyou can prevent this propagation for specific set of inheritors, by setting set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"propogate")," value of an inheriting group of components to ",(0,o.mdx)("inlineCode",{parentName:"p"},"false"),".\nOnce bit sees ",(0,o.mdx)("inlineCode",{parentName:"p"},'"propagate": false')," it uses only the configuration for this set and does not inherit."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/react": {\n "my-aspect2": {\n "aspect2-react-key": "aspect2-react-val"\n }\n },\n "components/react/ui": {\n "propagate": false, // take this config, and don\'t propagate parent configs down to here\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n }\n }\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="components/react/ui/button\'s calculated configuration"',title:"\"components/react/ui/button's",calculated:!0,'configuration"':!0},'{\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n }\n}\n')),(0,o.mdx)("h2",null,"Removing aspects"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Note: Once a component has been tagged, any aspect configured for that component ",(0,o.mdx)("strong",{parentName:"p"},"can only")," be removed from the component via the following ",(0,o.mdx)("inlineCode",{parentName:"p"},"remove")," method. (if you haven't exported yet then ",(0,o.mdx)("inlineCode",{parentName:"p"},"untag")," would reset the effect of the tag)")),(0,o.mdx)("p",null,"There are numerous scenarios where you would not want a specific aspect to be defined on a subgroup but you don't want to exclude the sub-group from upstream rules, or use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"propagate: false")," flag, since you want to receive the\nother configurations from the parent group rule/s."),(0,o.mdx)("p",null,"In that case, removing a specific aspect can be achieved using ",(0,o.mdx)("inlineCode",{parentName:"p"},'"-"')," as the value for an aspect's configuration. This will remove this aspect from the current component set."),(0,o.mdx)("p",null,"For instance, the following will remove ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-aspect2")," from components in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"components/react/ui")," set, while still inheriting other configs such as the ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-aspect3")," aspect."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/react": {\n "my-aspect2": {\n "aspect2-react-key": "aspect2-react-val"\n },\n "my-aspect3": {\n "aspect3-react-key": "aspect3-react-val"\n }\n },\n "components/react/ui": {\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n },\n "my-aspect2": "-" // Remove my-aspect2 from this set\'s configuration\n }\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="components/react/ui/button\'s calculated configuration"',title:"\"components/react/ui/button's",calculated:!0,'configuration"':!0},'{\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n },\n "my-aspect3": {\n "aspect3-react-key": "aspect3-react-val"\n }\n}\n'))))}d.__bit_component=a,d.isMDXComponent=!0},24046:(e,n,t)=>{var a={id:"teambit.workspace/variants@0.0.1268",homepage:"https://bit.cloud/teambit/workspace/variants",exported:!0};function o(){const e=r(t(41594));return o=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=a,r.__bit_component=a;const i=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/variants.svg"}));i.__bit_component=a,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var r=n[a]={exports:{}};return e[a].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};t.r(a),t.d(a,{compositions:()=>h,compositions_metadata:()=>x,overview:()=>g});var o={};t.r(o),t.d(o,{default:()=>f});var r=t(24046),i=(t(41594),t(5016)),s=t(65682),l=t(92352),c=t.n(l),p=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(null,arguments)}var u={},d="wrapper";function f(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,p);return(0,i.mdx)(d,m({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{Variants:c()},mdxType:"MDXScopeProvider"},(0,i.mdx)(c(),{mdxType:"Variants"})))}f.isMDXComponent=!0;const h=[r],g=[o],x={compositions:[{displayName:"Logo",identifier:"Logo"}]};return a})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.workspace/variants-preview"]=n():e["teambit.workspace/variants-preview"]=n()}(self,(()=>(()=>{"use strict";var e={92352:function(e,n,t){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Variants=void 0;var o=t(76593);Object.defineProperty(n,"Variants",{enumerable:!0,get:function(){return a(o).default}}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a(o).default}})},76593:(e,n,t)=>{var a={id:"teambit.workspace/content/variants@1.95.9",homepage:"https://bit.dev/teambit/workspace/content/variants",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=d,s(t(41594));var o=t(5016),r=t(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},l.apply(this,arguments)}function c(e,n){if(null==e)return{};var t,a,o=p(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function p(e,n){if(null==e)return{};var t,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(o[t]=e[t]);return o}s.__bit_component=a,l.__bit_component=a,c.__bit_component=a,p.__bit_component=a;var m={},u="wrapper";function d(e){var n=e.components,t=c(e,i);return(0,o.mdx)(u,l({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("h1",null,"Variants"),(0,o.mdx)("p",null,"'Variants' enables you to configure groups of components with ",(0,o.mdx)("a",{parentName:"p",href:"/components/component-config"},"Component configuration"),".\nComponents are selected using their common directory path or namespace, and applied, collectively, with configurations (i.e, pairs of Aspects and their corresponding configs)."),(0,o.mdx)("p",null,"Since each component can be selected more than once using different selectors, Variants looks for all available configurations and ",(0,o.mdx)("a",{parentName:"p",href:"#merging-configurations"},"merges them together"),"."),(0,o.mdx)("p",null,"Use Variants as an efficient alternative to manually configuring each component's ",(0,o.mdx)("inlineCode",{parentName:"p"},"component.json"),"."),(0,o.mdx)("h2",null,"Variants Selector Examples"),(0,o.mdx)("h3",null,"Configure components in a directory"),(0,o.mdx)("p",null,"To select a group of components using a directory path, use the relative path to the components' parent directory from the workspace root. In the following example, all components under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"components/utility-functions")," directory\n(and any sub-directories) will be included in this set:"),(0,o.mdx)("p",null,"This examples configures all components contained in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"design")," directory with the ",(0,o.mdx)("a",{parentName:"p",href:"/react"},"React env"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "design": {\n "teambit.react/react": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Configure components using Namespaces"),(0,o.mdx)("p",null,"This option is recommended as it decouples your components' configurations from the workspace's file structure. It handles components using fundamental definitions that pertain to function and purpose, via their namespace.\nThe namespace selector behaves like a glob pattern, with the component name (including its namespace) being the equivalent of a file path being matched against the pattern.\nSpecifically, this means that namespace selectors support the location-specific ",(0,o.mdx)("inlineCode",{parentName:"p"},"*")," matcher, and the 'anywhere' ",(0,o.mdx)("inlineCode",{parentName:"p"},"**")," matcher for matching the component name."),(0,o.mdx)("p",null,"In the following example, any component under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," namespace (and it's sub-namespaces) will be included in this rule set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "{utility-functions/**}": { // Match any component name starts with utility-functions\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("p",null,"In the following example however, only components ",(0,o.mdx)("strong",{parentName:"p"},"directly")," under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," namespace will be included in this rule set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "{utility-functions/*}": { // Match utility-functions/sort-array but not utility-functions/string/reverse\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Grouping selectors"),(0,o.mdx)("p",null,"You can add several sets for the same variant configuration by grouping selectors together:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Multiple directory paths"',title:'"Multiple',directory:!0,'paths"':!0},'"teambit.workspace/variants": {\n "components/utils, components/react-ui": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Multiple namespaces"',title:'"Multiple','namespaces"':!0},'"teambit.workspace/variants": {\n "{utility-functions/**}, {react-ui/**}": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="Paths and namespaces"',title:'"Paths',and:!0,'namespaces"':!0},'"teambit.workspace/variants": {\n "{utility-functions/**}, {react-ui/**}, components/utils, components/react-ui": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Exclude directories/components from a rule"),(0,o.mdx)("p",null,"Using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"!")," deselector you can exclude a set of components from a selector.\nThe ",(0,o.mdx)("inlineCode",{parentName:"p"},"!")," deselector works both for directories and namespaces, for example:"),(0,o.mdx)("h4",null,"Exclude a sub-directory directory from a rule"),(0,o.mdx)("p",null,"For example, apply the ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/node")," environment on the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions")," set, but exclude the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utility-functions/react-utils")," folder from that set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/utility-functions, !components/utility-functions/react-utils": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h4",null,"Exclude namespaces from a rule"),(0,o.mdx)("p",null,"The following example applies the ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/node")," environment on every component under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utils")," namespace, but excludes the ",(0,o.mdx)("inlineCode",{parentName:"p"},"utils/react")," namespace and its children from this set:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "{utils/**}, !{utils/react/**}": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h3",null,"Special Variants"),(0,o.mdx)("h4",null,"The Wildcard (","*",") variant"),(0,o.mdx)("p",null,"To select all components in your workspace use the wildcard variant ",(0,o.mdx)("inlineCode",{parentName:"p"},"*"),". This is useful when you want to apply very general configurations, especially default or backup configurations,\non all components. Using this selector can produce unexpected consequences if the rules aren't general enough, so we recommend using this selector sparingly!\nFor example:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.workspace/variants": {\n "*": {\n "teambit.harmony/node": {}\n },\n}\n')),(0,o.mdx)("h2",null,"Merging Configurations"),(0,o.mdx)("p",null,"The merging process is similar to the way CSS rules are handled. Rules are cascaded from the selected group to all its members. When the same component is applied with conflicting configs (using multiple selectors),\nthe most specific variant (selector) overrides the more general ones."),(0,o.mdx)("p",null,"In the following example, ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-org.my-scope/ui/inputs/button")," is selected using two different selectors (",(0,o.mdx)("inlineCode",{parentName:"p"},"{ui\\**}")," and ",(0,o.mdx)("inlineCode",{parentName:"p"},"{*\\inputs\\**}"),"), and configured with conflicting configurations."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "{ui/**}": {\n "teambit.preview/preview": {\n "disabled": true\n }\n },\n "{*/inputs/**}": {\n "teambit.preview/preview": {\n "disabled": false\n }\n }\n }\n}\n')),(0,o.mdx)("p",null,"The more specific selector ",(0,o.mdx)("inlineCode",{parentName:"p"},'"{*/inputs/*}"')," will override the more general one ",(0,o.mdx)("inlineCode",{parentName:"p"},'"{ui/**}"'),". This will result in configuring ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-org.my-scope/ui/inputs/button")," with ",(0,o.mdx)("inlineCode",{parentName:"p"},'"teambit.preview/preview": {"disabled": false}'),"."),(0,o.mdx)("h2",null,"Variants Flags"),(0,o.mdx)("h3",null,"Propagate"),(0,o.mdx)("p",null,"When using selectors which can propagate down to sub-sets, such as with directory selectors (where all sub-directories are included) or {namespace/","*","*","} type selectors,\nyou can prevent this propagation for specific set of inheritors, by setting set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"propogate")," value of an inheriting group of components to ",(0,o.mdx)("inlineCode",{parentName:"p"},"false"),".\nOnce bit sees ",(0,o.mdx)("inlineCode",{parentName:"p"},'"propagate": false')," it uses only the configuration for this set and does not inherit."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/react": {\n "my-aspect2": {\n "aspect2-react-key": "aspect2-react-val"\n }\n },\n "components/react/ui": {\n "propagate": false, // take this config, and don\'t propagate parent configs down to here\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n }\n }\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="components/react/ui/button\'s calculated configuration"',title:"\"components/react/ui/button's",calculated:!0,'configuration"':!0},'{\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n }\n}\n')),(0,o.mdx)("h2",null,"Removing aspects"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Note: Once a component has been tagged, any aspect configured for that component ",(0,o.mdx)("strong",{parentName:"p"},"can only")," be removed from the component via the following ",(0,o.mdx)("inlineCode",{parentName:"p"},"remove")," method. (if you haven't exported yet then ",(0,o.mdx)("inlineCode",{parentName:"p"},"untag")," would reset the effect of the tag)")),(0,o.mdx)("p",null,"There are numerous scenarios where you would not want a specific aspect to be defined on a subgroup but you don't want to exclude the sub-group from upstream rules, or use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"propagate: false")," flag, since you want to receive the\nother configurations from the parent group rule/s."),(0,o.mdx)("p",null,"In that case, removing a specific aspect can be achieved using ",(0,o.mdx)("inlineCode",{parentName:"p"},'"-"')," as the value for an aspect's configuration. This will remove this aspect from the current component set."),(0,o.mdx)("p",null,"For instance, the following will remove ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-aspect2")," from components in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"components/react/ui")," set, while still inheriting other configs such as the ",(0,o.mdx)("inlineCode",{parentName:"p"},"my-aspect3")," aspect."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.json',title:'"workspace.json'},'"teambit.workspace/variants": {\n "components/react": {\n "my-aspect2": {\n "aspect2-react-key": "aspect2-react-val"\n },\n "my-aspect3": {\n "aspect3-react-key": "aspect3-react-val"\n }\n },\n "components/react/ui": {\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n },\n "my-aspect2": "-" // Remove my-aspect2 from this set\'s configuration\n }\n}\n')),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="components/react/ui/button\'s calculated configuration"',title:"\"components/react/ui/button's",calculated:!0,'configuration"':!0},'{\n "my-aspect1": {\n "aspect1-react-ui-key": "aspect1-react-ui-val"\n },\n "my-aspect3": {\n "aspect3-react-key": "aspect3-react-val"\n }\n}\n'))))}d.__bit_component=a,d.isMDXComponent=!0},61159:(e,n,t)=>{var a={id:"teambit.workspace/variants@0.0.1270",homepage:"https://bit.cloud/teambit/workspace/variants",exported:!0};function o(){const e=r(t(41594));return o=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=a,r.__bit_component=a;const i=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/variants.svg"}));i.__bit_component=a,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var r=n[a]={exports:{}};return e[a].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};t.r(a),t.d(a,{compositions:()=>h,compositions_metadata:()=>x,overview:()=>g});var o={};t.r(o),t.d(o,{default:()=>f});var r=t(61159),i=(t(41594),t(5016)),s=t(65682),l=t(92352),c=t.n(l),p=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(null,arguments)}var u={},d="wrapper";function f(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,p);return(0,i.mdx)(d,m({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{Variants:c()},mdxType:"MDXScopeProvider"},(0,i.mdx)(c(),{mdxType:"Variants"})))}f.isMDXComponent=!0;const h=[r],g=[o],x={compositions:[{displayName:"Logo",identifier:"Logo"}]};return a})()));
@@ -88,16 +88,16 @@
88
88
  "__schema": "ParameterSchema",
89
89
  "location": {
90
90
  "filePath": "variants.main.runtime.ts",
91
- "line": 33,
92
- "character": 15
91
+ "line": 34,
92
+ "character": 5
93
93
  },
94
94
  "name": "patterns",
95
95
  "type": {
96
96
  "__schema": "TypeRefSchema",
97
97
  "location": {
98
98
  "filePath": "variants.main.runtime.ts",
99
- "line": 33,
100
- "character": 33
99
+ "line": 34,
100
+ "character": 23
101
101
  },
102
102
  "name": "Patterns"
103
103
  },
@@ -108,16 +108,16 @@
108
108
  "__schema": "ParameterSchema",
109
109
  "location": {
110
110
  "filePath": "variants.main.runtime.ts",
111
- "line": 33,
112
- "character": 43
111
+ "line": 35,
112
+ "character": 5
113
113
  },
114
114
  "name": "configAspect",
115
115
  "type": {
116
116
  "__schema": "TypeRefSchema",
117
117
  "location": {
118
118
  "filePath": "variants.main.runtime.ts",
119
- "line": 33,
120
- "character": 65
119
+ "line": 35,
120
+ "character": 27
121
121
  },
122
122
  "name": "ConfigMain",
123
123
  "componentId": {
@@ -144,7 +144,7 @@
144
144
  "__schema": "FunctionLikeSchema",
145
145
  "location": {
146
146
  "filePath": "variants.main.runtime.ts",
147
- "line": 45,
147
+ "line": 48,
148
148
  "character": 3
149
149
  },
150
150
  "signature": "(method) VariantsMain.raw(): Patterns",
@@ -154,7 +154,7 @@
154
154
  "__schema": "TypeRefSchema",
155
155
  "location": {
156
156
  "filePath": "variants.main.runtime.ts",
157
- "line": 45,
157
+ "line": 48,
158
158
  "character": 3
159
159
  },
160
160
  "name": "Patterns"
@@ -165,14 +165,14 @@
165
165
  "__schema": "FunctionLikeSchema",
166
166
  "location": {
167
167
  "filePath": "variants.main.runtime.ts",
168
- "line": 53,
168
+ "line": 56,
169
169
  "character": 3
170
170
  },
171
171
  "doc": {
172
172
  "__schema": "DocSchema",
173
173
  "location": {
174
174
  "filePath": "variants.main.runtime.ts",
175
- "line": 49,
175
+ "line": 52,
176
176
  "character": 3
177
177
  },
178
178
  "raw": "/**\n * Gets the config for specific component after merge all matching patterns of the component dir and id in the variants section\n * @param rootDir\n */",
@@ -182,7 +182,7 @@
182
182
  "__schema": "PropertyLikeTagSchema",
183
183
  "location": {
184
184
  "filePath": "variants.main.runtime.ts",
185
- "line": 51,
185
+ "line": 54,
186
186
  "character": 6
187
187
  },
188
188
  "name": "rootDir",
@@ -197,7 +197,7 @@
197
197
  "__schema": "ParameterSchema",
198
198
  "location": {
199
199
  "filePath": "variants.main.runtime.ts",
200
- "line": 53,
200
+ "line": 56,
201
201
  "character": 20
202
202
  },
203
203
  "name": "rootDir",
@@ -205,7 +205,7 @@
205
205
  "__schema": "TypeRefSchema",
206
206
  "location": {
207
207
  "filePath": "variants.main.runtime.ts",
208
- "line": 53,
208
+ "line": 56,
209
209
  "character": 29
210
210
  },
211
211
  "name": "PathLinuxRelative",
@@ -222,7 +222,7 @@
222
222
  "__schema": "ParameterSchema",
223
223
  "location": {
224
224
  "filePath": "variants.main.runtime.ts",
225
- "line": 53,
225
+ "line": 56,
226
226
  "character": 48
227
227
  },
228
228
  "name": "componentName",
@@ -230,7 +230,7 @@
230
230
  "__schema": "KeywordTypeSchema",
231
231
  "location": {
232
232
  "filePath": "variants.main.runtime.ts",
233
- "line": 53,
233
+ "line": 56,
234
234
  "character": 63
235
235
  },
236
236
  "name": "string"
@@ -243,7 +243,7 @@
243
243
  "__schema": "TypeUnionSchema",
244
244
  "location": {
245
245
  "filePath": "variants.main.runtime.ts",
246
- "line": 53,
246
+ "line": 56,
247
247
  "character": 72
248
248
  },
249
249
  "types": [
@@ -251,7 +251,7 @@
251
251
  "__schema": "TypeRefSchema",
252
252
  "location": {
253
253
  "filePath": "variants.main.runtime.ts",
254
- "line": 53,
254
+ "line": 56,
255
255
  "character": 72
256
256
  },
257
257
  "name": "VariantsComponentConfig",
@@ -261,7 +261,7 @@
261
261
  "__schema": "KeywordTypeSchema",
262
262
  "location": {
263
263
  "filePath": "variants.main.runtime.ts",
264
- "line": 53,
264
+ "line": 56,
265
265
  "character": 98
266
266
  },
267
267
  "name": "undefined"
@@ -274,14 +274,14 @@
274
274
  "__schema": "FunctionLikeSchema",
275
275
  "location": {
276
276
  "filePath": "variants.main.runtime.ts",
277
- "line": 101,
277
+ "line": 104,
278
278
  "character": 3
279
279
  },
280
280
  "doc": {
281
281
  "__schema": "DocSchema",
282
282
  "location": {
283
283
  "filePath": "variants.main.runtime.ts",
284
- "line": 94,
284
+ "line": 97,
285
285
  "character": 3
286
286
  },
287
287
  "raw": "/**\n * Updates the specified extension object of the specified variant.\n * @param {string} variant - The variant pattern.\n * @param {string} extensionId - The extension ID.\n * @param {Object} extensionConfig - The extension configuration.\n * @param {boolean} opts.overrideExisting - When true, any existing entries are overriden.\n */",
@@ -291,7 +291,7 @@
291
291
  "__schema": "PropertyLikeTagSchema",
292
292
  "location": {
293
293
  "filePath": "variants.main.runtime.ts",
294
- "line": 96,
294
+ "line": 99,
295
295
  "character": 6
296
296
  },
297
297
  "name": "variant",
@@ -301,7 +301,7 @@
301
301
  "__schema": "KeywordTypeSchema",
302
302
  "location": {
303
303
  "filePath": "variants.main.runtime.ts",
304
- "line": 96,
304
+ "line": 99,
305
305
  "character": 14
306
306
  },
307
307
  "name": "string"
@@ -311,7 +311,7 @@
311
311
  "__schema": "PropertyLikeTagSchema",
312
312
  "location": {
313
313
  "filePath": "variants.main.runtime.ts",
314
- "line": 97,
314
+ "line": 100,
315
315
  "character": 6
316
316
  },
317
317
  "name": "extensionId",
@@ -321,7 +321,7 @@
321
321
  "__schema": "KeywordTypeSchema",
322
322
  "location": {
323
323
  "filePath": "variants.main.runtime.ts",
324
- "line": 97,
324
+ "line": 100,
325
325
  "character": 14
326
326
  },
327
327
  "name": "string"
@@ -331,7 +331,7 @@
331
331
  "__schema": "PropertyLikeTagSchema",
332
332
  "location": {
333
333
  "filePath": "variants.main.runtime.ts",
334
- "line": 98,
334
+ "line": 101,
335
335
  "character": 6
336
336
  },
337
337
  "name": "extensionConfig",
@@ -341,7 +341,7 @@
341
341
  "__schema": "TypeRefSchema",
342
342
  "location": {
343
343
  "filePath": "variants.main.runtime.ts",
344
- "line": 98,
344
+ "line": 101,
345
345
  "character": 14
346
346
  },
347
347
  "name": "Object"
@@ -351,7 +351,7 @@
351
351
  "__schema": "PropertyLikeTagSchema",
352
352
  "location": {
353
353
  "filePath": "variants.main.runtime.ts",
354
- "line": 99,
354
+ "line": 102,
355
355
  "character": 6
356
356
  },
357
357
  "name": "opts.overrideExisting",
@@ -361,7 +361,7 @@
361
361
  "__schema": "KeywordTypeSchema",
362
362
  "location": {
363
363
  "filePath": "variants.main.runtime.ts",
364
- "line": 99,
364
+ "line": 102,
365
365
  "character": 14
366
366
  },
367
367
  "name": "boolean"
@@ -376,7 +376,7 @@
376
376
  "__schema": "ParameterSchema",
377
377
  "location": {
378
378
  "filePath": "variants.main.runtime.ts",
379
- "line": 101,
379
+ "line": 104,
380
380
  "character": 16
381
381
  },
382
382
  "name": "variant",
@@ -384,7 +384,7 @@
384
384
  "__schema": "KeywordTypeSchema",
385
385
  "location": {
386
386
  "filePath": "variants.main.runtime.ts",
387
- "line": 101,
387
+ "line": 104,
388
388
  "character": 25
389
389
  },
390
390
  "name": "string"
@@ -396,7 +396,7 @@
396
396
  "__schema": "ParameterSchema",
397
397
  "location": {
398
398
  "filePath": "variants.main.runtime.ts",
399
- "line": 101,
399
+ "line": 104,
400
400
  "character": 33
401
401
  },
402
402
  "name": "extensionId",
@@ -404,7 +404,7 @@
404
404
  "__schema": "KeywordTypeSchema",
405
405
  "location": {
406
406
  "filePath": "variants.main.runtime.ts",
407
- "line": 101,
407
+ "line": 104,
408
408
  "character": 46
409
409
  },
410
410
  "name": "string"
@@ -416,7 +416,7 @@
416
416
  "__schema": "ParameterSchema",
417
417
  "location": {
418
418
  "filePath": "variants.main.runtime.ts",
419
- "line": 101,
419
+ "line": 104,
420
420
  "character": 54
421
421
  },
422
422
  "name": "extensionConfig",
@@ -424,7 +424,7 @@
424
424
  "__schema": "KeywordTypeSchema",
425
425
  "location": {
426
426
  "filePath": "variants.main.runtime.ts",
427
- "line": 101,
427
+ "line": 104,
428
428
  "character": 71
429
429
  },
430
430
  "name": "any"
@@ -436,7 +436,7 @@
436
436
  "__schema": "ParameterSchema",
437
437
  "location": {
438
438
  "filePath": "variants.main.runtime.ts",
439
- "line": 101,
439
+ "line": 104,
440
440
  "character": 76
441
441
  },
442
442
  "name": "opts",
@@ -444,7 +444,7 @@
444
444
  "__schema": "TypeLiteralSchema",
445
445
  "location": {
446
446
  "filePath": "variants.main.runtime.ts",
447
- "line": 101,
447
+ "line": 104,
448
448
  "character": 83
449
449
  },
450
450
  "members": [
@@ -452,7 +452,7 @@
452
452
  "__schema": "VariableLikeSchema",
453
453
  "location": {
454
454
  "filePath": "variants.main.runtime.ts",
455
- "line": 101,
455
+ "line": 104,
456
456
  "character": 85
457
457
  },
458
458
  "signature": "(property) overrideExisting?: boolean | undefined",
@@ -461,7 +461,7 @@
461
461
  "__schema": "KeywordTypeSchema",
462
462
  "location": {
463
463
  "filePath": "variants.main.runtime.ts",
464
- "line": 101,
464
+ "line": 104,
465
465
  "character": 104
466
466
  },
467
467
  "name": "boolean"
@@ -478,7 +478,7 @@
478
478
  "__schema": "InferenceTypeSchema",
479
479
  "location": {
480
480
  "filePath": "variants.main.runtime.ts",
481
- "line": 101,
481
+ "line": 104,
482
482
  "character": 3
483
483
  },
484
484
  "type": "void"
@@ -489,7 +489,7 @@
489
489
  "__schema": "FunctionLikeSchema",
490
490
  "location": {
491
491
  "filePath": "variants.main.runtime.ts",
492
- "line": 111,
492
+ "line": 114,
493
493
  "character": 3
494
494
  },
495
495
  "signature": "(method) VariantsMain.provider([configAspect]: [ConfigMain], config: any): Promise<VariantsMain>",
@@ -499,7 +499,7 @@
499
499
  "__schema": "ParameterSchema",
500
500
  "location": {
501
501
  "filePath": "variants.main.runtime.ts",
502
- "line": 111,
502
+ "line": 114,
503
503
  "character": 25
504
504
  },
505
505
  "name": "[ configAspect ]",
@@ -507,7 +507,7 @@
507
507
  "__schema": "TupleTypeSchema",
508
508
  "location": {
509
509
  "filePath": "variants.main.runtime.ts",
510
- "line": 111,
510
+ "line": 114,
511
511
  "character": 41
512
512
  },
513
513
  "elements": [
@@ -515,7 +515,7 @@
515
515
  "__schema": "TypeRefSchema",
516
516
  "location": {
517
517
  "filePath": "variants.main.runtime.ts",
518
- "line": 111,
518
+ "line": 114,
519
519
  "character": 42
520
520
  },
521
521
  "name": "ConfigMain",
@@ -533,7 +533,7 @@
533
533
  "__schema": "ParameterSchema",
534
534
  "location": {
535
535
  "filePath": "variants.main.runtime.ts",
536
- "line": 111,
536
+ "line": 114,
537
537
  "character": 55
538
538
  },
539
539
  "name": "config",
@@ -541,7 +541,7 @@
541
541
  "__schema": "InferenceTypeSchema",
542
542
  "location": {
543
543
  "filePath": "variants.main.runtime.ts",
544
- "line": 111,
544
+ "line": 114,
545
545
  "character": 55
546
546
  },
547
547
  "type": "any"
@@ -554,7 +554,7 @@
554
554
  "__schema": "InferenceTypeSchema",
555
555
  "location": {
556
556
  "filePath": "variants.main.runtime.ts",
557
- "line": 111,
557
+ "line": 114,
558
558
  "character": 3
559
559
  },
560
560
  "type": "Promise<VariantsMain>"
@@ -1009,16 +1009,16 @@
1009
1009
  "__schema": "ParameterSchema",
1010
1010
  "location": {
1011
1011
  "filePath": "variants.main.runtime.ts",
1012
- "line": 33,
1013
- "character": 15
1012
+ "line": 34,
1013
+ "character": 5
1014
1014
  },
1015
1015
  "name": "patterns",
1016
1016
  "type": {
1017
1017
  "__schema": "TypeRefSchema",
1018
1018
  "location": {
1019
1019
  "filePath": "variants.main.runtime.ts",
1020
- "line": 33,
1021
- "character": 33
1020
+ "line": 34,
1021
+ "character": 23
1022
1022
  },
1023
1023
  "name": "Patterns"
1024
1024
  },
@@ -1029,16 +1029,16 @@
1029
1029
  "__schema": "ParameterSchema",
1030
1030
  "location": {
1031
1031
  "filePath": "variants.main.runtime.ts",
1032
- "line": 33,
1033
- "character": 43
1032
+ "line": 35,
1033
+ "character": 5
1034
1034
  },
1035
1035
  "name": "configAspect",
1036
1036
  "type": {
1037
1037
  "__schema": "TypeRefSchema",
1038
1038
  "location": {
1039
1039
  "filePath": "variants.main.runtime.ts",
1040
- "line": 33,
1041
- "character": 65
1040
+ "line": 35,
1041
+ "character": 27
1042
1042
  },
1043
1043
  "name": "ConfigMain",
1044
1044
  "componentId": {
@@ -1065,7 +1065,7 @@
1065
1065
  "__schema": "FunctionLikeSchema",
1066
1066
  "location": {
1067
1067
  "filePath": "variants.main.runtime.ts",
1068
- "line": 45,
1068
+ "line": 48,
1069
1069
  "character": 3
1070
1070
  },
1071
1071
  "signature": "(method) VariantsMain.raw(): Patterns",
@@ -1075,7 +1075,7 @@
1075
1075
  "__schema": "TypeRefSchema",
1076
1076
  "location": {
1077
1077
  "filePath": "variants.main.runtime.ts",
1078
- "line": 45,
1078
+ "line": 48,
1079
1079
  "character": 3
1080
1080
  },
1081
1081
  "name": "Patterns"
@@ -1086,14 +1086,14 @@
1086
1086
  "__schema": "FunctionLikeSchema",
1087
1087
  "location": {
1088
1088
  "filePath": "variants.main.runtime.ts",
1089
- "line": 53,
1089
+ "line": 56,
1090
1090
  "character": 3
1091
1091
  },
1092
1092
  "doc": {
1093
1093
  "__schema": "DocSchema",
1094
1094
  "location": {
1095
1095
  "filePath": "variants.main.runtime.ts",
1096
- "line": 49,
1096
+ "line": 52,
1097
1097
  "character": 3
1098
1098
  },
1099
1099
  "raw": "/**\n * Gets the config for specific component after merge all matching patterns of the component dir and id in the variants section\n * @param rootDir\n */",
@@ -1103,7 +1103,7 @@
1103
1103
  "__schema": "PropertyLikeTagSchema",
1104
1104
  "location": {
1105
1105
  "filePath": "variants.main.runtime.ts",
1106
- "line": 51,
1106
+ "line": 54,
1107
1107
  "character": 6
1108
1108
  },
1109
1109
  "name": "rootDir",
@@ -1118,7 +1118,7 @@
1118
1118
  "__schema": "ParameterSchema",
1119
1119
  "location": {
1120
1120
  "filePath": "variants.main.runtime.ts",
1121
- "line": 53,
1121
+ "line": 56,
1122
1122
  "character": 20
1123
1123
  },
1124
1124
  "name": "rootDir",
@@ -1126,7 +1126,7 @@
1126
1126
  "__schema": "TypeRefSchema",
1127
1127
  "location": {
1128
1128
  "filePath": "variants.main.runtime.ts",
1129
- "line": 53,
1129
+ "line": 56,
1130
1130
  "character": 29
1131
1131
  },
1132
1132
  "name": "PathLinuxRelative",
@@ -1143,7 +1143,7 @@
1143
1143
  "__schema": "ParameterSchema",
1144
1144
  "location": {
1145
1145
  "filePath": "variants.main.runtime.ts",
1146
- "line": 53,
1146
+ "line": 56,
1147
1147
  "character": 48
1148
1148
  },
1149
1149
  "name": "componentName",
@@ -1151,7 +1151,7 @@
1151
1151
  "__schema": "KeywordTypeSchema",
1152
1152
  "location": {
1153
1153
  "filePath": "variants.main.runtime.ts",
1154
- "line": 53,
1154
+ "line": 56,
1155
1155
  "character": 63
1156
1156
  },
1157
1157
  "name": "string"
@@ -1164,7 +1164,7 @@
1164
1164
  "__schema": "TypeUnionSchema",
1165
1165
  "location": {
1166
1166
  "filePath": "variants.main.runtime.ts",
1167
- "line": 53,
1167
+ "line": 56,
1168
1168
  "character": 72
1169
1169
  },
1170
1170
  "types": [
@@ -1172,7 +1172,7 @@
1172
1172
  "__schema": "TypeRefSchema",
1173
1173
  "location": {
1174
1174
  "filePath": "variants.main.runtime.ts",
1175
- "line": 53,
1175
+ "line": 56,
1176
1176
  "character": 72
1177
1177
  },
1178
1178
  "name": "VariantsComponentConfig",
@@ -1182,7 +1182,7 @@
1182
1182
  "__schema": "KeywordTypeSchema",
1183
1183
  "location": {
1184
1184
  "filePath": "variants.main.runtime.ts",
1185
- "line": 53,
1185
+ "line": 56,
1186
1186
  "character": 98
1187
1187
  },
1188
1188
  "name": "undefined"
@@ -1195,14 +1195,14 @@
1195
1195
  "__schema": "FunctionLikeSchema",
1196
1196
  "location": {
1197
1197
  "filePath": "variants.main.runtime.ts",
1198
- "line": 101,
1198
+ "line": 104,
1199
1199
  "character": 3
1200
1200
  },
1201
1201
  "doc": {
1202
1202
  "__schema": "DocSchema",
1203
1203
  "location": {
1204
1204
  "filePath": "variants.main.runtime.ts",
1205
- "line": 94,
1205
+ "line": 97,
1206
1206
  "character": 3
1207
1207
  },
1208
1208
  "raw": "/**\n * Updates the specified extension object of the specified variant.\n * @param {string} variant - The variant pattern.\n * @param {string} extensionId - The extension ID.\n * @param {Object} extensionConfig - The extension configuration.\n * @param {boolean} opts.overrideExisting - When true, any existing entries are overriden.\n */",
@@ -1212,7 +1212,7 @@
1212
1212
  "__schema": "PropertyLikeTagSchema",
1213
1213
  "location": {
1214
1214
  "filePath": "variants.main.runtime.ts",
1215
- "line": 96,
1215
+ "line": 99,
1216
1216
  "character": 6
1217
1217
  },
1218
1218
  "name": "variant",
@@ -1222,7 +1222,7 @@
1222
1222
  "__schema": "KeywordTypeSchema",
1223
1223
  "location": {
1224
1224
  "filePath": "variants.main.runtime.ts",
1225
- "line": 96,
1225
+ "line": 99,
1226
1226
  "character": 14
1227
1227
  },
1228
1228
  "name": "string"
@@ -1232,7 +1232,7 @@
1232
1232
  "__schema": "PropertyLikeTagSchema",
1233
1233
  "location": {
1234
1234
  "filePath": "variants.main.runtime.ts",
1235
- "line": 97,
1235
+ "line": 100,
1236
1236
  "character": 6
1237
1237
  },
1238
1238
  "name": "extensionId",
@@ -1242,7 +1242,7 @@
1242
1242
  "__schema": "KeywordTypeSchema",
1243
1243
  "location": {
1244
1244
  "filePath": "variants.main.runtime.ts",
1245
- "line": 97,
1245
+ "line": 100,
1246
1246
  "character": 14
1247
1247
  },
1248
1248
  "name": "string"
@@ -1252,7 +1252,7 @@
1252
1252
  "__schema": "PropertyLikeTagSchema",
1253
1253
  "location": {
1254
1254
  "filePath": "variants.main.runtime.ts",
1255
- "line": 98,
1255
+ "line": 101,
1256
1256
  "character": 6
1257
1257
  },
1258
1258
  "name": "extensionConfig",
@@ -1262,7 +1262,7 @@
1262
1262
  "__schema": "TypeRefSchema",
1263
1263
  "location": {
1264
1264
  "filePath": "variants.main.runtime.ts",
1265
- "line": 98,
1265
+ "line": 101,
1266
1266
  "character": 14
1267
1267
  },
1268
1268
  "name": "Object"
@@ -1272,7 +1272,7 @@
1272
1272
  "__schema": "PropertyLikeTagSchema",
1273
1273
  "location": {
1274
1274
  "filePath": "variants.main.runtime.ts",
1275
- "line": 99,
1275
+ "line": 102,
1276
1276
  "character": 6
1277
1277
  },
1278
1278
  "name": "opts.overrideExisting",
@@ -1282,7 +1282,7 @@
1282
1282
  "__schema": "KeywordTypeSchema",
1283
1283
  "location": {
1284
1284
  "filePath": "variants.main.runtime.ts",
1285
- "line": 99,
1285
+ "line": 102,
1286
1286
  "character": 14
1287
1287
  },
1288
1288
  "name": "boolean"
@@ -1297,7 +1297,7 @@
1297
1297
  "__schema": "ParameterSchema",
1298
1298
  "location": {
1299
1299
  "filePath": "variants.main.runtime.ts",
1300
- "line": 101,
1300
+ "line": 104,
1301
1301
  "character": 16
1302
1302
  },
1303
1303
  "name": "variant",
@@ -1305,7 +1305,7 @@
1305
1305
  "__schema": "KeywordTypeSchema",
1306
1306
  "location": {
1307
1307
  "filePath": "variants.main.runtime.ts",
1308
- "line": 101,
1308
+ "line": 104,
1309
1309
  "character": 25
1310
1310
  },
1311
1311
  "name": "string"
@@ -1317,7 +1317,7 @@
1317
1317
  "__schema": "ParameterSchema",
1318
1318
  "location": {
1319
1319
  "filePath": "variants.main.runtime.ts",
1320
- "line": 101,
1320
+ "line": 104,
1321
1321
  "character": 33
1322
1322
  },
1323
1323
  "name": "extensionId",
@@ -1325,7 +1325,7 @@
1325
1325
  "__schema": "KeywordTypeSchema",
1326
1326
  "location": {
1327
1327
  "filePath": "variants.main.runtime.ts",
1328
- "line": 101,
1328
+ "line": 104,
1329
1329
  "character": 46
1330
1330
  },
1331
1331
  "name": "string"
@@ -1337,7 +1337,7 @@
1337
1337
  "__schema": "ParameterSchema",
1338
1338
  "location": {
1339
1339
  "filePath": "variants.main.runtime.ts",
1340
- "line": 101,
1340
+ "line": 104,
1341
1341
  "character": 54
1342
1342
  },
1343
1343
  "name": "extensionConfig",
@@ -1345,7 +1345,7 @@
1345
1345
  "__schema": "KeywordTypeSchema",
1346
1346
  "location": {
1347
1347
  "filePath": "variants.main.runtime.ts",
1348
- "line": 101,
1348
+ "line": 104,
1349
1349
  "character": 71
1350
1350
  },
1351
1351
  "name": "any"
@@ -1357,7 +1357,7 @@
1357
1357
  "__schema": "ParameterSchema",
1358
1358
  "location": {
1359
1359
  "filePath": "variants.main.runtime.ts",
1360
- "line": 101,
1360
+ "line": 104,
1361
1361
  "character": 76
1362
1362
  },
1363
1363
  "name": "opts",
@@ -1365,7 +1365,7 @@
1365
1365
  "__schema": "TypeLiteralSchema",
1366
1366
  "location": {
1367
1367
  "filePath": "variants.main.runtime.ts",
1368
- "line": 101,
1368
+ "line": 104,
1369
1369
  "character": 83
1370
1370
  },
1371
1371
  "members": [
@@ -1373,7 +1373,7 @@
1373
1373
  "__schema": "VariableLikeSchema",
1374
1374
  "location": {
1375
1375
  "filePath": "variants.main.runtime.ts",
1376
- "line": 101,
1376
+ "line": 104,
1377
1377
  "character": 85
1378
1378
  },
1379
1379
  "signature": "(property) overrideExisting?: boolean | undefined",
@@ -1382,7 +1382,7 @@
1382
1382
  "__schema": "KeywordTypeSchema",
1383
1383
  "location": {
1384
1384
  "filePath": "variants.main.runtime.ts",
1385
- "line": 101,
1385
+ "line": 104,
1386
1386
  "character": 104
1387
1387
  },
1388
1388
  "name": "boolean"
@@ -1399,7 +1399,7 @@
1399
1399
  "__schema": "InferenceTypeSchema",
1400
1400
  "location": {
1401
1401
  "filePath": "variants.main.runtime.ts",
1402
- "line": 101,
1402
+ "line": 104,
1403
1403
  "character": 3
1404
1404
  },
1405
1405
  "type": "void"
@@ -1410,7 +1410,7 @@
1410
1410
  "__schema": "FunctionLikeSchema",
1411
1411
  "location": {
1412
1412
  "filePath": "variants.main.runtime.ts",
1413
- "line": 111,
1413
+ "line": 114,
1414
1414
  "character": 3
1415
1415
  },
1416
1416
  "signature": "(method) VariantsMain.provider([configAspect]: [ConfigMain], config: any): Promise<VariantsMain>",
@@ -1420,7 +1420,7 @@
1420
1420
  "__schema": "ParameterSchema",
1421
1421
  "location": {
1422
1422
  "filePath": "variants.main.runtime.ts",
1423
- "line": 111,
1423
+ "line": 114,
1424
1424
  "character": 25
1425
1425
  },
1426
1426
  "name": "[ configAspect ]",
@@ -1428,7 +1428,7 @@
1428
1428
  "__schema": "TupleTypeSchema",
1429
1429
  "location": {
1430
1430
  "filePath": "variants.main.runtime.ts",
1431
- "line": 111,
1431
+ "line": 114,
1432
1432
  "character": 41
1433
1433
  },
1434
1434
  "elements": [
@@ -1436,7 +1436,7 @@
1436
1436
  "__schema": "TypeRefSchema",
1437
1437
  "location": {
1438
1438
  "filePath": "variants.main.runtime.ts",
1439
- "line": 111,
1439
+ "line": 114,
1440
1440
  "character": 42
1441
1441
  },
1442
1442
  "name": "ConfigMain",
@@ -1454,7 +1454,7 @@
1454
1454
  "__schema": "ParameterSchema",
1455
1455
  "location": {
1456
1456
  "filePath": "variants.main.runtime.ts",
1457
- "line": 111,
1457
+ "line": 114,
1458
1458
  "character": 55
1459
1459
  },
1460
1460
  "name": "config",
@@ -1462,7 +1462,7 @@
1462
1462
  "__schema": "InferenceTypeSchema",
1463
1463
  "location": {
1464
1464
  "filePath": "variants.main.runtime.ts",
1465
- "line": 111,
1465
+ "line": 114,
1466
1466
  "character": 55
1467
1467
  },
1468
1468
  "type": "any"
@@ -1475,7 +1475,7 @@
1475
1475
  "__schema": "InferenceTypeSchema",
1476
1476
  "location": {
1477
1477
  "filePath": "variants.main.runtime.ts",
1478
- "line": 111,
1478
+ "line": 114,
1479
1479
  "character": 3
1480
1480
  },
1481
1481
  "type": "Promise<VariantsMain>"
@@ -1527,7 +1527,7 @@
1527
1527
  "__schema": "FunctionLikeSchema",
1528
1528
  "location": {
1529
1529
  "filePath": "variants.main.runtime.ts",
1530
- "line": 116,
1530
+ "line": 119,
1531
1531
  "character": 1
1532
1532
  },
1533
1533
  "signature": "function getExtensionFromPatternRawConfig(config: Record<string, any>): ExtensionDataList",
@@ -1537,7 +1537,7 @@
1537
1537
  "__schema": "ParameterSchema",
1538
1538
  "location": {
1539
1539
  "filePath": "variants.main.runtime.ts",
1540
- "line": 116,
1540
+ "line": 119,
1541
1541
  "character": 43
1542
1542
  },
1543
1543
  "name": "config",
@@ -1545,7 +1545,7 @@
1545
1545
  "__schema": "TypeRefSchema",
1546
1546
  "location": {
1547
1547
  "filePath": "variants.main.runtime.ts",
1548
- "line": 116,
1548
+ "line": 119,
1549
1549
  "character": 51
1550
1550
  },
1551
1551
  "name": "Record",
@@ -1554,7 +1554,7 @@
1554
1554
  "__schema": "KeywordTypeSchema",
1555
1555
  "location": {
1556
1556
  "filePath": "variants.main.runtime.ts",
1557
- "line": 116,
1557
+ "line": 119,
1558
1558
  "character": 58
1559
1559
  },
1560
1560
  "name": "string"
@@ -1563,7 +1563,7 @@
1563
1563
  "__schema": "KeywordTypeSchema",
1564
1564
  "location": {
1565
1565
  "filePath": "variants.main.runtime.ts",
1566
- "line": 116,
1566
+ "line": 119,
1567
1567
  "character": 66
1568
1568
  },
1569
1569
  "name": "any"
@@ -1578,7 +1578,7 @@
1578
1578
  "__schema": "TypeRefSchema",
1579
1579
  "location": {
1580
1580
  "filePath": "variants.main.runtime.ts",
1581
- "line": 116,
1581
+ "line": 119,
1582
1582
  "character": 1
1583
1583
  },
1584
1584
  "name": "ExtensionDataList",
@@ -1590,7 +1590,7 @@
1590
1590
  "__schema": "UnImplementedSchema",
1591
1591
  "location": {
1592
1592
  "filePath": "variants.main.runtime.ts",
1593
- "line": 122,
1593
+ "line": 125,
1594
1594
  "character": 1
1595
1595
  },
1596
1596
  "name": "VariantsAspect.addRuntime(VariantsMain);",
@@ -1639,7 +1639,7 @@
1639
1639
  "componentId": {
1640
1640
  "scope": "teambit.workspace",
1641
1641
  "name": "variants",
1642
- "version": "0.0.1268"
1642
+ "version": "0.0.1270"
1643
1643
  },
1644
1644
  "taggedModuleExports": []
1645
1645
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_variants@0.0.1268/dist/variants.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_variants@0.0.1268/dist/variants.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_variants@0.0.1270/dist/variants.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_variants@0.0.1270/dist/variants.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_config","_extensionData","_commentJson","_lodash","_workspaceModules","_legacyBitId","_variants","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","INTERNAL_FIELDS","VariantsMain","constructor","patterns","configAspect","validateConfig","forEach","patternConfig","pattern","defaultScope","isValidScopeName","InvalidScopeName","undefined","raw","byRootDirAndName","rootDir","componentName","matches","match","isMatchPattern","excluded","push","config","specificity","maxSpecificity","sortedMatches","sortMatchesBySpecificity","propagate","extensionsToMerge","getExtensionFromPatternRawConfig","mergedExtensions","ExtensionDataList","mergeConfigs","result","extensions","length","setExtension","variant","extensionId","extensionConfig","opts","newVariant","assign","VariantsAspect","id","overrideExisting","ignoreVersion","provider","exports","MainRuntime","ConfigAspect","rawExtensions","omit","fromConfigObject","addRuntime"],"sources":["variants.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { ConfigAspect } from '@teambit/config';\nimport type { ConfigMain } from '@teambit/config';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { PathLinuxRelative } from '@teambit/toolbox.path.path';\nimport { assign } from 'comment-json';\nimport { omit, forEach } from 'lodash';\nimport {\n MatchedPatternWithConfig,\n isMatchPattern,\n sortMatchesBySpecificity,\n} from '@teambit/workspace.modules.match-pattern';\nimport { InvalidScopeName, isValidScopeName } from '@teambit/legacy-bit-id';\nimport { VariantsAspect } from './variants.aspect';\n\nexport type Patterns = { [pattern: string]: Record<string, any> };\n\nexport type VariantsComponentConfig = {\n propagate: boolean;\n exclude?: string[];\n defaultScope?: string;\n extensions: ExtensionDataList;\n maxSpecificity: number;\n sortedMatches: MatchedPatternWithConfig[];\n};\n\nconst INTERNAL_FIELDS = ['propagate', 'exclude', 'defaultScope'];\n\nexport class VariantsMain {\n static runtime = MainRuntime;\n static dependencies = [ConfigAspect];\n\n constructor(private patterns: Patterns, private configAspect: ConfigMain) {\n this.validateConfig();\n }\n\n private validateConfig() {\n forEach(this.patterns, (patternConfig: Record<string, any>, pattern: string) => {\n if (patternConfig.defaultScope && !isValidScopeName(patternConfig.defaultScope)) {\n throw new InvalidScopeName(patternConfig.defaultScope, undefined, pattern);\n }\n });\n }\n\n raw(): Patterns {\n return this.patterns;\n }\n\n /**\n * Gets the config for specific component after merge all matching patterns of the component dir and id in the variants section\n * @param rootDir\n */\n byRootDirAndName(rootDir: PathLinuxRelative, componentName: string): VariantsComponentConfig | undefined {\n const matches: MatchedPatternWithConfig[] = [];\n forEach(this.patterns, (patternConfig, pattern) => {\n const match = isMatchPattern(rootDir, componentName, pattern);\n\n // Ignore matches with exclude matches\n if (match.match && !match.excluded) {\n matches.push({\n config: patternConfig,\n specificity: match.maxSpecificity,\n pattern: match.pattern,\n });\n }\n });\n\n const sortedMatches: MatchedPatternWithConfig[] = sortMatchesBySpecificity(matches);\n\n let defaultScope;\n let propagate = true;\n const extensionsToMerge: ExtensionDataList[] = [];\n sortedMatches.forEach((match) => {\n defaultScope = defaultScope || match.config.defaultScope;\n if (propagate) {\n extensionsToMerge.push(getExtensionFromPatternRawConfig(match.config));\n }\n if (match.config.propagate === false) {\n propagate = false;\n }\n });\n\n const mergedExtensions = ExtensionDataList.mergeConfigs(extensionsToMerge);\n const result = {\n defaultScope,\n extensions: mergedExtensions,\n propagate,\n maxSpecificity: sortedMatches.length ? sortedMatches[0].specificity : -1,\n sortedMatches,\n };\n return result;\n }\n\n /**\n * Updates the specified extension object of the specified variant.\n * @param {string} variant - The variant pattern.\n * @param {string} extensionId - The extension ID.\n * @param {Object} extensionConfig - The extension configuration.\n * @param {boolean} opts.overrideExisting - When true, any existing entries are overriden.\n */\n setExtension(variant: string, extensionId: string, extensionConfig: any, opts?: { overrideExisting?: boolean }) {\n const newVariant = this.patterns[variant] ?? {};\n assign(newVariant, { [extensionId]: extensionConfig });\n assign(this.patterns, { [variant]: newVariant });\n this.configAspect.setExtension(VariantsAspect.id, this.patterns, {\n overrideExisting: opts?.overrideExisting === true,\n ignoreVersion: true,\n });\n }\n\n static async provider([configAspect]: [ConfigMain], config) {\n return new VariantsMain(config, configAspect);\n }\n}\n\nfunction getExtensionFromPatternRawConfig(config: Record<string, any>) {\n const rawExtensions = omit(config, INTERNAL_FIELDS);\n const extensions = ExtensionDataList.fromConfigObject(rawExtensions);\n return extensions;\n}\n\nVariantsAspect.addRuntime(VariantsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;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K,gBAAgB,KAAK,IAAI;MACjDC,aAAa,EAAE;IACjB,CAAC,CAAC;EACJ;EAEA,aAAaC,QAAQA,CAAC,CAAC3C,YAAY,CAAe,EAAEkB,MAAM,EAAE;IAC1D,OAAO,IAAIrB,YAAY,CAACqB,MAAM,EAAElB,YAAY,CAAC;EAC/C;AACF;AAAC4C,OAAA,CAAA/C,YAAA,GAAAA,YAAA;AAAApB,eAAA,CArFYoB,YAAY,aACNgD,kBAAW;AAAApE,eAAA,CADjBoB,YAAY,kBAED,CAACiD,sBAAY,CAAC;AAqFtC,SAASrB,gCAAgCA,CAACP,MAA2B,EAAE;EACrE,MAAM6B,aAAa,GAAG,IAAAC,cAAI,EAAC9B,MAAM,EAAEtB,eAAe,CAAC;EACnD,MAAMkC,UAAU,GAAGH,kCAAiB,CAACsB,gBAAgB,CAACF,aAAa,CAAC;EACpE,OAAOjB,UAAU;AACnB;AAEAS,0BAAc,CAACW,UAAU,CAACrD,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_config","_extensionData","_commentJson","_lodash","_workspaceModules","_legacyBitId","_variants","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","INTERNAL_FIELDS","VariantsMain","constructor","patterns","configAspect","validateConfig","forEach","patternConfig","pattern","defaultScope","isValidScopeName","InvalidScopeName","undefined","raw","byRootDirAndName","rootDir","componentName","matches","match","isMatchPattern","excluded","push","config","specificity","maxSpecificity","sortedMatches","sortMatchesBySpecificity","propagate","extensionsToMerge","getExtensionFromPatternRawConfig","mergedExtensions","ExtensionDataList","mergeConfigs","result","extensions","length","setExtension","variant","extensionId","extensionConfig","opts","newVariant","assign","VariantsAspect","id","overrideExisting","ignoreVersion","provider","exports","MainRuntime","ConfigAspect","rawExtensions","omit","fromConfigObject","addRuntime"],"sources":["variants.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { ConfigAspect } from '@teambit/config';\nimport type { ConfigMain } from '@teambit/config';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { PathLinuxRelative } from '@teambit/toolbox.path.path';\nimport { assign } from 'comment-json';\nimport { omit, forEach } from 'lodash';\nimport {\n MatchedPatternWithConfig,\n isMatchPattern,\n sortMatchesBySpecificity,\n} from '@teambit/workspace.modules.match-pattern';\nimport { InvalidScopeName, isValidScopeName } from '@teambit/legacy-bit-id';\nimport { VariantsAspect } from './variants.aspect';\n\nexport type Patterns = { [pattern: string]: Record<string, any> };\n\nexport type VariantsComponentConfig = {\n propagate: boolean;\n exclude?: string[];\n defaultScope?: string;\n extensions: ExtensionDataList;\n maxSpecificity: number;\n sortedMatches: MatchedPatternWithConfig[];\n};\n\nconst INTERNAL_FIELDS = ['propagate', 'exclude', 'defaultScope'];\n\nexport class VariantsMain {\n static runtime = MainRuntime;\n static dependencies = [ConfigAspect];\n\n constructor(\n private patterns: Patterns,\n private configAspect: ConfigMain\n ) {\n this.validateConfig();\n }\n\n private validateConfig() {\n forEach(this.patterns, (patternConfig: Record<string, any>, pattern: string) => {\n if (patternConfig.defaultScope && !isValidScopeName(patternConfig.defaultScope)) {\n throw new InvalidScopeName(patternConfig.defaultScope, undefined, pattern);\n }\n });\n }\n\n raw(): Patterns {\n return this.patterns;\n }\n\n /**\n * Gets the config for specific component after merge all matching patterns of the component dir and id in the variants section\n * @param rootDir\n */\n byRootDirAndName(rootDir: PathLinuxRelative, componentName: string): VariantsComponentConfig | undefined {\n const matches: MatchedPatternWithConfig[] = [];\n forEach(this.patterns, (patternConfig, pattern) => {\n const match = isMatchPattern(rootDir, componentName, pattern);\n\n // Ignore matches with exclude matches\n if (match.match && !match.excluded) {\n matches.push({\n config: patternConfig,\n specificity: match.maxSpecificity,\n pattern: match.pattern,\n });\n }\n });\n\n const sortedMatches: MatchedPatternWithConfig[] = sortMatchesBySpecificity(matches);\n\n let defaultScope;\n let propagate = true;\n const extensionsToMerge: ExtensionDataList[] = [];\n sortedMatches.forEach((match) => {\n defaultScope = defaultScope || match.config.defaultScope;\n if (propagate) {\n extensionsToMerge.push(getExtensionFromPatternRawConfig(match.config));\n }\n if (match.config.propagate === false) {\n propagate = false;\n }\n });\n\n const mergedExtensions = ExtensionDataList.mergeConfigs(extensionsToMerge);\n const result = {\n defaultScope,\n extensions: mergedExtensions,\n propagate,\n maxSpecificity: sortedMatches.length ? sortedMatches[0].specificity : -1,\n sortedMatches,\n };\n return result;\n }\n\n /**\n * Updates the specified extension object of the specified variant.\n * @param {string} variant - The variant pattern.\n * @param {string} extensionId - The extension ID.\n * @param {Object} extensionConfig - The extension configuration.\n * @param {boolean} opts.overrideExisting - When true, any existing entries are overriden.\n */\n setExtension(variant: string, extensionId: string, extensionConfig: any, opts?: { overrideExisting?: boolean }) {\n const newVariant = this.patterns[variant] ?? {};\n assign(newVariant, { [extensionId]: extensionConfig });\n assign(this.patterns, { [variant]: newVariant });\n this.configAspect.setExtension(VariantsAspect.id, this.patterns, {\n overrideExisting: opts?.overrideExisting === true,\n ignoreVersion: true,\n });\n }\n\n static async provider([configAspect]: [ConfigMain], config) {\n return new VariantsMain(config, configAspect);\n }\n}\n\nfunction getExtensionFromPatternRawConfig(config: Record<string, any>) {\n const rawExtensions = omit(config, INTERNAL_FIELDS);\n const extensions = ExtensionDataList.fromConfigObject(rawExtensions);\n return extensions;\n}\n\nVariantsAspect.addRuntime(VariantsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,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AACkC,OAAO,GAAGI;IAAW,CAAC,CAAC;IAChD,IAAI,CAACrC,YAAY,CAACgC,YAAY,CAACO,0BAAc,CAACC,EAAE,EAAE,IAAI,CAACzC,QAAQ,EAAE;MAC/D0C,gBAAgB,EAAEL,IAAI,EAAEK,gBAAgB,KAAK,IAAI;MACjDC,aAAa,EAAE;IACjB,CAAC,CAAC;EACJ;EAEA,aAAaC,QAAQA,CAAC,CAAC3C,YAAY,CAAe,EAAEkB,MAAM,EAAE;IAC1D,OAAO,IAAIrB,YAAY,CAACqB,MAAM,EAAElB,YAAY,CAAC;EAC/C;AACF;AAAC4C,OAAA,CAAA/C,YAAA,GAAAA,YAAA;AAAApB,eAAA,CAxFYoB,YAAY,aACNgD,kBAAW;AAAApE,eAAA,CADjBoB,YAAY,kBAED,CAACiD,sBAAY,CAAC;AAwFtC,SAASrB,gCAAgCA,CAACP,MAA2B,EAAE;EACrE,MAAM6B,aAAa,GAAG,IAAAC,cAAI,EAAC9B,MAAM,EAAEtB,eAAe,CAAC;EACnD,MAAMkC,UAAU,GAAGH,kCAAiB,CAACsB,gBAAgB,CAACF,aAAa,CAAC;EACpE,OAAOjB,UAAU;AACnB;AAEAS,0BAAc,CAACW,UAAU,CAACrD,YAAY,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@teambit/variants",
3
- "version": "0.0.1268",
3
+ "version": "0.0.1270",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/variants",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "variants",
9
- "version": "0.0.1268"
9
+ "version": "0.0.1270"
10
10
  },
11
11
  "dependencies": {
12
12
  "comment-json": "3.0.3",
13
13
  "lodash": "4.17.21",
14
14
  "@teambit/harmony": "0.4.6",
15
15
  "@teambit/legacy-bit-id": "1.1.1",
16
- "@teambit/cli": "0.0.1001",
17
- "@teambit/config": "0.0.1175",
16
+ "@teambit/cli": "0.0.1003",
17
+ "@teambit/config": "0.0.1177",
18
18
  "@teambit/toolbox.path.path": "0.0.4",
19
19
  "@teambit/workspace.modules.match-pattern": "0.0.505"
20
20
  },