@teambit/react 0.0.669 → 0.0.672

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 (50) hide show
  1. package/artifacts/env-template/public/141.js +2 -2
  2. package/artifacts/env-template/public/181.js +1 -1
  3. package/artifacts/env-template/public/719.js +26 -11
  4. package/artifacts/env-template/public/848.js +1 -1
  5. package/artifacts/env-template/public/97.js +1 -0
  6. package/artifacts/env-template/public/assets-manifest.json +10 -10
  7. package/artifacts/env-template/public/{compositions.b5aab9787f2891b766ea.js → compositions.7b484ff165e70174d8cb.js} +1 -1
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/{overview.2ffbf8cf879d4e322669.js → overview.ed25c31031724df4bd2f.js} +1 -1
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/preview-root.57a178d7814974524740.js +1 -0
  12. package/artifacts/env-template/public/service-worker.js +1 -1
  13. package/artifacts/env-template/public/static/css/719.4b9f4359.css +1 -0
  14. package/artifacts/preview/teambit_react_react-preview.js +1 -1
  15. package/{compositions-1646796119196.js → compositions-1646931465104.js} +0 -0
  16. package/dist/templates/react-component/files/index-file.d.ts +5 -0
  17. package/dist/templates/react-component/files/index-file.js +23 -0
  18. package/dist/templates/react-component/files/index-file.js.map +1 -0
  19. package/dist/templates/react-component/index.js +38 -29
  20. package/dist/templates/react-component/index.js.map +1 -1
  21. package/dist/templates/react-component-js/index.js +27 -17
  22. package/dist/templates/react-component-js/index.js.map +1 -1
  23. package/dist/templates/react-context/files/index-file.d.ts +5 -0
  24. package/dist/templates/react-context/files/index-file.js +25 -0
  25. package/dist/templates/react-context/files/index-file.js.map +1 -0
  26. package/dist/templates/react-context/index.js +17 -14
  27. package/dist/templates/react-context/index.js.map +1 -1
  28. package/dist/templates/react-env/index.js +6 -0
  29. package/dist/templates/react-env/index.js.map +1 -1
  30. package/dist/templates/react-hook/files/index-file.d.ts +5 -0
  31. package/dist/templates/react-hook/files/index-file.js +22 -0
  32. package/dist/templates/react-hook/files/index-file.js.map +1 -0
  33. package/dist/templates/react-hook/index.js +17 -11
  34. package/dist/templates/react-hook/index.js.map +1 -1
  35. package/{overview-1646796119196.js → overview-1646931465104.js} +0 -0
  36. package/package-tar/teambit-react-0.0.672.tgz +0 -0
  37. package/package.json +30 -30
  38. package/{preview-1646796119196.js → preview-1646931465104.js} +2 -2
  39. package/templates/react-component/files/index-file.ts +12 -0
  40. package/templates/react-component/index.ts +8 -22
  41. package/templates/react-component-js/index.ts +6 -13
  42. package/templates/react-context/files/index-file.ts +14 -0
  43. package/templates/react-context/index.ts +7 -11
  44. package/templates/react-env/index.ts +6 -0
  45. package/templates/react-hook/files/index-file.ts +11 -0
  46. package/templates/react-hook/index.ts +7 -8
  47. package/artifacts/env-template/public/130.js +0 -1
  48. package/artifacts/env-template/public/preview-root.fc3344d908c6099ff850.js +0 -1
  49. package/artifacts/env-template/public/static/css/719.683e3caf.css +0 -1
  50. package/package-tar/teambit-react-0.0.669.tgz +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/react",
3
- "version": "0.0.669",
3
+ "version": "0.0.672",
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.669"
9
+ "version": "0.0.672"
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.669",
82
+ "@teambit/preview": "0.0.672",
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.669",
89
- "@teambit/bundler": "0.0.669",
90
- "@teambit/compiler": "0.0.669",
88
+ "@teambit/builder": "0.0.672",
89
+ "@teambit/bundler": "0.0.672",
90
+ "@teambit/compiler": "0.0.672",
91
91
  "@teambit/component.modules.component-url": "0.0.123",
92
- "@teambit/component": "0.0.669",
93
- "@teambit/envs": "0.0.669",
94
- "@teambit/eslint": "0.0.669",
95
- "@teambit/formatter": "0.0.220",
96
- "@teambit/jest": "0.0.669",
97
- "@teambit/linter": "0.0.669",
98
- "@teambit/pkg": "0.0.669",
99
- "@teambit/prettier": "0.0.220",
92
+ "@teambit/component": "0.0.672",
93
+ "@teambit/envs": "0.0.672",
94
+ "@teambit/eslint": "0.0.672",
95
+ "@teambit/formatter": "0.0.223",
96
+ "@teambit/jest": "0.0.672",
97
+ "@teambit/linter": "0.0.672",
98
+ "@teambit/pkg": "0.0.672",
99
+ "@teambit/prettier": "0.0.223",
100
100
  "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
