@teambit/node 0.0.676 → 0.0.679

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/artifacts/env-template/public/162.js +12 -0
  2. package/artifacts/env-template/public/298.js +1 -0
  3. package/artifacts/env-template/public/420.js +1 -0
  4. package/artifacts/env-template/public/677.js +1 -0
  5. package/artifacts/env-template/public/793.js +218 -0
  6. package/artifacts/env-template/public/assets-manifest.json +22 -22
  7. package/artifacts/env-template/public/compositions.288df61ff0249af2224d.js +1 -0
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/{overview.71058f57d6bdf294b6a0.js → overview.927ce5ff340f762c4689.js} +1 -1
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/peers.2221d5b025edd82f7f0b.js +1 -0
  12. package/artifacts/env-template/public/preview-root.164409784c7f44b8f8ce.js +1 -0
  13. package/artifacts/env-template/public/service-worker.js +1 -1
  14. package/artifacts/env-template/public/static/css/{719.34ae751d.css → 793.2c0416f7.css} +1 -1
  15. package/artifacts/preview/teambit_harmony_node-preview.js +1 -1
  16. package/{compositions-1647314610121.js → compositions-1647509820722.js} +0 -0
  17. package/dist/node.composition.js +1 -1
  18. package/dist/node.composition.js.map +1 -1
  19. package/dist/node.docs.mdx +1 -1
  20. package/dist/node.ui.runtime.js +6 -4
  21. package/dist/node.ui.runtime.js.map +1 -1
  22. package/dist/templates/node/index.js +6 -0
  23. package/dist/templates/node/index.js.map +1 -1
  24. package/dist/templates/node-env/files/doc.js +1 -1
  25. package/dist/templates/node-env/files/doc.js.map +1 -1
  26. package/node.composition.tsx +1 -1
  27. package/node.docs.mdx +1 -1
  28. package/node.ui.runtime.tsx +4 -3
  29. package/{overview-1647314610121.js → overview-1647509820722.js} +0 -0
  30. package/package-tar/teambit-node-0.0.679.tgz +0 -0
  31. package/package.json +18 -18
  32. package/{preview-1647314610121.js → preview-1647509820722.js} +2 -2
  33. package/templates/node/index.ts +6 -0
  34. package/templates/node-env/files/doc.ts +1 -1
  35. package/artifacts/env-template/public/181.js +0 -1
  36. package/artifacts/env-template/public/447.js +0 -1
  37. package/artifacts/env-template/public/719.js +0 -218
  38. package/artifacts/env-template/public/722.js +0 -12
  39. package/artifacts/env-template/public/848.js +0 -1
  40. package/artifacts/env-template/public/compositions.5820121c209e3fd91e1f.js +0 -1
  41. package/artifacts/env-template/public/peers.13a605e7a48007081e14.js +0 -1
  42. package/artifacts/env-template/public/preview-root.2aae95c9240e05eec1ed.js +0 -1
  43. package/package-tar/teambit-node-0.0.676.tgz +0 -0
