@rayburst/cli 0.1.17 → 0.2.0

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 (39) hide show
  1. package/README.md +165 -257
  2. package/dist/analysis/analyze-project.d.ts +9 -0
  3. package/dist/analysis/analyze-project.js +440 -0
  4. package/dist/git-utils.d.ts +33 -0
  5. package/dist/git-utils.js +96 -0
  6. package/dist/incremental-analyzer.d.ts +128 -0
  7. package/dist/incremental-analyzer.js +259 -0
  8. package/dist/index.d.ts +6 -0
  9. package/dist/index.js +6 -0
  10. package/dist/local-storage.d.ts +39 -0
  11. package/dist/local-storage.js +117 -0
  12. package/dist/registry.d.ts +89 -0
  13. package/dist/registry.js +287 -0
  14. package/dist/vite-plugin.d.ts +7 -0
  15. package/dist/vite-plugin.js +109 -0
  16. package/package.json +33 -30
  17. package/bin/rayburst.js +0 -232
  18. package/dist/assets/_commonjsHelpers-B85MJLTf.js +0 -5
  19. package/dist/assets/hostInit-BWYxHpMp.js +0 -9
  20. package/dist/assets/index-9R1akZrm.js +0 -578
  21. package/dist/assets/index-BW-RulSg.js +0 -258
  22. package/dist/assets/index-VnAMn3JB.js +0 -16587
  23. package/dist/assets/preload-helper-Dea3Szod.js +0 -54
  24. package/dist/assets/rayburstCli__loadRemote__rayburstApp_mf_1_App__loadRemote__-CHUYMhiU.js +0 -35
  25. package/dist/assets/rayburstCli__loadShare__react__loadShare__-CE7VtFm0.js +0 -19
  26. package/dist/assets/rayburstCli__mf_v__runtimeInit__mf_v__-C_SVfzik.js +0 -4173
  27. package/dist/assets/remoteEntry-B8biLITo.js +0 -122
  28. package/dist/assets/virtualExposes-DwA08f_D.js +0 -5
  29. package/dist/index.html +0 -56
  30. package/index.html +0 -54
  31. package/scripts/analyze-project.js +0 -475
  32. package/server.js +0 -188
  33. package/src/file-watcher.js +0 -174
  34. package/src/git-utils.js +0 -105
  35. package/src/incremental-analyzer.js +0 -295
  36. package/src/main.tsx +0 -126
  37. package/src/registry.js +0 -262
  38. package/vite-plugin-api.js +0 -123
  39. package/vite.config.ts +0 -73
