@teambit/dev-files 1.0.411 → 1.0.413

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="3" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/dev-files@1.0.411" tests="3" failures="0" errors="0" skipped="0">
4
- <testcase classname="dist/dev-files.spec.js" name="get all dev files of the docs aspect" time="0.001"/>
5
- <testcase classname="dist/dev-files.spec.js" name="should get undefined as there are no files for aspect id" time="0.001"/>
3
+ <testsuite name="teambit.component/dev-files@1.0.413" tests="3" failures="0" errors="0" skipped="0">
4
+ <testcase classname="dist/dev-files.spec.js" name="get all dev files of the docs aspect"/>
5
+ <testcase classname="dist/dev-files.spec.js" name="should get undefined as there are no files for aspect id"/>
6
6
  <testcase classname="dist/dev-files.spec.js" name="should list all dev files"/>
7
7
  </testsuite>
8
8
  </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.component/dev-files-preview"]=n():e["teambit.component/dev-files-preview"]=n()}(self,(()=>(()=>{"use strict";var e={13793:(e,n,t)=>{var o={id:"teambit.component/content/dev-files@1.95.9",homepage:"https://bit.dev/teambit/component/content/dev-files",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,s(t(41594));var r=t(5016),a=t(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function p(e,n){if(null==e)return{};var t,o,r=l(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function l(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}s.__bit_component=o,d.__bit_component=o,p.__bit_component=o,l.__bit_component=o;var c={},m="wrapper";function u(e){var n=e.components,t=p(e,i);return(0,r.mdx)(m,d({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Dev Files"),(0,r.mdx)("p",null,"Dev files are component files used for development and not for production. Dev files are determined as such by the Dev Files Aspect."),(0,r.mdx)("p",null,"Categorizing files as dev files is especially useful in dependency resolution, as dependencies can be inferred to be of type ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependencies")," by looking at the type of files that use them (if 'package-a' is only used by the component's dev files, then it is a dev dependency of that component)."),(0,r.mdx)("p",null,"For example, the ",(0,r.mdx)("inlineCode",{parentName:"p"},"ui/card")," component has the following file structure:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"└── card\n ├── card.composition.tsx\n ├── card.docs.mdx\n ├── card.spec.tsx\n ├── card.tsx\n └── index.ts\n")),(0,r.mdx)("p",null,"To examine it:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"$ bit show ui/card\n\n┌───────────────────┬──────────────────────────────────────────────────────────┐\n│ id │ company.scope/ui/card │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ ... │ │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ files │ card.composition.tsx │\n│ │ card.docs.mdx │\n│ │ card.spec.tsx │\n│ │ card.stories.tsx │\n│ │ card.tsx │\n│ │ index.ts │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dev files │ card.spec.tsx (teambit.defender/tester) │\n│ │ card.composition.tsx (teambit.compositions/compositions) │\n│ │ card.docs.mdx (teambit.docs/docs) │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ extensions │ ... │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dependencies │ ... │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dev dependencies │ @company/scope.envs.my-react@0.0.1----- (component) │\n│ │ @types/testing-library__jest-dom@5.9.5- (package) │\n│ │ @babel/runtime@7.12.18----------------- (package) │\n│ │ @types/jest@^26.0.0-------------------- (package) │\n│ │ @types/react-dom@^17.0.5--------------- (package) │\n│ │ @types/react@^17.0.8------------------- (package) │\n│ │ @types/node@12.20.4-------------------- (package) │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ peer dependencies │ ... │\n└───────────────────┴──────────────────────────────────────────────────────────┘\n")),(0,r.mdx)("p",null,"The component's compositions, documentation and test files are categorized as 'dev files'.\nTo the side of each listed dev file, you'll find the Aspect that registered it as such (via the Dev Files Aspect)."),(0,r.mdx)("p",null,"If, for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@testing-library/react")," will be used by the test file, ",(0,r.mdx)("inlineCode",{parentName:"p"},"card.spec.tsx")," (and no other production file), it will be inferred as a dev dependency of that component."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// card.spec.tsx\n\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport { BasicCard } from './card.composition';\n\nit('should render a Heading', () => {\n const { getByText } = render(<BasicCard />);\n const rendered = getByText('Self Host');\n expect(rendered).toBeTruthy();\n});\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit show ui/card\n\n┌───────────────────┬──────────────────────────────────────────────────────────┐\n│ dev dependencies │ @company/scope.envs.my-react@0.0.1----- (component) │\n│ │ @types/testing-library__jest-dom@5.9.5- (package) │\n│ │ @babel/runtime@7.12.18----------------- (package) │\n│ │ @types/jest@^26.0.0-------------------- (package) │\n│ │ @types/react-dom@^17.0.5--------------- (package) │\n│ │ @types/react@^17.0.8------------------- (package) │\n│ │ @types/node@12.20.4-------------------- (package) │\n│ │ @testing-library/react@12.0.0---------- (package) │\n└───────────────────┴──────────────────────────────────────────────────────────┘\n")),(0,r.mdx)("h2",null,"Configuring Dev Files"),(0,r.mdx)("p",null,"Dev files are configured by setting glob patterns that match the files' names."),(0,r.mdx)("h3",null,"Setting Glob Patterns via ",(0,r.mdx)("inlineCode",{parentName:"h3"},"workspace.jsonc")),(0,r.mdx)("p",null,"Use the ",(0,r.mdx)("inlineCode",{parentName:"p"},"devFilePatterns")," property in ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.component/dev-files")," to manually set a glob pattern for dev files."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "{ui/**}": {\n "teambit.component/dev-files": {\n "devFilePatterns": ["**/*.story.+(js|ts|jsx|tsx)"]\n }\n }\n }\n}\n')),(0,r.mdx)("h3",null,"Setting Glob Patterns via the Dev Files API"),(0,r.mdx)("p",null,"Update your extension or create an new one to register glob patterns for dev files, using the Dev Files ",(0,r.mdx)("inlineCode",{parentName:"p"},"registerDevPattern")," API."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit create aspect extensions/my-dev-files\n")),(0,r.mdx)("h4",null,"registerDevPattern"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"registerDevPattern: (pattern: string[]) : void\n")),(0,r.mdx)("p",null,"Use the ",(0,r.mdx)("inlineCode",{parentName:"p"},"registerDevPattern")," API to register an array of glob patterns."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"import { MainRuntime } from '@teambit/cli';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport { MyDevFilesAspect } from './my-dev-files.aspect';\n\nexport class MyDevFilesMain {\n constructor(private devFiles: DevFilesMain) {}\n\n static slots = [];\n\n static dependencies = [DevFilesAspect];\n\n static runtime = MainRuntime;\n\n static async provider([devFiles]: [DevFilesMain]) {\n devFiles.registerDevPattern(['**/*.my-dev.*']);\n\n return new MyDevFilesMain(devFiles);\n }\n}\n\nMyDevFilesAspect.addRuntime(MyDevFilesMain);\n")),(0,r.mdx)("p",null,"Configure the workspace config with that aspect to apply it on all components in the workspace:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'// workspace.jsonc\n{\n "company.scope/extensions/my-dev-files": {}\n}\n'))))}u.__bit_component=o,u.isMDXComponent=!0},55061:function(e,n,t){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.DevFiles=void 0;var r=t(13793);Object.defineProperty(n,"DevFiles",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return o(r).default}})},64259:(e,n,t)=>{var o={id:"teambit.component/dev-files@1.0.411",homepage:"https://bit.cloud/teambit/component/dev-files",exported:!0};function r(){const e=a(t(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const i=()=>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/dev-files.svg"}));i.__bit_component=o,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var a=n[o]={exports:{}};return e[o].call(a.exports,a,a.exports,t),a.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 o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},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 o={};t.r(o),t.d(o,{compositions:()=>v,compositions_metadata:()=>y,overview:()=>x});var r={};t.r(r),t.d(r,{default:()=>f});var a=t(64259),i=(t(41594),t(5016)),s=t(65682),d=t(55061),p=t.n(d),l=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},c.apply(null,arguments)}var m={},u="wrapper";function f(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,o,r=function(e,n){if(null==e)return{};var t={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.includes(o))continue;t[o]=e[o]}return t}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}(e,l);return(0,i.mdx)(u,c({},m,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{DevFiles:p()},mdxType:"MDXScopeProvider"},(0,i.mdx)(p(),{mdxType:"DevFiles"})))}f.isMDXComponent=!0;const v=[a],x=[r],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
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.component/dev-files-preview"]=n():e["teambit.component/dev-files-preview"]=n()}(self,(()=>(()=>{"use strict";var e={3345:(e,n,t)=>{var o={id:"teambit.component/content/dev-files@1.95.9",homepage:"https://bit.dev/teambit/component/content/dev-files",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,s(t(41594));var r=t(5016),a=t(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function p(e,n){if(null==e)return{};var t,o,r=l(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function l(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}s.__bit_component=o,d.__bit_component=o,p.__bit_component=o,l.__bit_component=o;var c={},m="wrapper";function u(e){var n=e.components,t=p(e,i);return(0,r.mdx)(m,d({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Dev Files"),(0,r.mdx)("p",null,"Dev files are component files used for development and not for production. Dev files are determined as such by the Dev Files Aspect."),(0,r.mdx)("p",null,"Categorizing files as dev files is especially useful in dependency resolution, as dependencies can be inferred to be of type ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependencies")," by looking at the type of files that use them (if 'package-a' is only used by the component's dev files, then it is a dev dependency of that component)."),(0,r.mdx)("p",null,"For example, the ",(0,r.mdx)("inlineCode",{parentName:"p"},"ui/card")," component has the following file structure:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"└── card\n ├── card.composition.tsx\n ├── card.docs.mdx\n ├── card.spec.tsx\n ├── card.tsx\n └── index.ts\n")),(0,r.mdx)("p",null,"To examine it:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"$ bit show ui/card\n\n┌───────────────────┬──────────────────────────────────────────────────────────┐\n│ id │ company.scope/ui/card │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ ... │ │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ files │ card.composition.tsx │\n│ │ card.docs.mdx │\n│ │ card.spec.tsx │\n│ │ card.stories.tsx │\n│ │ card.tsx │\n│ │ index.ts │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dev files │ card.spec.tsx (teambit.defender/tester) │\n│ │ card.composition.tsx (teambit.compositions/compositions) │\n│ │ card.docs.mdx (teambit.docs/docs) │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ extensions │ ... │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dependencies │ ... │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ dev dependencies │ @company/scope.envs.my-react@0.0.1----- (component) │\n│ │ @types/testing-library__jest-dom@5.9.5- (package) │\n│ │ @babel/runtime@7.12.18----------------- (package) │\n│ │ @types/jest@^26.0.0-------------------- (package) │\n│ │ @types/react-dom@^17.0.5--------------- (package) │\n│ │ @types/react@^17.0.8------------------- (package) │\n│ │ @types/node@12.20.4-------------------- (package) │\n├───────────────────┼──────────────────────────────────────────────────────────┤\n│ peer dependencies │ ... │\n└───────────────────┴──────────────────────────────────────────────────────────┘\n")),(0,r.mdx)("p",null,"The component's compositions, documentation and test files are categorized as 'dev files'.\nTo the side of each listed dev file, you'll find the Aspect that registered it as such (via the Dev Files Aspect)."),(0,r.mdx)("p",null,"If, for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@testing-library/react")," will be used by the test file, ",(0,r.mdx)("inlineCode",{parentName:"p"},"card.spec.tsx")," (and no other production file), it will be inferred as a dev dependency of that component."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// card.spec.tsx\n\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport { BasicCard } from './card.composition';\n\nit('should render a Heading', () => {\n const { getByText } = render(<BasicCard />);\n const rendered = getByText('Self Host');\n expect(rendered).toBeTruthy();\n});\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit show ui/card\n\n┌───────────────────┬──────────────────────────────────────────────────────────┐\n│ dev dependencies │ @company/scope.envs.my-react@0.0.1----- (component) │\n│ │ @types/testing-library__jest-dom@5.9.5- (package) │\n│ │ @babel/runtime@7.12.18----------------- (package) │\n│ │ @types/jest@^26.0.0-------------------- (package) │\n│ │ @types/react-dom@^17.0.5--------------- (package) │\n│ │ @types/react@^17.0.8------------------- (package) │\n│ │ @types/node@12.20.4-------------------- (package) │\n│ │ @testing-library/react@12.0.0---------- (package) │\n└───────────────────┴──────────────────────────────────────────────────────────┘\n")),(0,r.mdx)("h2",null,"Configuring Dev Files"),(0,r.mdx)("p",null,"Dev files are configured by setting glob patterns that match the files' names."),(0,r.mdx)("h3",null,"Setting Glob Patterns via ",(0,r.mdx)("inlineCode",{parentName:"h3"},"workspace.jsonc")),(0,r.mdx)("p",null,"Use the ",(0,r.mdx)("inlineCode",{parentName:"p"},"devFilePatterns")," property in ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.component/dev-files")," to manually set a glob pattern for dev files."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "{ui/**}": {\n "teambit.component/dev-files": {\n "devFilePatterns": ["**/*.story.+(js|ts|jsx|tsx)"]\n }\n }\n }\n}\n')),(0,r.mdx)("h3",null,"Setting Glob Patterns via the Dev Files API"),(0,r.mdx)("p",null,"Update your extension or create an new one to register glob patterns for dev files, using the Dev Files ",(0,r.mdx)("inlineCode",{parentName:"p"},"registerDevPattern")," API."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit create aspect extensions/my-dev-files\n")),(0,r.mdx)("h4",null,"registerDevPattern"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"registerDevPattern: (pattern: string[]) : void\n")),(0,r.mdx)("p",null,"Use the ",(0,r.mdx)("inlineCode",{parentName:"p"},"registerDevPattern")," API to register an array of glob patterns."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"import { MainRuntime } from '@teambit/cli';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport { MyDevFilesAspect } from './my-dev-files.aspect';\n\nexport class MyDevFilesMain {\n constructor(private devFiles: DevFilesMain) {}\n\n static slots = [];\n\n static dependencies = [DevFilesAspect];\n\n static runtime = MainRuntime;\n\n static async provider([devFiles]: [DevFilesMain]) {\n devFiles.registerDevPattern(['**/*.my-dev.*']);\n\n return new MyDevFilesMain(devFiles);\n }\n}\n\nMyDevFilesAspect.addRuntime(MyDevFilesMain);\n")),(0,r.mdx)("p",null,"Configure the workspace config with that aspect to apply it on all components in the workspace:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'// workspace.jsonc\n{\n "company.scope/extensions/my-dev-files": {}\n}\n'))))}u.__bit_component=o,u.isMDXComponent=!0},73061:function(e,n,t){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.DevFiles=void 0;var r=t(3345);Object.defineProperty(n,"DevFiles",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return o(r).default}})},54017:(e,n,t)=>{var o={id:"teambit.component/dev-files@1.0.413",homepage:"https://bit.cloud/teambit/component/dev-files",exported:!0};function r(){const e=a(t(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const i=()=>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/dev-files.svg"}));i.__bit_component=o,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var a=n[o]={exports:{}};return e[o].call(a.exports,a,a.exports,t),a.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 o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},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 o={};t.r(o),t.d(o,{compositions:()=>v,compositions_metadata:()=>y,overview:()=>x});var r={};t.r(r),t.d(r,{default:()=>f});var a=t(54017),i=(t(41594),t(5016)),s=t(65682),d=t(73061),p=t.n(d),l=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},c.apply(null,arguments)}var m={},u="wrapper";function f(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,o,r=function(e,n){if(null==e)return{};var t={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.includes(o))continue;t[o]=e[o]}return t}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}(e,l);return(0,i.mdx)(u,c({},m,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{DevFiles:p()},mdxType:"MDXScopeProvider"},(0,i.mdx)(p(),{mdxType:"DevFiles"})))}f.isMDXComponent=!0;const v=[a],x=[r],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
@@ -2539,7 +2539,7 @@
2539
2539
  "componentId": {
2540
2540
  "scope": "teambit.component",
2541
2541
  "name": "dev-files",
2542
- "version": "1.0.411"
2542
+ "version": "1.0.413"
2543
2543
  },