@@ -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.harmony/node-preview"]=n():e["teambit.harmony/node-preview"]=n()}(self,(function(){return(()=>{var e={88244:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},66485:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});t(63804);var o=t(85057),a=t(58459),r=t(66682),i=["components"];function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function s(e,n){if(null==e)return{};var t,o,a=function(e,n){if(null==e)return{};var t,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var m={};function p(e){var n=e.components,t=s(e,i);return(0,o.mdx)("wrapper",d({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(a.MDXScopeProvider,{components:{Node:r.N},mdxType:"MDXScopeProvider"},(0,o.mdx)(r.N,{mdxType:"Node"})))}p.isMDXComponent=!0},66682:(e,n,t)=>{"use strict";Object.defineProperty(n,"N",{enumerable:!0,get:function(){return o.default}});var o=a(t(57190));function a(e){return e&&e.__esModule?e:{default:e}}a.__bit_component={id:"teambit.harmony/aspect-docs/node@0.0.134",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0}},57190:(e,n,t)=>{"use strict";var o={id:"teambit.harmony/aspect-docs/node@0.0.134",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c;d(t(63804));var a=t(85057),r=t(58459),i=["components"];function d(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s.apply(this,arguments)}function m(e,n){if(null==e)return{};var t,o,a=p(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function p(e,n){if(null==e)return{};var t,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(a[t]=e[t]);return a}d.__bit_component=o,s.__bit_component=o,m.__bit_component=o,p.__bit_component=o;var l={};function c(e){var n=e.components,t=m(e,i);return(0,a.mdx)("wrapper",s({},l,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,a.mdx)("p",null,"The built-in ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/harmony/node"},"Node Component Development Environment")," is a concrete composition of the ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/envs/envs"},"Env Aspect"),". Use it when getting started with Node components with Bit and later as a base for any future customization of your Node-based workflow."),(0,a.mdx)("p",null,"Node environment is composed out of the base ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/react/react"},"React Environment")," with some specific overrides for dependency management."),(0,a.mdx)("h2",null,"Use Node environment"),(0,a.mdx)("p",null,"To use this environment for your components, add it to any of the ",(0,a.mdx)("inlineCode",{parentName:"p"},"variants")," in your ",(0,a.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," file as follows:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.jsonc"',title:'"workspace.jsonc"'},'{\n "teambit.workspace/variants": {\n "some/path": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,a.mdx)("h2",null,"Create Node components"),(0,a.mdx)("p",null,"Node implements several component templates:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"node-env")," boilerplate for customizing configuration.")),(0,a.mdx)("p",null,"Use any of these templates with the ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit create")," command:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create <template name> [components...]\n")),(0,a.mdx)("h2",null,"Default Configuration and Services"),(0,a.mdx)("p",null,"Node, like all over Environments must implement a set of Service Handlers. For each service, Node compose a different tool and config by default."),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"Node is a composition of the React environment with some specific modifications. Most of the links here direct to the actual configs in React environment.")),(0,a.mdx)("table",null,(0,a.mdx)("thead",{parentName:"table"},(0,a.mdx)("tr",{parentName:"thead"},(0,a.mdx)("th",{parentName:"tr",align:null},"Service"),(0,a.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,a.mdx)("th",{parentName:"tr",align:null},"Base Configuration"))),(0,a.mdx)("tbody",{parentName:"table"},(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Compilation"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Testing"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Jest")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Linting"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"ESLint")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Preview (simulation)"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Package"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"PKG")),(0,a.mdx)("td",{parentName:"tr",align:null},"Base ",(0,a.mdx)("inlineCode",{parentName:"td"},"package.json")," props from ",(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Bundling"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Documentation"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("em",{parentName:"td"},"Core implementation")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Build pipeline"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/pipelines/builder"},"Builder")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/node.env.ts"},"Build pipeline"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Dependencies"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("em",{parentName:"td"},"Core implementation")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/harmony/node/~code/node.env.ts"},"Env-dependencies"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Component Generator"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/generator/generator"},"Generator")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/harmony/node/~code/templates/node-component.ts"},"example template"))))),(0,a.mdx)("h2",null,"Customize environment"),(0,a.mdx)("p",null,"All environments are extendible. You can take any pre-existing environment, and create a component to extend it. That component can then use APIs to:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},"Override default configurations."),(0,a.mdx)("li",{parentName:"ul"},"Replace composed tools with others (for example - use Babel instead of TypeScript)."),(0,a.mdx)("li",{parentName:"ul"},"Add new services and capabilities.")),(0,a.mdx)("h3",null,"Create an extension"),(0,a.mdx)("p",null,"The first step is to create a component that extends Node. Use the ",(0,a.mdx)("inlineCode",{parentName:"p"},"node-env")," template from Node env."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create node-env extensions/custom-node\n")),(0,a.mdx)("p",null,"As with any component, environments must themselves have an environment which compiles, builds, transpiles, etc, them. Bit has a special environment that knows how to create other environments - ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect"),". So for any component that is meant to be a Bit environment, you must set ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," as the environment for that component."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="add variant for the extension and set the aspect env"',title:'"add',variant:!0,for:!0,the:!0,extension:!0,and:!0,set:!0,aspect:!0,'env"':!0},'{\n //...\n "teambit.workspace/variants": {\n //...\n "extensions/custom-node": {\n "teambit.harmony/aspect": {}\n }\n //...\n }\n}\n')),(0,a.mdx)("p",null,"Validate the above by running ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit env")," and see that the extension-component has ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," set as an environment."),(0,a.mdx)("p",null,"Now that you have a basic customized extension to start from, you can go ahead and configure it for your components in ",(0,a.mdx)("inlineCode",{parentName:"p"},"workspace.json"),":"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="edit variants and set the new env"',title:'"edit',variants:!0,and:!0,set:!0,the:!0,new:!0,'env"':!0},'{\n //...\n "teambit.workspace/variants": {\n //...\n "[some]/[variant]": {\n "[yourscope]/extensions/custom-node": {}\n }\n //...\n }\n}\n')),(0,a.mdx)("h3",null,"Customize configuration"),(0,a.mdx)("p",null,"Node implements a set of APIs you can use to merge your preferred configuration with its defaults. These APIs are called ",(0,a.mdx)("strong",{parentName:"p"},"transformers")," and they all start with the ",(0,a.mdx)("inlineCode",{parentName:"p"},"override")," pre-fix. Find ",(0,a.mdx)("a",{parentName:"p",href:"#transformers-api-docs"},"Available transformers here"),".\nIn case of a conflict, your config will override the default."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-typescript",metastring:'{4,14} title="Customized TypeScript configuration"',"{4,14}":!0,title:'"Customized',TypeScript:!0,'configuration"':!0},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { NodeAspect, NodeMain } from '@teambit/node';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport class CustomNodeExtension {\n constructor(private node: NodeMain) {}\n\n static dependencies: any = [EnvsAspect, NodeAspect];\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const customNodeEnv = node.compose([node.overrideTsConfig(tsconfig)]);\n\n envs.registerEnv(customNodeEnv);\n\n return new CustomNodeExtension(node);\n }\n}\n")),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"To override any specific configuration it's recommended to create a separate config file with your customized configuration and import it into the main ",(0,a.mdx)("inlineCode",{parentName:"p"},".extension.ts")," file where you can supply it to the relevant ",(0,a.mdx)("strong",{parentName:"p"},"transformers"),". See the tsconfig example in the above snippet.")),(0,a.mdx)("h3",null,"Composing tools and services"),(0,a.mdx)("p",null,"Environments use Environment Services by implementing a special class of methods called Service Handlers.\nThe supplied transformers allow overriding of these services - for instance the ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideCompiler")," transformer allows overriding the environment's ",(0,a.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," method."),(0,a.mdx)("p",null,"The below example uses the ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideCompiler")," transformer to override the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," Service Handler to change the compilation service."),(0,a.mdx)("ol",null,(0,a.mdx)("li",{parentName:"ol"},"Add a Babel config file to your custom environment and import/require it in your ",(0,a.mdx)("inlineCode",{parentName:"li"},".extension")," file"),(0,a.mdx)("li",{parentName:"ol"},"Create a new Babel compiler using the Babel aspect, and initialize it with the above babelConfig"),(0,a.mdx)("li",{parentName:"ol"},"Use the ",(0,a.mdx)("inlineCode",{parentName:"li"},"compose")," Env API to apply the compiler override transformer and add Babel as a transpiler in the environment")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-typescript",metastring:"{3,5,10-12,15,17-18,22-23}","{3,5,10-12,15,17-18,22-23}":!0},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { NodeAspect, NodeMain } from '@teambit/node';\nimport { BabelAspect, BabelMain } from '@teambit/babel';\n\nconst babelConfig = require('./babel/babel.config');\n\nexport class CustomNodeExtension {\n constructor(private node: NodeMain) {}\n\n static dependencies: any = [EnvsAspect, NodeAspect, BabelAspect];\n\n static async provider([envs, node, babel]: [EnvsMain, NodeMain, BabelMain]) {\n const babelCompiler = babel.createCompiler({\n babelTransformOptions: babelConfig,\n });\n\n const customNodeEnv = node.compose([\n node.overrideCompiler(babelCompiler),\n node.overrideCompilerTasks([babelCompiler.createTask()]),\n ]);\n\n envs.registerEnv(customNodeEnv);\n return new CustomNodeExtension(node);\n }\n}\n")),(0,a.mdx)("h3",null,"Transformers API docs"),(0,a.mdx)("p",null,"Use these APIs to customize the base Node environment default configuration with your extension. ",(0,a.mdx)("a",{parentName:"p",href:"#customizing-configuration"},"Read more here"),"."),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideTsConfig(tsconfig: TsConfigSourceFile): EnvTransformer")),(0,a.mdx)("p",null,"Merges the environment's default TypeScript configuration with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://www.typescriptlang.org/handbook/tsconfig-json.html"},"typescript configuration file"),".\nThis config affects the transpilation carried out when rendering components on the local dev UI. To override the config used when building components, use ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideBuildTsConfig")," below."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst tsconfig = require('./typescript/tsconfig.json');\nexport class NodeExtension {\n// ...\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideTsConfig(tsconfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideBuildTsConfig(tsconfig: TsConfigSourceFile): EnvTransformer")),(0,a.mdx)("p",null,"Merges the environment's default TypeScript configuration with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://www.typescriptlang.org/handbook/tsconfig-json.html"},"typescript configuration file"),".\nThis config affects transpilation of component code during the build process, i.e. in preparation for packaging and exporting the component. To override the local ts config used when rendering components in the local UI, please use ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideTsConfig")," above."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst tsconfig = require('./typescript/tsconfig.json');\nexport class NodeExtension {\n// ...\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideTsConfig(tsconfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overridePreviewConfig(config: Configuration): EnvTransformer")),(0,a.mdx)("p",null,"Merges the Webpack configuration for the 'Preview' environment service, with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://webpack.js.org/configuration/"},"webpack configuration file"),".\nThis webpack configuration is used for building and rendering your components on the local dev server."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst webpackConfig = require('./webpack/webpack.config');\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overridePreviewConfig(webpackConfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideDevServerConfig(config: Configuration): EnvTransformer")),(0,a.mdx)("p",null,"Merges the Webpack configuration for the 'DevServer' environment service, with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://webpack.js.org/configuration/"},"webpack configuration file"),".\nThis configuration is used for building and rendering the dev server UI (but not your components, which use the PreviewConfig)"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst webpackConfig = require('./webpack/webpack.config');\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideDevServerConfig(webpackConfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideJestConfig(jestConfigPath: string): EnvTransformer")),(0,a.mdx)("p",null,"Merges the default configuration for the Jest test runner with the contents of your (",(0,a.mdx)("a",{parentName:"p",href:"https://jestjs.io/en/configuration"},"jest.config configuration file"),")."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideJestConfig(require.resolve('./jest/jest.config'))\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideBuildPipe(tasks: BuildTask[]): EnvTransformer")),(0,a.mdx)("p",null,"This method receives an array of build tasks. It merges the provided tasks with the environment's default build pipeline (initiated either on a ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit tag")," or ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit build")," command)."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\n// Import the task\nimport { CustomTask } from './custom.task';\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n // Get the environment's default build pipeline using the 'getBuildPipe' service handler\n const nodePipe = node.env.getBuildPipe();\n // Add the custom task to the end of the build tasks sequence.\n const tasks = [...nodePipe, new CustomTask()];\n const newNodeEnv = node.compose([node.overrideBuildPipe(tasks)]);\n // ...\n }\n}\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideDependencies(dependencyPolicy: DependenciesPolicy): EnvTransformer")),(0,a.mdx)("p",null,"This method receives a dependency-policy object and merges it with the environment's default dependency policy for components using this environment.\nEach key-value pair in a dependency-policy object signifies the package and the version to be used. Use also the ",(0,a.mdx)("inlineCode",{parentName:"p"},"-")," and ",(0,a.mdx)("inlineCode",{parentName:"p"},"+")," notation to signify a module should moved between dependency types (dev, peer or standard)."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-js"},"// ...\nconst newDependencies = {\n devDependencies: {\n '@types/jest': '~26.0.9',\n },\n};\n\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([node.overrideDependencies(newDependencies)]);\n // ...\n }\n}\n")),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"The above example shows the 'Node' library being removed as a (runtime) dependency and added as a peer dependency.")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overridePackageJsonProps(props: PackageJsonProps): EnvTransformer")),(0,a.mdx)("p",null,"Merges the provide props with the default properties added to the ",(0,a.mdx)("inlineCode",{parentName:"p"},"package.json")," file of every package generated from components using this environment."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst newPackageProps = {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n};\n\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([node.overridePackageJsonProps(newPackageProps)]);\n // ...\n }\n}\n"))))}c.__bit_component=o,c.isMDXComponent=!0},33286:(e,n,t)=>{"use strict";var o={id:"teambit.harmony/node@0.0.676",homepage:"https://bit.dev/teambit/harmony/node",exported:!0},a=t(88244);function r(){const e=a(t(63804));return r=function(){return e},e}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,r.__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/brands/logo-nodejs.svg"}));i.__bit_component=o,n.Logo=i},85057:e=>{"use strict";e.exports=MdxJsReact},63804:e=>{"use strict";e.exports=React},58459:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var a=n[o];if(void 0!==a)return a.exports;var r=n[o]={exports:{}};return e[o](r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var 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(()=>{"use strict";t.r(o),t.d(o,{compositions:()=>e,overview:()=>n});const e=[t(33286)],n=[t(66485)]})(),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.harmony/node-preview"]=n():e["teambit.harmony/node-preview"]=n()}(self,(function(){return(()=>{var e={88244:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},34745:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});t(63804);var o=t(85057),a=t(58459),r=t(66682),i=["components"];function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function s(e,n){if(null==e)return{};var t,o,a=function(e,n){if(null==e)return{};var t,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var m={};function p(e){var n=e.components,t=s(e,i);return(0,o.mdx)("wrapper",d({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(a.MDXScopeProvider,{components:{Node:r.N},mdxType:"MDXScopeProvider"},(0,o.mdx)(r.N,{mdxType:"Node"})))}p.isMDXComponent=!0},66682:(e,n,t)=>{"use strict";Object.defineProperty(n,"N",{enumerable:!0,get:function(){return o.default}});var o=a(t(57190));function a(e){return e&&e.__esModule?e:{default:e}}a.__bit_component={id:"teambit.harmony/aspect-docs/node@0.0.134",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0}},57190:(e,n,t)=>{"use strict";var o={id:"teambit.harmony/aspect-docs/node@0.0.134",homepage:"https://bit.dev/teambit/harmony/aspect-docs/node",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c;d(t(63804));var a=t(85057),r=t(58459),i=["components"];function d(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s.apply(this,arguments)}function m(e,n){if(null==e)return{};var t,o,a=p(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function p(e,n){if(null==e)return{};var t,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(a[t]=e[t]);return a}d.__bit_component=o,s.__bit_component=o,m.__bit_component=o,p.__bit_component=o;var l={};function c(e){var n=e.components,t=m(e,i);return(0,a.mdx)("wrapper",s({},l,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,a.mdx)("p",null,"The built-in ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/harmony/node"},"Node Component Development Environment")," is a concrete composition of the ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/envs/envs"},"Env Aspect"),". Use it when getting started with Node components with Bit and later as a base for any future customization of your Node-based workflow."),(0,a.mdx)("p",null,"Node environment is composed out of the base ",(0,a.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/react/react"},"React Environment")," with some specific overrides for dependency management."),(0,a.mdx)("h2",null,"Use Node environment"),(0,a.mdx)("p",null,"To use this environment for your components, add it to any of the ",(0,a.mdx)("inlineCode",{parentName:"p"},"variants")," in your ",(0,a.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," file as follows:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.jsonc"',title:'"workspace.jsonc"'},'{\n "teambit.workspace/variants": {\n "some/path": {\n "teambit.harmony/node": {}\n }\n }\n}\n')),(0,a.mdx)("h2",null,"Create Node components"),(0,a.mdx)("p",null,"Node implements several component templates:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"node-env")," boilerplate for customizing configuration.")),(0,a.mdx)("p",null,"Use any of these templates with the ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit create")," command:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create <template name> [components...]\n")),(0,a.mdx)("h2",null,"Default Configuration and Services"),(0,a.mdx)("p",null,"Node, like all over Environments must implement a set of Service Handlers. For each service, Node compose a different tool and config by default."),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"Node is a composition of the React environment with some specific modifications. Most of the links here direct to the actual configs in React environment.")),(0,a.mdx)("table",null,(0,a.mdx)("thead",{parentName:"table"},(0,a.mdx)("tr",{parentName:"thead"},(0,a.mdx)("th",{parentName:"tr",align:null},"Service"),(0,a.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,a.mdx)("th",{parentName:"tr",align:null},"Base Configuration"))),(0,a.mdx)("tbody",{parentName:"table"},(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Compilation"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Testing"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Jest")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Linting"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"ESLint")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Preview (simulation)"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Package"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"PKG")),(0,a.mdx)("td",{parentName:"tr",align:null},"Base ",(0,a.mdx)("inlineCode",{parentName:"td"},"package.json")," props from ",(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Bundling"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("strong",{parentName:"td"},"Webpack")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Documentation"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("em",{parentName:"td"},"Core implementation")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Build pipeline"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/pipelines/builder"},"Builder")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/node.env.ts"},"Build pipeline"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Dependencies"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("em",{parentName:"td"},"Core implementation")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/harmony/node/~code/node.env.ts"},"Env-dependencies"))),(0,a.mdx)("tr",{parentName:"tbody"},(0,a.mdx)("td",{parentName:"tr",align:null},"Component Generator"),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/generator/generator"},"Generator")),(0,a.mdx)("td",{parentName:"tr",align:null},(0,a.mdx)("a",{parentName:"td",href:"https://bit.dev/harmony/node/~code/templates/node-component.ts"},"example template"))))),(0,a.mdx)("h2",null,"Customize environment"),(0,a.mdx)("p",null,"All environments are extendible. You can take any pre-existing environment, and create a component to extend it. That component can then use APIs to:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},"Override default configurations."),(0,a.mdx)("li",{parentName:"ul"},"Replace composed tools with others (for example - use Babel instead of TypeScript)."),(0,a.mdx)("li",{parentName:"ul"},"Add new services and capabilities.")),(0,a.mdx)("h3",null,"Create an extension"),(0,a.mdx)("p",null,"The first step is to create a component that extends Node. Use the ",(0,a.mdx)("inlineCode",{parentName:"p"},"node-env")," template from Node env."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create node-env extensions/custom-node\n")),(0,a.mdx)("p",null,"As with any component, environments must themselves have an environment which compiles, builds, transpiles, etc, them. Bit has a special environment that knows how to create other environments - ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect"),". So for any component that is meant to be a Bit environment, you must set ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," as the environment for that component."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="add variant for the extension and set the aspect env"',title:'"add',variant:!0,for:!0,the:!0,extension:!0,and:!0,set:!0,aspect:!0,'env"':!0},'{\n //...\n "teambit.workspace/variants": {\n //...\n "extensions/custom-node": {\n "teambit.harmony/aspect": {}\n }\n //...\n }\n}\n')),(0,a.mdx)("p",null,"Validate the above by running ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit env")," and see that the extension-component has ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," set as an environment."),(0,a.mdx)("p",null,"Now that you have a basic customized extension to start from, you can go ahead and configure it for your components in ",(0,a.mdx)("inlineCode",{parentName:"p"},"workspace.json"),":"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="edit variants and set the new env"',title:'"edit',variants:!0,and:!0,set:!0,the:!0,new:!0,'env"':!0},'{\n //...\n "teambit.workspace/variants": {\n //...\n "[some]/[variant]": {\n "[yourscope]/extensions/custom-node": {}\n }\n //...\n }\n}\n')),(0,a.mdx)("h3",null,"Customize configuration"),(0,a.mdx)("p",null,"Node implements a set of APIs you can use to merge your preferred configuration with its defaults. These APIs are called ",(0,a.mdx)("strong",{parentName:"p"},"transformers")," and they all start with the ",(0,a.mdx)("inlineCode",{parentName:"p"},"override")," pre-fix. Find ",(0,a.mdx)("a",{parentName:"p",href:"#transformers-api-docs"},"Available transformers here"),".\nIn case of a conflict, your config will override the default."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-typescript",metastring:'{4,14} title="Customized TypeScript configuration"',"{4,14}":!0,title:'"Customized',TypeScript:!0,'configuration"':!0},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { NodeAspect, NodeMain } from '@teambit/node';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport class CustomNodeExtension {\n constructor(private node: NodeMain) {}\n\n static dependencies: any = [EnvsAspect, NodeAspect];\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const customNodeEnv = node.compose([node.overrideTsConfig(tsconfig)]);\n\n envs.registerEnv(customNodeEnv);\n\n return new CustomNodeExtension(node);\n }\n}\n")),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"To override any specific configuration it's recommended to create a separate config file with your customized configuration and import it into the main ",(0,a.mdx)("inlineCode",{parentName:"p"},".extension.ts")," file where you can supply it to the relevant ",(0,a.mdx)("strong",{parentName:"p"},"transformers"),". See the tsconfig example in the above snippet.")),(0,a.mdx)("h3",null,"Composing tools and services"),(0,a.mdx)("p",null,"Environments use Environment Services by implementing a special class of methods called Service Handlers.\nThe supplied transformers allow overriding of these services - for instance the ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideCompiler")," transformer allows overriding the environment's ",(0,a.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," method."),(0,a.mdx)("p",null,"The below example uses the ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideCompiler")," transformer to override the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getCompiler()")," Service Handler to change the compilation service."),(0,a.mdx)("ol",null,(0,a.mdx)("li",{parentName:"ol"},"Add a Babel config file to your custom environment and import/require it in your ",(0,a.mdx)("inlineCode",{parentName:"li"},".extension")," file"),(0,a.mdx)("li",{parentName:"ol"},"Create a new Babel compiler using the Babel aspect, and initialize it with the above babelConfig"),(0,a.mdx)("li",{parentName:"ol"},"Use the ",(0,a.mdx)("inlineCode",{parentName:"li"},"compose")," Env API to apply the compiler override transformer and add Babel as a transpiler in the environment")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-typescript",metastring:"{3,5,10-12,15,17-18,22-23}","{3,5,10-12,15,17-18,22-23}":!0},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { NodeAspect, NodeMain } from '@teambit/node';\nimport { BabelAspect, BabelMain } from '@teambit/babel';\n\nconst babelConfig = require('./babel/babel.config');\n\nexport class CustomNodeExtension {\n constructor(private node: NodeMain) {}\n\n static dependencies: any = [EnvsAspect, NodeAspect, BabelAspect];\n\n static async provider([envs, node, babel]: [EnvsMain, NodeMain, BabelMain]) {\n const babelCompiler = babel.createCompiler({\n babelTransformOptions: babelConfig,\n });\n\n const customNodeEnv = node.compose([\n node.overrideCompiler(babelCompiler),\n node.overrideCompilerTasks([babelCompiler.createTask()]),\n ]);\n\n envs.registerEnv(customNodeEnv);\n return new CustomNodeExtension(node);\n }\n}\n")),(0,a.mdx)("h3",null,"Transformers API docs"),(0,a.mdx)("p",null,"Use these APIs to customize the base Node environment default configuration with your extension. ",(0,a.mdx)("a",{parentName:"p",href:"#customizing-configuration"},"Read more here"),"."),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideTsConfig(tsconfig: TsConfigSourceFile): EnvTransformer")),(0,a.mdx)("p",null,"Merges the environment's default TypeScript configuration with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://www.typescriptlang.org/handbook/tsconfig-json.html"},"typescript configuration file"),".\nThis config affects the transpilation carried out when rendering components on the local dev UI. To override the config used when building components, use ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideBuildTsConfig")," below."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst tsconfig = require('./typescript/tsconfig.json');\nexport class NodeExtension {\n// ...\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideTsConfig(tsconfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideBuildTsConfig(tsconfig: TsConfigSourceFile): EnvTransformer")),(0,a.mdx)("p",null,"Merges the environment's default TypeScript configuration with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://www.typescriptlang.org/handbook/tsconfig-json.html"},"typescript configuration file"),".\nThis config affects transpilation of component code during the build process, i.e. in preparation for packaging and exporting the component. To override the local ts config used when rendering components in the local UI, please use ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideTsConfig")," above."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst tsconfig = require('./typescript/tsconfig.json');\nexport class NodeExtension {\n// ...\n\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideTsConfig(tsconfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overridePreviewConfig(config: Configuration): EnvTransformer")),(0,a.mdx)("p",null,"Merges the Webpack configuration for the 'Preview' environment service, with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://webpack.js.org/configuration/"},"webpack configuration file"),".\nThis webpack configuration is used for building and rendering your components on the local dev server."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst webpackConfig = require('./webpack/webpack.config');\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overridePreviewConfig(webpackConfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideDevServerConfig(config: Configuration): EnvTransformer")),(0,a.mdx)("p",null,"Merges the Webpack configuration for the 'DevServer' environment service, with the contents of your ",(0,a.mdx)("a",{parentName:"p",href:"https://webpack.js.org/configuration/"},"webpack configuration file"),".\nThis configuration is used for building and rendering the dev server UI (but not your components, which use the PreviewConfig)"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst webpackConfig = require('./webpack/webpack.config');\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideDevServerConfig(webpackConfig)\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideJestConfig(jestConfigPath: string): EnvTransformer")),(0,a.mdx)("p",null,"Merges the default configuration for the Jest test runner with the contents of your (",(0,a.mdx)("a",{parentName:"p",href:"https://jestjs.io/en/configuration"},"jest.config configuration file"),")."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nexport class NodeExtension {\n// ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([\n node.overrideJestConfig(require.resolve('./jest/jest.config'))\n ]);\n}\n// ...\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideBuildPipe(tasks: BuildTask[]): EnvTransformer")),(0,a.mdx)("p",null,"This method receives an array of build tasks. It merges the provided tasks with the environment's default build pipeline (initiated either on a ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit tag")," or ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit build")," command)."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\n// Import the task\nimport { CustomTask } from './custom.task';\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n // Get the environment's default build pipeline using the 'getBuildPipe' service handler\n const nodePipe = node.env.getBuildPipe();\n // Add the custom task to the end of the build tasks sequence.\n const tasks = [...nodePipe, new CustomTask()];\n const newNodeEnv = node.compose([node.overrideBuildPipe(tasks)]);\n // ...\n }\n}\n")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overrideDependencies(dependencyPolicy: DependenciesPolicy): EnvTransformer")),(0,a.mdx)("p",null,"This method receives a dependency-policy object and merges it with the environment's default dependency policy for components using this environment.\nEach key-value pair in a dependency-policy object signifies the package and the version to be used. Use also the ",(0,a.mdx)("inlineCode",{parentName:"p"},"-")," and ",(0,a.mdx)("inlineCode",{parentName:"p"},"+")," notation to signify a module should moved between dependency types (dev, peer or standard)."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-js"},"// ...\nconst newDependencies = {\n devDependencies: {\n '@types/jest': '~26.0.9',\n },\n};\n\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([node.overrideDependencies(newDependencies)]);\n // ...\n }\n}\n")),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"The above example shows the 'Node' library being removed as a (runtime) dependency and added as a peer dependency.")),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"overridePackageJsonProps(props: PackageJsonProps): EnvTransformer")),(0,a.mdx)("p",null,"Merges the provide props with the default properties added to the ",(0,a.mdx)("inlineCode",{parentName:"p"},"package.json")," file of every package generated from components using this environment."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts"},"// ...\nconst newPackageProps = {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n};\n\nexport class CustomNode {\n // ...\n static async provider([envs, node]: [EnvsMain, NodeMain]) {\n const newNodeEnv = node.compose([node.overridePackageJsonProps(newPackageProps)]);\n // ...\n }\n}\n"))))}c.__bit_component=o,c.isMDXComponent=!0},30192:(e,n,t)=>{"use strict";var o={id:"teambit.harmony/node@0.0.679",homepage:"https://bit.dev/teambit/harmony/node",exported:!0},a=t(88244);function r(){const e=a(t(63804));return r=function(){return e},e}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,r.__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/node.svg"}));i.__bit_component=o,n.Logo=i},85057:e=>{"use strict";e.exports=MdxJsReact},63804:e=>{"use strict";e.exports=React},58459:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var a=n[o];if(void 0!==a)return a.exports;var r=n[o]={exports:{}};return e[o](r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var 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(()=>{"use strict";t.r(o),t.d(o,{compositions:()=>e,overview:()=>n});const e=[t(30192)],n=[t(34745)]})(),o})()}));
@@ -27,7 +27,7 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
27
27
  style: {
28
28
  width: 70
29
29
  },
30
- src: "https://static.bit.dev/brands/logo-nodejs.svg"
30
+ src: "https://static.bit.dev/extensions-icons/node.svg"
31
31
  }));
