@teambit/react 1.0.40 → 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 (208) hide show
  1. package/artifacts/env-template/public/{29.945e5ad7423216520f6d.js → 29.ddc7bc194190fac98e8b.js} +20 -20
  2. package/artifacts/env-template/public/{238.64be32cc6d4bc396b35e.js → 293.4bce474b96c9eb955917.js} +4 -4
  3. package/artifacts/env-template/public/assets-manifest.json +14 -14
  4. package/artifacts/env-template/public/{compositions.7e9f498935fc23eb4e05.js → compositions.3c3b3230660e1a556e41.js} +1 -1
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.43e37513c5428b001f91.js → overview.e6a80013a110693d6dac.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/{peers.f47f3d9546b9102bd8fd.js → peers.8430739d7755eb333339.js} +1 -1
  9. package/artifacts/env-template/public/{preview-root.983463c786334e1fbaf1.js → preview-root.3b62d04b3a7f234bd8ca.js} +1 -1
  10. package/artifacts/env-template/public/static/css/{29.a9958296.css → 29.1c2448c7.css} +1 -1
  11. package/dist/apps/web/ssr/ssr-express.js +2 -2
  12. package/dist/apps/web/ssr/ssr-express.js.map +1 -1
  13. package/dist/apps/web/webpack/webpack.app.ssr.config.js +2 -4
  14. package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
  15. package/dist/{preview-1698930721010.js → preview-1699364645970.js} +2 -2
  16. package/dist/react.aspect.js +2 -4
  17. package/dist/react.aspect.js.map +1 -1
  18. package/dist/react.env.js +2 -3
  19. package/dist/react.env.js.map +1 -1
  20. package/dist/react.main.runtime.d.ts +5 -2
  21. package/dist/react.main.runtime.js +18 -3
  22. package/dist/react.main.runtime.js.map +1 -1
  23. package/dist/react.preview.runtime.js +3 -4
  24. package/dist/react.preview.runtime.js.map +1 -1
  25. package/dist/react.templates.d.ts +2 -1
  26. package/dist/react.templates.js +21 -36
  27. package/dist/react.templates.js.map +1 -1
  28. package/dist/react.ui.runtime.js +1 -2
  29. package/dist/react.ui.runtime.js.map +1 -1
  30. package/dist/webpack/postcss.config.js +1 -2
  31. package/dist/webpack/postcss.config.js.map +1 -1
  32. package/dist/webpack/webpack.config.base.js +2 -2
  33. package/dist/webpack/webpack.config.base.js.map +1 -1
  34. package/package.json +44 -42
  35. package/dist/templates/react-app/files/app-plugin.d.ts +0 -2
  36. package/dist/templates/react-app/files/app-plugin.js +0 -17
  37. package/dist/templates/react-app/files/app-plugin.js.map +0 -1
  38. package/dist/templates/react-app/files/app-root.d.ts +0 -2
  39. package/dist/templates/react-app/files/app-root.js +0 -24
  40. package/dist/templates/react-app/files/app-root.js.map +0 -1
  41. package/dist/templates/react-app/files/app.d.ts +0 -2
  42. package/dist/templates/react-app/files/app.js +0 -34
  43. package/dist/templates/react-app/files/app.js.map +0 -1
  44. package/dist/templates/react-app/files/compositions.d.ts +0 -2
  45. package/dist/templates/react-app/files/compositions.js +0 -24
  46. package/dist/templates/react-app/files/compositions.js.map +0 -1
  47. package/dist/templates/react-app/files/doc.d.ts +0 -2
  48. package/dist/templates/react-app/files/doc.js +0 -33
  49. package/dist/templates/react-app/files/doc.js.map +0 -1
  50. package/dist/templates/react-app/files/index.d.ts +0 -2
  51. package/dist/templates/react-app/files/index.js +0 -13
  52. package/dist/templates/react-app/files/index.js.map +0 -1
  53. package/dist/templates/react-app/index.d.ts +0 -2
  54. package/dist/templates/react-app/index.js +0 -84
  55. package/dist/templates/react-app/index.js.map +0 -1
  56. package/dist/templates/react-component/files/component.d.ts +0 -5
  57. package/dist/templates/react-component/files/component.js +0 -35
  58. package/dist/templates/react-component/files/component.js.map +0 -1
  59. package/dist/templates/react-component/files/composition.d.ts +0 -5
  60. package/dist/templates/react-component/files/composition.js +0 -27
  61. package/dist/templates/react-component/files/composition.js.map +0 -1
  62. package/dist/templates/react-component/files/docs.d.ts +0 -5
  63. package/dist/templates/react-component/files/docs.js +0 -37
  64. package/dist/templates/react-component/files/docs.js.map +0 -1
  65. package/dist/templates/react-component/files/index-file.d.ts +0 -5
  66. package/dist/templates/react-component/files/index-file.js +0 -21
  67. package/dist/templates/react-component/files/index-file.js.map +0 -1
  68. package/dist/templates/react-component/files/test.d.ts +0 -5
  69. package/dist/templates/react-component/files/test.js +0 -28
  70. package/dist/templates/react-component/files/test.js.map +0 -1
  71. package/dist/templates/react-component/index.d.ts +0 -3
  72. package/dist/templates/react-component/index.js +0 -68
  73. package/dist/templates/react-component/index.js.map +0 -1
  74. package/dist/templates/react-component-js/files/component.d.ts +0 -5
  75. package/dist/templates/react-component-js/files/component.js +0 -28
  76. package/dist/templates/react-component-js/files/component.js.map +0 -1
  77. package/dist/templates/react-component-js/files/composition.d.ts +0 -5
  78. package/dist/templates/react-component-js/files/composition.js +0 -25
  79. package/dist/templates/react-component-js/files/composition.js.map +0 -1
  80. package/dist/templates/react-component-js/files/docs.d.ts +0 -5
  81. package/dist/templates/react-component-js/files/docs.js +0 -41
  82. package/dist/templates/react-component-js/files/docs.js.map +0 -1
  83. package/dist/templates/react-component-js/files/test.d.ts +0 -5
  84. package/dist/templates/react-component-js/files/test.js +0 -30
  85. package/dist/templates/react-component-js/files/test.js.map +0 -1
  86. package/dist/templates/react-component-js/index.d.ts +0 -3
  87. package/dist/templates/react-component-js/index.js +0 -70
  88. package/dist/templates/react-component-js/index.js.map +0 -1
  89. package/dist/templates/react-context/files/composition.d.ts +0 -5
  90. package/dist/templates/react-context/files/composition.js +0 -36
  91. package/dist/templates/react-context/files/composition.js.map +0 -1
  92. package/dist/templates/react-context/files/context-provider.d.ts +0 -5
  93. package/dist/templates/react-context/files/context-provider.js +0 -37
  94. package/dist/templates/react-context/files/context-provider.js.map +0 -1
  95. package/dist/templates/react-context/files/context.d.ts +0 -5
  96. package/dist/templates/react-context/files/context.js +0 -31
  97. package/dist/templates/react-context/files/context.js.map +0 -1
  98. package/dist/templates/react-context/files/docs.d.ts +0 -5
  99. package/dist/templates/react-context/files/docs.js +0 -60
  100. package/dist/templates/react-context/files/docs.js.map +0 -1
  101. package/dist/templates/react-context/files/index-file.d.ts +0 -5
  102. package/dist/templates/react-context/files/index-file.js +0 -23
  103. package/dist/templates/react-context/files/index-file.js.map +0 -1
  104. package/dist/templates/react-context/files/test.d.ts +0 -5
  105. package/dist/templates/react-context/files/test.js +0 -26
  106. package/dist/templates/react-context/files/test.js.map +0 -1
  107. package/dist/templates/react-context/index.d.ts +0 -2
  108. package/dist/templates/react-context/index.js +0 -65
  109. package/dist/templates/react-context/index.js.map +0 -1
  110. package/dist/templates/react-env/files/aspect.d.ts +0 -2
  111. package/dist/templates/react-env/files/aspect.js +0 -19
  112. package/dist/templates/react-env/files/aspect.js.map +0 -1
  113. package/dist/templates/react-env/files/doc.d.ts +0 -2
  114. package/dist/templates/react-env/files/doc.js +0 -186
  115. package/dist/templates/react-env/files/doc.js.map +0 -1
  116. package/dist/templates/react-env/files/index.d.ts +0 -2
  117. package/dist/templates/react-env/files/index.js +0 -19
  118. package/dist/templates/react-env/files/index.js.map +0 -1
  119. package/dist/templates/react-env/files/jest.config.d.ts +0 -1
  120. package/dist/templates/react-env/files/jest.config.js +0 -29
  121. package/dist/templates/react-env/files/jest.config.js.map +0 -1
  122. package/dist/templates/react-env/files/main.runtime.d.ts +0 -2
  123. package/dist/templates/react-env/files/main.runtime.js +0 -103
  124. package/dist/templates/react-env/files/main.runtime.js.map +0 -1
  125. package/dist/templates/react-env/files/preview.runtime.d.ts +0 -2
  126. package/dist/templates/react-env/files/preview.runtime.js +0 -37
  127. package/dist/templates/react-env/files/preview.runtime.js.map +0 -1
  128. package/dist/templates/react-env/files/typescript/styles.d.ts +0 -1
  129. package/dist/templates/react-env/files/typescript/styles.js +0 -15
  130. package/dist/templates/react-env/files/typescript/styles.js.map +0 -1
  131. package/dist/templates/react-env/files/typescript/ts-transformer.d.ts +0 -1
  132. package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -58
  133. package/dist/templates/react-env/files/typescript/ts-transformer.js.map +0 -1
  134. package/dist/templates/react-env/files/typescript/typescript.config.d.ts +0 -1
  135. package/dist/templates/react-env/files/typescript/typescript.config.js +0 -29
  136. package/dist/templates/react-env/files/typescript/typescript.config.js.map +0 -1
  137. package/dist/templates/react-env/files/webpack.config.d.ts +0 -1
  138. package/dist/templates/react-env/files/webpack.config.js +0 -56
  139. package/dist/templates/react-env/files/webpack.config.js.map +0 -1
  140. package/dist/templates/react-env/index.d.ts +0 -2
  141. package/dist/templates/react-env/index.js +0 -124
  142. package/dist/templates/react-env/index.js.map +0 -1
  143. package/dist/templates/react-hook/files/component.d.ts +0 -5
  144. package/dist/templates/react-hook/files/component.js +0 -26
  145. package/dist/templates/react-hook/files/component.js.map +0 -1
  146. package/dist/templates/react-hook/files/composition.d.ts +0 -5
  147. package/dist/templates/react-hook/files/composition.js +0 -32
  148. package/dist/templates/react-hook/files/composition.js.map +0 -1
  149. package/dist/templates/react-hook/files/docs.d.ts +0 -5
  150. package/dist/templates/react-hook/files/docs.js +0 -42
  151. package/dist/templates/react-hook/files/docs.js.map +0 -1
  152. package/dist/templates/react-hook/files/index-file.d.ts +0 -5
  153. package/dist/templates/react-hook/files/index-file.js +0 -20
  154. package/dist/templates/react-hook/files/index-file.js.map +0 -1
  155. package/dist/templates/react-hook/files/index-file.spec.d.ts +0 -1
  156. package/dist/templates/react-hook/files/index-file.spec.js +0 -36
  157. package/dist/templates/react-hook/files/index-file.spec.js.map +0 -1
  158. package/dist/templates/react-hook/files/test.d.ts +0 -5
  159. package/dist/templates/react-hook/files/test.js +0 -29
  160. package/dist/templates/react-hook/files/test.js.map +0 -1
  161. package/dist/templates/react-hook/index.d.ts +0 -2
  162. package/dist/templates/react-hook/index.js +0 -58
  163. package/dist/templates/react-hook/index.js.map +0 -1
  164. package/templates/react-app/files/app-plugin.ts +0 -9
  165. package/templates/react-app/files/app-root.ts +0 -16
  166. package/templates/react-app/files/app.ts +0 -26
  167. package/templates/react-app/files/compositions.ts +0 -16
  168. package/templates/react-app/files/doc.ts +0 -23
  169. package/templates/react-app/files/index.ts +0 -5
  170. package/templates/react-app/index.ts +0 -48
  171. package/templates/react-component/files/component.ts +0 -25
  172. package/templates/react-component/files/composition.ts +0 -18
  173. package/templates/react-component/files/docs.ts +0 -28
  174. package/templates/react-component/files/index-file.ts +0 -12
  175. package/templates/react-component/files/test.ts +0 -19
  176. package/templates/react-component/index.ts +0 -27
  177. package/templates/react-component-js/files/component.ts +0 -18
  178. package/templates/react-component-js/files/composition.ts +0 -16
  179. package/templates/react-component-js/files/docs.ts +0 -32
  180. package/templates/react-component-js/files/test.ts +0 -21
  181. package/templates/react-component-js/index.ts +0 -32
  182. package/templates/react-context/files/composition.ts +0 -27
  183. package/templates/react-context/files/context-provider.ts +0 -27
  184. package/templates/react-context/files/context.ts +0 -21
  185. package/templates/react-context/files/docs.ts +0 -51
  186. package/templates/react-context/files/index-file.ts +0 -14
  187. package/templates/react-context/files/test.ts +0 -18
  188. package/templates/react-context/index.ts +0 -29
  189. package/templates/react-env/files/aspect.ts +0 -10
  190. package/templates/react-env/files/doc.ts +0 -177
  191. package/templates/react-env/files/index.ts +0 -10
  192. package/templates/react-env/files/jest.config.ts +0 -21
  193. package/templates/react-env/files/main.runtime.ts +0 -94
  194. package/templates/react-env/files/preview.runtime.ts +0 -27
  195. package/templates/react-env/files/typescript/styles.ts +0 -7
  196. package/templates/react-env/files/typescript/ts-transformer.ts +0 -50
  197. package/templates/react-env/files/typescript/typescript.config.ts +0 -21
  198. package/templates/react-env/files/webpack.config.ts +0 -48
  199. package/templates/react-env/index.ts +0 -68
  200. package/templates/react-hook/files/component.ts +0 -16
  201. package/templates/react-hook/files/composition.ts +0 -23
  202. package/templates/react-hook/files/docs.ts +0 -33
  203. package/templates/react-hook/files/index-file.spec.ts +0 -24
  204. package/templates/react-hook/files/index-file.ts +0 -11
  205. package/templates/react-hook/files/test.ts +0 -20
  206. package/templates/react-hook/index.ts +0 -21
  207. /package/{compositions-1698930721010.js → compositions-1699364645970.js} +0 -0
  208. /package/{overview-1698930721010.js → overview-1699364645970.js} +0 -0
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.docFile = docFile;
7
- function docFile({
8
- name,
9
- componentId,
10
- nameCamelCase
11
- }) {
12
- return `---
13
- description: ${nameCamelCase} application component.
14
- labels: ['${name}', 'app']
15
- ---
16
-
17
- Configure the app plugin on your workspace:
18
-
19
- \`\`\`json
20
- "${componentId.toString()}": {},
21
- \`\`\`
22
-
23
- ### Run the application
24
-
25
- You can run your application on a separate port to see it outside of the Bit workspace
26
-
27
- \`\`\`bash
28
- bit run ${name}
29
- \`\`\`
30
- `;
31
- }
32
-
33
- //# sourceMappingURL=doc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["docFile","name","componentId","nameCamelCase","toString"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId, nameCamelCase }: ComponentContext) {\n return `---\ndescription: ${nameCamelCase} application component.\nlabels: ['${name}', 'app']\n---\n\nConfigure the app plugin on your workspace:\n\n\\`\\`\\`json\n\"${componentId.toString()}\": {},\n\\`\\`\\`\n\n### Run the application\n\nYou can run your application on a separate port to see it outside of the Bit workspace\n\n\\`\\`\\`bash\nbit run ${name}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAAC;EAAEC,IAAI;EAAEC,WAAW;EAAEC;AAAgC,CAAC,EAAE;EAC9E,OAAQ;AACV,eAAeA,aAAc;AAC7B,YAAYF,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA,GAAGC,WAAW,CAACE,QAAQ,CAAC,CAAE;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUH,IAAK;AACf;AACA,CAAC;AACD"}
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare function indexFile({ namePascalCase: Name }: ComponentContext): string;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.indexFile = indexFile;
7
- function indexFile({
8
- namePascalCase: Name
9
- }) {
10
- return `export { ${Name}App } from './app';`;
11
- }
12
-
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["indexFile","namePascalCase","Name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name }: ComponentContext) {\n return `export { ${Name}App } from './app';`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc,EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWA,IAAK,qBAAoB;AAC9C"}
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '@teambit/generator';
2
- export declare const reactAppTemplate: ComponentTemplate;
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.reactAppTemplate = void 0;
7
- function _appPlugin() {
8
- const data = require("./files/app-plugin");
9
- _appPlugin = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _index() {
15
- const data = require("./files/index");
16
- _index = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _doc() {
22
- const data = require("./files/doc");
23
- _doc = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _compositions() {
29
- const data = require("./files/compositions");
30
- _compositions = function () {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _app() {
36
- const data = require("./files/app");
37
- _app = function () {
38
- return data;
39
- };
40
- return data;
41
- }
42
- function _appRoot() {
43
- const data = require("./files/app-root");
44
- _appRoot = function () {
45
- return data;
46
- };
47
- return data;
48
- }
49
- const reactAppTemplate = {
50
- name: 'react-app',
51
- hidden: true,
52
- description: 'Creates a React app',
53
- generateFiles: context => {
54
- return [{
55
- relativePath: 'index.ts',
56
- content: (0, _index().indexFile)(context),
57
- isMain: true
58
- }, {
59
- relativePath: `${context.name}.docs.mdx`,
60
- content: (0, _doc().docFile)(context)
61
- }, {
62
- relativePath: `${context.name}.react-app.cjs`,
63
- content: (0, _appPlugin().appPlugin)(context)
64
- }, {
65
- relativePath: `${context.name}.compositions.tsx`,
66
- content: (0, _compositions().compositionsFile)(context)
67
- }, {
68
- relativePath: `app.tsx`,
69
- content: (0, _app().appFile)(context)
70
- }, {
71
- relativePath: `${context.name}.app-root.tsx`,
72
- content: (0, _appRoot().appRootFile)(context)
73
- }];
74
- },
75
- config: {
76
- 'teambit.harmony/aspect': {},
77
- 'teambit.envs/envs': {
78
- env: 'teambit.harmony/aspect'
79
- }
80
- }
81
- };
82
- exports.reactAppTemplate = reactAppTemplate;
83
-
84
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_appPlugin","data","require","_index","_doc","_compositions","_app","_appRoot","reactAppTemplate","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","appPlugin","compositionsFile","appFile","appRootFile","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { appPlugin } from './files/app-plugin';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { compositionsFile } from './files/compositions';\nimport { appFile } from './files/app';\nimport { appRootFile } from './files/app-root';\n\nexport const reactAppTemplate: ComponentTemplate = {\n name: 'react-app',\n hidden: true,\n description: 'Creates a React app',\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}.react-app.cjs`,\n content: appPlugin(context),\n },\n {\n relativePath: `${context.name}.compositions.tsx`,\n content: compositionsFile(context),\n },\n {\n relativePath: `app.tsx`,\n content: appFile(context),\n },\n {\n relativePath: `${context.name}.app-root.tsx`,\n content: appRootFile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ACL,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,gBAAe;MAC7CM,OAAO,EAAE,IAAAI,sBAAS,EAACN,OAAO;IAC5B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,mBAAkB;MAChDM,OAAO,EAAE,IAAAK,gCAAgB,EAACP,OAAO;IACnC,CAAC,EACD;MACEC,YAAY,EAAG,SAAQ;MACvBC,OAAO,EAAE,IAAAM,cAAO,EAACR,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,eAAc;MAC5CM,OAAO,EAAE,IAAAO,sBAAW,EAACT,OAAO;IAC9B,CAAC,CACF;EACH,CAAC;EACDU,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA"}
@@ -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,35 +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
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.tsx`,
14
- content: `import React, { ReactNode } from 'react';
15
-
16
- export type ${Name}Props = {
17
- /**
18
- * a node to be rendered in the special component.
19
- */
20
- children?: ReactNode;
21
- };
22
-
23
- export function ${Name}({ children }: ${Name}Props) {
24
- return (
25
- <div>
26
- {children}
27
- </div>
28
- );
29
- }
30
- `
31
- };
32
- };
33
- exports.componentFile = componentFile;
34
-
35
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["component.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}.tsx`,\n content: `import React, { ReactNode } from 'react';\n\nexport type ${Name}Props = {\n /**\n * a node to be rendered in the special component.\n */\n children?: ReactNode;\n};\n\nexport function ${Name}({ children }: ${Name}Props) {\n return (\n <div>\n {children}\n </div>\n );\n}\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAIC,OAAyB,IAAK;EAC1D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MAAK;IAC3BI,OAAO,EAAG;AACd;AACA,cAAcF,IAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBA,IAAK,kBAAiBA,IAAK;AAC7C;AACA;AACA;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,27 +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
- namePascalCase: 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
- return (
19
- <${Name}>hello world!</${Name}>
20
- );
21
- }
22
- `
23
- };
24
- };
25
- exports.compositionFile = compositionFile;
26
-
27
- //# sourceMappingURL=composition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, namePascalCase: 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 return (\n <${Name}>hello world!</${Name}>\n );\n}\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAyB,IAAK;EAC5D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBAAiB;IACvCI,OAAO,EAAG;AACd,WAAWF,IAAK,cAAaF,IAAK;AAClC;AACA,oBAAoBE,IAAK;AACzB;AACA,OAAOA,IAAK,kBAAiBA,IAAK;AAClC;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
- };
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.docsFile = void 0;
7
- const docsFile = context => {
8
- const {
9
- name,
10
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.docs.mdx`,
14
- content: `---
15
- description: A ${Name} component.
16
- ---
17
-
18
- import { ${Name} } from './${name}';
19
-
20
- A component that does something special and renders text in a div.
21
-
22
- ### Component usage
23
- \`\`\`js
24
- <${Name}>Hello world!</${Name}>
25
- \`\`\`
26
-
27
- ### Render hello world!
28
-
29
- \`\`\`js live
30
- <${Name}>Hello world!</${Name}>
31
- \`\`\`
32
- `
33
- };
34
- };
35
- exports.docsFile = docsFile;
36
-
37
- //# sourceMappingURL=docs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content","exports"],"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}.docs.mdx`,\n content: `---\ndescription: A ${Name} component.\n---\n\nimport { ${Name} } from './${name}';\n\nA component that does something special and renders text in a div.\n\n### Component usage\n\\`\\`\\`js\n<${Name}>Hello world!</${Name}>\n\\`\\`\\`\n\n### Render hello world!\n\n\\`\\`\\`js live\n<${Name}>Hello world!</${Name}>\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,WAAU;IAChCI,OAAO,EAAG;AACd,iBAAiBF,IAAK;AACtB;AACA;AACA,WAAWA,IAAK,cAAaF,IAAK;AAClC;AACA;AACA;AACA;AACA;AACA,GAAGE,IAAK,kBAAiBA,IAAK;AAC9B;AACA;AACA;AACA;AACA;AACA,GAAGA,IAAK,kBAAiBA,IAAK;AAC9B;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const indexFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.indexFile = void 0;
7
- const indexFile = context => {
8
- const {
9
- name,
10
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: 'index.ts',
14
- content: `export { ${Name} } from './${name}';
15
- export type { ${Name}Props } from './${name}';
16
- `
17
- };
18
- };
19
- exports.indexFile = indexFile;
20
-
21
- //# sourceMappingURL=index-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["indexFile","context","name","namePascalCase","Name","relativePath","content","exports"],"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} } from './${name}';\nexport type { ${Name}Props } from './${name}';\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,cAAaF,IAAK;AAChD,gBAAgBE,IAAK,mBAAkBF,IAAK;AAC5C;EACE,CAAC;AACH,CAAC;AAACK,OAAA,CAAAP,SAAA,GAAAA,SAAA"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const testFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.testFile = void 0;
7
- const testFile = context => {
8
- const {
9
- name,
10
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.spec.tsx`,
14
- content: `import React from 'react';
15
- import { render } from '@testing-library/react';
16
- import { Basic${Name} } from './${name}.composition';
17
-
18
- it('should render with the correct text', () => {
19
- const { getByText } = render(<Basic${Name} />);
20
- const rendered = getByText('hello world!');
21
- expect(rendered).toBeTruthy();
22
- });
23
- `
24
- };
25
- };
26
- exports.testFile = testFile;
27
-
28
- //# sourceMappingURL=test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.spec.tsx`,\n content: `import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic${Name} } from './${name}.composition';\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic${Name} />);\n const rendered = getByText('hello world!');\n expect(rendered).toBeTruthy();\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,WAAU;IAChCI,OAAO,EAAG;AACd;AACA,gBAAgBF,IAAK,cAAaF,IAAK;AACvC;AACA;AACA,uCAAuCE,IAAK;AAC5C;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
@@ -1,3 +0,0 @@
1
- import { ComponentTemplate } from '@teambit/generator';
2
- export declare const reactComponent: ComponentTemplate;
3
- export declare const deprecatedReactComponent: ComponentTemplate;
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.reactComponent = exports.deprecatedReactComponent = void 0;
7
- function _component() {
8
- const data = require("./files/component");
9
- _component = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _composition() {
15
- const data = require("./files/composition");
16
- _composition = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _docs() {
22
- const data = require("./files/docs");
23
- _docs = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _test() {
29
- const data = require("./files/test");
30
- _test = function () {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _indexFile() {
36
- const data = require("./files/index-file");
37
- _indexFile = function () {
38
- return data;
39
- };
40
- return data;
41
- }
42
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
43
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
44
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
45
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
46
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
47
- const reactComponent = {
48
- name: 'react',
49
- description: 'a basic react component',
50
- hidden: true,
51
- generateFiles: context => {
52
- return [(0, _indexFile().indexFile)(context), (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
53
- },
54
- config: {
55
- 'teambit.react/react': {},
56
- 'teambit.envs/envs': {
57
- env: 'teambit.react/react'
58
- }
59
- }
60
- };
61
- exports.reactComponent = reactComponent;
62
- const deprecatedReactComponent = _objectSpread(_objectSpread({}, reactComponent), {}, {
63
- name: 'react-component',
64
- hidden: true
65
- });
66
- exports.deprecatedReactComponent = deprecatedReactComponent;
67
-
68
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_component","data","require","_composition","_docs","_test","_indexFile","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","reactComponent","name","description","hidden","generateFiles","context","indexFile","componentFile","compositionFile","docsFile","testFile","config","env","exports","deprecatedReactComponent"],"sources":["index.ts"],"sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactComponent: ComponentTemplate = {\n name: 'react',\n description: 'a basic react component',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n config: {\n 'teambit.react/react': {},\n 'teambit.envs/envs': {\n env: 'teambit.react/react',\n },\n },\n};\n\nexport const deprecatedReactComponent: ComponentTemplate = {\n ...reactComponent,\n name: 'react-component',\n hidden: true,\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAA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EACvBE,MAAM,EAAE;AAAI,EACb;AAACU,OAAA,CAAAC,wBAAA,GAAAA,wBAAA"}
@@ -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,28 +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
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.jsx`,
14
- content: `import React from 'react';
15
-
16
- export function ${Name}({ text }) {
17
- return (
18
- <div>
19
- {text}
20
- </div>
21
- );
22
- }
23
- `
24
- };
25
- };
26
- exports.componentFile = componentFile;
27
-
28
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["component.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}.jsx`,\n content: `import React from 'react';\n\nexport function ${Name}({ text }) {\n return (\n <div>\n {text}\n </div>\n );\n}\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAIC,OAAyB,IAAK;EAC1D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MAAK;IAC3BI,OAAO,EAAG;AACd;AACA,kBAAkBF,IAAK;AACvB;AACA;AACA;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,25 +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
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.composition.jsx`,
14
- content: `import React from 'react';
15
- import { ${Name} } from './${name}';
16
-
17
- export const Basic${Name} = () => (
18
- <${Name} text="hello from ${Name}" />
19
- );
20
- `
21
- };
22
- };
23
- exports.compositionFile = compositionFile;
24
-
25
- //# sourceMappingURL=composition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.composition.jsx`,\n content: `import React from 'react';\nimport { ${Name} } from './${name}';\n\nexport const Basic${Name} = () => (\n <${Name} text=\"hello from ${Name}\" />\n);\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAyB,IAAK;EAC5D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBAAiB;IACvCI,OAAO,EAAG;AACd,WAAWF,IAAK,cAAaF,IAAK;AAClC;AACA,oBAAoBE,IAAK;AACzB,KAAKA,IAAK,qBAAoBA,IAAK;AACnC;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
- };
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.docsFile = void 0;
7
- const docsFile = context => {
8
- const {
9
- name,
10
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.docs.mdx`,
14
- content: `---
15
- description: 'A ${Name} component.'
16
- labels: ['label1', 'label2', 'label3']
17
- ---
18
-
19
- import { ${Name} } from './${name}';
20
-
21
- ## React Component for rendering text
22
-
23
- A basic div that renders some text
24
-
25
- ### Component usage
26
- \`\`\`js
27
- <${Name} text="hello from ${Name}" />
28
- \`\`\`
29
-
30
- ### Using props to customize the text
31
-
32
- Modify the text to see it change live:
33
- \`\`\`js live
34
- <${Name} text="hello from ${Name}" />
35
- \`\`\`
36
- `
37
- };
38
- };
39
- exports.docsFile = docsFile;
40
-
41
- //# sourceMappingURL=docs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content","exports"],"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}.docs.mdx`,\n content: `---\ndescription: 'A ${Name} component.'\nlabels: ['label1', 'label2', 'label3']\n---\n\nimport { ${Name} } from './${name}';\n\n## React Component for rendering text\n\nA basic div that renders some text\n\n### Component usage\n\\`\\`\\`js\n<${Name} text=\"hello from ${Name}\" />\n\\`\\`\\`\n\n### Using props to customize the text\n\nModify the text to see it change live:\n\\`\\`\\`js live\n<${Name} text=\"hello from ${Name}\" />\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,WAAU;IAChCI,OAAO,EAAG;AACd,kBAAkBF,IAAK;AACvB;AACA;AACA;AACA,WAAWA,IAAK,cAAaF,IAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAGE,IAAK,qBAAoBA,IAAK;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,GAAGA,IAAK,qBAAoBA,IAAK;AACjC;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
@@ -1,5 +0,0 @@
1
- import { ComponentContext } from '@teambit/generator';
2
- export declare const testFile: (context: ComponentContext) => {
3
- relativePath: string;
4
- content: string;
5
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.testFile = void 0;
7
- const testFile = context => {
8
- const {
9
- name,
10
- namePascalCase: Name
11
- } = context;
12
- return {
13
- relativePath: `${name}.spec.jsx`,
14
- content: `import React from 'react';
15
- import { render } from '@testing-library/react';
16
- import { Basic${Name} } from './${name}.composition';
17
-
18
-
19
- it('should render with the correct text', () => {
20
- const { getByText } = render(<Basic${Name} />);
21
- const rendered = getByText('hello from ${Name}');
22
- expect(rendered).toBeTruthy();
23
- });
24
-
25
- `
26
- };
27
- };
28
- exports.testFile = testFile;
29
-
30
- //# sourceMappingURL=test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.spec.jsx`,\n content: `import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic${Name} } from './${name}.composition';\n\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic${Name} />);\n const rendered = getByText('hello from ${Name}');\n expect(rendered).toBeTruthy();\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,WAAU;IAChCI,OAAO,EAAG;AACd;AACA,gBAAgBF,IAAK,cAAaF,IAAK;AACvC;AACA;AACA;AACA,uCAAuCE,IAAK;AAC5C,2CAA2CA,IAAK;AAChD;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
@@ -1,3 +0,0 @@
1
- import { ComponentTemplate } from '@teambit/generator';
2
- export declare const reactComponentJS: ComponentTemplate;
3
- export declare const deprecatedReactComponentJS: ComponentTemplate;