@teambit/react 1.0.62 → 1.0.63

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.
@@ -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';
@@ -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