32
32
 
33
33
  exports.Logo = Logo;
@@ -1 +1 @@
1
- {"version":3,"sources":["node.composition.tsx"],"names":["Logo","height","display","justifyContent","width"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;AAAK,EAAA,KAAK,EAAE;AAAEC,IAAAA,MAAM,EAAE,MAAV;AAAkBC,IAAAA,OAAO,EAAE,MAA3B;AAAmCC,IAAAA,cAAc,EAAE;AAAnD;AAAZ,gBACE;AAAK,EAAA,KAAK,EAAE;AAAEC,IAAAA,KAAK,EAAE;AAAT,GAAZ;AAA2B,EAAA,GAAG,EAAC;AAA/B,EADF,CADK","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/brands/logo-nodejs.svg\" />\n </div>\n);\n"]}
1
+ {"version":3,"sources":["node.composition.tsx"],"names":["Logo","height","display","justifyContent","width"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;AAAK,EAAA,KAAK,EAAE;AAAEC,IAAAA,MAAM,EAAE,MAAV;AAAkBC,IAAAA,OAAO,EAAE,MAA3B;AAAmCC,IAAAA,cAAc,EAAE;AAAnD;AAAZ,gBACE;AAAK,EAAA,KAAK,EAAE;AAAEC,IAAAA,KAAK,EAAE;AAAT,GAAZ;AAA2B,EAAA,GAAG,EAAC;AAA/B,EADF,CADK","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/node.svg\" />\n </div>\n);\n"]}
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: A Bit development environment for Node Components
2
+ description: A development environment for Node Components
3
3
  labels: ['node', 'environment', 'env', 'aspect', 'extension']
