@teambit/react 0.0.881 → 0.0.883
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/__bit_junit.xml +2 -2
- package/artifacts/env-template/public/{22.110c1e3ba45b0bbf27b0.js → 22.f311243a4b7463651c8e.js} +7 -3
- package/artifacts/env-template/public/{238.2ddc5a20aad2fef149e6.js → 700.b88f9139e07991261905.js} +21 -29
- package/artifacts/env-template/public/assets-manifest.json +18 -18
- package/artifacts/env-template/public/compositions.ac9e6df16c523807a4e3.js +9 -0
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.085d128a4f5272ef7319.js → overview.97f55013f9fda82a24ae.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.df1b33444b47cc9becfc.js → peers.65a74a62f208506b0532.js} +1 -1
- package/artifacts/env-template/public/{preview-root.b9ea187989f25bad7bf4.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
- package/artifacts/env-template/public/static/css/700.2aa44154.css +1 -0
- package/artifacts/env-template/public/static/css/compositions.812d93fb.css +1 -0
- package/artifacts/env-template/public/static/css/overview.793d10f3.css +1 -0
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1666409808293.js → compositions-1666582798766.js} +0 -0
- package/dist/apps/web/compute-results.js +0 -2
- package/dist/apps/web/compute-results.js.map +1 -1
- package/dist/apps/web/index.js +0 -3
- package/dist/apps/web/index.js.map +1 -1
- package/dist/apps/web/plugins/index.js +0 -3
- package/dist/apps/web/plugins/index.js.map +1 -1
- package/dist/apps/web/plugins/prerender.js +0 -14
- package/dist/apps/web/plugins/prerender.js.map +1 -1
- package/dist/apps/web/react.app-type.js +0 -7
- package/dist/apps/web/react.app-type.js.map +1 -1
- package/dist/apps/web/react.application.js +11 -76
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/apps/web/ssr/ssr-express.js +0 -31
- package/dist/apps/web/ssr/ssr-express.js.map +1 -1
- package/dist/apps/web/webpack/mutators.js +0 -13
- package/dist/apps/web/webpack/mutators.js.map +1 -1
- package/dist/apps/web/webpack/webpack.app.ssr.config.js +0 -11
- package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
- package/dist/eslint/eslintrc.js +1 -1
- package/dist/eslint/eslintrc.js.map +1 -1
- package/dist/highlighter-widget.js +0 -16
- package/dist/highlighter-widget.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/jest/index.js +0 -7
- package/dist/jest/index.js.map +1 -1
- package/dist/jest/jest.base.config.js +3 -3
- package/dist/jest/jest.base.config.js.map +1 -1
- package/dist/jest/jest.cjs.config.js +0 -10
- package/dist/jest/jest.cjs.config.js.map +1 -1
- package/dist/jest/jest.config.js +1 -1
- package/dist/jest/jest.config.js.map +1 -1
- package/dist/jest/jest.esm.config.js +0 -10
- package/dist/jest/jest.esm.config.js.map +1 -1
- package/dist/jest/setupTests.js.map +1 -1
- package/dist/jest/transformers/base-transformer-plugins.js +1 -0
- package/dist/jest/transformers/base-transformer-plugins.js.map +1 -1
- package/dist/jest/transformers/base-transformer-presets.js +1 -0
- package/dist/jest/transformers/base-transformer-presets.js.map +1 -1
- package/dist/jest/transformers/base-transformer-process.js +0 -2
- package/dist/jest/transformers/base-transformer-process.js.map +1 -1
- package/dist/jest/transformers/cjs-transformer.js +0 -5
- package/dist/jest/transformers/cjs-transformer.js.map +1 -1
- package/dist/jest/transformers/css-transform.js +1 -2
- package/dist/jest/transformers/css-transform.js.map +1 -1
- package/dist/jest/transformers/esm-transformer.js +1 -5
- package/dist/jest/transformers/esm-transformer.js.map +1 -1
- package/dist/jest/transformers/file-transform.js +2 -6
- package/dist/jest/transformers/file-transform.js.map +1 -1
- package/dist/prettier/prettier.config.js.map +1 -1
- package/dist/react.aspect.js +0 -5
- package/dist/react.aspect.js.map +1 -1
- package/dist/react.composition.js +0 -6
- package/dist/react.composition.js.map +1 -1
- package/dist/react.env.js +34 -143
- package/dist/react.env.js.map +1 -1
- package/dist/react.graphql.js +0 -6
- package/dist/react.graphql.js.map +1 -1
- package/dist/react.main.runtime.js +23 -152
- package/dist/react.main.runtime.js.map +1 -1
- package/dist/react.preview.runtime.js +0 -32
- package/dist/react.preview.runtime.js.map +1 -1
- package/dist/react.templates.js +0 -46
- package/dist/react.templates.js.map +1 -1
- package/dist/react.ui.runtime.js +0 -35
- package/dist/react.ui.runtime.js.map +1 -1
- package/dist/templates/react-app/files/app-plugin.js +0 -1
- package/dist/templates/react-app/files/app-plugin.js.map +1 -1
- package/dist/templates/react-app/files/app-root.js +0 -1
- package/dist/templates/react-app/files/app-root.js.map +1 -1
- package/dist/templates/react-app/files/app.js +0 -1
- package/dist/templates/react-app/files/app.js.map +1 -1
- package/dist/templates/react-app/files/compositions.js +0 -1
- package/dist/templates/react-app/files/compositions.js.map +1 -1
- package/dist/templates/react-app/files/doc.js +0 -1
- package/dist/templates/react-app/files/doc.js.map +1 -1
- package/dist/templates/react-app/files/index.js +0 -1
- package/dist/templates/react-app/files/index.js.map +1 -1
- package/dist/templates/react-app/index.js +0 -19
- package/dist/templates/react-app/index.js.map +1 -1
- package/dist/templates/react-component/files/component.js +0 -2
- package/dist/templates/react-component/files/component.js.map +1 -1
- package/dist/templates/react-component/files/composition.js +0 -2
- package/dist/templates/react-component/files/composition.js.map +1 -1
- package/dist/templates/react-component/files/docs.js +0 -2
- package/dist/templates/react-component/files/docs.js.map +1 -1
- package/dist/templates/react-component/files/index-file.js +0 -2
- package/dist/templates/react-component/files/index-file.js.map +1 -1
- package/dist/templates/react-component/files/test.js +0 -2
- package/dist/templates/react-component/files/test.js.map +1 -1
- package/dist/templates/react-component/index.js +0 -24
- package/dist/templates/react-component/index.js.map +1 -1
- package/dist/templates/react-component-js/files/component.js +0 -2
- package/dist/templates/react-component-js/files/component.js.map +1 -1
- package/dist/templates/react-component-js/files/composition.js +0 -2
- package/dist/templates/react-component-js/files/composition.js.map +1 -1
- package/dist/templates/react-component-js/files/docs.js +0 -2
- package/dist/templates/react-component-js/files/docs.js.map +1 -1
- package/dist/templates/react-component-js/files/test.js +0 -2
- package/dist/templates/react-component-js/files/test.js.map +1 -1
- package/dist/templates/react-component-js/index.js +0 -21
- package/dist/templates/react-component-js/index.js.map +1 -1
- package/dist/templates/react-context/files/composition.js +0 -2
- package/dist/templates/react-context/files/composition.js.map +1 -1
- package/dist/templates/react-context/files/context-provider.js +0 -2
- package/dist/templates/react-context/files/context-provider.js.map +1 -1
- package/dist/templates/react-context/files/context.js +0 -2
- package/dist/templates/react-context/files/context.js.map +1 -1
- package/dist/templates/react-context/files/docs.js +0 -2
- package/dist/templates/react-context/files/docs.js.map +1 -1
- package/dist/templates/react-context/files/index-file.js +0 -2
- package/dist/templates/react-context/files/index-file.js.map +1 -1
- package/dist/templates/react-context/files/test.js +0 -2
- package/dist/templates/react-context/files/test.js.map +1 -1
- package/dist/templates/react-context/index.js +0 -19
- package/dist/templates/react-context/index.js.map +1 -1
- package/dist/templates/react-env/files/aspect.js +0 -1
- package/dist/templates/react-env/files/aspect.js.map +1 -1
- package/dist/templates/react-env/files/doc.js +0 -1
- package/dist/templates/react-env/files/doc.js.map +1 -1
- package/dist/templates/react-env/files/index.js +0 -1
- package/dist/templates/react-env/files/index.js.map +1 -1
- package/dist/templates/react-env/files/jest.config.js +0 -1
- package/dist/templates/react-env/files/jest.config.js.map +1 -1
- package/dist/templates/react-env/files/main.runtime.js +0 -1
- package/dist/templates/react-env/files/main.runtime.js.map +1 -1
- package/dist/templates/react-env/files/preview.runtime.js +0 -1
- package/dist/templates/react-env/files/preview.runtime.js.map +1 -1
- package/dist/templates/react-env/files/typescript/styles.js +0 -1
- package/dist/templates/react-env/files/typescript/styles.js.map +1 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js.map +1 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js +0 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js.map +1 -1
- package/dist/templates/react-env/files/webpack.config.js +0 -1
- package/dist/templates/react-env/files/webpack.config.js.map +1 -1
- package/dist/templates/react-env/index.js +0 -31
- package/dist/templates/react-env/index.js.map +1 -1
- package/dist/templates/react-hook/files/component.js +0 -2
- package/dist/templates/react-hook/files/component.js.map +1 -1
- package/dist/templates/react-hook/files/composition.js +0 -2
- package/dist/templates/react-hook/files/composition.js.map +1 -1
- package/dist/templates/react-hook/files/docs.js +0 -2
- package/dist/templates/react-hook/files/docs.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.js +0 -2
- package/dist/templates/react-hook/files/index-file.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.spec.js +0 -6
- package/dist/templates/react-hook/files/index-file.spec.js.map +1 -1
- package/dist/templates/react-hook/files/test.js +0 -2
- package/dist/templates/react-hook/files/test.js.map +1 -1
- package/dist/templates/react-hook/index.js +0 -16
- package/dist/templates/react-hook/index.js.map +1 -1
- package/dist/templates/react-workspace/index.js +2 -6
- package/dist/templates/react-workspace/index.js.map +1 -1
- package/dist/templates/react-workspace-analytics/index.js +0 -5
- package/dist/templates/react-workspace-analytics/index.js.map +1 -1
- package/dist/templates/react-workspace-app/index.js +2 -13
- package/dist/templates/react-workspace-app/index.js.map +1 -1
- package/dist/templates/react-workspace-blog/index.js +0 -5
- package/dist/templates/react-workspace-blog/index.js.map +1 -1
- package/dist/templates/react-workspace-data-fetching/index.js +0 -5
- package/dist/templates/react-workspace-data-fetching/index.js.map +1 -1
- package/dist/templates/react-workspace-deprecated/index.js +0 -5
- package/dist/templates/react-workspace-deprecated/index.js.map +1 -1
- package/dist/templates/react-workspace-design-system/index.js +0 -5
- package/dist/templates/react-workspace-design-system/index.js.map +1 -1
- package/dist/templates/react-workspace-lib/index.js +0 -5
- package/dist/templates/react-workspace-lib/index.js.map +1 -1
- package/dist/templates/react-workspace-wiki/index.js +0 -5
- package/dist/templates/react-workspace-wiki/index.js.map +1 -1
- package/dist/templates/workspace-common/constants.js.map +1 -1
- package/dist/templates/workspace-common/files/eslint-config.js.map +1 -1
- package/dist/templates/workspace-common/files/git-ignore.js +0 -1
- package/dist/templates/workspace-common/files/git-ignore.js.map +1 -1
- package/dist/templates/workspace-common/files/launch-json.js +0 -2
- package/dist/templates/workspace-common/files/launch-json.js.map +1 -1
- package/dist/templates/workspace-common/files/prettier-config.js.map +1 -1
- package/dist/templates/workspace-common/files/readme-file.js +0 -1
- package/dist/templates/workspace-common/files/readme-file.js.map +1 -1
- package/dist/templates/workspace-common/files/ts-config.js.map +1 -1
- package/dist/templates/workspace-common/files/types/asset.js.map +1 -1
- package/dist/templates/workspace-common/files/types/style.js.map +1 -1
- package/dist/templates/workspace-common/files/workspace-config.js +0 -14
- package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
- package/dist/templates/workspace-common/generate-files.js +0 -29
- package/dist/templates/workspace-common/generate-files.js.map +1 -1
- package/dist/templates/workspace-common/index.js +0 -3
- package/dist/templates/workspace-common/index.js.map +1 -1
- package/dist/webpack/html.js +3 -2
- package/dist/webpack/html.js.map +1 -1
- package/dist/webpack/index.js +0 -3
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/overlay/formatWebpackMessages.js +26 -37
- package/dist/webpack/overlay/formatWebpackMessages.js.map +1 -1
- package/dist/webpack/overlay/launchEditorEndpoint.js +2 -2
- package/dist/webpack/overlay/launchEditorEndpoint.js.map +1 -1
- package/dist/webpack/overlay/refreshOverlayInterop.js +1 -3
- package/dist/webpack/overlay/refreshOverlayInterop.js.map +1 -1
- package/dist/webpack/overlay/webpackHotDevClient.js +54 -71
- package/dist/webpack/overlay/webpackHotDevClient.js.map +1 -1
- package/dist/webpack/postcss.config.js +6 -3
- package/dist/webpack/postcss.config.js.map +1 -1
- package/dist/webpack/webpack.config.base.js +28 -53
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/dist/webpack/webpack.config.base.prod.js +10 -14
- package/dist/webpack/webpack.config.base.prod.js.map +1 -1
- package/dist/webpack/webpack.config.component.dev.js +10 -17
- package/dist/webpack/webpack.config.component.dev.js.map +1 -1
- package/dist/webpack/webpack.config.component.prod.js +3 -6
- package/dist/webpack/webpack.config.component.prod.js.map +1 -1
- package/dist/webpack/webpack.config.env.dev.js +5 -5
- package/dist/webpack/webpack.config.env.dev.js.map +1 -1
- package/dist/webpack/webpack.config.env.template.js +0 -1
- package/dist/webpack/webpack.config.env.template.js.map +1 -1
- package/{overview-1666409808293.js → overview-1666582798766.js} +0 -0
- package/package-tar/teambit-react-0.0.883.tgz +0 -0
- package/package.json +26 -26
- package/{preview-1666409808293.js → preview-1666582798766.js} +2 -2
- package/artifacts/env-template/public/compositions.c4e18d110cce13606364.js +0 -5
- package/artifacts/env-template/public/static/css/238.a0238c25.css +0 -1
- package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
- package/artifacts/env-template/public/static/css/overview.367aeb5b.css +0 -1
- package/package-tar/teambit-react-0.0.881.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["appFile","namePascalCase","Name"],"sources":["app.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function appFile({ namePascalCase: Name }: ComponentContext) {\n return `import React from 'react';\nimport { Routes, Route } from 'react-router-dom';\n\nexport function ${Name}App() {\n return (\n <>\n {/* header component */}\n <Routes>\n <Route path=\"/\" element={<div>Hello World!!</div>}>\n {/* home page component */}\n </Route>\n\n <Route path=\"/about\">\n {/* about page component */}\n </Route>\n\n </Routes>\n {/* footer component */}\n </>\n );\n}\n`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["appFile","namePascalCase","Name"],"sources":["app.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function appFile({ namePascalCase: Name }: ComponentContext) {\n return `import React from 'react';\nimport { Routes, Route } from 'react-router-dom';\n\nexport function ${Name}App() {\n return (\n <>\n {/* header component */}\n <Routes>\n <Route path=\"/\" element={<div>Hello World!!</div>}>\n {/* home page component */}\n </Route>\n\n <Route path=\"/about\">\n {/* about page component */}\n </Route>\n\n </Routes>\n {/* footer component */}\n </>\n );\n}\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAAC;EAAEC,cAAc,EAAEC;AAAuB,CAAC,EAAE;EAClE,OAAQ;AACV;AACA;AACA,kBAAkBA,IAAK;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compositionsFile","namePascalCase","Name"],"sources":["compositions.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionsFile({ namePascalCase: Name }: ComponentContext) {\n return `import React from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { ${Name}App } from './app';\n\nexport const ${Name}Basic = () => {\n return (\n <MemoryRouter>\n <${Name}App />\n </MemoryRouter>\n );\n};\n`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["compositionsFile","namePascalCase","Name"],"sources":["compositions.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionsFile({ namePascalCase: Name }: ComponentContext) {\n return `import React from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { ${Name}App } from './app';\n\nexport const ${Name}Basic = () => {\n return (\n <MemoryRouter>\n <${Name}App />\n </MemoryRouter>\n );\n};\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,gBAAgB,CAAC;EAAEC,cAAc,EAAEC;AAAuB,CAAC,EAAE;EAC3E,OAAQ;AACV;AACA,WAAWA,IAAK;AAChB;AACA,eAAeA,IAAK;AACpB;AACA;AACA,SAASA,IAAK;AACd;AACA;AACA;AACA,CAAC;AACD"}
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,OAAO,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,EAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUH,IAAK;AACf;AACA,CAAC;AACD"}
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,SAAS,CAAC;EAAEC,cAAc,EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWA,IAAK,qBAAoB;AAC9C"}
|
|
@@ -4,67 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.reactAppTemplate = void 0;
|
|
7
|
-
|
|
8
7
|
function _appPlugin() {
|
|
9
8
|
const data = require("./files/app-plugin");
|
|
10
|
-
|
|
11
9
|
_appPlugin = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _index() {
|
|
19
15
|
const data = require("./files/index");
|
|
20
|
-
|
|
21
16
|
_index = function () {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _doc() {
|
|
29
22
|
const data = require("./files/doc");
|
|
30
|
-
|
|
31
23
|
_doc = function () {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _compositions() {
|
|
39
29
|
const data = require("./files/compositions");
|
|
40
|
-
|
|
41
30
|
_compositions = function () {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _app() {
|
|
49
36
|
const data = require("./files/app");
|
|
50
|
-
|
|
51
37
|
_app = function () {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _appRoot() {
|
|
59
43
|
const data = require("./files/app-root");
|
|
60
|
-
|
|
61
44
|
_appRoot = function () {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
const reactAppTemplate = {
|
|
69
50
|
name: 'react-app',
|
|
70
51
|
hidden: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["reactAppTemplate","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","appPlugin","compositionsFile","appFile","appRootFile","config","env"],"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.ts`,\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":"
|
|
1
|
+
{"version":3,"names":["reactAppTemplate","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","appPlugin","compositionsFile","appFile","appRootFile","config","env"],"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.ts`,\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAAmC,GAAG;EACjDC,IAAI,EAAE,WAAW;EACjBC,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,eAAc;MAC5CM,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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.componentFile = void 0;
|
|
7
|
-
|
|
8
7
|
const componentFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -31,7 +30,6 @@ export function ${Name}({ children }: ${Name}Props) {
|
|
|
31
30
|
`
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
|
-
|
|
35
33
|
exports.componentFile = componentFile;
|
|
36
34
|
|
|
37
35
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.compositionFile = void 0;
|
|
7
|
-
|
|
8
7
|
const compositionFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -23,7 +22,6 @@ export const Basic${Name} = () => {
|
|
|
23
22
|
`
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
exports.compositionFile = compositionFile;
|
|
28
26
|
|
|
29
27
|
//# sourceMappingURL=composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.docsFile = void 0;
|
|
7
|
-
|
|
8
7
|
const docsFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -33,7 +32,6 @@ A component that does something special and renders text in a div.
|
|
|
33
32
|
`
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
exports.docsFile = docsFile;
|
|
38
36
|
|
|
39
37
|
//# sourceMappingURL=docs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.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":"
|
|
1
|
+
{"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.indexFile = void 0;
|
|
7
|
-
|
|
8
7
|
const indexFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -17,7 +16,6 @@ export type { ${Name}Props } from './${name}';
|
|
|
17
16
|
`
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
|
|
21
19
|
exports.indexFile = indexFile;
|
|
22
20
|
|
|
23
21
|
//# sourceMappingURL=index-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\nexport type { ${Name}Props } from './${name}';\n`,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name} } 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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.testFile = void 0;
|
|
7
|
-
|
|
8
7
|
const testFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -24,7 +23,6 @@ it('should render with the correct text', () => {
|
|
|
24
23
|
`
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
exports.testFile = testFile;
|
|
29
27
|
|
|
30
28
|
//# sourceMappingURL=test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -1,76 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.reactComponent = exports.deprecatedReactComponent = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _component() {
|
|
21
16
|
const data = require("./files/component");
|
|
22
|
-
|
|
23
17
|
_component = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function _composition() {
|
|
31
23
|
const data = require("./files/composition");
|
|
32
|
-
|
|
33
24
|
_composition = function () {
|
|
34
25
|
return data;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return data;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
function _docs() {
|
|
41
30
|
const data = require("./files/docs");
|
|
42
|
-
|
|
43
31
|
_docs = function () {
|
|
44
32
|
return data;
|
|
45
33
|
};
|
|
46
|
-
|
|
47
34
|
return data;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
function _test() {
|
|
51
37
|
const data = require("./files/test");
|
|
52
|
-
|
|
53
38
|
_test = function () {
|
|
54
39
|
return data;
|
|
55
40
|
};
|
|
56
|
-
|
|
57
41
|
return data;
|
|
58
42
|
}
|
|
59
|
-
|
|
60
43
|
function _indexFile() {
|
|
61
44
|
const data = require("./files/index-file");
|
|
62
|
-
|
|
63
45
|
_indexFile = function () {
|
|
64
46
|
return data;
|
|
65
47
|
};
|
|
66
|
-
|
|
67
48
|
return data;
|
|
68
49
|
}
|
|
69
|
-
|
|
70
50
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
71
|
-
|
|
72
51
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
73
|
-
|
|
74
52
|
const reactComponent = {
|
|
75
53
|
name: 'react',
|
|
76
54
|
description: 'a basic react component',
|
|
@@ -85,12 +63,10 @@ const reactComponent = {
|
|
|
85
63
|
}
|
|
86
64
|
};
|
|
87
65
|
exports.reactComponent = reactComponent;
|
|
88
|
-
|
|
89
66
|
const deprecatedReactComponent = _objectSpread(_objectSpread({}, reactComponent), {}, {
|
|
90
67
|
name: 'react-component',
|
|
91
68
|
hidden: true
|
|
92
69
|
});
|
|
93
|
-
|
|
94
70
|
exports.deprecatedReactComponent = deprecatedReactComponent;
|
|
95
71
|
|
|
96
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["reactComponent","name","description","generateFiles","context","indexFile","componentFile","compositionFile","docsFile","testFile","config","env","deprecatedReactComponent","hidden"],"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 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":"
|
|
1
|
+
{"version":3,"names":["reactComponent","name","description","generateFiles","context","indexFile","componentFile","compositionFile","docsFile","testFile","config","env","deprecatedReactComponent","hidden"],"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 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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+C;AAAA;AAExC,MAAMA,cAAiC,GAAG;EAC/CC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,yBAAyB;EACtCC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CAAC,IAAAC,sBAAS,EAACD,OAAO,CAAC,EAAE,IAAAE,0BAAa,EAACF,OAAO,CAAC,EAAE,IAAAG,8BAAe,EAACH,OAAO,CAAC,EAAE,IAAAI,gBAAQ,EAACJ,OAAO,CAAC,EAAE,IAAAK,gBAAQ,EAACL,OAAO,CAAC,CAAC;EACrH,CAAC;EACDM,MAAM,EAAE;IACN,qBAAqB,EAAE,CAAC,CAAC;IACzB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC;AAEK,MAAMC,wBAA2C,mCACnDZ,cAAc;EACjBC,IAAI,EAAE,iBAAiB;EACvBY,MAAM,EAAE;AAAI,EACb;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.componentFile = void 0;
|
|
7
|
-
|
|
8
7
|
const componentFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -24,7 +23,6 @@ export function ${Name}({ text }) {
|
|
|
24
23
|
`
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
exports.componentFile = componentFile;
|
|
29
27
|
|
|
30
28
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["componentFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.compositionFile = void 0;
|
|
7
|
-
|
|
8
7
|
const compositionFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -21,7 +20,6 @@ export const Basic${Name} = () => (
|
|
|
21
20
|
`
|
|
22
21
|
};
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
exports.compositionFile = compositionFile;
|
|
26
24
|
|
|
27
25
|
//# sourceMappingURL=composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.docsFile = void 0;
|
|
7
|
-
|
|
8
7
|
const docsFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -37,7 +36,6 @@ Modify the text to see it change live:
|
|
|
37
36
|
`
|
|
38
37
|
};
|
|
39
38
|
};
|
|
40
|
-
|
|
41
39
|
exports.docsFile = docsFile;
|
|
42
40
|
|
|
43
41
|
//# sourceMappingURL=docs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.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":"
|
|
1
|
+
{"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.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;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.testFile = void 0;
|
|
7
|
-
|
|
8
7
|
const testFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -26,7 +25,6 @@ it('should render with the correct text', () => {
|
|
|
26
25
|
`
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
exports.testFile = testFile;
|
|
31
29
|
|
|
32
30
|
//# sourceMappingURL=test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content"],"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":"
|
|
1
|
+
{"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content"],"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;AAAC"}
|
|
@@ -1,66 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.reactComponentJS = exports.deprecatedReactComponentJS = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _component() {
|
|
21
16
|
const data = require("./files/component");
|
|
22
|
-
|
|
23
17
|
_component = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function _composition() {
|
|
31
23
|
const data = require("./files/composition");
|
|
32
|
-
|
|
33
24
|
_composition = function () {
|
|
34
25
|
return data;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return data;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
function _docs() {
|
|
41
30
|
const data = require("./files/docs");
|
|
42
|
-
|
|
43
31
|
_docs = function () {
|
|
44
32
|
return data;
|
|
45
33
|
};
|
|
46
|
-
|
|
47
34
|
return data;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
function _test() {
|
|
51
37
|
const data = require("./files/test");
|
|
52
|
-
|
|
53
38
|
_test = function () {
|
|
54
39
|
return data;
|
|
55
40
|
};
|
|
56
|
-
|
|
57
41
|
return data;
|
|
58
42
|
}
|
|
59
|
-
|
|
60
43
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
61
|
-
|
|
62
44
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
63
|
-
|
|
64
45
|
const reactComponentJS = {
|
|
65
46
|
name: 'react-js',
|
|
66
47
|
description: 'a basic react component in js',
|
|
@@ -84,12 +65,10 @@ const reactComponentJS = {
|
|
|
84
65
|
}
|
|
85
66
|
};
|
|
86
67
|
exports.reactComponentJS = reactComponentJS;
|
|
87
|
-
|
|
88
68
|
const deprecatedReactComponentJS = _objectSpread(_objectSpread({}, reactComponentJS), {}, {
|
|
89
69
|
name: 'react-component-js',
|
|
90
70
|
hidden: true
|
|
91
71
|
});
|
|
92
|
-
|
|
93
72
|
exports.deprecatedReactComponentJS = deprecatedReactComponentJS;
|
|
94
73
|
|
|
95
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["reactComponentJS","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content","componentFile","compositionFile","docsFile","testFile","config","env","deprecatedReactComponentJS","hidden"],"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';\n\nexport const reactComponentJS: ComponentTemplate = {\n name: 'react-js',\n description: 'a basic react component in js',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.js',\n content: `export { ${Name} } from './${name}';\n`,\n };\n return [indexFile, 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 deprecatedReactComponentJS: ComponentTemplate = {\n ...reactComponentJS,\n name: 'react-component-js',\n hidden: true,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["reactComponentJS","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content","componentFile","compositionFile","docsFile","testFile","config","env","deprecatedReactComponentJS","hidden"],"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';\n\nexport const reactComponentJS: ComponentTemplate = {\n name: 'react-js',\n description: 'a basic react component in js',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.js',\n content: `export { ${Name} } from './${name}';\n`,\n };\n return [indexFile, 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 deprecatedReactComponentJS: ComponentTemplate = {\n ...reactComponentJS,\n name: 'react-component-js',\n hidden: true,\n};\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwC;AAAA;AAEjC,MAAMA,gBAAmC,GAAG;EACjDC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,+BAA+B;EAE5CC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,MAAM;MAAEH,IAAI;MAAEI,cAAc,EAAEC;IAAK,CAAC,GAAGF,OAAO;IAC9C,MAAMG,SAAS,GAAG;MAChBC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAG,YAAWH,IAAK,cAAaL,IAAK;AAClD;IACI,CAAC;IACD,OAAO,CAACM,SAAS,EAAE,IAAAG,0BAAa,EAACN,OAAO,CAAC,EAAE,IAAAO,8BAAe,EAACP,OAAO,CAAC,EAAE,IAAAQ,gBAAQ,EAACR,OAAO,CAAC,EAAE,IAAAS,gBAAQ,EAACT,OAAO,CAAC,CAAC;EAC5G,CAAC;EACDU,MAAM,EAAE;IACN,qBAAqB,EAAE,CAAC,CAAC;IACzB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC;AAEK,MAAMC,0BAA6C,mCACrDhB,gBAAgB;EACnBC,IAAI,EAAE,oBAAoB;EAC1BgB,MAAM,EAAE;AAAI,EACb;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.compositionFile = void 0;
|
|
7
|
-
|
|
8
7
|
const compositionFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -32,7 +31,6 @@ export const BasicThemeUsage = () => {
|
|
|
32
31
|
`
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
|
-
|
|
36
34
|
exports.compositionFile = compositionFile;
|
|
37
35
|
|
|
38
36
|
//# sourceMappingURL=composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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}-context.composition.tsx`,\n content: `import React, { useContext } from 'react';\nimport { ${Name}Provider } from './${name}-context-provider';\nimport { ${Name}Context } from './${name}-context';\n\nexport function MockComponent() {\n const theme = useContext(${Name}Context);\n\n return <div style={{ color: theme.color }}>this should be {theme.color}</div>;\n}\n\nexport const BasicThemeUsage = () => {\n return (\n <${Name}Provider color=\"blue\">\n <MockComponent />\n </${Name}Provider>\n );\n};\n`,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"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}-context.composition.tsx`,\n content: `import React, { useContext } from 'react';\nimport { ${Name}Provider } from './${name}-context-provider';\nimport { ${Name}Context } from './${name}-context';\n\nexport function MockComponent() {\n const theme = useContext(${Name}Context);\n\n return <div style={{ color: theme.color }}>this should be {theme.color}</div>;\n}\n\nexport const BasicThemeUsage = () => {\n return (\n <${Name}Provider color=\"blue\">\n <MockComponent />\n </${Name}Provider>\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,0BAAyB;IAC/CI,OAAO,EAAG;AACd,WAAWF,IAAK,sBAAqBF,IAAK;AAC1C,WAAWE,IAAK,qBAAoBF,IAAK;AACzC;AACA;AACA,6BAA6BE,IAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAK;AACZ;AACA,QAAQA,IAAK;AACb;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.contextProviderFile = void 0;
|
|
7
|
-
|
|
8
7
|
const contextProviderFile = context => {
|
|
9
8
|
const {
|
|
10
9
|
name,
|
|
@@ -33,7 +32,6 @@ export function ${Name}Provider({ color, children }: ${Name}ProviderProps) {
|
|
|
33
32
|
`
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
exports.contextProviderFile = contextProviderFile;
|
|
38
36
|
|
|
39
37
|
//# sourceMappingURL=context-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["contextProviderFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["context-provider.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const contextProviderFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}-context-provider.tsx`,\n content: `import React, { ReactNode } from 'react';\nimport { ${Name}Context } from './${name}-context';\n\nexport type ${Name}ProviderProps = {\n /**\n * primary color of theme.\n */\n color?: string,\n\n /**\n * children to be rendered within this theme.\n */\n children: ReactNode\n};\n\nexport function ${Name}Provider({ color, children }: ${Name}ProviderProps) {\n return <${Name}Context.Provider value={{ color }}>{children}</${Name}Context.Provider>\n}\n`,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["contextProviderFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["context-provider.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const contextProviderFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}-context-provider.tsx`,\n content: `import React, { ReactNode } from 'react';\nimport { ${Name}Context } from './${name}-context';\n\nexport type ${Name}ProviderProps = {\n /**\n * primary color of theme.\n */\n color?: string,\n\n /**\n * children to be rendered within this theme.\n */\n children: ReactNode\n};\n\nexport function ${Name}Provider({ color, children }: ${Name}ProviderProps) {\n return <${Name}Context.Provider value={{ color }}>{children}</${Name}Context.Provider>\n}\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,mBAAmB,GAAIC,OAAyB,IAAK;EAChE,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,uBAAsB;IAC5CI,OAAO,EAAG;AACd,WAAWF,IAAK,qBAAoBF,IAAK;AACzC;AACA,cAAcE,IAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBA,IAAK,iCAAgCA,IAAK;AAC5D,YAAYA,IAAK,kDAAiDA,IAAK;AACvE;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
|