@teambit/react 0.0.784 → 0.0.787
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/apps/web/react-app-options.ts +1 -1
- package/apps/web/react.app-type.ts +1 -1
- package/apps/web/react.application.ts +10 -3
- package/artifacts/__bit_junit.xml +2 -2
- package/artifacts/env-template/public/{22.02c5cc40d024e64c9979.js → 22.2ca76823cc3c7a67fd3d.js} +2 -2
- package/artifacts/env-template/public/{244.40a7c02382995372607b.js → 244.f4618a078d9d20680288.js} +0 -0
- package/artifacts/env-template/public/{914.f32aeb645c45af9c7978.js → 408.fa414fa826680282be58.js} +19 -19
- package/artifacts/env-template/public/assets-manifest.json +18 -18
- package/artifacts/env-template/public/{compositions.1ce3d05e8f6ca0a81bde.js → compositions.0d931551272dd8d24444.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.23d523d06490da567913.js → overview.ccd3a0ca2b9708ce99fb.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.4c1b921df1a99f91d096.js → peers.c45c42ca4faae5a3bc01.js} +1 -1
- package/artifacts/env-template/public/{preview-root.00a58e25dd767689624c.js → preview-root.e5a0940ef4224fc2424e.js} +1 -1
- package/artifacts/env-template/public/static/css/{914.6843020b.css → 408.9138636c.css} +1 -1
- package/artifacts/env-template/public/static/css/overview.df4a22d4.css +1 -0
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1657251036992.js → compositions-1657623030826.js} +0 -0
- package/dist/apps/web/react-app-options.d.ts +1 -1
- package/dist/apps/web/react-app-options.js.map +1 -1
- package/dist/apps/web/react.app-type.d.ts +1 -1
- package/dist/apps/web/react.app-type.js +1 -3
- package/dist/apps/web/react.app-type.js.map +1 -1
- package/dist/apps/web/react.application.d.ts +3 -2
- package/dist/apps/web/react.application.js +9 -2
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/react.main.runtime.js +2 -1
- package/dist/react.main.runtime.js.map +1 -1
- package/{overview-1657251036992.js → overview-1657623030826.js} +0 -0
- package/package-tar/teambit-react-0.0.787.tgz +0 -0
- package/package.json +32 -97
- package/{preview-1657251036992.js → preview-1657623030826.js} +2 -2
- package/artifacts/env-template/public/static/css/overview.a3d70d4f.css +0 -1
- package/package-tar/teambit-react-0.0.784.tgz +0 -0
|
@@ -6,7 +6,7 @@ import { ReactEnv } from '../../react.env';
|
|
|
6
6
|
export class ReactAppType implements ApplicationType<ReactAppOptions> {
|
|
7
7
|
constructor(readonly name: string, private reactEnv: ReactEnv) {}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
createApp(options: ReactAppOptions) {
|
|
10
10
|
return new ReactApp(
|
|
11
11
|
options.name,
|
|
12
12
|
options.entry,
|
|
@@ -16,7 +16,7 @@ import { computeResults } from './compute-results';
|
|
|
16
16
|
export class ReactApp implements Application {
|
|
17
17
|
constructor(
|
|
18
18
|
readonly name: string,
|
|
19
|
-
readonly entry: string[],
|
|
19
|
+
readonly entry: string[]|(() => Promise<string[]>),
|
|
20
20
|
readonly portRange: number[],
|
|
21
21
|
private reactEnv: ReactEnv,
|
|
22
22
|
readonly prerender?: ReactAppPrerenderOptions,
|
|
@@ -89,7 +89,8 @@ export class ReactApp implements Application {
|
|
|
89
89
|
const publicDir = this.getPublicDir(context.artifactsDir);
|
|
90
90
|
const outputPath = join(capsule.path, publicDir);
|
|
91
91
|
const { distDir } = reactEnv.getCompiler();
|
|
92
|
-
const
|
|
92
|
+
const targetEntries = Array.isArray(this.entry) ? this.entry : await this.entry();
|
|
93
|
+
const entries = targetEntries.map((entry) => require.resolve(`${capsule.path}/${distDir}/${basename(entry)}`));
|
|
93
94
|
const staticDir = join(outputPath, this.dir);
|
|
94
95
|
|
|
95
96
|
const bundlerContext: BundlerContext = Object.assign(context, {
|
|
@@ -184,9 +185,15 @@ export class ReactApp implements Application {
|
|
|
184
185
|
return join(artifactsDir, this.applicationType, this.name);
|
|
185
186
|
}
|
|
186
187
|
|
|
188
|
+
async getEntries(): Promise<string[]> {
|
|
189
|
+
if (Array.isArray(this.entry)) return this.entry;
|
|
190
|
+
return this.entry();
|
|
191
|
+
}
|
|
192
|
+
|
|
187
193
|
private async getDevServerContext(context: AppContext): Promise<DevServerContext> {
|
|
194
|
+
const entries = await this.getEntries();
|
|
188
195
|
return Object.assign(context, {
|
|
189
|
-
entry:
|
|
196
|
+
entry: entries,
|
|
190
197
|
rootPath: '',
|
|
191
198
|
publicPath: `public/${this.name}`,
|
|
192
199
|
title: this.name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites>
|
|
3
|
-
<testsuite name="teambit.react/react@0.0.
|
|
4
|
-
<testcase classname="index-file.spec.js" name="should match snapshot" time="0.
|
|
3
|
+
<testsuite name="teambit.react/react@0.0.787" timestamp="2022-07-12T11:16:39.768Z" tests="1" failures="0" errors="0" skipped="0">
|
|
4
|
+
<testcase classname="index-file.spec.js" name="should match snapshot" time="0.022"/>
|
|
5
5
|
</testsuite>
|
|
6
6
|
</testsuites>
|