@rayburst/cli 0.1.12 → 0.1.14

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/bin/rayburst.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Command } from 'commander';
4
4
  import chalk from 'chalk';
5
- import { spawn } from 'child_process';
5
+ import { spawn, exec } from 'child_process';
6
6
  import { fileURLToPath } from 'url';
7
7
  import { dirname, join, resolve } from 'path';
8
8
  import {
@@ -29,7 +29,7 @@ program
29
29
  .command('start')
30
30
  .description('Start the Rayburst application')
31
31
  .option('-p, --port <port>', 'Port to run the server on', '3105')
32
- .option('-e, --env <environment>', 'Environment (local|staging|production)', 'production')
32
+ .option('-e, --env <environment>', 'Environment (local|staging|production)', 'local')
33
33
  .action((options) => {
34
34
  console.log(chalk.blue('🚀 Starting Rayburst CLI...'));
35
35
  console.log(chalk.gray(` Port: ${options.port}`));
@@ -48,6 +48,22 @@ program
48
48
  stdio: 'inherit',
49
49
  });
50
50
 
51
+ // Open browser after server starts
52
+ let browserOpened = false;
53
+ setTimeout(() => {
54
+ if (!browserOpened) {
55
+ browserOpened = true;
56
+ const url = `http://localhost:${options.port}`;
57
+ const openCommand = process.platform === 'darwin' ? 'open' :
58
+ process.platform === 'win32' ? 'start' : 'xdg-open';
59
+ exec(`${openCommand} ${url}`, (err) => {
60
+ if (err) {
61
+ console.log(chalk.dim(`\n💡 Open your browser to: ${url}`));
62
+ }
63
+ });
64
+ }
65
+ }, 2000);
66
+
51
67
  server.on('error', (err) => {
52
68
  console.error(chalk.red('Failed to start server:'), err);
53
69
  process.exit(1);
@@ -1,6 +1,6 @@
1
1
  import { _ as __vitePreload } from './preload-helper-Dea3Szod.js';
2
2
 
3
- const remoteEntryPromise = __vitePreload(() => import('./remoteEntry-2xB1wVPo.js'),true ?[]:void 0);
3
+ const remoteEntryPromise = __vitePreload(() => import('./remoteEntry-D7mL3CtW.js'),true ?[]:void 0);
4
4
  // __tla only serves as a hack for vite-plugin-top-level-await.
5
5
  Promise.resolve(remoteEntryPromise)
6
6
  .then(remoteEntry => {
@@ -16564,19 +16564,9 @@ class ErrorBoundary extends React$1.Component {
16564
16564
  }
16565
16565
  }
16566
16566
  const RemoteApp = rayburstCli__loadShare__react__loadShare__.lazy(() => {
16567
- console.log("[CLI] Attempting to load remote app from rayburstApp/App");
16568
- console.log("[CLI] Expected remote URL:", "http://localhost:3000/remoteEntry.js");
16569
- return __vitePreload(() => import('./rayburstCli__loadRemote__rayburstApp_mf_1_App__loadRemote__-CHUYMhiU.js').then(n => n.r),true ?[]:void 0).then((module) => {
16570
- console.log("[CLI] Successfully loaded remote app module:", module);
16571
- return module;
16572
- }).catch((err) => {
16567
+ return __vitePreload(() => import('./rayburstCli__loadRemote__rayburstApp_mf_1_App__loadRemote__-CHUYMhiU.js').then(n => n.r),true ?[]:void 0).catch((err) => {
16573
16568
  console.error("[CLI] Failed to load remote app:", err);
16574
- console.error("[CLI] Error details:", {
16575
- name: err.name,
16576
- message: err.message,
16577
- stack: err.stack
16578
- });
16579
- throw new Error("Could not load Rayburst application. Make sure it is running on port 3000.");
16569
+ throw new Error("Could not load Rayburst application from remote.");
16580
16570
  });
16581
16571
  });
16582
16572
  function App() {
@@ -77,7 +77,7 @@ const importMap = {
77
77
  entryGlobalName: "rayburstApp",
78
78
  name: "rayburstApp",
79
79
  type: "module",
80
- entry: "https://www.rayburst.app/remoteEntry.js?t=1763425729584",
80
+ entry: "https://www.rayburst.app/remoteEntry.js?t=1763426000545",
81
81
  shareScope: "default",
82
82
  }
83
83
 
package/dist/index.html CHANGED
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <script type="module" src="/assets/hostInit-BeN71ro9.js"></script>
4
+ <script type="module" src="/assets/hostInit-B9f9vtMM.js"></script>
5
5
 
6
6
  <meta charset="UTF-8" />
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -43,7 +43,7 @@
43
43
  font-weight: 500;
44
44
  }
45
45
  </style>
46
- <script type="module" crossorigin src="/assets/index-Cap7gsMp.js"></script>
46
+ <script type="module" crossorigin src="/assets/index-VnAMn3JB.js"></script>
47
47
  </head>
48
48
  <body>
49
49
  <div id="app">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayburst/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Rayburst CLI - A module federation host for Rayburst app",
5
5
  "type": "module",
6
6
  "bin": {
package/src/main.tsx CHANGED
@@ -88,23 +88,11 @@ class ErrorBoundary extends React.Component<
88
88
 
89
89
  // Dynamically import the remote app
90
90
  const RemoteApp = lazy(() => {
91
- console.log('[CLI] Attempting to load remote app from rayburstApp/App');
92
- console.log('[CLI] Expected remote URL:', 'http://localhost:3000/remoteEntry.js');
93
-
94
91
  // @ts-ignore - Module federation import
95
92
  return import('rayburstApp/App')
96
- .then((module) => {
97
- console.log('[CLI] Successfully loaded remote app module:', module);
98
- return module;
99
- })
100
93
  .catch((err) => {
101
94
  console.error('[CLI] Failed to load remote app:', err);
102
- console.error('[CLI] Error details:', {
103
- name: err.name,
104
- message: err.message,
105
- stack: err.stack
106
- });
107
- throw new Error('Could not load Rayburst application. Make sure it is running on port 3000.');
95
+ throw new Error('Could not load Rayburst application from remote.');
108
96
  });
109
97
  });
110
98