@teambit/react 0.0.675 → 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.
Files changed (64) hide show
  1. package/artifacts/env-template/public/420.js +1 -0
  2. package/artifacts/env-template/public/677.js +1 -0
  3. package/artifacts/env-template/public/750.js +12 -0
  4. package/artifacts/env-template/public/793.js +218 -0
  5. package/artifacts/env-template/public/888.js +1 -0
  6. package/artifacts/env-template/public/assets-manifest.json +22 -22
  7. package/artifacts/env-template/public/compositions.0cb8882cb213d0185254.js +1 -0
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/{overview.69846c0746b5b6398f68.js → overview.f077d05bdceaaad03b01.js} +1 -1
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/peers.c004d6a34765e7797913.js +1 -0
  12. package/artifacts/env-template/public/preview-root.0368612b0bf9eb282541.js +1 -0
  13. package/artifacts/env-template/public/service-worker.js +1 -1
  14. package/artifacts/env-template/public/static/css/{719.a22d71af.css → 793.2c0416f7.css} +1 -1
  15. package/artifacts/preview/teambit_react_react-preview.js +1 -1
  16. package/{compositions-1647228138686.js → compositions-1647487436311.js} +0 -0
  17. package/dist/react.composition.js +1 -1
  18. package/dist/react.composition.js.map +1 -1
  19. package/dist/react.docs.mdx +1 -1
  20. package/dist/react.env.d.ts +5 -2
  21. package/dist/react.env.js +33 -10
  22. package/dist/react.env.js.map +1 -1
  23. package/dist/templates/react-app/files/app.js +3 -7
  24. package/dist/templates/react-app/files/app.js.map +1 -1
  25. package/dist/templates/react-app/files/compositions.js +6 -1
  26. package/dist/templates/react-app/files/compositions.js.map +1 -1
  27. package/dist/templates/react-component/index.js +7 -6
  28. package/dist/templates/react-component/index.js.map +1 -1
  29. package/dist/templates/react-component-js/index.js +7 -6
  30. package/dist/templates/react-component-js/index.js.map +1 -1
  31. package/dist/templates/react-context/index.js +7 -6
  32. package/dist/templates/react-context/index.js.map +1 -1
  33. package/dist/templates/react-env/index.js +1 -1
  34. package/dist/templates/react-env/index.js.map +1 -1
  35. package/dist/templates/react-hook/index.js +7 -6
  36. package/dist/templates/react-hook/index.js.map +1 -1
  37. package/dist/templates/react-workspace/index.js +14 -21
  38. package/dist/templates/react-workspace/index.js.map +1 -1
  39. package/dist/templates/workspace-common/files/workspace-config.js +2 -32
  40. package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
  41. package/{overview-1647228138686.js → overview-1647487436311.js} +0 -0
  42. package/package-tar/teambit-react-0.0.678.tgz +0 -0
  43. package/package.json +30 -30
  44. package/{preview-1647228138686.js → preview-1647487436311.js} +2 -2
  45. package/react.composition.tsx +1 -1
  46. package/react.docs.mdx +1 -1
  47. package/templates/react-app/files/app.ts +3 -7
  48. package/templates/react-app/files/compositions.ts +6 -1
  49. package/templates/react-component/index.ts +6 -5
  50. package/templates/react-component-js/index.ts +6 -5
  51. package/templates/react-context/index.ts +6 -5
  52. package/templates/react-env/index.ts +1 -1
  53. package/templates/react-hook/index.ts +6 -5
  54. package/templates/react-workspace/index.ts +13 -13
  55. package/templates/workspace-common/files/workspace-config.ts +2 -32
  56. package/artifacts/env-template/public/141.js +0 -12
  57. package/artifacts/env-template/public/181.js +0 -1
  58. package/artifacts/env-template/public/475.js +0 -1
  59. package/artifacts/env-template/public/719.js +0 -218
  60. package/artifacts/env-template/public/848.js +0 -1
  61. package/artifacts/env-template/public/compositions.42a3bb9453dc926b0fee.js +0 -1
  62. package/artifacts/env-template/public/peers.e9c6c15491f6fc7c952b.js +0 -1
  63. package/artifacts/env-template/public/preview-root.32f61f9d9b2491abb762.js +0 -1
  64. package/package-tar/teambit-react-0.0.675.tgz +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/react",
3
- "version": "0.0.675",
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.675"
9
+ "version": "0.0.678"
10
10
  },
11
11
  "dependencies": {
12
12
  "react-error-boundary": "^3.0.0",
@@ -79,39 +79,39 @@
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.675",
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.675",
89
- "@teambit/bundler": "0.0.675",
90
- "@teambit/compiler": "0.0.675",
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.675",
93
- "@teambit/envs": "0.0.675",
94
- "@teambit/eslint": "0.0.675",
95
- "@teambit/formatter": "0.0.226",
96
- "@teambit/jest": "0.0.675",
97
- "@teambit/linter": "0.0.675",
98
- "@teambit/pkg": "0.0.675",
99
- "@teambit/prettier": "0.0.226",
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.675",
102
- "@teambit/tester": "0.0.675",
103
- "@teambit/typescript": "0.0.675",
104
- "@teambit/webpack": "0.0.675",
105
- "@teambit/workspace": "0.0.675",
106
- "@teambit/application": "0.0.317",
107
- "@teambit/cli": "0.0.452",
108
- "@teambit/dependency-resolver": "0.0.675",
109
- "@teambit/generator": "0.0.675",
110
- "@teambit/graphql": "0.0.675",
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
+ "@teambit/cli": "0.0.453",
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.675",
113
- "@teambit/ui": "0.0.675",
114
- "@teambit/react.eslint-config-bit-react": "0.0.529",
112
+ "@teambit/compositions": "0.0.678",
113
+ "@teambit/ui": "0.0.678",
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",
117
117
  "@teambit/webpack.modules.config-mutator": "0.0.137",
@@ -121,7 +121,7 @@
121
121
  "@teambit/webpack.modules.style-regexps": "0.0.132",
122
122
  "@teambit/component-id": "0.0.401",
123
123
  "@teambit/toolbox.network.get-port": "0.0.113",
124
- "@teambit/config": "0.0.465"
124
+ "@teambit/config": "0.0.466"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@types/react": "^17.0.8",
@@ -140,7 +140,7 @@
140
140
  "@teambit/react.content.react-overview": "1.95.0"
141
141
  },
