@teambit/react 1.0.62 → 1.0.64

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 (24) hide show
  1. package/apps/web/react-app-options.ts +1 -1
  2. package/apps/web/react.application.ts +16 -5
  3. package/artifacts/env-template/public/{886.0b32da975e03e22af980.js → 232.7824fc56f36270b01906.js} +2 -2
  4. package/artifacts/env-template/public/{29.586cd596be4880657163.js → 29.980a277d3200e5d68db9.js} +6 -6
  5. package/artifacts/env-template/public/assets-manifest.json +14 -14
  6. package/artifacts/env-template/public/{compositions.8536bbeab74a0e838a59.js → compositions.265b44398e9711e8264a.js} +1 -1
  7. package/artifacts/env-template/public/compositions.html +1 -1
  8. package/artifacts/env-template/public/{overview.629ceea7b56a3d8673f1.js → overview.7a8f3d546b3cb2c42b4b.js} +1 -1
  9. package/artifacts/env-template/public/overview.html +1 -1
  10. package/artifacts/env-template/public/peers.8e1a57dc3470ee468413.js +1 -0
  11. package/artifacts/env-template/public/{preview-root.d2db1bde946094134283.js → preview-root.476f2b9ad3813d46b17e.js} +1 -1
  12. package/artifacts/env-template/public/static/css/{29.9e0d197b.css → 29.dd569806.css} +1 -1
  13. package/dist/apps/web/react-app-options.d.ts +1 -1
  14. package/dist/apps/web/react-app-options.js.map +1 -1
  15. package/dist/apps/web/react.application.d.ts +4 -4
  16. package/dist/apps/web/react.application.js +11 -2
  17. package/dist/apps/web/react.application.js.map +1 -1
  18. package/dist/{preview-1700709510910.js → preview-1700991709206.js} +2 -2
  19. package/dist/react.templates.js +4 -5
  20. package/dist/react.templates.js.map +1 -1
  21. package/package.json +29 -29
  22. package/artifacts/env-template/public/peers.1f2ccf09d6e518d515d6.js +0 -1
  23. /package/{compositions-1700709510910.js → compositions-1700991709206.js} +0 -0
  24. /package/{overview-1700709510910.js → overview-1700991709206.js} +0 -0
@@ -54,7 +54,7 @@ export type ReactAppOptions = {
54
54
  /**
55
55
  * deploy function.
56
56
  */
57
- deploy?: (context: ReactDeployContext) => Promise<void>;
57
+ deploy?: (context: ReactDeployContext) => Promise<undefined>;
58
58
 
59
59
  /**
60
60
  * ranges of ports to use to run the app server.
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'fs';
2
2
  import { join, resolve, basename } from 'path';
3
- import { Application, AppContext, AppBuildContext, AppResult } from '@teambit/application';
3
+ import { Application, AppContext, AppBuildContext, AppResult, ApplicationInstance } from '@teambit/application';
4
4
  import type { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';
5
5
  import { Port } from '@teambit/toolbox.network.get-port';
6
6
  import { ComponentMap } from '@teambit/component';
@@ -34,7 +34,7 @@ export class ReactApp implements Application {
34
34
  readonly ssrBundler?: Bundler,
35
35
  readonly devServer?: DevServer,
36
36
  readonly transformers: WebpackConfigTransformer[] = [],
37
- readonly deploy?: (context: ReactDeployContext) => Promise<void>,
37
+ readonly deploy?: (context: ReactDeployContext) => Promise<undefined>,
38
38
  readonly favicon?: string,
39
39
  readonly webpackModulePath?: string,
40
40
  readonly webpackDevServerModulePath?: string
@@ -43,13 +43,18 @@ export class ReactApp implements Application {
43
43
  readonly dir = 'public';
44
44
  readonly ssrDir = 'ssr';
45
45
 
46
- async run(context: AppContext): Promise<number> {
46
+ async run(context: AppContext): Promise<ApplicationInstance> {
47
47
  const [from, to] = this.portRange;
48
48
  const port = context.port || (await Port.getPort(from, to));
49
49
 
50
50
  if (this.devServer) {
51
51
  await this.devServer.listen(port);
52
- return port;
52
+ this.logger.console(`${context.appName} is listening on http://localhost:${port}`);
53
+
54
+ return {
55
+ appName: context.appName,
56
+ port
57
+ };
53
58
  }
54
59
 
55
60
  const devServerContext = await this.getDevServerContext(context);
@@ -60,7 +65,12 @@ export class ReactApp implements Application {
60
65
  this.webpackDevServerModulePath
61
66
  );
62
67
  await devServer.listen(port);
63
- return port;
68
+ this.logger.console(`${context.appName} is listening on http://localhost:${port}`);
69
+
70
+ return {
71
+ appName: context.appName,
72
+ port
73
+ };
64
74
  }
65
75
 
66
76
  async runSsr(context: AppContext): Promise<AppResult> {
@@ -91,6 +101,7 @@ export class ReactApp implements Application {
91
101
  });
92
102
 
93
103
  expressApp.listen(port);
104
+ this.logger.console(`listening on port ${port}`);
94
105
  return { port };
95
106
  }
96
107