@teambit/react 1.0.41 → 1.0.42

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 (207) hide show
  1. package/artifacts/env-template/public/{29.aabccd461805a58cd99a.js → 29.ddc7bc194190fac98e8b.js} +18 -18
  2. package/artifacts/env-template/public/{238.64be32cc6d4bc396b35e.js → 293.4bce474b96c9eb955917.js} +4 -4
  3. package/artifacts/env-template/public/assets-manifest.json +12 -12
  4. package/artifacts/env-template/public/{compositions.b6446d022ddef607b2fb.js → compositions.3c3b3230660e1a556e41.js} +1 -1
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.536d77e3d6f68d0ddf21.js → overview.e6a80013a110693d6dac.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/{peers.777d86ba769cf02b788f.js → peers.8430739d7755eb333339.js} +1 -1
  9. package/artifacts/env-template/public/{preview-root.983463c786334e1fbaf1.js → preview-root.3b62d04b3a7f234bd8ca.js} +1 -1
  10. package/dist/apps/web/ssr/ssr-express.js +2 -2
  11. package/dist/apps/web/ssr/ssr-express.js.map +1 -1
  12. package/dist/apps/web/webpack/webpack.app.ssr.config.js +2 -4
  13. package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
  14. package/dist/{preview-1698981534427.js → preview-1699364645970.js} +2 -2
  15. package/dist/react.aspect.js +2 -4
  16. package/dist/react.aspect.js.map +1 -1
  17. package/dist/react.env.js +2 -3
  18. package/dist/react.env.js.map +1 -1
  19. package/dist/react.main.runtime.d.ts +5 -2
  20. package/dist/react.main.runtime.js +18 -3
  21. package/dist/react.main.runtime.js.map +1 -1
  22. package/dist/react.preview.runtime.js +3 -4
  23. package/dist/react.preview.runtime.js.map +1 -1
  24. package/dist/react.templates.d.ts +2 -1
  25. package/dist/react.templates.js +21 -36
  26. package/dist/react.templates.js.map +1 -1
  27. package/dist/react.ui.runtime.js +1 -2
  28. package/dist/react.ui.runtime.js.map +1 -1
  29. package/dist/webpack/postcss.config.js +1 -2
  30. package/dist/webpack/postcss.config.js.map +1 -1
  31. package/dist/webpack/webpack.config.base.js +2 -2
  32. package/dist/webpack/webpack.config.base.js.map +1 -1
  33. package/package.json +46 -44
  34. package/dist/templates/react-app/files/app-plugin.d.ts +0 -2
  35. package/dist/templates/react-app/files/app-plugin.js +0 -17
  36. package/dist/templates/react-app/files/app-plugin.js.map +0 -1
  37. package/dist/templates/react-app/files/app-root.d.ts +0 -2
  38. package/dist/templates/react-app/files/app-root.js +0 -24
  39. package/dist/templates/react-app/files/app-root.js.map +0 -1
  40. package/dist/templates/react-app/files/app.d.ts +0 -2
  41. package/dist/templates/react-app/files/app.js +0 -34
  42. package/dist/templates/react-app/files/app.js.map +0 -1
  43. package/dist/templates/react-app/files/compositions.d.ts +0 -2
  44. package/dist/templates/react-app/files/compositions.js +0 -24
  45. package/dist/templates/react-app/files/compositions.js.map +0 -1
  46. package/dist/templates/react-app/files/doc.d.ts +0 -2
  47. package/dist/templates/react-app/files/doc.js +0 -33
  48. package/dist/templates/react-app/files/doc.js.map +0 -1
  49. package/dist/templates/react-app/files/index.d.ts +0 -2
  50. package/dist/templates/react-app/files/index.js +0 -13
  51. package/dist/templates/react-app/files/index.js.map +0 -1
  52. package/dist/templates/react-app/index.d.ts +0 -2
  53. package/dist/templates/react-app/index.js +0 -84
  54. package/dist/templates/react-app/index.js.map +0 -1
  55. package/dist/templates/react-component/files/component.d.ts +0 -5
  56. package/dist/templates/react-component/files/component.js +0 -35
  57. package/dist/templates/react-component/files/component.js.map +0 -1
  58. package/dist/templates/react-component/files/composition.d.ts +0 -5
  59. package/dist/templates/react-component/files/composition.js +0 -27
  60. package/dist/templates/react-component/files/composition.js.map +0 -1
  61. package/dist/templates/react-component/files/docs.d.ts +0 -5
  62. package/dist/templates/react-component/files/docs.js +0 -37
  63. package/dist/templates/react-component/files/docs.js.map +0 -1
  64. package/dist/templates/react-component/files/index-file.d.ts +0 -5
  65. package/dist/templates/react-component/files/index-file.js +0 -21
  66. package/dist/templates/react-component/files/index-file.js.map +0 -1
  67. package/dist/templates/react-component/files/test.d.ts +0 -5
  68. package/dist/templates/react-component/files/test.js +0 -28
  69. package/dist/templates/react-component/files/test.js.map +0 -1
  70. package/dist/templates/react-component/index.d.ts +0 -3
  71. package/dist/templates/react-component/index.js +0 -68
  72. package/dist/templates/react-component/index.js.map +0 -1
  73. package/dist/templates/react-component-js/files/component.d.ts +0 -5
  74. package/dist/templates/react-component-js/files/component.js +0 -28
  75. package/dist/templates/react-component-js/files/component.js.map +0 -1
  76. package/dist/templates/react-component-js/files/composition.d.ts +0 -5
  77. package/dist/templates/react-component-js/files/composition.js +0 -25
  78. package/dist/templates/react-component-js/files/composition.js.map +0 -1
  79. package/dist/templates/react-component-js/files/docs.d.ts +0 -5
  80. package/dist/templates/react-component-js/files/docs.js +0 -41
  81. package/dist/templates/react-component-js/files/docs.js.map +0 -1
  82. package/dist/templates/react-component-js/files/test.d.ts +0 -5
  83. package/dist/templates/react-component-js/files/test.js +0 -30
  84. package/dist/templates/react-component-js/files/test.js.map +0 -1
  85. package/dist/templates/react-component-js/index.d.ts +0 -3
  86. package/dist/templates/react-component-js/index.js +0 -70
  87. package/dist/templates/react-component-js/index.js.map +0 -1
  88. package/dist/templates/react-context/files/composition.d.ts +0 -5
  89. package/dist/templates/react-context/files/composition.js +0 -36
  90. package/dist/templates/react-context/files/composition.js.map +0 -1
  91. package/dist/templates/react-context/files/context-provider.d.ts +0 -5
  92. package/dist/templates/react-context/files/context-provider.js +0 -37
  93. package/dist/templates/react-context/files/context-provider.js.map +0 -1
  94. package/dist/templates/react-context/files/context.d.ts +0 -5
  95. package/dist/templates/react-context/files/context.js +0 -31
  96. package/dist/templates/react-context/files/context.js.map +0 -1
  97. package/dist/templates/react-context/files/docs.d.ts +0 -5
  98. package/dist/templates/react-context/files/docs.js +0 -60
  99. package/dist/templates/react-context/files/docs.js.map +0 -1
  100. package/dist/templates/react-context/files/index-file.d.ts +0 -5
  101. package/dist/templates/react-context/files/index-file.js +0 -23
  102. package/dist/templates/react-context/files/index-file.js.map +0 -1
  103. package/dist/templates/react-context/files/test.d.ts +0 -5
  104. package/dist/templates/react-context/files/test.js +0 -26
  105. package/dist/templates/react-context/files/test.js.map +0 -1
  106. package/dist/templates/react-context/index.d.ts +0 -2
  107. package/dist/templates/react-context/index.js +0 -65
  108. package/dist/templates/react-context/index.js.map +0 -1
  109. package/dist/templates/react-env/files/aspect.d.ts +0 -2
  110. package/dist/templates/react-env/files/aspect.js +0 -19
  111. package/dist/templates/react-env/files/aspect.js.map +0 -1
  112. package/dist/templates/react-env/files/doc.d.ts +0 -2
  113. package/dist/templates/react-env/files/doc.js +0 -186
  114. package/dist/templates/react-env/files/doc.js.map +0 -1
  115. package/dist/templates/react-env/files/index.d.ts +0 -2
  116. package/dist/templates/react-env/files/index.js +0 -19
  117. package/dist/templates/react-env/files/index.js.map +0 -1
  118. package/dist/templates/react-env/files/jest.config.d.ts +0 -1
  119. package/dist/templates/react-env/files/jest.config.js +0 -29
  120. package/dist/templates/react-env/files/jest.config.js.map +0 -1
  121. package/dist/templates/react-env/files/main.runtime.d.ts +0 -2
  122. package/dist/templates/react-env/files/main.runtime.js +0 -103
  123. package/dist/templates/react-env/files/main.runtime.js.map +0 -1
  124. package/dist/templates/react-env/files/preview.runtime.d.ts +0 -2
  125. package/dist/templates/react-env/files/preview.runtime.js +0 -37
  126. package/dist/templates/react-env/files/preview.runtime.js.map +0 -1
  127. package/dist/templates/react-env/files/typescript/styles.d.ts +0 -1
  128. package/dist/templates/react-env/files/typescript/styles.js +0 -15
  129. package/dist/templates/react-env/files/typescript/styles.js.map +0 -1
  130. package/dist/templates/react-env/files/typescript/ts-transformer.d.ts +0 -1
  131. package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -58
  132. package/dist/templates/react-env/files/typescript/ts-transformer.js.map +0 -1
  133. package/dist/templates/react-env/files/typescript/typescript.config.d.ts +0 -1
  134. package/dist/templates/react-env/files/typescript/typescript.config.js +0 -29
  135. package/dist/templates/react-env/files/typescript/typescript.config.js.map +0 -1
  136. package/dist/templates/react-env/files/webpack.config.d.ts +0 -1
  137. package/dist/templates/react-env/files/webpack.config.js +0 -56
  138. package/dist/templates/react-env/files/webpack.config.js.map +0 -1
  139. package/dist/templates/react-env/index.d.ts +0 -2
  140. package/dist/templates/react-env/index.js +0 -124
  141. package/dist/templates/react-env/index.js.map +0 -1
  142. package/dist/templates/react-hook/files/component.d.ts +0 -5
  143. package/dist/templates/react-hook/files/component.js +0 -26
  144. package/dist/templates/react-hook/files/component.js.map +0 -1
  145. package/dist/templates/react-hook/files/composition.d.ts +0 -5
  146. package/dist/templates/react-hook/files/composition.js +0 -32
  147. package/dist/templates/react-hook/files/composition.js.map +0 -1
  148. package/dist/templates/react-hook/files/docs.d.ts +0 -5
  149. package/dist/templates/react-hook/files/docs.js +0 -42
  150. package/dist/templates/react-hook/files/docs.js.map +0 -1
  151. package/dist/templates/react-hook/files/index-file.d.ts +0 -5
  152. package/dist/templates/react-hook/files/index-file.js +0 -20
  153. package/dist/templates/react-hook/files/index-file.js.map +0 -1
  154. package/dist/templates/react-hook/files/index-file.spec.d.ts +0 -1
  155. package/dist/templates/react-hook/files/index-file.spec.js +0 -36
  156. package/dist/templates/react-hook/files/index-file.spec.js.map +0 -1
  157. package/dist/templates/react-hook/files/test.d.ts +0 -5
  158. package/dist/templates/react-hook/files/test.js +0 -29
  159. package/dist/templates/react-hook/files/test.js.map +0 -1
  160. package/dist/templates/react-hook/index.d.ts +0 -2
  161. package/dist/templates/react-hook/index.js +0 -58
  162. package/dist/templates/react-hook/index.js.map +0 -1
  163. package/templates/react-app/files/app-plugin.ts +0 -9
  164. package/templates/react-app/files/app-root.ts +0 -16
  165. package/templates/react-app/files/app.ts +0 -26
  166. package/templates/react-app/files/compositions.ts +0 -16
  167. package/templates/react-app/files/doc.ts +0 -23
  168. package/templates/react-app/files/index.ts +0 -5
  169. package/templates/react-app/index.ts +0 -48
  170. package/templates/react-component/files/component.ts +0 -25
  171. package/templates/react-component/files/composition.ts +0 -18
  172. package/templates/react-component/files/docs.ts +0 -28
  173. package/templates/react-component/files/index-file.ts +0 -12
  174. package/templates/react-component/files/test.ts +0 -19
  175. package/templates/react-component/index.ts +0 -27
  176. package/templates/react-component-js/files/component.ts +0 -18
  177. package/templates/react-component-js/files/composition.ts +0 -16
  178. package/templates/react-component-js/files/docs.ts +0 -32
  179. package/templates/react-component-js/files/test.ts +0 -21
  180. package/templates/react-component-js/index.ts +0 -32
  181. package/templates/react-context/files/composition.ts +0 -27
  182. package/templates/react-context/files/context-provider.ts +0 -27
  183. package/templates/react-context/files/context.ts +0 -21
  184. package/templates/react-context/files/docs.ts +0 -51
  185. package/templates/react-context/files/index-file.ts +0 -14
  186. package/templates/react-context/files/test.ts +0 -18
  187. package/templates/react-context/index.ts +0 -29
  188. package/templates/react-env/files/aspect.ts +0 -10
  189. package/templates/react-env/files/doc.ts +0 -177
  190. package/templates/react-env/files/index.ts +0 -10
  191. package/templates/react-env/files/jest.config.ts +0 -21
  192. package/templates/react-env/files/main.runtime.ts +0 -94
  193. package/templates/react-env/files/preview.runtime.ts +0 -27
  194. package/templates/react-env/files/typescript/styles.ts +0 -7
  195. package/templates/react-env/files/typescript/ts-transformer.ts +0 -50
  196. package/templates/react-env/files/typescript/typescript.config.ts +0 -21
  197. package/templates/react-env/files/webpack.config.ts +0 -48
  198. package/templates/react-env/index.ts +0 -68
  199. package/templates/react-hook/files/component.ts +0 -16
  200. package/templates/react-hook/files/composition.ts +0 -23
  201. package/templates/react-hook/files/docs.ts +0 -33
  202. package/templates/react-hook/files/index-file.spec.ts +0 -24
  203. package/templates/react-hook/files/index-file.ts +0 -11
  204. package/templates/react-hook/files/test.ts +0 -20
  205. package/templates/react-hook/index.ts +0 -21
  206. /package/{compositions-1698981534427.js → compositions-1699364645970.js} +0 -0
  207. /package/{overview-1698981534427.js → overview-1699364645970.js} +0 -0
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.jestConfigFile = jestConfigFile;
7
- function jestConfigFile() {
8
- return `
9
- // Override the Jest config to ignore transpiling from specific folders
10
- // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js
11
-
12
- // const reactJestConfig = require('@teambit/react/jest/jest.config');
13
- // uncomment the line below and install the package if you want to use this function
14
- // const {
15
- // generateNodeModulesPattern,
16
- // } = require('@teambit/dependencies.modules.packages-excluder');
17
- // const packagesToExclude = ['@my-org', 'my-package-name'];
18
-
19
- // module.exports = {
20
- // ...reactJestConfig,
21
- // transformIgnorePatterns: [
22
- // '^.+\\.module\\.(css|sass|scss)$',
23
- // generateNodeModulesPattern({ packages: packagesToExclude }),
24
- // ],
25
- // };
26
- `;
27
- }
28
-
29
- //# sourceMappingURL=jest.config.js.map
@@ -1 +0,0 @@
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,cAAcA,CAAA,EAAG;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH"}
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext): string;
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.mainRuntimeFile = mainRuntimeFile;
7
- function mainRuntimeFile({
8
- namePascalCase: Name,
9
- name
10
- }) {
11
- return `import { MainRuntime } from '@teambit/cli';
12
- import { ReactAspect, ReactMain, UseTypescriptModifiers } from '@teambit/react';
13
- import { EnvsAspect, EnvsMain } from '@teambit/envs';
14
- import { ${Name}Aspect } from './${name}.aspect';
15
- //import {
16
- // previewConfigTransformer,
17
- // devServerConfigTransformer
18
- //} from './webpack/webpack-transformers';
19
- //import {
20
- // devConfigTransformer,
21
- // buildConfigTransformer,
22
- //} from "./typescript/ts-transformer";
23
-
24
- export class ${Name}Main {
25
- static slots = [];
26
-
27
- static dependencies = [ReactAspect, EnvsAspect];
28
-
29
- static runtime = MainRuntime;
30
-
31
- static async provider([react, envs]: [ReactMain, EnvsMain]) {
32
-
33
- //const webpackModifiers: UseWebpackModifiers = {
34
- // previewConfig: [previewConfigTransformer],
35
- // devServerConfig: [devServerConfigTransformer],
36
- //};
37
-
38
- //const tsModifiers: UseTypescriptModifiers = {
39
- // devConfig: [devConfigTransformer],
40
- // buildConfig: [buildConfigTransformer],
41
- //};
42
-
43
- const ${Name}Env = react.compose([
44
- /**
45
- * Uncomment to override the config files for TypeScript, Webpack or Jest
46
- * Your config gets merged with the defaults
47
- */
48
-
49
- // react.useTypescript(tsModifiers), // note: this cannot be used in conjunction with react.overrideCompiler
50
- // react.useWebpack(webpackModifiers),
51
- // react.overrideJestConfig(require.resolve('./jest/jest.config')),
52
-
53
- /**
54
- * override the ESLint default config here then check your files for lint errors
55
- * @example
56
- * bit lint
57
- * bit lint --fix
58
- */
59
- //react.useEslint({
60
- // transformers: [
61
- // (config) => {
62
- // config.setRule('no-console', ['error']);
63
- // return config;
64
- // }
65
- // ]
66
- //}),
67
-
68
- /**
69
- * override the Prettier default config here the check your formatting
70
- * @example
71
- * bit format --check
72
- * bit format
73
- */
74
- //react.usePrettier({
75
- // transformers: [
76
- // (config) => {
77
- // config.setKey('tabWidth', 2);
78
- // return config;
79
- // }
80
- // ]
81
- //}),
82
-
83
- /**
84
- * override dependencies here
85
- * @example
86
- * Uncomment types to include version 17.0.3 of the types package
87
- */
88
- react.overrideDependencies({
89
- devDependencies: {
90
- // '@types/react': '17.0.3'
91
- }
92
- })
93
- ]);
94
- envs.registerEnv(${Name}Env);
95
- return new ${Name}Main();
96
- }
97
- }
98
-
99
- ${Name}Aspect.addRuntime(${Name}Main);
100
- `;
101
- }
102
-
103
- //# sourceMappingURL=main.runtime.js.map
@@ -1 +0,0 @@
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,eAAeA,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"}
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext): string;
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.previewRuntimeFile = previewRuntimeFile;
7
- function previewRuntimeFile({
8
- namePascalCase: Name,
9
- nameCamelCase: nameCamel,
10
- name
11
- }) {
12
- return `import { PreviewRuntime } from '@teambit/preview';
13
- import { ReactAspect, ReactPreview } from '@teambit/react';
14
- // uncomment the line below and install the theme if you want to use our theme or create your own and import it here
15
- // import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
16
-
17
- import { ${Name}Aspect } from './${name}.aspect';
18
-
19
- export class ${Name}PreviewMain {
20
- static runtime = PreviewRuntime;
21
-
22
- static dependencies = [ReactAspect];
23
-
24
- static async provider([react]: [ReactPreview]) {
25
- const ${nameCamel}PreviewMain = new ${Name}PreviewMain();
26
- // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.
27
- // react.registerProvider([ThemeCompositions]);
28
-
29
- return ${nameCamel}PreviewMain;
30
- }
31
- }
32
-
33
- ${Name}Aspect.addRuntime(${Name}PreviewMain);
34
- `;
35
- }
36
-
37
- //# sourceMappingURL=preview.runtime.js.map
@@ -1 +0,0 @@
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,kBAAkBA,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"}
@@ -1 +0,0 @@
1
- export declare function globalStylesFile(): string;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.globalStylesFile = globalStylesFile;
7
- function globalStylesFile() {
8
- return `
9
- /*
10
- Add your global styles here to be added for any component using this env
11
- */
12
- `;
13
- }
14
-
15
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
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,gBAAgBA,CAAA,EAAG;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAAG;AACH"}
@@ -1 +0,0 @@
1
- export declare function tsTransformerFile(): string;
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.tsTransformerFile = tsTransformerFile;
7
- function tsTransformerFile() {
8
- return `
9
- import * as path from 'path';
10
- import {
11
- TsConfigTransformer,
12
- TypescriptConfigMutator,
13
- } from "@teambit/typescript";
14
-
15
- const tsConfig = require('./tsconfig.json');
16
-
17
- export const commonTransformer: TsConfigTransformer = (
18
- config: TypescriptConfigMutator
19
- ) => {
20
- const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])
21
- newConfig.mergeTsConfig(tsConfig);
22
- // Some examples of other built in mutator functions:
23
- //newConfig.addExclude(['someExclude']);
24
- //newConfig.setCompileJs(true)
25
- return newConfig;
26
- };
27
-
28
- /**
29
- * Transformation for the dev config only
30
- * @param config
31
- * @param context
32
- * @returns
33
- */
34
- export const devConfigTransformer: TsConfigTransformer = (
35
- config: TypescriptConfigMutator,
36
- ) => {
37
- const newConfig = commonTransformer(config, {});
38
- return newConfig;
39
- };
40
-
41
- /**
42
- * Transformation for the build only
43
- * @param config
44
- * @param context
45
- * @returns
46
- */
47
- export const buildConfigTransformer: TsConfigTransformer = (
48
- config: TypescriptConfigMutator
49
- ) => {
50
- const newConfig = commonTransformer(config, {});
51
- newConfig.mergeTsConfig(tsConfig);
52
- return newConfig;
53
- };
54
-
55
- `;
56
- }
57
-
58
- //# sourceMappingURL=ts-transformer.js.map
@@ -1 +0,0 @@
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,iBAAiBA,CAAA,EAAG;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"}
@@ -1 +0,0 @@
1
- export declare function typescriptConfigFile(): string;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.typescriptConfigFile = typescriptConfigFile;
7
- function typescriptConfigFile() {
8
- return `{
9
- // add your compiler options here
10
-
11
- "compilerOptions": {
12
- // "target": "es2017",
13
- // "module": "es2015",
14
- // "moduleResolution": "node",
15
- // "lib": ["es2017", "dom"],
16
- // "experimentalDecorators": true,
17
- // "esModuleInterop": true,
18
- // "outDir": "dist",
19
- // "sourceMap": true,
20
- // "emitDecoratorMetadata": true,
21
- // "allowJs": true,
22
- // "baseUrl": ".",
23
- // "jsx": "react"
24
- }
25
- }
26
- `;
27
- }
28
-
29
- //# sourceMappingURL=typescript.config.js.map
@@ -1 +0,0 @@
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,oBAAoBA,CAAA,EAAG;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1 +0,0 @@
1
- export declare function webpackConfigFile(): string;
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.webpackConfigFile = webpackConfigFile;
7
- function webpackConfigFile() {
8
- return `
9
- import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';
10
-
11
- /**
12
- * Transformation to apply for both preview and dev server
13
- * @param config
14
- * @param _context
15
- */
16
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
- function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {
18
- // Merge config with the webpack.config.js file if you choose to import a module export format config.
19
- // config.merge([webpackConfig]);
20
- // config.addAliases({});
21
- // config.addModuleRule(youRuleHere);
22
- return config;
23
- }
24
-
25
- /**
26
- * Transformation for the preview only
27
- * @param config
28
- * @param context
29
- * @returns
30
- */
31
- export const previewConfigTransformer: WebpackConfigTransformer = (
32
- config: WebpackConfigMutator,
33
- context: WebpackConfigTransformContext
34
- ) => {
35
- const newConfig = commonTransformation(config, context);
36
- return newConfig;
37
- };
38
-
39
- /**
40
- * Transformation for the dev server only
41
- * @param config
42
- * @param context
43
- * @returns
44
- */
45
- export const devServerConfigTransformer: WebpackConfigTransformer = (
46
- config: WebpackConfigMutator,
47
- context: WebpackConfigTransformContext
48
- ) => {
49
- const newConfig = commonTransformation(config, context);
50
- return newConfig;
51
- };
52
-
53
- `;
54
- }
55
-
56
- //# sourceMappingURL=webpack.config.js.map
@@ -1 +0,0 @@
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,iBAAiBA,CAAA,EAAG;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"}
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '@teambit/generator';
2
- export declare const reactEnvTemplate: ComponentTemplate;
@@ -1,124 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.reactEnvTemplate = void 0;
7
- function _index() {
8
- const data = require("./files/index");
9
- _index = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _doc() {
15
- const data = require("./files/doc");
16
- _doc = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _main() {
22
- const data = require("./files/main.runtime");
23
- _main = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _preview() {
29
- const data = require("./files/preview.runtime");
30
- _preview = function () {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _aspect() {
36
- const data = require("./files/aspect");
37
- _aspect = function () {
38
- return data;
39
- };
40
- return data;
41
- }
42
- function _webpack() {
43
- const data = require("./files/webpack.config");
44
- _webpack = function () {
45
- return data;
46
- };
47
- return data;
48
- }
49
- function _typescript() {
50
- const data = require("./files/typescript/typescript.config");
51
- _typescript = function () {
52
- return data;
53
- };
54
- return data;
55
- }
56
- function _styles() {
57
- const data = require("./files/typescript/styles");
58
- _styles = function () {
59
- return data;
60
- };
61
- return data;
62
- }
63
- function _tsTransformer() {
64
- const data = require("./files/typescript/ts-transformer");
65
- _tsTransformer = function () {
66
- return data;
67
- };
68
- return data;
69
- }
70
- function _jest() {
71
- const data = require("./files/jest.config");
72
- _jest = function () {
73
- return data;
74
- };
75
- return data;
76
- }
77
- const reactEnvTemplate = {
78
- name: 'react-env',
79
- description: 'customize the base React env with your configs and tools',
80
- hidden: true,
81
- generateFiles: context => {
82
- return [{
83
- relativePath: 'index.ts',
84
- content: (0, _index().indexFile)(context),
85
- isMain: true
86
- }, {
87
- relativePath: `${context.name}.docs.mdx`,
88
- content: (0, _doc().docFile)(context)
89
- }, {
90
- relativePath: `${context.name}.main.runtime.ts`,
91
- content: (0, _main().mainRuntimeFile)(context)
92
- }, {
93
- relativePath: `${context.name}.preview.runtime.ts`,
94
- content: (0, _preview().previewRuntimeFile)(context)
95
- }, {
96
- relativePath: `${context.name}.aspect.ts`,
97
- content: (0, _aspect().aspectFile)(context)
98
- }, {
99
- relativePath: `webpack/webpack-transformers.ts`,
100
- content: (0, _webpack().webpackConfigFile)()
101
- }, {
102
- relativePath: `typescript/tsconfig.json`,
103
- content: (0, _typescript().typescriptConfigFile)()
104
- }, {
105
- relativePath: `typescript/styles.d.ts`,
106
- content: (0, _styles().globalStylesFile)()
107
- }, {
108
- relativePath: `typescript/ts-transformer.ts`,
109
- content: (0, _tsTransformer().tsTransformerFile)()
110
- }, {
111
- relativePath: `jest/jest.config.js`,
112
- content: (0, _jest().jestConfigFile)()
113
- }];
114
- },
115
- config: {
116
- 'teambit.envs/env': {},
117
- 'teambit.envs/envs': {
118
- env: 'teambit.envs/env'
119
- }
120
- }
121
- };
122
- exports.reactEnvTemplate = reactEnvTemplate;
123
-
124
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_index","data","require","_doc","_main","_preview","_aspect","_webpack","_typescript","_styles","_tsTransformer","_jest","reactEnvTemplate","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env","exports"],"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 hidden: true,\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":"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"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const componentFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.componentFile = void 0;
7
- const componentFile = context => {
8
- const {
9
- name,
10
- nameCamelCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.tsx`,
14
- content: `import { useState } from 'react';
15
-
16
- export function ${Name}() {
17
- const [count, setCount] = useState(0)
18
- const increment = () => setCount((c) => c + 1)
19
- return { count, increment }
20
- }
21
- `
22
- };
23
- };
24
- exports.componentFile = componentFile;
25
-
26
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["componentFile","context","name","nameCamelCase","Name","relativePath","content","exports"],"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;AAACG,OAAA,CAAAP,aAAA,GAAAA,aAAA"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const compositionFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.compositionFile = void 0;
7
- const compositionFile = context => {
8
- const {
9
- name,
10
- nameCamelCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.composition.tsx`,
14
- content: `import React from 'react';
15
- import { ${Name} } from './${name}';
16
-
17
- export const Basic${Name} = () => {
18
- const { count, increment } = ${Name}();
19
-
20
- return (
21
- <>
22
- <h1>The count is {count}</h1>
23
- <button onClick={increment}>increment</button>
24
- </>
25
- );
26
- };
27
- `
28
- };
29
- };
30
- exports.compositionFile = compositionFile;
31
-
32
- //# sourceMappingURL=composition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["compositionFile","context","name","nameCamelCase","Name","relativePath","content","exports"],"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;AAACG,OAAA,CAAAP,eAAA,GAAAA,eAAA"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const docsFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };