@teambit/react 0.0.677 → 0.0.678
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/420.js +1 -1
- package/artifacts/env-template/public/750.js +1 -1
- package/artifacts/env-template/public/793.js +12 -12
- package/artifacts/env-template/public/888.js +1 -0
- package/artifacts/env-template/public/assets-manifest.json +10 -10
- package/artifacts/env-template/public/{compositions.9f1fdfc34d67494ac1e2.js → compositions.0cb8882cb213d0185254.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.dce6c29fd17b93a21bd4.js → overview.f077d05bdceaaad03b01.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/preview-root.0368612b0bf9eb282541.js +1 -0
- package/artifacts/env-template/public/service-worker.js +1 -1
- package/artifacts/env-template/public/static/css/{793.dafc3ad5.css → 793.2c0416f7.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1647401023351.js → compositions-1647487436311.js} +0 -0
- package/dist/react.composition.js +1 -1
- package/dist/react.composition.js.map +1 -1
- package/dist/react.docs.mdx +1 -1
- package/dist/templates/react-app/files/app.js +3 -7
- package/dist/templates/react-app/files/app.js.map +1 -1
- package/dist/templates/react-app/files/compositions.js +6 -1
- package/dist/templates/react-app/files/compositions.js.map +1 -1
- package/dist/templates/react-workspace/index.js +14 -21
- package/dist/templates/react-workspace/index.js.map +1 -1
- package/dist/templates/workspace-common/files/workspace-config.js +2 -32
- package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
- package/{overview-1647401023351.js → overview-1647487436311.js} +0 -0
- package/package-tar/teambit-react-0.0.678.tgz +0 -0
- package/package.json +25 -25
- package/{preview-1647401023351.js → preview-1647487436311.js} +2 -2
- package/react.composition.tsx +1 -1
- package/react.docs.mdx +1 -1
- package/templates/react-app/files/app.ts +3 -7
- package/templates/react-app/files/compositions.ts +6 -1
- package/templates/react-workspace/index.ts +13 -13
- package/templates/workspace-common/files/workspace-config.ts +2 -32
- package/artifacts/env-template/public/965.js +0 -1
- package/artifacts/env-template/public/preview-root.2b0cd7db56266d32895e.js +0 -1
- package/package-tar/teambit-react-0.0.677.tgz +0 -0
package/dist/react.docs.mdx
CHANGED
|
@@ -9,14 +9,12 @@ function appFile({
|
|
|
9
9
|
namePascalCase: Name
|
|
10
10
|
}) {
|
|
11
11
|
return `import React from 'react';
|
|
12
|
-
import {
|
|
12
|
+
import { Routes, Route } from 'react-router-dom';
|
|
13
13
|
|
|
14
14
|
export function ${Name}App() {
|
|
15
15
|
return (
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
<>
|
|
18
17
|
{/* header component */}
|
|
19
|
-
|
|
20
18
|
<Routes>
|
|
21
19
|
<Route path="/" element={<div>Hello World!!</div>}>
|
|
22
20
|
{/* home page component */}
|
|
@@ -27,10 +25,8 @@ export function ${Name}App() {
|
|
|
27
25
|
</Route>
|
|
28
26
|
|
|
29
27
|
</Routes>
|
|
30
|
-
|
|
31
28
|
{/* footer component */}
|
|
32
|
-
|
|
33
|
-
</BrowserRouter>
|
|
29
|
+
</>
|
|
34
30
|
);
|
|
35
31
|
}
|
|
36
32
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["app.ts"],"names":["appFile","namePascalCase","Name"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiB;AAAEC,EAAAA,cAAc,EAAEC;AAAlB,CAAjB,EAA6D;AAClE,SAAQ;AACV;AACA;AACA,kBAAkBA,IAAK;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["app.ts"],"names":["appFile","namePascalCase","Name"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiB;AAAEC,EAAAA,cAAc,EAAEC;AAAlB,CAAjB,EAA6D;AAClE,SAAQ;AACV;AACA;AACA,kBAAkBA,IAAK;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CArBE;AAsBD","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"]}
|
|
@@ -9,10 +9,15 @@ function compositionsFile({
|
|
|
9
9
|
namePascalCase: Name
|
|
10
10
|
}) {
|
|
11
11
|
return `import React from 'react';
|
|
12
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
12
13
|
import { ${Name}App } from './app';
|
|
13
14
|
|
|
14
15
|
export const ${Name}Basic = () => {
|
|
15
|
-
return
|
|
16
|
+
return (
|
|
17
|
+
<MemoryRouter>
|
|
18
|
+
<${Name}App />
|
|
19
|
+
</MemoryRouter>
|
|
20
|
+
);
|
|
16
21
|
};
|
|
17
22
|
`;
|
|
18
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["compositions.ts"],"names":["compositionsFile","namePascalCase","Name"],"mappings":";;;;;;;AAEO,SAASA,gBAAT,CAA0B;AAAEC,EAAAA,cAAc,EAAEC;AAAlB,CAA1B,EAAsE;AAC3E,SAAQ;AACV,WAAWA,IAAK;AAChB;AACA,eAAeA,IAAK;AACpB,
|
|
1
|
+
{"version":3,"sources":["compositions.ts"],"names":["compositionsFile","namePascalCase","Name"],"mappings":";;;;;;;AAEO,SAASA,gBAAT,CAA0B;AAAEC,EAAAA,cAAc,EAAEC;AAAlB,CAA1B,EAAsE;AAC3E,SAAQ;AACV;AACA,WAAWA,IAAK;AAChB;AACA,eAAeA,IAAK;AACpB;AACA;AACA,SAASA,IAAK;AACd;AACA;AACA;AACA,CAXE;AAYD","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"]}
|
|
@@ -24,27 +24,20 @@ const reactWorkspaceTemplate = {
|
|
|
24
24
|
return (0, _workspaceCommon().generateFiles)(context);
|
|
25
25
|
},
|
|
26
26
|
importComponents: () => {
|
|
27
|
-
return [{
|
|
28
|
-
id: 'teambit.react/templates/envs/my-react',
|
|
29
|
-
targetName: 'envs/my-react',
|
|
30
|
-
path: 'demo/envs/my-react'
|
|
31
|
-
|
|
32
|
-
id: 'teambit.react/templates/ui/text',
|
|
33
|
-
targetName: 'ui/
|
|
34
|
-
path: 'demo/ui/
|
|
35
|
-
|
|
36
|
-
id: 'teambit.react/templates/
|
|
37
|
-
targetName: '
|
|
38
|
-
path: 'demo/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
targetName: 'ui/card',
|
|
42
|
-
path: 'demo/ui/card'
|
|
43
|
-
}, {
|
|
44
|
-
id: 'teambit.react/templates/pages/welcome',
|
|
45
|
-
targetName: 'pages/welcome',
|
|
46
|
-
path: 'demo/pages/welcome'
|
|
47
|
-
}];
|
|
27
|
+
return [// {
|
|
28
|
+
// id: 'teambit.react/templates/envs/my-react',
|
|
29
|
+
// targetName: 'envs/my-react',
|
|
30
|
+
// path: 'demo/envs/my-react',
|
|
31
|
+
// },
|
|
32
|
+
// { id: 'teambit.react/templates/ui/text', targetName: 'ui/text', path: 'demo/ui/text' },
|
|
33
|
+
// { id: 'teambit.react/templates/ui/heading', targetName: 'ui/heading', path: 'demo/ui/heading' },
|
|
34
|
+
// { id: 'teambit.react/templates/ui/card', targetName: 'ui/card', path: 'demo/ui/card' },
|
|
35
|
+
// {
|
|
36
|
+
// id: 'teambit.react/templates/pages/welcome',
|
|
37
|
+
// targetName: 'pages/welcome',
|
|
38
|
+
// path: 'demo/pages/welcome',
|
|
39
|
+
// },
|
|
40
|
+
];
|
|
48
41
|
}
|
|
49
42
|
};
|
|
50
43
|
exports.reactWorkspaceTemplate = reactWorkspaceTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["reactWorkspaceTemplate","name","description","generateFiles","context","importComponents"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["reactWorkspaceTemplate","name","description","generateFiles","context","importComponents"],"mappings":";;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,sBAAyC,GAAG;AACvDC,EAAAA,IAAI,EAAE,OADiD;AAEvDC,EAAAA,WAAW,EAAE,sCAF0C;AAGvDC,EAAAA,aAAa,EAAE,MAAOC,OAAP,IAAqC;AAClD,WAAO,sCAAoBA,OAApB,CAAP;AACD,GALsD;AAMvDC,EAAAA,gBAAgB,EAAE,MAAM;AACtB,WAAO,CACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbK,KAAP;AAeD;AAtBsD,CAAlD","sourcesContent":["import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';\nimport { generateFiles as generateCommonFiles } from '../workspace-common';\n\nexport const reactWorkspaceTemplate: WorkspaceTemplate = {\n name: 'react',\n description: 'React workspace with demo components',\n generateFiles: async (context: WorkspaceContext) => {\n return generateCommonFiles(context);\n },\n importComponents: () => {\n return [\n // {\n // id: 'teambit.react/templates/envs/my-react',\n // targetName: 'envs/my-react',\n // path: 'demo/envs/my-react',\n // },\n // { id: 'teambit.react/templates/ui/text', targetName: 'ui/text', path: 'demo/ui/text' },\n // { id: 'teambit.react/templates/ui/heading', targetName: 'ui/heading', path: 'demo/ui/heading' },\n // { id: 'teambit.react/templates/ui/card', targetName: 'ui/card', path: 'demo/ui/card' },\n // {\n // id: 'teambit.react/templates/pages/welcome',\n // targetName: 'pages/welcome',\n // path: 'demo/pages/welcome',\n // },\n ];\n },\n};\n"]}
|
|
@@ -31,7 +31,7 @@ async function workspaceConfig({
|
|
|
31
31
|
name,
|
|
32
32
|
defaultScope
|
|
33
33
|
}) {
|
|
34
|
-
const scope = defaultScope || '
|
|
34
|
+
const scope = defaultScope || 'my-org.my-scope';
|
|
35
35
|
const configParsed = await (0, _config().getWorkspaceConfigTemplateParsed)();
|
|
36
36
|
configParsed['teambit.workspace/workspace'].name = name;
|
|
37
37
|
configParsed['teambit.workspace/workspace'].defaultScope = scope;
|
|
@@ -54,37 +54,7 @@ async function workspaceConfig({
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
const variants = {
|
|
57
|
-
'teambit.workspace/variants': (0, _commentJson().parse)(`{
|
|
58
|
-
/**
|
|
59
|
-
* configures all components with namespaces 'ui', 'blocks', 'pages' and 'themes'
|
|
60
|
-
* to use the default React development environment.
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
"{ui/**}, {blocks/**}, {pages/**}, {themes/**}": {
|
|
64
|
-
"teambit.react/react": {}
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* configures components with namespaces 'entities', 'modules' and 'functions' to use the
|
|
69
|
-
* default NodeJS dev environment.
|
|
70
|
-
*/
|
|
71
|
-
"{entities/**}, {modules/**}, {functions/**}": {
|
|
72
|
-
"teambit.harmony/node": {}
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* configures components with namespace 'content' to use the MDX dev environment.
|
|
76
|
-
*/
|
|
77
|
-
"{content/**}": {
|
|
78
|
-
"teambit.mdx/mdx": {}
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* configures components with namespaces 'envs' and 'aspects' to use the default Aspect development environment.
|
|
83
|
-
*/
|
|
84
|
-
"{envs/**}, {aspects/**}, {apps/**}": {
|
|
85
|
-
"teambit.harmony/aspect": {}
|
|
86
|
-
}
|
|
87
|
-
}`)
|
|
57
|
+
'teambit.workspace/variants': (0, _commentJson().parse)(`{}`)
|
|
88
58
|
};
|
|
89
59
|
const configMerged = (0, _commentJson().assign)(configParsed, variants);
|
|
90
60
|
return (0, _config().stringifyWorkspaceConfig)(configMerged);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["workspace-config.ts"],"names":["workspaceConfig","name","defaultScope","scope","configParsed","packageManager","policy","dependencies","peerDependencies","react","variants","configMerged"],"mappings":";;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,eAAeA,eAAf,CAA+B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAA/B,EAAyE;AAC9E,QAAMC,KAAK,GAAGD,YAAY,IAAI,
|
|
1
|
+
{"version":3,"sources":["workspace-config.ts"],"names":["workspaceConfig","name","defaultScope","scope","configParsed","packageManager","policy","dependencies","peerDependencies","react","variants","configMerged"],"mappings":";;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,eAAeA,eAAf,CAA+B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAA/B,EAAyE;AAC9E,QAAMC,KAAK,GAAGD,YAAY,IAAI,iBAA9B;AACA,QAAME,YAAY,GAAG,MAAM,iDAA3B;AACAA,EAAAA,YAAY,CAAC,6BAAD,CAAZ,CAA4CH,IAA5C,GAAmDA,IAAnD;AACAG,EAAAA,YAAY,CAAC,6BAAD,CAAZ,CAA4CF,YAA5C,GAA2DC,KAA3D;AACAC,EAAAA,YAAY,CAAC,0CAAD,CAAZ,CAAyDC,cAAzD,GAA0E,2BAA1E;AACAD,EAAAA,YAAY,CAAC,0CAAD,CAAZ,CAAyDE,MAAzD,GAAkE;AAChEC,IAAAA,YAAY,EAAE;AACZ,0CAAoC,UADxB;AAEZ,0CAAoC,QAFxB;AAGZ,qCAA+B,OAHnB;AAIZ,8BAAwB,QAJZ;AAKZ,4BAAsB,QALV;AAMZ,gCAA0B,OANd;AAOZ,2BAAqB,QAPT;AAQZ,6BAAuB;AARX,KADkD;AAWhEC,IAAAA,gBAAgB,EAAE;AAChB,gCAA0B,QADV;AAEhBC,MAAAA,KAAK,EAAE,QAFS;AAGhB,mBAAa;AAHG;AAX8C,GAAlE;AAkBA,QAAMC,QAAQ,GAAG;AACf,kCAA8B,0BAAO,IAAP;AADf,GAAjB;AAIA,QAAMC,YAAY,GAAG,2BAAOP,YAAP,EAAqBM,QAArB,CAArB;AAEA,SAAO,wCAAyBC,YAAzB,CAAP;AACD","sourcesContent":["import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\nimport { parse, assign } from 'comment-json';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const scope = defaultScope || 'my-org.my-scope';\n const configParsed = await getWorkspaceConfigTemplateParsed();\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = scope;\n configParsed['teambit.dependencies/dependency-resolver'].packageManager = 'teambit.dependencies/pnpm';\n configParsed['teambit.dependencies/dependency-resolver'].policy = {\n dependencies: {\n '@teambit/eslint-config-bit-react': '~0.0.367',\n '@typescript-eslint/eslint-plugin': '4.29.3',\n 'eslint-import-resolver-node': '0.3.6',\n 'eslint-plugin-import': '2.22.1',\n 'eslint-plugin-jest': '24.4.0',\n 'eslint-plugin-jsx-a11y': '6.4.1',\n 'eslint-plugin-mdx': '1.15.0',\n 'eslint-plugin-react': '7.25.1',\n },\n peerDependencies: {\n '@testing-library/react': '12.0.0',\n react: '17.0.2',\n 'react-dom': '17.0.2',\n },\n };\n\n const variants = {\n 'teambit.workspace/variants': parse(`{}`),\n };\n\n const configMerged = assign(configParsed, variants);\n\n return stringifyWorkspaceConfig(configMerged);\n}\n"]}
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.678",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/react/react",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.react",
|
|
8
8
|
"name": "react",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.678"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"react-error-boundary": "^3.0.0",
|
|
@@ -79,38 +79,38 @@
|
|
|
79
79
|
"@teambit/react.instructions.react.adding-compositions": "0.0.6",
|
|
80
80
|
"@teambit/react.instructions.react.adding-tests": "0.0.6",
|
|
81
81
|
"@teambit/design.ui.pages.standalone-not-found-page": "0.0.355",
|
|
82
|
-
"@teambit/preview": "0.0.
|
|
82
|
+
"@teambit/preview": "0.0.678",
|
|
83
83
|
"@teambit/react.ui.error-fallback": "0.0.110",
|
|
84
84
|
"@teambit/react.ui.loader-fallback": "0.0.89",
|
|
85
85
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
86
86
|
"@teambit/design.ui.input.option-button": "0.0.26",
|
|
87
87
|
"@teambit/design.ui.tooltip": "0.0.352",
|
|
88
|
-
"@teambit/builder": "0.0.
|
|
89
|
-
"@teambit/bundler": "0.0.
|
|
90
|
-
"@teambit/compiler": "0.0.
|
|
88
|
+
"@teambit/builder": "0.0.678",
|
|
89
|
+
"@teambit/bundler": "0.0.678",
|
|
90
|
+
"@teambit/compiler": "0.0.678",
|
|
91
91
|
"@teambit/component.modules.component-url": "0.0.123",
|
|
92
|
-
"@teambit/component": "0.0.
|
|
93
|
-
"@teambit/envs": "0.0.
|
|
94
|
-
"@teambit/eslint": "0.0.
|
|
95
|
-
"@teambit/formatter": "0.0.
|
|
96
|
-
"@teambit/jest": "0.0.
|
|
97
|
-
"@teambit/linter": "0.0.
|
|
98
|
-
"@teambit/pkg": "0.0.
|
|
99
|
-
"@teambit/prettier": "0.0.
|
|
92
|
+
"@teambit/component": "0.0.678",
|
|
93
|
+
"@teambit/envs": "0.0.678",
|
|
94
|
+
"@teambit/eslint": "0.0.678",
|
|
95
|
+
"@teambit/formatter": "0.0.229",
|
|
96
|
+
"@teambit/jest": "0.0.678",
|
|
97
|
+
"@teambit/linter": "0.0.678",
|
|
98
|
+
"@teambit/pkg": "0.0.678",
|
|
99
|
+
"@teambit/prettier": "0.0.229",
|
|
100
100
|
"@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
|
|
101
|
-
"@teambit/schema": "0.0.
|
|
102
|
-
"@teambit/tester": "0.0.
|
|
103
|
-
"@teambit/typescript": "0.0.
|
|
104
|
-
"@teambit/webpack": "0.0.
|
|
105
|
-
"@teambit/workspace": "0.0.
|
|
106
|
-
"@teambit/application": "0.0.
|
|
101
|
+
"@teambit/schema": "0.0.678",
|
|
102
|
+
"@teambit/tester": "0.0.678",
|
|
103
|
+
"@teambit/typescript": "0.0.678",
|
|
104
|
+
"@teambit/webpack": "0.0.678",
|
|
105
|
+
"@teambit/workspace": "0.0.678",
|
|
106
|
+
"@teambit/application": "0.0.320",
|
|
107
107
|
"@teambit/cli": "0.0.453",
|
|
108
|
-
"@teambit/dependency-resolver": "0.0.
|
|
109
|
-
"@teambit/generator": "0.0.
|
|
110
|
-
"@teambit/graphql": "0.0.
|
|
108
|
+
"@teambit/dependency-resolver": "0.0.678",
|
|
109
|
+
"@teambit/generator": "0.0.678",
|
|
110
|
+
"@teambit/graphql": "0.0.678",
|
|
111
111
|
"@teambit/react.ui.highlighter-provider": "0.0.184",
|
|
112
|
-
"@teambit/compositions": "0.0.
|
|
113
|
-
"@teambit/ui": "0.0.
|
|
112
|
+
"@teambit/compositions": "0.0.678",
|
|
113
|
+
"@teambit/ui": "0.0.678",
|
|
114
114
|
"@teambit/react.eslint-config-bit-react": "0.0.530",
|
|
115
115
|
"@teambit/webpack.modules.generate-expose-loaders": "0.0.3",
|
|
116
116
|
"@teambit/webpack.modules.generate-externals": "0.0.3",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.678/dist/react.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.678/dist/react.docs.mdx')]
|
package/react.composition.tsx
CHANGED
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export const Logo = () => (
|
|
4
4
|
<div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>
|
|
5
|
-
<img style={{ width: 70 }} src="https://static.bit.dev/
|
|
5
|
+
<img style={{ width: 70 }} src="https://static.bit.dev/extensions-icons/react.svg" />
|
|
6
6
|
</div>
|
|
7
7
|
);
|
package/react.docs.mdx
CHANGED
|
@@ -2,14 +2,12 @@ import { ComponentContext } from '@teambit/generator';
|
|
|
2
2
|
|
|
3
3
|
export function appFile({ namePascalCase: Name }: ComponentContext) {
|
|
4
4
|
return `import React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { Routes, Route } from 'react-router-dom';
|
|
6
6
|
|
|
7
7
|
export function ${Name}App() {
|
|
8
8
|
return (
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
<>
|
|
11
10
|
{/* header component */}
|
|
12
|
-
|
|
13
11
|
<Routes>
|
|
14
12
|
<Route path="/" element={<div>Hello World!!</div>}>
|
|
15
13
|
{/* home page component */}
|
|
@@ -20,10 +18,8 @@ export function ${Name}App() {
|
|
|
20
18
|
</Route>
|
|
21
19
|
|
|
22
20
|
</Routes>
|
|
23
|
-
|
|
24
21
|
{/* footer component */}
|
|
25
|
-
|
|
26
|
-
</BrowserRouter>
|
|
22
|
+
</>
|
|
27
23
|
);
|
|
28
24
|
}
|
|
29
25
|
`;
|
|
@@ -2,10 +2,15 @@ import { ComponentContext } from '@teambit/generator';
|
|
|
2
2
|
|
|
3
3
|
export function compositionsFile({ namePascalCase: Name }: ComponentContext) {
|
|
4
4
|
return `import React from 'react';
|
|
5
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
5
6
|
import { ${Name}App } from './app';
|
|
6
7
|
|
|
7
8
|
export const ${Name}Basic = () => {
|
|
8
|
-
return
|
|
9
|
+
return (
|
|
10
|
+
<MemoryRouter>
|
|
11
|
+
<${Name}App />
|
|
12
|
+
</MemoryRouter>
|
|
13
|
+
);
|
|
9
14
|
};
|
|
10
15
|
`;
|
|
11
16
|
}
|
|
@@ -9,19 +9,19 @@ export const reactWorkspaceTemplate: WorkspaceTemplate = {
|
|
|
9
9
|
},
|
|
10
10
|
importComponents: () => {
|
|
11
11
|
return [
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
{ id: 'teambit.react/templates/ui/text', targetName: 'ui/text', path: 'demo/ui/text' },
|
|
18
|
-
{ id: 'teambit.react/templates/ui/heading', targetName: 'ui/heading', path: 'demo/ui/heading' },
|
|
19
|
-
{ id: 'teambit.react/templates/ui/card', targetName: 'ui/card', path: 'demo/ui/card' },
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
12
|
+
// {
|
|
13
|
+
// id: 'teambit.react/templates/envs/my-react',
|
|
14
|
+
// targetName: 'envs/my-react',
|
|
15
|
+
// path: 'demo/envs/my-react',
|
|
16
|
+
// },
|
|
17
|
+
// { id: 'teambit.react/templates/ui/text', targetName: 'ui/text', path: 'demo/ui/text' },
|
|
18
|
+
// { id: 'teambit.react/templates/ui/heading', targetName: 'ui/heading', path: 'demo/ui/heading' },
|
|
19
|
+
// { id: 'teambit.react/templates/ui/card', targetName: 'ui/card', path: 'demo/ui/card' },
|
|
20
|
+
// {
|
|
21
|
+
// id: 'teambit.react/templates/pages/welcome',
|
|
22
|
+
// targetName: 'pages/welcome',
|
|
23
|
+
// path: 'demo/pages/welcome',
|
|
24
|
+
// },
|
|
25
25
|
];
|
|
26
26
|
},
|
|
27
27
|
};
|
|
@@ -3,7 +3,7 @@ import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@tea
|
|
|
3
3
|
import { parse, assign } from 'comment-json';
|
|
4
4
|
|
|
5
5
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
|
6
|
-
const scope = defaultScope || '
|
|
6
|
+
const scope = defaultScope || 'my-org.my-scope';
|
|
7
7
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
|
8
8
|
configParsed['teambit.workspace/workspace'].name = name;
|
|
9
9
|
configParsed['teambit.workspace/workspace'].defaultScope = scope;
|
|
@@ -27,37 +27,7 @@ export async function workspaceConfig({ name, defaultScope }: WorkspaceContext)
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const variants = {
|
|
30
|
-
'teambit.workspace/variants': parse(`{
|
|
31
|
-
/**
|
|
32
|
-
* configures all components with namespaces 'ui', 'blocks', 'pages' and 'themes'
|
|
33
|
-
* to use the default React development environment.
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
"{ui/**}, {blocks/**}, {pages/**}, {themes/**}": {
|
|
37
|
-
"teambit.react/react": {}
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* configures components with namespaces 'entities', 'modules' and 'functions' to use the
|
|
42
|
-
* default NodeJS dev environment.
|
|
43
|
-
*/
|
|
44
|
-
"{entities/**}, {modules/**}, {functions/**}": {
|
|
45
|
-
"teambit.harmony/node": {}
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* configures components with namespace 'content' to use the MDX dev environment.
|
|
49
|
-
*/
|
|
50
|
-
"{content/**}": {
|
|
51
|
-
"teambit.mdx/mdx": {}
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* configures components with namespaces 'envs' and 'aspects' to use the default Aspect development environment.
|
|
56
|
-
*/
|
|
57
|
-
"{envs/**}, {aspects/**}, {apps/**}": {
|
|
58
|
-
"teambit.harmony/aspect": {}
|
|
59
|
-
}
|
|
60
|
-
}`),
|
|
30
|
+
'teambit.workspace/variants': parse(`{}`),
|
|
61
31
|
};
|
|
62
32
|
|
|
63
33
|
const configMerged = assign(configParsed, variants);
|