@reverso/cli 0.1.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/README.md +82 -0
- package/dist/bin.d.ts +6 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +23 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/build.d.ts +6 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +86 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev.d.ts +6 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +100 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/migrate.d.ts +6 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +145 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/scan.d.ts +6 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +104 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/start.d.ts +6 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +87 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# @reverso/cli
|
|
2
|
+
|
|
3
|
+
Command line interface for Reverso CMS.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @reverso/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @reverso/cli scan
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
### `reverso scan`
|
|
20
|
+
|
|
21
|
+
Scan your codebase for `data-reverso` markers and generate schema.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
reverso scan --watch
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### `reverso dev`
|
|
28
|
+
|
|
29
|
+
Start development server with hot reloading.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
reverso dev --port 4000
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `reverso migrate`
|
|
36
|
+
|
|
37
|
+
Run database migrations.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
reverso migrate
|
|
41
|
+
reverso migrate:status
|
|
42
|
+
reverso migrate:reset
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### `reverso build`
|
|
46
|
+
|
|
47
|
+
Build for production.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
reverso build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `reverso start`
|
|
54
|
+
|
|
55
|
+
Start production server.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
reverso start --port 4000
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
Create `reverso.config.ts`:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { defineConfig } from '@reverso/core';
|
|
67
|
+
|
|
68
|
+
export default defineConfig({
|
|
69
|
+
database: {
|
|
70
|
+
type: 'sqlite',
|
|
71
|
+
path: './data/reverso.db',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
See [https://reverso.dev/docs/packages/cli](https://reverso.dev/docs/packages/cli)
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;GAEG"}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Reverso CLI entry point.
|
|
4
|
+
*/
|
|
5
|
+
import { program } from 'commander';
|
|
6
|
+
import { buildCommand } from './commands/build.js';
|
|
7
|
+
import { devCommand } from './commands/dev.js';
|
|
8
|
+
import { migrateCommand } from './commands/migrate.js';
|
|
9
|
+
import { scanCommand } from './commands/scan.js';
|
|
10
|
+
import { startCommand } from './commands/start.js';
|
|
11
|
+
import { VERSION } from './index.js';
|
|
12
|
+
program
|
|
13
|
+
.name('reverso')
|
|
14
|
+
.description('Command line interface for Reverso CMS')
|
|
15
|
+
.version(VERSION);
|
|
16
|
+
// Register commands
|
|
17
|
+
scanCommand(program);
|
|
18
|
+
devCommand(program);
|
|
19
|
+
buildCommand(program);
|
|
20
|
+
startCommand(program);
|
|
21
|
+
migrateCommand(program);
|
|
22
|
+
program.parse();
|
|
23
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,wCAAwC,CAAC;KACrD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,oBAAoB;AACpB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,UAAU,CAAC,OAAO,CAAC,CAAC;AACpB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,cAAc,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwFnD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build command - prepares the CMS for production.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { resolve, join } from 'node:path';
|
|
7
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
8
|
+
export function buildCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('build')
|
|
11
|
+
.description('Build the CMS for production deployment')
|
|
12
|
+
.option('-s, --src <dir>', 'Source directory to scan', './src')
|
|
13
|
+
.option('-o, --output <dir>', 'Output directory', '.reverso')
|
|
14
|
+
.option('-d, --database <path>', 'Database file path', '.reverso/reverso.db')
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
const spinner = ora();
|
|
17
|
+
try {
|
|
18
|
+
console.log(chalk.blue.bold('Building Reverso CMS for production...'));
|
|
19
|
+
console.log();
|
|
20
|
+
const outputDir = resolve(options.output);
|
|
21
|
+
const dbPath = resolve(options.database);
|
|
22
|
+
// Ensure output directory exists
|
|
23
|
+
if (!existsSync(outputDir)) {
|
|
24
|
+
mkdirSync(outputDir, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
// Step 1: Scan source files
|
|
27
|
+
spinner.start('Scanning source files...');
|
|
28
|
+
const { createScanner } = await import('@reverso/scanner');
|
|
29
|
+
const scanner = createScanner({
|
|
30
|
+
srcDir: options.src,
|
|
31
|
+
outputDir: outputDir,
|
|
32
|
+
});
|
|
33
|
+
const result = await scanner.scan();
|
|
34
|
+
if (!result.success || !result.schema) {
|
|
35
|
+
throw new Error(`Scan failed: ${result.errors?.join(', ') || 'Unknown error'}`);
|
|
36
|
+
}
|
|
37
|
+
spinner.succeed(`Found ${result.schema.totalFields} fields in ${result.schema.pages.length} pages`);
|
|
38
|
+
// Step 2: Generate schema file
|
|
39
|
+
spinner.start('Generating schema...');
|
|
40
|
+
const schemaPath = join(outputDir, 'schema.json');
|
|
41
|
+
writeFileSync(schemaPath, JSON.stringify(result.schema, null, 2));
|
|
42
|
+
spinner.succeed(`Schema saved to ${schemaPath}`);
|
|
43
|
+
// Step 3: Initialize database
|
|
44
|
+
spinner.start('Initializing database...');
|
|
45
|
+
const { createDatabaseSchema, syncSchema, initDatabase, getDatabase, closeDatabase } = await import('@reverso/db');
|
|
46
|
+
// Create database schema
|
|
47
|
+
await createDatabaseSchema(dbPath);
|
|
48
|
+
// Initialize and sync
|
|
49
|
+
initDatabase({ url: dbPath });
|
|
50
|
+
const db = getDatabase();
|
|
51
|
+
await syncSchema(db, result.schema);
|
|
52
|
+
await closeDatabase();
|
|
53
|
+
spinner.succeed('Database initialized and synced');
|
|
54
|
+
// Step 4: Create build manifest
|
|
55
|
+
spinner.start('Creating build manifest...');
|
|
56
|
+
const manifest = {
|
|
57
|
+
version: '1.0.0',
|
|
58
|
+
buildTime: new Date().toISOString(),
|
|
59
|
+
schema: {
|
|
60
|
+
pages: result.schema.pages.length,
|
|
61
|
+
fields: result.schema.totalFields,
|
|
62
|
+
},
|
|
63
|
+
database: dbPath,
|
|
64
|
+
nodeVersion: process.version,
|
|
65
|
+
};
|
|
66
|
+
const manifestPath = join(outputDir, 'manifest.json');
|
|
67
|
+
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
68
|
+
spinner.succeed('Build manifest created');
|
|
69
|
+
console.log();
|
|
70
|
+
console.log(chalk.green.bold('Build complete!'));
|
|
71
|
+
console.log();
|
|
72
|
+
console.log(chalk.bold('Build output:'));
|
|
73
|
+
console.log(chalk.gray(` Schema: ${schemaPath}`));
|
|
74
|
+
console.log(chalk.gray(` Database: ${dbPath}`));
|
|
75
|
+
console.log(chalk.gray(` Manifest: ${manifestPath}`));
|
|
76
|
+
console.log();
|
|
77
|
+
console.log(chalk.yellow('Run `reverso start` to start the production server'));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
spinner.fail(chalk.red('Build failed'));
|
|
81
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ/D,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,yCAAyC,CAAC;SACtD,MAAM,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,OAAO,CAAC;SAC9D,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,UAAU,CAAC;SAC5D,MAAM,CA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
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4GjD"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev command - starts development server.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
export function devCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command('dev')
|
|
10
|
+
.description('Start development server (API + Admin)')
|
|
11
|
+
.option('-p, --port <port>', 'API server port', '3001')
|
|
12
|
+
.option('-H, --host <host>', 'Server host', 'localhost')
|
|
13
|
+
.option('-d, --database <path>', 'Database file path', '.reverso/dev.db')
|
|
14
|
+
.option('-s, --src <dir>', 'Source directory to watch', './src')
|
|
15
|
+
.option('--open', 'Open admin panel in browser', false)
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const spinner = ora();
|
|
18
|
+
try {
|
|
19
|
+
const port = parseInt(options.port, 10);
|
|
20
|
+
const dbPath = resolve(options.database);
|
|
21
|
+
console.log(chalk.blue('Starting Reverso development server...'));
|
|
22
|
+
console.log();
|
|
23
|
+
// Create database if needed
|
|
24
|
+
spinner.start('Initializing database...');
|
|
25
|
+
const { createDatabaseSchema } = await import('@reverso/db');
|
|
26
|
+
await createDatabaseSchema(dbPath);
|
|
27
|
+
spinner.succeed('Database initialized');
|
|
28
|
+
// Start scanner in watch mode
|
|
29
|
+
spinner.start('Starting file scanner...');
|
|
30
|
+
const { createScanner } = await import('@reverso/scanner');
|
|
31
|
+
const scanner = createScanner({
|
|
32
|
+
srcDir: options.src,
|
|
33
|
+
outputDir: '.reverso',
|
|
34
|
+
});
|
|
35
|
+
// Initial scan
|
|
36
|
+
await scanner.scan();
|
|
37
|
+
spinner.succeed('Initial scan complete');
|
|
38
|
+
// Start watch mode in background
|
|
39
|
+
scanner.on((event) => {
|
|
40
|
+
if (event.type === 'complete' && event.schema) {
|
|
41
|
+
console.log(chalk.gray(`[scanner] Schema updated: ${event.schema.totalFields} fields`));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
scanner.startWatch();
|
|
45
|
+
// Start API server
|
|
46
|
+
spinner.start('Starting API server...');
|
|
47
|
+
const { createApiServer, startServer } = await import('@reverso/api');
|
|
48
|
+
const server = await createApiServer({
|
|
49
|
+
port,
|
|
50
|
+
host: options.host,
|
|
51
|
+
databaseUrl: dbPath,
|
|
52
|
+
cors: true,
|
|
53
|
+
logger: false,
|
|
54
|
+
});
|
|
55
|
+
await startServer(server);
|
|
56
|
+
spinner.succeed(`API server running at http://${options.host}:${port}`);
|
|
57
|
+
console.log();
|
|
58
|
+
console.log(chalk.green.bold('Development server ready!'));
|
|
59
|
+
console.log();
|
|
60
|
+
console.log(chalk.bold('Endpoints:'));
|
|
61
|
+
console.log(chalk.gray(` API: http://${options.host}:${port}/api/reverso`));
|
|
62
|
+
console.log(chalk.gray(` Health: http://${options.host}:${port}/health`));
|
|
63
|
+
console.log();
|
|
64
|
+
console.log(chalk.yellow('Press Ctrl+C to stop'));
|
|
65
|
+
// Open browser if requested
|
|
66
|
+
if (options.open) {
|
|
67
|
+
const { spawn } = await import('node:child_process');
|
|
68
|
+
// Validate host to prevent command injection
|
|
69
|
+
const safeHost = /^[a-zA-Z0-9.-]+$/.test(options.host) ? options.host : 'localhost';
|
|
70
|
+
const safePort = Number.isInteger(port) && port > 0 && port < 65536 ? port : 3001;
|
|
71
|
+
const url = `http://${safeHost}:${safePort}`;
|
|
72
|
+
// Use spawn with separate arguments (no shell) to prevent injection
|
|
73
|
+
const openCommand = process.platform === 'darwin'
|
|
74
|
+
? { cmd: 'open', args: [url] }
|
|
75
|
+
: process.platform === 'win32'
|
|
76
|
+
? { cmd: 'cmd', args: ['/c', 'start', '', url] }
|
|
77
|
+
: { cmd: 'xdg-open', args: [url] };
|
|
78
|
+
spawn(openCommand.cmd, openCommand.args, {
|
|
79
|
+
detached: true,
|
|
80
|
+
stdio: 'ignore'
|
|
81
|
+
}).unref();
|
|
82
|
+
}
|
|
83
|
+
// Handle shutdown
|
|
84
|
+
const shutdown = async () => {
|
|
85
|
+
console.log(chalk.gray('\nShutting down...'));
|
|
86
|
+
scanner.stopWatch();
|
|
87
|
+
await server.close();
|
|
88
|
+
process.exit(0);
|
|
89
|
+
};
|
|
90
|
+
process.on('SIGINT', shutdown);
|
|
91
|
+
process.on('SIGTERM', shutdown);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
spinner.fail(chalk.red('Failed to start development server'));
|
|
95
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,CAAC;SACtD,MAAM,CAAC,mBAAmB,EAAE,aAAa,EAAE,WAAW,CAAC;SACvD,MAAM,CAAC,uBAAuB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC;SACxE,MAAM,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,OAAO,CAAC;SAC/D,MAAM,CAAC,QAAQ,EAAE,6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ACpB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;gBACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC;YAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC,CAAC;YAC9D,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands.
|
|
3
|
+
*/
|
|
4
|
+
export { scanCommand } from './scan.js';
|
|
5
|
+
export { devCommand } from './dev.js';
|
|
6
|
+
export { buildCommand } from './build.js';
|
|
7
|
+
export { startCommand } from './start.js';
|
|
8
|
+
export { migrateCommand } from './migrate.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands.
|
|
3
|
+
*/
|
|
4
|
+
export { scanCommand } from './scan.js';
|
|
5
|
+
export { devCommand } from './dev.js';
|
|
6
|
+
export { buildCommand } from './build.js';
|
|
7
|
+
export { startCommand } from './start.js';
|
|
8
|
+
export { migrateCommand } from './migrate.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+JrD"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migrate command - database migrations.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
export function migrateCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command('migrate')
|
|
10
|
+
.description('Run database migrations')
|
|
11
|
+
.option('-d, --database <path>', 'Database file path', '.reverso/dev.db')
|
|
12
|
+
.option('-v, --verbose', 'Verbose output', false)
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
const spinner = ora();
|
|
15
|
+
try {
|
|
16
|
+
const dbPath = resolve(options.database);
|
|
17
|
+
spinner.start('Running database migrations...');
|
|
18
|
+
const { runMigrations } = await import('@reverso/db');
|
|
19
|
+
await runMigrations({
|
|
20
|
+
dbPath,
|
|
21
|
+
verbose: options.verbose,
|
|
22
|
+
});
|
|
23
|
+
spinner.succeed(chalk.green('Migrations complete!'));
|
|
24
|
+
console.log(chalk.gray(` Database: ${dbPath}`));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
spinner.fail(chalk.red('Migration failed'));
|
|
28
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// Sub-command: migrate create
|
|
33
|
+
program
|
|
34
|
+
.command('migrate:create <name>')
|
|
35
|
+
.description('Create a new migration file')
|
|
36
|
+
.option('-d, --dir <path>', 'Migrations directory', '.reverso/migrations')
|
|
37
|
+
.action(async (name, options) => {
|
|
38
|
+
const spinner = ora();
|
|
39
|
+
try {
|
|
40
|
+
const { writeFileSync, mkdirSync, existsSync } = await import('node:fs');
|
|
41
|
+
const { join } = await import('node:path');
|
|
42
|
+
const migrationsDir = resolve(options.dir);
|
|
43
|
+
// Create directory if needed
|
|
44
|
+
if (!existsSync(migrationsDir)) {
|
|
45
|
+
mkdirSync(migrationsDir, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
// Generate timestamp
|
|
48
|
+
const timestamp = new Date()
|
|
49
|
+
.toISOString()
|
|
50
|
+
.replace(/[-:T]/g, '')
|
|
51
|
+
.slice(0, 14);
|
|
52
|
+
const filename = `${timestamp}_${name.toLowerCase().replace(/\s+/g, '_')}.sql`;
|
|
53
|
+
const filepath = join(migrationsDir, filename);
|
|
54
|
+
const template = `-- Migration: ${name}
|
|
55
|
+
-- Created at: ${new Date().toISOString()}
|
|
56
|
+
|
|
57
|
+
-- Write your migration SQL here
|
|
58
|
+
-- Example:
|
|
59
|
+
-- ALTER TABLE pages ADD COLUMN new_column TEXT;
|
|
60
|
+
|
|
61
|
+
`;
|
|
62
|
+
writeFileSync(filepath, template);
|
|
63
|
+
spinner.succeed(chalk.green(`Created migration: ${filename}`));
|
|
64
|
+
console.log(chalk.gray(` Path: ${filepath}`));
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
spinner.fail(chalk.red('Failed to create migration'));
|
|
68
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
// Sub-command: migrate reset
|
|
73
|
+
program
|
|
74
|
+
.command('migrate:reset')
|
|
75
|
+
.description('Reset database (drop all tables and recreate)')
|
|
76
|
+
.option('-d, --database <path>', 'Database file path', '.reverso/dev.db')
|
|
77
|
+
.option('--force', 'Skip confirmation', false)
|
|
78
|
+
.action(async (options) => {
|
|
79
|
+
const spinner = ora();
|
|
80
|
+
try {
|
|
81
|
+
const { existsSync, unlinkSync } = await import('node:fs');
|
|
82
|
+
const dbPath = resolve(options.database);
|
|
83
|
+
if (!options.force) {
|
|
84
|
+
const prompts = (await import('prompts')).default;
|
|
85
|
+
const response = await prompts({
|
|
86
|
+
type: 'confirm',
|
|
87
|
+
name: 'confirm',
|
|
88
|
+
message: `This will delete the database at ${dbPath}. Are you sure?`,
|
|
89
|
+
initial: false,
|
|
90
|
+
});
|
|
91
|
+
if (!response.confirm) {
|
|
92
|
+
console.log(chalk.gray('Aborted.'));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
spinner.start('Resetting database...');
|
|
97
|
+
// Delete database files
|
|
98
|
+
const files = [dbPath, `${dbPath}-shm`, `${dbPath}-wal`];
|
|
99
|
+
for (const file of files) {
|
|
100
|
+
if (existsSync(file)) {
|
|
101
|
+
unlinkSync(file);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Recreate database
|
|
105
|
+
const { createDatabaseSchema } = await import('@reverso/db');
|
|
106
|
+
await createDatabaseSchema(dbPath);
|
|
107
|
+
spinner.succeed(chalk.green('Database reset complete!'));
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
spinner.fail(chalk.red('Reset failed'));
|
|
111
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// Sub-command: migrate status
|
|
116
|
+
program
|
|
117
|
+
.command('migrate:status')
|
|
118
|
+
.description('Show migration status')
|
|
119
|
+
.option('-d, --database <path>', 'Database file path', '.reverso/dev.db')
|
|
120
|
+
.action(async (options) => {
|
|
121
|
+
try {
|
|
122
|
+
const { existsSync } = await import('node:fs');
|
|
123
|
+
const dbPath = resolve(options.database);
|
|
124
|
+
if (!existsSync(dbPath)) {
|
|
125
|
+
console.log(chalk.yellow('Database does not exist yet.'));
|
|
126
|
+
console.log(chalk.gray(` Expected: ${dbPath}`));
|
|
127
|
+
console.log(chalk.gray(' Run "reverso migrate" to create it.'));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
console.log(chalk.green('Database exists'));
|
|
131
|
+
console.log(chalk.gray(` Path: ${dbPath}`));
|
|
132
|
+
// Get file stats
|
|
133
|
+
const { statSync } = await import('node:fs');
|
|
134
|
+
const stats = statSync(dbPath);
|
|
135
|
+
console.log(chalk.gray(` Size: ${(stats.size / 1024).toFixed(2)} KB`));
|
|
136
|
+
console.log(chalk.gray(` Modified: ${stats.mtime.toISOString()}`));
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error(chalk.red('Failed to check status'));
|
|
140
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.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K,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8GlD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scan command - scans project for data-reverso markers.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { createScanner, scan } from '@reverso/scanner';
|
|
7
|
+
export function scanCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command('scan')
|
|
10
|
+
.description('Scan project for data-reverso markers and generate schema')
|
|
11
|
+
.option('-s, --src <dir>', 'Source directory to scan', './src')
|
|
12
|
+
.option('-o, --output <dir>', 'Output directory for schema', '.reverso')
|
|
13
|
+
.option('-w, --watch', 'Watch for changes', false)
|
|
14
|
+
.option('-v, --verbose', 'Verbose output', false)
|
|
15
|
+
.option('--include <patterns...>', 'Glob patterns to include', ['**/*.tsx', '**/*.jsx'])
|
|
16
|
+
.option('--exclude <patterns...>', 'Glob patterns to exclude', ['**/node_modules/**', '**/dist/**'])
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const spinner = ora();
|
|
19
|
+
try {
|
|
20
|
+
if (options.watch) {
|
|
21
|
+
// Watch mode uses ScannerOptions
|
|
22
|
+
const scannerOptions = {
|
|
23
|
+
srcDir: options.src,
|
|
24
|
+
outputDir: options.output,
|
|
25
|
+
include: options.include,
|
|
26
|
+
exclude: options.exclude,
|
|
27
|
+
};
|
|
28
|
+
console.log(chalk.blue('Starting scanner in watch mode...'));
|
|
29
|
+
console.log(chalk.gray(` Source: ${options.src}`));
|
|
30
|
+
console.log(chalk.gray(` Output: ${options.output}`));
|
|
31
|
+
console.log();
|
|
32
|
+
const scanner = createScanner(scannerOptions);
|
|
33
|
+
scanner.on((event) => {
|
|
34
|
+
switch (event.type) {
|
|
35
|
+
case 'start':
|
|
36
|
+
spinner.start('Scanning...');
|
|
37
|
+
break;
|
|
38
|
+
case 'complete':
|
|
39
|
+
if (event.schema) {
|
|
40
|
+
spinner.succeed(chalk.green(`Found ${event.schema.totalFields} fields across ${event.schema.pages.length} pages`));
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case 'error':
|
|
44
|
+
spinner.fail(chalk.red(`Error: ${event.error?.message || 'Unknown error'}`));
|
|
45
|
+
break;
|
|
46
|
+
case 'change':
|
|
47
|
+
if (event.changedFile) {
|
|
48
|
+
console.log(chalk.gray(`File changed: ${event.changedFile}`));
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
await scanner.startWatch();
|
|
54
|
+
// Keep process running
|
|
55
|
+
console.log(chalk.yellow('\nWatching for changes. Press Ctrl+C to stop.\n'));
|
|
56
|
+
process.on('SIGINT', () => {
|
|
57
|
+
scanner.stopWatch();
|
|
58
|
+
console.log(chalk.gray('\nStopped watching.'));
|
|
59
|
+
process.exit(0);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// One-time scan uses CoreScanOptions
|
|
64
|
+
const scanOptions = {
|
|
65
|
+
srcDir: options.src,
|
|
66
|
+
include: options.include,
|
|
67
|
+
exclude: options.exclude,
|
|
68
|
+
verbose: options.verbose,
|
|
69
|
+
};
|
|
70
|
+
spinner.start('Scanning for data-reverso markers...');
|
|
71
|
+
const result = await scan(scanOptions);
|
|
72
|
+
spinner.succeed(chalk.green('Scan complete!'));
|
|
73
|
+
console.log();
|
|
74
|
+
console.log(chalk.bold('Results:'));
|
|
75
|
+
console.log(chalk.gray(` Pages: ${result.schema.pages.length}`));
|
|
76
|
+
console.log(chalk.gray(` Total fields: ${result.schema.totalFields}`));
|
|
77
|
+
console.log(chalk.gray(` Output: ${options.output}/schema.json`));
|
|
78
|
+
if (options.verbose && result.schema.pages.length > 0) {
|
|
79
|
+
console.log();
|
|
80
|
+
console.log(chalk.bold('Pages:'));
|
|
81
|
+
for (const page of result.schema.pages) {
|
|
82
|
+
const fieldCount = page.sections.reduce((sum, s) => sum + s.fields.length, 0);
|
|
83
|
+
console.log(chalk.gray(` - ${page.slug} (${fieldCount} fields)`));
|
|
84
|
+
for (const section of page.sections) {
|
|
85
|
+
console.log(chalk.gray(` ${section.slug}: ${section.fields.length} fields`));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (result.schema.totalFields === 0) {
|
|
90
|
+
console.log();
|
|
91
|
+
console.log(chalk.yellow('No data-reverso markers found.'));
|
|
92
|
+
console.log(chalk.gray('Add markers to your components like:'));
|
|
93
|
+
console.log(chalk.gray(' <h1 data-reverso="home.hero.title">Welcome</h1>'));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
spinner.fail(chalk.red('Scan failed'));
|
|
99
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAAA;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C,KAAK,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0FnD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start command - starts the production server.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
8
|
+
export function startCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('start')
|
|
11
|
+
.description('Start the production server')
|
|
12
|
+
.option('-p, --port <port>', 'Server port', process.env.REVERSO_PORT || '3001')
|
|
13
|
+
.option('-H, --host <host>', 'Server host', process.env.REVERSO_HOST || '0.0.0.0')
|
|
14
|
+
.option('-d, --database <path>', 'Database file path', process.env.REVERSO_DB_PATH || '.reverso/reverso.db')
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
const spinner = ora();
|
|
17
|
+
try {
|
|
18
|
+
const port = parseInt(options.port, 10);
|
|
19
|
+
const dbPath = resolve(options.database);
|
|
20
|
+
// Validate database exists
|
|
21
|
+
if (!existsSync(dbPath)) {
|
|
22
|
+
console.error(chalk.red(`Database not found: ${dbPath}`));
|
|
23
|
+
console.error(chalk.yellow('Run `reverso build` first to initialize the database.'));
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
console.log(chalk.blue.bold('Starting Reverso CMS production server...'));
|
|
27
|
+
console.log();
|
|
28
|
+
console.log(chalk.gray(`Database: ${dbPath}`));
|
|
29
|
+
console.log();
|
|
30
|
+
// Initialize database
|
|
31
|
+
spinner.start('Connecting to database...');
|
|
32
|
+
const { initDatabase, getDatabase } = await import('@reverso/db');
|
|
33
|
+
initDatabase({ url: dbPath });
|
|
34
|
+
const db = getDatabase();
|
|
35
|
+
spinner.succeed('Database connected');
|
|
36
|
+
// Start API server
|
|
37
|
+
spinner.start('Starting server...');
|
|
38
|
+
const { createApiServer, startServer, registerRoutes } = await import('@reverso/api');
|
|
39
|
+
const server = await createApiServer({
|
|
40
|
+
port,
|
|
41
|
+
host: options.host,
|
|
42
|
+
databaseUrl: dbPath,
|
|
43
|
+
cors: true,
|
|
44
|
+
logger: true,
|
|
45
|
+
});
|
|
46
|
+
// Register routes with database
|
|
47
|
+
await registerRoutes(server);
|
|
48
|
+
const address = await startServer(server);
|
|
49
|
+
spinner.succeed(`Server running at ${address}`);
|
|
50
|
+
console.log();
|
|
51
|
+
console.log(chalk.green.bold('Production server ready!'));
|
|
52
|
+
console.log();
|
|
53
|
+
console.log(chalk.bold('Endpoints:'));
|
|
54
|
+
console.log(chalk.gray(` API: ${address}/api/reverso`));
|
|
55
|
+
console.log(chalk.gray(` Health: ${address}/health`));
|
|
56
|
+
console.log(chalk.gray(` Auth: ${address}/auth/login`));
|
|
57
|
+
console.log();
|
|
58
|
+
// Log security reminders in production
|
|
59
|
+
if (process.env.NODE_ENV === 'production') {
|
|
60
|
+
if (!process.env.REVERSO_COOKIE_SECRET) {
|
|
61
|
+
console.log(chalk.yellow('Warning: REVERSO_COOKIE_SECRET not set. Using development fallback.'));
|
|
62
|
+
}
|
|
63
|
+
if (!process.env.REVERSO_API_KEY) {
|
|
64
|
+
console.log(chalk.yellow('Info: No API key configured. Only session auth available.'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
console.log(chalk.gray('Press Ctrl+C to stop'));
|
|
68
|
+
// Handle shutdown
|
|
69
|
+
const shutdown = async () => {
|
|
70
|
+
console.log(chalk.gray('\nShutting down gracefully...'));
|
|
71
|
+
await server.close();
|
|
72
|
+
const { closeDatabase } = await import('@reverso/db');
|
|
73
|
+
await closeDatabase();
|
|
74
|
+
console.log(chalk.green('Server stopped.'));
|
|
75
|
+
process.exit(0);
|
|
76
|
+
};
|
|
77
|
+
process.on('SIGINT', shutdown);
|
|
78
|
+
process.on('SIGTERM', shutdown);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
spinner.fail(chalk.red('Failed to start server'));
|
|
82
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,MAAM,CAAC,mBAAmB,EAAE,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,MAAM,CAAC;SAC9E,MAAM,CAAC,mBAAmB,EAAE,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC;SACjF,MAAM,CAAC,uBAAuB,EAAE,oBAAoB,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,qBAAqB,CAAC;SAC3G,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;QAEtB,IAAI,CAAC;YACH,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AAC,CAAC;gBACzF,CAAC;YACH,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;YAEhD,kBAAkB;YAClB,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;gBACzD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;gBACrB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBACtD,MAAM,aAAa,EAAE,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;gBAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC;YAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @reverso/cli
|
|
3
|
+
*
|
|
4
|
+
* Command line interface for Reverso CMS.
|
|
5
|
+
* Provides commands for scanning, development, database management, and more.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```bash
|
|
9
|
+
* # Scan project for data-reverso markers
|
|
10
|
+
* npx reverso scan
|
|
11
|
+
*
|
|
12
|
+
* # Start development server
|
|
13
|
+
* npx reverso dev
|
|
14
|
+
*
|
|
15
|
+
* # Run database migrations
|
|
16
|
+
* npx reverso migrate
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const VERSION = "0.0.0";
|
|
20
|
+
export { scanCommand, devCommand, migrateCommand } from './commands/index.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @reverso/cli
|
|
3
|
+
*
|
|
4
|
+
* Command line interface for Reverso CMS.
|
|
5
|
+
* Provides commands for scanning, development, database management, and more.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```bash
|
|
9
|
+
* # Scan project for data-reverso markers
|
|
10
|
+
* npx reverso scan
|
|
11
|
+
*
|
|
12
|
+
* # Start development server
|
|
13
|
+
* npx reverso dev
|
|
14
|
+
*
|
|
15
|
+
* # Run database migrations
|
|
16
|
+
* npx reverso migrate
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const VERSION = '0.0.0';
|
|
20
|
+
// Export commands for programmatic use
|
|
21
|
+
export { scanCommand, devCommand, migrateCommand } from './commands/index.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,uCAAuC;AACvC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reverso/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Command line interface for Reverso CMS",
|
|
5
|
+
"homepage": "https://reverso.dev/docs/packages/cli",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/hogrid/reverso/issues"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.0.0"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"bin": {
|
|
16
|
+
"reverso": "./dist/bin.js"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.build.json",
|
|
30
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"lint": "biome check src/",
|
|
33
|
+
"test": "vitest run --passWithNoTests",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"clean": "rm -rf dist .turbo"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@reverso/core": "workspace:*",
|
|
39
|
+
"@reverso/scanner": "workspace:*",
|
|
40
|
+
"@reverso/db": "workspace:*",
|
|
41
|
+
"@reverso/api": "workspace:*",
|
|
42
|
+
"commander": "^14.0.2",
|
|
43
|
+
"chalk": "^5.4.1",
|
|
44
|
+
"ora": "^9.1.0",
|
|
45
|
+
"prompts": "^2.4.2",
|
|
46
|
+
"dotenv": "^17.2.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.10.7",
|
|
50
|
+
"@types/prompts": "^2.4.9",
|
|
51
|
+
"typescript": "^5.7.3",
|
|
52
|
+
"vitest": "^2.1.8"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/hogrid/reverso.git",
|
|
60
|
+
"directory": "packages/cli"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"reverso",
|
|
64
|
+
"cms",
|
|
65
|
+
"cli",
|
|
66
|
+
"command-line"
|
|
67
|
+
],
|
|
68
|
+
"author": "Emerson Nunes <emerson@hogrid.com>",
|
|
69
|
+
"license": "MIT"
|
|
70
|
+
}
|