142
142
  "peerDependencies": {
143
- "@teambit/legacy": "1.0.231",
143
+ "@teambit/legacy": "1.0.232",
144
144
  "react-dom": "^16.8.0 || ^17.0.0",
145
145
  "react": "^16.8.0 || ^17.0.0"
146
146
  },
@@ -202,7 +202,7 @@
202
202
  "@types/jest": "^26.0.0"
203
203
  },
204
204
  "peerDependencies": {
205
- "@teambit/legacy": "1.0.231",
205
+ "@teambit/legacy": "1.0.232",
206
206
  "react-dom": "^16.8.0 || ^17.0.0",
207
207
  "react": "^16.8.0 || ^17.0.0"
208
208
  }
@@ -1,2 +1,2 @@
1
- export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.675/dist/react.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.675/dist/react.docs.mdx')]
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')]
@@ -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/brands/logo-react.svg" />
5
+ <img style={{ width: 70 }} src="https://static.bit.dev/extensions-icons/react.svg" />
6
6
  </div>
7
7
  );
package/react.docs.mdx CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: A Bit development environment for React Components
2
+ description: A development environment for React Components
3
3
  labels: ['react', 'environment', 'env', 'aspect', 'extension']
4
4
  ---
5
5
 
@@ -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 { BrowserRouter, Routes, Route } from 'react-router-dom';
5
+ import { Routes, Route } from 'react-router-dom';
6
6
 
7
7
  export function ${Name}App() {
8
8
  return (
9
- <BrowserRouter>
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 <${Name}App />;
9
+ return (
10
+ <MemoryRouter>
11
+ <${Name}App />
12
+ </MemoryRouter>
13
+ );
9
14
  };
10
15
  `;
11
16
  }
@@ -11,11 +11,12 @@ export const reactComponent: ComponentTemplate = {
11
11
  generateFiles: (context: ComponentContext) => {
12
12
  return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
13
13
  },
14
- // config: {
15
- // 'teambit.envs/envs': {
16
- // env: 'teambit.react/react',
17
- // },
18
- // }
14
+ config: {
15
+ 'teambit.react/react': {},
16
+ 'teambit.envs/envs': {
17
+ env: 'teambit.react/react',
18
+ },
19
+ },
19
20
  };
20
21
 
21
22
  export const deprecatedReactComponent: ComponentTemplate = {
@@ -17,11 +17,12 @@ export const reactComponentJS: ComponentTemplate = {
17
17
  };
18
18
  return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
19
19
  },
20
- // config: {
21
- // 'teambit.envs/envs': {
22
- // env: 'teambit.react/react',
23
- // },
24
- // }
20
+ config: {
21
+ 'teambit.react/react': {},
22
+ 'teambit.envs/envs': {
23
+ env: 'teambit.react/react',
24
+ },
25
+ },
25
26
  };
26
27
 
27
28
  export const deprecatedReactComponentJS: ComponentTemplate = {
@@ -20,9 +20,10 @@ export const reactContext: ComponentTemplate = {
20
20
  testFile(context),
21
21
  ];
22
22
  },
23
- // config: {
24
- // 'teambit.envs/envs': {
25
- // env: 'teambit.react/react',
26
- // },
27
- // }
23
+ config: {
24
+ 'teambit.react/react': {},
25
+ 'teambit.envs/envs': {
26
+ env: 'teambit.react/react',
27
+ },
28
+ },
28
29
  };
@@ -49,7 +49,7 @@ export const reactEnvTemplate: ComponentTemplate = {
49
49
  ];
50
50
  },
51
51
  config: {
52
- 'teambit.envs/env': {},
52
+ 'teambit.react/react': {},
53
53
  'teambit.envs/envs': {
54
54
  env: 'teambit.envs/env',
55
55
  },
@@ -12,9 +12,10 @@ export const reactHook: ComponentTemplate = {
12
12
  generateFiles: (context: ComponentContext) => {
13
13
  return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
14
14
  },
15
- // config: {
16
- // 'teambit.envs/envs': {
17
- // env: 'teambit.react/react',
18
- // },
19
- // }
15
+ config: {
16
+ 'teambit.react/react': {},
17
+ 'teambit.envs/envs': {
18
+ env: 'teambit.react/react',
19
+ },
20
+ },
20
21
  };
@@ -9,19 +9,19 @@ export const reactWorkspaceTemplate: WorkspaceTemplate = {
9
9
  },
10
10
  importComponents: () => {
11
11
  return [
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
- },
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 || 'company.scope';
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);