@teambit/dev-files 1.0.209 → 1.0.210

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
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.209" tests="3" failures="0" errors="0" skipped="0">
3
+ <testsuite name="teambit.component/dev-files@1.0.210" tests="3" failures="0" errors="0" skipped="0">
4
4
  <testcase classname="dist/dev-files.spec.js" name="get all dev files of the docs aspect"/>
5
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"/>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/dev-files-preview"]=t():e["teambit.component/dev-files-preview"]=t()}(self,(()=>(()=>{"use strict";var e={70923:(e,t,n)=>{var o={id:"teambit.component/content/dev-files@1.95.9",homepage:"https://bit.dev/teambit/component/content/dev-files",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=u,s(n(41594));var r=n(5016),a=n(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}s.__bit_component=o,p.__bit_component=o,d.__bit_component=o,l.__bit_component=o;var c={},m="wrapper";function u(e){var t=e.components,n=d(e,i);return(0,r.mdx)(m,p({},c,n,{components:t,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},39331:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DevFiles=void 0;var r=n(70923);Object.defineProperty(t,"DevFiles",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o(r).default}})},81805:(e,t,n)=>{var o={id:"teambit.component/dev-files@1.0.209",homepage:"https://bit.cloud/teambit/component/dev-files",exported:!0};function r(){const e=a(n(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.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,t.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>u,compositions_metadata:()=>v,overview:()=>f});var e={};n.r(e),n.d(e,{default:()=>m});var t=n(81805),r=(n(41594),n(5016)),a=n(65682),i=n(39331),s=n.n(i),p=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}var l={},c="wrapper";function m(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,p);return(0,r.mdx)(c,d({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{DevFiles:s()},mdxType:"MDXScopeProvider"},(0,r.mdx)(s(),{mdxType:"DevFiles"})))}m.isMDXComponent=!0;const u=[t],f=[e],v={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/dev-files-preview"]=t():e["teambit.component/dev-files-preview"]=t()}(self,(()=>(()=>{"use strict";var e={93381:(e,t,n)=>{var o={id:"teambit.component/content/dev-files@1.95.9",homepage:"https://bit.dev/teambit/component/content/dev-files",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=u,s(n(41594));var r=n(5016),a=n(65682),i=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}s.__bit_component=o,p.__bit_component=o,d.__bit_component=o,l.__bit_component=o;var c={},m="wrapper";function u(e){var t=e.components,n=d(e,i);return(0,r.mdx)(m,p({},c,n,{components:t,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},40273:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DevFiles=void 0;var r=n(93381);Object.defineProperty(t,"DevFiles",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o(r).default}})},12985:(e,t,n)=>{var o={id:"teambit.component/dev-files@1.0.210",homepage:"https://bit.cloud/teambit/component/dev-files",exported:!0};function r(){const e=a(n(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.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,t.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>u,compositions_metadata:()=>v,overview:()=>f});var e={};n.r(e),n.d(e,{default:()=>m});var t=n(12985),r=(n(41594),n(5016)),a=n(65682),i=n(40273),s=n.n(i),p=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}var l={},c="wrapper";function m(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,p);return(0,r.mdx)(c,d({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{DevFiles:s()},mdxType:"MDXScopeProvider"},(0,r.mdx)(s(),{mdxType:"DevFiles"})))}m.isMDXComponent=!0;const u=[t],f=[e],v={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
@@ -2136,7 +2136,7 @@
2136
2136
  "componentId": {
2137
2137
  "scope": "teambit.component",
2138
2138
  "name": "dev-files",
2139
- "version": "1.0.209"
2139
+ "version": "1.0.210"
2140
2140
  },
2141
2141
  "taggedModuleExports": []
2142
2142
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.DevFilesFragment = void 0;
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  class DevFilesFragment {
11
11
  constructor(devFiles) {
@@ -96,7 +96,7 @@ function _devFiles4() {
96
96
  return data;
97
97
  }
98
98
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
99
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
99
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
100
100
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
101
101
  /**
102
102
  * 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]"
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_commentJson","_scope","_lodash","_harmony","_workspace","_envs","_component","_graphql","_devFiles","_devFiles2","_devFiles3","_devFiles4","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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","legacyFiles","isCoreEnv","envJson","find","file","relative","envComponent","getEnvComponentByEnvId","filesystem","files","object","parse","contents","toString","flatten","values","isDevFile","filePath","devFiles","getDevFiles","includes","registerDevPattern","register","rawDevFiles","DevFiles","getDevFilesForConsumerComp","consumerComponent","componentId","loadExtensions","Error","computedDevFiles","computeDevFiles","list","keys","byGlob","map","provider","componentAspect","graphql","scope","registerShowFragments","DevFilesFragment","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/legacy/dist/consumer/component/sources';\nimport { MainRuntime } from '@teambit/cli';\nimport { parse } from 'comment-json';\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, 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\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 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 envJson;\n if (legacyFiles) {\n envJson = legacyFiles.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n } else {\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n envJson = envComponent.filesystem.files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n }\n\n if (!envJson) return undefined;\n\n const object = parse(envJson.contents.toString('utf8'));\n return object.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\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,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,MAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,KAAA,YAAAA,CAAA;IAAA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5B,QAAQ,CAAC,CAAC;IAC1C,OAAOA,QAAQ;EACjB;AACF;AAAC6B,OAAA,CAAAvG,YAAA,GAAAA,YAAA;AAAArB,eAAA,CA/MYqB,YAAY,WA4KR,CAACwG,eAAI,CAACC,QAAQ,CAAc,CAAC,CAAC;AAAA9H,eAAA,CA5KlCqB,YAAY,mBA8KA;EACrBuB,QAAQ,EAAE;AACZ,CAAC;AAAA5C,eAAA,CAhLUqB,YAAY,aAkLN0G,kBAAW;AAAA/H,eAAA,CAlLjBqB,YAAY,kBAoLD,CAAC2G,kBAAU,EAAEC,4BAAe,EAAEC,4BAAe,EAAEC,wBAAa,EAAEC,oBAAW,CAAC;AA6BlGnG,0BAAc,CAACoG,UAAU,CAAChH,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_commentJson","_scope","_lodash","_harmony","_workspace","_envs","_component","_graphql","_devFiles","_devFiles2","_devFiles3","_devFiles4","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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","legacyFiles","isCoreEnv","envJson","find","file","relative","envComponent","getEnvComponentByEnvId","filesystem","files","object","parse","contents","toString","flatten","values","isDevFile","filePath","devFiles","getDevFiles","includes","registerDevPattern","register","rawDevFiles","DevFiles","getDevFilesForConsumerComp","consumerComponent","componentId","loadExtensions","Error","computedDevFiles","computeDevFiles","list","keys","byGlob","map","provider","componentAspect","graphql","scope","registerShowFragments","DevFilesFragment","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/legacy/dist/consumer/component/sources';\nimport { MainRuntime } from '@teambit/cli';\nimport { parse } from 'comment-json';\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, 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\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 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 envJson;\n if (legacyFiles) {\n envJson = legacyFiles.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n } else {\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n envJson = envComponent.filesystem.files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n }\n\n if (!envJson) return undefined;\n\n const object = parse(envJson.contents.toString('utf8'));\n return object.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\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;E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- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_dev-files@1.0.209/dist/dev-files.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_dev-files@1.0.209/dist/dev-files.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_dev-files@1.0.210/dist/dev-files.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_dev-files@1.0.210/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,24 +1,24 @@
1
1
  {
2
2
  "name": "@teambit/dev-files",
3
- "version": "1.0.209",
3
+ "version": "1.0.210",
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.209"
9
+ "version": "1.0.210"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
13
13
  "comment-json": "3.0.3",
14
14
  "lodash": "4.17.21",
15
15
  "@teambit/harmony": "0.4.6",
16
- "@teambit/component": "1.0.209",
17
- "@teambit/graphql": "1.0.209",
16
+ "@teambit/component": "1.0.210",
17
+ "@teambit/graphql": "1.0.210",
18
18
  "@teambit/cli": "0.0.858",
19
- "@teambit/envs": "1.0.209",
20
- "@teambit/scope": "1.0.209",
21
- "@teambit/workspace": "1.0.209"
19
+ "@teambit/envs": "1.0.210",
20
+ "@teambit/scope": "1.0.210",
21
+ "@teambit/workspace": "1.0.210"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/lodash": "4.14.165",