@teambit/react 0.0.568 → 0.0.572

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 (69) hide show
  1. package/compositions-app.tsx +31 -0
  2. package/highlighter-widget.tsx +19 -0
  3. package/mount.tsx +17 -0
  4. package/package-tar/teambit-react-0.0.572.tgz +0 -0
  5. package/package.json +44 -59
  6. package/react.composition.tsx +7 -0
  7. package/react.ui.runtime.tsx +35 -0
  8. package/templates/react-app/files/app-root.ts +10 -0
  9. package/templates/react-app/files/app.ts +30 -0
  10. package/templates/react-app/files/aspect.ts +10 -0
  11. package/templates/react-app/files/compositions.ts +11 -0
  12. package/templates/react-app/files/doc.ts +29 -0
  13. package/templates/react-app/files/index.ts +10 -0
  14. package/templates/react-app/files/main.runtime.ts +22 -0
  15. package/templates/react-app/index.ts +47 -0
  16. package/templates/react-component/files/component.ts +25 -0
  17. package/templates/react-component/files/composition.ts +16 -0
  18. package/templates/react-component/files/docs.ts +32 -0
  19. package/templates/react-component/files/test.ts +19 -0
  20. package/templates/react-component/index.ts +40 -0
  21. package/templates/react-component-js/files/component.ts +18 -0
  22. package/templates/react-component-js/files/composition.ts +16 -0
  23. package/templates/react-component-js/files/docs.ts +32 -0
  24. package/templates/react-component-js/files/test.ts +21 -0
  25. package/templates/react-component-js/index.ts +38 -0
  26. package/templates/react-context/files/composition.ts +27 -0
  27. package/templates/react-context/files/context-provider.ts +27 -0
  28. package/templates/react-context/files/context.ts +21 -0
  29. package/templates/react-context/files/docs.ts +51 -0
  30. package/templates/react-context/files/test.ts +18 -0
  31. package/templates/react-context/index.ts +32 -0
  32. package/templates/react-env/files/aspect.ts +10 -0
  33. package/templates/react-env/files/doc.ts +163 -0
  34. package/templates/react-env/files/index.ts +10 -0
  35. package/templates/react-env/files/jest.config.ts +21 -0
  36. package/templates/react-env/files/main.runtime.ts +84 -0
  37. package/templates/react-env/files/preview.runtime.ts +27 -0
  38. package/templates/react-env/files/typescript.config.ts +21 -0
  39. package/templates/react-env/files/webpack.config.ts +48 -0
  40. package/templates/react-env/index.ts +51 -0
  41. package/templates/react-hook/files/component.ts +16 -0
  42. package/templates/react-hook/files/composition.ts +23 -0
  43. package/templates/react-hook/files/docs.ts +33 -0
  44. package/templates/react-hook/files/test.ts +20 -0
  45. package/templates/react-hook/index.ts +21 -0
  46. package/templates/react-workspace/index.ts +27 -0
  47. package/templates/react-workspace-app/index.ts +20 -0
  48. package/templates/react-workspace-deprecated/index.ts +28 -0
  49. package/templates/react-workspace-lib/index.ts +21 -0
  50. package/templates/workspace-common/files/eslint-config.ts +6 -0
  51. package/templates/workspace-common/files/git-ignore.ts +113 -0
  52. package/templates/workspace-common/files/prettier-config.ts +5 -0
  53. package/templates/workspace-common/files/readme-file.ts +36 -0
  54. package/templates/workspace-common/files/ts-config.ts +7 -0
  55. package/templates/workspace-common/files/types/asset.ts +28 -0
  56. package/templates/workspace-common/files/types/style.ts +43 -0
  57. package/templates/workspace-common/files/workspace-config.ts +58 -0
  58. package/templates/workspace-common/generate-files.ts +51 -0
  59. package/templates/workspace-common/index.ts +1 -0
  60. package/types/asset.d.ts +29 -0
  61. package/types/style.d.ts +42 -0
  62. package/typescript/asset.d.ts +29 -0
  63. package/typescript/style.d.ts +42 -0
  64. package/webpack/postcss.config.ts +21 -0
  65. package/webpack/webpack.config.base.prod.ts +123 -0
  66. package/webpack/webpack.config.base.ts +365 -0
  67. package/webpack/webpack.config.component.dev.ts +99 -0
  68. package/webpack/webpack.config.component.prod.ts +39 -0
  69. package/webpack/webpack.config.env.dev.ts +21 -0
@@ -0,0 +1,39 @@
1
+ import { Configuration } from 'webpack';
2
+ import { ComponentID } from '@teambit/component-id';
3
+ // Make sure the bit-react-transformer is a dependency
4
+ // TODO: remove it once we can set policy from component to component then set it via the component.json
5
+ import '@teambit/react.babel.bit-react-transformer';
6
+
7
+ // This is the production and development configuration.
8
+ // It is focused on developer experience, fast rebuilds, and a minimal bundle.
9
+ // eslint-disable-next-line complexity
10
+ export default function (): Configuration {
11
+ return {
12
+ module: {
13
+ rules: [
14
+ {
15
+ test: /\.js$/,
16
+ include: [/node_modules/, /\/dist\//],
17
+ exclude: /@teambit\/legacy/,
18
+ descriptionData: { componentId: ComponentID.isValidObject },
19
+ use: [
20
+ {
21
+ loader: require.resolve('babel-loader'),
22
+ options: {
23
+ babelrc: false,
24
+ configFile: false,
25
+ plugins: [
26
+ // for component highlighting in preview.
27
+ [require.resolve('@teambit/react.babel.bit-react-transformer')],
28
+ ],
29
+ // turn off all optimizations (only slow down for node_modules)
30
+ compact: false,
31
+ minified: false,
32
+ },
33
+ },
34
+ ],
35
+ },
36
+ ],
37
+ },
38
+ };
39
+ }
@@ -0,0 +1,21 @@
1
+ import type { WebpackConfigWithDevServer } from '@teambit/webpack';
2
+
3
+ export default function envConfig(envId: string): WebpackConfigWithDevServer {
4
+ return {
5
+ devServer: {
6
+ webSocketServer: {
7
+ options: {
8
+ path: `/_hmr/${envId}`,
9
+ // port is automatically matchs WDS
10
+ },
11
+ },
12
+ client: {
13
+ // public, sockHost, sockPath, and sockPort options were removed in favor client.webSocketURL option:
14
+ webSocketURL: {
15
+ pathname: `_hmr/${envId}`,
16
+ // port is automatically matchs the website.
17
+ },
18
+ },
19
+ },
20
+ };
21
+ }