@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.
- package/artifacts/env-template/public/{29.aabccd461805a58cd99a.js → 29.ddc7bc194190fac98e8b.js} +18 -18
- package/artifacts/env-template/public/{238.64be32cc6d4bc396b35e.js → 293.4bce474b96c9eb955917.js} +4 -4
- package/artifacts/env-template/public/assets-manifest.json +12 -12
- package/artifacts/env-template/public/{compositions.b6446d022ddef607b2fb.js → compositions.3c3b3230660e1a556e41.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.536d77e3d6f68d0ddf21.js → overview.e6a80013a110693d6dac.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.777d86ba769cf02b788f.js → peers.8430739d7755eb333339.js} +1 -1
- package/artifacts/env-template/public/{preview-root.983463c786334e1fbaf1.js → preview-root.3b62d04b3a7f234bd8ca.js} +1 -1
- package/dist/apps/web/ssr/ssr-express.js +2 -2
- package/dist/apps/web/ssr/ssr-express.js.map +1 -1
- package/dist/apps/web/webpack/webpack.app.ssr.config.js +2 -4
- package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
- package/dist/{preview-1698981534427.js → preview-1699364645970.js} +2 -2
- package/dist/react.aspect.js +2 -4
- package/dist/react.aspect.js.map +1 -1
- package/dist/react.env.js +2 -3
- package/dist/react.env.js.map +1 -1
- package/dist/react.main.runtime.d.ts +5 -2
- package/dist/react.main.runtime.js +18 -3
- package/dist/react.main.runtime.js.map +1 -1
- package/dist/react.preview.runtime.js +3 -4
- package/dist/react.preview.runtime.js.map +1 -1
- package/dist/react.templates.d.ts +2 -1
- package/dist/react.templates.js +21 -36
- package/dist/react.templates.js.map +1 -1
- package/dist/react.ui.runtime.js +1 -2
- package/dist/react.ui.runtime.js.map +1 -1
- package/dist/webpack/postcss.config.js +1 -2
- package/dist/webpack/postcss.config.js.map +1 -1
- package/dist/webpack/webpack.config.base.js +2 -2
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/package.json +46 -44
- package/dist/templates/react-app/files/app-plugin.d.ts +0 -2
- package/dist/templates/react-app/files/app-plugin.js +0 -17
- package/dist/templates/react-app/files/app-plugin.js.map +0 -1
- package/dist/templates/react-app/files/app-root.d.ts +0 -2
- package/dist/templates/react-app/files/app-root.js +0 -24
- package/dist/templates/react-app/files/app-root.js.map +0 -1
- package/dist/templates/react-app/files/app.d.ts +0 -2
- package/dist/templates/react-app/files/app.js +0 -34
- package/dist/templates/react-app/files/app.js.map +0 -1
- package/dist/templates/react-app/files/compositions.d.ts +0 -2
- package/dist/templates/react-app/files/compositions.js +0 -24
- package/dist/templates/react-app/files/compositions.js.map +0 -1
- package/dist/templates/react-app/files/doc.d.ts +0 -2
- package/dist/templates/react-app/files/doc.js +0 -33
- package/dist/templates/react-app/files/doc.js.map +0 -1
- package/dist/templates/react-app/files/index.d.ts +0 -2
- package/dist/templates/react-app/files/index.js +0 -13
- package/dist/templates/react-app/files/index.js.map +0 -1
- package/dist/templates/react-app/index.d.ts +0 -2
- package/dist/templates/react-app/index.js +0 -84
- package/dist/templates/react-app/index.js.map +0 -1
- package/dist/templates/react-component/files/component.d.ts +0 -5
- package/dist/templates/react-component/files/component.js +0 -35
- package/dist/templates/react-component/files/component.js.map +0 -1
- package/dist/templates/react-component/files/composition.d.ts +0 -5
- package/dist/templates/react-component/files/composition.js +0 -27
- package/dist/templates/react-component/files/composition.js.map +0 -1
- package/dist/templates/react-component/files/docs.d.ts +0 -5
- package/dist/templates/react-component/files/docs.js +0 -37
- package/dist/templates/react-component/files/docs.js.map +0 -1
- package/dist/templates/react-component/files/index-file.d.ts +0 -5
- package/dist/templates/react-component/files/index-file.js +0 -21
- package/dist/templates/react-component/files/index-file.js.map +0 -1
- package/dist/templates/react-component/files/test.d.ts +0 -5
- package/dist/templates/react-component/files/test.js +0 -28
- package/dist/templates/react-component/files/test.js.map +0 -1
- package/dist/templates/react-component/index.d.ts +0 -3
- package/dist/templates/react-component/index.js +0 -68
- package/dist/templates/react-component/index.js.map +0 -1
- package/dist/templates/react-component-js/files/component.d.ts +0 -5
- package/dist/templates/react-component-js/files/component.js +0 -28
- package/dist/templates/react-component-js/files/component.js.map +0 -1
- package/dist/templates/react-component-js/files/composition.d.ts +0 -5
- package/dist/templates/react-component-js/files/composition.js +0 -25
- package/dist/templates/react-component-js/files/composition.js.map +0 -1
- package/dist/templates/react-component-js/files/docs.d.ts +0 -5
- package/dist/templates/react-component-js/files/docs.js +0 -41
- package/dist/templates/react-component-js/files/docs.js.map +0 -1
- package/dist/templates/react-component-js/files/test.d.ts +0 -5
- package/dist/templates/react-component-js/files/test.js +0 -30
- package/dist/templates/react-component-js/files/test.js.map +0 -1
- package/dist/templates/react-component-js/index.d.ts +0 -3
- package/dist/templates/react-component-js/index.js +0 -70
- package/dist/templates/react-component-js/index.js.map +0 -1
- package/dist/templates/react-context/files/composition.d.ts +0 -5
- package/dist/templates/react-context/files/composition.js +0 -36
- package/dist/templates/react-context/files/composition.js.map +0 -1
- package/dist/templates/react-context/files/context-provider.d.ts +0 -5
- package/dist/templates/react-context/files/context-provider.js +0 -37
- package/dist/templates/react-context/files/context-provider.js.map +0 -1
- package/dist/templates/react-context/files/context.d.ts +0 -5
- package/dist/templates/react-context/files/context.js +0 -31
- package/dist/templates/react-context/files/context.js.map +0 -1
- package/dist/templates/react-context/files/docs.d.ts +0 -5
- package/dist/templates/react-context/files/docs.js +0 -60
- package/dist/templates/react-context/files/docs.js.map +0 -1
- package/dist/templates/react-context/files/index-file.d.ts +0 -5
- package/dist/templates/react-context/files/index-file.js +0 -23
- package/dist/templates/react-context/files/index-file.js.map +0 -1
- package/dist/templates/react-context/files/test.d.ts +0 -5
- package/dist/templates/react-context/files/test.js +0 -26
- package/dist/templates/react-context/files/test.js.map +0 -1
- package/dist/templates/react-context/index.d.ts +0 -2
- package/dist/templates/react-context/index.js +0 -65
- package/dist/templates/react-context/index.js.map +0 -1
- package/dist/templates/react-env/files/aspect.d.ts +0 -2
- package/dist/templates/react-env/files/aspect.js +0 -19
- package/dist/templates/react-env/files/aspect.js.map +0 -1
- package/dist/templates/react-env/files/doc.d.ts +0 -2
- package/dist/templates/react-env/files/doc.js +0 -186
- package/dist/templates/react-env/files/doc.js.map +0 -1
- package/dist/templates/react-env/files/index.d.ts +0 -2
- package/dist/templates/react-env/files/index.js +0 -19
- package/dist/templates/react-env/files/index.js.map +0 -1
- package/dist/templates/react-env/files/jest.config.d.ts +0 -1
- package/dist/templates/react-env/files/jest.config.js +0 -29
- package/dist/templates/react-env/files/jest.config.js.map +0 -1
- package/dist/templates/react-env/files/main.runtime.d.ts +0 -2
- package/dist/templates/react-env/files/main.runtime.js +0 -103
- package/dist/templates/react-env/files/main.runtime.js.map +0 -1
- package/dist/templates/react-env/files/preview.runtime.d.ts +0 -2
- package/dist/templates/react-env/files/preview.runtime.js +0 -37
- package/dist/templates/react-env/files/preview.runtime.js.map +0 -1
- package/dist/templates/react-env/files/typescript/styles.d.ts +0 -1
- package/dist/templates/react-env/files/typescript/styles.js +0 -15
- package/dist/templates/react-env/files/typescript/styles.js.map +0 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.d.ts +0 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -58
- package/dist/templates/react-env/files/typescript/ts-transformer.js.map +0 -1
- package/dist/templates/react-env/files/typescript/typescript.config.d.ts +0 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js +0 -29
- package/dist/templates/react-env/files/typescript/typescript.config.js.map +0 -1
- package/dist/templates/react-env/files/webpack.config.d.ts +0 -1
- package/dist/templates/react-env/files/webpack.config.js +0 -56
- package/dist/templates/react-env/files/webpack.config.js.map +0 -1
- package/dist/templates/react-env/index.d.ts +0 -2
- package/dist/templates/react-env/index.js +0 -124
- package/dist/templates/react-env/index.js.map +0 -1
- package/dist/templates/react-hook/files/component.d.ts +0 -5
- package/dist/templates/react-hook/files/component.js +0 -26
- package/dist/templates/react-hook/files/component.js.map +0 -1
- package/dist/templates/react-hook/files/composition.d.ts +0 -5
- package/dist/templates/react-hook/files/composition.js +0 -32
- package/dist/templates/react-hook/files/composition.js.map +0 -1
- package/dist/templates/react-hook/files/docs.d.ts +0 -5
- package/dist/templates/react-hook/files/docs.js +0 -42
- package/dist/templates/react-hook/files/docs.js.map +0 -1
- package/dist/templates/react-hook/files/index-file.d.ts +0 -5
- package/dist/templates/react-hook/files/index-file.js +0 -20
- package/dist/templates/react-hook/files/index-file.js.map +0 -1
- package/dist/templates/react-hook/files/index-file.spec.d.ts +0 -1
- package/dist/templates/react-hook/files/index-file.spec.js +0 -36
- package/dist/templates/react-hook/files/index-file.spec.js.map +0 -1
- package/dist/templates/react-hook/files/test.d.ts +0 -5
- package/dist/templates/react-hook/files/test.js +0 -29
- package/dist/templates/react-hook/files/test.js.map +0 -1
- package/dist/templates/react-hook/index.d.ts +0 -2
- package/dist/templates/react-hook/index.js +0 -58
- package/dist/templates/react-hook/index.js.map +0 -1
- package/templates/react-app/files/app-plugin.ts +0 -9
- package/templates/react-app/files/app-root.ts +0 -16
- package/templates/react-app/files/app.ts +0 -26
- package/templates/react-app/files/compositions.ts +0 -16
- package/templates/react-app/files/doc.ts +0 -23
- package/templates/react-app/files/index.ts +0 -5
- package/templates/react-app/index.ts +0 -48
- package/templates/react-component/files/component.ts +0 -25
- package/templates/react-component/files/composition.ts +0 -18
- package/templates/react-component/files/docs.ts +0 -28
- package/templates/react-component/files/index-file.ts +0 -12
- package/templates/react-component/files/test.ts +0 -19
- package/templates/react-component/index.ts +0 -27
- package/templates/react-component-js/files/component.ts +0 -18
- package/templates/react-component-js/files/composition.ts +0 -16
- package/templates/react-component-js/files/docs.ts +0 -32
- package/templates/react-component-js/files/test.ts +0 -21
- package/templates/react-component-js/index.ts +0 -32
- package/templates/react-context/files/composition.ts +0 -27
- package/templates/react-context/files/context-provider.ts +0 -27
- package/templates/react-context/files/context.ts +0 -21
- package/templates/react-context/files/docs.ts +0 -51
- package/templates/react-context/files/index-file.ts +0 -14
- package/templates/react-context/files/test.ts +0 -18
- package/templates/react-context/index.ts +0 -29
- package/templates/react-env/files/aspect.ts +0 -10
- package/templates/react-env/files/doc.ts +0 -177
- package/templates/react-env/files/index.ts +0 -10
- package/templates/react-env/files/jest.config.ts +0 -21
- package/templates/react-env/files/main.runtime.ts +0 -94
- package/templates/react-env/files/preview.runtime.ts +0 -27
- package/templates/react-env/files/typescript/styles.ts +0 -7
- package/templates/react-env/files/typescript/ts-transformer.ts +0 -50
- package/templates/react-env/files/typescript/typescript.config.ts +0 -21
- package/templates/react-env/files/webpack.config.ts +0 -48
- package/templates/react-env/index.ts +0 -68
- package/templates/react-hook/files/component.ts +0 -16
- package/templates/react-hook/files/composition.ts +0 -23
- package/templates/react-hook/files/docs.ts +0 -33
- package/templates/react-hook/files/index-file.spec.ts +0 -24
- package/templates/react-hook/files/index-file.ts +0 -11
- package/templates/react-hook/files/test.ts +0 -20
- package/templates/react-hook/index.ts +0 -21
- /package/{compositions-1698981534427.js → compositions-1699364645970.js} +0 -0
- /package/{overview-1698981534427.js → overview-1699364645970.js} +0 -0
|
@@ -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(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\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,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,gBAAmC,GAAG;EACjDC,IAAI,EAAE,WAAW;EACjBC,MAAM,EAAE,IAAI;EACZC,WAAW,EAAE,qBAAqB;EAClCC,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,CAACJ,IAAK,WAAU;MACxCM,OAAO,EAAE,IAAAG,cAAO,EAACL,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,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,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,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,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,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,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":"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"}
|
|
@@ -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,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,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,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,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.reactComponentJS = exports.deprecatedReactComponentJS = 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 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; }
|
|
36
|
-
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; }
|
|
37
|
-
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; }
|
|
38
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
39
|
-
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); }
|
|
40
|
-
const reactComponentJS = {
|
|
41
|
-
name: 'react-js',
|
|
42
|
-
description: 'a basic react component in js',
|
|
43
|
-
hidden: true,
|
|
44
|
-
generateFiles: context => {
|
|
45
|
-
const {
|
|
46
|
-
name,
|
|
47
|
-
namePascalCase: Name
|
|
48
|
-
} = context;
|
|
49
|
-
const indexFile = {
|
|
50
|
-
relativePath: 'index.js',
|
|
51
|
-
content: `export { ${Name} } from './${name}';
|
|
52
|
-
`
|
|
53
|
-
};
|
|
54
|
-
return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
|
|
55
|
-
},
|
|
56
|
-
config: {
|
|
57
|
-
'teambit.react/react': {},
|
|
58
|
-
'teambit.envs/envs': {
|
|
59
|
-
env: 'teambit.react/react'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
exports.reactComponentJS = reactComponentJS;
|
|
64
|
-
const deprecatedReactComponentJS = _objectSpread(_objectSpread({}, reactComponentJS), {}, {
|
|
65
|
-
name: 'react-component-js',
|
|
66
|
-
hidden: true
|
|
67
|
-
});
|
|
68
|
-
exports.deprecatedReactComponentJS = deprecatedReactComponentJS;
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=index.js.map
|