@teambit/react 0.0.779 → 0.0.782

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 (35) hide show
  1. package/apps/web/react.application.ts +1 -1
  2. package/artifacts/__bit_junit.xml +2 -2
  3. package/artifacts/env-template/public/22.02c5cc40d024e64c9979.js +43 -0
  4. package/artifacts/env-template/public/{244.739752d913aa9b9973e9.js → 244.40a7c02382995372607b.js} +6 -6
  5. package/artifacts/env-template/public/{830.87975426a2d9aba35cc5.js → 857.bdfded1490d9efe637f8.js} +28 -28
  6. package/artifacts/env-template/public/assets-manifest.json +16 -16
  7. package/artifacts/env-template/public/compositions.132ad56af83a59d06627.js +5 -0
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/{overview.e9f25567c914ef048779.js → overview.077ea2408336de8f238c.js} +1 -1
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/peers.6a6694db7f2fdcdd11a0.js +1 -0
  12. package/artifacts/env-template/public/{preview-root.267f5147d686b94c6d62.js → preview-root.c56b4d752d9774bccd8b.js} +1 -1
  13. package/artifacts/env-template/public/static/css/{830.c01819bb.css → 857.c0eadd42.css} +1 -1
  14. package/artifacts/preview/teambit_react_react-preview.js +2 -2
  15. package/{compositions-1656991770328.js → compositions-1657164425299.js} +1 -1
  16. package/dist/apps/web/react.application.js.map +1 -1
  17. package/dist/react.env.d.ts +2 -2
  18. package/dist/react.env.js +2 -2
  19. package/dist/react.env.js.map +1 -1
  20. package/{overview-1656991770328.js → overview-1657164425299.js} +0 -0
  21. package/package-tar/teambit-react-0.0.782.tgz +0 -0
  22. package/package.json +32 -37
  23. package/{preview-1656991770328.js → preview-1657164425299.js} +2 -2
  24. package/artifacts/env-template/public/22.7072732251b2fe075054.js +0 -43
  25. package/artifacts/env-template/public/compositions.f2bf30aaac737a83f3b2.js +0 -5
  26. package/artifacts/env-template/public/peers.7d1c60e8589952b82b8c.js +0 -1
  27. package/compositions-app.tsx +0 -32
  28. package/dist/compositions-app.d.ts +0 -6
  29. package/dist/compositions-app.js +0 -99
  30. package/dist/compositions-app.js.map +0 -1
  31. package/dist/mount.d.ts +0 -9
  32. package/dist/mount.js +0 -54
  33. package/dist/mount.js.map +0 -1
  34. package/mount.tsx +0 -17
  35. package/package-tar/teambit-react-0.0.779.tgz +0 -0
@@ -1,4 +1,4 @@
1
- (function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.react/react-preview"]=factory():root["teambit.react/react-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},55906:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __webpack_unused_export__,__bit_component={id:"teambit.react/content/react-overview@1.95.0",homepage:"https://bit.dev/teambit/react/content/react-overview",exported:!0};__webpack_unused_export__={value:!0},__webpack_unused_export__={enumerable:!0,get:function(){return _reactOverview.default}},Object.defineProperty(exports2,"ZP",{enumerable:!0,get:function(){return _reactOverview.default}});var _reactOverview=_interopRequireDefault(__webpack_require__2(2664));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component},2664:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/content/react-overview@1.95.0",homepage:"https://bit.dev/teambit/react/content/react-overview",exported:!0};Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.default=MDXContent;var _react=_interopRequireDefault(__webpack_require__2(63804)),_react2=__webpack_require__2(85057),_mdxUi=__webpack_require__2(58459),_excluded=["components"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component;function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}_extends.__bit_component=__bit_component;function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}_objectWithoutProperties.__bit_component=__bit_component;function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}_objectWithoutPropertiesLoose.__bit_component=__bit_component;var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_react2.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_react2.mdx)(_mdxUi.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,_react2.mdx)("h1",null,"React Overview"),(0,_react2.mdx)("p",null,`React is teambit's Component Development Environment (Env) for React.
1
+ (function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.react/react-preview"]=factory():root["teambit.react/react-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},55906:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __webpack_unused_export__,__bit_component={id:"teambit.react/content/react-overview@1.95.0",homepage:"https://bit.dev/teambit/react/content/react-overview",exported:!0};__webpack_unused_export__={value:!0},__webpack_unused_export__={enumerable:!0,get:function(){return _reactOverview.default}},Object.defineProperty(exports2,"ZP",{enumerable:!0,get:function(){return _reactOverview.default}});var _reactOverview=_interopRequireDefault(__webpack_require__2(85009));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component},85009:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/content/react-overview@1.95.0",homepage:"https://bit.dev/teambit/react/content/react-overview",exported:!0};Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.default=MDXContent;var _react=_interopRequireDefault(__webpack_require__2(63804)),_react2=__webpack_require__2(85057),_mdxUi=__webpack_require__2(58459),_excluded=["components"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_interopRequireDefault.__bit_component=__bit_component;function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}_extends.__bit_component=__bit_component;function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}_objectWithoutProperties.__bit_component=__bit_component;function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}_objectWithoutPropertiesLoose.__bit_component=__bit_component;var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_react2.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_react2.mdx)(_mdxUi.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,_react2.mdx)("h1",null,"React Overview"),(0,_react2.mdx)("p",null,`React is teambit's Component Development Environment (Env) for React.
2
2
  It enables you to quickly set up a dev environment that follows best practices for React component development.`),(0,_react2.mdx)("p",null,"React can also be used as a good starting point for your own customized Env as it provides a comprehensive API that makes it easy to extend."),(0,_react2.mdx)("h2",null,"Using the React env"),(0,_react2.mdx)("p",null,"To use React Env, apply it on the relevant ",(0,_react2.mdx)("a",{parentName:"p",href:"/docs/workspace/variants"},"variants")," (component selections) in your ",(0,_react2.mdx)("a",{parentName:"p",href:"/docs/workspace/workspace-configuration"},"Workspace config"),":"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-json",metastring:'title="workspace.jsonc"',title:'"workspace.jsonc"'},`{
3
3
  "teambit.workspace/variants": {
4
4
  "{ui/**}": {
@@ -8,4 +8,4 @@ It enables you to quickly set up a dev environment that follows best practices f
8
8
  }
9
9
  `)),(0,_react2.mdx)("h2",null,"Creating Components"),(0,_react2.mdx)("p",null,"React env provides a set of component templates that can be used to speed-up and standardize your component development:"),(0,_react2.mdx)("p",null,"To list all available templates:"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-bash"},`bit templates
10
10
  `)),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react")," a basic React UI component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-context")," a react context component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-hook")," a react hook component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"mdx-component")," an MDX component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-component-js")," a basic React component in JS."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-env")," boilerplate for a customized environment configuration.")),(0,_react2.mdx)("p",null,"Use any of these templates with the ",(0,_react2.mdx)("inlineCode",{parentName:"p"},"bit create")," command:"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-bash"},`bit create react ui/my-welcome
11
- `)),(0,_react2.mdx)("h2",null,"Development services and configurations"),(0,_react2.mdx)("p",null,"The table below lists ",(0,_react2.mdx)("a",{parentName:"p",href:"/dev-services/dev-services-overview"},"dev services")," that are provided by the React env. Each service handles a specific component development operation. Each is implemented by the React env, using a specific set of configurations."),(0,_react2.mdx)("p",null,"To customize and extend the React env, ",(0,_react2.mdx)("a",{parentName:"p",href:"/envs/pre-configured-envs/react/extending-react#using-your-own-react-env-extension"},"create you own React env extension"),". You can replace the Aspects used by the env, or override their configurations (use the links provided in the 'customization' column)."),(0,_react2.mdx)("table",null,(0,_react2.mdx)("thead",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"thead"},(0,_react2.mdx)("th",{parentName:"tr",align:null},"Service"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Default config"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Customization"))),(0,_react2.mdx)("tbody",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/compiler-overview"},"Compiler")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#typescript"},"TS compilation config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/configure-env-with-compiler"},"Replace compiler"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/tester/overview"},"Tester")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/jest"},"Jest")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#jest"},"Jest config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/tester/configure-env-with-tester"},"Replace Tester"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/linter/overview"},"Linting")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/eslint"},"ESLint")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#eslint"},"ESLint Config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/linter/configure-env-with-linter"},"Replace Linter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/formatter/overview"},"Formatter")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/prettier"},"Prettier")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/prettier/prettier.config.js"},"prettier.config.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#prettier"},"Prettier config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/formatter/configure-env-with-formatter"},"Replace Formatter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling in the workspace)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/preview/overview"},"Preview")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null}),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/preview/register-custom-preview"},"Add preview"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/packages/packages-overview"},"Package")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"See the ",(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect")," config"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/packages/managing-package-json#set-configuration-from-an-env"},"Add Env package config")," ",(0,_react2.mdx)("br",null)," \u2022 TypeScript's package config")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"Bundler"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling during build)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-overview"},"Documentation")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-templates"},"Replace docs template"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Builder")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Build pipeline")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/builder/build-pipelines"},"Build pipelines"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/dependencies-overview"},"Dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/react.env.ts"},"Env-dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/configuring-dependencies#configuring-dependencies-from-an-env"},"Env dependencies"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/generator/generator-overview"},"Generator")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/templates/react-component.ts"},"React templates")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:""},"Add a component template"))))),(0,_react2.mdx)("h3",null,"Default React versions"),(0,_react2.mdx)("p",null,"By default, the React env sets the following dependency versions for components using it:"),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react-dom")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.8")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react-dom"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.5")))))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},47954:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/react@0.0.779",homepage:"https://bit.dev/teambit/react/react",exported:!0},_interopRequireDefault=__webpack_require__2(88244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(63804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/react.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},85057:module2=>{"use strict";module2.exports=MdxJsReact},63804:module2=>{"use strict";module2.exports=React},58459:module2=>{"use strict";module2.exports=TeambitMdxUiMdxScopeContext}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,overview:()=>overview});var react_docs_namespaceObject={};__webpack_require__.r(react_docs_namespaceObject),__webpack_require__.d(react_docs_namespaceObject,{default:()=>MDXContent});var react_composition=__webpack_require__(47954),external_React_=__webpack_require__(63804),external_MdxJsReact_=__webpack_require__(85057),external_TeambitMdxUiMdxScopeContext_=__webpack_require__(58459),dist=__webpack_require__(55906),_excluded=["components"];function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_.MDXScopeProvider,{components:{ReactOverview:dist.ZP},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.ZP,{mdxType:"ReactOverview"})))}MDXContent.isMDXComponent=!0;const compositions=[react_composition],overview=[react_docs_namespaceObject]})(),__webpack_exports__})()});
11
+ `)),(0,_react2.mdx)("h2",null,"Development services and configurations"),(0,_react2.mdx)("p",null,"The table below lists ",(0,_react2.mdx)("a",{parentName:"p",href:"/dev-services/dev-services-overview"},"dev services")," that are provided by the React env. Each service handles a specific component development operation. Each is implemented by the React env, using a specific set of configurations."),(0,_react2.mdx)("p",null,"To customize and extend the React env, ",(0,_react2.mdx)("a",{parentName:"p",href:"/envs/pre-configured-envs/react/extending-react#using-your-own-react-env-extension"},"create you own React env extension"),". You can replace the Aspects used by the env, or override their configurations (use the links provided in the 'customization' column)."),(0,_react2.mdx)("table",null,(0,_react2.mdx)("thead",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"thead"},(0,_react2.mdx)("th",{parentName:"tr",align:null},"Service"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Default config"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Customization"))),(0,_react2.mdx)("tbody",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/compiler-overview"},"Compiler")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#typescript"},"TS compilation config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/configure-env-with-compiler"},"Replace compiler"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/tester/overview"},"Tester")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/jest"},"Jest")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#jest"},"Jest config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/tester/configure-env-with-tester"},"Replace Tester"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/linter/overview"},"Linting")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/eslint"},"ESLint")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#eslint"},"ESLint Config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/linter/configure-env-with-linter"},"Replace Linter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/formatter/overview"},"Formatter")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/prettier"},"Prettier")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/prettier/prettier.config.js"},"prettier.config.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#prettier"},"Prettier config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/formatter/configure-env-with-formatter"},"Replace Formatter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling in the workspace)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/preview/overview"},"Preview")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null}),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/preview/register-custom-preview"},"Add preview"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/packages/packages-overview"},"Package")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"See the ",(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect")," config"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/packages/managing-package-json#set-configuration-from-an-env"},"Add Env package config")," ",(0,_react2.mdx)("br",null)," \u2022 TypeScript's package config")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"Bundler"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling during build)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-overview"},"Documentation")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-templates"},"Replace docs template"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Builder")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Build pipeline")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/builder/build-pipelines"},"Build pipelines"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/dependencies-overview"},"Dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/react.env.ts"},"Env-dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/configuring-dependencies#configuring-dependencies-from-an-env"},"Env dependencies"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/generator/generator-overview"},"Generator")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/templates/react-component.ts"},"React templates")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:""},"Add a component template"))))),(0,_react2.mdx)("h3",null,"Default React versions"),(0,_react2.mdx)("p",null,"By default, the React env sets the following dependency versions for components using it:"),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react-dom")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.8")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react-dom"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.5")))))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},64450:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/react@0.0.782",homepage:"https://bit.dev/teambit/react/react",exported:!0},_interopRequireDefault=__webpack_require__2(88244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(63804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/react.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},85057:module2=>{"use strict";module2.exports=MdxJsReact},63804:module2=>{"use strict";module2.exports=React},58459:module2=>{"use strict";module2.exports=TeambitMdxUiMdxScopeContext}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,overview:()=>overview});var react_docs_namespaceObject={};__webpack_require__.r(react_docs_namespaceObject),__webpack_require__.d(react_docs_namespaceObject,{default:()=>MDXContent});var react_composition=__webpack_require__(64450),external_React_=__webpack_require__(63804),external_MdxJsReact_=__webpack_require__(85057),external_TeambitMdxUiMdxScopeContext_=__webpack_require__(58459),dist=__webpack_require__(55906),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_.MDXScopeProvider,{components:{ReactOverview:dist.ZP},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.ZP,{mdxType:"ReactOverview"})))}MDXContent.isMDXComponent=!0;const compositions=[react_composition],overview=[react_docs_namespaceObject]})(),__webpack_exports__})()});
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { linkModules } from '/home/circleci/bit/bit/node_modules/@teambit/preview/dist/preview.preview.runtime.js';
3
- import * as mainModule from '/home/circleci/bit/bit/node_modules/@teambit/react/dist/mount.js';
3
+ import * as mainModule from '/home/circleci/bit/bit/node_modules/@teambit/react.ui.compositions-app/dist/index.js';
4
4
 
