@teambit/react 0.0.668 → 0.0.671

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 (54) 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/829.js +1 -0
  5. package/artifacts/env-template/public/848.js +1 -1
  6. package/artifacts/env-template/public/assets-manifest.json +10 -10
  7. package/artifacts/env-template/public/{compositions.b8cf1bae61d6770fb256.js → compositions.3a5b55372d389b93bbf2.js} +1 -1
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/overview.a7c4a3fa35bd26ab4b80.js +1 -0
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/preview-root.5e21ef02ac0649aa70d0.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-1646709972516.js → compositions-1646920477648.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/dist/webpack/webpack.config.base.js +12 -0
  36. package/dist/webpack/webpack.config.base.js.map +1 -1
  37. package/{overview-1646709972516.js → overview-1646920477648.js} +0 -0
  38. package/package-tar/teambit-react-0.0.671.tgz +0 -0
  39. package/package.json +30 -30
  40. package/{preview-1646709972516.js → preview-1646920477648.js} +2 -2
  41. package/templates/react-component/files/index-file.ts +12 -0
  42. package/templates/react-component/index.ts +8 -22
  43. package/templates/react-component-js/index.ts +6 -13
  44. package/templates/react-context/files/index-file.ts +14 -0
  45. package/templates/react-context/index.ts +7 -11
  46. package/templates/react-env/index.ts +6 -0
  47. package/templates/react-hook/files/index-file.ts +11 -0
  48. package/templates/react-hook/index.ts +7 -8
  49. package/webpack/webpack.config.base.ts +14 -0
  50. package/artifacts/env-template/public/130.js +0 -1
  51. package/artifacts/env-template/public/overview.8e9cce77964a6de8a067.js +0 -1
  52. package/artifacts/env-template/public/preview-root.fc3344d908c6099ff850.js +0 -1
  53. package/artifacts/env-template/public/static/css/719.fc2ace3d.css +0 -1
  54. package/package-tar/teambit-react-0.0.668.tgz +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/react",
3
- "version": "0.0.668",
3
+ "version": "0.0.671",
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.668"
9
+ "version": "0.0.671"
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.668",
82
+ "@teambit/preview": "0.0.671",
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.668",
89
- "@teambit/bundler": "0.0.668",
90
- "@teambit/compiler": "0.0.668",
88
+ "@teambit/builder": "0.0.671",
89
+ "@teambit/bundler": "0.0.671",
90
+ "@teambit/compiler": "0.0.671",
91
91
  "@teambit/component.modules.component-url": "0.0.123",
92
- "@teambit/component": "0.0.668",
93
- "@teambit/envs": "0.0.668",
94
- "@teambit/eslint": "0.0.668",
95
- "@teambit/formatter": "0.0.219",
96
- "@teambit/jest": "0.0.668",
97
- "@teambit/linter": "0.0.668",
98
- "@teambit/pkg": "0.0.668",
99
- "@teambit/prettier": "0.0.219",
92
+ "@teambit/component": "0.0.671",
93
+ "@teambit/envs": "0.0.671",
94
+ "@teambit/eslint": "0.0.671",
95
+ "@teambit/formatter": "0.0.222",
96
+ "@teambit/jest": "0.0.671",
97
+ "@teambit/linter": "0.0.671",
98
+ "@teambit/pkg": "0.0.671",
99
+ "@teambit/prettier": "0.0.222",
100
100
  "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
101
- "@teambit/schema": "0.0.668",
102
- "@teambit/tester": "0.0.668",
103
- "@teambit/typescript": "0.0.668",
104
- "@teambit/webpack": "0.0.668",
105
- "@teambit/workspace": "0.0.668",
106
- "@teambit/application": "0.0.310",
107
- "@teambit/cli": "0.0.451",
108
- "@teambit/dependency-resolver": "0.0.668",
109
- "@teambit/generator": "0.0.668",
110
- "@teambit/graphql": "0.0.668",
101
+ "@teambit/schema": "0.0.671",
102
+ "@teambit/tester": "0.0.671",
103
+ "@teambit/typescript": "0.0.671",
104
+ "@teambit/webpack": "0.0.671",
105
+ "@teambit/workspace": "0.0.671",
106
+ "@teambit/application": "0.0.313",
107
+ "@teambit/cli": "0.0.452",
108
+ "@teambit/dependency-resolver": "0.0.671",
109
+ "@teambit/generator": "0.0.671",
110
+ "@teambit/graphql": "0.0.671",
111
111
  "@teambit/react.ui.highlighter-provider": "0.0.184",
112
- "@teambit/compositions": "0.0.668",
113
- "@teambit/ui": "0.0.668",
114
- "@teambit/react.eslint-config-bit-react": "0.0.528",
112
+ "@teambit/compositions": "0.0.671",
113
+ "@teambit/ui": "0.0.671",
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.668/dist/react.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.668/dist/react.docs.mdx')]
1
+ export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.671/dist/react.composition.js')]
2
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.671/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
  };
@@ -297,6 +297,9 @@ export default function (isEnvProduction = false): Configuration {
297
297
  maxSize: imageInlineSizeLimit,
298
298
  },
299
299
  },
300
+ generator: {
301
+ filename: 'static/images/[hash][ext][query]',
302
+ },
300
303
  },
301
304
  {
302
305
  // loads svg as both inlineUrl and react component, like:
@@ -319,6 +322,14 @@ export default function (isEnvProduction = false): Configuration {
319
322
  },
320
323
  ],
321
324
  },
325
+ {
326
+ test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
327
+ type: 'asset',
328
+ generator: {
329
+ filename: 'static/fonts/[hash][ext][query]',
330
+ },
331
+ },
332
+
322
333
  // "file" loader makes sure those assets get served by WebpackDevServer.
323
334
  // When you `import` an asset, you get its (virtual) filename.
324
335
  // In production, they would get copied to the `build` folder.
@@ -330,6 +341,9 @@ export default function (isEnvProduction = false): Configuration {
330
341
  // Also exclude `html` and `json` extensions so they get processed
331
342
  // by webpacks internal loaders.
332
343
  exclude: [/\.(js|mjs|cjs|jsx|ts|tsx)$/, /\.html$/, /\.mdx?/, /\.json$/, /\.css$/],
344
+ generator: {
345
+ filename: 'static/[hash][ext][query]',
346
+ },
333
347
  type: 'asset',
334
348
  },
335
349
  // ** STOP ** Are you adding a new loader?