package/bin/rayburst.js DELETED
@@ -1,232 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import chalk from 'chalk';
5
- import { spawn, exec } from 'child_process';
6
- import { fileURLToPath } from 'url';
7
- import { dirname, join, resolve } from 'path';
8
- import {
9
- registerProject,
10
- unregisterProject,
11
- listProjects,
12
- getRegistryPaths,
13
- writeAnalysisData,
14
- updateProjectAnalysis,
15
- } from '../src/registry.js';
16
- import { analyzeProject } from '../scripts/analyze-project.js';
17
-
18
- const __filename = fileURLToPath(import.meta.url);
19
- const __dirname = dirname(__filename);
20
-
21
- const program = new Command();
22
-
23
- program
24
- .name('rayburst')
25
- .description('Rayburst CLI - Module Federation Host')
26
- .version('0.1.0');
27
-
28
- program
29
- .command('start')
30
- .description('Start the Rayburst application')
31
- .option('-p, --port <port>', 'Port to run the server on', '3105')
32
- .option('-e, --env <environment>', 'Environment (local|staging|production)', 'production')
33
- .action((options) => {
34
- console.log(chalk.blue('šŸš€ Starting Rayburst CLI...'));
35
- console.log(chalk.gray(` Port: ${options.port}`));
36
- console.log(chalk.gray(` Environment: ${options.env}`));
37
-
38
- const serverPath = join(__dirname, '..', 'server.js');
39
-
40
- const env = {
41
- ...process.env,
42
- PORT: options.port,
43
- NODE_ENV: options.env,
44
- };
45
-
46
- const server = spawn('node', [serverPath], {
47
- env,
48
- stdio: 'inherit',
49
- });
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
-
67
- server.on('error', (err) => {
68
- console.error(chalk.red('Failed to start server:'), err);
69
- process.exit(1);
70
- });
71
-
72
- server.on('exit', (code) => {
73
- if (code !== 0) {
74
- console.error(chalk.red(`Server exited with code ${code}`));
75
- process.exit(code);
76
- }
77
- });
78
-
79
- process.on('SIGINT', () => {
80
- console.log(chalk.yellow('\nšŸ‘‹ Shutting down Rayburst CLI...'));
81
- server.kill('SIGINT');
82
- process.exit(0);
83
- });
84
- });
85
-
86
- program
87
- .command('register')
88
- .description('Register the current directory as a Rayburst project')
89
- .argument('[path]', 'Path to register (defaults to current directory)', '.')
90
- .option('--no-analyze', 'Skip automatic code analysis')
91
- .action((projectPath, options) => {
92
- try {
93
- console.log(chalk.blue('šŸ“¦ Registering project...'));
94
- const project = registerProject(projectPath);
95
- console.log(chalk.green('āœ“ Project registered successfully!'));
96
- console.log(chalk.gray(` Name: ${project.name}`));
97
- console.log(chalk.gray(` Path: ${project.path}`));
98
- console.log(chalk.gray(` ID: ${project.id}`));
99
- console.log();
100
-
101
- // Run analysis by default
102
- if (options.analyze !== false) {
103
- console.log(chalk.blue('šŸ” Analyzing project...'));
104
- try {
105
- const analysisData = analyzeProject(project.path);
106
- writeAnalysisData(project.id, analysisData);
107
- updateProjectAnalysis(project.id);
108
- console.log(chalk.green('āœ“ Analysis complete!'));
109
- console.log(chalk.gray(` Nodes: ${analysisData.planData[Object.keys(analysisData.planData)[0]]?.nodes?.length || 0}`));
110
- console.log(chalk.gray(` Edges: ${analysisData.planData[Object.keys(analysisData.planData)[0]]?.edges?.length || 0}`));
111
- } catch (error) {
112
- console.warn(chalk.yellow('⚠ Analysis failed:'), error.message);
113
- console.warn(chalk.dim(' Project registered but without analysis data'));
114
- }
115
- }
116
-
117
- console.log();
118
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst list'), chalk.dim('to see all registered projects'));
119
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst start'), chalk.dim('to open the Rayburst dashboard'));
120
- } catch (error) {
121
- console.error(chalk.red('āœ— Registration failed:'), error.message);
122
- process.exit(1);
123
- }
124
- });
125
-
126
- program
127
- .command('unregister')
128
- .description('Unregister a Rayburst project')
129
- .argument('[path]', 'Path or project ID to unregister (defaults to current directory)', '.')
130
- .action((projectPath) => {
131
- try {
132
- console.log(chalk.blue('šŸ“¦ Unregistering project...'));
133
- const project = unregisterProject(projectPath);
134
- console.log(chalk.green('āœ“ Project unregistered successfully!'));
135
- console.log(chalk.gray(` Name: ${project.name}`));
136
- console.log(chalk.gray(` Path: ${project.path}`));
137
- } catch (error) {
138
- console.error(chalk.red('āœ— Unregistration failed:'), error.message);
139
- process.exit(1);
140
- }
141
- });
142
-
143
- program
144
- .command('list')
145
- .description('List all registered Rayburst projects')
146
- .action(() => {
147
- try {
148
- const projects = listProjects();
149
-
150
- if (projects.length === 0) {
151
- console.log(chalk.yellow('No projects registered yet.'));
152
- console.log();
153
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst register'), chalk.dim('in a project directory to register it'));
154
- return;
155
- }
156
-
157
- console.log(chalk.blue(`šŸ“¦ Registered Projects (${projects.length}):\n`));
158
-
159
- projects.forEach((project, index) => {
160
- console.log(chalk.bold(`${index + 1}. ${project.name}`));
161
- console.log(chalk.gray(` Path: ${project.path}`));
162
- console.log(chalk.gray(` ID: ${project.id}`));
163
- console.log(chalk.gray(` Version: ${project.packageJson?.version || 'N/A'}`));
164
- console.log(chalk.gray(` Registered: ${new Date(project.registeredAt).toLocaleString()}`));
165
- if (project.lastAnalyzed) {
166
- console.log(chalk.gray(` Last Analyzed: ${new Date(project.lastAnalyzed).toLocaleString()}`));
167
- }
168
- console.log();
169
- });
170
-
171
- const paths = getRegistryPaths();
172
- console.log(chalk.dim(`Registry location: ${paths.projectsFile}`));
173
- } catch (error) {
174
- console.error(chalk.red('āœ— Failed to list projects:'), error.message);
175
- process.exit(1);
176
- }
177
- });
178
-
179
- program
180
- .command('analyze')
181
- .description('Analyze a registered Rayburst project')
182
- .argument('[path]', 'Path or project ID to analyze (defaults to current directory)', '.')
183
- .action((projectPath) => {
184
- try {
185
- // Find the project by path or ID
186
- const projects = listProjects();
187
- const absolutePath = resolve(projectPath);
188
-
189
- let project = projects.find(p => p.path === absolutePath);
190
- if (!project) {
191
- // Try to find by ID
192
- project = projects.find(p => p.id === projectPath);
193
- }
194
-
195
- if (!project) {
196
- console.error(chalk.red('āœ— Project not found. Make sure it\'s registered first.'));
197
- console.log();
198
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst list'), chalk.dim('to see registered projects'));
199
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst register'), chalk.dim('to register a new project'));
200
- process.exit(1);
201
- }
202
-
203
- console.log(chalk.blue('šŸ” Analyzing project...'));
204
- console.log(chalk.gray(` Name: ${project.name}`));
205
- console.log(chalk.gray(` Path: ${project.path}`));
206
- console.log();
207
-
208
- const analysisData = analyzeProject(project.path);
209
- writeAnalysisData(project.id, analysisData);
210
- updateProjectAnalysis(project.id);
211
-
212
- console.log(chalk.green('āœ“ Analysis complete!'));
213
-
214
- // Show stats for each branch
215
- const branchIds = Object.keys(analysisData.planData);
216
- console.log(chalk.gray(` Branches analyzed: ${branchIds.length}`));
217
-
218
- branchIds.forEach(branchId => {
219
- const planData = analysisData.planData[branchId];
220
- const branch = analysisData.branches.find(b => b.id === branchId);
221
- console.log(chalk.gray(` - ${branch?.name || branchId}: ${planData.nodes.length} nodes, ${planData.edges.length} edges`));
222
- });
223
-
224
- console.log();
225
- console.log(chalk.dim('šŸ’” Run'), chalk.cyan('rayburst start'), chalk.dim('to view the analysis in the dashboard'));
226
- } catch (error) {
227
- console.error(chalk.red('āœ— Analysis failed:'), error.message);
228
- process.exit(1);
229
- }
230
- });
231
-
232
- program.parse();
@@ -1,5 +0,0 @@
1
- function getDefaultExportFromCjs (x) {
2
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3
- }
4
-
5
- export { getDefaultExportFromCjs as g };
@@ -1,9 +0,0 @@
1
- import { _ as __vitePreload } from './preload-helper-Dea3Szod.js';
2
-
3
- const remoteEntryPromise = __vitePreload(() => import('./remoteEntry-B8biLITo.js'),true ?[]:void 0);
4
- // __tla only serves as a hack for vite-plugin-top-level-await.
5
- Promise.resolve(remoteEntryPromise)
6
- .then(remoteEntry => {
7
- return Promise.resolve(remoteEntry.__tla)
8
- .then(remoteEntry.init).catch(remoteEntry.init)
9
- });