@teambit/envs 1.0.281 → 1.0.283
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_envs_envs-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dist/context/context.js +1 -1
- package/dist/context/context.js.map +1 -1
- package/dist/env-definition.js.map +1 -1
- package/dist/env.composition.js +1 -1
- package/dist/env.composition.js.map +1 -1
- package/dist/env.fragment.js +2 -2
- package/dist/env.fragment.js.map +1 -1
- package/dist/env.plugin.js +1 -1
- package/dist/env.plugin.js.map +1 -1
- package/dist/environments.graphql.js.map +1 -1
- package/dist/environments.main.runtime.js +2 -2
- package/dist/environments.main.runtime.js.map +1 -1
- package/dist/envs.cmd.js +2 -2
- package/dist/envs.cmd.js.map +1 -1
- package/dist/exceptions/env-not-configured-for-component.js.map +1 -1
- package/dist/exceptions/env-not-found-in-runtime.js.map +1 -1
- package/dist/exceptions/env-not-found.js.map +1 -1
- package/dist/{preview-1716434516635.js → preview-1716607230882.js} +2 -2
- package/dist/runtime/envs-execution-result.js.map +1 -1
- package/dist/runtime/runtime.js +1 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/services/service-handler-context.js.map +1 -1
- package/package.json +21 -21
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
3
|
-
<testsuite name="teambit.envs/envs@1.0.
|
3
|
+
<testsuite name="teambit.envs/envs@1.0.283" tests="0" failures="0" errors="0" skipped="0"/>
|
4
4
|
</testsuites>
|
@@ -1 +1 @@
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.envs/envs-preview"]=n():e["teambit.envs/envs-preview"]=n()}(self,(()=>(()=>{"use strict";var e={73624:(e,n,t)=>{var o={id:"teambit.envs/aspect-docs/envs@0.0.168",homepage:"https://bit.cloud/teambit/envs/aspect-docs/envs",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=d,i(t(41594));var r=t(5016),a=["components"];function i(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():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},s.apply(this,arguments)}function m(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={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;t[o]=e[o]}return t}i.__bit_component=o,s.__bit_component=o,m.__bit_component=o,l.__bit_component=o;var c={},p="wrapper";function d(e){var n=e.components,t=m(e,a);return(0,r.mdx)(p,s({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Envs aspect runs Bit environments and environment services, and defines their structure."),(0,r.mdx)("p",null,"A Bit environment is a development environment encapsulated in a Bit component. Just like other components, Bit environments can be instantly added to your workspace to start developing, testing, and building components with zero configurations.\nDifferent environments can be easily applied to multiple components in a workspace, and can be easily extended or customized to fit your needs and development stack. For example, try the React environment to start developing React components in your workspace.\nLike all Bit components, Bit environments are reusable, so you can share them across projects and teams to greatly speed up and standardize development."),(0,r.mdx)("h4",null,"Example"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'// Using the \'Node\' and \'React\' environments for different components in a Bit workspace.\n{\n "teambit.workspace/variants": {\n "components/ui": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("h4",null,"Features"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Blazing fast environment setup"),": Setting up an environment requires nothing more than configuring a workspace to use a Bit extension.\nGet started in seconds and focus on the thing that matters most - delivering great features.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Multiple environments in a single workspace"),": No need to constantly switch between workspaces as different environments,\nset to handle different components, can all be used in parallel in a single workspace.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Less to learn"),": Using a pre-configured environment extension means you don't have to get into all the details of your build tooling.\nThat's a especially important when onboarding a new developer to your team.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Customizable and extensible"),": Environments can be extended to add or override configurations.\nQuickly add your own modifications to get an environment that best suits your needs.\nExport your environment extension to a remote scope to have it available to all your team.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Standardized development"),": Sharing and reusing environments makes it easier to maintain consistency in development across multiple decoupled Bit workspaces.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Easy to maintain"),": Get your environment's latest updates with just a simple ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," command. Roll-back as easily, if needed."))),(0,r.mdx)("h2",null,"CLI reference"),(0,r.mdx)("p",null,"Bit environments make use of Bit's CLI to execute their different services. That means, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit test"),", for example, may execute different test runners, depending on the environment in use."),(0,r.mdx)("h4",null,"start"),(0,r.mdx)("p",null,"Runs the development serve (that includes running the Workspace UI)."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"// run the dev server\nbit start\n")),(0,r.mdx)("h4",null,"build"),(0,r.mdx)("p",null,"Runs the build pipeline (without tagging components with a new release version)."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit build\n")),(0,r.mdx)("h4",null,"test"),(0,r.mdx)("p",null,"Runs all tests."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit test\n")),(0,r.mdx)("h4",null,"compile"),(0,r.mdx)("p",null,"Compiles all components."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit compile\n")),(0,r.mdx)("h4",null,"lint"),(0,r.mdx)("p",null,"Get lint results for all components."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit lint\n")),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Setting a default environment for the workspace"),(0,r.mdx)("p",null,"Environments can only be configured using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/variants")," workspace API. That means the ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/workspace")," cannot be utilized to set an environment as the default for all components. To achieve a similar result, select all components using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," wildcard."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n }\n }\n}\n')),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{style:{color:"#c31313"}},"Never use the '*' wildcard in a workspace that uses multiple environments!"),"Instead, use exclusive namespaces or directories to select and configure each group of components to use its own environment (see an example in the next section)."),(0,r.mdx)("br",null),(0,r.mdx)("br",null),(0,r.mdx)("p",null,"To learn more, see the 'Troubleshooting' section."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"A single component (with the same version) cannot use more than a single environment.")),(0,r.mdx)("h3",null,"Setting multiple environments"),(0,r.mdx)("p",null,"A single workspace can use different environments for different sets of components. Setting an environment on a specific group of components is done by selecting the group and applying the environment. This is done using ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/variants"),"."),(0,r.mdx)("p",null,"For example, to set the Node and React environments on two sets of components (selected by their directory):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/ui": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("h3",null,"Extending an environment"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"This section goes through the steps of extending the 'main runtime'.\nSee the 'Runtime Environment' section to learn how to extend multiple runtime environments.")),(0,r.mdx)("p",null,"An environment extension is a component that extends an existing environment. An extension file will have the ",(0,r.mdx)("inlineCode",{parentName:"p"},".extension.ts")," suffix as a convention."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The ",(0,r.mdx)("inlineCode",{parentName:"p"},"*.extensions.ts")," pattern should only be used when no other 'runtime environment' is being extended other than the 'main runtime.' For more details, see the 'runtime environments' section.")),(0,r.mdx)("p",null,"To create and use an environment extension:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},"Create the extension files"),(0,r.mdx)("li",{parentName:"ol"},"Use and extend an existing environment"),(0,r.mdx)("li",{parentName:"ol"},"Track the new component"),(0,r.mdx)("li",{parentName:"ol"},"Use the new extension component ID to set it in the workspace configuration file"),(0,r.mdx)("li",{parentName:"ol"},"(Optional) Tag the new component"),(0,r.mdx)("li",{parentName:"ol"},"(Optional) Export the component the make it available to be used by others")),(0,r.mdx)("h4",null,"1. Create the environment extension files"),(0,r.mdx)("p",null,"We'll start by creating a new extension:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"// In the workspace's root directory\nmkdir -p extensions/custom-react\ntouch extensions/custom-react/custom-react.extension.ts\ntouch extensions/custom-react/index.ts\n")),(0,r.mdx)("h4",null,"2. Use an existing environment to extend it"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The below code uses the React environment as an example.")),(0,r.mdx)("p",null,"Our files will have the following code (the code below will only extend the ",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react")," environment without changing its configurations):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // The 'compose' methods to compose the overrides into a single environment\n const customReactEnv = react.compose([\n // This is were the environment's 'transformers' will be used to customize it\n ]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the Environments aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\n\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("h4",null,"3. Track the extension component"),(0,r.mdx)("p",null,"We'll then track the new component (with the 'my-extensions' namespace):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit add extensions/custom-react -n my-extensions\n")),(0,r.mdx)("h4",null,"4. Set the extension component in the workspace config file"),(0,r.mdx)("p",null,"Our extension component now has a component ID that can be used in our ",(0,r.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," configuration file:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/workspace": {\n "name": "my-workspace",\n "icon": "https://image.flaticon.com/icons/svg/185/185034.svg",\n "defaultScope": "my-org.my-extensions"\n },\n "teambit.workspace/variants": {\n "*": {\n "my-org.my-extensions/custom-react": {}\n }\n }\n}\n')),(0,r.mdx)("h3",null,"The anatomy of an environment extension"),(0,r.mdx)("p",null,"An environment extension uses the following Bit components to extend an existing environment, and to register itself as an environment:"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},"The ",(0,r.mdx)("strong",{parentName:"p"},'"base" environment')," (e.g, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit/react"),") is extended and customized using its override methods. Each override method, or \"environment transformer\", corresponds to a Bit extension component used by the environment (e.g, the TypeScript component). Using an 'environment transformer' will add new configurations to the relevant Bit component and will override any conflicting ones.",(0,r.mdx)("br",null)," The full list of available 'environment transformers' can be seen in the specific environment's documentation (see: React, React Native, Node).")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},"The ",(0,r.mdx)("strong",{parentName:"p"},"'Environments' component")," (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit/envs"),") is used to:"),(0,r.mdx)("ol",{parentName:"li"},(0,r.mdx)("li",{parentName:"ol"},'Register the new environment using its "slot"'),(0,r.mdx)("li",{parentName:"ol"},'Override a "service handler". This is done to replace a Bit component used by an environment service. For example, to set the "compiler" service handler to use Babel instead of TypeScript')))),(0,r.mdx)("h4",null,"Override the config for a Bit component used by the environment"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The current Envs API will soon be replaced.")),(0,r.mdx)("p",null,"The example below is of a React environment extension. This new environment overrides React's DevServer configuration by setting a new Webpack configuration file."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it and override its DevServer config\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\nconst newWebpackConfig = require('./webpack/new-webpack-config');\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // The 'compose' methods to compose the overrides into a single environment\n const customReactEnv = react.compose([\n\n // Override the Webpack configs of the DevServer aspect\n react.overrideDevServerConfig(newWebpackRules);\n\n ]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the Environments aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The 'provider' method will be executed by Bit. Its Bit aspects dependencies are set in the ",(0,r.mdx)("inlineCode",{parentName:"p"},"dependencies")," variable, and will be injected into the method upon execution.")),(0,r.mdx)("h4",null,"Override a 'service handler' to replace a component used by the environment"),(0,r.mdx)("p",null,"The example below is of a React environment extension. This new environment overrides the 'service handler' for the compiler service. It replaces the Bit aspect used by it, TypeScript, with another Bit aspect, Babel."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it and override its DevServer config\nimport { ReactAspect, ReactMain } from '@teambit/react';\n// Import the Babel aspect to configure it and set it as the new compiler\nimport { BabelAspect, BabelMain } from '@teambit.compilation/babel';\n\nconst babelConfig = require('./babel/babel-config');\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect, BabelAspect];\n\n static async provider([envs, react, babel]: [EnvsMain, ReactMain, BabelMain]) {\n // Create a new Babel compiler with the 'babelConfig' configurations\n const babelCompiler = babel.createCompiler({\n babelTransformOptions: babelConfig,\n });\n\n // Use the 'override' method provided by the 'environments' aspect (not the React aspect)\n const compilerOverride = envs.override({\n getCompiler: () => {\n return babelCompiler;\n },\n });\n\n // Compose the overrides into a single environment\n const customReactEnv = react.compose([compilerOverride]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the 'environments' aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("h2",null,"Concepts and tools"),(0,r.mdx)("h3",null,"Environment Services"),(0,r.mdx)("p",null,'To become a "one-stop-shop" for components, an environment "bundles" together different Environment Services provided by various Bit aspect components. These Environment Services enable other Bit aspects to integrate into Bit\'s component life-cycle features.'),(0,r.mdx)("p",null,"For example, the 'Tester' service (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.defender/tester"),") enables the React environment (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react"),") to set 'Jest' (",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.defender/jest"),") as the default test runner for its components. This will enable Jest to be executed on the ",(0,r.mdx)("inlineCode",{parentName:"p"},"bbit test")," command, to be run as a pre-tag check, to output results using Bit's logger, and even to display the generated logs in the Workspace and Scope UIs (to name just a few examples)."),(0,r.mdx)("img",{src:"https://storage.googleapis.com/docs-images/react_env_ex.png",alt:"React env using Jest with the tester service",style:{width:"50%",minWidth:500}}),(0,r.mdx)("blockquote",null,(0,r.mdx)("h5",{parentName:"blockquote"},"Services VS Build Tasks"),(0,r.mdx)("p",{parentName:"blockquote"},"Environment Services which are executed either by the development server, or via the CLI, are not identical\nto Build Tasks that run as part of the Build Pipeline.\nFor example, the TypeScript configurations used for compilation by the development server are not the same as the ones used for a component's build process.")),(0,r.mdx)("h4",null,"Compiler"),(0,r.mdx)("p",null,"Runs the environment's selected compiler (for example, TypeScript)."),(0,r.mdx)("h4",null,"Tester"),(0,r.mdx)("p",null,"Runs the environment's selected test runner (for example, Jest)"),(0,r.mdx)("h4",null,"Linter"),(0,r.mdx)("p",null,"Runs the environment's selected linter (for example, ESLint)"),(0,r.mdx)("h4",null,"Documentation"),(0,r.mdx)("p",null,"Sets the template for the auto-generated component documentation, as well as the API for customizing component docs."),(0,r.mdx)("h4",null,"Build pipeline (CI)"),(0,r.mdx)("p",null,"Sets the sequence of build tasks to run before a component is tagged with a new version."),(0,r.mdx)("h4",null,"DevServer"),(0,r.mdx)("p",null,"Bundles all components and runs a server to display them, live (using \"hot reloading\") in the workspace UI. This includes rendering the 'compositions' as well as the documentation shown in the 'Overview' tab."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"Even though different types of components, e.g. React and Node components, run on different servers (one for each environment) the workspace is explored and navigated through as if it where a single server.")),(0,r.mdx)("h4",null,"Package"),(0,r.mdx)("p",null,"Generates the node module package for components, with properties set by the environment."),(0,r.mdx)("h4",null,"Dependencies"),(0,r.mdx)("p",null,"Sets the default dependencies (as well as their version and type) for each component handled by the environment. That includes peer dependencies used for runtime (for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"react-dom"),") and dev dependencies (for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@types/react"),")."),(0,r.mdx)("h4",null,"Bundler"),(0,r.mdx)("p",null,"Bundles components (compositions, docs, etc.) using the environment's bundler and bundling configurations. The generated assets are use both in development (when running the development server) and when exploring component's tagged releases (for example, in the scope UI)."),(0,r.mdx)("h3",null,"Service Handlers"),(0,r.mdx)("p",null,"Service Handlers are the link that binds an environment to the various Environment Services. They are methods in the Environment class that set an Environment Service to use a specific Bit extension component or a configuration file."),(0,r.mdx)("p",null,"For example, the React environment uses the Service Handler ",(0,r.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," to configure the Compiler Environment Service to run the TypeScript extension component."),(0,r.mdx)("p",null,"Environment services run on various events. Whenever a service runs, it executes its corresponding service handler which consequently runs the configured aspect (in the previous example, that would be TypeScript)."),(0,r.mdx)("p",null,"Different components in a Bit workspace may use different environments. That means environment services need to execute their corresponding service handlers in the specific environment applied on the component currently being processed."),(0,r.mdx)("p",null,"For example, if ",(0,r.mdx)("em",{parentName:"p"},"component A")," uses the Node environment then the Compiler service processing that component, will execute the Service Handler (in that case, ",(0,r.mdx)("inlineCode",{parentName:"p"},"getCompiler"),") found in the Node environment."),(0,r.mdx)("h3",null,"List of service handlers"),(0,r.mdx)("h4",null,"getTester"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getTester(...args : any[]): Tester\n")),(0,r.mdx)("p",null,"Returns a test runner to be used by the Tester service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Jest Aspect\n private jestAspect: JestMain\n ) {}\n\n // ...\n\n getTester(jestConfigPath: string, jestModule = jest): Tester {\n const jestConfig = require.resolve('./jest/jest.config');\n return this.jestAspect.createTester(jestConfig);\n }\n}\n")),(0,r.mdx)("h4",null,"getCompiler"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getCompiler(...args : any[]): Compiler\n")),(0,r.mdx)("p",null,"Returns a compiler to be used by the Compiler service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n\nconstructor(\n // ...\n\n // The TypeScript aspect\n private tsAspect: TypescriptMain\n){}\n\n// ...\n\ngetCompiler() {\n const tsConfig = require.resolve('./typescript/tsconfig.json')\n return this.tsAspect.createCompiler(tsConfig);\n}\n")),(0,r.mdx)("h4",null,"getLinter"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getLinter(...args : any[]): Linter\n")),(0,r.mdx)("p",null,"Returns a linter to be used by the Linter service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n\n constructor(){\n // ...\n\n // The ESLint aspect\n private eslint: ESLintMain\n }\n\n // ...\n\n getLinter() {\n const eslintConfig = require.resolve('./eslint/eslintrc')\n return this.eslint.createLinter({\n config: eslintConfig,\n // resolve all plugins from the react environment\n pluginPath: __dirname,\n });\n }\n}\n")),(0,r.mdx)("h4",null,"getDevServer"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDevServer(...args : any[]): DevServer\n")),(0,r.mdx)("p",null,"Returns a DevServer to be used by the DevServer service. (A DevServer is essentially the combination of the bundler configurations, together with a specified 'listen' port number)"),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Webpack aspect\n private webpack: WebpackMain\n ) {}\n\n // ...\n\n getDevServer(): DevServer {\n const withDocs = Object.assign(context, {\n entry: context.entry.concat([require.resolve('./docs')]),\n });\n return this.webpack.createDevServer(withDocs, webpackConfig);\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The above example runs the dev server with the environment's documentation template.")),(0,r.mdx)("h4",null,"getDocsTemplate"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDocsTemplate(...args : any[]): string\n")),(0,r.mdx)("p",null,"Returns the path to the documentation template files, to be used by the Documentation service."),(0,r.mdx)("p",null,"For example (see docs files ",(0,r.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/tree/master/scopes/react/react/docs"},"here"),"):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n getDocsTemplate() {\n return require.resolve('./docs');\n }\n}\n")),(0,r.mdx)("h4",null,"getPackageJsonProps"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getPackageJsonProps(...args : any[]): object\n")),(0,r.mdx)("p",null,"Returns an object that defines the ",(0,r.mdx)("inlineCode",{parentName:"p"},"package.json")," properties of the packages generated for components handled by this environment. This configuration is used by the Packager service."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n getPackageJsonProps() {\n return {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n };\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"As with any other 'merging' process, the properties defined in the above returned object will be added to configurations set by Bit.\nConflicting properties will be overridden by the properties that are set here.\nConfigurations that are set here may also be overridden, either by the 'pkg aspect' or by workspace configurations set using the 'variants API'.")),(0,r.mdx)("h4",null,"getDependencies"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDependencies(component: any): Promise<DependencyList>\n")),(0,r.mdx)("p",null,"Returns an object that defines the default dependencies for components handled by this environment. The returned object is used by the Dependencies service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n async getDependencies() {\n return {\n dependencies: {\n react: '-',\n },\n devDependencies: {\n '@types/react': '16.9.43',\n '@types/jest': '~26.0.9',\n },\n peerDependencies: {\n react: '^16.13.1',\n 'react-dom': '^16.13.1',\n },\n };\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"As with any other 'merging' process, the properties defined in the above returned object will be added to configurations set by Bit.\nConflicting properties will be overridden by the properties that are set here.\nConfigurations that are set here may also be overridden, either by the 'Dependency Resolver aspect' or by workspace configurations set using the 'variants API'.")),(0,r.mdx)("h4",null,"getBuildPipe"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getBuildPipe(...args : any[]): BuildTask[]\n")),(0,r.mdx)("p",null,"Returns an array of build tasks to be used by the Builder service. Tasks will be added after and before Bit's pre-configured build tasks."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Compiler aspect\n private compiler: CompilerMain,\n\n // The Tester aspect\n private tester: TesterMain\n ) {}\n\n getBuildPipe(): BuildTask[] {\n return [this.compiler.createTask('StencilCompiler', this.getCompiler()), this.tester.task];\n }\n}\n")),(0,r.mdx)("h2",null,"Extending multiple runtime environments"),(0,r.mdx)("p",null,"An environment may operate in multiple runtime environments: 'Main', which runs on the server and 'UI' and 'Preview', which run on the browser.\nEach runtime environment runs all files that are named with its corresponding file pattern."),(0,r.mdx)("p",null,'An environment extension that runs on multiple runtimes is called "Aspect" an will have the following file structure:'),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"|-- env-extension\n |-- env-extension.main.ts\n |-- env-extension.ui.tsx\n |-- env-extension.preview.tsx\n |-- env.extension.aspect.ts\n")),(0,r.mdx)("h3",null,"Registering an environment as an aspect"),(0,r.mdx)("p",null,"Create a ",(0,r.mdx)("inlineCode",{parentName:"p"},"*.aspect.ts")," file:"),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"touch path/to/extension/env-extension.aspect.ts\n")),(0,r.mdx)("p",null,"Place the following lines to register your environment as a multiple runtime extension (a.k.a, an Aspect):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// env-extension.aspect.ts\n\nimport { Aspect } from '@teambit/harmony';\n\nexport const ReactWithProvidersAspect = Aspect.create({\n // The ID should be your component's ID\n // Make sure to track your extension component before registering it as an Aspect\n id: 'my-scope.react-with-providers',\n});\n")),(0,r.mdx)("h3",null,"Registering a runtime extension"),(0,r.mdx)("p",null,"An aspect is a collection of multiple extensions, each extending a specific runtime."),(0,r.mdx)("p",null,"Register each runtime extension to its corresponding runtime, using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"addRuntime")," method."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.preview.ts\n\nimport { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-with-providers.aspect';\n\nexport class ReactExtensionPreview {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n return new ReactExtensionPreview();\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionPreview);\n")),(0,r.mdx)("h3",null,"Runtime environments"),(0,r.mdx)("h4",null,"Main"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.main.runtime.ts")),(0,r.mdx)("p",null,"Node files that run in a node runtime environments and outputs to the terminal."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Example:"),"\nThe React environment TypeScript compiler will be extended in the main runtime."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.main.ts\n\nimport { MainRuntime } from '@teambit/cli';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-extension.aspect';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport class ReactExtensionMain {\n constructor(private react: ReactMain, private envs: EnvsMain) {}\n\n icon() {\n return 'https://static.bit.dev/extensions-icons/react.svg';\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [ReactAspect, EnvsAspect];\n\n static async provider([react, envs]: [ReactMain, EnvsMain]) {\n const reactExtension = envs.compose(react, [react.overrideTsConfig(tsconfig)]);\n envs.registerEnv(reactExtension);\n return new ReactWithProvidersMain(react, envs);\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionMain);\n")),(0,r.mdx)("h4",null,"UI"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.ui.runtime.[ts,js,jsx,tsx]")),(0,r.mdx)("p",null,"JSX files that run in the browser, as part of the Workspace/Scope UI bundle that is being served by the development server."),(0,r.mdx)("h4",null,"Preview"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.preview.runtime.*")),(0,r.mdx)("p",null,"These files are served by the environment's server, as part of the environment's preview bundle (i.e, the component compositions and documentation).\n(The 'preview' runtime is rendered in the Workspace/Scope UI using an iframe.)"),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Example:"),'\nA new composition provider that will "wrap" every composition using that environment will be added using the preview runtime since it is part of the component compositions (which are being served to the browser by the environment\'s server).'),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.preview.ts\n\nimport { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-with-providers.aspect';\nimport { Center } from './my-providers/center';\n\nexport class ReactExtensionPreview {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n react.registerProvider(Center);\n\n return new ReactExtensionPreview();\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionPreview);\n")),(0,r.mdx)("h2",null,"Troubleshooting"),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Problem:")," Components that are configured to use a specific environment, use the workspace's default environment, instead."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("p",null,"In the above example, components in the ",(0,r.mdx)("inlineCode",{parentName:"p"},"components/utils")," directory are set to use the Node environment.\nSince that selection is more specific than the one done using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," wildcard selector, it is expected to override it."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Understanding the problem:"),"\nTo select the right configurations for each component, the 'Variants' aspect sorts all workspace configurations, from the most specific to the most general.\nThe first configuration set on an aspect (the most specific one) will be the one that is selected for that aspect.\nThat means, once Variants encounters configurations for an aspect, it stops looking for additional configurations for that specific aspect."),(0,r.mdx)("p",null,"Each environment is considered as a different aspect, even though they are all under the \"environments\" category and can only be used once per component.\n'Variants' does not understand categories, only individual aspects and therefore, cannot override one environment with a different environment."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Solution #1:")),(0,r.mdx)("p",null,"Remove the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," general selection and use only specific and exclusive selectors to configure environments\n(that means your workspace directories/ namespaces need to be structured in a way that enables complete selection of all components using selectors that are exclusive)."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/react": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Solution #2:"),"\nConfigure the environment using the Envs config API."),(0,r.mdx)("p",null,"Example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {},\n "teambit.envs/envs": {\n "env": "teambit.harmony/node"\n }\n }\n }\n}\n')),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"Notice how the Node environment was added also as a standalone aspect, to ensure that it is registered as a dependency of the selected components.")),(0,r.mdx)("hr",null))}d.__bit_component=o,d.isMDXComponent=!0},12829:(e,n,t)=>{Object.defineProperty(n,"B",{enumerable:!0,get:function(){return o.default}});var o=r(t(73624));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.envs/aspect-docs/envs@0.0.168",homepage:"https://bit.cloud/teambit/envs/aspect-docs/envs",exported:!0}},71304:(e,n,t)=>{var o={id:"teambit.envs/envs@1.0.281",homepage:"https://bit.cloud/teambit/envs/envs",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/env.svg"}));i.__bit_component=o,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var a=n[o]={exports:{}};return e[o](a,a.exports,t),a.exports}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={};return(()=>{t.r(o),t.d(o,{compositions:()=>d,compositions_metadata:()=>x,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>p});var n=t(71304),r=(t(41594),t(5016));const a=TeambitMdxUiMdxScopeContext;var i=t(12829),s=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}var l={},c="wrapper";function p(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(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)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.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}(e,s);return(0,r.mdx)(c,m({},l,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{Envs:i.B},mdxType:"MDXScopeProvider"},(0,r.mdx)(i.B,{mdxType:"Envs"})))}p.isMDXComponent=!0;const d=[n],u=[e],x={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),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.envs/envs-preview"]=n():e["teambit.envs/envs-preview"]=n()}(self,(()=>(()=>{"use strict";var e={73624:(e,n,t)=>{var o={id:"teambit.envs/aspect-docs/envs@0.0.168",homepage:"https://bit.cloud/teambit/envs/aspect-docs/envs",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=d,i(t(41594));var r=t(5016),a=["components"];function i(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():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},s.apply(this,arguments)}function m(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={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;t[o]=e[o]}return t}i.__bit_component=o,s.__bit_component=o,m.__bit_component=o,l.__bit_component=o;var c={},p="wrapper";function d(e){var n=e.components,t=m(e,a);return(0,r.mdx)(p,s({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Envs aspect runs Bit environments and environment services, and defines their structure."),(0,r.mdx)("p",null,"A Bit environment is a development environment encapsulated in a Bit component. Just like other components, Bit environments can be instantly added to your workspace to start developing, testing, and building components with zero configurations.\nDifferent environments can be easily applied to multiple components in a workspace, and can be easily extended or customized to fit your needs and development stack. For example, try the React environment to start developing React components in your workspace.\nLike all Bit components, Bit environments are reusable, so you can share them across projects and teams to greatly speed up and standardize development."),(0,r.mdx)("h4",null,"Example"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'// Using the \'Node\' and \'React\' environments for different components in a Bit workspace.\n{\n "teambit.workspace/variants": {\n "components/ui": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("h4",null,"Features"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Blazing fast environment setup"),": Setting up an environment requires nothing more than configuring a workspace to use a Bit extension.\nGet started in seconds and focus on the thing that matters most - delivering great features.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Multiple environments in a single workspace"),": No need to constantly switch between workspaces as different environments,\nset to handle different components, can all be used in parallel in a single workspace.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Less to learn"),": Using a pre-configured environment extension means you don't have to get into all the details of your build tooling.\nThat's a especially important when onboarding a new developer to your team.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Customizable and extensible"),": Environments can be extended to add or override configurations.\nQuickly add your own modifications to get an environment that best suits your needs.\nExport your environment extension to a remote scope to have it available to all your team.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Standardized development"),": Sharing and reusing environments makes it easier to maintain consistency in development across multiple decoupled Bit workspaces.")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},(0,r.mdx)("strong",{parentName:"p"},"Easy to maintain"),": Get your environment's latest updates with just a simple ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," command. Roll-back as easily, if needed."))),(0,r.mdx)("h2",null,"CLI reference"),(0,r.mdx)("p",null,"Bit environments make use of Bit's CLI to execute their different services. That means, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit test"),", for example, may execute different test runners, depending on the environment in use."),(0,r.mdx)("h4",null,"start"),(0,r.mdx)("p",null,"Runs the development serve (that includes running the Workspace UI)."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"// run the dev server\nbit start\n")),(0,r.mdx)("h4",null,"build"),(0,r.mdx)("p",null,"Runs the build pipeline (without tagging components with a new release version)."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit build\n")),(0,r.mdx)("h4",null,"test"),(0,r.mdx)("p",null,"Runs all tests."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit test\n")),(0,r.mdx)("h4",null,"compile"),(0,r.mdx)("p",null,"Compiles all components."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit compile\n")),(0,r.mdx)("h4",null,"lint"),(0,r.mdx)("p",null,"Get lint results for all components."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit lint\n")),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Setting a default environment for the workspace"),(0,r.mdx)("p",null,"Environments can only be configured using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/variants")," workspace API. That means the ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/workspace")," cannot be utilized to set an environment as the default for all components. To achieve a similar result, select all components using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," wildcard."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n }\n }\n}\n')),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{style:{color:"#c31313"}},"Never use the '*' wildcard in a workspace that uses multiple environments!"),"Instead, use exclusive namespaces or directories to select and configure each group of components to use its own environment (see an example in the next section)."),(0,r.mdx)("br",null),(0,r.mdx)("br",null),(0,r.mdx)("p",null,"To learn more, see the 'Troubleshooting' section."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"A single component (with the same version) cannot use more than a single environment.")),(0,r.mdx)("h3",null,"Setting multiple environments"),(0,r.mdx)("p",null,"A single workspace can use different environments for different sets of components. Setting an environment on a specific group of components is done by selecting the group and applying the environment. This is done using ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/variants"),"."),(0,r.mdx)("p",null,"For example, to set the Node and React environments on two sets of components (selected by their directory):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/ui": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("h3",null,"Extending an environment"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"This section goes through the steps of extending the 'main runtime'.\nSee the 'Runtime Environment' section to learn how to extend multiple runtime environments.")),(0,r.mdx)("p",null,"An environment extension is a component that extends an existing environment. An extension file will have the ",(0,r.mdx)("inlineCode",{parentName:"p"},".extension.ts")," suffix as a convention."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The ",(0,r.mdx)("inlineCode",{parentName:"p"},"*.extensions.ts")," pattern should only be used when no other 'runtime environment' is being extended other than the 'main runtime.' For more details, see the 'runtime environments' section.")),(0,r.mdx)("p",null,"To create and use an environment extension:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},"Create the extension files"),(0,r.mdx)("li",{parentName:"ol"},"Use and extend an existing environment"),(0,r.mdx)("li",{parentName:"ol"},"Track the new component"),(0,r.mdx)("li",{parentName:"ol"},"Use the new extension component ID to set it in the workspace configuration file"),(0,r.mdx)("li",{parentName:"ol"},"(Optional) Tag the new component"),(0,r.mdx)("li",{parentName:"ol"},"(Optional) Export the component the make it available to be used by others")),(0,r.mdx)("h4",null,"1. Create the environment extension files"),(0,r.mdx)("p",null,"We'll start by creating a new extension:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"// In the workspace's root directory\nmkdir -p extensions/custom-react\ntouch extensions/custom-react/custom-react.extension.ts\ntouch extensions/custom-react/index.ts\n")),(0,r.mdx)("h4",null,"2. Use an existing environment to extend it"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The below code uses the React environment as an example.")),(0,r.mdx)("p",null,"Our files will have the following code (the code below will only extend the ",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react")," environment without changing its configurations):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // The 'compose' methods to compose the overrides into a single environment\n const customReactEnv = react.compose([\n // This is were the environment's 'transformers' will be used to customize it\n ]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the Environments aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\n\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("h4",null,"3. Track the extension component"),(0,r.mdx)("p",null,"We'll then track the new component (with the 'my-extensions' namespace):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"bit add extensions/custom-react -n my-extensions\n")),(0,r.mdx)("h4",null,"4. Set the extension component in the workspace config file"),(0,r.mdx)("p",null,"Our extension component now has a component ID that can be used in our ",(0,r.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," configuration file:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/workspace": {\n "name": "my-workspace",\n "icon": "https://image.flaticon.com/icons/svg/185/185034.svg",\n "defaultScope": "my-org.my-extensions"\n },\n "teambit.workspace/variants": {\n "*": {\n "my-org.my-extensions/custom-react": {}\n }\n }\n}\n')),(0,r.mdx)("h3",null,"The anatomy of an environment extension"),(0,r.mdx)("p",null,"An environment extension uses the following Bit components to extend an existing environment, and to register itself as an environment:"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},"The ",(0,r.mdx)("strong",{parentName:"p"},'"base" environment')," (e.g, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit/react"),") is extended and customized using its override methods. Each override method, or \"environment transformer\", corresponds to a Bit extension component used by the environment (e.g, the TypeScript component). Using an 'environment transformer' will add new configurations to the relevant Bit component and will override any conflicting ones.",(0,r.mdx)("br",null)," The full list of available 'environment transformers' can be seen in the specific environment's documentation (see: React, React Native, Node).")),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("p",{parentName:"li"},"The ",(0,r.mdx)("strong",{parentName:"p"},"'Environments' component")," (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit/envs"),") is used to:"),(0,r.mdx)("ol",{parentName:"li"},(0,r.mdx)("li",{parentName:"ol"},'Register the new environment using its "slot"'),(0,r.mdx)("li",{parentName:"ol"},'Override a "service handler". This is done to replace a Bit component used by an environment service. For example, to set the "compiler" service handler to use Babel instead of TypeScript')))),(0,r.mdx)("h4",null,"Override the config for a Bit component used by the environment"),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The current Envs API will soon be replaced.")),(0,r.mdx)("p",null,"The example below is of a React environment extension. This new environment overrides React's DevServer configuration by setting a new Webpack configuration file."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it and override its DevServer config\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\nconst newWebpackConfig = require('./webpack/new-webpack-config');\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // The 'compose' methods to compose the overrides into a single environment\n const customReactEnv = react.compose([\n\n // Override the Webpack configs of the DevServer aspect\n react.overrideDevServerConfig(newWebpackRules);\n\n ]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the Environments aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The 'provider' method will be executed by Bit. Its Bit aspects dependencies are set in the ",(0,r.mdx)("inlineCode",{parentName:"p"},"dependencies")," variable, and will be injected into the method upon execution.")),(0,r.mdx)("h4",null,"Override a 'service handler' to replace a component used by the environment"),(0,r.mdx)("p",null,"The example below is of a React environment extension. This new environment overrides the 'service handler' for the compiler service. It replaces the Bit aspect used by it, TypeScript, with another Bit aspect, Babel."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-tsx"},"// custom-react.extension.ts\n\n// Import from the Environments aspect to register this extension as an environment\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\n// Import from the React aspect to extend it and override its DevServer config\nimport { ReactAspect, ReactMain } from '@teambit/react';\n// Import the Babel aspect to configure it and set it as the new compiler\nimport { BabelAspect, BabelMain } from '@teambit.compilation/babel';\n\nconst babelConfig = require('./babel/babel-config');\n\nexport class CustomReactExtension {\n constructor(private react: ReactMain) {}\n\n // Set the necessary dependencies to be injected (by Bit) into the following 'provider' function\n static dependencies: any = [EnvsAspect, ReactAspect, BabelAspect];\n\n static async provider([envs, react, babel]: [EnvsMain, ReactMain, BabelMain]) {\n // Create a new Babel compiler with the 'babelConfig' configurations\n const babelCompiler = babel.createCompiler({\n babelTransformOptions: babelConfig,\n });\n\n // Use the 'override' method provided by the 'environments' aspect (not the React aspect)\n const compilerOverride = envs.override({\n getCompiler: () => {\n return babelCompiler;\n },\n });\n\n // Compose the overrides into a single environment\n const customReactEnv = react.compose([compilerOverride]);\n\n // Register this extension as an environment using the \"registerEnv\" slot (provided by the 'environments' aspect).\n envs.registerEnv(customReactEnv);\n\n return new CustomReactExtension(react);\n }\n}\n")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// index.ts\nimport { CustomReactExtension } from './custom-react.extension';\nexport { CustomReactExtension };\nexport default CustomReactExtension;\n")),(0,r.mdx)("h2",null,"Concepts and tools"),(0,r.mdx)("h3",null,"Environment Services"),(0,r.mdx)("p",null,'To become a "one-stop-shop" for components, an environment "bundles" together different Environment Services provided by various Bit aspect components. These Environment Services enable other Bit aspects to integrate into Bit\'s component life-cycle features.'),(0,r.mdx)("p",null,"For example, the 'Tester' service (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.defender/tester"),") enables the React environment (",(0,r.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react"),") to set 'Jest' (",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit.defender/jest"),") as the default test runner for its components. This will enable Jest to be executed on the ",(0,r.mdx)("inlineCode",{parentName:"p"},"bbit test")," command, to be run as a pre-tag check, to output results using Bit's logger, and even to display the generated logs in the Workspace and Scope UIs (to name just a few examples)."),(0,r.mdx)("img",{src:"https://storage.googleapis.com/docs-images/react_env_ex.png",alt:"React env using Jest with the tester service",style:{width:"50%",minWidth:500}}),(0,r.mdx)("blockquote",null,(0,r.mdx)("h5",{parentName:"blockquote"},"Services VS Build Tasks"),(0,r.mdx)("p",{parentName:"blockquote"},"Environment Services which are executed either by the development server, or via the CLI, are not identical\nto Build Tasks that run as part of the Build Pipeline.\nFor example, the TypeScript configurations used for compilation by the development server are not the same as the ones used for a component's build process.")),(0,r.mdx)("h4",null,"Compiler"),(0,r.mdx)("p",null,"Runs the environment's selected compiler (for example, TypeScript)."),(0,r.mdx)("h4",null,"Tester"),(0,r.mdx)("p",null,"Runs the environment's selected test runner (for example, Jest)"),(0,r.mdx)("h4",null,"Linter"),(0,r.mdx)("p",null,"Runs the environment's selected linter (for example, ESLint)"),(0,r.mdx)("h4",null,"Documentation"),(0,r.mdx)("p",null,"Sets the template for the auto-generated component documentation, as well as the API for customizing component docs."),(0,r.mdx)("h4",null,"Build pipeline (CI)"),(0,r.mdx)("p",null,"Sets the sequence of build tasks to run before a component is tagged with a new version."),(0,r.mdx)("h4",null,"DevServer"),(0,r.mdx)("p",null,"Bundles all components and runs a server to display them, live (using \"hot reloading\") in the workspace UI. This includes rendering the 'compositions' as well as the documentation shown in the 'Overview' tab."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"Even though different types of components, e.g. React and Node components, run on different servers (one for each environment) the workspace is explored and navigated through as if it where a single server.")),(0,r.mdx)("h4",null,"Package"),(0,r.mdx)("p",null,"Generates the node module package for components, with properties set by the environment."),(0,r.mdx)("h4",null,"Dependencies"),(0,r.mdx)("p",null,"Sets the default dependencies (as well as their version and type) for each component handled by the environment. That includes peer dependencies used for runtime (for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"react-dom"),") and dev dependencies (for example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"@types/react"),")."),(0,r.mdx)("h4",null,"Bundler"),(0,r.mdx)("p",null,"Bundles components (compositions, docs, etc.) using the environment's bundler and bundling configurations. The generated assets are use both in development (when running the development server) and when exploring component's tagged releases (for example, in the scope UI)."),(0,r.mdx)("h3",null,"Service Handlers"),(0,r.mdx)("p",null,"Service Handlers are the link that binds an environment to the various Environment Services. They are methods in the Environment class that set an Environment Service to use a specific Bit extension component or a configuration file."),(0,r.mdx)("p",null,"For example, the React environment uses the Service Handler ",(0,r.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," to configure the Compiler Environment Service to run the TypeScript extension component."),(0,r.mdx)("p",null,"Environment services run on various events. Whenever a service runs, it executes its corresponding service handler which consequently runs the configured aspect (in the previous example, that would be TypeScript)."),(0,r.mdx)("p",null,"Different components in a Bit workspace may use different environments. That means environment services need to execute their corresponding service handlers in the specific environment applied on the component currently being processed."),(0,r.mdx)("p",null,"For example, if ",(0,r.mdx)("em",{parentName:"p"},"component A")," uses the Node environment then the Compiler service processing that component, will execute the Service Handler (in that case, ",(0,r.mdx)("inlineCode",{parentName:"p"},"getCompiler"),") found in the Node environment."),(0,r.mdx)("h3",null,"List of service handlers"),(0,r.mdx)("h4",null,"getTester"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getTester(...args : any[]): Tester\n")),(0,r.mdx)("p",null,"Returns a test runner to be used by the Tester service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Jest Aspect\n private jestAspect: JestMain\n ) {}\n\n // ...\n\n getTester(jestConfigPath: string, jestModule = jest): Tester {\n const jestConfig = require.resolve('./jest/jest.config');\n return this.jestAspect.createTester(jestConfig);\n }\n}\n")),(0,r.mdx)("h4",null,"getCompiler"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getCompiler(...args : any[]): Compiler\n")),(0,r.mdx)("p",null,"Returns a compiler to be used by the Compiler service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n\nconstructor(\n // ...\n\n // The TypeScript aspect\n private tsAspect: TypescriptMain\n){}\n\n// ...\n\ngetCompiler() {\n const tsConfig = require.resolve('./typescript/tsconfig.json')\n return this.tsAspect.createCompiler(tsConfig);\n}\n")),(0,r.mdx)("h4",null,"getLinter"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getLinter(...args : any[]): Linter\n")),(0,r.mdx)("p",null,"Returns a linter to be used by the Linter service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n\n constructor(){\n // ...\n\n // The ESLint aspect\n private eslint: ESLintMain\n }\n\n // ...\n\n getLinter() {\n const eslintConfig = require.resolve('./eslint/eslintrc')\n return this.eslint.createLinter({\n config: eslintConfig,\n // resolve all plugins from the react environment\n pluginPath: __dirname,\n });\n }\n}\n")),(0,r.mdx)("h4",null,"getDevServer"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDevServer(...args : any[]): DevServer\n")),(0,r.mdx)("p",null,"Returns a DevServer to be used by the DevServer service. (A DevServer is essentially the combination of the bundler configurations, together with a specified 'listen' port number)"),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Webpack aspect\n private webpack: WebpackMain\n ) {}\n\n // ...\n\n getDevServer(): DevServer {\n const withDocs = Object.assign(context, {\n entry: context.entry.concat([require.resolve('./docs')]),\n });\n return this.webpack.createDevServer(withDocs, webpackConfig);\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"The above example runs the dev server with the environment's documentation template.")),(0,r.mdx)("h4",null,"getDocsTemplate"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDocsTemplate(...args : any[]): string\n")),(0,r.mdx)("p",null,"Returns the path to the documentation template files, to be used by the Documentation service."),(0,r.mdx)("p",null,"For example (see docs files ",(0,r.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/tree/master/scopes/react/react/docs"},"here"),"):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n getDocsTemplate() {\n return require.resolve('./docs');\n }\n}\n")),(0,r.mdx)("h4",null,"getPackageJsonProps"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getPackageJsonProps(...args : any[]): object\n")),(0,r.mdx)("p",null,"Returns an object that defines the ",(0,r.mdx)("inlineCode",{parentName:"p"},"package.json")," properties of the packages generated for components handled by this environment. This configuration is used by the Packager service."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n getPackageJsonProps() {\n return {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n };\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"As with any other 'merging' process, the properties defined in the above returned object will be added to configurations set by Bit.\nConflicting properties will be overridden by the properties that are set here.\nConfigurations that are set here may also be overridden, either by the 'pkg aspect' or by workspace configurations set using the 'variants API'.")),(0,r.mdx)("h4",null,"getDependencies"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getDependencies(component: any): Promise<DependencyList>\n")),(0,r.mdx)("p",null,"Returns an object that defines the default dependencies for components handled by this environment. The returned object is used by the Dependencies service."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n // ...\n\n async getDependencies() {\n return {\n dependencies: {\n react: '-',\n },\n devDependencies: {\n '@types/react': '16.9.43',\n '@types/jest': '~26.0.9',\n },\n peerDependencies: {\n react: '^16.13.1',\n 'react-dom': '^16.13.1',\n },\n };\n }\n}\n")),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"As with any other 'merging' process, the properties defined in the above returned object will be added to configurations set by Bit.\nConflicting properties will be overridden by the properties that are set here.\nConfigurations that are set here may also be overridden, either by the 'Dependency Resolver aspect' or by workspace configurations set using the 'variants API'.")),(0,r.mdx)("h4",null,"getBuildPipe"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"getBuildPipe(...args : any[]): BuildTask[]\n")),(0,r.mdx)("p",null,"Returns an array of build tasks to be used by the Builder service. Tasks will be added after and before Bit's pre-configured build tasks."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"export class ReactEnv implements Environment {\n constructor(\n // ...\n\n // The Compiler aspect\n private compiler: CompilerMain,\n\n // The Tester aspect\n private tester: TesterMain\n ) {}\n\n getBuildPipe(): BuildTask[] {\n return [this.compiler.createTask('StencilCompiler', this.getCompiler()), this.tester.task];\n }\n}\n")),(0,r.mdx)("h2",null,"Extending multiple runtime environments"),(0,r.mdx)("p",null,"An environment may operate in multiple runtime environments: 'Main', which runs on the server and 'UI' and 'Preview', which run on the browser.\nEach runtime environment runs all files that are named with its corresponding file pattern."),(0,r.mdx)("p",null,'An environment extension that runs on multiple runtimes is called "Aspect" an will have the following file structure:'),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"|-- env-extension\n |-- env-extension.main.ts\n |-- env-extension.ui.tsx\n |-- env-extension.preview.tsx\n |-- env.extension.aspect.ts\n")),(0,r.mdx)("h3",null,"Registering an environment as an aspect"),(0,r.mdx)("p",null,"Create a ",(0,r.mdx)("inlineCode",{parentName:"p"},"*.aspect.ts")," file:"),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-shell"},"touch path/to/extension/env-extension.aspect.ts\n")),(0,r.mdx)("p",null,"Place the following lines to register your environment as a multiple runtime extension (a.k.a, an Aspect):"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// env-extension.aspect.ts\n\nimport { Aspect } from '@teambit/harmony';\n\nexport const ReactWithProvidersAspect = Aspect.create({\n // The ID should be your component's ID\n // Make sure to track your extension component before registering it as an Aspect\n id: 'my-scope.react-with-providers',\n});\n")),(0,r.mdx)("h3",null,"Registering a runtime extension"),(0,r.mdx)("p",null,"An aspect is a collection of multiple extensions, each extending a specific runtime."),(0,r.mdx)("p",null,"Register each runtime extension to its corresponding runtime, using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"addRuntime")," method."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.preview.ts\n\nimport { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-with-providers.aspect';\n\nexport class ReactExtensionPreview {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n return new ReactExtensionPreview();\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionPreview);\n")),(0,r.mdx)("h3",null,"Runtime environments"),(0,r.mdx)("h4",null,"Main"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.main.runtime.ts")),(0,r.mdx)("p",null,"Node files that run in a node runtime environments and outputs to the terminal."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Example:"),"\nThe React environment TypeScript compiler will be extended in the main runtime."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.main.ts\n\nimport { MainRuntime } from '@teambit/cli';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-extension.aspect';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport class ReactExtensionMain {\n constructor(private react: ReactMain, private envs: EnvsMain) {}\n\n icon() {\n return 'https://static.bit.dev/extensions-icons/react.svg';\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [ReactAspect, EnvsAspect];\n\n static async provider([react, envs]: [ReactMain, EnvsMain]) {\n const reactExtension = envs.compose(react, [react.overrideTsConfig(tsconfig)]);\n envs.registerEnv(reactExtension);\n return new ReactWithProvidersMain(react, envs);\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionMain);\n")),(0,r.mdx)("h4",null,"UI"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.ui.runtime.[ts,js,jsx,tsx]")),(0,r.mdx)("p",null,"JSX files that run in the browser, as part of the Workspace/Scope UI bundle that is being served by the development server."),(0,r.mdx)("h4",null,"Preview"),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"*.preview.runtime.*")),(0,r.mdx)("p",null,"These files are served by the environment's server, as part of the environment's preview bundle (i.e, the component compositions and documentation).\n(The 'preview' runtime is rendered in the Workspace/Scope UI using an iframe.)"),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Example:"),'\nA new composition provider that will "wrap" every composition using that environment will be added using the preview runtime since it is part of the component compositions (which are being served to the browser by the environment\'s server).'),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-typescript"},"// react-extension.preview.ts\n\nimport { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\nimport { ReactExtensionAspect } from './react-with-providers.aspect';\nimport { Center } from './my-providers/center';\n\nexport class ReactExtensionPreview {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n react.registerProvider(Center);\n\n return new ReactExtensionPreview();\n }\n}\n\nReactExtensionAspect.addRuntime(ReactExtensionPreview);\n")),(0,r.mdx)("h2",null,"Troubleshooting"),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Problem:")," Components that are configured to use a specific environment, use the workspace's default environment, instead."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("p",null,"In the above example, components in the ",(0,r.mdx)("inlineCode",{parentName:"p"},"components/utils")," directory are set to use the Node environment.\nSince that selection is more specific than the one done using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," wildcard selector, it is expected to override it."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Understanding the problem:"),"\nTo select the right configurations for each component, the 'Variants' aspect sorts all workspace configurations, from the most specific to the most general.\nThe first configuration set on an aspect (the most specific one) will be the one that is selected for that aspect.\nThat means, once Variants encounters configurations for an aspect, it stops looking for additional configurations for that specific aspect."),(0,r.mdx)("p",null,"Each environment is considered as a different aspect, even though they are all under the \"environments\" category and can only be used once per component.\n'Variants' does not understand categories, only individual aspects and therefore, cannot override one environment with a different environment."),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Solution #1:")),(0,r.mdx)("p",null,"Remove the ",(0,r.mdx)("inlineCode",{parentName:"p"},"*")," general selection and use only specific and exclusive selectors to configure environments\n(that means your workspace directories/ namespaces need to be structured in a way that enables complete selection of all components using selectors that are exclusive)."),(0,r.mdx)("p",null,"For example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/react": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,r.mdx)("p",null,(0,r.mdx)("strong",{parentName:"p"},"Solution #2:"),"\nConfigure the environment using the Envs config API."),(0,r.mdx)("p",null,"Example:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.react/react": {}\n },\n "components/utils": {\n "teambit.harmony/node": {},\n "teambit.envs/envs": {\n "env": "teambit.harmony/node"\n }\n }\n }\n}\n')),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},"Notice how the Node environment was added also as a standalone aspect, to ensure that it is registered as a dependency of the selected components.")),(0,r.mdx)("hr",null))}d.__bit_component=o,d.isMDXComponent=!0},12829:(e,n,t)=>{Object.defineProperty(n,"B",{enumerable:!0,get:function(){return o.default}});var o=r(t(73624));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.envs/aspect-docs/envs@0.0.168",homepage:"https://bit.cloud/teambit/envs/aspect-docs/envs",exported:!0}},83242:(e,n,t)=>{var o={id:"teambit.envs/envs@1.0.283",homepage:"https://bit.cloud/teambit/envs/envs",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/env.svg"}));i.__bit_component=o,n.Logo=i},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var a=n[o]={exports:{}};return e[o](a,a.exports,t),a.exports}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={};return(()=>{t.r(o),t.d(o,{compositions:()=>d,compositions_metadata:()=>x,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>p});var n=t(83242),r=(t(41594),t(5016));const a=TeambitMdxUiMdxScopeContext;var i=t(12829),s=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(null,arguments)}var l={},c="wrapper";function p(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.indexOf(o)>=0)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.indexOf(t)>=0||{}.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}(e,s);return(0,r.mdx)(c,m({},l,t,{components:n,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{Envs:i.B},mdxType:"MDXScopeProvider"},(0,r.mdx)(i.B,{mdxType:"Envs"})))}p.isMDXComponent=!0;const d=[n],u=[e],x={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
package/artifacts/schema.json
CHANGED
@@ -31762,7 +31762,7 @@
|
|
31762
31762
|
"componentId": {
|
31763
31763
|
"scope": "teambit.envs",
|
31764
31764
|
"name": "envs",
|
31765
|
-
"version": "1.0.
|
31765
|
+
"version": "1.0.283"
|
31766
31766
|
},
|
31767
31767
|
"taggedModuleExports": []
|
31768
31768
|
}
|
package/dist/context/context.js
CHANGED
@@ -11,7 +11,7 @@ function _envDefinition() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _defineProperty(
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
16
|
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); }
|
17
17
|
class ExecutionContext {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_envDefinition","data","require","_defineProperty","
|
1
|
+
{"version":3,"names":["_envDefinition","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExecutionContext","constructor","upper","envRuntime","components","id","env","envDefinition","EnvDefinition","apply","name","args","Error","exports"],"sources":["context.ts"],"sourcesContent":["import { EnvDefinition } from '../env-definition';\nimport { Environment } from '../environment';\n\nimport { EnvRuntime, Runtime } from '../runtime';\n\nexport type ServiceMap<T> = {\n [env: string]: T;\n};\n\nexport class ExecutionContext {\n constructor(\n /**\n * upper scope of all environment contexts.\n */\n readonly upper: Runtime,\n\n /**\n * runtime instance of the environment.\n */\n readonly envRuntime: EnvRuntime,\n\n /**\n * components applied in the execution context.\n */\n public components = envRuntime.components\n ) {}\n\n relatedContexts: string[] = [];\n\n /**\n * extension ID of the environment\n */\n get id() {\n return this.envRuntime.id;\n }\n\n /**\n * environment instance.\n */\n get env(): Environment {\n return this.envRuntime.env;\n }\n\n get envDefinition(): EnvDefinition {\n return new EnvDefinition(this.id, this.env);\n }\n\n apply<T>(name: string, args: any[]): T {\n if (!this.env[name]) {\n throw new Error(`method ${name} not implemented`);\n }\n\n return this.env[name].apply(this.env, ...args);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkD,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAS3C,MAAMgB,gBAAgB,CAAC;EAC5BC,WAAWA;EACT;AACJ;AACA;EACaC,KAAc;EAEvB;AACJ;AACA;EACaC,UAAsB;EAE/B;AACJ;AACA;EACWC,UAAU,GAAGD,UAAU,CAACC,UAAU,EACzC;IAAA,KAXSF,KAAc,GAAdA,KAAc;IAAA,KAKdC,UAAsB,GAAtBA,UAAsB;IAAA,KAKxBC,UAAU,GAAVA,UAAU;IAAAvB,eAAA,0BAGS,EAAE;EAF3B;EAIH;AACF;AACA;EACE,IAAIwB,EAAEA,CAAA,EAAG;IACP,OAAO,IAAI,CAACF,UAAU,CAACE,EAAE;EAC3B;;EAEA;AACF;AACA;EACE,IAAIC,GAAGA,CAAA,EAAgB;IACrB,OAAO,IAAI,CAACH,UAAU,CAACG,GAAG;EAC5B;EAEA,IAAIC,aAAaA,CAAA,EAAkB;IACjC,OAAO,KAAIC,8BAAa,EAAC,IAAI,CAACH,EAAE,EAAE,IAAI,CAACC,GAAG,CAAC;EAC7C;EAEAG,KAAKA,CAAIC,IAAY,EAAEC,IAAW,EAAK;IACrC,IAAI,CAAC,IAAI,CAACL,GAAG,CAACI,IAAI,CAAC,EAAE;MACnB,MAAM,IAAIE,KAAK,CAAC,UAAUF,IAAI,kBAAkB,CAAC;IACnD;IAEA,OAAO,IAAI,CAACJ,GAAG,CAACI,IAAI,CAAC,CAACD,KAAK,CAAC,IAAI,CAACH,GAAG,EAAE,GAAGK,IAAI,CAAC;EAChD;AACF;AAACE,OAAA,CAAAb,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["EnvDefinition","constructor","id","env","icon","defaultIcon","name","description","toObject","exports"],"sources":["env-definition.ts"],"sourcesContent":["import { Environment } from './environment';\n\n/**\n * API for component development environment.\n */\nexport class EnvDefinition {\n constructor(\n /**\n * id of the env.\n */\n readonly id: string,\n\n /**\n * env instance.\n */\n readonly env: Environment\n ) {}\n\n /**\n * get icon of the env.\n */\n get icon() {\n // TODO: refactor this away from here.\n const defaultIcon = `https://static.bit.dev/extensions-icons/default.svg`;\n return this.env.icon || defaultIcon;\n }\n\n /**\n * get the name of the env.\n */\n get name() {\n return this.env.name;\n }\n\n /**\n * get the description of the env.\n */\n get description() {\n return this.env.description;\n }\n\n toObject() {\n return {\n id: this.id,\n description: this.description,\n name: this.name,\n icon: this.icon,\n };\n }\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACO,MAAMA,aAAa,CAAC;EACzBC,WAAWA;EACT;AACJ;AACA;EACaC,EAAU;EAEnB;AACJ;AACA;EACaC,GAAgB,EACzB;IAAA,KANSD,EAAU,GAAVA,EAAU;IAAA,KAKVC,GAAgB,GAAhBA,GAAgB;EACxB;;EAEH;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAG;IACT;IACA,MAAMC,WAAW,
|
1
|
+
{"version":3,"names":["EnvDefinition","constructor","id","env","icon","defaultIcon","name","description","toObject","exports"],"sources":["env-definition.ts"],"sourcesContent":["import { Environment } from './environment';\n\n/**\n * API for component development environment.\n */\nexport class EnvDefinition {\n constructor(\n /**\n * id of the env.\n */\n readonly id: string,\n\n /**\n * env instance.\n */\n readonly env: Environment\n ) {}\n\n /**\n * get icon of the env.\n */\n get icon() {\n // TODO: refactor this away from here.\n const defaultIcon = `https://static.bit.dev/extensions-icons/default.svg`;\n return this.env.icon || defaultIcon;\n }\n\n /**\n * get the name of the env.\n */\n get name() {\n return this.env.name;\n }\n\n /**\n * get the description of the env.\n */\n get description() {\n return this.env.description;\n }\n\n toObject() {\n return {\n id: this.id,\n description: this.description,\n name: this.name,\n icon: this.icon,\n };\n }\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACO,MAAMA,aAAa,CAAC;EACzBC,WAAWA;EACT;AACJ;AACA;EACaC,EAAU;EAEnB;AACJ;AACA;EACaC,GAAgB,EACzB;IAAA,KANSD,EAAU,GAAVA,EAAU;IAAA,KAKVC,GAAgB,GAAhBA,GAAgB;EACxB;;EAEH;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAG;IACT;IACA,MAAMC,WAAW,GAAG,qDAAqD;IACzE,OAAO,IAAI,CAACF,GAAG,CAACC,IAAI,IAAIC,WAAW;EACrC;;EAEA;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACH,GAAG,CAACG,IAAI;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACJ,GAAG,CAACI,WAAW;EAC7B;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO;MACLN,EAAE,EAAE,IAAI,CAACA,EAAE;MACXK,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BD,IAAI,EAAE,IAAI,CAACA,IAAI;MACfF,IAAI,EAAE,IAAI,CAACA;IACb,CAAC;EACH;AACF;AAACK,OAAA,CAAAT,aAAA,GAAAA,aAAA","ignoreList":[]}
|
package/dist/env.composition.js
CHANGED
@@ -11,7 +11,7 @@ function _react() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _interopRequireDefault(
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
16
16
|
style: {
|
17
17
|
height: '100%',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["env.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/env.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAiD,CAAE,CAC/E,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/dist/env.fragment.js
CHANGED
@@ -11,8 +11,8 @@ function _chalk() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _interopRequireDefault(
|
15
|
-
function _defineProperty(
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
class EnvFragment {
|
package/dist/env.fragment.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EnvFragment","constructor","envs","renderRow","component","envId","getEnvId","isLoaded","isEnvRegistered","title","content","chalk","red","json","calculateEnvId","toString","exports"],"sources":["env.fragment.ts"],"sourcesContent":["import { ShowFragment, Component } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsMain } from './environments.main.runtime';\n\nexport class EnvFragment implements ShowFragment {\n constructor(private envs: EnvsMain) {}\n\n readonly title = 'env';\n\n async renderRow(component: Component) {\n const envId = await this.getEnvId(component);\n const isLoaded = this.envs.isEnvRegistered(envId);\n return {\n title: this.title,\n content: isLoaded ? envId : `${envId} ${chalk.red('(not loaded)')}`,\n };\n }\n\n async json(component: Component) {\n const envId = await this.getEnvId(component);\n return {\n title: this.title,\n json: envId,\n };\n }\n\n private async getEnvId(component: Component) {\n // don't use this.envs.getEnv(). otherwise, it'll throw an error when running bit-show on a remote component\n // where the env can't register to the slot.\n // return this.envs.getEnvId(component);\n return (await this.envs.calculateEnvId(component)).toString();\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,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MAAcC,QAAQA,CAACF,SAAoB,EAAE;IAC3C;IACA;IACA;IACA,OAAO,CAAC,MAAM,IAAI,CAACF,IAAI,CAACY,cAAc,CAACV,SAAS,CAAC,EAAEW,QAAQ,CAAC,CAAC;EAC/D;AAGF;AAACC,OAAA,CAAAhB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
package/dist/env.plugin.js
CHANGED
@@ -34,7 +34,7 @@ function _serviceHandlerContext() {
|
|
34
34
|
}
|
35
35
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
36
36
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
37
|
-
function _defineProperty(
|
37
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
38
38
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
39
39
|
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); }
|
40
40
|
class EnvPlugin {
|
package/dist/env.plugin.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_component","data","require","_cli","_lodash","_serviceHandlerContext","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","
|
1
|
+
{"version":3,"names":["_component","data","require","_cli","_lodash","_serviceHandlerContext","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","EnvPlugin","constructor","envSlot","servicesRegistry","loggerMain","workerMain","harmony","MainRuntime","name","createContext","envId","EnvContext","transformToLegacyEnv","env","envComponentId","ComponentID","fromString","envContext","allServices","flatten","values","transformers","reduce","acc","service","transform","currTransformer","preview","compiler","undefined","icon","__getDescriptor","type","id","register","object","aspect","exports"],"sources":["env.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { Aspect, Harmony } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component';\nimport { WorkerMain } from '@teambit/worker';\nimport { MainRuntime } from '@teambit/cli';\nimport { LoggerMain } from '@teambit/logger';\nimport { flatten } from 'lodash';\nimport { ServiceHandlerContext as EnvContext } from './services/service-handler-context';\nimport { Env } from './env-interface';\nimport { EnvsRegistry, ServicesRegistry } from './environments.main.runtime';\n\nexport class EnvPlugin implements PluginDefinition {\n constructor(\n private envSlot: EnvsRegistry,\n private servicesRegistry: ServicesRegistry,\n private loggerMain: LoggerMain,\n private workerMain: WorkerMain,\n private harmony: Harmony\n ) {}\n\n pattern = '*.bit-env.*';\n\n runtimes = [MainRuntime.name];\n\n private createContext(envId: ComponentID) {\n return new EnvContext(envId, this.loggerMain, this.workerMain, this.harmony);\n }\n\n private transformToLegacyEnv(envId: string, env: Env) {\n const envComponentId = ComponentID.fromString(envId);\n const envContext = this.createContext(envComponentId);\n const allServices = flatten(this.servicesRegistry.values());\n const transformers = allServices.reduce((acc, service) => {\n if (!service.transform) return acc;\n const currTransformer = service.transform(env, envContext);\n if (!currTransformer) return acc;\n return { ...acc, ...currTransformer };\n }, {});\n\n if (!env.preview && !env.compiler) return undefined;\n\n return {\n ...transformers,\n name: env.name,\n icon: env.icon,\n __getDescriptor: async () => {\n return {\n type: env.name,\n };\n },\n id: envId,\n };\n }\n\n register(object: any, aspect: Aspect) {\n const env = this.transformToLegacyEnv(aspect.id, object);\n if (!env) return undefined;\n return this.envSlot.register(env);\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,uBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,sBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyF,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,E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AA,CAAAA,aAAA,KAAY2C,GAAG,GAAKG,eAAe;IACrC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,CAACb,GAAG,CAACc,OAAO,IAAI,CAACd,GAAG,CAACe,QAAQ,EAAE,OAAOC,SAAS;IAEnD,OAAAjD,aAAA,CAAAA,aAAA,KACKyC,YAAY;MACfb,IAAI,EAAEK,GAAG,CAACL,IAAI;MACdsB,IAAI,EAAEjB,GAAG,CAACiB,IAAI;MACdC,eAAe,EAAE,MAAAA,CAAA,KAAY;QAC3B,OAAO;UACLC,IAAI,EAAEnB,GAAG,CAACL;QACZ,CAAC;MACH,CAAC;MACDyB,EAAE,EAAEvB;IAAK;EAEb;EAEAwB,QAAQA,CAACC,MAAW,EAAEC,MAAc,EAAE;IACpC,MAAMvB,GAAG,GAAG,IAAI,CAACD,oBAAoB,CAACwB,MAAM,CAACH,EAAE,EAAEE,MAAM,CAAC;IACxD,IAAI,CAACtB,GAAG,EAAE,OAAOgB,SAAS;IAC1B,OAAO,IAAI,CAAC3B,OAAO,CAACgC,QAAQ,CAACrB,GAAG,CAAC;EACnC;AACF;AAACwB,OAAA,CAAArC,SAAA,GAAAA,SAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","require","environmentsSchema","environments","typeDefs","gql","resolvers","Component","env","component","getDescriptor"],"sources":["environments.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { EnvsMain } from './environments.main.runtime';\n\nexport function environmentsSchema(environments: EnvsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n env: ExtensionDescriptor\n }\n\n type ExtensionDescriptor {\n id: String\n icon: String\n }\n `,\n resolvers: {\n Component: {\n env: (component: Component) => {\n return environments.getDescriptor(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,kBAAkBA,CAACC,YAAsB,EAAU;EACjE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG
|
1
|
+
{"version":3,"names":["_graphqlTag","data","require","environmentsSchema","environments","typeDefs","gql","resolvers","Component","env","component","getDescriptor"],"sources":["environments.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { EnvsMain } from './environments.main.runtime';\n\nexport function environmentsSchema(environments: EnvsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n env: ExtensionDescriptor\n }\n\n type ExtensionDescriptor {\n id: String\n icon: String\n }\n `,\n resolvers: {\n Component: {\n env: (component: Component) => {\n return environments.getDescriptor(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,kBAAkBA,CAACC,YAAsB,EAAU;EACjE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTC,GAAG,EAAGC,SAAoB,IAAK;UAC7B,OAAON,YAAY,CAACO,aAAa,CAACD,SAAS,CAAC;QAC9C;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
@@ -207,10 +207,10 @@ function _env2() {
|
|
207
207
|
};
|
208
208
|
return data;
|
209
209
|
}
|
210
|
-
function _interopRequireDefault(
|
210
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
211
211
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
212
212
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
213
|
-
function _defineProperty(
|
213
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
214
214
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
215
215
|
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); }
|
216
216
|
const DEFAULT_ENV = exports.DEFAULT_ENV = 'teambit.harmony/node';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_bit","_fsExtra","_pLocate","_commentJson","_cli","_component","_graphql","_issues","_pMapSeries","_componentIssues","_harmony","_logger","_bitError","_toolboxArray","_lodash","_worker","_componentId","_environments","_environments2","_runtime","_envDefinition","_envServiceList","_envs","_env","_exceptions","_env2","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_ENV","exports","EnvsMain","icon","constructor","config","harmony","envSlot","logger","servicesRegistry","componentMain","loggerMain","workerMain","envJsoncMergeCustomizerSlot","Set","createEnvironment","components","createRuntime","addFailedToLoadEnvs","id","failedToLoadEnvs","add","envIds","addFailedToLoadExt","failedToLoadExt","has","resetFailedToLoadEnvs","clear","getFailedToLoadEnvs","Array","from","extId","uniq","getDefaultEnv","defaultEnv","get","Error","EnvDefinition","getCoreEnvsIds","compose","targetEnv","envTransformers","a","reduce","acc","transformer","override","propsToOverride","env","merge","sourceEnv","allNames","prototype","getPrototypeOf","name","getOwnPropertyNames","fn","includes","bind","hasEnvManifest","envComponent","legacyFiles","undefined","files","filesystem","envJson","find","file","relative","getEnvManifest","object","parse","contents","toString","resolvedObject","recursivelyMergeWithParentManifest","path","originPath","extends","parentPackageName","parentPath","resolveFrom","parentResolvedPath","findRoot","existsSync","info","parentEnvJsoncPath","map","fileName","join","filePath","consoleWarning","parentStr","readFileSync","parentObject","mergedObject","mergeEnvManifests","parent","child","merged","mergeCustomizer","getAllRegisteredEnvJsoncCustomizers","customizer","oneMerged","hasEnvManifestById","envId","requesting","component","getEnvComponentByEnvId","getEnvData","envsData","state","aspects","EnvsAspect","getEnvIdFromEnvsData","ignoreVersion","rawEnvId","envIdWithoutVersion","ComponentID","fromString","toStringWithoutVersion","getEnvId","envIdFromEnvData","withVersion","resolveEnv","withVersionMatch","toArray","withVersionMatchId","exactMatch","exactMatchId","EnvNotConfiguredForComponent","isUsingCoreEnv","isCoreEnv","getEnv","envDef","getEnvDefinitionByStringId","EnvNotFound","getEnvComponent","host","getHost","newId","resolveComponentId","BitError","getOrCalculateEnv","err","calculateEnv","getDescriptor","calcDescriptor","opts","componentDescriptor","getComponentEnvDescriptor","envComponentSelfDescriptor","getEnvSelfDescriptor","result","self","isEnvRegistered","getEnvFromComponent","services","getServices","selfDescriptor","getEnvDescriptorFromEnvDef","toObject","__getDescriptor","systemDescriptor","type","split","description","matchedEntry","entries","aspectEntry","calculateEnvId","envIdFromEnvsConfig","getEnvIdFromEnvsConfig","envIdFromEnvsConfigWithoutVersion","ids","findFirstEnv","finalId","getEnvDefinitionById","skipWarnings","printWarningIfFirstTime","envDefFromList","getAllEnvsConfiguredOnComponent","getEnvFromEnvsConfig","getEnvsNotFromEnvsConfig","hasEnvConfigured","Boolean","getAllRegisteredEnvs","envData","customizerEntry","getEnvPlugin","EnvPlugin","getEnvIdFromEnvsLegacyExtensions","extensions","envsAspect","findCoreExtension","calculateEnvIdFromExtensions","extension","extensionId","stringId","calculateEnvFromExtensions","getEnvDefinitionByLegacyExtension","isFoundWithoutVersion","pLocate","idWithoutVersion","isCoreAspect","envDefWithoutVersion","hasManifest","isUsingEnvEnv","finalEnvId","getEnvDefinition","allVersions","all","first","head","getEnvsEnvDefinition","message","alreadyShownWarning","isUsingAspectEnv","isEnv","registerService","envServices","register","allServices","currentServices","service","implements","warn","EnvServiceList","registerEnv","registerEnvJsoncMergeCustomizer","addNonLoadedEnvAsComponentIssues","pMapSeries","envIdStr","foundComp","c","issues","getOrCreate","IssuesClasses","ExternalEnvWithoutVersion","componentId","NonLoadedEnv","Runtime","aggregateByDefs","throwForDuplicateComponents","envsMap","Promise","envAspectDef","getEnvAspectDef","EnvRuntime","resolvedAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","useScopeAspectsCapsule","def","idsStr","duplications","findDuplications","provider","graphql","loggerAspect","cli","worker","context","createLogger","envs","registerShowFragments","EnvFragment","registerAddComponentsIssues","envsCmd","EnvsCmd","commands","ListEnvsCmd","GetEnvCmd","environmentsSchema","Slot","withType","GraphqlAspect","LoggerAspect","ComponentAspect","CLIAspect","WorkerAspect","IssuesAspect","addRuntime"],"sources":["environments.main.runtime.ts"],"sourcesContent":["import { join } from 'path';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { isCoreAspect } from '@teambit/bit';\nimport { existsSync, readFileSync } from 'fs-extra';\nimport pLocate from 'p-locate';\nimport { parse } from 'comment-json';\nimport { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport type { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport type { EnvJsoncPatterns } from '@teambit/dev-files';\nimport pMapSeries from 'p-map-series';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ExtensionDataList, ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { BitError } from '@teambit/bit-error';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { head, uniq } from 'lodash';\nimport { WorkerAspect, WorkerMain } from '@teambit/worker';\nimport { ComponentID } from '@teambit/component-id';\nimport { EnvService } from './services';\nimport { Environment } from './environment';\nimport { EnvsAspect } from './environments.aspect';\nimport { environmentsSchema } from './environments.graphql';\nimport { EnvRuntime, Runtime } from './runtime';\nimport { EnvDefinition } from './env-definition';\nimport { EnvServiceList } from './env-service-list';\nimport { EnvsCmd, GetEnvCmd, ListEnvsCmd } from './envs.cmd';\nimport { EnvFragment } from './env.fragment';\nimport { EnvNotFound, EnvNotConfiguredForComponent } from './exceptions';\nimport { EnvPlugin } from './env.plugin';\n\nexport type EnvJsonc = {\n extends?: string;\n policy?: EnvPolicyConfigObject;\n patterns?: EnvJsoncPatterns;\n};\n\nexport type EnvJsoncMergeCustomizer = (parentObj: EnvJsonc, childObj: EnvJsonc) => Partial<EnvJsonc>;\n\nexport type EnvsRegistry = SlotRegistry<Environment>;\nexport type EnvJsoncMergeCustomizerRegistry = SlotRegistry<EnvJsoncMergeCustomizer>;\n\nexport type EnvsConfig = {\n env: string;\n options: EnvOptions;\n};\n\ntype GetCalcEnvOptions = {\n skipWarnings?: boolean;\n};\n\nexport type EnvOptions = {};\n\nexport type EnvTransformer = (env: Environment) => Environment;\n\nexport type ServicesRegistry = SlotRegistry<Array<EnvService<any>>>;\n\nexport type RegularCompDescriptor = {\n id: string;\n icon?: string;\n type?: string;\n name?: string;\n description?: string;\n};\nexport type EnvCompDescriptorProps = RegularCompDescriptor & {\n services?: {\n env: {\n id: string;\n icon: string;\n name?: string;\n description?: string;\n };\n services: Array<{\n id: string;\n name?: string;\n description?: string;\n data: any;\n }>;\n };\n};\n\nexport type EnvCompDescriptor = EnvCompDescriptorProps & {\n self?: EnvCompDescriptorProps;\n};\n\nexport type Descriptor = RegularCompDescriptor | EnvCompDescriptor;\n\nexport const DEFAULT_ENV = 'teambit.harmony/node';\n\nexport class EnvsMain {\n /**\n * Envs that are failed to load\n */\n private failedToLoadEnvs = new Set<string>();\n /**\n * Extensions that are failed to load\n * We use this as sometime when we couldn't load an extension we don't know if it's an env or not\n * We should ideally take it from the aspect loader aspect, but right now the aspect loader is using envs\n */\n private failedToLoadExt = new Set<string>();\n /**\n * Ids of envs (not neccesrraly loaded successfully)\n */\n public envIds = new Set<string>();\n\n static runtime = MainRuntime;\n\n private alreadyShownWarning = {};\n\n /**\n * icon of the extension.\n */\n icon() {\n return `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"25\" cy=\"25\" r=\"20\"/>\n </svg>`;\n }\n\n constructor(\n /**\n * environments extension configuration.\n */\n readonly config: EnvsConfig,\n\n /**\n * harmony context.\n */\n private harmony: Harmony,\n\n /**\n * slot for allowing extensions to register new environment.\n */\n private envSlot: EnvsRegistry,\n\n private logger: Logger,\n\n private servicesRegistry: ServicesRegistry,\n\n private componentMain: ComponentMain,\n\n private loggerMain: LoggerMain,\n\n private workerMain: WorkerMain,\n\n private envJsoncMergeCustomizerSlot: EnvJsoncMergeCustomizerRegistry\n ) {}\n\n /**\n * creates a new runtime environments for a set of components.\n */\n async createEnvironment(components: Component[]): Promise<Runtime> {\n return this.createRuntime(components);\n }\n\n /**\n *\n * @param id\n */\n /**\n * This function adds an extension ID to a set of failed to load extensions.\n * This mostly used by the aspect loader to add such issues\n * Then it is used to hide different errors that are caused by the same issue.\n * @param {string} id - string - represents the unique identifier of an extension that failed to load.\n */\n addFailedToLoadEnvs(id: string) {\n this.failedToLoadEnvs.add(id);\n this.envIds.add(id);\n }\n\n addFailedToLoadExt(id: string) {\n this.failedToLoadExt.add(id);\n if (this.envIds.has(id)) {\n this.addFailedToLoadEnvs(id);\n }\n }\n\n resetFailedToLoadEnvs() {\n this.failedToLoadEnvs.clear();\n this.failedToLoadExt.clear();\n }\n\n getFailedToLoadEnvs() {\n const failedToLoadEnvs = Array.from(this.failedToLoadEnvs);\n // Add all extensions which are also envs\n for (const extId of this.failedToLoadExt) {\n if (this.envIds.has(extId)) {\n failedToLoadEnvs.push(extId);\n }\n }\n return uniq(failedToLoadEnvs);\n }\n\n /**\n * get the configured default env.\n */\n getDefaultEnv(): EnvDefinition {\n const defaultEnv = this.envSlot.get(DEFAULT_ENV);\n if (!defaultEnv) throw new Error('default env must be set.');\n\n return new EnvDefinition(DEFAULT_ENV, defaultEnv);\n }\n\n getCoreEnvsIds(): string[] {\n return [\n 'teambit.harmony/aspect',\n 'teambit.react/react',\n 'teambit.harmony/node',\n 'teambit.react/react-native',\n 'teambit.html/html',\n 'teambit.mdx/mdx',\n 'teambit.envs/env',\n 'teambit.mdx/readme',\n 'teambit.harmony/bit-custom-aspect',\n ];\n }\n\n /**\n * compose a new environment from a list of environment transformers.\n */\n compose(targetEnv: Environment, envTransformers: EnvTransformer[]) {\n const a = envTransformers.reduce((acc, transformer) => {\n acc = transformer(acc);\n return acc;\n }, targetEnv);\n\n return a;\n }\n\n /**\n * create an env transformer which overrides specific env properties.\n */\n override(propsToOverride: Environment): EnvTransformer {\n return (env: Environment) => {\n return this.merge(propsToOverride, env);\n };\n }\n\n /**\n * compose two environments into one.\n */\n merge<T extends Environment, S extends Environment>(targetEnv: Environment, sourceEnv: Environment): T & S {\n const allNames = new Set<string>();\n const keys = ['icon', 'name', 'description'];\n for (let o = sourceEnv; o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n for (const name of Object.getOwnPropertyNames(o)) {\n allNames.add(name);\n }\n }\n\n allNames.forEach((key: string) => {\n const fn = sourceEnv[key];\n if (targetEnv[key]) return;\n if (keys.includes(key)) targetEnv[key] = fn;\n if (!fn || !fn.bind) {\n return;\n }\n targetEnv[key] = fn.bind(sourceEnv);\n });\n\n return targetEnv as T & S;\n }\n\n /**\n * This function checks if an environment manifest file exists in a given component or set of legacy files.\n * @param {Component} [envComponent] - A component object that represents an environment. It contains information about\n * the files and directories that make up the environment.\n * @param {SourceFile[]} [legacyFiles] - An optional array of SourceFile objects representing the files in the legacy\n * file system. If this parameter is not provided, the function will attempt to retrieve the files from the envComponent\n * parameter.\n * @returns a boolean value indicating whether an `env.jsonc` or `env.json` file exists in the `files` array of either\n * the `envComponent` object or the `legacyFiles` array. If neither `envComponent` nor `legacyFiles` are provided, the\n * function returns `undefined`.\n */\n hasEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): boolean | undefined {\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return false;\n return true;\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvJsonc | undefined {\n // TODO: maybe throw an error here?\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return undefined;\n\n const object: EnvJsonc = parse(envJson.contents.toString('utf8'), undefined, true);\n const resolvedObject = this.recursivelyMergeWithParentManifest(object, envJson.path);\n return resolvedObject;\n }\n\n recursivelyMergeWithParentManifest(object: EnvJsonc, originPath: string): EnvJsonc {\n if (!object.extends) return object;\n const parentPackageName = object.extends;\n const parentPath = resolveFrom(originPath, [parentPackageName]);\n const parentResolvedPath = findRoot(parentPath);\n if (!parentResolvedPath || !existsSync(parentResolvedPath)) {\n this.logger.info(`failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath}`);\n }\n const parentEnvJsoncPath = ['env.jsonc', 'env.json']\n .map((fileName) => join(parentResolvedPath, fileName))\n .find((filePath) => {\n return existsSync(filePath);\n });\n if (!parentEnvJsoncPath) {\n this.logger.consoleWarning(\n `failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath} referred from ${originPath}`\n );\n return object;\n }\n const parentStr = readFileSync(parentEnvJsoncPath).toString('utf8');\n const parentObject: EnvJsonc = parse(parentStr, undefined, true);\n const mergedObject = this.mergeEnvManifests(parentObject, object);\n if (mergedObject.extends) {\n return this.recursivelyMergeWithParentManifest(mergedObject, parentEnvJsoncPath);\n }\n return mergedObject;\n }\n\n mergeEnvManifests(parent: EnvJsonc, child: EnvJsonc): EnvJsonc {\n let merged: EnvJsonc = {};\n const mergeCustomizer = this.getAllRegisteredEnvJsoncCustomizers();\n for (const customizer of mergeCustomizer) {\n const oneMerged = customizer(parent, child);\n merged = { ...merged, ...oneMerged };\n }\n // Take extends specifically from the parent so we can propagate it to the next parent\n if (parent.extends) {\n merged.extends = parent.extends;\n }\n return merged;\n }\n\n async hasEnvManifestById(envId: string, requesting: string): Promise<boolean | undefined> {\n const component = await this.getEnvComponentByEnvId(envId, requesting);\n return this.hasEnvManifest(component);\n }\n\n getEnvData(component: Component): Descriptor {\n let envsData = component.state.aspects.get(EnvsAspect.id);\n if (!envsData) {\n // TODO: remove this once we re-export old components used to store the data here\n envsData = component.state.aspects.get('teambit.workspace/workspace');\n }\n if (!envsData) throw new Error(`env was not configured on component ${component.id.toString()}`);\n return envsData.data as Descriptor;\n }\n\n /**\n * Return the id of the env as configured in the envs data (without version by default)\n * The reason it's not contain version by default is that we want to take the version from the aspect defined on the component itself\n * As this version is stay up to date during tagging the env along with the component\n * @param component\n * @param ignoreVersion\n */\n private getEnvIdFromEnvsData(component: Component, ignoreVersion = true): string | undefined {\n const envsData = this.getEnvData(component);\n if (!envsData) return undefined;\n const rawEnvId = envsData.id;\n if (!rawEnvId) return undefined;\n if (!ignoreVersion) return rawEnvId;\n const envIdWithoutVersion = ComponentID.fromString(rawEnvId).toStringWithoutVersion();\n return envIdWithoutVersion;\n }\n\n /**\n * get the env id of the given component.\n */\n getEnvId(component: Component): string {\n const envIdFromEnvData = this.getEnvIdFromEnvsData(component);\n if (!envIdFromEnvData) {\n // This should never happen\n throw new Error(`no env found for ${component.id.toString()}`);\n }\n const withVersion = this.resolveEnv(component, envIdFromEnvData);\n const withVersionMatch = this.envSlot.toArray().find(([envId]) => {\n return withVersion?.toString() === envId;\n });\n const withVersionMatchId = withVersionMatch?.[0];\n if (withVersionMatchId) return withVersionMatchId;\n\n // Handle core envs\n const exactMatch = this.envSlot.toArray().find(([envId]) => {\n return envIdFromEnvData === envId;\n });\n\n const exactMatchId = exactMatch?.[0];\n if (exactMatchId) return exactMatchId;\n\n if (!withVersion) throw new EnvNotConfiguredForComponent(envIdFromEnvData, component.id.toString());\n return withVersion.toString();\n }\n\n isUsingCoreEnv(component: Component): boolean {\n const envId = this.getEnvId(component);\n return this.isCoreEnv(envId);\n }\n\n isCoreEnv(envId: string): boolean {\n return this.getCoreEnvsIds().includes(envId);\n }\n\n /**\n * get the env of the given component.\n * In case you are asking for the env during on load you should use calculateEnv instead\n */\n getEnv(component: Component): EnvDefinition {\n const id = this.getEnvId(component);\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) {\n return envDef;\n }\n // Do not allow a non existing env\n throw new EnvNotFound(id, component.id.toString());\n }\n\n /**\n * get the env component of the given component.\n */\n async getEnvComponent(component: Component): Promise<Component> {\n const envId = this.getEnvId(component);\n return this.getEnvComponentByEnvId(envId, component.id.toString());\n }\n\n /**\n * get the env component by the env id.\n */\n async getEnvComponentByEnvId(envId: string, requesting?: string): Promise<Component> {\n const host = this.componentMain.getHost();\n const newId = await host.resolveComponentId(envId);\n const envComponent = await host.get(newId);\n if (!envComponent) {\n throw new BitError(`can't load env. env id is ${envId} used by component ${requesting || 'unknown'}`);\n }\n return envComponent;\n }\n\n /**\n * get the env of the given component.\n * This will try to use the regular getEnv but fallback to the calculate env (in case you are using it during on load)\n * This is safe to be used on onLoad as well\n */\n getOrCalculateEnv(component: Component): EnvDefinition {\n try {\n return this.getEnv(component);\n } catch (err) {\n return this.calculateEnv(component);\n }\n }\n\n /**\n * get an environment Descriptor.\n */\n getDescriptor(component: Component): Descriptor | undefined {\n const envsData = this.getEnvData(component);\n envsData.id = this.resolveEnv(component, envsData.id)?.toString() || envsData.id;\n return envsData;\n }\n\n async calcDescriptor(component: Component, opts: GetCalcEnvOptions = {}): Promise<Descriptor | undefined> {\n const componentDescriptor = await this.getComponentEnvDescriptor(component, opts);\n if (!componentDescriptor) return undefined;\n const envComponentSelfDescriptor = await this.getEnvSelfDescriptor(component);\n const result = envComponentSelfDescriptor\n ? { ...componentDescriptor, self: envComponentSelfDescriptor }\n : componentDescriptor;\n return result;\n }\n\n /**\n * Get env descriptor from the env itself if the component is an env\n * This will be empty for regular component, and will only contain data for env themself\n */\n private async getEnvSelfDescriptor(envComponent: Component): Promise<EnvCompDescriptorProps | undefined> {\n // !important calculate only on the env itself.\n if (!this.isEnvRegistered(envComponent.id.toString())) {\n return undefined;\n }\n\n const envDef = this.getEnvFromComponent(envComponent);\n if (!envDef) return undefined;\n\n const services = this.getServices(envDef);\n // const selfDescriptor = (await this.getEnvDescriptorFromEnvDef(envDef)) || {};\n const selfDescriptor = await this.getEnvDescriptorFromEnvDef(envDef);\n\n if (!selfDescriptor) return undefined;\n return {\n ...selfDescriptor,\n services: services.toObject(),\n };\n }\n\n /**\n * Get env descriptor from the env that a given component is using\n */\n private async getComponentEnvDescriptor(\n component: Component,\n opts: GetCalcEnvOptions = {}\n ): Promise<RegularCompDescriptor | undefined> {\n const envDef = this.calculateEnv(component, opts);\n return this.getEnvDescriptorFromEnvDef(envDef);\n }\n\n private async getEnvDescriptorFromEnvDef(envDef: EnvDefinition): Promise<RegularCompDescriptor | undefined> {\n if (!envDef.env.__getDescriptor || typeof envDef.env.__getDescriptor !== 'function') {\n return undefined;\n }\n const systemDescriptor = await envDef.env.__getDescriptor();\n\n return {\n type: systemDescriptor.type,\n // Make sure to store the env id in the data without the version\n // The version should always come from the aspect id configured on the component\n id: envDef.id.split('@')[0],\n name: envDef.name,\n icon: envDef.env.icon,\n description: envDef.description,\n };\n }\n\n resolveEnv(component: Component, id: string) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return id === aspectEntry.id.toString() || id === aspectEntry.id.toString({ ignoreVersion: true });\n });\n\n return matchedEntry?.id;\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n async calculateEnvId(component: Component): Promise<ComponentID> {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n // if (!envIdFromEnvsConfig) return this.getDefaultEnv();\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return ComponentID.fromString(envIdFromEnvsConfig);\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n\n if (matchedEntry?.id) return matchedEntry?.id;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let ids: string[] = [];\n component.state.aspects.entries.forEach((aspectEntry) => {\n ids.push(aspectEntry.id.toString());\n // ids.push(aspectEntry.id.toString({ ignoreVersion: true }));\n });\n ids = uniq(ids);\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return ComponentID.fromString(finalId);\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n calculateEnv(component: Component, opts: GetCalcEnvOptions = {}): EnvDefinition {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n let envIdFromEnvsConfigWithoutVersion;\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionById(matchedEntry.id);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n if (!opts.skipWarnings) {\n // Do not allow a non existing env\n this.printWarningIfFirstTime(\n matchedEntry.id.toString(),\n `environment with ID: ${matchedEntry.id.toString()} configured on component ${component.id.toString()} was not loaded (run \"bit install\")`\n );\n }\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig as string, component.id.toString()).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig as string, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let envDefFromList;\n component.state.aspects.entries.find((aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) {\n envDefFromList = envDef;\n }\n return !!envDef;\n });\n\n if (envDefFromList) {\n this.envIds.add(envDefFromList.id);\n return envDefFromList;\n }\n return this.getDefaultEnv();\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns #1 if exists, otherwise, #2.\n */\n getAllEnvsConfiguredOnComponent(component: Component): EnvDefinition[] {\n // if a component has \"envs\" config, use it and ignore other components that are set up\n // in this components which happen to be envs.\n const envDef = this.getEnvFromEnvsConfig(component);\n if (envDef) {\n return [envDef];\n }\n\n return this.getEnvsNotFromEnvsConfig(component);\n }\n\n /**\n * whether a component has an env configured (either by variant or .bitmap).\n */\n hasEnvConfigured(component: Component): boolean {\n return Boolean(this.getAllEnvsConfiguredOnComponent(component).length);\n }\n\n getAllRegisteredEnvs(): string[] {\n return this.envSlot.toArray().map((envData) => envData[0]);\n }\n\n getAllRegisteredEnvJsoncCustomizers(): EnvJsoncMergeCustomizer[] {\n return this.envJsoncMergeCustomizerSlot.toArray().map((customizerEntry) => customizerEntry[1]);\n }\n\n getEnvPlugin() {\n return new EnvPlugin(this.envSlot, this.servicesRegistry, this.loggerMain, this.workerMain, this.harmony);\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #1\n */\n getEnvFromEnvsConfig(component: Component): EnvDefinition | undefined {\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n if (!envIdFromEnvsConfig) {\n return undefined;\n }\n const envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n return envDef;\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #2\n */\n getEnvsNotFromEnvsConfig(component: Component): EnvDefinition[] {\n return component.state.aspects.entries.reduce((acc: EnvDefinition[], aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) acc.push(envDef);\n return acc;\n }, []);\n }\n\n getEnvIdFromEnvsLegacyExtensions(extensions: ExtensionDataList): string | undefined {\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.data.id;\n return envIdFromEnvsConfig;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnvId() instead!)\n */\n async calculateEnvIdFromExtensions(extensions: ExtensionDataList): Promise<string> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return envIdFromEnvsConfig;\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry?.id) return matchedEntry?.stringId;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return finalId;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnv() instead!)\n */\n async calculateEnvFromExtensions(extensions: ExtensionDataList): Promise<EnvDefinition> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n let envIdFromEnvsConfigWithoutVersion;\n\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionByLegacyExtension(matchedEntry);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n // Do not allow a non existing env\n // this.printWarningIfFirstTime(\n // matchedEntry.id.toString(),\n // `environment with ID: ${matchedEntry.id.toString()} was not found`\n // );\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const envDef = envId ? this.getEnvDefinitionByStringId(envId) : undefined;\n\n return envDef || this.getDefaultEnv();\n }\n\n /**\n * This function finds the first environment ID from a list of IDs by checking if it is register as env (to the slot).\n * or contains env.jsonc file\n * @param {string[]} ids - `ids` is an array of string values representing environment IDs. The function `findFirstEnv`\n * takes this array as input and returns a Promise that resolves to a string value representing the first environment ID\n * that matches certain conditions.\n * @returns The `findFirstEnv` function returns a Promise that resolves to a string or undefined. The string represents\n * the ID of the first environment that matches the conditions specified in the function, or undefined if no environment\n * is found.\n */\n private async findFirstEnv(ids: string[]): Promise<string | undefined> {\n let isFoundWithoutVersion = false;\n const envId = await pLocate(ids, async (id) => {\n const idWithoutVersion = id.split('@')[0];\n if (this.isCoreEnv(idWithoutVersion)) return true;\n if (isCoreAspect(idWithoutVersion)) return false;\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) return true;\n const envDefWithoutVersion = this.getEnvDefinitionByStringId(idWithoutVersion);\n if (envDefWithoutVersion) {\n isFoundWithoutVersion = true;\n return true;\n }\n const envComponent = await this.getEnvComponentByEnvId(id);\n const hasManifest = this.hasEnvManifest(envComponent);\n if (hasManifest) return true;\n const isUsingEnvEnv = this.isUsingEnvEnv(envComponent);\n return !!isUsingEnvEnv;\n });\n let finalEnvId;\n if (envId) {\n finalEnvId = isFoundWithoutVersion ? envId?.split('@')[0] : envId;\n this.envIds.add(envId);\n }\n return finalEnvId;\n }\n\n private getEnvDefinitionByLegacyExtension(extension: ExtensionDataEntry): EnvDefinition | undefined {\n const envDef = extension.extensionId\n ? this.getEnvDefinitionById(extension.extensionId)\n : this.getEnvDefinitionByStringId(extension.stringId);\n return envDef;\n }\n\n getEnvIdFromEnvsConfig(component: Component): string | undefined {\n const envsAspect = component.state.aspects.get(EnvsAspect.id);\n return envsAspect?.config.env;\n }\n\n getEnvDefinition(id: ComponentID) {\n const allVersions = this.envSlot.toArray();\n const all = allVersions.filter(([envId]) => envId.includes(id.toStringWithoutVersion()));\n const first = head(all);\n if (!first) return undefined;\n const [envId, env] = first;\n return new EnvDefinition(envId, env);\n }\n\n getEnvDefinitionById(id: ComponentID): EnvDefinition | undefined {\n const envDef =\n this.getEnvDefinitionByStringId(id.toString()) ||\n this.getEnvDefinitionByStringId(id.toString({ ignoreVersion: true }));\n return envDef;\n }\n\n public getEnvDefinitionByStringId(envId: string): EnvDefinition | undefined {\n const env = this.envSlot.get(envId);\n if (env) {\n return new EnvDefinition(envId, env as Environment);\n }\n return undefined;\n }\n\n getEnvFromComponent(envComponent: Component): EnvDefinition | undefined {\n const env = this.getEnvDefinitionById(envComponent.id);\n return env;\n }\n\n /**\n * Return the env definition of teambit.envs/env\n */\n getEnvsEnvDefinition(): EnvDefinition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.getEnvDefinitionByStringId('teambit.envs/env')!;\n }\n\n private printWarningIfFirstTime(envId: string, message: string) {\n if (!this.alreadyShownWarning[envId] && !this.failedToLoadEnvs.has(envId)) {\n this.alreadyShownWarning[envId] = true;\n this.logger.consoleWarning(message);\n this.addFailedToLoadEnvs(envId);\n }\n }\n\n /**\n * determines whether an env is registered.\n */\n public isEnvRegistered(id: string) {\n return Boolean(this.envSlot.get(id));\n }\n\n isUsingAspectEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'aspect';\n }\n\n isUsingEnvEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'env';\n }\n\n /**\n * Check if the given component is an env component.\n * @param component\n * @returns\n */\n isEnv(component: Component): boolean {\n return (\n this.isUsingEnvEnv(component) ||\n this.isEnvRegistered(component.id.toString()) ||\n this.isEnvRegistered(component.id.toStringWithoutVersion())\n );\n }\n\n /**\n * register a new environment service.\n */\n registerService(...envServices: EnvService<any>[]) {\n this.servicesRegistry.register(envServices);\n return this;\n }\n\n /**\n * get list of services enabled on an env.\n */\n getServices(env: EnvDefinition): EnvServiceList {\n const allServices = this.servicesRegistry.toArray();\n const services: [string, EnvService<any>][] = [];\n allServices.forEach(([id, currentServices]) => {\n currentServices.forEach((service) => {\n try {\n if (this.implements(env, service)) {\n services.push([id, service]);\n }\n } catch (err) {\n this.logger.warn(`failed loading service ${id} for env ${env.id}`);\n }\n });\n });\n return new EnvServiceList(env, services);\n }\n\n implements(env: EnvDefinition, service: EnvService<any>) {\n // TODO: remove this after refactoring everything and remove getDescriptor from being optional.\n if (!service.getDescriptor) return false;\n return !!service.getDescriptor(env);\n }\n\n /**\n * register an environment.\n */\n registerEnv(env: Environment) {\n return this.envSlot.register(env);\n }\n\n /**\n * register an env.jsonc merge customizer.\n */\n registerEnvJsoncMergeCustomizer(customizer: EnvJsoncMergeCustomizer) {\n return this.envJsoncMergeCustomizerSlot.register(customizer);\n }\n\n async addNonLoadedEnvAsComponentIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n const envId = await this.calculateEnvId(component);\n const envIdStr = envId.toString();\n if (!this.isEnvRegistered(envIdStr)) {\n this.addFailedToLoadEnvs(envIdStr);\n // If there is no version and the env is not in the workspace this is not valid\n // you can't set external env without version\n if (!envIdStr.includes('@')) {\n const foundComp = components.find((c) => c.id.toStringWithoutVersion() === envIdStr);\n if (!foundComp) {\n component.state.issues.getOrCreate(IssuesClasses.ExternalEnvWithoutVersion).data = {\n envId: envIdStr,\n componentId: component.id.toString(),\n };\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n }\n });\n }\n\n // refactor here\n private async createRuntime(components: Component[]): Promise<Runtime> {\n return new Runtime(await this.aggregateByDefs(components), this.logger);\n }\n\n // :TODO can be refactored to few utilities who will make repeating this very easy.\n private async aggregateByDefs(components: Component[]): Promise<EnvRuntime[]> {\n this.throwForDuplicateComponents(components);\n const envsMap = {};\n components.forEach((component: Component) => {\n const envDef = this.getEnv(component);\n const envId = envDef.id;\n const env = envDef.env;\n // handle config as well when aggregating envs.\n if (envsMap[envId]) envsMap[envId].components.push(component);\n else\n envsMap[envId] = {\n components: [component],\n env,\n };\n });\n\n return Promise.all(\n Object.keys(envsMap).map(async (key) => {\n const envAspectDef = await this.getEnvAspectDef(key);\n return new EnvRuntime(key, envsMap[key].env, envsMap[key].components, envAspectDef);\n })\n );\n }\n\n private async getEnvAspectDef(envId: string): Promise<AspectDefinition> {\n const host = this.componentMain.getHost();\n const id = await host.resolveComponentId(envId);\n // We don't want to filter by runtime here as we want to also get envs that configured as plugins. so they don't\n // contain the runtime path.\n const resolvedAspects = await host.resolveAspects(MainRuntime.name, [id], {\n requestedOnly: true,\n filterByRuntime: false,\n useScopeAspectsCapsule: true,\n });\n const def = resolvedAspects[0];\n\n return def;\n }\n\n private throwForDuplicateComponents(components: Component[]) {\n const idsStr = components.map((c) => c.id.toString());\n const duplications = findDuplications(idsStr);\n if (duplications.length) {\n throw new Error(`found duplicated components: ${duplications.join(', ')}`);\n }\n }\n\n static slots = [\n Slot.withType<Environment>(),\n Slot.withType<EnvService<any>>(),\n Slot.withType<EnvJsoncMergeCustomizerRegistry>(),\n ];\n\n static dependencies = [GraphqlAspect, LoggerAspect, ComponentAspect, CLIAspect, WorkerAspect, IssuesAspect];\n\n static async provider(\n [graphql, loggerAspect, component, cli, worker, issues]: [\n GraphqlMain,\n LoggerMain,\n ComponentMain,\n CLIMain,\n WorkerMain,\n IssuesMain\n ],\n config: EnvsConfig,\n [envSlot, servicesRegistry, envJsoncMergeCustomizerSlot]: [\n EnvsRegistry,\n ServicesRegistry,\n EnvJsoncMergeCustomizerRegistry\n ],\n context: Harmony\n ) {\n const logger = loggerAspect.createLogger(EnvsAspect.id);\n const envs = new EnvsMain(\n config,\n context,\n envSlot,\n logger,\n servicesRegistry,\n component,\n loggerAspect,\n worker,\n envJsoncMergeCustomizerSlot\n );\n component.registerShowFragments([new EnvFragment(envs)]);\n if (issues) issues.registerAddComponentsIssues(envs.addNonLoadedEnvAsComponentIssues.bind(envs));\n\n const envsCmd = new EnvsCmd(envs, component);\n envsCmd.commands = [new ListEnvsCmd(envs, component), new GetEnvCmd(envs, component)];\n cli.register(envsCmd);\n graphql.register(environmentsSchema(envs));\n return envs;\n }\n}\n\nEnvsAspect.addRuntime(EnvsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,I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J,SAAS,CAAC;IAC5CmK,OAAO,CAACE,QAAQ,GAAG,CAAC,KAAIC,mBAAW,EAACP,IAAI,EAAE/J,SAAS,CAAC,EAAE,KAAIuK,iBAAS,EAACR,IAAI,EAAE/J,SAAS,CAAC,CAAC;IACrF2J,GAAG,CAACzC,QAAQ,CAACiD,OAAO,CAAC;IACrBV,OAAO,CAACvC,QAAQ,CAAC,IAAAsD,mCAAkB,EAACT,IAAI,CAAC,CAAC;IAC1C,OAAOA,IAAI;EACb;AACF;AAACzQ,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAAAnB,eAAA,CAnhCYmB,QAAQ,aAgBFyP,kBAAW;AAAA5Q,eAAA,CAhBjBmB,QAAQ,WAq+BJ,CACbkR,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAkC,CAAC,CACjD;AAAAtS,eAAA,CAz+BUmB,QAAQ,kBA2+BG,CAACoR,wBAAa,EAAEC,sBAAY,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA0C7G1K,0BAAU,CAAC2K,UAAU,CAAC1R,QAAQ,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_bit","_fsExtra","_pLocate","_commentJson","_cli","_component","_graphql","_issues","_pMapSeries","_componentIssues","_harmony","_logger","_bitError","_toolboxArray","_lodash","_worker","_componentId","_environments","_environments2","_runtime","_envDefinition","_envServiceList","_envs","_env","_exceptions","_env2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_ENV","exports","EnvsMain","icon","constructor","config","harmony","envSlot","logger","servicesRegistry","componentMain","loggerMain","workerMain","envJsoncMergeCustomizerSlot","Set","createEnvironment","components","createRuntime","addFailedToLoadEnvs","id","failedToLoadEnvs","add","envIds","addFailedToLoadExt","failedToLoadExt","has","resetFailedToLoadEnvs","clear","getFailedToLoadEnvs","Array","from","extId","uniq","getDefaultEnv","defaultEnv","get","Error","EnvDefinition","getCoreEnvsIds","compose","targetEnv","envTransformers","a","reduce","acc","transformer","override","propsToOverride","env","merge","sourceEnv","allNames","prototype","getPrototypeOf","name","getOwnPropertyNames","key","fn","includes","bind","hasEnvManifest","envComponent","legacyFiles","undefined","files","filesystem","envJson","find","file","relative","getEnvManifest","object","parse","contents","toString","resolvedObject","recursivelyMergeWithParentManifest","path","originPath","extends","parentPackageName","parentPath","resolveFrom","parentResolvedPath","findRoot","existsSync","info","parentEnvJsoncPath","map","fileName","join","filePath","consoleWarning","parentStr","readFileSync","parentObject","mergedObject","mergeEnvManifests","parent","child","merged","mergeCustomizer","getAllRegisteredEnvJsoncCustomizers","customizer","oneMerged","hasEnvManifestById","envId","requesting","component","getEnvComponentByEnvId","getEnvData","envsData","state","aspects","EnvsAspect","getEnvIdFromEnvsData","ignoreVersion","rawEnvId","envIdWithoutVersion","ComponentID","fromString","toStringWithoutVersion","getEnvId","envIdFromEnvData","withVersion","resolveEnv","withVersionMatch","toArray","withVersionMatchId","exactMatch","exactMatchId","EnvNotConfiguredForComponent","isUsingCoreEnv","isCoreEnv","getEnv","envDef","getEnvDefinitionByStringId","EnvNotFound","getEnvComponent","host","getHost","newId","resolveComponentId","BitError","getOrCalculateEnv","err","calculateEnv","getDescriptor","calcDescriptor","opts","componentDescriptor","getComponentEnvDescriptor","envComponentSelfDescriptor","getEnvSelfDescriptor","result","self","isEnvRegistered","getEnvFromComponent","services","getServices","selfDescriptor","getEnvDescriptorFromEnvDef","toObject","__getDescriptor","systemDescriptor","type","split","description","matchedEntry","entries","aspectEntry","calculateEnvId","envIdFromEnvsConfig","getEnvIdFromEnvsConfig","envIdFromEnvsConfigWithoutVersion","ids","findFirstEnv","finalId","getEnvDefinitionById","skipWarnings","printWarningIfFirstTime","envDefFromList","getAllEnvsConfiguredOnComponent","getEnvFromEnvsConfig","getEnvsNotFromEnvsConfig","hasEnvConfigured","Boolean","getAllRegisteredEnvs","envData","customizerEntry","getEnvPlugin","EnvPlugin","getEnvIdFromEnvsLegacyExtensions","extensions","envsAspect","findCoreExtension","calculateEnvIdFromExtensions","extension","extensionId","stringId","calculateEnvFromExtensions","getEnvDefinitionByLegacyExtension","isFoundWithoutVersion","pLocate","idWithoutVersion","isCoreAspect","envDefWithoutVersion","hasManifest","isUsingEnvEnv","finalEnvId","getEnvDefinition","allVersions","all","first","head","getEnvsEnvDefinition","message","alreadyShownWarning","isUsingAspectEnv","isEnv","registerService","envServices","register","allServices","currentServices","service","implements","warn","EnvServiceList","registerEnv","registerEnvJsoncMergeCustomizer","addNonLoadedEnvAsComponentIssues","pMapSeries","envIdStr","foundComp","c","issues","getOrCreate","IssuesClasses","ExternalEnvWithoutVersion","componentId","NonLoadedEnv","Runtime","aggregateByDefs","throwForDuplicateComponents","envsMap","Promise","envAspectDef","getEnvAspectDef","EnvRuntime","resolvedAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","useScopeAspectsCapsule","def","idsStr","duplications","findDuplications","provider","graphql","loggerAspect","cli","worker","context","createLogger","envs","registerShowFragments","EnvFragment","registerAddComponentsIssues","envsCmd","EnvsCmd","commands","ListEnvsCmd","GetEnvCmd","environmentsSchema","Slot","withType","GraphqlAspect","LoggerAspect","ComponentAspect","CLIAspect","WorkerAspect","IssuesAspect","addRuntime"],"sources":["environments.main.runtime.ts"],"sourcesContent":["import { join } from 'path';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { isCoreAspect } from '@teambit/bit';\nimport { existsSync, readFileSync } from 'fs-extra';\nimport pLocate from 'p-locate';\nimport { parse } from 'comment-json';\nimport { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport type { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport type { EnvJsoncPatterns } from '@teambit/dev-files';\nimport pMapSeries from 'p-map-series';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ExtensionDataList, ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { BitError } from '@teambit/bit-error';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { head, uniq } from 'lodash';\nimport { WorkerAspect, WorkerMain } from '@teambit/worker';\nimport { ComponentID } from '@teambit/component-id';\nimport { EnvService } from './services';\nimport { Environment } from './environment';\nimport { EnvsAspect } from './environments.aspect';\nimport { environmentsSchema } from './environments.graphql';\nimport { EnvRuntime, Runtime } from './runtime';\nimport { EnvDefinition } from './env-definition';\nimport { EnvServiceList } from './env-service-list';\nimport { EnvsCmd, GetEnvCmd, ListEnvsCmd } from './envs.cmd';\nimport { EnvFragment } from './env.fragment';\nimport { EnvNotFound, EnvNotConfiguredForComponent } from './exceptions';\nimport { EnvPlugin } from './env.plugin';\n\nexport type EnvJsonc = {\n extends?: string;\n policy?: EnvPolicyConfigObject;\n patterns?: EnvJsoncPatterns;\n};\n\nexport type EnvJsoncMergeCustomizer = (parentObj: EnvJsonc, childObj: EnvJsonc) => Partial<EnvJsonc>;\n\nexport type EnvsRegistry = SlotRegistry<Environment>;\nexport type EnvJsoncMergeCustomizerRegistry = SlotRegistry<EnvJsoncMergeCustomizer>;\n\nexport type EnvsConfig = {\n env: string;\n options: EnvOptions;\n};\n\ntype GetCalcEnvOptions = {\n skipWarnings?: boolean;\n};\n\nexport type EnvOptions = {};\n\nexport type EnvTransformer = (env: Environment) => Environment;\n\nexport type ServicesRegistry = SlotRegistry<Array<EnvService<any>>>;\n\nexport type RegularCompDescriptor = {\n id: string;\n icon?: string;\n type?: string;\n name?: string;\n description?: string;\n};\nexport type EnvCompDescriptorProps = RegularCompDescriptor & {\n services?: {\n env: {\n id: string;\n icon: string;\n name?: string;\n description?: string;\n };\n services: Array<{\n id: string;\n name?: string;\n description?: string;\n data: any;\n }>;\n };\n};\n\nexport type EnvCompDescriptor = EnvCompDescriptorProps & {\n self?: EnvCompDescriptorProps;\n};\n\nexport type Descriptor = RegularCompDescriptor | EnvCompDescriptor;\n\nexport const DEFAULT_ENV = 'teambit.harmony/node';\n\nexport class EnvsMain {\n /**\n * Envs that are failed to load\n */\n private failedToLoadEnvs = new Set<string>();\n /**\n * Extensions that are failed to load\n * We use this as sometime when we couldn't load an extension we don't know if it's an env or not\n * We should ideally take it from the aspect loader aspect, but right now the aspect loader is using envs\n */\n private failedToLoadExt = new Set<string>();\n /**\n * Ids of envs (not neccesrraly loaded successfully)\n */\n public envIds = new Set<string>();\n\n static runtime = MainRuntime;\n\n private alreadyShownWarning = {};\n\n /**\n * icon of the extension.\n */\n icon() {\n return `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"25\" cy=\"25\" r=\"20\"/>\n </svg>`;\n }\n\n constructor(\n /**\n * environments extension configuration.\n */\n readonly config: EnvsConfig,\n\n /**\n * harmony context.\n */\n private harmony: Harmony,\n\n /**\n * slot for allowing extensions to register new environment.\n */\n private envSlot: EnvsRegistry,\n\n private logger: Logger,\n\n private servicesRegistry: ServicesRegistry,\n\n private componentMain: ComponentMain,\n\n private loggerMain: LoggerMain,\n\n private workerMain: WorkerMain,\n\n private envJsoncMergeCustomizerSlot: EnvJsoncMergeCustomizerRegistry\n ) {}\n\n /**\n * creates a new runtime environments for a set of components.\n */\n async createEnvironment(components: Component[]): Promise<Runtime> {\n return this.createRuntime(components);\n }\n\n /**\n *\n * @param id\n */\n /**\n * This function adds an extension ID to a set of failed to load extensions.\n * This mostly used by the aspect loader to add such issues\n * Then it is used to hide different errors that are caused by the same issue.\n * @param {string} id - string - represents the unique identifier of an extension that failed to load.\n */\n addFailedToLoadEnvs(id: string) {\n this.failedToLoadEnvs.add(id);\n this.envIds.add(id);\n }\n\n addFailedToLoadExt(id: string) {\n this.failedToLoadExt.add(id);\n if (this.envIds.has(id)) {\n this.addFailedToLoadEnvs(id);\n }\n }\n\n resetFailedToLoadEnvs() {\n this.failedToLoadEnvs.clear();\n this.failedToLoadExt.clear();\n }\n\n getFailedToLoadEnvs() {\n const failedToLoadEnvs = Array.from(this.failedToLoadEnvs);\n // Add all extensions which are also envs\n for (const extId of this.failedToLoadExt) {\n if (this.envIds.has(extId)) {\n failedToLoadEnvs.push(extId);\n }\n }\n return uniq(failedToLoadEnvs);\n }\n\n /**\n * get the configured default env.\n */\n getDefaultEnv(): EnvDefinition {\n const defaultEnv = this.envSlot.get(DEFAULT_ENV);\n if (!defaultEnv) throw new Error('default env must be set.');\n\n return new EnvDefinition(DEFAULT_ENV, defaultEnv);\n }\n\n getCoreEnvsIds(): string[] {\n return [\n 'teambit.harmony/aspect',\n 'teambit.react/react',\n 'teambit.harmony/node',\n 'teambit.react/react-native',\n 'teambit.html/html',\n 'teambit.mdx/mdx',\n 'teambit.envs/env',\n 'teambit.mdx/readme',\n 'teambit.harmony/bit-custom-aspect',\n ];\n }\n\n /**\n * compose a new environment from a list of environment transformers.\n */\n compose(targetEnv: Environment, envTransformers: EnvTransformer[]) {\n const a = envTransformers.reduce((acc, transformer) => {\n acc = transformer(acc);\n return acc;\n }, targetEnv);\n\n return a;\n }\n\n /**\n * create an env transformer which overrides specific env properties.\n */\n override(propsToOverride: Environment): EnvTransformer {\n return (env: Environment) => {\n return this.merge(propsToOverride, env);\n };\n }\n\n /**\n * compose two environments into one.\n */\n merge<T extends Environment, S extends Environment>(targetEnv: Environment, sourceEnv: Environment): T & S {\n const allNames = new Set<string>();\n const keys = ['icon', 'name', 'description'];\n for (let o = sourceEnv; o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n for (const name of Object.getOwnPropertyNames(o)) {\n allNames.add(name);\n }\n }\n\n allNames.forEach((key: string) => {\n const fn = sourceEnv[key];\n if (targetEnv[key]) return;\n if (keys.includes(key)) targetEnv[key] = fn;\n if (!fn || !fn.bind) {\n return;\n }\n targetEnv[key] = fn.bind(sourceEnv);\n });\n\n return targetEnv as T & S;\n }\n\n /**\n * This function checks if an environment manifest file exists in a given component or set of legacy files.\n * @param {Component} [envComponent] - A component object that represents an environment. It contains information about\n * the files and directories that make up the environment.\n * @param {SourceFile[]} [legacyFiles] - An optional array of SourceFile objects representing the files in the legacy\n * file system. If this parameter is not provided, the function will attempt to retrieve the files from the envComponent\n * parameter.\n * @returns a boolean value indicating whether an `env.jsonc` or `env.json` file exists in the `files` array of either\n * the `envComponent` object or the `legacyFiles` array. If neither `envComponent` nor `legacyFiles` are provided, the\n * function returns `undefined`.\n */\n hasEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): boolean | undefined {\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return false;\n return true;\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvJsonc | undefined {\n // TODO: maybe throw an error here?\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return undefined;\n\n const object: EnvJsonc = parse(envJson.contents.toString('utf8'), undefined, true);\n const resolvedObject = this.recursivelyMergeWithParentManifest(object, envJson.path);\n return resolvedObject;\n }\n\n recursivelyMergeWithParentManifest(object: EnvJsonc, originPath: string): EnvJsonc {\n if (!object.extends) return object;\n const parentPackageName = object.extends;\n const parentPath = resolveFrom(originPath, [parentPackageName]);\n const parentResolvedPath = findRoot(parentPath);\n if (!parentResolvedPath || !existsSync(parentResolvedPath)) {\n this.logger.info(`failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath}`);\n }\n const parentEnvJsoncPath = ['env.jsonc', 'env.json']\n .map((fileName) => join(parentResolvedPath, fileName))\n .find((filePath) => {\n return existsSync(filePath);\n });\n if (!parentEnvJsoncPath) {\n this.logger.consoleWarning(\n `failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath} referred from ${originPath}`\n );\n return object;\n }\n const parentStr = readFileSync(parentEnvJsoncPath).toString('utf8');\n const parentObject: EnvJsonc = parse(parentStr, undefined, true);\n const mergedObject = this.mergeEnvManifests(parentObject, object);\n if (mergedObject.extends) {\n return this.recursivelyMergeWithParentManifest(mergedObject, parentEnvJsoncPath);\n }\n return mergedObject;\n }\n\n mergeEnvManifests(parent: EnvJsonc, child: EnvJsonc): EnvJsonc {\n let merged: EnvJsonc = {};\n const mergeCustomizer = this.getAllRegisteredEnvJsoncCustomizers();\n for (const customizer of mergeCustomizer) {\n const oneMerged = customizer(parent, child);\n merged = { ...merged, ...oneMerged };\n }\n // Take extends specifically from the parent so we can propagate it to the next parent\n if (parent.extends) {\n merged.extends = parent.extends;\n }\n return merged;\n }\n\n async hasEnvManifestById(envId: string, requesting: string): Promise<boolean | undefined> {\n const component = await this.getEnvComponentByEnvId(envId, requesting);\n return this.hasEnvManifest(component);\n }\n\n getEnvData(component: Component): Descriptor {\n let envsData = component.state.aspects.get(EnvsAspect.id);\n if (!envsData) {\n // TODO: remove this once we re-export old components used to store the data here\n envsData = component.state.aspects.get('teambit.workspace/workspace');\n }\n if (!envsData) throw new Error(`env was not configured on component ${component.id.toString()}`);\n return envsData.data as Descriptor;\n }\n\n /**\n * Return the id of the env as configured in the envs data (without version by default)\n * The reason it's not contain version by default is that we want to take the version from the aspect defined on the component itself\n * As this version is stay up to date during tagging the env along with the component\n * @param component\n * @param ignoreVersion\n */\n private getEnvIdFromEnvsData(component: Component, ignoreVersion = true): string | undefined {\n const envsData = this.getEnvData(component);\n if (!envsData) return undefined;\n const rawEnvId = envsData.id;\n if (!rawEnvId) return undefined;\n if (!ignoreVersion) return rawEnvId;\n const envIdWithoutVersion = ComponentID.fromString(rawEnvId).toStringWithoutVersion();\n return envIdWithoutVersion;\n }\n\n /**\n * get the env id of the given component.\n */\n getEnvId(component: Component): string {\n const envIdFromEnvData = this.getEnvIdFromEnvsData(component);\n if (!envIdFromEnvData) {\n // This should never happen\n throw new Error(`no env found for ${component.id.toString()}`);\n }\n const withVersion = this.resolveEnv(component, envIdFromEnvData);\n const withVersionMatch = this.envSlot.toArray().find(([envId]) => {\n return withVersion?.toString() === envId;\n });\n const withVersionMatchId = withVersionMatch?.[0];\n if (withVersionMatchId) return withVersionMatchId;\n\n // Handle core envs\n const exactMatch = this.envSlot.toArray().find(([envId]) => {\n return envIdFromEnvData === envId;\n });\n\n const exactMatchId = exactMatch?.[0];\n if (exactMatchId) return exactMatchId;\n\n if (!withVersion) throw new EnvNotConfiguredForComponent(envIdFromEnvData, component.id.toString());\n return withVersion.toString();\n }\n\n isUsingCoreEnv(component: Component): boolean {\n const envId = this.getEnvId(component);\n return this.isCoreEnv(envId);\n }\n\n isCoreEnv(envId: string): boolean {\n return this.getCoreEnvsIds().includes(envId);\n }\n\n /**\n * get the env of the given component.\n * In case you are asking for the env during on load you should use calculateEnv instead\n */\n getEnv(component: Component): EnvDefinition {\n const id = this.getEnvId(component);\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) {\n return envDef;\n }\n // Do not allow a non existing env\n throw new EnvNotFound(id, component.id.toString());\n }\n\n /**\n * get the env component of the given component.\n */\n async getEnvComponent(component: Component): Promise<Component> {\n const envId = this.getEnvId(component);\n return this.getEnvComponentByEnvId(envId, component.id.toString());\n }\n\n /**\n * get the env component by the env id.\n */\n async getEnvComponentByEnvId(envId: string, requesting?: string): Promise<Component> {\n const host = this.componentMain.getHost();\n const newId = await host.resolveComponentId(envId);\n const envComponent = await host.get(newId);\n if (!envComponent) {\n throw new BitError(`can't load env. env id is ${envId} used by component ${requesting || 'unknown'}`);\n }\n return envComponent;\n }\n\n /**\n * get the env of the given component.\n * This will try to use the regular getEnv but fallback to the calculate env (in case you are using it during on load)\n * This is safe to be used on onLoad as well\n */\n getOrCalculateEnv(component: Component): EnvDefinition {\n try {\n return this.getEnv(component);\n } catch (err) {\n return this.calculateEnv(component);\n }\n }\n\n /**\n * get an environment Descriptor.\n */\n getDescriptor(component: Component): Descriptor | undefined {\n const envsData = this.getEnvData(component);\n envsData.id = this.resolveEnv(component, envsData.id)?.toString() || envsData.id;\n return envsData;\n }\n\n async calcDescriptor(component: Component, opts: GetCalcEnvOptions = {}): Promise<Descriptor | undefined> {\n const componentDescriptor = await this.getComponentEnvDescriptor(component, opts);\n if (!componentDescriptor) return undefined;\n const envComponentSelfDescriptor = await this.getEnvSelfDescriptor(component);\n const result = envComponentSelfDescriptor\n ? { ...componentDescriptor, self: envComponentSelfDescriptor }\n : componentDescriptor;\n return result;\n }\n\n /**\n * Get env descriptor from the env itself if the component is an env\n * This will be empty for regular component, and will only contain data for env themself\n */\n private async getEnvSelfDescriptor(envComponent: Component): Promise<EnvCompDescriptorProps | undefined> {\n // !important calculate only on the env itself.\n if (!this.isEnvRegistered(envComponent.id.toString())) {\n return undefined;\n }\n\n const envDef = this.getEnvFromComponent(envComponent);\n if (!envDef) return undefined;\n\n const services = this.getServices(envDef);\n // const selfDescriptor = (await this.getEnvDescriptorFromEnvDef(envDef)) || {};\n const selfDescriptor = await this.getEnvDescriptorFromEnvDef(envDef);\n\n if (!selfDescriptor) return undefined;\n return {\n ...selfDescriptor,\n services: services.toObject(),\n };\n }\n\n /**\n * Get env descriptor from the env that a given component is using\n */\n private async getComponentEnvDescriptor(\n component: Component,\n opts: GetCalcEnvOptions = {}\n ): Promise<RegularCompDescriptor | undefined> {\n const envDef = this.calculateEnv(component, opts);\n return this.getEnvDescriptorFromEnvDef(envDef);\n }\n\n private async getEnvDescriptorFromEnvDef(envDef: EnvDefinition): Promise<RegularCompDescriptor | undefined> {\n if (!envDef.env.__getDescriptor || typeof envDef.env.__getDescriptor !== 'function') {\n return undefined;\n }\n const systemDescriptor = await envDef.env.__getDescriptor();\n\n return {\n type: systemDescriptor.type,\n // Make sure to store the env id in the data without the version\n // The version should always come from the aspect id configured on the component\n id: envDef.id.split('@')[0],\n name: envDef.name,\n icon: envDef.env.icon,\n description: envDef.description,\n };\n }\n\n resolveEnv(component: Component, id: string) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return id === aspectEntry.id.toString() || id === aspectEntry.id.toString({ ignoreVersion: true });\n });\n\n return matchedEntry?.id;\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n async calculateEnvId(component: Component): Promise<ComponentID> {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n // if (!envIdFromEnvsConfig) return this.getDefaultEnv();\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return ComponentID.fromString(envIdFromEnvsConfig);\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n\n if (matchedEntry?.id) return matchedEntry?.id;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let ids: string[] = [];\n component.state.aspects.entries.forEach((aspectEntry) => {\n ids.push(aspectEntry.id.toString());\n // ids.push(aspectEntry.id.toString({ ignoreVersion: true }));\n });\n ids = uniq(ids);\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return ComponentID.fromString(finalId);\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n calculateEnv(component: Component, opts: GetCalcEnvOptions = {}): EnvDefinition {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n let envIdFromEnvsConfigWithoutVersion;\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionById(matchedEntry.id);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n if (!opts.skipWarnings) {\n // Do not allow a non existing env\n this.printWarningIfFirstTime(\n matchedEntry.id.toString(),\n `environment with ID: ${matchedEntry.id.toString()} configured on component ${component.id.toString()} was not loaded (run \"bit install\")`\n );\n }\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig as string, component.id.toString()).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig as string, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let envDefFromList;\n component.state.aspects.entries.find((aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) {\n envDefFromList = envDef;\n }\n return !!envDef;\n });\n\n if (envDefFromList) {\n this.envIds.add(envDefFromList.id);\n return envDefFromList;\n }\n return this.getDefaultEnv();\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns #1 if exists, otherwise, #2.\n */\n getAllEnvsConfiguredOnComponent(component: Component): EnvDefinition[] {\n // if a component has \"envs\" config, use it and ignore other components that are set up\n // in this components which happen to be envs.\n const envDef = this.getEnvFromEnvsConfig(component);\n if (envDef) {\n return [envDef];\n }\n\n return this.getEnvsNotFromEnvsConfig(component);\n }\n\n /**\n * whether a component has an env configured (either by variant or .bitmap).\n */\n hasEnvConfigured(component: Component): boolean {\n return Boolean(this.getAllEnvsConfiguredOnComponent(component).length);\n }\n\n getAllRegisteredEnvs(): string[] {\n return this.envSlot.toArray().map((envData) => envData[0]);\n }\n\n getAllRegisteredEnvJsoncCustomizers(): EnvJsoncMergeCustomizer[] {\n return this.envJsoncMergeCustomizerSlot.toArray().map((customizerEntry) => customizerEntry[1]);\n }\n\n getEnvPlugin() {\n return new EnvPlugin(this.envSlot, this.servicesRegistry, this.loggerMain, this.workerMain, this.harmony);\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #1\n */\n getEnvFromEnvsConfig(component: Component): EnvDefinition | undefined {\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n if (!envIdFromEnvsConfig) {\n return undefined;\n }\n const envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n return envDef;\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #2\n */\n getEnvsNotFromEnvsConfig(component: Component): EnvDefinition[] {\n return component.state.aspects.entries.reduce((acc: EnvDefinition[], aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) acc.push(envDef);\n return acc;\n }, []);\n }\n\n getEnvIdFromEnvsLegacyExtensions(extensions: ExtensionDataList): string | undefined {\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.data.id;\n return envIdFromEnvsConfig;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnvId() instead!)\n */\n async calculateEnvIdFromExtensions(extensions: ExtensionDataList): Promise<string> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return envIdFromEnvsConfig;\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry?.id) return matchedEntry?.stringId;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return finalId;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnv() instead!)\n */\n async calculateEnvFromExtensions(extensions: ExtensionDataList): Promise<EnvDefinition> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n let envIdFromEnvsConfigWithoutVersion;\n\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionByLegacyExtension(matchedEntry);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n // Do not allow a non existing env\n // this.printWarningIfFirstTime(\n // matchedEntry.id.toString(),\n // `environment with ID: ${matchedEntry.id.toString()} was not found`\n // );\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const envDef = envId ? this.getEnvDefinitionByStringId(envId) : undefined;\n\n return envDef || this.getDefaultEnv();\n }\n\n /**\n * This function finds the first environment ID from a list of IDs by checking if it is register as env (to the slot).\n * or contains env.jsonc file\n * @param {string[]} ids - `ids` is an array of string values representing environment IDs. The function `findFirstEnv`\n * takes this array as input and returns a Promise that resolves to a string value representing the first environment ID\n * that matches certain conditions.\n * @returns The `findFirstEnv` function returns a Promise that resolves to a string or undefined. The string represents\n * the ID of the first environment that matches the conditions specified in the function, or undefined if no environment\n * is found.\n */\n private async findFirstEnv(ids: string[]): Promise<string | undefined> {\n let isFoundWithoutVersion = false;\n const envId = await pLocate(ids, async (id) => {\n const idWithoutVersion = id.split('@')[0];\n if (this.isCoreEnv(idWithoutVersion)) return true;\n if (isCoreAspect(idWithoutVersion)) return false;\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) return true;\n const envDefWithoutVersion = this.getEnvDefinitionByStringId(idWithoutVersion);\n if (envDefWithoutVersion) {\n isFoundWithoutVersion = true;\n return true;\n }\n const envComponent = await this.getEnvComponentByEnvId(id);\n const hasManifest = this.hasEnvManifest(envComponent);\n if (hasManifest) return true;\n const isUsingEnvEnv = this.isUsingEnvEnv(envComponent);\n return !!isUsingEnvEnv;\n });\n let finalEnvId;\n if (envId) {\n finalEnvId = isFoundWithoutVersion ? envId?.split('@')[0] : envId;\n this.envIds.add(envId);\n }\n return finalEnvId;\n }\n\n private getEnvDefinitionByLegacyExtension(extension: ExtensionDataEntry): EnvDefinition | undefined {\n const envDef = extension.extensionId\n ? this.getEnvDefinitionById(extension.extensionId)\n : this.getEnvDefinitionByStringId(extension.stringId);\n return envDef;\n }\n\n getEnvIdFromEnvsConfig(component: Component): string | undefined {\n const envsAspect = component.state.aspects.get(EnvsAspect.id);\n return envsAspect?.config.env;\n }\n\n getEnvDefinition(id: ComponentID) {\n const allVersions = this.envSlot.toArray();\n const all = allVersions.filter(([envId]) => envId.includes(id.toStringWithoutVersion()));\n const first = head(all);\n if (!first) return undefined;\n const [envId, env] = first;\n return new EnvDefinition(envId, env);\n }\n\n getEnvDefinitionById(id: ComponentID): EnvDefinition | undefined {\n const envDef =\n this.getEnvDefinitionByStringId(id.toString()) ||\n this.getEnvDefinitionByStringId(id.toString({ ignoreVersion: true }));\n return envDef;\n }\n\n public getEnvDefinitionByStringId(envId: string): EnvDefinition | undefined {\n const env = this.envSlot.get(envId);\n if (env) {\n return new EnvDefinition(envId, env as Environment);\n }\n return undefined;\n }\n\n getEnvFromComponent(envComponent: Component): EnvDefinition | undefined {\n const env = this.getEnvDefinitionById(envComponent.id);\n return env;\n }\n\n /**\n * Return the env definition of teambit.envs/env\n */\n getEnvsEnvDefinition(): EnvDefinition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.getEnvDefinitionByStringId('teambit.envs/env')!;\n }\n\n private printWarningIfFirstTime(envId: string, message: string) {\n if (!this.alreadyShownWarning[envId] && !this.failedToLoadEnvs.has(envId)) {\n this.alreadyShownWarning[envId] = true;\n this.logger.consoleWarning(message);\n this.addFailedToLoadEnvs(envId);\n }\n }\n\n /**\n * determines whether an env is registered.\n */\n public isEnvRegistered(id: string) {\n return Boolean(this.envSlot.get(id));\n }\n\n isUsingAspectEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'aspect';\n }\n\n isUsingEnvEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'env';\n }\n\n /**\n * Check if the given component is an env component.\n * @param component\n * @returns\n */\n isEnv(component: Component): boolean {\n return (\n this.isUsingEnvEnv(component) ||\n this.isEnvRegistered(component.id.toString()) ||\n this.isEnvRegistered(component.id.toStringWithoutVersion())\n );\n }\n\n /**\n * register a new environment service.\n */\n registerService(...envServices: EnvService<any>[]) {\n this.servicesRegistry.register(envServices);\n return this;\n }\n\n /**\n * get list of services enabled on an env.\n */\n getServices(env: EnvDefinition): EnvServiceList {\n const allServices = this.servicesRegistry.toArray();\n const services: [string, EnvService<any>][] = [];\n allServices.forEach(([id, currentServices]) => {\n currentServices.forEach((service) => {\n try {\n if (this.implements(env, service)) {\n services.push([id, service]);\n }\n } catch (err) {\n this.logger.warn(`failed loading service ${id} for env ${env.id}`);\n }\n });\n });\n return new EnvServiceList(env, services);\n }\n\n implements(env: EnvDefinition, service: EnvService<any>) {\n // TODO: remove this after refactoring everything and remove getDescriptor from being optional.\n if (!service.getDescriptor) return false;\n return !!service.getDescriptor(env);\n }\n\n /**\n * register an environment.\n */\n registerEnv(env: Environment) {\n return this.envSlot.register(env);\n }\n\n /**\n * register an env.jsonc merge customizer.\n */\n registerEnvJsoncMergeCustomizer(customizer: EnvJsoncMergeCustomizer) {\n return this.envJsoncMergeCustomizerSlot.register(customizer);\n }\n\n async addNonLoadedEnvAsComponentIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n const envId = await this.calculateEnvId(component);\n const envIdStr = envId.toString();\n if (!this.isEnvRegistered(envIdStr)) {\n this.addFailedToLoadEnvs(envIdStr);\n // If there is no version and the env is not in the workspace this is not valid\n // you can't set external env without version\n if (!envIdStr.includes('@')) {\n const foundComp = components.find((c) => c.id.toStringWithoutVersion() === envIdStr);\n if (!foundComp) {\n component.state.issues.getOrCreate(IssuesClasses.ExternalEnvWithoutVersion).data = {\n envId: envIdStr,\n componentId: component.id.toString(),\n };\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n }\n });\n }\n\n // refactor here\n private async createRuntime(components: Component[]): Promise<Runtime> {\n return new Runtime(await this.aggregateByDefs(components), this.logger);\n }\n\n // :TODO can be refactored to few utilities who will make repeating this very easy.\n private async aggregateByDefs(components: Component[]): Promise<EnvRuntime[]> {\n this.throwForDuplicateComponents(components);\n const envsMap = {};\n components.forEach((component: Component) => {\n const envDef = this.getEnv(component);\n const envId = envDef.id;\n const env = envDef.env;\n // handle config as well when aggregating envs.\n if (envsMap[envId]) envsMap[envId].components.push(component);\n else\n envsMap[envId] = {\n components: [component],\n env,\n };\n });\n\n return Promise.all(\n Object.keys(envsMap).map(async (key) => {\n const envAspectDef = await this.getEnvAspectDef(key);\n return new EnvRuntime(key, envsMap[key].env, envsMap[key].components, envAspectDef);\n })\n );\n }\n\n private async getEnvAspectDef(envId: string): Promise<AspectDefinition> {\n const host = this.componentMain.getHost();\n const id = await host.resolveComponentId(envId);\n // We don't want to filter by runtime here as we want to also get envs that configured as plugins. so they don't\n // contain the runtime path.\n const resolvedAspects = await host.resolveAspects(MainRuntime.name, [id], {\n requestedOnly: true,\n filterByRuntime: false,\n useScopeAspectsCapsule: true,\n });\n const def = resolvedAspects[0];\n\n return def;\n }\n\n private throwForDuplicateComponents(components: Component[]) {\n const idsStr = components.map((c) => c.id.toString());\n const duplications = findDuplications(idsStr);\n if (duplications.length) {\n throw new Error(`found duplicated components: ${duplications.join(', ')}`);\n }\n }\n\n static slots = [\n Slot.withType<Environment>(),\n Slot.withType<EnvService<any>>(),\n Slot.withType<EnvJsoncMergeCustomizerRegistry>(),\n ];\n\n static dependencies = [GraphqlAspect, LoggerAspect, ComponentAspect, CLIAspect, WorkerAspect, IssuesAspect];\n\n static async provider(\n [graphql, loggerAspect, component, cli, worker, issues]: [\n GraphqlMain,\n LoggerMain,\n ComponentMain,\n CLIMain,\n WorkerMain,\n IssuesMain\n ],\n config: EnvsConfig,\n [envSlot, servicesRegistry, envJsoncMergeCustomizerSlot]: [\n EnvsRegistry,\n ServicesRegistry,\n EnvJsoncMergeCustomizerRegistry\n ],\n context: Harmony\n ) {\n const logger = loggerAspect.createLogger(EnvsAspect.id);\n const envs = new EnvsMain(\n config,\n context,\n envSlot,\n logger,\n servicesRegistry,\n component,\n loggerAspect,\n worker,\n envJsoncMergeCustomizerSlot\n );\n component.registerShowFragments([new EnvFragment(envs)]);\n if (issues) issues.registerAddComponentsIssues(envs.addNonLoadedEnvAsComponentIssues.bind(envs));\n\n const envsCmd = new EnvsCmd(envs, component);\n envsCmd.commands = [new ListEnvsCmd(envs, component), new GetEnvCmd(envs, component)];\n cli.register(envsCmd);\n graphql.register(environmentsSchema(envs));\n return envs;\n }\n}\n\nEnvsAspect.addRuntime(EnvsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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AAIC,mBAAW,EAACP,IAAI,EAAE/J,SAAS,CAAC,EAAE,KAAIuK,iBAAS,EAACR,IAAI,EAAE/J,SAAS,CAAC,CAAC;IACrF2J,GAAG,CAACzC,QAAQ,CAACiD,OAAO,CAAC;IACrBV,OAAO,CAACvC,QAAQ,CAAC,IAAAsD,mCAAkB,EAACT,IAAI,CAAC,CAAC;IAC1C,OAAOA,IAAI;EACb;AACF;AAAC1Q,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAAAlB,eAAA,CAnhCYkB,QAAQ,aAgBF0P,kBAAW;AAAA5Q,eAAA,CAhBjBkB,QAAQ,WAq+BJ,CACbmR,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAkC,CAAC,CACjD;AAAAtS,eAAA,CAz+BUkB,QAAQ,kBA2+BG,CAACqR,wBAAa,EAAEC,sBAAY,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA0C7G1K,0BAAU,CAAC2K,UAAU,CAAC3R,QAAQ,CAAC","ignoreList":[]}
|
package/dist/envs.cmd.js
CHANGED
@@ -32,8 +32,8 @@ function _lodash() {
|
|
32
32
|
};
|
33
33
|
return data;
|
34
34
|
}
|
35
|
-
function _interopRequireDefault(
|
36
|
-
function _defineProperty(
|
35
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
36
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
37
37
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
38
38
|
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); } // eslint-disable-next-line max-classes-per-file
|
39
39
|
class ListEnvsCmd {
|
package/dist/envs.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_chalk","_cliTable","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvs","join","title","chalk","green","exports","GetEnvCmd","name","description","showEnv","id","host","servicesArr","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","includes","serviceTitle","cyan","bold","underline","content","render","all","compact","Promise","envTitle","getHost","split","undefined","EnvsCmd","Set","components","list","table","getTable","warning","getNonLoadedEnvsWarning","tableData","pMapSeries","envId","calculateEnvId","envIdStr","toString","isLoaded","isEnvRegistered","nonLoadedEnvs","add","envWithErr","red","header","CLITable","fromObject","sort","size","Array","from","values","yellow"],"sources":["envs.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport pMapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { ComponentMain, ComponentFactory, Component } from '@teambit/component';\nimport { EnvsMain } from './environments.main.runtime';\n\nexport class ListEnvsCmd implements Command {\n name = 'list';\n description = 'list all envs currently used in the workspace';\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report() {\n const allEnvs = this.envs.getAllRegisteredEnvs().join('\\n');\n const title = chalk.green('the following envs are available in the workspace:');\n return `${title}\\n${allEnvs}`;\n }\n}\n\ntype GetEnvOpts = {\n services: string;\n};\n\nexport class GetEnvCmd implements Command {\n name = 'get <component-name>';\n description = \"show config information from a component's env\";\n arguments = [\n {\n name: 'component-name',\n description: \"the 'component name' or 'component id' of the component whose env you'd like to inspect\",\n },\n ];\n examples: [{ cmd: 'get ui/button'; description: 'show config information from the env configured for ui/button' }];\n options = [\n [\n '',\n 'services <string>',\n 'show information about the specific services only. for multiple services, separate by a comma and wrap with quotes',\n ],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async showEnv(id: string, host: ComponentFactory, servicesArr: string[] | undefined) {\n const component = await host.get(await host.resolveComponentId(id));\n if (!component) throw new Error(`component for env ${id} was not found`);\n const env = this.envs.getEnv(component);\n const envRuntime = await this.envs.createEnvironment([component]);\n const envExecutionContext = envRuntime.getEnvExecutionContext();\n const services = this.envs.getServices(env);\n const allP = services.services.map(async ([serviceId, service]) => {\n if (servicesArr && !servicesArr.includes(serviceId)) return null;\n const serviceTitle = chalk.cyan.bold.underline(serviceId);\n const content = service.render ? await service.render(env, envExecutionContext) : '';\n return `${serviceTitle}\\n\\n${content}`;\n });\n\n const all = compact(await Promise.all(allP));\n\n const envTitle = chalk.green(`Environment: ${env.id}`);\n return `${envTitle}\\n${all.join('\\n\\n')}`;\n }\n\n async report([name]: [string], { services }: GetEnvOpts): Promise<string> {\n const host = this.componentAspect.getHost();\n const servicesArr = services ? services.split(',') : undefined;\n\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n return this.showEnv(name, host, servicesArr);\n }\n}\n\nexport class EnvsCmd implements Command {\n name = 'envs';\n alias = 'env';\n description = 'list all components maintained by the workspace and their corresponding envs';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n // private showNonLoadedEnvsWarning = false;\n private nonLoadedEnvs = new Set<string>();\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report(): Promise<string> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n const components = await host.list();\n const table = await this.getTable(components);\n const warning = this.getNonLoadedEnvsWarning();\n return warning ? `${table}\\n${warning}` : table;\n }\n\n private async getTable(components: Component[]) {\n const tableData = await pMapSeries(components, async (component) => {\n // const envId = this.envs.getEnvId(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdStr = envId.toString();\n const isLoaded = this.envs.isEnvRegistered(envIdStr);\n if (!isLoaded) {\n this.nonLoadedEnvs.add(envIdStr);\n }\n const envWithErr = isLoaded ? envIdStr : `${envIdStr} ${chalk.red('(not loaded)')}`;\n return {\n component: component.id.toString(),\n env: envWithErr,\n };\n });\n\n const header = [\n {\n value: 'component',\n },\n {\n value: 'env',\n },\n ];\n const table = CLITable.fromObject(header, tableData);\n table.sort();\n return table.render();\n }\n\n getNonLoadedEnvsWarning() {\n if (!this.nonLoadedEnvs.size) return '';\n const list = Array.from(this.nonLoadedEnvs.values()).join(',');\n return chalk.yellow(`warning: bit wasn't able to load the following envs: ${chalk.cyan(list)}.\nplease run ${chalk.cyan(\"'bit install'\")} to fix. if this doesn't help, run ${chalk.cyan(\n \"'bit status'\"\n )} to see if there are any additional issues`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;E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GAAEA,QAAS,IAAGpD,gBAAK,CAAC2D,GAAG,CAAC,cAAc,CAAE,EAAC;MACnF,OAAO;QACLjD,SAAS,EAAEA,SAAS,CAACH,EAAE,CAAC8C,QAAQ,CAAC,CAAC;QAClCvC,GAAG,EAAE4C;MACP,CAAC;IACH,CAAC,CAAC;IAEF,MAAME,MAAM,GAAG,CACb;MACEvF,KAAK,EAAE;IACT,CAAC,EACD;MACEA,KAAK,EAAE;IACT,CAAC,CACF;IACD,MAAMuE,KAAK,GAAGiB,oBAAQ,CAACC,UAAU,CAACF,MAAM,EAAEZ,SAAS,CAAC;IACpDJ,KAAK,CAACmB,IAAI,CAAC,CAAC;IACZ,OAAOnB,KAAK,CAACZ,MAAM,CAAC,CAAC;EACvB;EAEAe,uBAAuBA,CAAA,EAAG;IACxB,IAAI,CAAC,IAAI,CAACS,aAAa,CAACQ,IAAI,EAAE,OAAO,EAAE;IACvC,MAAMrB,IAAI,GAAGsB,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,aAAa,CAACW,MAAM,CAAC,CAAC,CAAC,CAACrE,IAAI,CAAC,GAAG,CAAC;IAC9D,OAAOE,gBAAK,CAACoE,MAAM,CAAE,wDAAuDpE,gBAAK,CAAC4B,IAAI,CAACe,IAAI,CAAE;AACjG,aAAa3C,gBAAK,CAAC4B,IAAI,CAAC,eAAe,CAAE,sCAAqC5B,gBAAK,CAAC4B,IAAI,CAClF,cACF,CAAE,4CAA2C,CAAC;EAChD;AACF;AAAC1B,OAAA,CAAAsC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_chalk","_cliTable","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvs","join","title","chalk","green","exports","GetEnvCmd","name","description","showEnv","id","host","servicesArr","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","includes","serviceTitle","cyan","bold","underline","content","render","all","compact","Promise","envTitle","getHost","split","undefined","EnvsCmd","Set","components","list","table","getTable","warning","getNonLoadedEnvsWarning","tableData","pMapSeries","envId","calculateEnvId","envIdStr","toString","isLoaded","isEnvRegistered","nonLoadedEnvs","add","envWithErr","red","header","CLITable","fromObject","sort","size","Array","from","values","yellow"],"sources":["envs.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport pMapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { ComponentMain, ComponentFactory, Component } from '@teambit/component';\nimport { EnvsMain } from './environments.main.runtime';\n\nexport class ListEnvsCmd implements Command {\n name = 'list';\n description = 'list all envs currently used in the workspace';\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report() {\n const allEnvs = this.envs.getAllRegisteredEnvs().join('\\n');\n const title = chalk.green('the following envs are available in the workspace:');\n return `${title}\\n${allEnvs}`;\n }\n}\n\ntype GetEnvOpts = {\n services: string;\n};\n\nexport class GetEnvCmd implements Command {\n name = 'get <component-name>';\n description = \"show config information from a component's env\";\n arguments = [\n {\n name: 'component-name',\n description: \"the 'component name' or 'component id' of the component whose env you'd like to inspect\",\n },\n ];\n examples: [{ cmd: 'get ui/button'; description: 'show config information from the env configured for ui/button' }];\n options = [\n [\n '',\n 'services <string>',\n 'show information about the specific services only. for multiple services, separate by a comma and wrap with quotes',\n ],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async showEnv(id: string, host: ComponentFactory, servicesArr: string[] | undefined) {\n const component = await host.get(await host.resolveComponentId(id));\n if (!component) throw new Error(`component for env ${id} was not found`);\n const env = this.envs.getEnv(component);\n const envRuntime = await this.envs.createEnvironment([component]);\n const envExecutionContext = envRuntime.getEnvExecutionContext();\n const services = this.envs.getServices(env);\n const allP = services.services.map(async ([serviceId, service]) => {\n if (servicesArr && !servicesArr.includes(serviceId)) return null;\n const serviceTitle = chalk.cyan.bold.underline(serviceId);\n const content = service.render ? await service.render(env, envExecutionContext) : '';\n return `${serviceTitle}\\n\\n${content}`;\n });\n\n const all = compact(await Promise.all(allP));\n\n const envTitle = chalk.green(`Environment: ${env.id}`);\n return `${envTitle}\\n${all.join('\\n\\n')}`;\n }\n\n async report([name]: [string], { services }: GetEnvOpts): Promise<string> {\n const host = this.componentAspect.getHost();\n const servicesArr = services ? services.split(',') : undefined;\n\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n return this.showEnv(name, host, servicesArr);\n }\n}\n\nexport class EnvsCmd implements Command {\n name = 'envs';\n alias = 'env';\n description = 'list all components maintained by the workspace and their corresponding envs';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n // private showNonLoadedEnvsWarning = false;\n private nonLoadedEnvs = new Set<string>();\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report(): Promise<string> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n const components = await host.list();\n const table = await this.getTable(components);\n const warning = this.getNonLoadedEnvsWarning();\n return warning ? `${table}\\n${warning}` : table;\n }\n\n private async getTable(components: Component[]) {\n const tableData = await pMapSeries(components, async (component) => {\n // const envId = this.envs.getEnvId(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdStr = envId.toString();\n const isLoaded = this.envs.isEnvRegistered(envIdStr);\n if (!isLoaded) {\n this.nonLoadedEnvs.add(envIdStr);\n }\n const envWithErr = isLoaded ? envIdStr : `${envIdStr} ${chalk.red('(not loaded)')}`;\n return {\n component: component.id.toString(),\n env: envWithErr,\n };\n });\n\n const header = [\n {\n value: 'component',\n },\n {\n value: 'env',\n },\n ];\n const table = CLITable.fromObject(header, tableData);\n table.sort();\n return table.render();\n }\n\n getNonLoadedEnvsWarning() {\n if (!this.nonLoadedEnvs.size) return '';\n const list = Array.from(this.nonLoadedEnvs.values()).join(',');\n return chalk.yellow(`warning: bit wasn't able to load the following envs: ${chalk.cyan(list)}.\nplease run ${chalk.cyan(\"'bit install'\")} to fix. if this doesn't help, run ${chalk.cyan(\n \"'bit status'\"\n )} to see if there are any additional issues`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC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AC;IACZ,OAAOnB,KAAK,CAACZ,MAAM,CAAC,CAAC;EACvB;EAEAe,uBAAuBA,CAAA,EAAG;IACxB,IAAI,CAAC,IAAI,CAACS,aAAa,CAACQ,IAAI,EAAE,OAAO,EAAE;IACvC,MAAMrB,IAAI,GAAGsB,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,aAAa,CAACW,MAAM,CAAC,CAAC,CAAC,CAACrE,IAAI,CAAC,GAAG,CAAC;IAC9D,OAAOE,gBAAK,CAACoE,MAAM,CAAC,wDAAwDpE,gBAAK,CAAC4B,IAAI,CAACe,IAAI,CAAC;AAChG,aAAa3C,gBAAK,CAAC4B,IAAI,CAAC,eAAe,CAAC,sCAAsC5B,gBAAK,CAAC4B,IAAI,CAClF,cACF,CAAC,4CAA4C,CAAC;EAChD;AACF;AAAC1B,OAAA,CAAAsC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","EnvNotConfiguredForComponent","BitError","constructor","id","componentId","suffix","exports"],"sources":["env-not-configured-for-component.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotConfiguredForComponent extends BitError {\n constructor(id: string, componentId?: string) {\n const suffix = componentId ? ` for the component ${componentId}` : '';\n super(`environment with ID: \"${id}\" is not configured as extension${suffix}.\nyou probably need to set this environment to your component(s). for example, \"bit env set <component-pattern> ${id}\"\n`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,4BAA4B,SAASC,oBAAQ,CAAC;EACzDC,WAAWA,CAACC,EAAU,EAAEC,WAAoB,EAAE;IAC5C,MAAMC,MAAM,GAAGD,WAAW,
|
1
|
+
{"version":3,"names":["_bitError","data","require","EnvNotConfiguredForComponent","BitError","constructor","id","componentId","suffix","exports"],"sources":["env-not-configured-for-component.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotConfiguredForComponent extends BitError {\n constructor(id: string, componentId?: string) {\n const suffix = componentId ? ` for the component ${componentId}` : '';\n super(`environment with ID: \"${id}\" is not configured as extension${suffix}.\nyou probably need to set this environment to your component(s). for example, \"bit env set <component-pattern> ${id}\"\n`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,4BAA4B,SAASC,oBAAQ,CAAC;EACzDC,WAAWA,CAACC,EAAU,EAAEC,WAAoB,EAAE;IAC5C,MAAMC,MAAM,GAAGD,WAAW,GAAG,sBAAsBA,WAAW,EAAE,GAAG,EAAE;IACrE,KAAK,CAAC,yBAAyBD,EAAE,mCAAmCE,MAAM;AAC9E,gHAAgHF,EAAE;AAClH,CAAC,CAAC;EACA;AACF;AAACG,OAAA,CAAAN,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","EnvNotFoundInRuntime","BitError","constructor","id","exports"],"sources":["env-not-found-in-runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotFoundInRuntime extends BitError {\n constructor(private id: string) {\n super(`environment with ID: ${id} was not found configured to any of your components`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAASC,EAAU,EAAE;IAC9B,KAAK,
|
1
|
+
{"version":3,"names":["_bitError","data","require","EnvNotFoundInRuntime","BitError","constructor","id","exports"],"sources":["env-not-found-in-runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotFoundInRuntime extends BitError {\n constructor(private id: string) {\n super(`environment with ID: ${id} was not found configured to any of your components`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAASC,EAAU,EAAE;IAC9B,KAAK,CAAC,wBAAwBA,EAAE,qDAAqD,CAAC;IAAC,KADrEA,EAAU,GAAVA,EAAU;EAE9B;AACF;AAACC,OAAA,CAAAJ,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","EnvNotFound","BitError","constructor","id","componentId","getMessage","exports","compIdDetails"],"sources":["env-not-found.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotFound extends BitError {\n constructor(private id: string, private componentId?: string) {\n super(getMessage(id, componentId));\n }\n}\n\nfunction getMessage(id: string, componentId?: string): string {\n const compIdDetails = componentId ? `configured on component ${componentId}` : '';\n return `environment with ID: ${id} ${compIdDetails} was not found`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,WAAW,SAASC,oBAAQ,CAAC;EACxCC,WAAWA,CAASC,EAAU,EAAUC,WAAoB,EAAE;IAC5D,KAAK,CAACC,UAAU,CAACF,EAAE,EAAEC,WAAW,CAAC,CAAC;IAAC,KADjBD,EAAU,GAAVA,EAAU;IAAA,KAAUC,WAAoB,GAApBA,WAAoB;EAE5D;AACF;AAACE,OAAA,CAAAN,WAAA,GAAAA,WAAA;AAED,SAASK,UAAUA,CAACF,EAAU,EAAEC,WAAoB,EAAU;EAC5D,MAAMG,aAAa,GAAGH,WAAW,
|
1
|
+
{"version":3,"names":["_bitError","data","require","EnvNotFound","BitError","constructor","id","componentId","getMessage","exports","compIdDetails"],"sources":["env-not-found.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class EnvNotFound extends BitError {\n constructor(private id: string, private componentId?: string) {\n super(getMessage(id, componentId));\n }\n}\n\nfunction getMessage(id: string, componentId?: string): string {\n const compIdDetails = componentId ? `configured on component ${componentId}` : '';\n return `environment with ID: ${id} ${compIdDetails} was not found`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,WAAW,SAASC,oBAAQ,CAAC;EACxCC,WAAWA,CAASC,EAAU,EAAUC,WAAoB,EAAE;IAC5D,KAAK,CAACC,UAAU,CAACF,EAAE,EAAEC,WAAW,CAAC,CAAC;IAAC,KADjBD,EAAU,GAAVA,EAAU;IAAA,KAAUC,WAAoB,GAApBA,WAAoB;EAE5D;AACF;AAACE,OAAA,CAAAN,WAAA,GAAAA,WAAA;AAED,SAASK,UAAUA,CAACF,EAAU,EAAEC,WAAoB,EAAU;EAC5D,MAAMG,aAAa,GAAGH,WAAW,GAAG,2BAA2BA,WAAW,EAAE,GAAG,EAAE;EACjF,OAAO,wBAAwBD,EAAE,IAAII,aAAa,gBAAgB;AACpE","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.283/dist/env.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.283/dist/envs.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_lodash","data","require","EnvsExecutionResult","constructor","results","hasErrors","Boolean","errors","length","flatten","map","envResult","getErrorsOfEnv","execError","error","push","throwErrorsIfExist","Error","errorsPerEnvs","getEnvErrorsAsString","errorOutput","join","title","env","id","errorsStr","message","stack","exports"],"sources":["envs-execution-result.ts"],"sourcesContent":["import { flatten } from 'lodash';\n\nimport { ServiceExecutionResult } from '../services';\nimport { EnvResult } from './runtime';\n\nexport class EnvsExecutionResult<T extends ServiceExecutionResult> {\n constructor(readonly results: EnvResult<T>[]) {}\n\n hasErrors() {\n return Boolean(this.errors.length);\n }\n\n /**\n * execution errors.\n */\n get errors(): Error[] {\n return flatten(this.results.map((envResult) => this.getErrorsOfEnv(envResult)));\n }\n\n getErrorsOfEnv(envResult: EnvResult<T>): Error[] {\n const execError = envResult.error;\n const errors = envResult.data ? envResult.data.errors || [] : [];\n if (execError) errors.push(execError);\n return errors;\n }\n\n /**\n * if only one error is found, throw it. otherwise, summarize the errors per env and throw the\n * output\n */\n throwErrorsIfExist() {\n if (!this.errors || !this.errors.length) return;\n if (this.errors.length === 1 && this.errors[0] instanceof Error) throw this.errors[0];\n const errorsPerEnvs = this.results.map((envResult) => this.getEnvErrorsAsString(envResult));\n const errorOutput = errorsPerEnvs.join('\\n\\n');\n throw new Error(errorOutput);\n }\n\n getEnvErrorsAsString(envResult: EnvResult<T>): string {\n const errors = this.getErrorsOfEnv(envResult);\n if (!errors.length) return '';\n const title = `found ${errors.length} error(s) for ${envResult.env.id}`;\n const errorsStr = errors.map((error) => `${error.message}\\n${error.stack}`).join('\\n');\n return `${title}\\n${errorsSt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MS,WAAW,GAAGF,aAAa,CAACG,IAAI,CAAC,MAAM,CAAC;IAC9C,MAAM,IAAIJ,KAAK,CAACG,WAAW,CAAC;EAC9B;EAEAD,oBAAoBA,CAACR,SAAuB,EAAU;IACpD,MAAMJ,MAAM,GAAG,IAAI,CAACK,cAAc,CAACD,SAAS,CAAC;IAC7C,IAAI,CAACJ,MAAM,CAACC,MAAM,EAAE,OAAO,EAAE;IAC7B,MAAMc,KAAK,
|
1
|
+
{"version":3,"names":["_lodash","data","require","EnvsExecutionResult","constructor","results","hasErrors","Boolean","errors","length","flatten","map","envResult","getErrorsOfEnv","execError","error","push","throwErrorsIfExist","Error","errorsPerEnvs","getEnvErrorsAsString","errorOutput","join","title","env","id","errorsStr","message","stack","exports"],"sources":["envs-execution-result.ts"],"sourcesContent":["import { flatten } from 'lodash';\n\nimport { ServiceExecutionResult } from '../services';\nimport { EnvResult } from './runtime';\n\nexport class EnvsExecutionResult<T extends ServiceExecutionResult> {\n constructor(readonly results: EnvResult<T>[]) {}\n\n hasErrors() {\n return Boolean(this.errors.length);\n }\n\n /**\n * execution errors.\n */\n get errors(): Error[] {\n return flatten(this.results.map((envResult) => this.getErrorsOfEnv(envResult)));\n }\n\n getErrorsOfEnv(envResult: EnvResult<T>): Error[] {\n const execError = envResult.error;\n const errors = envResult.data ? envResult.data.errors || [] : [];\n if (execError) errors.push(execError);\n return errors;\n }\n\n /**\n * if only one error is found, throw it. otherwise, summarize the errors per env and throw the\n * output\n */\n throwErrorsIfExist() {\n if (!this.errors || !this.errors.length) return;\n if (this.errors.length === 1 && this.errors[0] instanceof Error) throw this.errors[0];\n const errorsPerEnvs = this.results.map((envResult) => this.getEnvErrorsAsString(envResult));\n const errorOutput = errorsPerEnvs.join('\\n\\n');\n throw new Error(errorOutput);\n }\n\n getEnvErrorsAsString(envResult: EnvResult<T>): string {\n const errors = this.getErrorsOfEnv(envResult);\n if (!errors.length) return '';\n const title = `found ${errors.length} error(s) for ${envResult.env.id}`;\n const errorsStr = errors.map((error) => `${error.message}\\n${error.stack}`).join('\\n');\n return `${title}\\n${errorsStr}`;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAME,mBAAmB,CAAmC;EACjEC,WAAWA,CAAUC,OAAuB,EAAE;IAAA,KAAzBA,OAAuB,GAAvBA,OAAuB;EAAG;EAE/CC,SAASA,CAAA,EAAG;IACV,OAAOC,OAAO,CAAC,IAAI,CAACC,MAAM,CAACC,MAAM,CAAC;EACpC;;EAEA;AACF;AACA;EACE,IAAID,MAAMA,CAAA,EAAY;IACpB,OAAO,IAAAE,iBAAO,EAAC,IAAI,CAACL,OAAO,CAACM,GAAG,CAAEC,SAAS,IAAK,IAAI,CAACC,cAAc,CAACD,SAAS,CAAC,CAAC,CAAC;EACjF;EAEAC,cAAcA,CAACD,SAAuB,EAAW;IAC/C,MAAME,SAAS,GAAGF,SAAS,CAACG,KAAK;IACjC,MAAMP,MAAM,GAAGI,SAAS,CAACX,IAAI,GAAGW,SAAS,CAACX,IAAI,CAACO,MAAM,IAAI,EAAE,GAAG,EAAE;IAChE,IAAIM,SAAS,EAAEN,MAAM,CAACQ,IAAI,CAACF,SAAS,CAAC;IACrC,OAAON,MAAM;EACf;;EAEA;AACF;AACA;AACA;EACES,kBAAkBA,CAAA,EAAG;IACnB,IAAI,CAAC,IAAI,CAACT,MAAM,IAAI,CAAC,IAAI,CAACA,MAAM,CAACC,MAAM,EAAE;IACzC,IAAI,IAAI,CAACD,MAAM,CAACC,MAAM,KAAK,CAAC,IAAI,IAAI,CAACD,MAAM,CAAC,CAAC,CAAC,YAAYU,KAAK,EAAE,MAAM,IAAI,CAACV,MAAM,CAAC,CAAC,CAAC;IACrF,MAAMW,aAAa,GAAG,IAAI,CAACd,OAAO,CAACM,GAAG,CAAEC,SAAS,IAAK,IAAI,CAACQ,oBAAoB,CAACR,SAAS,CAAC,CAAC;IAC3F,MAAMS,WAAW,GAAGF,aAAa,CAACG,IAAI,CAAC,MAAM,CAAC;IAC9C,MAAM,IAAIJ,KAAK,CAACG,WAAW,CAAC;EAC9B;EAEAD,oBAAoBA,CAACR,SAAuB,EAAU;IACpD,MAAMJ,MAAM,GAAG,IAAI,CAACK,cAAc,CAACD,SAAS,CAAC;IAC7C,IAAI,CAACJ,MAAM,CAACC,MAAM,EAAE,OAAO,EAAE;IAC7B,MAAMc,KAAK,GAAG,SAASf,MAAM,CAACC,MAAM,iBAAiBG,SAAS,CAACY,GAAG,CAACC,EAAE,EAAE;IACvE,MAAMC,SAAS,GAAGlB,MAAM,CAACG,GAAG,CAAEI,KAAK,IAAK,GAAGA,KAAK,CAACY,OAAO,KAAKZ,KAAK,CAACa,KAAK,EAAE,CAAC,CAACN,IAAI,CAAC,IAAI,CAAC;IACtF,OAAO,GAAGC,KAAK,KAAKG,SAAS,EAAE;EACjC;AACF;AAACG,OAAA,CAAA1B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/dist/runtime/runtime.js
CHANGED
@@ -39,7 +39,7 @@ function _envsExecutionResult() {
|
|
39
39
|
};
|
40
40
|
return data;
|
41
41
|
}
|
42
|
-
function _interopRequireDefault(
|
42
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
43
43
|
class Runtime {
|
44
44
|
constructor(
|
45
45
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_component","data","require","_pMapSeries","_interopRequireDefault","_exceptions","_context","_envsExecutionResult","
|
1
|
+
{"version":3,"names":["_component","data","require","_pMapSeries","_interopRequireDefault","_exceptions","_context","_envsExecutionResult","e","__esModule","default","Runtime","constructor","runtimeEnvs","logger","runEnv","envRuntimeId","service","options","envRuntime","find","runtime","id","ComponentID","fromString","withoutVersion","toStringWithoutVersion","EnvNotFoundInRuntime","run","runOnce","Error","envsExecutionContext","getEnvExecutionContext","serviceResult","map","env","ExecutionContext","runtimes","errors","contexts","mapSeries","err","error","message","consoleFailure","name","push","EnvsExecutionResult","exports"],"sources":["runtime.ts"],"sourcesContent":["import { Logger } from '@teambit/logger';\nimport { ComponentID } from '@teambit/component';\nimport mapSeries from 'p-map-series';\nimport { EnvNotFoundInRuntime } from '../exceptions';\nimport { ExecutionContext } from '../context';\nimport { EnvService, ServiceExecutionResult } from '../services';\nimport { EnvRuntime } from './env-runtime';\nimport { EnvsExecutionResult } from './envs-execution-result';\n\nexport interface EnvResult<T extends ServiceExecutionResult> {\n env: EnvRuntime;\n data?: T;\n error?: Error;\n}\n\nexport class Runtime {\n constructor(\n /**\n * runtime instances of the environments.\n */\n readonly runtimeEnvs: EnvRuntime[],\n\n private logger: Logger\n ) {}\n\n /**\n * execute a service on a specific env.\n */\n runEnv<T extends ServiceExecutionResult>(\n envRuntimeId: string,\n service: EnvService<T>,\n options?: { [key: string]: any }\n ): Promise<EnvsExecutionResult<T>> {\n const envRuntime = this.runtimeEnvs.find((runtime) => {\n const id = ComponentID.fromString(runtime.id);\n const withoutVersion = id.toStringWithoutVersion();\n return withoutVersion === envRuntimeId;\n });\n if (!envRuntime) throw new EnvNotFoundInRuntime(envRuntimeId);\n return this.run(service, options, [envRuntime]);\n }\n\n /**\n * execute a service once for all environments.\n */\n async runOnce<T extends ServiceExecutionResult>(\n service: EnvService<T>,\n options?: { [key: string]: any }\n ): Promise<any> {\n if (!service.runOnce) throw new Error('a service must implement `runOnce()` in order to be executed');\n const envsExecutionContext = this.getEnvExecutionContext();\n const serviceResult = await service.runOnce(envsExecutionContext, options);\n return serviceResult;\n }\n\n getEnvExecutionContext(): ExecutionContext[] {\n const envsExecutionContext = this.runtimeEnvs.map((env) => new ExecutionContext(this, env));\n return envsExecutionContext;\n }\n\n /**\n * execute a service on each one of the environments.\n */\n async run<T extends ServiceExecutionResult>(\n /**\n * environment service to execute.\n */\n service: EnvService<T>,\n\n /**\n * options to proxy to the service upon execution.\n */\n options?: { [key: string]: any },\n runtimes?: EnvRuntime[]\n ): Promise<EnvsExecutionResult<T>> {\n if (!service.run) throw new Error('a service must implement `run()` in order to be executed');\n const errors: Error[] = [];\n const contexts: EnvResult<T>[] = await mapSeries(runtimes || this.runtimeEnvs, async (env) => {\n try {\n // @ts-ignore\n const serviceResult = await service.run(new ExecutionContext(this, env), options);\n\n return {\n env,\n data: serviceResult,\n };\n } catch (err: any) {\n this.logger.error(err.message, err);\n this.logger.consoleFailure(`service \"${service.name}\" of env \"${env.id}\" has failed. error: ${err.message}`);\n errors.push(err);\n return {\n env,\n error: err,\n };\n }\n });\n\n return new EnvsExecutionResult(contexts);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,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;AAGA,SAAAM,qBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,oBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8D,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQvD,MAAMG,OAAO,CAAC;EAC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;AACA;EACIC,OAAgC,EAChCmB,QAAuB,EACU;IACjC,IAAI,CAACpB,OAAO,CAACW,GAAG,EAAE,MAAM,IAAIE,KAAK,CAAC,0DAA0D,CAAC;IAC7F,MAAMQ,MAAe,GAAG,EAAE;IAC1B,MAAMC,QAAwB,GAAG,MAAM,IAAAC,qBAAS,EAACH,QAAQ,IAAI,IAAI,CAACxB,WAAW,EAAE,MAAOsB,GAAG,IAAK;MAC5F,IAAI;QACF;QACA,MAAMF,aAAa,GAAG,MAAMhB,OAAO,CAACW,GAAG,CAAC,KAAIQ,2BAAgB,EAAC,IAAI,EAAED,GAAG,CAAC,EAAEjB,OAAO,CAAC;QAEjF,OAAO;UACLiB,GAAG;UACHlC,IAAI,EAAEgC;QACR,CAAC;MACH,CAAC,CAAC,OAAOQ,GAAQ,EAAE;QACjB,IAAI,CAAC3B,MAAM,CAAC4B,KAAK,CAACD,GAAG,CAACE,OAAO,EAAEF,GAAG,CAAC;QACnC,IAAI,CAAC3B,MAAM,CAAC8B,cAAc,CAAC,YAAY3B,OAAO,CAAC4B,IAAI,aAAaV,GAAG,CAACb,EAAE,wBAAwBmB,GAAG,CAACE,OAAO,EAAE,CAAC;QAC5GL,MAAM,CAACQ,IAAI,CAACL,GAAG,CAAC;QAChB,OAAO;UACLN,GAAG;UACHO,KAAK,EAAED;QACT,CAAC;MACH;IACF,CAAC,CAAC;IAEF,OAAO,KAAIM,0CAAmB,EAACR,QAAQ,CAAC;EAC1C;AACF;AAACS,OAAA,CAAArC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ServiceHandlerContext","constructor","envId","loggerMain","workerMain","harmony","createLogger","name","loggerName","toString","getAspect","aspectId","get","createWorker","path","worker","declareWorker","exports"],"sources":["service-handler-context.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { Harmony } from '@teambit/harmony';\nimport { Logger, LoggerMain } from '@teambit/logger';\nimport { WorkerMain } from '@teambit/worker';\n\nexport class ServiceHandlerContext {\n constructor(\n /**\n * id of the environment defined in the context.\n */\n readonly envId: ComponentID,\n readonly loggerMain: LoggerMain,\n readonly workerMain: WorkerMain,\n readonly harmony: Harmony\n ) {}\n\n /**\n * return a logger instance for the env.\n */\n createLogger(name?: string): Logger {\n const loggerName = name ? `${this.envId.toString()}::${name}` : this.envId.toString();\n\n return this.loggerMain.createLogger(loggerName);\n }\n\n /**\n * get an instance of an aspect. make sure it is loaded prior to requesting it.\n */\n getAspect<T>(aspectId: string) {\n return this.harmony.get<T>(aspectId);\n }\n\n /**\n * create worker for the env context.\n */\n createWorker<T>(name: string, path: string) {\n const worker = this.workerMain.declareWorker<T>(name, path);\n return worker;\n }\n}\n"],"mappings":";;;;;;AAKO,MAAMA,qBAAqB,CAAC;EACjCC,WAAWA;EACT;AACJ;AACA;EACaC,KAAkB,EAClBC,UAAsB,EACtBC,UAAsB,EACtBC,OAAgB,EACzB;IAAA,KAJSH,KAAkB,GAAlBA,KAAkB;IAAA,KAClBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,OAAgB,GAAhBA,OAAgB;EACxB;;EAEH;AACF;AACA;EACEC,YAAYA,CAACC,IAAa,EAAU;IAClC,MAAMC,UAAU,GAAGD,IAAI,
|
1
|
+
{"version":3,"names":["ServiceHandlerContext","constructor","envId","loggerMain","workerMain","harmony","createLogger","name","loggerName","toString","getAspect","aspectId","get","createWorker","path","worker","declareWorker","exports"],"sources":["service-handler-context.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { Harmony } from '@teambit/harmony';\nimport { Logger, LoggerMain } from '@teambit/logger';\nimport { WorkerMain } from '@teambit/worker';\n\nexport class ServiceHandlerContext {\n constructor(\n /**\n * id of the environment defined in the context.\n */\n readonly envId: ComponentID,\n readonly loggerMain: LoggerMain,\n readonly workerMain: WorkerMain,\n readonly harmony: Harmony\n ) {}\n\n /**\n * return a logger instance for the env.\n */\n createLogger(name?: string): Logger {\n const loggerName = name ? `${this.envId.toString()}::${name}` : this.envId.toString();\n\n return this.loggerMain.createLogger(loggerName);\n }\n\n /**\n * get an instance of an aspect. make sure it is loaded prior to requesting it.\n */\n getAspect<T>(aspectId: string) {\n return this.harmony.get<T>(aspectId);\n }\n\n /**\n * create worker for the env context.\n */\n createWorker<T>(name: string, path: string) {\n const worker = this.workerMain.declareWorker<T>(name, path);\n return worker;\n }\n}\n"],"mappings":";;;;;;AAKO,MAAMA,qBAAqB,CAAC;EACjCC,WAAWA;EACT;AACJ;AACA;EACaC,KAAkB,EAClBC,UAAsB,EACtBC,UAAsB,EACtBC,OAAgB,EACzB;IAAA,KAJSH,KAAkB,GAAlBA,KAAkB;IAAA,KAClBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,OAAgB,GAAhBA,OAAgB;EACxB;;EAEH;AACF;AACA;EACEC,YAAYA,CAACC,IAAa,EAAU;IAClC,MAAMC,UAAU,GAAGD,IAAI,GAAG,GAAG,IAAI,CAACL,KAAK,CAACO,QAAQ,CAAC,CAAC,KAAKF,IAAI,EAAE,GAAG,IAAI,CAACL,KAAK,CAACO,QAAQ,CAAC,CAAC;IAErF,OAAO,IAAI,CAACN,UAAU,CAACG,YAAY,CAACE,UAAU,CAAC;EACjD;;EAEA;AACF;AACA;EACEE,SAASA,CAAIC,QAAgB,EAAE;IAC7B,OAAO,IAAI,CAACN,OAAO,CAACO,GAAG,CAAID,QAAQ,CAAC;EACtC;;EAEA;AACF;AACA;EACEE,YAAYA,CAAIN,IAAY,EAAEO,IAAY,EAAE;IAC1C,MAAMC,MAAM,GAAG,IAAI,CAACX,UAAU,CAACY,aAAa,CAAIT,IAAI,EAAEO,IAAI,CAAC;IAC3D,OAAOC,MAAM;EACf;AACF;AAACE,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/envs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.283",
|
4
4
|
"homepage": "https://bit.cloud/teambit/envs/envs",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.envs",
|
8
8
|
"name": "envs",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.283"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -20,29 +20,29 @@
|
|
20
20
|
"@teambit/harmony": "0.4.6",
|
21
21
|
"@teambit/bit-error": "0.0.404",
|
22
22
|
"@teambit/component-id": "1.2.0",
|
23
|
-
"@teambit/component": "1.0.
|
24
|
-
"@teambit/aspect-loader": "1.0.
|
23
|
+
"@teambit/component": "1.0.283",
|
24
|
+
"@teambit/aspect-loader": "1.0.283",
|
25
25
|
"@teambit/cli": "0.0.865",
|
26
26
|
"@teambit/logger": "0.0.958",
|
27
27
|
"@teambit/worker": "0.0.1169",
|
28
|
-
"@teambit/builder": "1.0.
|
29
|
-
"@teambit/bundler": "1.0.
|
30
|
-
"@teambit/compiler": "1.0.
|
31
|
-
"@teambit/dependency-resolver": "1.0.
|
32
|
-
"@teambit/formatter": "1.0.
|
33
|
-
"@teambit/isolator": "1.0.
|
34
|
-
"@teambit/linter": "1.0.
|
35
|
-
"@teambit/pkg": "1.0.
|
36
|
-
"@teambit/preview": "1.0.
|
37
|
-
"@teambit/schema": "1.0.
|
38
|
-
"@teambit/tester": "1.0.
|
39
|
-
"@teambit/typescript": "1.0.
|
40
|
-
"@teambit/webpack": "1.0.
|
41
|
-
"@teambit/graphql": "1.0.
|
42
|
-
"@teambit/bit": "1.6.
|
28
|
+
"@teambit/builder": "1.0.283",
|
29
|
+
"@teambit/bundler": "1.0.283",
|
30
|
+
"@teambit/compiler": "1.0.283",
|
31
|
+
"@teambit/dependency-resolver": "1.0.283",
|
32
|
+
"@teambit/formatter": "1.0.283",
|
33
|
+
"@teambit/isolator": "1.0.283",
|
34
|
+
"@teambit/linter": "1.0.283",
|
35
|
+
"@teambit/pkg": "1.0.283",
|
36
|
+
"@teambit/preview": "1.0.283",
|
37
|
+
"@teambit/schema": "1.0.283",
|
38
|
+
"@teambit/tester": "1.0.283",
|
39
|
+
"@teambit/typescript": "1.0.283",
|
40
|
+
"@teambit/webpack": "1.0.283",
|
41
|
+
"@teambit/graphql": "1.0.283",
|
42
|
+
"@teambit/bit": "1.6.176",
|
43
43
|
"@teambit/component-issues": "0.0.149",
|
44
|
-
"@teambit/dev-files": "1.0.
|
45
|
-
"@teambit/issues": "1.0.
|
44
|
+
"@teambit/dev-files": "1.0.283",
|
45
|
+
"@teambit/issues": "1.0.283",
|
46
46
|
"@teambit/toolbox.array.duplications-finder": "0.0.1",
|
47
47
|
"@teambit/toolbox.modules.module-resolver": "0.0.7",
|
48
48
|
"@teambit/cli-table": "0.0.48"
|