101
- "@teambit/schema": "0.0.669",
102
- "@teambit/tester": "0.0.669",
103
- "@teambit/typescript": "0.0.669",
104
- "@teambit/webpack": "0.0.669",
105
- "@teambit/workspace": "0.0.669",
106
- "@teambit/application": "0.0.311",
107
- "@teambit/cli": "0.0.451",
108
- "@teambit/dependency-resolver": "0.0.669",
109
- "@teambit/generator": "0.0.669",
110
- "@teambit/graphql": "0.0.669",
101
+ "@teambit/schema": "0.0.672",
102
+ "@teambit/tester": "0.0.672",
103
+ "@teambit/typescript": "0.0.672",
104
+ "@teambit/webpack": "0.0.672",
105
+ "@teambit/workspace": "0.0.672",
106
+ "@teambit/application": "0.0.314",
107
+ "@teambit/cli": "0.0.452",
108
+ "@teambit/dependency-resolver": "0.0.672",
109
+ "@teambit/generator": "0.0.672",
110
+ "@teambit/graphql": "0.0.672",
111
111
  "@teambit/react.ui.highlighter-provider": "0.0.184",
112
- "@teambit/compositions": "0.0.669",
113
- "@teambit/ui": "0.0.669",
114
- "@teambit/react.eslint-config-bit-react": "0.0.528",
112
+ "@teambit/compositions": "0.0.672",
113
+ "@teambit/ui": "0.0.672",
114
+ "@teambit/react.eslint-config-bit-react": "0.0.529",
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.464"
124
+ "@teambit/config": "0.0.465"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@types/react": "^17.0.8",
@@ -140,7 +140,7 @@
140
140
  "@teambit/react.aspect-docs.react": "0.0.132"
141
141
  },
142
142
  "peerDependencies": {
143
- "@teambit/legacy": "1.0.230",
143
+ "@teambit/legacy": "1.0.231",
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.230",
205
+ "@teambit/legacy": "1.0.231",
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.669/dist/react.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.669/dist/react.docs.mdx')]
1
+ export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.672/dist/react.composition.js')]
2
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.672/dist/react.docs.mdx')]
@@ -0,0 +1,12 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+
3
+ export const indexFile = (context: ComponentContext) => {
4
+ const { name, namePascalCase: Name } = context;
5
+
6
+ return {
7
+ relativePath: 'index.ts',
8
+ content: `export { ${Name} } from './${name}';
9
+ export type { ${Name}Props } from './${name}';
10
+ `,
11
+ };
12
+ }
@@ -3,37 +3,23 @@ import { componentFile } from './files/component';
3
3
  import { compositionFile } from './files/composition';
4
4
  import { docsFile } from './files/docs';
5
5
  import { testFile } from './files/test';
6
+ import { indexFile } from './files/index-file';
6
7
 
7
8
  export const reactComponent: ComponentTemplate = {
8
9
  name: 'react',
9
10
  description: 'a basic react component',
10
11
  generateFiles: (context: ComponentContext) => {
11
- const { name, namePascalCase: Name } = context;
12
- const indexFile = {
13
- relativePath: 'index.ts',
14
- content: `export { ${Name} } from './${name}';
15
- export type { ${Name}Props } from './${name}';
16
- `,
17
- };
18
-
19
- return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
12
+ return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
20
13
  },
14
+ // config: {
15
+ // 'teambit.envs/envs': {
16
+ // env: 'teambit.react/react',
17
+ // },
18
+ // }
21
19
  };
22
20
 
23
21
  export const deprecatedReactComponent: ComponentTemplate = {
22
+ ...reactComponent,
24
23
  name: 'react-component',
25
- description: 'a basic react component',
26
24
  hidden: true,
27
-
28
- generateFiles: (context: ComponentContext) => {
29
- const { name, namePascalCase: Name } = context;
30
- const indexFile = {
31
- relativePath: 'index.ts',
32
- content: `export { ${Name} } from './${name}';
33
- export type { ${Name}Props } from './${name}';
34
- `,
35
- };
36
-
37
- return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
38
- },
39
25
  };
@@ -15,24 +15,17 @@ export const reactComponentJS: ComponentTemplate = {
15
15
  content: `export { ${Name} } from './${name}';
16
16
  `,
17
17
  };
18
-
19
18
  return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
20
19
  },
