roport 1.4.0 → 2.0.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.
package/bin/roport.js DELETED
@@ -1,131 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { program } = require('commander');
4
- const { startServer } = require('../src/server');
5
- const builder = require('../src/builder');
6
- const contextGen = require('../src/context');
7
- const fs = require('fs-extra');
8
- const path = require('path');
9
- const chalk = require('chalk');
10
- const os = require('os');
11
-
12
- program
13
- .name('roport')
14
- .description('Roport Sync Tool for Roblox')
15
- .version('1.3.2');
16
-
17
- program
18
- .command('serve')
19
- .description('Start the sync server')
20
- .option('-p, --port <number>', 'Port to run on', '3456')
21
- .action((options) => {
22
- startServer(parseInt(options.port));
23
- });
24
-
25
- program
26
- .command('context')
27
- .description('Generate a text summary of the project for AI context')
28
- .option('-d, --depth <number>', 'Max directory depth', '5')
29
- .option('-s, --source', 'Include source code in output', false)
30
- .option('-o, --output <file>', 'Output file (default: stdout)')
31
- .action(async (options) => {
32
- try {
33
- const output = await contextGen.generate(process.cwd(), {
34
- maxDepth: parseInt(options.depth),
35
- includeSource: options.source
36
- });
37
-
38
- if (options.output) {
39
- await fs.outputFile(options.output, output);
40
- console.log(chalk.green(`Context generated: ${options.output}`));
41
- } else {
42
- console.log(output);
43
- }
44
- } catch (err) {
45
- console.error(chalk.red('Context generation failed:'), err);
46
- }
47
- });
48
-
49
- program
50
- .command('build')
51
- .description('Build the project into a Roblox model file (.rbxmx)')
52
- .option('-o, --output <file>', 'Output file', 'Roport.rbxmx')
53
- .action(async (options) => {
54
- try {
55
- await builder.build(process.cwd(), options.output);
56
- } catch (err) {
57
- console.error(chalk.red('Build failed:'), err);
58
- process.exit(1);
59
- }
60
- });
61
-
62
- program
63
- .command('sourcemap')
64
- .description('Generate a sourcemap for the project')
65
- .option('-o, --output <file>', 'Output file (default: stdout)')
66
- .action(async (options) => {
67
- try {
68
- await builder.sourcemap(process.cwd(), options.output);
69
- } catch (err) {
70
- console.error(chalk.red('Sourcemap generation failed:'), err);
71
- process.exit(1);
72
- }
73
- });
74
-
75
- program
76
- .command('plugin install')
77
- .description('Install the Roport plugin to Roblox Studio')
78
- .action(async () => {
79
- try {
80
- const localAppData = process.env.LOCALAPPDATA;
81
- if (!localAppData) {
82
- throw new Error('LOCALAPPDATA environment variable not found (Windows only support for now)');
83
- }
84
-
85
- const pluginsDir = path.join(localAppData, 'Roblox', 'Plugins');
86
-
87
- // 1. Try bundled asset (Production)
88
- let pluginSource = path.join(__dirname, '../assets/RoportSyncPlugin.rbxmx');
89
-
90
- // 2. Fallback to cwd (Development)
91
- if (!await fs.pathExists(pluginSource)) {
92
- pluginSource = path.join(process.cwd(), 'Roport.rbxmx');
93
- }
94
-
95
- if (await fs.pathExists(pluginSource)) {
96
- await fs.copy(pluginSource, path.join(pluginsDir, 'RoportSyncPlugin.rbxmx'));
97
- console.log(chalk.green(`Plugin installed to ${pluginsDir}`));
98
- console.log(chalk.gray(`Source: ${pluginSource}`));
99
- } else {
100
- console.error(chalk.red('Plugin file not found. (RoportSyncPlugin.rbxmx)'));
101
- }
102
- } catch (err) {
103
- console.error(chalk.red('Installation failed:'), err);
104
- }
105
- });
106
-
107
- program
108
- .command('init')
109
- .description('Initialize a new Roport project with standard modules')
110
- .action(async () => {
111
- const targetDir = process.cwd();
112
- const templateDir = path.join(__dirname, '../templates/default');
113
-
114
- console.log(chalk.blue(`Initializing Roport project in ${targetDir}...`));
115
-
116
- try {
117
- if (await fs.pathExists(templateDir)) {
118
- await fs.copy(templateDir, targetDir);
119
- console.log(chalk.green('Success! Project initialized.'));
120
- console.log(chalk.white('Run `roport serve` to start the sync server.'));
121
- console.log(chalk.white('Check DOCUMENTATION.md for usage details.'));
122
- console.log(chalk.white('Install RoportSyncPlugin.rbxmx in your Roblox Studio project.'));
123
- } else {
124
- console.error(chalk.red(`Error: Template directory not found at ${templateDir}`));
125
- }
126
- } catch (err) {
127
- console.error(chalk.red('Error initializing project:'), err);
128
- }
129
- });
130
-
131
- program.parse();