5
5
 
6
6
 
@@ -1 +1 @@
1
- {"version":3,"names":["ReactApp","constructor","name","entry","portRange","reactEnv","prerender","bundler","devServer","transformers","deploy","favicon","isPrerendering","TerserPlugin","extractComments","terserOptions","parse","ecma","compress","warnings","comparisons","inline","mangle","safari10","output","comments","ascii_only","minify","esbuildMinify","run","context","from","to","port","Port","getPort","listen","devServerContext","getDevServerContext","getDevServer","configMutator","addTopLevel","historyApiFallback","index","disableDotRule","headers","raw","publicPath","build","htmlConfig","title","templateContent","html","Object","assign","getBundler","bundleResult","computeResults","publicDir","getPublicDir","artifactsDir","dir","getDefaultBundler","capsule","env","outputPath","join","path","distDir","getCompiler","entries","map","require","resolve","basename","staticDir","bundlerContext","targets","components","component","hostDependencies","getPeers","aliasHostDependencies","rootPath","metaData","initiator","envId","id","defaultTransformer","config","addPlugin","prerenderPlugin","optimization","minimizer","remove","push","getESBuildConfig","applicationType","getPeerDependenciesList"],"sources":["react.application.ts"],"sourcesContent":["import { join, basename } from 'path';\nimport { Application, AppContext, AppBuildContext } from '@teambit/application';\nimport { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { remove } from 'lodash';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { ReactEnv } from '../../react.env';\nimport { prerenderPlugin } from './plugins';\nimport { ReactAppBuildResult } from './react-build-result';\nimport { ReactAppPrerenderOptions } from './react-app-options';\nimport { html } from '../../webpack';\nimport { ReactDeployContext } from '.';\nimport { computeResults } from './compute-results';\n\nexport class ReactApp implements Application {\n constructor(\n readonly name: string,\n readonly entry: string[],\n readonly portRange: number[],\n private reactEnv: ReactEnv,\n readonly prerender?: ReactAppPrerenderOptions,\n readonly bundler?: Bundler,\n readonly devServer?: DevServer,\n readonly transformers: WebpackConfigTransformer[] = [],\n readonly deploy?: (context: ReactDeployContext) => Promise<void>,\n readonly favicon?: string\n ) {}\n readonly applicationType = 'react-common-js';\n readonly dir = 'public';\n\n async run(context: AppContext): Promise<number> {\n const [from, to] = this.portRange;\n const port = await Port.getPort(from, to);\n if (this.devServer) {\n await this.devServer.listen(port);\n return port;\n }\n const devServerContext = await this.getDevServerContext(context);\n const devServer = this.reactEnv.getDevServer(devServerContext, [\n (configMutator) =>\n configMutator.addTopLevel('devServer', {\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n headers: {\n 'Access-Control-Allow-Headers': '*',\n }\n },\n }),\n (configMutator) => {\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n },\n ...this.transformers,\n ]);\n await devServer.listen(port);\n return port;\n }\n\n async build(context: AppBuildContext): Promise<ReactAppBuildResult> {\n const htmlConfig: BundlerHtmlConfig[] = [\n {\n title: context.name,\n templateContent: html(context.name),\n minify: false,\n favicon: this.favicon,\n // filename: ''.html`,\n },\n ];\n Object.assign(context, {\n html: htmlConfig,\n });\n const bundler = await this.getBundler(context);\n const bundleResult = await bundler.run();\n\n return computeResults(bundleResult, { publicDir: `${this.getPublicDir(context.artifactsDir)}/${this.dir}` });\n }\n\n private getBundler(context: AppBuildContext) {\n if (this.bundler) return this.bundler;\n return this.getDefaultBundler(context);\n }\n private async getDefaultBundler(context: AppBuildContext) {\n const { capsule } = context;\n const reactEnv: ReactEnv = context.env;\n const publicDir = this.getPublicDir(context.artifactsDir);\n const outputPath = join(capsule.path, publicDir);\n const { distDir } = reactEnv.getCompiler();\n const entries = this.entry.map((entry) => require.resolve(`${capsule.path}/${distDir}/${basename(entry)}`));\n const staticDir = join(outputPath, this.dir);\n\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [\n {\n components: [capsule?.component],\n entries,\n outputPath,\n hostDependencies: await this.getPeers(),\n aliasHostDependencies: true,\n },\n ],\n entry: [],\n rootPath: '/',\n metaData: {\n initiator: `building app: ${context.name}`,\n envId: context.id,\n },\n });\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const config = configMutator.addTopLevel('output', { path: staticDir, publicPath: `/` });\n if (this.prerender) config.addPlugin(prerenderPlugin(this.prerender));\n if (config.raw.optimization?.minimizer) {\n remove(config.raw.optimization?.minimizer, (minimizer) => {\n return minimizer.constructor.name === 'TerserPlugin';\n });\n\n config.raw.optimization?.minimizer.push(this.getESBuildConfig());\n }\n\n return config;\n };\n const transformers = [defaultTransformer, ...this.transformers];\n const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);\n return bundler;\n }\n private getESBuildConfig = (isPrerendering = this.prerender) => {\n // We don't want to use esbuild in case of prerendering since the headless browser puppeteer doesn't support\n // the output of esbuild\n\n if (isPrerendering) {\n return new TerserPlugin({\n extractComments: false,\n terserOptions: {\n parse: {\n // We want terser to parse ecma 8 code. However, we don't want it\n // to apply any minification steps that turns valid ecma 5 code\n // into invalid ecma 5 code. This is why the 'compress' and 'output'\n // sections only apply transformations that are ecma 5 safe\n // https://github.com/facebook/create-react-app/pull/4234\n ecma: 8,\n },\n compress: {\n ecma: 5,\n warnings: false,\n // Disabled because of an issue with Uglify breaking seemingly valid code:\n // https://github.com/facebook/create-react-app/issues/2376\n // Pending further investigation:\n // https://github.com/mishoo/UglifyJS2/issues/2011\n comparisons: false,\n // Disabled because of an issue with Terser breaking valid code:\n // https://github.com/facebook/create-react-app/issues/5250\n // Pending further investigation:\n // https://github.com/terser-js/terser/issues/120\n inline: 2,\n },\n mangle: {\n safari10: true,\n },\n output: {\n ecma: 5,\n comments: false,\n // Turned on because emoji and regex is not minified properly using default\n // https://github.com/facebook/create-react-app/issues/2488\n ascii_only: true,\n },\n },\n });\n }\n return new TerserPlugin({\n minify: TerserPlugin.esbuildMinify,\n // `terserOptions` options will be passed to `esbuild`\n // Link to options - https://esbuild.github.io/api/#minify\n terserOptions: {\n minify: true,\n },\n });\n };\n\n private getPublicDir(artifactsDir: string) {\n return join(artifactsDir, this.applicationType, this.name);\n }\n\n private async getDevServerContext(context: AppContext): Promise<DevServerContext> {\n return Object.assign(context, {\n entry: this.entry,\n rootPath: '',\n publicPath: `public/${this.name}`,\n title: this.name,\n favicon: this.favicon,\n hostDependencies: await this.getPeers(),\n aliasHostDependencies: true,\n });\n }\n\n private getPeers(): Promise<string[]> {\n return this.reactEnv.getPeerDependenciesList();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,QAAN,CAAsC;EAC3CC,WAAW,CACAC,IADA,EAEAC,KAFA,EAGAC,SAHA,EAIDC,QAJC,EAKAC,SALA,EAMAC,OANA,EAOAC,SAPA,EAQAC,YAAwC,GAAG,EAR3C,EASAC,MATA,EAUAC,OAVA,EAWT;IAAA,KAVST,IAUT,GAVSA,IAUT;IAAA,KATSC,KAST,GATSA,KAST;IAAA,KARSC,SAQT,GARSA,SAQT;IAAA,KAPQC,QAOR,GAPQA,QAOR;IAAA,KANSC,SAMT,GANSA,SAMT;IAAA,KALSC,OAKT,GALSA,OAKT;IAAA,KAJSC,SAIT,GAJSA,SAIT;IAAA,KAHSC,YAGT,GAHSA,YAGT;IAAA,KAFSC,MAET,GAFSA,MAET;IAAA,KADSC,OACT,GADSA,OACT;IAAA,yDACyB,iBADzB;IAAA,6CAEa,QAFb;IAAA,0DAsGyB,CAACC,cAAc,GAAG,KAAKN,SAAvB,KAAqC;MAC9D;MACA;MAEA,IAAIM,cAAJ,EAAoB;QAClB,OAAO,KAAIC,8BAAJ,EAAiB;UACtBC,e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ANI;MAO5BC,qBAAqB,EAAE;IAPK,CAAvB,CAAP;EASD;;EAEOD,QAAQ,GAAsB;IACpC,OAAO,KAAK5E,QAAL,CAAc6F,uBAAd,EAAP;EACD;;AAzL0C"}
1
+ {"version":3,"names":["ReactApp","constructor","name","entry","portRange","reactEnv","prerender","bundler","devServer","transformers","deploy","favicon","isPrerendering","TerserPlugin","extractComments","terserOptions","parse","ecma","compress","warnings","comparisons","inline","mangle","safari10","output","comments","ascii_only","minify","esbuildMinify","run","context","from","to","port","Port","getPort","listen","devServerContext","getDevServerContext","getDevServer","configMutator","addTopLevel","historyApiFallback","index","disableDotRule","headers","raw","publicPath","build","htmlConfig","title","templateContent","html","Object","assign","getBundler","bundleResult","computeResults","publicDir","getPublicDir","artifactsDir","dir","getDefaultBundler","capsule","env","outputPath","join","path","distDir","getCompiler","entries","map","require","resolve","basename","staticDir","bundlerContext","targets","components","component","hostDependencies","getPeers","aliasHostDependencies","rootPath","metaData","initiator","envId","id","defaultTransformer","config","addPlugin","prerenderPlugin","optimization","minimizer","remove","push","getESBuildConfig","applicationType","getPeerDependenciesList"],"sources":["react.application.ts"],"sourcesContent":["import { join, basename } from 'path';\nimport { Application, AppContext, AppBuildContext } from '@teambit/application';\nimport { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { remove } from 'lodash';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { ReactEnv } from '../../react.env';\nimport { prerenderPlugin } from './plugins';\nimport { ReactAppBuildResult } from './react-build-result';\nimport { ReactAppPrerenderOptions } from './react-app-options';\nimport { html } from '../../webpack';\nimport { ReactDeployContext } from '.';\nimport { computeResults } from './compute-results';\n\nexport class ReactApp implements Application {\n constructor(\n readonly name: string,\n readonly entry: string[],\n readonly portRange: number[],\n private reactEnv: ReactEnv,\n readonly prerender?: ReactAppPrerenderOptions,\n readonly bundler?: Bundler,\n readonly devServer?: DevServer,\n readonly transformers: WebpackConfigTransformer[] = [],\n readonly deploy?: (context: ReactDeployContext) => Promise<void>,\n readonly favicon?: string\n ) {}\n readonly applicationType = 'react-common-js';\n readonly dir = 'public';\n\n async run(context: AppContext): Promise<number> {\n const [from, to] = this.portRange;\n const port = await Port.getPort(from, to);\n if (this.devServer) {\n await this.devServer.listen(port);\n return port;\n }\n const devServerContext = await this.getDevServerContext(context);\n const devServer = this.reactEnv.getDevServer(devServerContext, [\n (configMutator) =>\n configMutator.addTopLevel('devServer', {\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n headers: {\n 'Access-Control-Allow-Headers': '*',\n },\n },\n }),\n (configMutator) => {\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n },\n ...this.transformers,\n ]);\n await devServer.listen(port);\n return port;\n }\n\n async build(context: AppBuildContext): Promise<ReactAppBuildResult> {\n const htmlConfig: BundlerHtmlConfig[] = [\n {\n title: context.name,\n templateContent: html(context.name),\n minify: false,\n favicon: this.favicon,\n // filename: ''.html`,\n },\n ];\n Object.assign(context, {\n html: htmlConfig,\n });\n const bundler = await this.getBundler(context);\n const bundleResult = await bundler.run();\n\n return computeResults(bundleResult, { publicDir: `${this.getPublicDir(context.artifactsDir)}/${this.dir}` });\n }\n\n private getBundler(context: AppBuildContext) {\n if (this.bundler) return this.bundler;\n return this.getDefaultBundler(context);\n }\n private async getDefaultBundler(context: AppBuildContext) {\n const { capsule } = context;\n const reactEnv: ReactEnv = context.env;\n const publicDir = this.getPublicDir(context.artifactsDir);\n const outputPath = join(capsule.path, publicDir);\n const { distDir } = reactEnv.getCompiler();\n const entries = this.entry.map((entry) => require.resolve(`${capsule.path}/${distDir}/${basename(entry)}`));\n const staticDir = join(outputPath, this.dir);\n\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [\n {\n components: [capsule?.component],\n entries,\n outputPath,\n hostDependencies: await this.getPeers(),\n aliasHostDependencies: true,\n },\n ],\n entry: [],\n rootPath: '/',\n metaData: {\n initiator: `building app: ${context.name}`,\n envId: context.id,\n },\n });\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const config = configMutator.addTopLevel('output', { path: staticDir, publicPath: `/` });\n if (this.prerender) config.addPlugin(prerenderPlugin(this.prerender));\n if (config.raw.optimization?.minimizer) {\n remove(config.raw.optimization?.minimizer, (minimizer) => {\n return minimizer.constructor.name === 'TerserPlugin';\n });\n\n config.raw.optimization?.minimizer.push(this.getESBuildConfig());\n }\n\n return config;\n };\n const transformers = [defaultTransformer, ...this.transformers];\n const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);\n return bundler;\n }\n private getESBuildConfig = (isPrerendering = this.prerender) => {\n // We don't want to use esbuild in case of prerendering since the headless browser puppeteer doesn't support\n // the output of esbuild\n\n if (isPrerendering) {\n return new TerserPlugin({\n extractComments: false,\n terserOptions: {\n parse: {\n // We want terser to parse ecma 8 code. However, we don't want it\n // to apply any minification steps that turns valid ecma 5 code\n // into invalid ecma 5 code. This is why the 'compress' and 'output'\n // sections only apply transformations that are ecma 5 safe\n // https://github.com/facebook/create-react-app/pull/4234\n ecma: 8,\n },\n compress: {\n ecma: 5,\n warnings: false,\n // Disabled because of an issue with Uglify breaking seemingly valid code:\n // https://github.com/facebook/create-react-app/issues/2376\n // Pending further investigation:\n // https://github.com/mishoo/UglifyJS2/issues/2011\n comparisons: false,\n // Disabled because of an issue with Terser breaking valid code:\n // https://github.com/facebook/create-react-app/issues/5250\n // Pending further investigation:\n // https://github.com/terser-js/terser/issues/120\n inline: 2,\n },\n mangle: {\n safari10: true,\n },\n output: {\n ecma: 5,\n comments: false,\n // Turned on because emoji and regex is not minified properly using default\n // https://github.com/facebook/create-react-app/issues/2488\n ascii_only: true,\n },\n },\n });\n }\n return new TerserPlugin({\n minify: TerserPlugin.esbuildMinify,\n // `terserOptions` options will be passed to `esbuild`\n // Link to options - https://esbuild.github.io/api/#minify\n terserOptions: {\n minify: true,\n },\n });\n };\n\n private getPublicDir(artifactsDir: string) {\n return join(artifactsDir, this.applicationType, this.name);\n }\n\n private async getDevServerContext(context: AppContext): Promise<DevServerContext> {\n return Object.assign(context, {\n entry: this.entry,\n rootPath: '',\n publicPath: `public/${this.name}`,\n title: this.name,\n favicon: this.favicon,\n hostDependencies: await this.getPeers(),\n aliasHostDependencies: true,\n });\n }\n\n private getPeers(): Promise<string[]> {\n return this.reactEnv.getPeerDependenciesList();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,QAAN,CAAsC;EAC3CC,WAAW,CACAC,IADA,EAEAC,KAFA,EAGAC,SAHA,EAIDC,QAJC,EAKAC,SALA,EAMAC,OANA,EAOAC,SAPA,EAQAC,YAAwC,GAAG,EAR3C,EASAC,MATA,EAUAC,OAVA,EAWT;IAAA,KAVST,IAUT,GAVSA,IAUT;IAAA,KATSC,KAST,GATSA,KAST;IAAA,KARSC,SAQT,GARSA,SAQT;IAAA,KAPQC,QAOR,GAPQA,QAOR;IAAA,KANSC,SAMT,GANSA,SAMT;IAAA,KALSC,OAKT,GALSA,OAKT;IAAA,KAJSC,SAIT,GAJSA,SAIT;IAAA,KAHSC,YAGT,GAHSA,YAGT;IAAA,KAFSC,MAET,GAFSA,MAET;IAAA,KADSC,OACT,GADSA,OACT;IAAA,yDACyB,iBADzB;IAAA,6CAEa,QAFb;IAAA,0DAsGyB,CAACC,cAAc,GAAG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,KAAK,EAAE,KAAKhD,IAJgB;MAK5BS,OAAO,EAAE,KAAKA,OALc;MAM5BqE,gBAAgB,EAAE,MAAM,KAAKC,QAAL,EANI;MAO5BC,qBAAqB,EAAE;IAPK,CAAvB,CAAP;EASD;;EAEOD,QAAQ,GAAsB;IACpC,OAAO,KAAK5E,QAAL,CAAc6F,uBAAd,EAAP;EACD;;AAzL0C"}
@@ -16,7 +16,7 @@ import { Linter, LinterContext } from '@teambit/linter';
16
16
  import { Formatter, FormatterContext } from '@teambit/formatter';
17
17
  import { SchemaExtractor } from '@teambit/schema';
18
18
  import { Logger } from '@teambit/logger';
19
- import { ReactMainConfig } from './react.main.runtime';
19
+ import type { ReactMainConfig } from './react.main.runtime';
20
20
  export declare const ReactEnvType = "react";
21
21
  declare type CompilerMode = 'build' | 'dev';
22
22
  declare type GetBuildPipeModifiers = PipeServiceModifiersMap & {
@@ -165,7 +165,7 @@ export declare class ReactEnv implements TesterEnv, CompilerEnv, LinterEnv, DevE
165
165
  getDocsTemplate(): string;
166
166
  icon: string;
167
167
  /**
168
- * returns a paths to a function which mounts a given component to DOM
168
+ * returns the path to the compositions template
169
169
  */
170
170
  getMounter(): string;
171
171
  getPreviewConfig(): {
package/dist/react.env.js CHANGED
@@ -469,10 +469,10 @@ class ReactEnv {
469
469
  }
470
470
 
471
471
  /**
472
- * returns a paths to a function which mounts a given component to DOM
472
+ * returns the path to the compositions template
473
473
  */
474
474
  getMounter() {
475
- return require.resolve('./mount');
475
+ return require.resolve('@teambit/react.ui.compositions-app');
476
476
  }
477
477
 
478
478
  getPreviewConfig() {
@@ -1 +1 @@
1
- {"version":3,"names":["ReactEnvType","defaultTsConfig","require","buildTsConfig","eslintConfig","prettierConfig","ReactEnv","constructor","jestAspect","tsAspect","compiler","webpack","workspace","pkg","tester","config","eslint","prettier","dependencyResolver","logger","compilerAspectId","getTsConfig","targetTsConfig","merge","getBuildTsConfig","getCjsJestTester","jestConfigPath","jestModulePath","pathToSource","pathNormalizeToLinux","__dirname","replace","defaultConfig","join","createTester","resolve","getEsmJestTester","getTester","getTsCompilerOptions","mode","tsconfig","cloneDeep","compileJs","compileJsx","types","getTsCjsCompiler","transformers","tsModule","ts","tsCompileOptions","createCjsCompiler","getTsEsmCompiler","createEsmCompiler","getCompiler","getLinter","context","defaultTransformer","configMutator","addExtensionTypes","allTransformers","createLinter","pluginPath","getFormatter","createFormatter","getFileMap","components","local","reduce","index","component","state","filesystem","files","forEach","file","path","id","toString","homepage","fullName","ComponentUrl","toUrl","writeFileMap","fileMap","tmpdir","Math","random","slice","outputFileSync","JSON","stringify","getDevEnvId","ReactAspect","getSchemaExtractor","createSchemaExtractor","getDevServer","baseConfig","basePreviewConfigFactory","envDevConfig","envPreviewDevConfigFactory","componentDevConfig","componentPreviewDevConfigFactory","merged","createDevServer","getBundler","createComponentsWebpackBundler","development","baseProdConfig","basePreviewProdConfigFactory","componentProdConfig","componentPreviewProdConfigFactory","mergedTransformers","createWebpackBundler","createTemplateWebpackBundler","templateConfig","templateWebpackConfigFactory","createBundler","getPeerDependenciesList","getPeerDependenciesListFromEnv","getAdditionalHostDependencies","getDocsTemplate","getMounter","getPreviewConfig","strategyName","splitComponentBundle","getPackageJsonProps","getCjsPackageJsonProps","getEsmPackageJsonProps","getNpmIgnore","CAPSULE_ARTIFACTS_DIR","getDependencies","dependencies","react","devDependencies","peerDependencies","getBuildPipe","modifiers","tsModifier","getCompilerTask","module","task","getBuildPipeWithoutCompiler","pipeWithoutCompiler","filter","aspectId","getEsmCompilerTask","tsCompiler","createTask","getCjsCompilerTask","__getDescriptor","type"],"sources":["react.env.ts"],"sourcesContent":["import ts, { TsConfigSourceFile } from 'typescript';\nimport { tmpdir } from 'os';\nimport { Component } from '@teambit/component';\nimport { ComponentUrl } from '@teambit/component.modules.component-url';\nimport { BuildTask, CAPSULE_ARTIFACTS_DIR } from '@teambit/builder';\nimport { merge, cloneDeep } from 'lodash';\nimport { Bundler, BundlerContext, DevServer, DevServerContext } from '@teambit/bundler';\nimport { CompilerMain } from '@teambit/compiler';\nimport {\n BuilderEnv,\n CompilerEnv,\n DependenciesEnv,\n DevEnv,\n LinterEnv,\n PackageEnv,\n TesterEnv,\n FormatterEnv,\n PipeServiceModifier,\n PipeServiceModifiersMap,\n} from '@teambit/envs';\nimport { JestMain } from '@teambit/jest';\nimport { PackageJsonProps, PkgMain } from '@teambit/pkg';\nimport { Tester, TesterMain } from '@teambit/tester';\nimport { TsConfigTransformer, TypescriptMain } from '@teambit/typescript';\nimport type { TypeScriptCompilerOptions } from '@teambit/typescript';\nimport { WebpackConfigTransformer, WebpackMain } from '@teambit/webpack';\nimport { Workspace } from '@teambit/workspace';\nimport { ESLintMain, EslintConfigTransformer } from '@teambit/eslint';\nimport { PrettierConfigTransformer, PrettierMain } from '@teambit/prettier';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Linter, LinterContext } from '@teambit/linter';\nimport { Formatter, FormatterContext } from '@teambit/formatter';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport type { ComponentMeta } from '@teambit/react.ui.highlighter.component-metadata.bit-component-meta';\nimport { SchemaExtractor } from '@teambit/schema';\nimport { join, resolve } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Logger } from '@teambit/logger';\n// Makes sure the @teambit/react.ui.docs-app is a dependency\n// TODO: remove this import once we can set policy from component to component with workspace version. Then set it via the component.json\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { ReactMainConfig } from './react.main.runtime';\nimport { ReactAspect } from './react.aspect';\n// webpack configs for both components and envs\nimport basePreviewConfigFactory from './webpack/webpack.config.base';\nimport basePreviewProdConfigFactory from './webpack/webpack.config.base.prod';\n\n// webpack configs for envs only\n// import devPreviewConfigFactory from './webpack/webpack.config.preview.dev';\nimport envPreviewDevConfigFactory from './webpack/webpack.config.env.dev';\nimport { templateWebpackConfigFactory } from './webpack/webpack.config.env.template';\n\n// webpack configs for components only\nimport componentPreviewProdConfigFactory from './webpack/webpack.config.component.prod';\nimport componentPreviewDevConfigFactory from './webpack/webpack.config.component.dev';\n\nexport const ReactEnvType = 'react';\nconst defaultTsConfig = require('./typescript/tsconfig.json');\nconst buildTsConfig = require('./typescript/tsconfig.build.json');\nconst eslintConfig = require('./eslint/eslintrc');\nconst prettierConfig = require('./prettier/prettier.config.js');\n\n// TODO: move to be taken from the key mode of compiler context\ntype CompilerMode = 'build' | 'dev';\n\ntype GetBuildPipeModifiers = PipeServiceModifiersMap & {\n tsModifier?: PipeServiceModifier;\n};\n\n/**\n * a component environment built for [React](https://reactjs.org) .\n */\nexport class ReactEnv\n implements TesterEnv, CompilerEnv, LinterEnv, DevEnv, BuilderEnv, DependenciesEnv, PackageEnv, FormatterEnv\n{\n constructor(\n /**\n * jest extension\n */\n private jestAspect: JestMain,\n\n /**\n * typescript extension.\n */\n protected tsAspect: TypescriptMain,\n\n /**\n * compiler extension.\n */\n private compiler: CompilerMain,\n\n /**\n * webpack extension.\n */\n private webpack: WebpackMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * pkg extension.\n */\n private pkg: PkgMain,\n\n /**\n * tester extension\n */\n private tester: TesterMain,\n\n private config: ReactMainConfig,\n\n private eslint: ESLintMain,\n\n private prettier: PrettierMain,\n\n private dependencyResolver: DependencyResolverMain,\n\n private logger: Logger,\n\n private compilerAspectId: string\n ) {}\n\n getTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile {\n return targetTsConfig ? merge({}, defaultTsConfig, targetTsConfig) : defaultTsConfig;\n }\n\n getBuildTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile {\n return targetTsConfig ? merge({}, buildTsConfig, targetTsConfig) : buildTsConfig;\n }\n\n /**\n * Get a jest tester instance with react config and cjs configs\n * @param jestConfigPath\n * @param jestModulePath\n * @returns\n */\n getCjsJestTester(jestConfigPath?: string, jestModulePath?: string): Tester {\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist', '');\n const defaultConfig = join(pathToSource, './jest/jest.cjs.config.js');\n const config = jestConfigPath || defaultConfig;\n return this.jestAspect.createTester(config, jestModulePath || require.resolve('jest'));\n }\n\n /**\n * Get a jest tester instance with react config and esm configs\n * @param jestConfigPath\n * @param jestModulePath\n * @returns\n */\n getEsmJestTester(jestConfigPath?: string, jestModulePath?: string): Tester {\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist', '');\n const defaultConfig = join(pathToSource, './jest/jest.esm.config.js');\n const config = jestConfigPath || defaultConfig;\n return this.jestAspect.createTester(config, jestModulePath || require.resolve('jest'));\n }\n\n /**\n * returns a component tester.\n */\n getTester(jestConfigPath: string, jestModulePath?: string): Tester {\n // return this.getEsmJestTester(jestConfigPath, jestModulePath);\n return this.getCjsJestTester(jestConfigPath, jestModulePath);\n }\n\n private getTsCompilerOptions(mode: CompilerMode = 'dev'): TypeScriptCompilerOptions {\n const tsconfig = mode === 'dev' ? cloneDeep(defaultTsConfig) : cloneDeep(buildTsConfig);\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist/', '/src/');\n const compileJs = true;\n const compileJsx = true;\n return {\n tsconfig,\n // TODO: @david please remove this line and refactor to be something that makes sense.\n types: [resolve(pathToSource, './typescript/style.d.ts'), resolve(pathToSource, './typescript/asset.d.ts')],\n compileJs,\n compileJsx,\n };\n }\n\n /**\n * Get a compiler instance with react config and set it to cjs module\n * @param mode\n * @param transformers\n * @param tsModule\n * @returns\n */\n getTsCjsCompiler(mode: CompilerMode = 'dev', transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompileOptions = this.getTsCompilerOptions(mode);\n return this.tsAspect.createCjsCompiler(tsCompileOptions, transformers, tsModule);\n }\n\n /**\n * Get a compiler instance with react config and set it to esm module\n * @param mode\n * @param transformers\n * @param tsModule\n * @returns\n */\n getTsEsmCompiler(mode: CompilerMode = 'dev', transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompileOptions = this.getTsCompilerOptions(mode);\n return this.tsAspect.createEsmCompiler(tsCompileOptions, transformers, tsModule);\n }\n\n getCompiler(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n // return this.getTsEsmCompiler('dev', transformers, tsModule);\n return this.getTsCjsCompiler('dev', transformers, tsModule);\n }\n\n /**\n * returns and configures the component linter.\n */\n getLinter(context: LinterContext, transformers: EslintConfigTransformer[] = []): Linter {\n const defaultTransformer: EslintConfigTransformer = (configMutator) => {\n configMutator.addExtensionTypes(['.md', '.mdx']);\n return configMutator;\n };\n\n const allTransformers = [defaultTransformer, ...transformers];\n\n return this.eslint.createLinter(\n context,\n {\n config: eslintConfig,\n // resolve all plugins from the react environment.\n pluginPath: __dirname,\n },\n allTransformers\n );\n }\n\n /**\n * returns and configures the component formatter.\n */\n getFormatter(context: FormatterContext, transformers: PrettierConfigTransformer[] = []): Formatter {\n return this.prettier.createFormatter(\n context,\n {\n config: prettierConfig,\n },\n transformers\n );\n }\n\n private getFileMap(components: Component[], local = false) {\n return components.reduce<{ [key: string]: ComponentMeta }>((index, component: Component) => {\n component.state.filesystem.files.forEach((file) => {\n index[file.path] = {\n id: component.id.toString(),\n homepage: local ? `/${component.id.fullName}` : ComponentUrl.toUrl(component.id),\n };\n });\n\n return index;\n }, {});\n }\n\n private writeFileMap(components: Component[], local?: boolean) {\n const fileMap = this.getFileMap(components, local);\n const path = join(tmpdir(), `${Math.random().toString(36).slice(2, 11)}.json`);\n outputFileSync(path, JSON.stringify(fileMap));\n return path;\n }\n\n /**\n * required for `bit start`\n */\n getDevEnvId(id?: string) {\n if (typeof id !== 'string') return ReactAspect.id;\n return id || ReactAspect.id;\n }\n\n /**\n * get a schema generator instance configured with the correct tsconfig.\n */\n getSchemaExtractor(tsconfig: TsConfigSourceFile): SchemaExtractor {\n return this.tsAspect.createSchemaExtractor(this.getTsConfig(tsconfig));\n }\n\n /**\n * returns and configures the React component dev server.\n * required for `bit start`\n */\n getDevServer(context: DevServerContext, transformers: WebpackConfigTransformer[] = []): DevServer {\n const baseConfig = basePreviewConfigFactory(false);\n const envDevConfig = envPreviewDevConfigFactory(context.id);\n const componentDevConfig = componentPreviewDevConfigFactory(this.workspace.path, context.id);\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, envDevConfig, componentDevConfig]);\n return merged;\n };\n\n return this.webpack.createDevServer(context, [defaultTransformer, ...transformers]);\n }\n\n async getBundler(context: BundlerContext, transformers: WebpackConfigTransformer[] = []): Promise<Bundler> {\n return this.createComponentsWebpackBundler(context, transformers);\n }\n\n async createComponentsWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n const baseConfig = basePreviewConfigFactory(!context.development);\n const baseProdConfig = basePreviewProdConfigFactory(context.development);\n const componentProdConfig = componentPreviewProdConfigFactory();\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, baseProdConfig, componentProdConfig]);\n return merged;\n };\n const mergedTransformers = [defaultTransformer, ...transformers];\n return this.createWebpackBundler(context, mergedTransformers);\n }\n\n async createTemplateWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n const baseConfig = basePreviewConfigFactory(!context.development);\n const baseProdConfig = basePreviewProdConfigFactory(context.development);\n const templateConfig = templateWebpackConfigFactory();\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, baseProdConfig, templateConfig]);\n return merged;\n };\n const mergedTransformers = [defaultTransformer, ...transformers];\n return this.createWebpackBundler(context, mergedTransformers);\n }\n\n private async createWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n return this.webpack.createBundler(context, transformers);\n }\n\n /**\n * Get the peers configured by the env on the components + the host deps configured by the env\n */\n getPeerDependenciesList() {\n return this.dependencyResolver.getPeerDependenciesListFromEnv(this);\n }\n\n getAdditionalHostDependencies(): string[] {\n return ['@teambit/mdx.ui.mdx-scope-context', '@mdx-js/react', 'react'];\n }\n\n /**\n * returns a path to a docs template.\n */\n getDocsTemplate() {\n return require.resolve('@teambit/react.ui.docs-app');\n }\n\n icon = 'https://static.bit.dev/extensions-icons/react.svg';\n\n /**\n * returns a paths to a function which mounts a given component to DOM\n */\n getMounter() {\n return require.resolve('./mount');\n }\n\n getPreviewConfig() {\n return {\n strategyName: 'component',\n splitComponentBundle: true,\n };\n }\n\n /**\n * define the package json properties to add to each component.\n */\n getPackageJsonProps(): PackageJsonProps {\n // React compile by default to esm, so uses type module\n // return this.getEsmPackageJsonProps();\n return this.getCjsPackageJsonProps();\n }\n\n /**\n * Get the default package.json props for a cjs component\n * @returns\n */\n getCjsPackageJsonProps(): PackageJsonProps {\n return this.tsAspect.getCjsPackageJsonProps();\n }\n\n /**\n * Get the default package.json props for an esm component\n * @returns\n */\n getEsmPackageJsonProps(): PackageJsonProps {\n return this.tsAspect.getEsmPackageJsonProps();\n }\n\n getNpmIgnore() {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n // without this change, the package has \"index.ts\" file in the root, causing typescript to parse it instead of the\n // d.ts files. (changing the \"types\" prop in the package.json file doesn't help).\n return [`${CAPSULE_ARTIFACTS_DIR}/`];\n }\n\n /**\n * adds dependencies to all configured components.\n */\n getDependencies() {\n return {\n dependencies: {\n react: '-',\n 'react-dom': '-',\n 'core-js': '^3.0.0',\n },\n // TODO: add this only if using ts\n devDependencies: {\n react: '-',\n 'react-dom': '-',\n '@types/mocha': '-',\n '@types/node': '12.20.4',\n '@types/react': '^17.0.8',\n '@types/react-dom': '^17.0.5',\n '@types/jest': '^26.0.0',\n // This is added as dev dep since our jest file transformer uses babel plugins that require this to be installed\n '@babel/runtime': '7.12.18',\n '@types/testing-library__jest-dom': '5.9.5',\n },\n peerDependencies: {\n react: '^16.8.0 || ^17.0.0',\n 'react-dom': '^16.8.0 || ^17.0.0',\n },\n };\n }\n\n /**\n * returns the component build pipeline.\n */\n getBuildPipe(modifiers: GetBuildPipeModifiers = {}): BuildTask[] {\n const transformers: TsConfigTransformer[] =\n (modifiers?.tsModifier?.transformers as any as TsConfigTransformer[]) || [];\n return [this.getCompilerTask(transformers, modifiers?.tsModifier?.module || ts), this.tester.task];\n }\n\n /**\n * Get the react build pipeline without the compilation task.\n * This help in cases you want to only replace the compilation task with something else\n * @returns\n */\n getBuildPipeWithoutCompiler(): BuildTask[] {\n const pipeWithoutCompiler = this.getBuildPipe().filter((task) => task.aspectId !== this.compilerAspectId);\n return pipeWithoutCompiler;\n }\n\n /**\n * Get a compiler task with react config and set to esm module\n * @param transformers\n * @param tsModule\n * @returns\n */\n getEsmCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompiler = this.getTsEsmCompiler('build', transformers, tsModule);\n return this.compiler.createTask('TSCompiler', tsCompiler);\n }\n\n /**\n * Get a compiler task with react config and set to cjs module\n * @param transformers\n * @param tsModule\n * @returns\n */\n getCjsCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompiler = this.getTsCjsCompiler('build', transformers, tsModule);\n return this.compiler.createTask('TSCompiler', tsCompiler);\n }\n\n private getCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.getCjsCompilerTask(transformers, tsModule);\n }\n\n async __getDescriptor() {\n return {\n type: ReactEnvType,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AA2BA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AA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A2B,GAAgB;IACzC,MAAMC,mBAAmB,GAAG,KAAKP,YAAL,GAAoBQ,MAApB,CAA4BH,IAAD,IAAUA,IAAI,CAACI,QAAL,KAAkB,KAAK5H,gBAA5D,CAA5B;IACA,OAAO0H,mBAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACEG,kBAAkB,CAACnG,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC1E,MAAMkG,UAAU,GAAG,KAAK/F,gBAAL,CAAsB,OAAtB,EAA+BL,YAA/B,EAA6CC,QAA7C,CAAnB;IACA,OAAO,KAAKrC,QAAL,CAAcyI,UAAd,CAAyB,YAAzB,EAAuCD,UAAvC,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACEE,kBAAkB,CAACtG,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC1E,MAAMkG,UAAU,GAAG,KAAKrG,gBAAL,CAAsB,OAAtB,EAA+BC,YAA/B,EAA6CC,QAA7C,CAAnB;IACA,OAAO,KAAKrC,QAAL,CAAcyI,UAAd,CAAyB,YAAzB,EAAuCD,UAAvC,CAAP;EACD;;EAEOR,eAAe,CAAC5F,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC/E,OAAO,KAAKoG,kBAAL,CAAwBtG,YAAxB,EAAsCC,QAAtC,CAAP;EACD;;EAEoB,MAAfsG,eAAe,GAAG;IACtB,OAAO;MACLC,IAAI,EAAEtJ;IADD,CAAP;EAGD;;AA1ZH"}
1
+ {"version":3,"names":["ReactEnvType","defaultTsConfig","require","buildTsConfig","eslintConfig","prettierConfig","ReactEnv","constructor","jestAspect","tsAspect","compiler","webpack","workspace","pkg","tester","config","eslint","prettier","dependencyResolver","logger","compilerAspectId","getTsConfig","targetTsConfig","merge","getBuildTsConfig","getCjsJestTester","jestConfigPath","jestModulePath","pathToSource","pathNormalizeToLinux","__dirname","replace","defaultConfig","join","createTester","resolve","getEsmJestTester","getTester","getTsCompilerOptions","mode","tsconfig","cloneDeep","compileJs","compileJsx","types","getTsCjsCompiler","transformers","tsModule","ts","tsCompileOptions","createCjsCompiler","getTsEsmCompiler","createEsmCompiler","getCompiler","getLinter","context","defaultTransformer","configMutator","addExtensionTypes","allTransformers","createLinter","pluginPath","getFormatter","createFormatter","getFileMap","components","local","reduce","index","component","state","filesystem","files","forEach","file","path","id","toString","homepage","fullName","ComponentUrl","toUrl","writeFileMap","fileMap","tmpdir","Math","random","slice","outputFileSync","JSON","stringify","getDevEnvId","ReactAspect","getSchemaExtractor","createSchemaExtractor","getDevServer","baseConfig","basePreviewConfigFactory","envDevConfig","envPreviewDevConfigFactory","componentDevConfig","componentPreviewDevConfigFactory","merged","createDevServer","getBundler","createComponentsWebpackBundler","development","baseProdConfig","basePreviewProdConfigFactory","componentProdConfig","componentPreviewProdConfigFactory","mergedTransformers","createWebpackBundler","createTemplateWebpackBundler","templateConfig","templateWebpackConfigFactory","createBundler","getPeerDependenciesList","getPeerDependenciesListFromEnv","getAdditionalHostDependencies","getDocsTemplate","getMounter","getPreviewConfig","strategyName","splitComponentBundle","getPackageJsonProps","getCjsPackageJsonProps","getEsmPackageJsonProps","getNpmIgnore","CAPSULE_ARTIFACTS_DIR","getDependencies","dependencies","react","devDependencies","peerDependencies","getBuildPipe","modifiers","tsModifier","getCompilerTask","module","task","getBuildPipeWithoutCompiler","pipeWithoutCompiler","filter","aspectId","getEsmCompilerTask","tsCompiler","createTask","getCjsCompilerTask","__getDescriptor","type"],"sources":["react.env.ts"],"sourcesContent":["import ts, { TsConfigSourceFile } from 'typescript';\nimport { tmpdir } from 'os';\nimport { Component } from '@teambit/component';\nimport { ComponentUrl } from '@teambit/component.modules.component-url';\nimport { BuildTask, CAPSULE_ARTIFACTS_DIR } from '@teambit/builder';\nimport { merge, cloneDeep } from 'lodash';\nimport { Bundler, BundlerContext, DevServer, DevServerContext } from '@teambit/bundler';\nimport { CompilerMain } from '@teambit/compiler';\nimport {\n BuilderEnv,\n CompilerEnv,\n DependenciesEnv,\n DevEnv,\n LinterEnv,\n PackageEnv,\n TesterEnv,\n FormatterEnv,\n PipeServiceModifier,\n PipeServiceModifiersMap,\n} from '@teambit/envs';\nimport { JestMain } from '@teambit/jest';\nimport { PackageJsonProps, PkgMain } from '@teambit/pkg';\nimport { Tester, TesterMain } from '@teambit/tester';\nimport { TsConfigTransformer, TypescriptMain } from '@teambit/typescript';\nimport type { TypeScriptCompilerOptions } from '@teambit/typescript';\nimport { WebpackConfigTransformer, WebpackMain } from '@teambit/webpack';\nimport { Workspace } from '@teambit/workspace';\nimport { ESLintMain, EslintConfigTransformer } from '@teambit/eslint';\nimport { PrettierConfigTransformer, PrettierMain } from '@teambit/prettier';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Linter, LinterContext } from '@teambit/linter';\nimport { Formatter, FormatterContext } from '@teambit/formatter';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport type { ComponentMeta } from '@teambit/react.ui.highlighter.component-metadata.bit-component-meta';\nimport { SchemaExtractor } from '@teambit/schema';\nimport { join, resolve } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Logger } from '@teambit/logger';\nimport type { ReactMainConfig } from './react.main.runtime';\nimport { ReactAspect } from './react.aspect';\n// webpack configs for both components and envs\nimport basePreviewConfigFactory from './webpack/webpack.config.base';\nimport basePreviewProdConfigFactory from './webpack/webpack.config.base.prod';\n\n// webpack configs for envs only\n// import devPreviewConfigFactory from './webpack/webpack.config.preview.dev';\nimport envPreviewDevConfigFactory from './webpack/webpack.config.env.dev';\nimport { templateWebpackConfigFactory } from './webpack/webpack.config.env.template';\n\n// webpack configs for components only\nimport componentPreviewProdConfigFactory from './webpack/webpack.config.component.prod';\nimport componentPreviewDevConfigFactory from './webpack/webpack.config.component.dev';\n\nexport const ReactEnvType = 'react';\nconst defaultTsConfig = require('./typescript/tsconfig.json');\nconst buildTsConfig = require('./typescript/tsconfig.build.json');\nconst eslintConfig = require('./eslint/eslintrc');\nconst prettierConfig = require('./prettier/prettier.config.js');\n\n// TODO: move to be taken from the key mode of compiler context\ntype CompilerMode = 'build' | 'dev';\n\ntype GetBuildPipeModifiers = PipeServiceModifiersMap & {\n tsModifier?: PipeServiceModifier;\n};\n\n/**\n * a component environment built for [React](https://reactjs.org) .\n */\nexport class ReactEnv\n implements TesterEnv, CompilerEnv, LinterEnv, DevEnv, BuilderEnv, DependenciesEnv, PackageEnv, FormatterEnv\n{\n constructor(\n /**\n * jest extension\n */\n private jestAspect: JestMain,\n\n /**\n * typescript extension.\n */\n protected tsAspect: TypescriptMain,\n\n /**\n * compiler extension.\n */\n private compiler: CompilerMain,\n\n /**\n * webpack extension.\n */\n private webpack: WebpackMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * pkg extension.\n */\n private pkg: PkgMain,\n\n /**\n * tester extension\n */\n private tester: TesterMain,\n\n private config: ReactMainConfig,\n\n private eslint: ESLintMain,\n\n private prettier: PrettierMain,\n\n private dependencyResolver: DependencyResolverMain,\n\n private logger: Logger,\n\n private compilerAspectId: string\n ) {}\n\n getTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile {\n return targetTsConfig ? merge({}, defaultTsConfig, targetTsConfig) : defaultTsConfig;\n }\n\n getBuildTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile {\n return targetTsConfig ? merge({}, buildTsConfig, targetTsConfig) : buildTsConfig;\n }\n\n /**\n * Get a jest tester instance with react config and cjs configs\n * @param jestConfigPath\n * @param jestModulePath\n * @returns\n */\n getCjsJestTester(jestConfigPath?: string, jestModulePath?: string): Tester {\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist', '');\n const defaultConfig = join(pathToSource, './jest/jest.cjs.config.js');\n const config = jestConfigPath || defaultConfig;\n return this.jestAspect.createTester(config, jestModulePath || require.resolve('jest'));\n }\n\n /**\n * Get a jest tester instance with react config and esm configs\n * @param jestConfigPath\n * @param jestModulePath\n * @returns\n */\n getEsmJestTester(jestConfigPath?: string, jestModulePath?: string): Tester {\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist', '');\n const defaultConfig = join(pathToSource, './jest/jest.esm.config.js');\n const config = jestConfigPath || defaultConfig;\n return this.jestAspect.createTester(config, jestModulePath || require.resolve('jest'));\n }\n\n /**\n * returns a component tester.\n */\n getTester(jestConfigPath: string, jestModulePath?: string): Tester {\n // return this.getEsmJestTester(jestConfigPath, jestModulePath);\n return this.getCjsJestTester(jestConfigPath, jestModulePath);\n }\n\n private getTsCompilerOptions(mode: CompilerMode = 'dev'): TypeScriptCompilerOptions {\n const tsconfig = mode === 'dev' ? cloneDeep(defaultTsConfig) : cloneDeep(buildTsConfig);\n const pathToSource = pathNormalizeToLinux(__dirname).replace('/dist/', '/src/');\n const compileJs = true;\n const compileJsx = true;\n return {\n tsconfig,\n // TODO: @david please remove this line and refactor to be something that makes sense.\n types: [resolve(pathToSource, './typescript/style.d.ts'), resolve(pathToSource, './typescript/asset.d.ts')],\n compileJs,\n compileJsx,\n };\n }\n\n /**\n * Get a compiler instance with react config and set it to cjs module\n * @param mode\n * @param transformers\n * @param tsModule\n * @returns\n */\n getTsCjsCompiler(mode: CompilerMode = 'dev', transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompileOptions = this.getTsCompilerOptions(mode);\n return this.tsAspect.createCjsCompiler(tsCompileOptions, transformers, tsModule);\n }\n\n /**\n * Get a compiler instance with react config and set it to esm module\n * @param mode\n * @param transformers\n * @param tsModule\n * @returns\n */\n getTsEsmCompiler(mode: CompilerMode = 'dev', transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompileOptions = this.getTsCompilerOptions(mode);\n return this.tsAspect.createEsmCompiler(tsCompileOptions, transformers, tsModule);\n }\n\n getCompiler(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n // return this.getTsEsmCompiler('dev', transformers, tsModule);\n return this.getTsCjsCompiler('dev', transformers, tsModule);\n }\n\n /**\n * returns and configures the component linter.\n */\n getLinter(context: LinterContext, transformers: EslintConfigTransformer[] = []): Linter {\n const defaultTransformer: EslintConfigTransformer = (configMutator) => {\n configMutator.addExtensionTypes(['.md', '.mdx']);\n return configMutator;\n };\n\n const allTransformers = [defaultTransformer, ...transformers];\n\n return this.eslint.createLinter(\n context,\n {\n config: eslintConfig,\n // resolve all plugins from the react environment.\n pluginPath: __dirname,\n },\n allTransformers\n );\n }\n\n /**\n * returns and configures the component formatter.\n */\n getFormatter(context: FormatterContext, transformers: PrettierConfigTransformer[] = []): Formatter {\n return this.prettier.createFormatter(\n context,\n {\n config: prettierConfig,\n },\n transformers\n );\n }\n\n private getFileMap(components: Component[], local = false) {\n return components.reduce<{ [key: string]: ComponentMeta }>((index, component: Component) => {\n component.state.filesystem.files.forEach((file) => {\n index[file.path] = {\n id: component.id.toString(),\n homepage: local ? `/${component.id.fullName}` : ComponentUrl.toUrl(component.id),\n };\n });\n\n return index;\n }, {});\n }\n\n private writeFileMap(components: Component[], local?: boolean) {\n const fileMap = this.getFileMap(components, local);\n const path = join(tmpdir(), `${Math.random().toString(36).slice(2, 11)}.json`);\n outputFileSync(path, JSON.stringify(fileMap));\n return path;\n }\n\n /**\n * required for `bit start`\n */\n getDevEnvId(id?: string) {\n if (typeof id !== 'string') return ReactAspect.id;\n return id || ReactAspect.id;\n }\n\n /**\n * get a schema generator instance configured with the correct tsconfig.\n */\n getSchemaExtractor(tsconfig: TsConfigSourceFile): SchemaExtractor {\n return this.tsAspect.createSchemaExtractor(this.getTsConfig(tsconfig));\n }\n\n /**\n * returns and configures the React component dev server.\n * required for `bit start`\n */\n getDevServer(context: DevServerContext, transformers: WebpackConfigTransformer[] = []): DevServer {\n const baseConfig = basePreviewConfigFactory(false);\n const envDevConfig = envPreviewDevConfigFactory(context.id);\n const componentDevConfig = componentPreviewDevConfigFactory(this.workspace.path, context.id);\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, envDevConfig, componentDevConfig]);\n return merged;\n };\n\n return this.webpack.createDevServer(context, [defaultTransformer, ...transformers]);\n }\n\n async getBundler(context: BundlerContext, transformers: WebpackConfigTransformer[] = []): Promise<Bundler> {\n return this.createComponentsWebpackBundler(context, transformers);\n }\n\n async createComponentsWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n const baseConfig = basePreviewConfigFactory(!context.development);\n const baseProdConfig = basePreviewProdConfigFactory(context.development);\n const componentProdConfig = componentPreviewProdConfigFactory();\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, baseProdConfig, componentProdConfig]);\n return merged;\n };\n const mergedTransformers = [defaultTransformer, ...transformers];\n return this.createWebpackBundler(context, mergedTransformers);\n }\n\n async createTemplateWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n const baseConfig = basePreviewConfigFactory(!context.development);\n const baseProdConfig = basePreviewProdConfigFactory(context.development);\n const templateConfig = templateWebpackConfigFactory();\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const merged = configMutator.merge([baseConfig, baseProdConfig, templateConfig]);\n return merged;\n };\n const mergedTransformers = [defaultTransformer, ...transformers];\n return this.createWebpackBundler(context, mergedTransformers);\n }\n\n private async createWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n return this.webpack.createBundler(context, transformers);\n }\n\n /**\n * Get the peers configured by the env on the components + the host deps configured by the env\n */\n getPeerDependenciesList() {\n return this.dependencyResolver.getPeerDependenciesListFromEnv(this);\n }\n\n getAdditionalHostDependencies(): string[] {\n return ['@teambit/mdx.ui.mdx-scope-context', '@mdx-js/react', 'react'];\n }\n\n /**\n * returns a path to a docs template.\n */\n getDocsTemplate() {\n return require.resolve('@teambit/react.ui.docs-app');\n }\n\n icon = 'https://static.bit.dev/extensions-icons/react.svg';\n\n /**\n * returns the path to the compositions template\n */\n getMounter() {\n return require.resolve('@teambit/react.ui.compositions-app');\n }\n\n getPreviewConfig() {\n return {\n strategyName: 'component',\n splitComponentBundle: true,\n };\n }\n\n /**\n * define the package json properties to add to each component.\n */\n getPackageJsonProps(): PackageJsonProps {\n // React compile by default to esm, so uses type module\n // return this.getEsmPackageJsonProps();\n return this.getCjsPackageJsonProps();\n }\n\n /**\n * Get the default package.json props for a cjs component\n * @returns\n */\n getCjsPackageJsonProps(): PackageJsonProps {\n return this.tsAspect.getCjsPackageJsonProps();\n }\n\n /**\n * Get the default package.json props for an esm component\n * @returns\n */\n getEsmPackageJsonProps(): PackageJsonProps {\n return this.tsAspect.getEsmPackageJsonProps();\n }\n\n getNpmIgnore() {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n // without this change, the package has \"index.ts\" file in the root, causing typescript to parse it instead of the\n // d.ts files. (changing the \"types\" prop in the package.json file doesn't help).\n return [`${CAPSULE_ARTIFACTS_DIR}/`];\n }\n\n /**\n * adds dependencies to all configured components.\n */\n getDependencies() {\n return {\n dependencies: {\n react: '-',\n 'react-dom': '-',\n 'core-js': '^3.0.0',\n },\n // TODO: add this only if using ts\n devDependencies: {\n react: '-',\n 'react-dom': '-',\n '@types/mocha': '-',\n '@types/node': '12.20.4',\n '@types/react': '^17.0.8',\n '@types/react-dom': '^17.0.5',\n '@types/jest': '^26.0.0',\n // This is added as dev dep since our jest file transformer uses babel plugins that require this to be installed\n '@babel/runtime': '7.12.18',\n '@types/testing-library__jest-dom': '5.9.5',\n },\n peerDependencies: {\n react: '^16.8.0 || ^17.0.0',\n 'react-dom': '^16.8.0 || ^17.0.0',\n },\n };\n }\n\n /**\n * returns the component build pipeline.\n */\n getBuildPipe(modifiers: GetBuildPipeModifiers = {}): BuildTask[] {\n const transformers: TsConfigTransformer[] =\n (modifiers?.tsModifier?.transformers as any as TsConfigTransformer[]) || [];\n return [this.getCompilerTask(transformers, modifiers?.tsModifier?.module || ts), this.tester.task];\n }\n\n /**\n * Get the react build pipeline without the compilation task.\n * This help in cases you want to only replace the compilation task with something else\n * @returns\n */\n getBuildPipeWithoutCompiler(): BuildTask[] {\n const pipeWithoutCompiler = this.getBuildPipe().filter((task) => task.aspectId !== this.compilerAspectId);\n return pipeWithoutCompiler;\n }\n\n /**\n * Get a compiler task with react config and set to esm module\n * @param transformers\n * @param tsModule\n * @returns\n */\n getEsmCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompiler = this.getTsEsmCompiler('build', transformers, tsModule);\n return this.compiler.createTask('TSCompiler', tsCompiler);\n }\n\n /**\n * Get a compiler task with react config and set to cjs module\n * @param transformers\n * @param tsModule\n * @returns\n */\n getCjsCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n const tsCompiler = this.getTsCjsCompiler('build', transformers, tsModule);\n return this.compiler.createTask('TSCompiler', tsCompiler);\n }\n\n private getCompilerTask(transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.getCjsCompilerTask(transformers, tsModule);\n }\n\n async __getDescriptor() {\n return {\n type: ReactEnvType,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AA2BA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA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AAK5H,gBAA5D,CAA5B;IACA,OAAO0H,mBAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACEG,kBAAkB,CAACnG,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC1E,MAAMkG,UAAU,GAAG,KAAK/F,gBAAL,CAAsB,OAAtB,EAA+BL,YAA/B,EAA6CC,QAA7C,CAAnB;IACA,OAAO,KAAKrC,QAAL,CAAcyI,UAAd,CAAyB,YAAzB,EAAuCD,UAAvC,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACEE,kBAAkB,CAACtG,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC1E,MAAMkG,UAAU,GAAG,KAAKrG,gBAAL,CAAsB,OAAtB,EAA+BC,YAA/B,EAA6CC,QAA7C,CAAnB;IACA,OAAO,KAAKrC,QAAL,CAAcyI,UAAd,CAAyB,YAAzB,EAAuCD,UAAvC,CAAP;EACD;;EAEOR,eAAe,CAAC5F,YAAmC,GAAG,EAAvC,EAA2CC,QAAQ,GAAGC,qBAAtD,EAA0D;IAC/E,OAAO,KAAKoG,kBAAL,CAAwBtG,YAAxB,EAAsCC,QAAtC,CAAP;EACD;;EAEoB,MAAfsG,eAAe,GAAG;IACtB,OAAO;MACLC,IAAI,EAAEtJ;IADD,CAAP;EAGD;;AA1ZH"}
package/package.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "@teambit/react",
3
- "version": "0.0.779",
3
+ "version": "0.0.782",
4
4
  "homepage": "https://bit.dev/teambit/react/react",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.react",
8
8
  "name": "react",
9
- "version": "0.0.779"
9
+ "version": "0.0.782"
10
10
  },
11
11
  "dependencies": {
12
- "react-error-boundary": "^3.0.0",
13
12
  "fs-extra": "10.0.0",
14
13
  "lodash": "4.17.21",
15
14
  "typescript": "4.4.2",
@@ -74,45 +73,41 @@
74
73
  "@babel/helper-plugin-test-runner": "7.16.7",
75
74
  "@svgr/webpack": "5.5.0",
76
75
  "core-js": "^3.0.0",
77
- "@teambit/base-ui.utils.composer": "1.0.0",
78
76
  "@teambit/design.ui.input.option-button": "1.0.0",
79
77
  "@teambit/harmony": "0.3.3",
80
78
  "@teambit/react.instructions.react.adding-compositions": "0.0.6",
81
79
  "@teambit/react.instructions.react.adding-tests": "0.0.6",
82
- "@teambit/design.ui.pages.standalone-not-found-page": "0.0.358",
83
- "@teambit/preview": "0.0.779",
84
- "@teambit/react.ui.error-fallback": "0.0.111",
85
- "@teambit/react.ui.loader-fallback": "0.0.89",
86
80
  "@teambit/compositions.ui.hooks.use-composition": "0.0.163",
87
81
  "@teambit/design.ui.tooltip": "0.0.352",
88
- "@teambit/builder": "0.0.779",
89
- "@teambit/bundler": "0.0.779",
90
- "@teambit/compiler": "0.0.779",
82
+ "@teambit/builder": "0.0.782",
83
+ "@teambit/bundler": "0.0.782",
84
+ "@teambit/compiler": "0.0.782",
91
85
  "@teambit/component.modules.component-url": "0.0.125",
92
- "@teambit/component": "0.0.779",
93
- "@teambit/dependency-resolver": "0.0.779",
94
- "@teambit/envs": "0.0.779",
95
- "@teambit/eslint": "0.0.779",
96
- "@teambit/formatter": "0.0.330",
97
- "@teambit/jest": "0.0.779",
98
- "@teambit/linter": "0.0.779",
99
- "@teambit/logger": "0.0.608",
100
- "@teambit/pkg": "0.0.779",
101
- "@teambit/prettier": "0.0.330",
86
+ "@teambit/component": "0.0.782",
87
+ "@teambit/dependency-resolver": "0.0.782",
88
+ "@teambit/envs": "0.0.782",
89
+ "@teambit/eslint": "0.0.782",
90
+ "@teambit/formatter": "0.0.333",
91
+ "@teambit/jest": "0.0.782",
92
+ "@teambit/linter": "0.0.782",
93
+ "@teambit/logger": "0.0.611",
94
+ "@teambit/pkg": "0.0.782",
95
+ "@teambit/prettier": "0.0.333",
102
96
  "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
103
- "@teambit/schema": "0.0.779",
104
- "@teambit/tester": "0.0.779",
105
- "@teambit/typescript": "0.0.779",
106
- "@teambit/webpack": "0.0.779",
107
- "@teambit/workspace": "0.0.779",
108
- "@teambit/application": "0.0.421",
109
- "@teambit/cli": "0.0.515",
110
- "@teambit/generator": "0.0.779",
111
- "@teambit/graphql": "0.0.779",
97
+ "@teambit/schema": "0.0.782",
98
+ "@teambit/tester": "0.0.782",
99
+ "@teambit/typescript": "0.0.782",
100
+ "@teambit/webpack": "0.0.782",
101
+ "@teambit/workspace": "0.0.782",
102
+ "@teambit/application": "0.0.424",
103
+ "@teambit/cli": "0.0.518",
104
+ "@teambit/generator": "0.0.782",
105
+ "@teambit/graphql": "0.0.782",
106
+ "@teambit/preview": "0.0.782",
112
107
  "@teambit/react.ui.highlighter-provider": "0.0.189",
113
- "@teambit/compositions": "0.0.779",
114
- "@teambit/ui": "0.0.779",
115
- "@teambit/react.eslint-config-bit-react": "0.0.589",
108
+ "@teambit/compositions": "0.0.782",
109
+ "@teambit/ui": "0.0.782",
110
+ "@teambit/react.eslint-config-bit-react": "0.0.592",
116
111
  "@teambit/mdx.modules.mdx-loader": "0.0.490",
117
112
  "@teambit/react.babel.bit-react-transformer": "0.0.501",
118
113
  "@teambit/webpack.modules.generate-style-loaders": "0.0.103",
@@ -120,17 +115,17 @@
120
115
  "@teambit/component-id": "0.0.402",
121
116
  "@teambit/toolbox.network.get-port": "0.0.113",
122
117
  "@teambit/react.modules.prerenderer-puppeteer": "0.0.2",
123
- "@teambit/config": "0.0.528"
118
+ "@teambit/config": "0.0.531"
124
119
  },
125
120
  "devDependencies": {
126
121
  "@types/react": "^17.0.8",
127
- "@types/react-dom": "^17.0.5",
128
122
  "@types/fs-extra": "9.0.7",
129
123
  "@types/lodash": "4.14.165",
130
124
  "@types/lodash.flatten": "4.4.6",
131
125
  "@types/webpack": "5.28.0",
132
126
  "@types/mini-css-extract-plugin": "2.2.0",
133
127
  "@types/react-dev-utils": "9.0.10",
128
+ "@types/react-dom": "^17.0.5",
134
129
  "@types/postcss-normalize": "9.0.1",
135
130
  "@types/node": "12.20.4",
136
131
  "@types/mocha": "9.1.0",
@@ -139,7 +134,7 @@
139
134
  "@teambit/react.content.react-overview": "1.95.0"
140
135
  },
141
136
  "peerDependencies": {
142
- "@teambit/legacy": "1.0.296",
137
+ "@teambit/legacy": "1.0.299",
143
138
  "react-dom": "^16.8.0 || ^17.0.0",
144
139
  "react": "^16.8.0 || ^17.0.0"
145
140
  },
@@ -203,7 +198,7 @@
203
198
  "@types/jest": "^26.0.0"
204
199
  },
205
200
  "peerDependencies": {
206
- "@teambit/legacy": "1.0.296",
201
+ "@teambit/legacy": "1.0.299",
207
202
  "react-dom": "^16.8.0 || ^17.0.0",
208
203
  "react": "^16.8.0 || ^17.0.0"
209
204
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.779/dist/react.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.779/dist/react.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.782/dist/react.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.782/dist/react.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];