20
+ // config: {
21
+ // 'teambit.envs/envs': {
22
+ // env: 'teambit.react/react',
23
+ // },
24
+ // }
21
25
  };
22
26
 
23
27
  export const deprecatedReactComponentJS: ComponentTemplate = {
28
+ ...reactComponentJS,
24
29
  name: 'react-component-js',
25
- description: 'a basic react component in js',
26
30
  hidden: true,
27
-
28
- generateFiles: (context: ComponentContext) => {
29
- const { name, namePascalCase: Name } = context;
30
- const indexFile = {
31
- relativePath: 'index.js',
32
- content: `export { ${Name} } from './${name}';
33
- `,
34
- };
35
-
36
- return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
37
- },
38
31
  };
@@ -0,0 +1,14 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+
3
+ export const indexFile = (context: ComponentContext) => {
4
+ const { name, namePascalCase: Name } = context;
5
+
6
+ return {
7
+ relativePath: 'index.ts',
8
+ content: `export { ${Name}Context } from './${name}-context';
9
+ export type { ${Name}ContextType } from './${name}-context';
10
+ export { ${Name}Provider } from './${name}-context-provider';
11
+ export type { ${Name}ProviderProps } from './${name}-context-provider';
12
+ `,
13
+ };
14
+ }
@@ -4,24 +4,15 @@ import { contextProviderFile } from './files/context-provider';
4
4
  import { compositionFile } from './files/composition';
5
5
  import { docsFile } from './files/docs';
6
6
  import { testFile } from './files/test';
7
+ import { indexFile } from './files/index-file';
7
8
 
8
9
  export const reactContext: ComponentTemplate = {
9
10
  name: 'react-context',
10
11
  description: 'a react context component',
11
12
 
12
13
  generateFiles: (context: ComponentContext) => {
13
- const { name, namePascalCase: Name } = context;
14
- const indexFile = {
15
- relativePath: 'index.ts',
16
- content: `export { ${Name}Context } from './${name}-context';
17
- export type { ${Name}ContextType } from './${name}-context';
18
- export { ${Name}Provider } from './${name}-context-provider';
19
- export type { ${Name}ProviderProps } from './${name}-context-provider';
20
- `,
21
- };
22
-
23
14
  return [
24
- indexFile,
15
+ indexFile(context),
25
16
  contextFile(context),
26
17
  contextProviderFile(context),
27
18
  compositionFile(context),
@@ -29,4 +20,9 @@ export type { ${Name}ProviderProps } from './${name}-context-provider';
29
20
  testFile(context),
30
21
  ];
31
22
  },
23
+ // config: {
24
+ // 'teambit.envs/envs': {
25
+ // env: 'teambit.react/react',
26
+ // },
27
+ // }
32
28
  };
@@ -48,4 +48,10 @@ export const reactEnvTemplate: ComponentTemplate = {
48
48
  },
49
49
  ];
50
50
  },
51
+ config: {
52
+ 'teambit.envs/env': {},
53
+ 'teambit.envs/envs': {
54
+ env: 'teambit.envs/env',
55
+ },
56
+ },
51
57
  };
@@ -0,0 +1,11 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+
3
+ export const indexFile = (context: ComponentContext) => {
4
+ const { name, namePascalCase: Name } = context;
5
+
6
+ return {
7
+ relativePath: 'index.ts',
8
+ content: `export { ${Name} } from './${name}';
9
+ `,
10
+ };
11
+ }
@@ -3,19 +3,18 @@ import { componentFile } from './files/component';
3
3
  import { compositionFile } from './files/composition';
4
4
  import { docsFile } from './files/docs';
5
5
  import { testFile } from './files/test';
6
+ import { indexFile } from './files/index-file';
6
7
 
7
8
  export const reactHook: ComponentTemplate = {
8
9
  name: 'react-hook',
9
10
  description: 'a react hook component',
10
11
 
11
12
  generateFiles: (context: ComponentContext) => {
12
- const { name, nameCamelCase: Name } = context;
13
- const indexFile = {
14
- relativePath: 'index.ts',
15
- content: `export { ${Name} } from './${name}';
16
- `,
17
- };
18
-
19
- return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
13
+ return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];
20
14
  },
15
+ // config: {
16
+ // 'teambit.envs/envs': {
17
+ // env: 'teambit.react/react',
18
+ // },
19
+ // }
21
20
  };