@teambit/react 0.0.880 → 0.0.882

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 (236) hide show
  1. package/artifacts/__bit_junit.xml +2 -2
  2. package/artifacts/env-template/public/{770.8cc321d531369e25ec1c.js → 700.fcb0085dcdf160cc65c9.js} +18 -20
  3. package/artifacts/env-template/public/assets-manifest.json +16 -16
  4. package/artifacts/env-template/public/{compositions.aab650d15edcf055899a.js → compositions.d36450c5ae70173e7a70.js} +1 -1
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.5ef8ce1624e4c34dadf2.js → overview.ca1695b4bf4d507d7a28.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/peers.9642cecf0c09b9d93f54.js +1 -0
  9. package/artifacts/env-template/public/{preview-root.48c79384da92a8a7a512.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
  10. package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
  11. package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
  12. package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
  13. package/artifacts/preview/teambit_react_react-preview.js +1 -1
  14. package/{compositions-1666312873430.js → compositions-1666496165706.js} +0 -0
  15. package/dist/apps/web/compute-results.js +0 -2
  16. package/dist/apps/web/compute-results.js.map +1 -1
  17. package/dist/apps/web/index.js +0 -3
  18. package/dist/apps/web/index.js.map +1 -1
  19. package/dist/apps/web/plugins/index.js +0 -3
  20. package/dist/apps/web/plugins/index.js.map +1 -1
  21. package/dist/apps/web/plugins/prerender.js +0 -14
  22. package/dist/apps/web/plugins/prerender.js.map +1 -1
  23. package/dist/apps/web/react.app-type.js +0 -7
  24. package/dist/apps/web/react.app-type.js.map +1 -1
  25. package/dist/apps/web/react.application.js +11 -76
  26. package/dist/apps/web/react.application.js.map +1 -1
  27. package/dist/apps/web/ssr/ssr-express.js +0 -31
  28. package/dist/apps/web/ssr/ssr-express.js.map +1 -1
  29. package/dist/apps/web/webpack/mutators.js +0 -13
  30. package/dist/apps/web/webpack/mutators.js.map +1 -1
  31. package/dist/apps/web/webpack/webpack.app.ssr.config.js +0 -11
  32. package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
  33. package/dist/eslint/eslintrc.js +1 -1
  34. package/dist/eslint/eslintrc.js.map +1 -1
  35. package/dist/highlighter-widget.js +0 -16
  36. package/dist/highlighter-widget.js.map +1 -1
  37. package/dist/index.js +0 -3
  38. package/dist/index.js.map +1 -1
  39. package/dist/jest/index.js +0 -7
  40. package/dist/jest/index.js.map +1 -1
  41. package/dist/jest/jest.base.config.js +3 -3
  42. package/dist/jest/jest.base.config.js.map +1 -1
  43. package/dist/jest/jest.cjs.config.js +0 -10
  44. package/dist/jest/jest.cjs.config.js.map +1 -1
  45. package/dist/jest/jest.config.js +1 -1
  46. package/dist/jest/jest.config.js.map +1 -1
  47. package/dist/jest/jest.esm.config.js +0 -10
  48. package/dist/jest/jest.esm.config.js.map +1 -1
  49. package/dist/jest/setupTests.js.map +1 -1
  50. package/dist/jest/transformers/base-transformer-plugins.js +1 -0
  51. package/dist/jest/transformers/base-transformer-plugins.js.map +1 -1
  52. package/dist/jest/transformers/base-transformer-presets.js +1 -0
  53. package/dist/jest/transformers/base-transformer-presets.js.map +1 -1
  54. package/dist/jest/transformers/base-transformer-process.js +0 -2
  55. package/dist/jest/transformers/base-transformer-process.js.map +1 -1
  56. package/dist/jest/transformers/cjs-transformer.js +0 -5
  57. package/dist/jest/transformers/cjs-transformer.js.map +1 -1
  58. package/dist/jest/transformers/css-transform.js +1 -2
  59. package/dist/jest/transformers/css-transform.js.map +1 -1
  60. package/dist/jest/transformers/esm-transformer.js +1 -5
  61. package/dist/jest/transformers/esm-transformer.js.map +1 -1
  62. package/dist/jest/transformers/file-transform.js +2 -6
  63. package/dist/jest/transformers/file-transform.js.map +1 -1
  64. package/dist/prettier/prettier.config.js.map +1 -1
  65. package/dist/react.aspect.js +0 -5
  66. package/dist/react.aspect.js.map +1 -1
  67. package/dist/react.composition.js +0 -6
  68. package/dist/react.composition.js.map +1 -1
  69. package/dist/react.env.js +34 -143
  70. package/dist/react.env.js.map +1 -1
  71. package/dist/react.graphql.js +0 -6
  72. package/dist/react.graphql.js.map +1 -1
  73. package/dist/react.main.runtime.js +23 -152
  74. package/dist/react.main.runtime.js.map +1 -1
  75. package/dist/react.preview.runtime.js +0 -32
  76. package/dist/react.preview.runtime.js.map +1 -1
  77. package/dist/react.templates.js +0 -46
  78. package/dist/react.templates.js.map +1 -1
  79. package/dist/react.ui.runtime.js +0 -35
  80. package/dist/react.ui.runtime.js.map +1 -1
  81. package/dist/templates/react-app/files/app-plugin.js +0 -1
  82. package/dist/templates/react-app/files/app-plugin.js.map +1 -1
  83. package/dist/templates/react-app/files/app-root.js +0 -1
  84. package/dist/templates/react-app/files/app-root.js.map +1 -1
  85. package/dist/templates/react-app/files/app.js +0 -1
  86. package/dist/templates/react-app/files/app.js.map +1 -1
  87. package/dist/templates/react-app/files/compositions.js +0 -1
  88. package/dist/templates/react-app/files/compositions.js.map +1 -1
  89. package/dist/templates/react-app/files/doc.js +0 -1
  90. package/dist/templates/react-app/files/doc.js.map +1 -1
  91. package/dist/templates/react-app/files/index.js +0 -1
  92. package/dist/templates/react-app/files/index.js.map +1 -1
  93. package/dist/templates/react-app/index.js +0 -19
  94. package/dist/templates/react-app/index.js.map +1 -1
  95. package/dist/templates/react-component/files/component.js +0 -2
  96. package/dist/templates/react-component/files/component.js.map +1 -1
  97. package/dist/templates/react-component/files/composition.js +0 -2
  98. package/dist/templates/react-component/files/composition.js.map +1 -1
  99. package/dist/templates/react-component/files/docs.js +0 -2
  100. package/dist/templates/react-component/files/docs.js.map +1 -1
  101. package/dist/templates/react-component/files/index-file.js +0 -2
  102. package/dist/templates/react-component/files/index-file.js.map +1 -1
  103. package/dist/templates/react-component/files/test.js +0 -2
  104. package/dist/templates/react-component/files/test.js.map +1 -1
  105. package/dist/templates/react-component/index.js +0 -24
  106. package/dist/templates/react-component/index.js.map +1 -1
  107. package/dist/templates/react-component-js/files/component.js +0 -2
  108. package/dist/templates/react-component-js/files/component.js.map +1 -1
  109. package/dist/templates/react-component-js/files/composition.js +0 -2
  110. package/dist/templates/react-component-js/files/composition.js.map +1 -1
  111. package/dist/templates/react-component-js/files/docs.js +0 -2
  112. package/dist/templates/react-component-js/files/docs.js.map +1 -1
  113. package/dist/templates/react-component-js/files/test.js +0 -2
  114. package/dist/templates/react-component-js/files/test.js.map +1 -1
  115. package/dist/templates/react-component-js/index.js +0 -21
  116. package/dist/templates/react-component-js/index.js.map +1 -1
  117. package/dist/templates/react-context/files/composition.js +0 -2
  118. package/dist/templates/react-context/files/composition.js.map +1 -1
  119. package/dist/templates/react-context/files/context-provider.js +0 -2
  120. package/dist/templates/react-context/files/context-provider.js.map +1 -1
  121. package/dist/templates/react-context/files/context.js +0 -2
  122. package/dist/templates/react-context/files/context.js.map +1 -1
  123. package/dist/templates/react-context/files/docs.js +0 -2
  124. package/dist/templates/react-context/files/docs.js.map +1 -1
  125. package/dist/templates/react-context/files/index-file.js +0 -2
  126. package/dist/templates/react-context/files/index-file.js.map +1 -1
  127. package/dist/templates/react-context/files/test.js +0 -2
  128. package/dist/templates/react-context/files/test.js.map +1 -1
  129. package/dist/templates/react-context/index.js +0 -19
  130. package/dist/templates/react-context/index.js.map +1 -1
  131. package/dist/templates/react-env/files/aspect.js +0 -1
  132. package/dist/templates/react-env/files/aspect.js.map +1 -1
  133. package/dist/templates/react-env/files/doc.js +0 -1
  134. package/dist/templates/react-env/files/doc.js.map +1 -1
  135. package/dist/templates/react-env/files/index.js +0 -1
  136. package/dist/templates/react-env/files/index.js.map +1 -1
  137. package/dist/templates/react-env/files/jest.config.js +0 -1
  138. package/dist/templates/react-env/files/jest.config.js.map +1 -1
  139. package/dist/templates/react-env/files/main.runtime.js +0 -1
  140. package/dist/templates/react-env/files/main.runtime.js.map +1 -1
  141. package/dist/templates/react-env/files/preview.runtime.js +0 -1
  142. package/dist/templates/react-env/files/preview.runtime.js.map +1 -1
  143. package/dist/templates/react-env/files/typescript/styles.js +0 -1
  144. package/dist/templates/react-env/files/typescript/styles.js.map +1 -1
  145. package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -1
  146. package/dist/templates/react-env/files/typescript/ts-transformer.js.map +1 -1
  147. package/dist/templates/react-env/files/typescript/typescript.config.js +0 -1
  148. package/dist/templates/react-env/files/typescript/typescript.config.js.map +1 -1
  149. package/dist/templates/react-env/files/webpack.config.js +0 -1
  150. package/dist/templates/react-env/files/webpack.config.js.map +1 -1
  151. package/dist/templates/react-env/index.js +0 -31
  152. package/dist/templates/react-env/index.js.map +1 -1
  153. package/dist/templates/react-hook/files/component.js +0 -2
  154. package/dist/templates/react-hook/files/component.js.map +1 -1
  155. package/dist/templates/react-hook/files/composition.js +0 -2
  156. package/dist/templates/react-hook/files/composition.js.map +1 -1
  157. package/dist/templates/react-hook/files/docs.js +0 -2
  158. package/dist/templates/react-hook/files/docs.js.map +1 -1
  159. package/dist/templates/react-hook/files/index-file.js +0 -2
  160. package/dist/templates/react-hook/files/index-file.js.map +1 -1
  161. package/dist/templates/react-hook/files/index-file.spec.js +0 -6
  162. package/dist/templates/react-hook/files/index-file.spec.js.map +1 -1
  163. package/dist/templates/react-hook/files/test.js +0 -2
  164. package/dist/templates/react-hook/files/test.js.map +1 -1
  165. package/dist/templates/react-hook/index.js +0 -16
  166. package/dist/templates/react-hook/index.js.map +1 -1
  167. package/dist/templates/react-workspace/index.js +2 -6
  168. package/dist/templates/react-workspace/index.js.map +1 -1
  169. package/dist/templates/react-workspace-analytics/index.js +0 -5
  170. package/dist/templates/react-workspace-analytics/index.js.map +1 -1
  171. package/dist/templates/react-workspace-app/index.js +2 -13
  172. package/dist/templates/react-workspace-app/index.js.map +1 -1
  173. package/dist/templates/react-workspace-blog/index.js +0 -5
  174. package/dist/templates/react-workspace-blog/index.js.map +1 -1
  175. package/dist/templates/react-workspace-data-fetching/index.js +0 -5
  176. package/dist/templates/react-workspace-data-fetching/index.js.map +1 -1
  177. package/dist/templates/react-workspace-deprecated/index.js +0 -5
  178. package/dist/templates/react-workspace-deprecated/index.js.map +1 -1
  179. package/dist/templates/react-workspace-design-system/index.js +0 -5
  180. package/dist/templates/react-workspace-design-system/index.js.map +1 -1
  181. package/dist/templates/react-workspace-lib/index.js +0 -5
  182. package/dist/templates/react-workspace-lib/index.js.map +1 -1
  183. package/dist/templates/react-workspace-wiki/index.js +0 -5
  184. package/dist/templates/react-workspace-wiki/index.js.map +1 -1
  185. package/dist/templates/workspace-common/constants.js.map +1 -1
  186. package/dist/templates/workspace-common/files/eslint-config.js.map +1 -1
  187. package/dist/templates/workspace-common/files/git-ignore.js +0 -1
  188. package/dist/templates/workspace-common/files/git-ignore.js.map +1 -1
  189. package/dist/templates/workspace-common/files/launch-json.js +0 -2
  190. package/dist/templates/workspace-common/files/launch-json.js.map +1 -1
  191. package/dist/templates/workspace-common/files/prettier-config.js.map +1 -1
  192. package/dist/templates/workspace-common/files/readme-file.js +0 -1
  193. package/dist/templates/workspace-common/files/readme-file.js.map +1 -1
  194. package/dist/templates/workspace-common/files/ts-config.js.map +1 -1
  195. package/dist/templates/workspace-common/files/types/asset.js.map +1 -1
  196. package/dist/templates/workspace-common/files/types/style.js.map +1 -1
  197. package/dist/templates/workspace-common/files/workspace-config.js +0 -14
  198. package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
  199. package/dist/templates/workspace-common/generate-files.js +0 -29
  200. package/dist/templates/workspace-common/generate-files.js.map +1 -1
  201. package/dist/templates/workspace-common/index.js +0 -3
  202. package/dist/templates/workspace-common/index.js.map +1 -1
  203. package/dist/webpack/html.js +3 -2
  204. package/dist/webpack/html.js.map +1 -1
  205. package/dist/webpack/index.js +0 -3
  206. package/dist/webpack/index.js.map +1 -1
  207. package/dist/webpack/overlay/formatWebpackMessages.js +26 -37
  208. package/dist/webpack/overlay/formatWebpackMessages.js.map +1 -1
  209. package/dist/webpack/overlay/launchEditorEndpoint.js +2 -2
  210. package/dist/webpack/overlay/launchEditorEndpoint.js.map +1 -1
  211. package/dist/webpack/overlay/refreshOverlayInterop.js +1 -3
  212. package/dist/webpack/overlay/refreshOverlayInterop.js.map +1 -1
  213. package/dist/webpack/overlay/webpackHotDevClient.js +54 -71
  214. package/dist/webpack/overlay/webpackHotDevClient.js.map +1 -1
  215. package/dist/webpack/postcss.config.js +6 -3
  216. package/dist/webpack/postcss.config.js.map +1 -1
  217. package/dist/webpack/webpack.config.base.js +28 -53
  218. package/dist/webpack/webpack.config.base.js.map +1 -1
  219. package/dist/webpack/webpack.config.base.prod.js +10 -14
  220. package/dist/webpack/webpack.config.base.prod.js.map +1 -1
  221. package/dist/webpack/webpack.config.component.dev.js +10 -17
  222. package/dist/webpack/webpack.config.component.dev.js.map +1 -1
  223. package/dist/webpack/webpack.config.component.prod.js +3 -6
  224. package/dist/webpack/webpack.config.component.prod.js.map +1 -1
  225. package/dist/webpack/webpack.config.env.dev.js +5 -5
  226. package/dist/webpack/webpack.config.env.dev.js.map +1 -1
  227. package/dist/webpack/webpack.config.env.template.js +0 -1
  228. package/dist/webpack/webpack.config.env.template.js.map +1 -1
  229. package/{overview-1666312873430.js → overview-1666496165706.js} +0 -0
  230. package/package-tar/teambit-react-0.0.882.tgz +0 -0
  231. package/package.json +30 -30
  232. package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
  233. package/artifacts/env-template/public/peers.d8a0e658db2c8c4cd6c0.js +0 -1
  234. package/artifacts/env-template/public/static/css/770.a0238c25.css +0 -1
  235. package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
  236. package/package-tar/teambit-react-0.0.880.tgz +0 -0
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.contextFile = void 0;
7
-
8
7
  const contextFile = context => {
9
8
  const {
10
9
  name,
@@ -27,7 +26,6 @@ export const ${Name}Context = createContext<${Name}ContextType>({
27
26
  `
28
27
  };
29
28
  };
30
-
31
29
  exports.contextFile = contextFile;
32
30
 
33
31
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["contextFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["context.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const contextFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}-context.tsx`,\n content: `import { createContext } from 'react';\n\nexport type ${Name}ContextType = {\n /**\n * primary color of theme.\n */\n color?: string;\n};\n\nexport const ${Name}Context = createContext<${Name}ContextType>({\n color: 'aqua'\n});\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,WAAW,GAAIC,OAAD,IAA+B;EACxD,MAAM;IAAEC,IAAF;IAAQC,cAAc,EAAEC;EAAxB,IAAiCH,OAAvC;EACA,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,cADjB;IAELI,OAAO,EAAG;AACd;AACA,cAAcF,IAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK,2BAA0BA,IAAK;AACnD;AACA;AACA;EAdS,CAAP;AAgBD,CAlBM"}
1
+ {"version":3,"names":["contextFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["context.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const contextFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}-context.tsx`,\n content: `import { createContext } from 'react';\n\nexport type ${Name}ContextType = {\n /**\n * primary color of theme.\n */\n color?: string;\n};\n\nexport const ${Name}Context = createContext<${Name}ContextType>({\n color: 'aqua'\n});\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,WAAW,GAAIC,OAAyB,IAAK;EACxD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,cAAa;IACnCI,OAAO,EAAG;AACd;AACA,cAAcF,IAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK,2BAA0BA,IAAK;AACnD;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docsFile = void 0;
7
-
8
7
  const docsFile = context => {
9
8
  const {
10
9
  name,
@@ -56,7 +55,6 @@ Change the color to see the text change:
56
55
  `
57
56
  };
58
57
  };
59
-
60
58
  exports.docsFile = docsFile;
61
59
 
62
60
  //# sourceMappingURL=docs.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}-context.docs.mdx`,\n content: `---\ndescription: ${Name} context.\nlabels: ['context']\n---\n\nimport { ${Name}Context } from './${name}-context';\nimport { ${Name}Provider } from './${name}-context-provider';\nimport { MockComponent } from './${name}-context.composition';\n\n## React Theme Context\n\nThis is a simple [React Context](https://reactjs.org/docs/context.html) shared as a Bit component.\nUse this component to apply a theme as a context to set on it's children.\n\n### Component usage\n\n\\`\\`\\`tsx\n() => {\nimport React, { useContext } from 'react';\nimport { ThemeProvider } from './theme-context-provider';\nimport { ThemeContext } from './theme-context';\n\n<${Name}Provider color=\"blue\">\n // My lovely children now get a theme!\n <MockComponent />\n</${Name}Provider>;\n\\`\\`\\`\n\n### Using props to customize the theme\n\nChange the color to see the text change:\n\n\\`\\`\\`tsx live\n() => {\n return (\n <${Name}Provider color=\"red\">\n <MockComponent />\n </${Name}Provider>\n );\n};\n\\`\\`\\`\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAD,IAA+B;EACrD,MAAM;IAAEC,IAAF;IAAQC,cAAc,EAAEC;EAAxB,IAAiCH,OAAvC;EAEA,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,mBADjB;IAELI,OAAO,EAAG;AACd,eAAeF,IAAK;AACpB;AACA;AACA;AACA,WAAWA,IAAK,qBAAoBF,IAAK;AACzC,WAAWE,IAAK,sBAAqBF,IAAK;AAC1C,mCAAmCA,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAGE,IAAK;AACR;AACA;AACA,IAAIA,IAAK;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAK;AACZ;AACA,QAAQA,IAAK;AACb;AACA;AACA;AACA;EA3CS,CAAP;AA6CD,CAhDM"}
1
+ {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}-context.docs.mdx`,\n content: `---\ndescription: ${Name} context.\nlabels: ['context']\n---\n\nimport { ${Name}Context } from './${name}-context';\nimport { ${Name}Provider } from './${name}-context-provider';\nimport { MockComponent } from './${name}-context.composition';\n\n## React Theme Context\n\nThis is a simple [React Context](https://reactjs.org/docs/context.html) shared as a Bit component.\nUse this component to apply a theme as a context to set on it's children.\n\n### Component usage\n\n\\`\\`\\`tsx\n() => {\nimport React, { useContext } from 'react';\nimport { ThemeProvider } from './theme-context-provider';\nimport { ThemeContext } from './theme-context';\n\n<${Name}Provider color=\"blue\">\n // My lovely children now get a theme!\n <MockComponent />\n</${Name}Provider>;\n\\`\\`\\`\n\n### Using props to customize the theme\n\nChange the color to see the text change:\n\n\\`\\`\\`tsx live\n() => {\n return (\n <${Name}Provider color=\"red\">\n <MockComponent />\n </${Name}Provider>\n );\n};\n\\`\\`\\`\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,mBAAkB;IACxCI,OAAO,EAAG;AACd,eAAeF,IAAK;AACpB;AACA;AACA;AACA,WAAWA,IAAK,qBAAoBF,IAAK;AACzC,WAAWE,IAAK,sBAAqBF,IAAK;AAC1C,mCAAmCA,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAGE,IAAK;AACR;AACA;AACA,IAAIA,IAAK;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAK;AACZ;AACA,QAAQA,IAAK;AACb;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = void 0;
7
-
8
7
  const indexFile = context => {
9
8
  const {
10
9
  name,
@@ -19,7 +18,6 @@ export type { ${Name}ProviderProps } from './${name}-context-provider';
19
18
  `
20
19
  };
21
20
  };
22
-
23
21
  exports.indexFile = indexFile;
24
22
 
25
23
  //# sourceMappingURL=index-file.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name}Context } from './${name}-context';\nexport type { ${Name}ContextType } from './${name}-context';\nexport { ${Name}Provider } from './${name}-context-provider';\nexport type { ${Name}ProviderProps } from './${name}-context-provider';\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,SAAS,GAAIC,OAAD,IAA+B;EACtD,MAAM;IAAEC,IAAF;IAAQC,cAAc,EAAEC;EAAxB,IAAiCH,OAAvC;EAEA,OAAO;IACLI,YAAY,EAAE,UADT;IAELC,OAAO,EAAG,YAAWF,IAAK,qBAAoBF,IAAK;AACvD,gBAAgBE,IAAK,yBAAwBF,IAAK;AAClD,WAAWE,IAAK,sBAAqBF,IAAK;AAC1C,gBAAgBE,IAAK,2BAA0BF,IAAK;AACpD;EANS,CAAP;AAQD,CAXM"}
1
+ {"version":3,"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name}Context } from './${name}-context';\nexport type { ${Name}ContextType } from './${name}-context';\nexport { ${Name}Provider } from './${name}-context-provider';\nexport type { ${Name}ProviderProps } from './${name}-context-provider';\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,SAAS,GAAIC,OAAyB,IAAK;EACtD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,YAAWF,IAAK,qBAAoBF,IAAK;AACvD,gBAAgBE,IAAK,yBAAwBF,IAAK;AAClD,WAAWE,IAAK,sBAAqBF,IAAK;AAC1C,gBAAgBE,IAAK,2BAA0BF,IAAK;AACpD;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.testFile = void 0;
7
-
8
7
  const testFile = context => {
9
8
  const {
10
9
  name
@@ -22,7 +21,6 @@ it('should render the button in the color blue', () => {
22
21
  `
23
22
  };
24
23
  };
25
-
26
24
  exports.testFile = testFile;
27
25
 
28
26
  //# sourceMappingURL=test.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["testFile","context","name","relativePath","content"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name } = context;\n\n return {\n relativePath: `${name}-context.spec.tsx`,\n content: `import { BasicThemeUsage } from './${name}-context.composition';\nimport { render } from '@testing-library/react';\n\nit('should render the button in the color blue', () => {\n const { getByText } = render(<BasicThemeUsage />);\n const rendered = getByText('this should be blue');\n expect(rendered).toBeTruthy();\n});\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAD,IAA+B;EACrD,MAAM;IAAEC;EAAF,IAAWD,OAAjB;EAEA,OAAO;IACLE,YAAY,EAAG,GAAED,IAAK,mBADjB;IAELE,OAAO,EAAG,sCAAqCF,IAAK;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAVS,CAAP;AAYD,CAfM"}
1
+ {"version":3,"names":["testFile","context","name","relativePath","content"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name } = context;\n\n return {\n relativePath: `${name}-context.spec.tsx`,\n content: `import { BasicThemeUsage } from './${name}-context.composition';\nimport { render } from '@testing-library/react';\n\nit('should render the button in the color blue', () => {\n const { getByText } = render(<BasicThemeUsage />);\n const rendered = getByText('this should be blue');\n expect(rendered).toBeTruthy();\n});\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC;EAAK,CAAC,GAAGD,OAAO;EAExB,OAAO;IACLE,YAAY,EAAG,GAAED,IAAK,mBAAkB;IACxCE,OAAO,EAAG,sCAAqCF,IAAK;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,67 +4,48 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.reactContext = void 0;
7
-
8
7
  function _context() {
9
8
  const data = require("./files/context");
10
-
11
9
  _context = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _contextProvider() {
19
15
  const data = require("./files/context-provider");
20
-
21
16
  _contextProvider = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _composition() {
29
22
  const data = require("./files/composition");
30
-
31
23
  _composition = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _docs() {
39
29
  const data = require("./files/docs");
40
-
41
30
  _docs = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _test() {
49
36
  const data = require("./files/test");
50
-
51
37
  _test = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  function _indexFile() {
59
43
  const data = require("./files/index-file");
60
-
61
44
  _indexFile = function () {
62
45
  return data;
63
46
  };
64
-
65
47
  return data;
66
48
  }
67
-
68
49
  const reactContext = {
69
50
  name: 'react-context',
70
51
  description: 'a react context component',
@@ -1 +1 @@
1
- {"version":3,"names":["reactContext","name","description","generateFiles","context","indexFile","contextFile","contextProviderFile","compositionFile","docsFile","testFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { contextFile } from './files/context';\nimport { contextProviderFile } from './files/context-provider';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactContext: ComponentTemplate = {\n name: 'react-context',\n description: 'a react context component',\n\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n contextFile(context),\n contextProviderFile(context),\n compositionFile(context),\n docsFile(context),\n testFile(context),\n ];\n },\n config: {\n 'teambit.react/react': {},\n 'teambit.envs/envs': {\n env: 'teambit.react/react',\n },\n },\n};\n"],"mappings":";;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,YAA+B,GAAG;EAC7CC,IAAI,EAAE,eADuC;EAE7CC,WAAW,EAAE,2BAFgC;EAI7CC,aAAa,EAAGC,OAAD,IAA+B;IAC5C,OAAO,CACL,IAAAC,sBAAA,EAAUD,OAAV,CADK,EAEL,IAAAE,sBAAA,EAAYF,OAAZ,CAFK,EAGL,IAAAG,sCAAA,EAAoBH,OAApB,CAHK,EAIL,IAAAI,8BAAA,EAAgBJ,OAAhB,CAJK,EAKL,IAAAK,gBAAA,EAASL,OAAT,CALK,EAML,IAAAM,gBAAA,EAASN,OAAT,CANK,CAAP;EAQD,CAb4C;EAc7CO,MAAM,EAAE;IACN,uBAAuB,EADjB;IAEN,qBAAqB;MACnBC,GAAG,EAAE;IADc;EAFf;AAdqC,CAAxC"}
1
+ {"version":3,"names":["reactContext","name","description","generateFiles","context","indexFile","contextFile","contextProviderFile","compositionFile","docsFile","testFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { contextFile } from './files/context';\nimport { contextProviderFile } from './files/context-provider';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactContext: ComponentTemplate = {\n name: 'react-context',\n description: 'a react context component',\n\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n contextFile(context),\n contextProviderFile(context),\n compositionFile(context),\n docsFile(context),\n testFile(context),\n ];\n },\n config: {\n 'teambit.react/react': {},\n 'teambit.envs/envs': {\n env: 'teambit.react/react',\n },\n },\n};\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAA+B,GAAG;EAC7CC,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE,2BAA2B;EAExCC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL,IAAAC,sBAAS,EAACD,OAAO,CAAC,EAClB,IAAAE,sBAAW,EAACF,OAAO,CAAC,EACpB,IAAAG,sCAAmB,EAACH,OAAO,CAAC,EAC5B,IAAAI,8BAAe,EAACJ,OAAO,CAAC,EACxB,IAAAK,gBAAQ,EAACL,OAAO,CAAC,EACjB,IAAAM,gBAAQ,EAACN,OAAO,CAAC,CAClB;EACH,CAAC;EACDO,MAAM,EAAE;IACN,qBAAqB,EAAE,CAAC,CAAC;IACzB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.aspectFile = aspectFile;
7
-
8
7
  function aspectFile({
9
8
  namePascalCase: Name,
10
9
  componentId
@@ -1 +1 @@
1
- {"version":3,"names":["aspectFile","namePascalCase","Name","componentId"],"sources":["aspect.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${Name}Aspect = Aspect.create({\n id: '${componentId}',\n});\n`;\n}\n"],"mappings":";;;;;;;AAEO,SAASA,UAAT,CAAoB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAApB,EAA6E;EAClF,OAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CALE;AAMD"}
1
+ {"version":3,"names":["aspectFile","namePascalCase","Name","componentId"],"sources":["aspect.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${Name}Aspect = Aspect.create({\n id: '${componentId}',\n});\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAU,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAClF,OAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docFile = docFile;
7
-
8
7
  function docFile({
9
8
  name,
10
9
  componentId
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","name","componentId"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return `---\ndescription: 'A standard React component development environment'\nlabels: ['react', 'typescript', 'env', 'extension']\n---\n\n## Overview\n\nA customized version which extends the default React component development environment created by teambit.\n\nThis environment can be applied to all your components or a set of components via the command \\`bit env set <pattern or component_id> ${componentId}\\`, or under the variants of your \\`workspace.json\\` file.\nThat means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be\nexported and then shared and used in various projects which makes it easier to create standards when working with many teams.\n\n### Usage instructions\n\n#### Recommended usage:\n\nRun the command \\`bit env set <\"pattern\" or component_id> ${componentId}\\` where the pattern is a glob pattern to select multiple components. This will put the env\nconfig in your component's entry in the \\`.bitmap\\` file.\n\n:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc\n:::\n\n#### Alternative Usage\nUnder the **variant** section of your \\`workspace.json\\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \\`${name}.aspect.ts\\` file.\n\n\\`\\`\\`json\n{\n \"teambit.workspace/variants\": {\n \"{ui/**}, {pages/**}\": {\n \"${componentId}\": {}\n }\n }\n}\n\\`\\`\\`\n\nThis usage may be deprecated in future in favour of the recommended usage above\n## Runtime Configurations\n\nExtend the \\`main.runtime\\` file when you want to add custom configurations at runtime.\n\n### Compilation\n\nBy default, Component compilation is done with the TypeScript compiler. Target format is \\`ES2015\\` which\nsupports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \\`tsconfig.json\\` file to add your own compiler options which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`json\n{\n \"compilerOptions\": {\n \"target\": \"es2017\",\n \"module\": \"es2015\",\n \"moduleResolution\": \"node\",\n \"lib\": [\"es2017\", \"dom\"],\n \"experimentalDecorators\": true,\n \"esModuleInterop\": true,\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"allowJs\": true,\n \"baseUrl\": \".\",\n \"jsx\": \"react\"\n }\n}\n\\`\\`\\`\n\n### Testing\n\nComponent testing is done through [Jest](https://jestjs.io/) with the default \\`teambit.react/react\\` environment. You can modify the \\`jestconfig.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\nTo Override the Jest config to ignore transpiling from specific folders add this to the \\`jestconfig.js\\` file:\n\n\\`\\`\\`js\nconst reactJestConfig = require('@teambit/react/jest/jest.config');\nmodule.exports = {\n ...reactJestConfig,\n transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']\n};\n\\`\\`\\`\n\n### Webpack\n\nBit uses webpack 5 to bundle components. You can modify the \\`webpack.config.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`ts\nmodule.exports = {\n module: {\n // add your custom rules here\n rules: []\n }\n};\n\\`\\`\\`\n\n### ESLint\n\nBit uses ESLint to lint your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use ESLint:\n\n\\`\\`\\`bash\nbit lint\nbit lint --fix\n\\`\\`\\`\n\n### Formatting\n\nBit uses Prettier to format your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use Prettier:\n\n\\`\\`\\`bash\nbit format --check\nbit format\n\\`\\`\\`\n\n### Dependencies\n\nOverride the default dependencies in the \\`${name}.main.runtime\\` file to include react types of a different version for example.\n\n\\`\\`\\`ts\nreact.overrideDependencies({\n devDependencies: {\n '@types/react': '17.0.3'\n }\n});\n\\`\\`\\`\n\n## Preview Configurations\n\nExtend the \\`${name}.preview.runtime\\` file when you want to add your own customizations only for previewing in the Bit UI.\n\n### Adding a Theme\n\nA custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.\n\nExample:\n\n\\`\\`\\`ts\nreact.registerProvider([ThemeCompositions]);\n`;\n}\n"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiB;EAAEC,IAAF;EAAQC;AAAR,CAAjB,EAA0D;EAC/D,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wIAAwIA,WAAY;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4DA,WAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmLD,IAAK;AACxL;AACA;AACA;AACA;AACA;AACA,SAASC,WAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+ED,IAAK;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmFA,IAAK;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6CA,IAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA5KE;AA6KD"}
1
+ {"version":3,"names":["docFile","name","componentId"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return `---\ndescription: 'A standard React component development environment'\nlabels: ['react', 'typescript', 'env', 'extension']\n---\n\n## Overview\n\nA customized version which extends the default React component development environment created by teambit.\n\nThis environment can be applied to all your components or a set of components via the command \\`bit env set <pattern or component_id> ${componentId}\\`, or under the variants of your \\`workspace.json\\` file.\nThat means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be\nexported and then shared and used in various projects which makes it easier to create standards when working with many teams.\n\n### Usage instructions\n\n#### Recommended usage:\n\nRun the command \\`bit env set <\"pattern\" or component_id> ${componentId}\\` where the pattern is a glob pattern to select multiple components. This will put the env\nconfig in your component's entry in the \\`.bitmap\\` file.\n\n:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc\n:::\n\n#### Alternative Usage\nUnder the **variant** section of your \\`workspace.json\\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \\`${name}.aspect.ts\\` file.\n\n\\`\\`\\`json\n{\n \"teambit.workspace/variants\": {\n \"{ui/**}, {pages/**}\": {\n \"${componentId}\": {}\n }\n }\n}\n\\`\\`\\`\n\nThis usage may be deprecated in future in favour of the recommended usage above\n## Runtime Configurations\n\nExtend the \\`main.runtime\\` file when you want to add custom configurations at runtime.\n\n### Compilation\n\nBy default, Component compilation is done with the TypeScript compiler. Target format is \\`ES2015\\` which\nsupports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \\`tsconfig.json\\` file to add your own compiler options which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`json\n{\n \"compilerOptions\": {\n \"target\": \"es2017\",\n \"module\": \"es2015\",\n \"moduleResolution\": \"node\",\n \"lib\": [\"es2017\", \"dom\"],\n \"experimentalDecorators\": true,\n \"esModuleInterop\": true,\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"allowJs\": true,\n \"baseUrl\": \".\",\n \"jsx\": \"react\"\n }\n}\n\\`\\`\\`\n\n### Testing\n\nComponent testing is done through [Jest](https://jestjs.io/) with the default \\`teambit.react/react\\` environment. You can modify the \\`jestconfig.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\nTo Override the Jest config to ignore transpiling from specific folders add this to the \\`jestconfig.js\\` file:\n\n\\`\\`\\`js\nconst reactJestConfig = require('@teambit/react/jest/jest.config');\nmodule.exports = {\n ...reactJestConfig,\n transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']\n};\n\\`\\`\\`\n\n### Webpack\n\nBit uses webpack 5 to bundle components. You can modify the \\`webpack.config.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`ts\nmodule.exports = {\n module: {\n // add your custom rules here\n rules: []\n }\n};\n\\`\\`\\`\n\n### ESLint\n\nBit uses ESLint to lint your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use ESLint:\n\n\\`\\`\\`bash\nbit lint\nbit lint --fix\n\\`\\`\\`\n\n### Formatting\n\nBit uses Prettier to format your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use Prettier:\n\n\\`\\`\\`bash\nbit format --check\nbit format\n\\`\\`\\`\n\n### Dependencies\n\nOverride the default dependencies in the \\`${name}.main.runtime\\` file to include react types of a different version for example.\n\n\\`\\`\\`ts\nreact.overrideDependencies({\n devDependencies: {\n '@types/react': '17.0.3'\n }\n});\n\\`\\`\\`\n\n## Preview Configurations\n\nExtend the \\`${name}.preview.runtime\\` file when you want to add your own customizations only for previewing in the Bit UI.\n\n### Adding a Theme\n\nA custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.\n\nExample:\n\n\\`\\`\\`ts\nreact.registerProvider([ThemeCompositions]);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAAC;EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAC/D,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wIAAwIA,WAAY;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4DA,WAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmLD,IAAK;AACxL;AACA;AACA;AACA;AACA;AACA,SAASC,WAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+ED,IAAK;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmFA,IAAK;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6CA,IAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = indexFile;
7
-
8
7
  function indexFile({
9
8
  namePascalCase: Name,
10
9
  name
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","Name","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { ${Name}Aspect } from './${name}.aspect';\n\nexport type { ${Name}Main } from './${name}.main.runtime';\nexport default ${Name}Aspect;\nexport { ${Name}Aspect };\n`;\n}\n"],"mappings":";;;;;;;AAEO,SAASA,SAAT,CAAmB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAAnB,EAAqE;EAC1E,OAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CALE;AAMD"}
1
+ {"version":3,"names":["indexFile","namePascalCase","Name","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { ${Name}Aspect } from './${name}.aspect';\n\nexport type { ${Name}Main } from './${name}.main.runtime';\nexport default ${Name}Aspect;\nexport { ${Name}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAAS,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAC1E,OAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.jestConfigFile = jestConfigFile;
7
-
8
7
  function jestConfigFile() {
9
8
  return `
10
9
  // Override the Jest config to ignore transpiling from specific folders
@@ -1 +1 @@
1
- {"version":3,"names":["jestConfigFile"],"sources":["jest.config.ts"],"sourcesContent":["export function jestConfigFile() {\n return `\n // Override the Jest config to ignore transpiling from specific folders\n // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js\n\n // const reactJestConfig = require('@teambit/react/jest/jest.config');\n // uncomment the line below and install the package if you want to use this function\n // const {\n // generateNodeModulesPattern,\n // } = require('@teambit/dependencies.modules.packages-excluder');\n // const packagesToExclude = ['@my-org', 'my-package-name'];\n\n // module.exports = {\n // ...reactJestConfig,\n // transformIgnorePatterns: [\n // '^.+\\\\.module\\\\.(css|sass|scss)$',\n // generateNodeModulesPattern({ packages: packagesToExclude }),\n // ],\n // };\n `;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,cAAT,GAA0B;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAlBE;AAmBD"}
1
+ {"version":3,"names":["jestConfigFile"],"sources":["jest.config.ts"],"sourcesContent":["export function jestConfigFile() {\n return `\n // Override the Jest config to ignore transpiling from specific folders\n // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js\n\n // const reactJestConfig = require('@teambit/react/jest/jest.config');\n // uncomment the line below and install the package if you want to use this function\n // const {\n // generateNodeModulesPattern,\n // } = require('@teambit/dependencies.modules.packages-excluder');\n // const packagesToExclude = ['@my-org', 'my-package-name'];\n\n // module.exports = {\n // ...reactJestConfig,\n // transformIgnorePatterns: [\n // '^.+\\\\.module\\\\.(css|sass|scss)$',\n // generateNodeModulesPattern({ packages: packagesToExclude }),\n // ],\n // };\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,cAAc,GAAG;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mainRuntimeFile = mainRuntimeFile;
7
-
8
7
  function mainRuntimeFile({
9
8
  namePascalCase: Name,
10
9
  name
@@ -1 +1 @@
1
- {"version":3,"names":["mainRuntimeFile","namePascalCase","Name","name"],"sources":["main.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { ReactAspect, ReactMain, UseTypescriptModifiers } from '@teambit/react';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformer\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [ReactAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n static async provider([react, envs]: [ReactMain, EnvsMain]) {\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n const ${Name}Env = react.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // react.useTypescript(tsModifiers), // note: this cannot be used in conjunction with react.overrideCompiler\n // react.useWebpack(webpackModifiers),\n // react.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n //react.useEslint({\n // transformers: [\n // (config) => {\n // config.setRule('no-console', ['error']);\n // return config;\n // }\n // ]\n //}),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n //react.usePrettier({\n // transformers: [\n // (config) => {\n // config.setKey('tabWidth', 2);\n // return config;\n // }\n // ]\n //}),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n react.overrideDependencies({\n devDependencies: {\n // '@types/react': '17.0.3'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAAzB,EAA2E;EAChF,OAAQ;AACV;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAzFE;AA0FD"}
1
+ {"version":3,"names":["mainRuntimeFile","namePascalCase","Name","name"],"sources":["main.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { ReactAspect, ReactMain, UseTypescriptModifiers } from '@teambit/react';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformer\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [ReactAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n static async provider([react, envs]: [ReactMain, EnvsMain]) {\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n const ${Name}Env = react.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // react.useTypescript(tsModifiers), // note: this cannot be used in conjunction with react.overrideCompiler\n // react.useWebpack(webpackModifiers),\n // react.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n //react.useEslint({\n // transformers: [\n // (config) => {\n // config.setRule('no-console', ['error']);\n // return config;\n // }\n // ]\n //}),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n //react.usePrettier({\n // transformers: [\n // (config) => {\n // config.setKey('tabWidth', 2);\n // return config;\n // }\n // ]\n //}),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n react.overrideDependencies({\n devDependencies: {\n // '@types/react': '17.0.3'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAe,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAChF,OAAQ;AACV;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.previewRuntimeFile = previewRuntimeFile;
7
-
8
7
  function previewRuntimeFile({
9
8
  namePascalCase: Name,
10
9
  nameCamelCase: nameCamel,
@@ -1 +1 @@
1
- {"version":3,"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"sources":["preview.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"],"mappings":";;;;;;;AAEO,SAASA,kBAAT,CAA4B;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC,aAAa,EAAEC,SAAvC;EAAkDC;AAAlD,CAA5B,EAAwG;EAC7G,OAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAtBE;AAuBD"}
1
+ {"version":3,"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"sources":["preview.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react';\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,kBAAkB,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC,aAAa,EAAEC,SAAS;EAAEC;AAAuB,CAAC,EAAE;EAC7G,OAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.globalStylesFile = globalStylesFile;
7
-
8
7
  function globalStylesFile() {
9
8
  return `
10
9
  /*
@@ -1 +1 @@
1
- {"version":3,"names":["globalStylesFile"],"sources":["styles.ts"],"sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,gBAAT,GAA4B;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAJE;AAKD"}
1
+ {"version":3,"names":["globalStylesFile"],"sources":["styles.ts"],"sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgB,GAAG;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAAG;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tsTransformerFile = tsTransformerFile;
7
-
8
7
  function tsTransformerFile() {
9
8
  return `
10
9
  import * as path from 'path';
@@ -1 +1 @@
1
- {"version":3,"names":["tsTransformerFile"],"sources":["ts-transformer.ts"],"sourcesContent":["export function tsTransformerFile() {\n return `\n import * as path from 'path';\nimport {\n TsConfigTransformer,\n TypescriptConfigMutator,\n} from \"@teambit/typescript\";\n\nconst tsConfig = require('./tsconfig.json');\n\nexport const commonTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])\n newConfig.mergeTsConfig(tsConfig);\n // Some examples of other built in mutator functions:\n //newConfig.addExclude(['someExclude']);\n //newConfig.setCompileJs(true)\n return newConfig;\n};\n\n/**\n * Transformation for the dev config only\n * @param config\n * @param context\n * @returns\n */\nexport const devConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator,\n) => {\n const newConfig = commonTransformer(config, {});\n return newConfig;\n};\n\n/**\n * Transformation for the build only\n * @param config\n * @param context\n * @returns\n */\nexport const buildConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = commonTransformer(config, {});\n newConfig.mergeTsConfig(tsConfig);\n return newConfig;\n};\n\n`;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,iBAAT,GAA6B;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA/CE;AAgDD"}
1
+ {"version":3,"names":["tsTransformerFile"],"sources":["ts-transformer.ts"],"sourcesContent":["export function tsTransformerFile() {\n return `\n import * as path from 'path';\nimport {\n TsConfigTransformer,\n TypescriptConfigMutator,\n} from \"@teambit/typescript\";\n\nconst tsConfig = require('./tsconfig.json');\n\nexport const commonTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])\n newConfig.mergeTsConfig(tsConfig);\n // Some examples of other built in mutator functions:\n //newConfig.addExclude(['someExclude']);\n //newConfig.setCompileJs(true)\n return newConfig;\n};\n\n/**\n * Transformation for the dev config only\n * @param config\n * @param context\n * @returns\n */\nexport const devConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator,\n) => {\n const newConfig = commonTransformer(config, {});\n return newConfig;\n};\n\n/**\n * Transformation for the build only\n * @param config\n * @param context\n * @returns\n */\nexport const buildConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = commonTransformer(config, {});\n newConfig.mergeTsConfig(tsConfig);\n return newConfig;\n};\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiB,GAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.typescriptConfigFile = typescriptConfigFile;
7
-
8
7
  function typescriptConfigFile() {
9
8
  return `{
10
9
  // add your compiler options here
@@ -1 +1 @@
1
- {"version":3,"names":["typescriptConfigFile"],"sources":["typescript.config.ts"],"sourcesContent":["export function typescriptConfigFile() {\n return `{\n // add your compiler options here\n\n \"compilerOptions\": {\n // \"target\": \"es2017\",\n // \"module\": \"es2015\",\n // \"moduleResolution\": \"node\",\n // \"lib\": [\"es2017\", \"dom\"],\n // \"experimentalDecorators\": true,\n // \"esModuleInterop\": true,\n // \"outDir\": \"dist\",\n // \"sourceMap\": true,\n // \"emitDecoratorMetadata\": true,\n // \"allowJs\": true,\n // \"baseUrl\": \".\",\n // \"jsx\": \"react\"\n }\n}\n`;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,oBAAT,GAAgC;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAlBE;AAmBD"}
1
+ {"version":3,"names":["typescriptConfigFile"],"sources":["typescript.config.ts"],"sourcesContent":["export function typescriptConfigFile() {\n return `{\n // add your compiler options here\n\n \"compilerOptions\": {\n // \"target\": \"es2017\",\n // \"module\": \"es2015\",\n // \"moduleResolution\": \"node\",\n // \"lib\": [\"es2017\", \"dom\"],\n // \"experimentalDecorators\": true,\n // \"esModuleInterop\": true,\n // \"outDir\": \"dist\",\n // \"sourceMap\": true,\n // \"emitDecoratorMetadata\": true,\n // \"allowJs\": true,\n // \"baseUrl\": \".\",\n // \"jsx\": \"react\"\n }\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,oBAAoB,GAAG;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.webpackConfigFile = webpackConfigFile;
7
-
8
7
  function webpackConfigFile() {
9
8
  return `
10
9
  import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';
@@ -1 +1 @@
1
- {"version":3,"names":["webpackConfigFile"],"sources":["webpack.config.ts"],"sourcesContent":["export function webpackConfigFile() {\n return `\n import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';\n\n /**\n * Transformation to apply for both preview and dev server\n * @param config\n * @param _context\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {\n // Merge config with the webpack.config.js file if you choose to import a module export format config.\n // config.merge([webpackConfig]);\n // config.addAliases({});\n // config.addModuleRule(youRuleHere);\n return config;\n }\n\n /**\n * Transformation for the preview only\n * @param config\n * @param context\n * @returns\n */\n export const previewConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n /**\n * Transformation for the dev server only\n * @param config\n * @param context\n * @returns\n */\n export const devServerConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n`;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,iBAAT,GAA6B;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA7CE;AA8CD"}
1
+ {"version":3,"names":["webpackConfigFile"],"sources":["webpack.config.ts"],"sourcesContent":["export function webpackConfigFile() {\n return `\n import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';\n\n /**\n * Transformation to apply for both preview and dev server\n * @param config\n * @param _context\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {\n // Merge config with the webpack.config.js file if you choose to import a module export format config.\n // config.merge([webpackConfig]);\n // config.addAliases({});\n // config.addModuleRule(youRuleHere);\n return config;\n }\n\n /**\n * Transformation for the preview only\n * @param config\n * @param context\n * @returns\n */\n export const previewConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n /**\n * Transformation for the dev server only\n * @param config\n * @param context\n * @returns\n */\n export const devServerConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiB,GAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -4,107 +4,76 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.reactEnvTemplate = void 0;
7
-
8
7
  function _index() {
9
8
  const data = require("./files/index");
10
-
11
9
  _index = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _doc() {
19
15
  const data = require("./files/doc");
20
-
21
16
  _doc = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _main() {
29
22
  const data = require("./files/main.runtime");
30
-
31
23
  _main = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _preview() {
39
29
  const data = require("./files/preview.runtime");
40
-
41
30
  _preview = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _aspect() {
49
36
  const data = require("./files/aspect");
50
-
51
37
  _aspect = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  function _webpack() {
59
43
  const data = require("./files/webpack.config");
60
-
61
44
  _webpack = function () {
62
45
  return data;
63
46
  };
64
-
65
47
  return data;
66
48
  }
67
-
68
49
  function _typescript() {
69
50
  const data = require("./files/typescript/typescript.config");
70
-
71
51
  _typescript = function () {
72
52
  return data;
73
53
  };
74
-
75
54
  return data;
76
55
  }
77
-
78
56
  function _styles() {
79
57
  const data = require("./files/typescript/styles");
80
-
81
58
  _styles = function () {
82
59
  return data;
83
60
  };
84
-
85
61
  return data;
86
62
  }
87
-
88
63
  function _tsTransformer() {
89
64
  const data = require("./files/typescript/ts-transformer");
90
-
91
65
  _tsTransformer = function () {
92
66
  return data;
93
67
  };
94
-
95
68
  return data;
96
69
  }
97
-
98
70
  function _jest() {
99
71
  const data = require("./files/jest.config");
100
-
101
72
  _jest = function () {
102
73
  return data;
103
74
  };
104
-
105
75
  return data;
106
76
  }
107
-
108
77
  const reactEnvTemplate = {
109
78
  name: 'react-env',
110
79
  description: 'customize the base React env with your configs and tools',
@@ -1 +1 @@
1
- {"version":3,"names":["reactEnvTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript/typescript.config';\nimport { globalStylesFile } from './files/typescript/styles';\nimport { tsTransformerFile } from './files/typescript/ts-transformer';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const reactEnvTemplate: ComponentTemplate = {\n name: 'react-env',\n description: 'customize the base React env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `typescript/styles.d.ts`,\n content: globalStylesFile(),\n },\n {\n relativePath: `typescript/ts-transformer.ts`,\n content: tsTransformerFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"],"mappings":";;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,gBAAmC,GAAG;EACjDC,IAAI,EAAE,WAD2C;EAEjDC,WAAW,EAAE,0DAFoC;EAGjDC,aAAa,EAAGC,OAAD,IAA+B;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UADhB;MAEEC,OAAO,EAAE,IAAAC,kBAAA,EAAUH,OAAV,CAFX;MAGEI,MAAM,EAAE;IAHV,CADK,EAML;MACEH,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WADhC;MAEEK,OAAO,EAAE,IAAAG,cAAA,EAAQL,OAAR;IAFX,CANK,EAUL;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBADhC;MAEEK,OAAO,EAAE,IAAAI,uBAAA,EAAgBN,OAAhB;IAFX,CAVK,EAcL;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,qBADhC;MAEEK,OAAO,EAAE,IAAAK,6BAAA,EAAmBP,OAAnB;IAFX,CAdK,EAkBL;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,YADhC;MAEEK,OAAO,EAAE,IAAAM,oBAAA,EAAWR,OAAX;IAFX,CAlBK,EAsBL;MACEC,YAAY,EAAG,iCADjB;MAEEC,OAAO,EAAE,IAAAO,4BAAA;IAFX,CAtBK,EA0BL;MACER,YAAY,EAAG,0BADjB;MAEEC,OAAO,EAAE,IAAAQ,kCAAA;IAFX,CA1BK,EA8BL;MACET,YAAY,EAAG,wBADjB;MAEEC,OAAO,EAAE,IAAAS,0BAAA;IAFX,CA9BK,EAkCL;MACEV,YAAY,EAAG,8BADjB;MAEEC,OAAO,EAAE,IAAAU,kCAAA;IAFX,CAlCK,EAsCL;MACEX,YAAY,EAAG,qBADjB;MAEEC,OAAO,EAAE,IAAAW,sBAAA;IAFX,CAtCK,CAAP;EA2CD,CA/CgD;EAgDjDC,MAAM,EAAE;IACN,oBAAoB,EADd;IAEN,qBAAqB;MACnBC,GAAG,EAAE;IADc;EAFf;AAhDyC,CAA5C"}
1
+ {"version":3,"names":["reactEnvTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript/typescript.config';\nimport { globalStylesFile } from './files/typescript/styles';\nimport { tsTransformerFile } from './files/typescript/ts-transformer';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const reactEnvTemplate: ComponentTemplate = {\n name: 'react-env',\n description: 'customize the base React env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `typescript/styles.d.ts`,\n content: globalStylesFile(),\n },\n {\n relativePath: `typescript/ts-transformer.ts`,\n content: tsTransformerFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAAmC,GAAG;EACjDC,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,0DAA0D;EACvEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,kBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WAAU;MACxCK,OAAO,EAAE,IAAAG,cAAO,EAACL,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBAAiB;MAC/CK,OAAO,EAAE,IAAAI,uBAAe,EAACN,OAAO;IAClC,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,qBAAoB;MAClDK,OAAO,EAAE,IAAAK,6BAAkB,EAACP,OAAO;IACrC,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,YAAW;MACzCK,OAAO,EAAE,IAAAM,oBAAU,EAACR,OAAO;IAC7B,CAAC,EACD;MACEC,YAAY,EAAG,iCAAgC;MAC/CC,OAAO,EAAE,IAAAO,4BAAiB;IAC5B,CAAC,EACD;MACER,YAAY,EAAG,0BAAyB;MACxCC,OAAO,EAAE,IAAAQ,kCAAoB;IAC/B,CAAC,EACD;MACET,YAAY,EAAG,wBAAuB;MACtCC,OAAO,EAAE,IAAAS,0BAAgB;IAC3B,CAAC,EACD;MACEV,YAAY,EAAG,8BAA6B;MAC5CC,OAAO,EAAE,IAAAU,kCAAiB;IAC5B,CAAC,EACD;MACEX,YAAY,EAAG,qBAAoB;MACnCC,OAAO,EAAE,IAAAW,sBAAc;IACzB,CAAC,CACF;EACH,CAAC;EACDC,MAAM,EAAE;IACN,kBAAkB,EAAE,CAAC,CAAC;IACtB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.componentFile = void 0;
7
-
8
7
  const componentFile = context => {
9
8
  const {
10
9
  name,
@@ -22,7 +21,6 @@ export function ${Name}() {
22
21
  `
23
22
  };
24
23
  };
25
-
26
24
  exports.componentFile = componentFile;
27
25
 
28
26
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["componentFile","context","name","nameCamelCase","Name","relativePath","content"],"sources":["component.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, nameCamelCase: Name } = context;\n return {\n relativePath: `${name}.tsx`,\n content: `import { useState } from 'react';\n\nexport function ${Name}() {\n const [count, setCount] = useState(0)\n const increment = () => setCount((c) => c + 1)\n return { count, increment }\n}\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,aAAa,GAAIC,OAAD,IAA+B;EAC1D,MAAM;IAAEC,IAAF;IAAQC,aAAa,EAAEC;EAAvB,IAAgCH,OAAtC;EACA,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MADjB;IAELI,OAAO,EAAG;AACd;AACA,kBAAkBF,IAAK;AACvB;AACA;AACA;AACA;AACA;EATS,CAAP;AAWD,CAbM"}
1
+ {"version":3,"names":["componentFile","context","name","nameCamelCase","Name","relativePath","content"],"sources":["component.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, nameCamelCase: Name } = context;\n return {\n relativePath: `${name}.tsx`,\n content: `import { useState } from 'react';\n\nexport function ${Name}() {\n const [count, setCount] = useState(0)\n const increment = () => setCount((c) => c + 1)\n return { count, increment }\n}\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAIC,OAAyB,IAAK;EAC1D,MAAM;IAAEC,IAAI;IAAEC,aAAa,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC7C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MAAK;IAC3BI,OAAO,EAAG;AACd;AACA,kBAAkBF,IAAK;AACvB;AACA;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.compositionFile = void 0;
7
-
8
7
  const compositionFile = context => {
9
8
  const {
10
9
  name,
@@ -28,7 +27,6 @@ export const Basic${Name} = () => {
28
27
  `
29
28
  };
30
29
  };
31
-
32
30
  exports.compositionFile = compositionFile;
33
31
 
34
32
  //# sourceMappingURL=composition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["compositionFile","context","name","nameCamelCase","Name","relativePath","content"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, nameCamelCase: Name } = context;\n\n return {\n relativePath: `${name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${Name} } from './${name}';\n\nexport const Basic${Name} = () => {\n const { count, increment } = ${Name}();\n\n return (\n <>\n <h1>The count is {count}</h1>\n <button onClick={increment}>increment</button>\n </>\n );\n};\n`,\n };\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAD,IAA+B;EAC5D,MAAM;IAAEC,IAAF;IAAQC,aAAa,EAAEC;EAAvB,IAAgCH,OAAtC;EAEA,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBADjB;IAELI,OAAO,EAAG;AACd,WAAWF,IAAK,cAAaF,IAAK;AAClC;AACA,oBAAoBE,IAAK;AACzB,iCAAiCA,IAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAfS,CAAP;AAiBD,CApBM"}
1
+ {"version":3,"names":["compositionFile","context","name","nameCamelCase","Name","relativePath","content"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, nameCamelCase: Name } = context;\n\n return {\n relativePath: `${name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${Name} } from './${name}';\n\nexport const Basic${Name} = () => {\n const { count, increment } = ${Name}();\n\n return (\n <>\n <h1>The count is {count}</h1>\n <button onClick={increment}>increment</button>\n </>\n );\n};\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAyB,IAAK;EAC5D,MAAM;IAAEC,IAAI;IAAEC,aAAa,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE7C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBAAiB;IACvCI,OAAO,EAAG;AACd,WAAWF,IAAK,cAAaF,IAAK;AAClC;AACA,oBAAoBE,IAAK;AACzB,iCAAiCA,IAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docsFile = void 0;
7
-
8
7
  const docsFile = context => {
9
8
  const {
10
9
  name,
@@ -38,7 +37,6 @@ const { count, increment } = ${Name}();
38
37
  `
39
38
  };
40
39
  };
41
-
42
40
  exports.docsFile = docsFile;
43
41
 
44
42
  //# sourceMappingURL=docs.js.map