@teambit/react 0.0.568 → 0.0.569
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/compositions-app.tsx +31 -0
- package/highlighter-widget.tsx +19 -0
- package/mount.tsx +17 -0
- package/package-tar/teambit-react-0.0.569.tgz +0 -0
- package/package.json +44 -59
- package/react.composition.tsx +7 -0
- package/react.ui.runtime.tsx +35 -0
- package/templates/react-app/files/app-root.ts +10 -0
- package/templates/react-app/files/app.ts +30 -0
- package/templates/react-app/files/aspect.ts +10 -0
- package/templates/react-app/files/compositions.ts +11 -0
- package/templates/react-app/files/doc.ts +29 -0
- package/templates/react-app/files/index.ts +10 -0
- package/templates/react-app/files/main.runtime.ts +22 -0
- package/templates/react-app/index.ts +47 -0
- package/templates/react-component/files/component.ts +25 -0
- package/templates/react-component/files/composition.ts +16 -0
- package/templates/react-component/files/docs.ts +32 -0
- package/templates/react-component/files/test.ts +19 -0
- package/templates/react-component/index.ts +40 -0
- package/templates/react-component-js/files/component.ts +18 -0
- package/templates/react-component-js/files/composition.ts +16 -0
- package/templates/react-component-js/files/docs.ts +32 -0
- package/templates/react-component-js/files/test.ts +21 -0
- package/templates/react-component-js/index.ts +38 -0
- package/templates/react-context/files/composition.ts +27 -0
- package/templates/react-context/files/context-provider.ts +27 -0
- package/templates/react-context/files/context.ts +21 -0
- package/templates/react-context/files/docs.ts +51 -0
- package/templates/react-context/files/test.ts +18 -0
- package/templates/react-context/index.ts +32 -0
- package/templates/react-env/files/aspect.ts +10 -0
- package/templates/react-env/files/doc.ts +163 -0
- package/templates/react-env/files/index.ts +10 -0
- package/templates/react-env/files/jest.config.ts +21 -0
- package/templates/react-env/files/main.runtime.ts +84 -0
- package/templates/react-env/files/preview.runtime.ts +27 -0
- package/templates/react-env/files/typescript.config.ts +21 -0
- package/templates/react-env/files/webpack.config.ts +48 -0
- package/templates/react-env/index.ts +51 -0
- package/templates/react-hook/files/component.ts +16 -0
- package/templates/react-hook/files/composition.ts +23 -0
- package/templates/react-hook/files/docs.ts +33 -0
- package/templates/react-hook/files/test.ts +20 -0
- package/templates/react-hook/index.ts +21 -0
- package/templates/react-workspace/index.ts +27 -0
- package/templates/react-workspace-app/index.ts +20 -0
- package/templates/react-workspace-deprecated/index.ts +28 -0
- package/templates/react-workspace-lib/index.ts +21 -0
- package/templates/workspace-common/files/eslint-config.ts +6 -0
- package/templates/workspace-common/files/git-ignore.ts +113 -0
- package/templates/workspace-common/files/prettier-config.ts +5 -0
- package/templates/workspace-common/files/readme-file.ts +36 -0
- package/templates/workspace-common/files/ts-config.ts +7 -0
- package/templates/workspace-common/files/types/asset.ts +28 -0
- package/templates/workspace-common/files/types/style.ts +43 -0
- package/templates/workspace-common/files/workspace-config.ts +58 -0
- package/templates/workspace-common/generate-files.ts +51 -0
- package/templates/workspace-common/index.ts +1 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
- package/typescript/asset.d.ts +29 -0
- package/typescript/style.d.ts +42 -0
- package/webpack/postcss.config.ts +21 -0
- package/webpack/webpack.config.base.prod.ts +123 -0
- package/webpack/webpack.config.base.ts +365 -0
- package/webpack/webpack.config.component.dev.ts +99 -0
- package/webpack/webpack.config.component.prod.ts +39 -0
- 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
|
+
}
|