2544
2544
  "taggedModuleExports": []
2545
2545
  }
@@ -180,7 +180,7 @@ class DevFilesMain {
180
180
  }
181
181
  mergeEnvManifestPatterns(parent, child) {
182
182
  const merged = {
183
- patterns: _objectSpread(_objectSpread({}, parent.patterns || {}), child.patterns || {})
183
+ patterns: _objectSpread(_objectSpread({}, parent.patterns), child.patterns)
184
184
  };
185
185
  return merged;
186
186
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_scope","_lodash","_harmony","_workspace","_envs","_component","_graphql","_devFiles","_devFiles2","_devFiles3","_devFiles4","ownKeys","e","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","DevFilesMain","constructor","envs","workspace","devPatternSlot","config","computeDevPatterns","component","entry","state","aspects","get","DevFilesAspect","id","configuredPatterns","devFilePatterns","fromSlot","computeDevPatternsFromSlot","fromEnv","computeDevPatternsFromEnv","names","res","assign","patterns","patternSlot","toArray","getPatterns","devPatterns","isFunction","reduce","acc","current","aspectId","patternsOrDescriptor","patternsArray","Array","isArray","pattern","name","undefined","concat","patternNames","envId","getEnvId","fromEnvJsonFile","computeDevPatternsFromEnvJsoncFile","fromEnvFunc","envDef","calculateEnv","skipWarnings","inInstallContext","env","getDevPatterns","envPatterns","envPatternsObject","entries","mergeEnvManifestPatterns","parent","child","merged","legacyFiles","isCoreEnv","envJsonc","getEnvManifest","envComponent","getEnvComponentByEnvId","flatten","values","isDevFile","filePath","devFiles","getDevFiles","includes","registerDevPattern","register","rawDevFiles","DevFiles","getDevFilesForConsumerComp","consumerComponent","componentId","loadExtensions","Error","toString","computedDevFiles","computeDevFiles","list","filesystem","byGlob","map","file","relative","provider","componentAspect","graphql","scope","registerShowFragments","DevFilesFragment","registerEnvJsoncMergeCustomizer","bind","calcDevOnLoad","toObject","registerOnComponentLoad","registerOnCompAspectReCalc","devFilesSchema","exports","Slot","withType","MainRuntime","EnvsAspect","WorkspaceAspect","ComponentAspect","GraphqlAspect","ScopeAspect","addRuntime"],"sources":["dev-files.main.runtime.ts"],"sourcesContent":["import { SourceFile } from '@teambit/component.sources';\nimport { MainRuntime } from '@teambit/cli';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { flatten, isFunction } from 'lodash';\nimport { SlotRegistry, Slot } from '@teambit/harmony';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { EnvJsonc, EnvsMain } from '@teambit/envs';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport { Component, ComponentMain, ComponentAspect } from '@teambit/component';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { DevFilesAspect } from './dev-files.aspect';\nimport { DevFiles } from './dev-files';\nimport { DevFilesFragment } from './dev-files.fragment';\nimport { devFilesSchema } from './dev-files.graphql';\n\ntype DevPatternDescriptor = {\n /**\n * Name of the dev pattern\n */\n name: string;\n\n /**\n * Glob pattern to select dev files\n */\n pattern: string[];\n};\n\ntype DevPattern = string[] | DevPatternDescriptor;\n\n/**\n * dev pattern is a list of strings or a function that returns a list of strings. an example to a pattern can be \"[*.spec.ts]\"\n */\nexport type DevPatterns = ((component: Component) => DevPattern) | DevPattern;\n\nexport type EnvJsoncPatterns = {\n compositions?: string[];\n docs?: string[];\n tests?: string[];\n [key: string]: string[] | undefined;\n};\n\n/**\n * slot for dev file patterns.\n */\nexport type DevPatternSlot = SlotRegistry<DevPatterns>;\n\nexport type DevFilesConfig = {\n patterns: string[];\n};\n\nexport class DevFilesMain {\n constructor(\n private envs: EnvsMain,\n\n private workspace: Workspace,\n\n private devPatternSlot: DevPatternSlot,\n\n /**\n * configuration loaded into the dev files aspect.\n */\n readonly config: DevFilesConfig\n ) {}\n\n /**\n * compute all dev patterns on a component.\n * computing of dev patterns is a merge of the configuration, the env (env.getDevPatterns(component)) and\n * the registering aspects (through registerDevPattern()).\n */\n async computeDevPatterns(component: Component) {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const configuredPatterns = entry?.config.devFilePatterns || [];\n\n const fromSlot = await this.computeDevPatternsFromSlot(component);\n const fromEnv = await this.computeDevPatternsFromEnv(component, fromSlot.names);\n\n const res = Object.assign(\n {\n config: configuredPatterns,\n },\n fromSlot.patterns,\n fromEnv\n );\n return res;\n }\n\n private async computeDevPatternsFromSlot(\n component: Component\n ): Promise<{ patterns: { [id: string]: string[] }; names: { [name: string]: string } }> {\n const patternSlot = this.devPatternSlot.toArray();\n const getPatterns = (devPatterns: DevPatterns) => {\n if (isFunction(devPatterns)) {\n return devPatterns(component);\n }\n return devPatterns;\n };\n const fromSlot = patternSlot.reduce(\n (acc, current) => {\n const [aspectId, patterns] = current;\n // if (component.state.aspects.get(aspectId)) acc[aspectId] = acc[aspectId].concat(patterns);\n const patternsOrDescriptor = getPatterns(patterns);\n const patternsArray = Array.isArray(patternsOrDescriptor) ? patternsOrDescriptor : patternsOrDescriptor.pattern;\n const name = Array.isArray(patternsOrDescriptor) ? undefined : patternsOrDescriptor.name;\n if (!acc.patterns[aspectId]) acc.patterns[aspectId] = [];\n acc.patterns[aspectId] = acc.patterns[aspectId].concat(patternsArray);\n if (name) {\n acc.names[name] = aspectId;\n }\n return acc;\n },\n { patterns: {}, names: {} }\n );\n return fromSlot;\n }\n\n private async computeDevPatternsFromEnv(\n component: Component,\n patternNames: { [name: string]: string }\n ): Promise<{ [id: string]: string[] }> {\n const envId = this.envs.getEnvId(component);\n const fromEnvJsonFile = await this.computeDevPatternsFromEnvJsoncFile(envId);\n let fromEnvFunc;\n if (!fromEnvJsonFile) {\n const envDef = await this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext });\n fromEnvFunc = envDef.env?.getDevPatterns ? envDef.env.getDevPatterns(component) : [];\n }\n const envPatterns = fromEnvJsonFile || fromEnvFunc || {};\n if (Array.isArray(envPatterns)) {\n return { [envId]: envPatterns };\n }\n const envPatternsObject = Object.entries(envPatterns).reduce((acc, [name, pattern]) => {\n const aspectId = patternNames[name] || envId;\n if (!acc[aspectId]) acc[aspectId] = [];\n acc[aspectId] = acc[aspectId].concat(pattern);\n return acc;\n }, {});\n return envPatternsObject;\n }\n\n mergeEnvManifestPatterns(parent: EnvJsonc, child: EnvJsonc): Partial<EnvJsonc> {\n const merged: Partial<EnvJsonc> = {\n patterns: { ...(parent.patterns || {}), ...(child.patterns || {}) },\n };\n return merged;\n }\n\n private async computeDevPatternsFromEnvJsoncFile(\n envId: string,\n legacyFiles?: SourceFile[]\n ): Promise<string[] | undefined> {\n const isCoreEnv = this.envs.isCoreEnv(envId);\n if (isCoreEnv) return undefined;\n let envJsonc;\n if (legacyFiles) {\n envJsonc = this.envs.getEnvManifest(undefined, legacyFiles);\n } else {\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n envJsonc = this.envs.getEnvManifest(envComponent, undefined);\n }\n\n if (!envJsonc) return undefined;\n\n return envJsonc.patterns;\n }\n\n /**\n * get all dev files configured on a component.\n */\n getDevPatterns(component: Component, aspectId?: string): string[] {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const devPatterns = entry?.data.devPatterns || {};\n return aspectId ? devPatterns[aspectId] : flatten(Object.values(devPatterns));\n }\n\n /**\n * determine whether a file of a component is a dev file.\n */\n isDevFile(component: Component, filePath: string): boolean {\n const devFiles = this.getDevFiles(component);\n return devFiles.includes(filePath);\n }\n\n /**\n * register a new dev pattern.\n * @param regex dev pattern\n */\n registerDevPattern(pattern: DevPatterns) {\n return this.devPatternSlot.register(pattern);\n }\n\n /**\n * get all dev patterns registered.\n * If you want to use this during onLoad event you might need to use computeDevFiles instead, since the component might not include this data yet\n */\n getDevFiles(component: Component): DevFiles {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const rawDevFiles = entry?.data.devFiles || {};\n return new DevFiles(rawDevFiles);\n }\n\n async getDevFilesForConsumerComp(consumerComponent: LegacyComponent): Promise<string[]> {\n const componentId = consumerComponent.id;\n // Do not change the storeInCache=false arg. if you think you need to change it, please talk to Gilad first\n const component = await this.workspace.get(componentId, consumerComponent, true, false, { loadExtensions: false });\n if (!component) throw Error(`failed to transform component ${consumerComponent.id.toString()} in harmony`);\n const computedDevFiles = await this.computeDevFiles(component);\n return computedDevFiles.list();\n }\n\n /**\n * compute all dev files of a component.\n */\n async computeDevFiles(component: Component): Promise<DevFiles> {\n const devPatterns = await this.computeDevPatterns(component);\n const rawDevFiles = Object.keys(devPatterns).reduce((acc, aspectId) => {\n if (!acc[aspectId]) acc[aspectId] = [];\n const patterns = devPatterns[aspectId];\n acc[aspectId] = component.state.filesystem.byGlob(patterns).map((file) => file.relative);\n return acc;\n }, {});\n\n return new DevFiles(rawDevFiles);\n }\n\n static slots = [Slot.withType<DevPatterns>()];\n\n static defaultConfig = {\n patterns: [],\n };\n\n static runtime = MainRuntime;\n\n static dependencies = [EnvsAspect, WorkspaceAspect, ComponentAspect, GraphqlAspect, ScopeAspect];\n\n static async provider(\n [envs, workspace, componentAspect, graphql, scope]: [EnvsMain, Workspace, ComponentMain, GraphqlMain, ScopeMain],\n config: DevFilesConfig,\n [devPatternSlot]: [DevPatternSlot]\n ) {\n const devFiles = new DevFilesMain(envs, workspace, devPatternSlot, config);\n componentAspect.registerShowFragments([new DevFilesFragment(devFiles)]);\n envs.registerEnvJsoncMergeCustomizer(devFiles.mergeEnvManifestPatterns.bind(devFiles));\n\n const calcDevOnLoad = async (component: Component) => {\n return {\n devPatterns: await devFiles.computeDevPatterns(component),\n devFiles: (await devFiles.computeDevFiles(component)).toObject(),\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(calcDevOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(calcDevOnLoad);\n }\n\n graphql.register(devFilesSchema(devFiles));\n return devFiles;\n }\n}\n\nDevFilesAspect.addRuntime(DevFilesMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAA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Q,CAACd,wBAAwB,CAAC0C,IAAI,CAAC5B,QAAQ,CAAC,CAAC;IAEtF,MAAM6B,aAAa,GAAG,MAAO5F,SAAoB,IAAK;MACpD,OAAO;QACLoB,WAAW,EAAE,MAAM2C,QAAQ,CAAChE,kBAAkB,CAACC,SAAS,CAAC;QACzD+D,QAAQ,EAAE,CAAC,MAAMA,QAAQ,CAACc,eAAe,CAAC7E,SAAS,CAAC,EAAE6F,QAAQ,CAAC;MACjE,CAAC;IACH,CAAC;IAED,IAAIjG,SAAS,EAAE;MACbA,SAAS,CAACkG,uBAAuB,CAACF,aAAa,CAAC;IAClD;IACA,IAAIL,KAAK,EAAE;MACTA,KAAK,CAACQ,0BAA0B,CAACH,aAAa,CAAC;IACjD;IAEAN,OAAO,CAACnB,QAAQ,CAAC,IAAA6B,2BAAc,EAACjC,QAAQ,CAAC,CAAC;IAC1C,OAAOA,QAAQ;EACjB;AACF;AAACkC,OAAA,CAAAxG,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CAlNYgB,YAAY,WA8KR,CAACyG,eAAI,CAACC,QAAQ,CAAc,CAAC,CAAC;AAAA1H,eAAA,CA9KlCgB,YAAY,mBAgLA;EACrBuB,QAAQ,EAAE;AACZ,CAAC;AAAAvC,eAAA,CAlLUgB,YAAY,aAoLN2G,kBAAW;AAAA3H,eAAA,CApLjBgB,YAAY,kBAsLD,CAAC4G,kBAAU,EAAEC,4BAAe,EAAEC,4BAAe,EAAEC,wBAAa,EAAEC,oBAAW,CAAC;AA8BlGpG,0BAAc,CAACqG,UAAU,CAACjH,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_scope","_lodash","_harmony","_workspace","_envs","_component","_graphql","_devFiles","_devFiles2","_devFiles3","_devFiles4","ownKeys","e","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","DevFilesMain","constructor","envs","workspace","devPatternSlot","config","computeDevPatterns","component","entry","state","aspects","get","DevFilesAspect","id","configuredPatterns","devFilePatterns","fromSlot","computeDevPatternsFromSlot","fromEnv","computeDevPatternsFromEnv","names","res","assign","patterns","patternSlot","toArray","getPatterns","devPatterns","isFunction","reduce","acc","current","aspectId","patternsOrDescriptor","patternsArray","Array","isArray","pattern","name","undefined","concat","patternNames","envId","getEnvId","fromEnvJsonFile","computeDevPatternsFromEnvJsoncFile","fromEnvFunc","envDef","calculateEnv","skipWarnings","inInstallContext","env","getDevPatterns","envPatterns","envPatternsObject","entries","mergeEnvManifestPatterns","parent","child","merged","legacyFiles","isCoreEnv","envJsonc","getEnvManifest","envComponent","getEnvComponentByEnvId","flatten","values","isDevFile","filePath","devFiles","getDevFiles","includes","registerDevPattern","register","rawDevFiles","DevFiles","getDevFilesForConsumerComp","consumerComponent","componentId","loadExtensions","Error","toString","computedDevFiles","computeDevFiles","list","filesystem","byGlob","map","file","relative","provider","componentAspect","graphql","scope","registerShowFragments","DevFilesFragment","registerEnvJsoncMergeCustomizer","bind","calcDevOnLoad","toObject","registerOnComponentLoad","registerOnCompAspectReCalc","devFilesSchema","exports","Slot","withType","MainRuntime","EnvsAspect","WorkspaceAspect","ComponentAspect","GraphqlAspect","ScopeAspect","addRuntime"],"sources":["dev-files.main.runtime.ts"],"sourcesContent":["import { SourceFile } from '@teambit/component.sources';\nimport { MainRuntime } from '@teambit/cli';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { flatten, isFunction } from 'lodash';\nimport { SlotRegistry, Slot } from '@teambit/harmony';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { EnvJsonc, EnvsMain } from '@teambit/envs';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport { Component, ComponentMain, ComponentAspect } from '@teambit/component';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { DevFilesAspect } from './dev-files.aspect';\nimport { DevFiles } from './dev-files';\nimport { DevFilesFragment } from './dev-files.fragment';\nimport { devFilesSchema } from './dev-files.graphql';\n\ntype DevPatternDescriptor = {\n /**\n * Name of the dev pattern\n */\n name: string;\n\n /**\n * Glob pattern to select dev files\n */\n pattern: string[];\n};\n\ntype DevPattern = string[] | DevPatternDescriptor;\n\n/**\n * dev pattern is a list of strings or a function that returns a list of strings. an example to a pattern can be \"[*.spec.ts]\"\n */\nexport type DevPatterns = ((component: Component) => DevPattern) | DevPattern;\n\nexport type EnvJsoncPatterns = {\n compositions?: string[];\n docs?: string[];\n tests?: string[];\n [key: string]: string[] | undefined;\n};\n\n/**\n * slot for dev file patterns.\n */\nexport type DevPatternSlot = SlotRegistry<DevPatterns>;\n\nexport type DevFilesConfig = {\n patterns: string[];\n};\n\nexport class DevFilesMain {\n constructor(\n private envs: EnvsMain,\n\n private workspace: Workspace,\n\n private devPatternSlot: DevPatternSlot,\n\n /**\n * configuration loaded into the dev files aspect.\n */\n readonly config: DevFilesConfig\n ) {}\n\n /**\n * compute all dev patterns on a component.\n * computing of dev patterns is a merge of the configuration, the env (env.getDevPatterns(component)) and\n * the registering aspects (through registerDevPattern()).\n */\n async computeDevPatterns(component: Component) {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const configuredPatterns = entry?.config.devFilePatterns || [];\n\n const fromSlot = await this.computeDevPatternsFromSlot(component);\n const fromEnv = await this.computeDevPatternsFromEnv(component, fromSlot.names);\n\n const res = Object.assign(\n {\n config: configuredPatterns,\n },\n fromSlot.patterns,\n fromEnv\n );\n return res;\n }\n\n private async computeDevPatternsFromSlot(\n component: Component\n ): Promise<{ patterns: { [id: string]: string[] }; names: { [name: string]: string } }> {\n const patternSlot = this.devPatternSlot.toArray();\n const getPatterns = (devPatterns: DevPatterns) => {\n if (isFunction(devPatterns)) {\n return devPatterns(component);\n }\n return devPatterns;\n };\n const fromSlot = patternSlot.reduce(\n (acc, current) => {\n const [aspectId, patterns] = current;\n // if (component.state.aspects.get(aspectId)) acc[aspectId] = acc[aspectId].concat(patterns);\n const patternsOrDescriptor = getPatterns(patterns);\n const patternsArray = Array.isArray(patternsOrDescriptor) ? patternsOrDescriptor : patternsOrDescriptor.pattern;\n const name = Array.isArray(patternsOrDescriptor) ? undefined : patternsOrDescriptor.name;\n if (!acc.patterns[aspectId]) acc.patterns[aspectId] = [];\n acc.patterns[aspectId] = acc.patterns[aspectId].concat(patternsArray);\n if (name) {\n acc.names[name] = aspectId;\n }\n return acc;\n },\n { patterns: {}, names: {} }\n );\n return fromSlot;\n }\n\n private async computeDevPatternsFromEnv(\n component: Component,\n patternNames: { [name: string]: string }\n ): Promise<{ [id: string]: string[] }> {\n const envId = this.envs.getEnvId(component);\n const fromEnvJsonFile = await this.computeDevPatternsFromEnvJsoncFile(envId);\n let fromEnvFunc;\n if (!fromEnvJsonFile) {\n const envDef = await this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext });\n fromEnvFunc = envDef.env?.getDevPatterns ? envDef.env.getDevPatterns(component) : [];\n }\n const envPatterns = fromEnvJsonFile || fromEnvFunc || {};\n if (Array.isArray(envPatterns)) {\n return { [envId]: envPatterns };\n }\n const envPatternsObject = Object.entries(envPatterns).reduce((acc, [name, pattern]) => {\n const aspectId = patternNames[name] || envId;\n if (!acc[aspectId]) acc[aspectId] = [];\n acc[aspectId] = acc[aspectId].concat(pattern);\n return acc;\n }, {});\n return envPatternsObject;\n }\n\n mergeEnvManifestPatterns(parent: EnvJsonc, child: EnvJsonc): Partial<EnvJsonc> {\n const merged: Partial<EnvJsonc> = {\n patterns: { ...parent.patterns, ...child.patterns },\n };\n return merged;\n }\n\n private async computeDevPatternsFromEnvJsoncFile(\n envId: string,\n legacyFiles?: SourceFile[]\n ): Promise<string[] | undefined> {\n const isCoreEnv = this.envs.isCoreEnv(envId);\n if (isCoreEnv) return undefined;\n let envJsonc;\n if (legacyFiles) {\n envJsonc = this.envs.getEnvManifest(undefined, legacyFiles);\n } else {\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n envJsonc = this.envs.getEnvManifest(envComponent, undefined);\n }\n\n if (!envJsonc) return undefined;\n\n return envJsonc.patterns;\n }\n\n /**\n * get all dev files configured on a component.\n */\n getDevPatterns(component: Component, aspectId?: string): string[] {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const devPatterns = entry?.data.devPatterns || {};\n return aspectId ? devPatterns[aspectId] : flatten(Object.values(devPatterns));\n }\n\n /**\n * determine whether a file of a component is a dev file.\n */\n isDevFile(component: Component, filePath: string): boolean {\n const devFiles = this.getDevFiles(component);\n return devFiles.includes(filePath);\n }\n\n /**\n * register a new dev pattern.\n * @param regex dev pattern\n */\n registerDevPattern(pattern: DevPatterns) {\n return this.devPatternSlot.register(pattern);\n }\n\n /**\n * get all dev patterns registered.\n * If you want to use this during onLoad event you might need to use computeDevFiles instead, since the component might not include this data yet\n */\n getDevFiles(component: Component): DevFiles {\n const entry = component.state.aspects.get(DevFilesAspect.id);\n const rawDevFiles = entry?.data.devFiles || {};\n return new DevFiles(rawDevFiles);\n }\n\n async getDevFilesForConsumerComp(consumerComponent: LegacyComponent): Promise<string[]> {\n const componentId = consumerComponent.id;\n // Do not change the storeInCache=false arg. if you think you need to change it, please talk to Gilad first\n const component = await this.workspace.get(componentId, consumerComponent, true, false, { loadExtensions: false });\n if (!component) throw Error(`failed to transform component ${consumerComponent.id.toString()} in harmony`);\n const computedDevFiles = await this.computeDevFiles(component);\n return computedDevFiles.list();\n }\n\n /**\n * compute all dev files of a component.\n */\n async computeDevFiles(component: Component): Promise<DevFiles> {\n const devPatterns = await this.computeDevPatterns(component);\n const rawDevFiles = Object.keys(devPatterns).reduce((acc, aspectId) => {\n if (!acc[aspectId]) acc[aspectId] = [];\n const patterns = devPatterns[aspectId];\n acc[aspectId] = component.state.filesystem.byGlob(patterns).map((file) => file.relative);\n return acc;\n }, {});\n\n return new DevFiles(rawDevFiles);\n }\n\n static slots = [Slot.withType<DevPatterns>()];\n\n static defaultConfig = {\n patterns: [],\n };\n\n static runtime = MainRuntime;\n\n static dependencies = [EnvsAspect, WorkspaceAspect, ComponentAspect, GraphqlAspect, ScopeAspect];\n\n static async provider(\n [envs, workspace, componentAspect, graphql, scope]: [EnvsMain, Workspace, ComponentMain, GraphqlMain, ScopeMain],\n config: DevFilesConfig,\n [devPatternSlot]: [DevPatternSlot]\n ) {\n const devFiles = new DevFilesMain(envs, workspace, devPatternSlot, config);\n componentAspect.registerShowFragments([new DevFilesFragment(devFiles)]);\n envs.registerEnvJsoncMergeCustomizer(devFiles.mergeEnvManifestPatterns.bind(devFiles));\n\n const calcDevOnLoad = async (component: Component) => {\n return {\n devPatterns: await devFiles.computeDevPatterns(component),\n devFiles: (await devFiles.computeDevFiles(component)).toObject(),\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(calcDevOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(calcDevOnLoad);\n }\n\n graphql.register(devFilesSchema(devFiles));\n return devFiles;\n }\n}\n\nDevFilesAspect.addRuntime(DevFilesMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OA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jD;IAEAN,OAAO,CAACnB,QAAQ,CAAC,IAAA6B,2BAAc,EAACjC,QAAQ,CAAC,CAAC;IAC1C,OAAOA,QAAQ;EACjB;AACF;AAACkC,OAAA,CAAAxG,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CAlNYgB,YAAY,WA8KR,CAACyG,eAAI,CAACC,QAAQ,CAAc,CAAC,CAAC;AAAA1H,eAAA,CA9KlCgB,YAAY,mBAgLA;EACrBuB,QAAQ,EAAE;AACZ,CAAC;AAAAvC,eAAA,CAlLUgB,YAAY,aAoLN2G,kBAAW;AAAA3H,eAAA,CApLjBgB,YAAY,kBAsLD,CAAC4G,kBAAU,EAAEC,4BAAe,EAAEC,4BAAe,EAAEC,wBAAa,EAAEC,oBAAW,CAAC;AA8BlGpG,0BAAc,CAACqG,UAAU,CAACjH,YAAY,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_dev-files@1.0.411/dist/dev-files.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_dev-files@1.0.411/dist/dev-files.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_dev-files@1.0.413/dist/dev-files.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_dev-files@1.0.413/dist/dev-files.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@teambit/dev-files",
3
- "version": "1.0.411",
3
+ "version": "1.0.413",
4
4
  "homepage": "https://bit.cloud/teambit/component/dev-files",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "dev-files",
9
- "version": "1.0.411"
9
+ "version": "1.0.413"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
13
13
  "lodash": "4.17.21",
14
14
  "@teambit/harmony": "0.4.6",
15
- "@teambit/component": "1.0.411",
16
- "@teambit/graphql": "1.0.411",
17
- "@teambit/cli": "0.0.988",
18
- "@teambit/component.sources": "0.0.30",
19
- "@teambit/envs": "1.0.411",
20
- "@teambit/scope": "1.0.411",
21
- "@teambit/workspace": "1.0.411"
15
+ "@teambit/component": "1.0.413",
16
+ "@teambit/graphql": "1.0.413",
17
+ "@teambit/cli": "0.0.990",
18
+ "@teambit/component.sources": "0.0.31",
19
+ "@teambit/envs": "1.0.413",
20
+ "@teambit/scope": "1.0.413",
21
+ "@teambit/workspace": "1.0.413"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/lodash": "4.14.165",
25
- "@types/chai": "4.2.15",
26
25
  "chai": "4.3.0",
27
26
  "@types/mocha": "9.1.0",
28
27
  "@teambit/component.content.dev-files": "1.95.9",
29
- "@teambit/harmony.envs.core-aspect-env": "0.0.47"
28
+ "@teambit/harmony.envs.core-aspect-env": "0.0.59"
30
29
  },
31
30
  "peerDependencies": {
32
31
  "react": "^17.0.0 || ^18.0.0",
33
32
  "@types/react": "^17.0.73",
33
+ "@types/chai": "4.3.19",
34
34
  "@teambit/legacy": "1.0.624"
35
35
  },
36
36
  "license": "Apache-2.0",