4
4
  ---
5
5
 
@@ -83,19 +83,21 @@ function _node() {
83
83
 
84
84
  class NodeEnvUI {
85
85
  static async provider([compositionsUI, testerUi]) {
86
- const nodeEnvUI = new NodeEnvUI();
86
+ const nodeEnvUI = new NodeEnvUI(); // TODO: pass the docs url into here after fetch it from the community aspect
87
+
87
88
  testerUi.registerEmptyState(() => {
88
89
  return /*#__PURE__*/_react().default.createElement(_designUi().EmptyBox, {
89
90
  title: "This component doesn\u2019t have any tests.",
90
91
  linkText: "Learn how to add tests to your node components",
91
- link: "https://harmony-docs.bit.dev/testing/overview/"
92
+ link: `https://bit.dev/docs/dev-services-overview/tester/tester-overview`
92
93
  });
93
- });
94
+ }); // TODO: pass the docs url into here after fetch it from the community aspect
95
+
94
96
  compositionsUI.registerEmptyState(() => {
95
97
  return /*#__PURE__*/_react().default.createElement(_designUi().EmptyBox, {
96
98
  title: "This component doesn\u2019t have any compositions.",
97
99
  linkText: "Learn how to add compositions to your node components",
98
- link: "https://harmony-docs.bit.dev/compositions/overview/"
100
+ link: `https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`
99
101
  });
100
102
  });
101
103
  return nodeEnvUI;
@@ -1 +1 @@
1
- {"version":3,"sources":["node.ui.runtime.tsx"],"names":["NodeEnvUI","provider","compositionsUI","testerUi","nodeEnvUI","registerEmptyState","UIRuntime","CompositionsAspect","TesterAspect","NodeAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,SAAN,CAAgB;AAKA,eAARC,QAAQ,CAAC,CAACC,cAAD,EAAiBC,QAAjB,CAAD,EAAyD;AAC5E,UAAMC,SAAS,GAAG,IAAIJ,SAAJ,EAAlB;AAEAG,IAAAA,QAAQ,CAACE,kBAAT,CAA4B,MAAM;AAChC,0BACE,+BAAC,oBAAD;AACE,QAAA,KAAK,EAAC,6CADR;AAEE,QAAA,QAAQ,EAAC,gDAFX;AAGE,QAAA,IAAI,EAAC;AAHP,QADF;AAOD,KARD;AAUAH,IAAAA,cAAc,CAACG,kBAAf,CAAkC,MAAM;AACtC,0BACE,+BAAC,oBAAD;AACE,QAAA,KAAK,EAAC,oDADR;AAEE,QAAA,QAAQ,EAAC,uDAFX;AAGE,QAAA,IAAI,EAAC;AAHP,QADF;AAOD,KARD;AAUA,WAAOD,SAAP;AACD;;AA7BoB;;;gCAAVJ,S,aACMM,e;gCADNN,S,WAEI,E;gCAFJA,S,kBAGW,CAACO,kCAAD,EAAqBC,sBAArB,C;;AA6BxBC,mBAAWC,UAAX,CAAsBV,SAAtB;;eAEeA,S","sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { NodeAspect } from './node.aspect';\n\nexport class NodeEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const nodeEnvUI = new NodeEnvUI();\n\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your node components\"\n link=\"https://harmony-docs.bit.dev/testing/overview/\"\n />\n );\n });\n\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your node components\"\n link=\"https://harmony-docs.bit.dev/compositions/overview/\"\n />\n );\n });\n\n return nodeEnvUI;\n }\n}\n\nNodeAspect.addRuntime(NodeEnvUI);\n\nexport default NodeEnvUI;\n"]}
1
+ {"version":3,"sources":["node.ui.runtime.tsx"],"names":["NodeEnvUI","provider","compositionsUI","testerUi","nodeEnvUI","registerEmptyState","UIRuntime","CompositionsAspect","TesterAspect","NodeAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,SAAN,CAAgB;AAKA,eAARC,QAAQ,CAAC,CAACC,cAAD,EAAiBC,QAAjB,CAAD,EAAyD;AAC5E,UAAMC,SAAS,GAAG,IAAIJ,SAAJ,EAAlB,CAD4E,CAE5E;;AACAG,IAAAA,QAAQ,CAACE,kBAAT,CAA4B,MAAM;AAChC,0BACE,+BAAC,oBAAD;AACE,QAAA,KAAK,EAAC,6CADR;AAEE,QAAA,QAAQ,EAAC,gDAFX;AAGE,QAAA,IAAI,EAAG;AAHT,QADF;AAOD,KARD,EAH4E,CAa5E;;AACAH,IAAAA,cAAc,CAACG,kBAAf,CAAkC,MAAM;AACtC,0BACE,+BAAC,oBAAD;AACE,QAAA,KAAK,EAAC,oDADR;AAEE,QAAA,QAAQ,EAAC,uDAFX;AAGE,QAAA,IAAI,EAAG;AAHT,QADF;AAOD,KARD;AAUA,WAAOD,SAAP;AACD;;AA9BoB;;;gCAAVJ,S,aACMM,e;gCADNN,S,WAEI,E;gCAFJA,S,kBAGW,CAACO,kCAAD,EAAqBC,sBAArB,C;;AA8BxBC,mBAAWC,UAAX,CAAsBV,SAAtB;;eAEeA,S","sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { NodeAspect } from './node.aspect';\n\nexport class NodeEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const nodeEnvUI = new NodeEnvUI();\n // TODO: pass the docs url into here after fetch it from the community aspect\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}\n />\n );\n });\n\n // TODO: pass the docs url into here after fetch it from the community aspect\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}\n />\n );\n });\n\n return nodeEnvUI;\n }\n}\n\nNodeAspect.addRuntime(NodeEnvUI);\n\nexport default NodeEnvUI;\n"]}
@@ -60,6 +60,12 @@ const nodeTemplate = {
60
60
  description: 'a Node.js module',
61
61
  generateFiles: context => {
62
62
  return [(0, _index().indexFile)(context), (0, _doc().docFile)(context), (0, _main().mainFile)(context), (0, _composition().compositionFile)(context), (0, _test().testFile)(context)];
63
+ },
64
+ config: {
65
+ 'teambit.harmony/node': {},
66
+ 'teambit.envs/envs': {
67
+ env: 'teambit.harmony/node'
68
+ }
63
69
  }
64
70
  };
65
71
  exports.nodeTemplate = nodeTemplate;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["nodeTemplate","name","description","generateFiles","context"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,YAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAE,MADuC;AAE7CC,EAAAA,WAAW,EAAE,kBAFgC;AAG7CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CAAC,wBAAUA,OAAV,CAAD,EAAqB,oBAAQA,OAAR,CAArB,EAAuC,sBAASA,OAAT,CAAvC,EAA0D,oCAAgBA,OAAhB,CAA1D,EAAoF,sBAASA,OAAT,CAApF,CAAP;AACD;AAL4C,CAAxC","sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\nimport { testFile } from './files/test';\nimport { compositionFile } from './files/composition';\n\nexport const nodeTemplate: ComponentTemplate = {\n name: 'node',\n description: 'a Node.js module',\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), docFile(context), mainFile(context), compositionFile(context), testFile(context)];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["nodeTemplate","name","description","generateFiles","context","config","env"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,YAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAE,MADuC;AAE7CC,EAAAA,WAAW,EAAE,kBAFgC;AAG7CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CAAC,wBAAUA,OAAV,CAAD,EAAqB,oBAAQA,OAAR,CAArB,EAAuC,sBAASA,OAAT,CAAvC,EAA0D,oCAAgBA,OAAhB,CAA1D,EAAoF,sBAASA,OAAT,CAApF,CAAP;AACD,GAL4C;AAM7CC,EAAAA,MAAM,EAAE;AACN,4BAAwB,EADlB;AAEN,yBAAqB;AACnBC,MAAAA,GAAG,EAAE;AADc;AAFf;AANqC,CAAxC","sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\nimport { testFile } from './files/test';\nimport { compositionFile } from './files/composition';\n\nexport const nodeTemplate: ComponentTemplate = {\n name: 'node',\n description: 'a Node.js module',\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), docFile(context), mainFile(context), compositionFile(context), testFile(context)];\n },\n config: {\n 'teambit.harmony/node': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"]}
@@ -11,7 +11,7 @@ labels: ['extension', 'node', 'env', 'environment']
11
11
  description: 'A customized extension for Node environment.'
12
12
  ---
13
13
 
14
- This is a customized extension for Node, based of the [Node Aspect](https://bit.dev/teambit/harmony/node).
14
+ This is a customized extension for Node, based of the [Node Aspect](https://bit.cloud/teambit/harmony/node).
15
15
 
16
16
  Explain here the modified configurations and tools applied.
17
17
  `;
@@ -1 +1 @@
1
- {"version":3,"sources":["doc.ts"],"names":["docFile"],"mappings":";;;;;;;AAAO,SAASA,OAAT,GAAmB;AACxB,SAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CARE;AASD","sourcesContent":["export function docFile() {\n return `---\nlabels: ['extension', 'node', 'env', 'environment']\ndescription: 'A customized extension for Node environment.'\n---\n\nThis is a customized extension for Node, based of the [Node Aspect](https://bit.dev/teambit/harmony/node).\n\nExplain here the modified configurations and tools applied.\n`;\n}\n"]}
1
+ {"version":3,"sources":["doc.ts"],"names":["docFile"],"mappings":";;;;;;;AAAO,SAASA,OAAT,GAAmB;AACxB,SAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CARE;AASD","sourcesContent":["export function docFile() {\n return `---\nlabels: ['extension', 'node', 'env', 'environment']\ndescription: 'A customized extension for Node environment.'\n---\n\nThis is a customized extension for Node, based of the [Node Aspect](https://bit.cloud/teambit/harmony/node).\n\nExplain here the modified configurations and tools applied.\n`;\n}\n"]}
@@ -2,6 +2,6 @@ import React from 'react';
2
2
 
3
3
  export const Logo = () => (
4
4
  <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>
5
- <img style={{ width: 70 }} src="https://static.bit.dev/brands/logo-nodejs.svg" />
5
+ <img style={{ width: 70 }} src="https://static.bit.dev/extensions-icons/node.svg" />
6
6
  </div>
7
7
  );
package/node.docs.mdx CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: A Bit development environment for Node Components
2
+ description: A development environment for Node Components
3
3
  labels: ['node', 'environment', 'env', 'aspect', 'extension']
4
4
  ---
5
5
 
@@ -12,23 +12,24 @@ export class NodeEnvUI {
12
12
 
13
13
  static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {
14
14
  const nodeEnvUI = new NodeEnvUI();
15
-
15
+ // TODO: pass the docs url into here after fetch it from the community aspect
16
16
  testerUi.registerEmptyState(() => {
17
17
  return (
18
18
  <EmptyBox
19
19
  title="This component doesn’t have any tests."
20
20
  linkText="Learn how to add tests to your node components"
21
- link="https://harmony-docs.bit.dev/testing/overview/"
21
+ link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}
22
22
  />
23
23
  );
24
24
  });
25
25
 
26
+ // TODO: pass the docs url into here after fetch it from the community aspect
26
27
  compositionsUI.registerEmptyState(() => {
27
28
  return (
28
29
  <EmptyBox
29
30
  title="This component doesn’t have any compositions."
30
31
  linkText="Learn how to add compositions to your node components"
31
- link="https://harmony-docs.bit.dev/compositions/overview/"
32
+ link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}
32
33
  />
33
34
  );
34
35
  });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/node",
3
- "version": "0.0.676",
3
+ "version": "0.0.679",
4
4
  "homepage": "https://bit.dev/teambit/harmony/node",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "node",
9
- "version": "0.0.676"
9
+ "version": "0.0.679"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
@@ -14,21 +14,21 @@
14
14
  "typescript": "4.4.2",
15
15
  "@babel/runtime": "7.12.18",
16
16
  "core-js": "^3.0.0",
17
- "@teambit/application": "0.0.318",
18
- "@teambit/logger": "0.0.545",
19
- "@teambit/react": "0.0.676",
20
- "@teambit/dependency-resolver": "0.0.676",
21
- "@teambit/envs": "0.0.676",
22
- "@teambit/builder": "0.0.676",
23
- "@teambit/cli": "0.0.453",
24
- "@teambit/compiler": "0.0.676",
25
- "@teambit/generator": "0.0.676",
26
- "@teambit/pkg": "0.0.676",
27
- "@teambit/typescript": "0.0.676",
28
- "@teambit/compositions": "0.0.676",
17
+ "@teambit/application": "0.0.321",
18
+ "@teambit/logger": "0.0.546",
19
+ "@teambit/react": "0.0.679",
20
+ "@teambit/dependency-resolver": "0.0.679",
21
+ "@teambit/envs": "0.0.679",
22
+ "@teambit/builder": "0.0.679",
23
+ "@teambit/cli": "0.0.454",
24
+ "@teambit/compiler": "0.0.679",
25
+ "@teambit/generator": "0.0.679",
26
+ "@teambit/pkg": "0.0.679",
27
+ "@teambit/typescript": "0.0.679",
28
+ "@teambit/compositions": "0.0.679",
29
29
  "@teambit/design.ui.empty-box": "0.0.353",
30
- "@teambit/tester": "0.0.676",
31
- "@teambit/ui": "0.0.676"
30
+ "@teambit/tester": "0.0.679",
31
+ "@teambit/ui": "0.0.679"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/react": "^17.0.8",
@@ -41,7 +41,7 @@
41
41
  "@teambit/harmony.aspect-docs.node": "0.0.134"
42
42
  },
43
43
  "peerDependencies": {
44
- "@teambit/legacy": "1.0.232",
44
+ "@teambit/legacy": "1.0.233",
45
45
  "react-dom": "^16.8.0 || ^17.0.0",
46
46
  "react": "^16.8.0 || ^17.0.0"
47
47
  },
@@ -69,7 +69,7 @@
69
69
  "react": "-"
70
70
  },
71
71
  "peerDependencies": {
72
- "@teambit/legacy": "1.0.232",
72
+ "@teambit/legacy": "1.0.233",
73
73
  "react-dom": "^16.8.0 || ^17.0.0",
74
74
  "react": "^16.8.0 || ^17.0.0"
75
75
  }
@@ -1,2 +1,2 @@
1
- export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.676/dist/node.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.676/dist/node.docs.mdx')]
1
+ export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.679/dist/node.composition.js')]
2
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.679/dist/node.docs.mdx')]
@@ -11,4 +11,10 @@ export const nodeTemplate: ComponentTemplate = {
11
11
  generateFiles: (context: ComponentContext) => {
12
12
  return [indexFile(context), docFile(context), mainFile(context), compositionFile(context), testFile(context)];
13
13
  },
14
+ config: {
15
+ 'teambit.harmony/node': {},
16
+ 'teambit.envs/envs': {
17
+ env: 'teambit.harmony/node',
18
+ },
19
+ },
14
20
  };
@@ -4,7 +4,7 @@ labels: ['extension', 'node', 'env', 'environment']
4
4
  description: 'A customized extension for Node environment.'
5
5
  ---
6
6
 
7
- This is a customized extension for Node, based of the [Node Aspect](https://bit.dev/teambit/harmony/node).
7
+ This is a customized extension for Node, based of the [Node Aspect](https://bit.cloud/teambit/harmony/node).
8
8
 
9
9
  Explain here the modified configurations and tools applied.
10
10
  `;
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_teambit_legacy=self.webpackChunk_teambit_legacy||[]).push([[181],{92614:(e,t,n)=>{var o=n(47418),r=n(57129),i=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,a=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,u=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function s(e){return(e||"").toString().replace(u,"")}var l=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],c={hash:1,query:1};function d(e){var t,o=("undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{}).location||{},r={},a=typeof(e=e||o);if("blob:"===e.protocol)r=new p(unescape(e.pathname),{});else if("string"===a)for(t in r=new p(e,{}),c)delete r[t];else if("object"===a){for(t in e)t in c||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=i.test(e.href))}return r}function f(e){e=s(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function p(e,t,n){if(e=s(e),!(this instanceof p))return new p(e,t,n);var i,a,u,c,b,m,_=l.slice(),h=typeof t,v=this,g=0;for("object"!==h&&"string"!==h&&(n=t,t=null),n&&"function"!==typeof n&&(n=r.parse),t=d(t),i=!(a=f(e||"")).protocol&&!a.slashes,v.slashes=a.slashes||i&&t.slashes,v.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(_[3]=[/(.*)/,"pathname"]);g<_.length;g++)"function"!==typeof(c=_[g])?(u=c[0],m=c[1],u!==u?v[m]=e:"string"===typeof u?~(b=e.indexOf(u))&&("number"===typeof c[2]?(v[m]=e.slice(0,b),e=e.slice(b+c[2])):(v[m]=e.slice(b),e=e.slice(0,b))):(b=u.exec(e))&&(v[m]=b[1],e=e.slice(0,b.index)),v[m]=v[m]||i&&c[3]&&t[m]||"",c[4]&&(v[m]=v[m].toLowerCase())):e=c(e);n&&(v.query=n(v.query)),i&&t.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==t.pathname)&&(v.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,a=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),a++):a&&(0===o&&(i=!0),n.splice(o,1),a--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(v.pathname,t.pathname)),"/"!==v.pathname.charAt(0)&&v.hostname&&(v.pathname="/"+v.pathname),o(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(c=v.auth.split(":"),v.username=c[0]||"",v.password=c[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}p.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"===typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var u=0;u<l.length;u++){var s=l[u];s[4]&&(i[s[1]]=i[s[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"===typeof e||(e=r.stringify);var t,n=this,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"===typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},p.extractProtocol=f,p.location=d,p.trimLeft=s,p.qs=r,e.exports=p},5519:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderRibbon=void 0;var o=n(72425);Object.defineProperty(t,"LoaderRibbon",{enumerable:!0,get:function(){return o.LoaderRibbon}})},72425:function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderRibbon=void 0;const i=r(n(94184)),a=r(n(4516)),u=r(n(80719));function s(e){var{active:t,className:n}=e,r=o(e,["active","className"]);return a.default.createElement("div",Object.assign({},r,{className:i.default(n,u.default.loader,t&&u.default.loading)}),a.default.createElement("div",{className:u.default.progress}))}s.__bit_component={id:"teambit.base-ui/loaders/loader-ribbon@1.0.0",homepage:"https://bit.dev/teambit/base-ui/loaders/loader-ribbon",exported:!0},t.LoaderRibbon=s},76421:function(e,t,n){var o={id:"teambit.base-ui/routing/compare-url@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/compare-url",exported:!0},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;const i=r(n(92614));function a(e,t,{exact:n,strict:o}={}){if(e===t)return!0;o||(e=e.replace(/\/(?=[?#]|$)/,""),t=t.replace(/\/(?=[?#]|$)/,""));const r=i.default(e),a=i.default(t),c=u(r,a),d=!n||s(r,a),f=!o||l(r,a);return c&&d&&f}function u(e,t){return(!t.protocol||t.protocol===e.protocol)&&(!t.hostname||t.hostname===e.hostname)&&(!t.port||t.port===e.port)&&(!t.pathname||e.pathname.startsWith(t.pathname))&&(!t.query||c(t.query,e.query))&&(!t.hash||t.hash===e.hash)&&(!t.password||t.password===e.password)&&(!t.username||t.username===e.username)}function s(e,t){return(!t.pathname||e.pathname===t.pathname)&&(!t.query||c(e.query,t.query))}function l(e,t){return!t.pathname||e.pathname.endsWith("/")===t.pathname.endsWith("/")}function c(e,t){return Object.keys(e).every((n=>e[n]===t[n]))}a.__bit_component=o,t.compareUrl=a,u.__bit_component=o,s.__bit_component=o,l.__bit_component=o,c.__bit_component=o},86988:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;var o=n(76421);Object.defineProperty(t,"compareUrl",{enumerable:!0,get:function(){return o.compareUrl}})},30724:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;var o=n(38951);Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return o.Link}})},38951:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;const r=o(n(4516)),i=n(14583);function a(e){const t=i.useRouting().Link;return r.default.createElement(t,Object.assign({},e))}a.__bit_component={id:"teambit.base-ui/routing/link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/link",exported:!0},t.Link=a},23330:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;var o=n(52553);Object.defineProperty(t,"NativeNavLink",{enumerable:!0,get:function(){return o.NativeNavLink}})},52553:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;const s=i(n(4516)),l=u(n(94184)),c=n(86924),d=n(86988),f=n(42187);function p(e){var{activeClassName:t,activeStyle:n,isActive:o,exact:r,strict:i,style:u,className:p}=e,b=a(e,["activeClassName","activeStyle","isActive","exact","strict","style","className"]);const m=f.isBrowser?window.location.href:"/",_=s.useMemo((()=>b.href&&d.compareUrl(m,b.href)),[r,i,m,b.href]),h=(null===o||void 0===o?void 0:o())||_,v=s.useMemo((()=>h&&n?Object.assign(Object.assign({},u),n):u),[h,u]);return s.default.createElement(c.NativeLink,Object.assign({},b,{style:v,className:l.default(p,h&&t)}))}p.__bit_component={id:"teambit.base-ui/routing/native-nav-link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/native-nav-link",exported:!0},t.NativeNavLink=p},14583:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;var o=n(27472);Object.defineProperty(t,"RoutingProvider",{enumerable:!0,get:function(){return o.RoutingProvider}}),Object.defineProperty(t,"useRouting",{enumerable:!0,get:function(){return o.useRouting}}),Object.defineProperty(t,"useLocation",{enumerable:!0,get:function(){return o.useLocation}})},27472:function(e,t,n){var o={id:"teambit.base-ui/routing/routing-provider@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/routing-provider",exported:!0},r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;const u=a(n(4516)),s=n(86924),l=n(23330),c=n(42187),d={pathname:"/",search:"",hash:""},f={Link:s.NativeLink,NavLink:l.NativeNavLink,useLocation:()=>c.isBrowser?window.location:d},p=u.createContext(f);function b({value:e,children:t}){return u.default.createElement(p.Provider,{value:e},t)}function m(){return u.useContext(p)}function _(){return m().useLocation()}b.__bit_component=o,t.RoutingProvider=b,m.__bit_component=o,t.useRouting=m,_.__bit_component=o,t.useLocation=_},88499:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.brands=void 0;const r=o(n(55668)),{brands:i}=r.default;t.brands=i},47364:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.primaryPalette=void 0;const r=o(n(16805)),{primaryPalette:i}=r.default;t.primaryPalette=i},32794:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.headingMargins=void 0;const r=o(n(33498)),{headingMargins:i}=r.default;t.headingMargins=i},1197:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.shadowTheme=void 0;const r=o(n(44033)),{shadowTheme:i}=r.default;t.shadowTheme=i},53875:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.textFontSize=t.headingFontSize=void 0;const r=o(n(94685)),{headingFontSize:i,textFontSize:a}=r.default;t.headingFontSize=i,t.textFontSize=a},94419:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Theme=void 0;var o=n(12519);Object.defineProperty(t,"Theme",{enumerable:!0,get:function(){return o.Theme}})},12519:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Theme=void 0;const r=o(n(4516)),i=o(n(94184)),a=n(53875),u=n(1197),s=n(47364),l=n(88499),c=n(32794),d=n(95108),f=o(n(33709));function p(e){return r.default.createElement("div",Object.assign({},e,{className:i.default(a.headingFontSize,a.textFontSize,d.bookFont,u.shadowTheme,s.primaryPalette,l.brands,c.headingMargins,f.default.defaults,e.className)}))}p.__bit_component={id:"teambit.base-ui/theme/theme-provider@1.0.1",homepage:"https://bit.dev/teambit/base-ui/theme/theme-provider",exported:!0},t.Theme=p},95108:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bookFont=void 0;const r=o(n(66381)),{bookFont:i}=r.default;t.bookFont=i},77122:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Composer=void 0;const r=o(n(4516));function i(e){const{components:t=[],children:n}=e,o=t.map((e=>Array.isArray(e)?e:[e,void 0]));return r.default.createElement(r.default.Fragment,null,o.reduceRight(((e,[t,n])=>r.default.createElement(t,Object.assign({},n),e)),n))}i.__bit_component={id:"teambit.base-ui/utils/composer@1.0.0",homepage:"https://bit.dev/teambit/base-ui/utils/composer",exported:!0},t.Composer=i},63564:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Composer=void 0;var o=n(77122);Object.defineProperty(t,"Composer",{enumerable:!0,get:function(){return o.Composer}})},42187:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0;var o=n(73789);Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o.isBrowser}})},73789:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser="undefined"!==typeof window},7150:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContactIcons=void 0;const r=o(n(4516)),i=n(30724),a={link:{textDecoration:"none",lineHeight:"inherit",color:"unset"},logo:{width:"24px",height:"24px",margin:"0 13px"}};function u(e){return r.default.createElement("div",Object.assign({style:Object.assign(Object.assign({},a.iconLine),e.style)},e),r.default.createElement(i.Link,{external:!0,style:a.link,href:"https://join.slack.com/t/bit-dev-community/shared_invite/zt-o2tim18y-UzwOCFdTafmFKEqm2tXE4w"},r.default.createElement("img",{alt:"slack",style:a.logo,src:"https://static.bit.dev/harmony/slack-round-icon.svg"})),r.default.createElement(i.Link,{external:!0,style:a.link,href:"https://github.com/teambit/bit"},r.default.createElement("img",{alt:"github",style:a.logo,src:"https://static.bit.dev/harmony/github.svg"})),r.default.createElement(i.Link,{external:!0,style:a.link,href:"https://harmony-docs.bit.dev/"},r.default.createElement("img",{alt:"bit docs",style:a.logo,src:"https://static.bit.dev/bit-logo.svg"})))}u.__bit_component={id:"teambit.design/ui/error-page@0.0.352",homepage:"https://bit.dev/teambit/design/ui/error-page",exported:!0},t.ContactIcons=u},41657:function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorPage=void 0;const i=r(n(4516)),a={errorPage:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",margin:"auto",padding:"24px",textAlign:"center"},title:{fontWeight:"bold",margin:"0 0 24px 0"},img:{maxWidth:"700px",marginBottom:"24px",width:"100%"}};function u(e){var{code:t,title:n,style:r,children:u}=e,s=o(e,["code","title","style","children"]);return i.default.createElement("div",Object.assign({},s,{style:Object.assign(Object.assign({},a.errorPage),r)}),i.default.createElement("style",null,"\n.bit-error-page-title { font-size: 36px; }\n@media screen and (max-width: 480px) { .bit-error-page-title { font-size: 24px; } }\n"),i.default.createElement("h1",{style:a.title,className:"bit-error-page-title"},n),i.default.createElement("img",{alt:"error-image",style:a.img,src:`https://static.bit.dev/harmony/${t}.svg`}),u)}u.__bit_component={id:"teambit.design/ui/error-page@0.0.352",homepage:"https://bit.dev/teambit/design/ui/error-page",exported:!0},t.ErrorPage=u},72967:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ContactIconsProps=t.ContactIcons=void 0,r(n(41657),t);var i=n(7150);Object.defineProperty(t,"ContactIcons",{enumerable:!0,get:function(){return i.ContactIcons}}),Object.defineProperty(t,"ContactIconsProps",{enumerable:!0,get:function(){return i.ContactIconsProps}})},37504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundPageProps=t.NotFoundPage=void 0;var o=n(19505);Object.defineProperty(t,"NotFoundPage",{enumerable:!0,get:function(){return o.NotFoundPage}}),Object.defineProperty(t,"NotFoundPageProps",{enumerable:!0,get:function(){return o.NotFoundPageProps}})},19505:function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundPage=void 0;const i=r(n(4516)),a=n(72967);function u(e){var t=o(e,[]);return i.default.createElement(a.ErrorPage,Object.assign({},t,{code:404,title:"Page not found"}),i.default.createElement(a.ContactIcons,null))}u.__bit_component={id:"teambit.design/ui/pages/not-found@0.0.353",homepage:"https://bit.dev/teambit/design/ui/pages/not-found",exported:!0},t.NotFoundPage=u},24461:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(39170),t)},39170:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StandaloneNotFoundPage=void 0;const r=o(n(4516)),i=n(94419),a=n(37504);function u(){return r.default.createElement(i.Theme,null,r.default.createElement(a.NotFoundPage,null))}u.__bit_component={id:"teambit.design/ui/pages/standalone-not-found-page@0.0.355",homepage:"https://bit.dev/teambit/design/ui/pages/standalone-not-found-page",exported:!0},t.StandaloneNotFoundPage=u},40401:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useFallback=t.LoaderFallback=void 0;var o=n(19916);Object.defineProperty(t,"LoaderFallback",{enumerable:!0,get:function(){return o.LoaderFallback}}),Object.defineProperty(t,"useFallback",{enumerable:!0,get:function(){return o.useFallback}})},19916:function(e,t,n){var o={id:"teambit.react/ui/loader-fallback@0.0.89",homepage:"https://bit.dev/teambit/react/ui/loader-fallback",exported:!0},r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useFallback=t.LoaderFallback=void 0;const u=a(n(4516)),s=n(5519);function l({Target:e,Loader:t=d,DefaultComponent:n,timeout:o=15e3}){return c(e&&u.default.createElement(e,null),u.default.createElement(n,null),{timeout:o,loader:u.default.createElement(t,null)})}function c(e,t,{timeout:n=15e3,loader:o=u.default.createElement(d,null)}={}){const[r,i]=(0,u.useState)(!!e),a=!!e;return(0,u.useEffect)((()=>{if(n<=0)return()=>{};if(a)return i(!0),()=>{};const e=setTimeout((()=>i(!1)),n);return()=>clearTimeout(e)}),[a,n]),e||(r&&n>0?o:t)}function d(){return u.default.createElement(s.LoaderRibbon,{active:!0,style:{position:"fixed",top:0,left:0,right:0}})}l.__bit_component=o,t.LoaderFallback=l,c.__bit_component=o,t.useFallback=c,d.__bit_component=o},98087:(e,t,n)=>{var o={id:"teambit.react/react@0.0.675",homepage:"https://bit.dev/teambit/react/react",exported:!0},r=n(95318);function i(){const e=r(n(4516));return i=function(){return e},e}function a(){const e=n(63564);return a=function(){return e},e}function u(){const e=n(24461);return u=function(){return e},e}function s(){const e=n(75334);return s=function(){return e},e}function l(){const e=n(40401);return l=function(){return e},e}function c(){const e=n(35800);return c=function(){return e},e}function d(){const e=n(60504);return d=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionsApp=f,i.__bit_component=o,a.__bit_component=o,u.__bit_component=o,s.__bit_component=o,l.__bit_component=o,c.__bit_component=o,d.__bit_component=o;function f({Composition:e,previewContext:t}){const{providers:n=[]}=t.get(d().ReactAspect.id)||{},o=(0,l().useFallback)(e&&i().default.createElement(e,null),i().default.createElement(u().StandaloneNotFoundPage,null));return i().default.createElement(c().ErrorBoundary,{FallbackComponent:s().ErrorFallback,resetKeys:[e]},i().default.createElement(a().Composer,{components:n},i().default.createElement("style",null,"body::-webkit-scrollbar {display: none;}"),o))}f.__bit_component=o},22181:(e,t,n)=>{var o={id:"teambit.react/react@0.0.675",homepage:"https://bit.dev/teambit/react/react",exported:!0},r=n(95318);function i(){const e=r(n(4516));return i=function(){return e},e}function a(){const e=r(n(79283));return a=function(){return e},e}function u(){const e=n(98087);return u=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i.__bit_component=o,a.__bit_component=o,u.__bit_component=o;var s=(e,t)=>{a().default.render(i().default.createElement(u().CompositionsApp,{Composition:e,previewContext:t}),document.getElementById("root"))};s.__bit_component=o,t.default=s},80719:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={loader:"loader-ribbon_loader__2GCaR",loading:"loader-ribbon_loading__3uSHa",progress:"loader-ribbon_progress__12zF8",completed:"loader-ribbon_completed__33Bjc"}},55668:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={brands:"brand-definition_brands__3U8QG"}},16805:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={primaryPalette:"color-definition_primaryPalette__3oy3v"}},33498:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={headingMargins:"heading-margin-definition_headingMargins__1tFjF"}},44033:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={shadowTheme:"shadow-definition_shadowTheme__3jVqm"}},94685:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={headingFontSize:"size-definition_headingFontSize__1PHYm",textFontSize:"size-definition_textFontSize__3ICoU"}},33709:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={defaults:"texts_defaults__t8Yd6"}},66381:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={bookFont:"book-font_bookFont__3DQbg"}},57129:(e,t)=>{var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function r(e){try{return encodeURIComponent(e)}catch(t){return null}}t.stringify=function(e,t){t=t||"";var o,i,a=[];for(i in"string"!==typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!==o&&undefined!==o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;a.push(i+"="+o)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),a=o(t[2]);null===i||null===a||i in r||(r[i]=a)}return r}},47418:e=>{e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}}}]);