spindb 0.2.4 → 0.2.6
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/cli.js +23 -20
- package/{src/bin/cli.ts → cli/bin.ts} +1 -1
- package/{src/cli → cli}/commands/clone.ts +6 -6
- package/{src/cli → cli}/commands/config.ts +4 -4
- package/{src/cli → cli}/commands/connect.ts +5 -5
- package/{src/cli → cli}/commands/create.ts +7 -7
- package/{src/cli → cli}/commands/delete.ts +6 -6
- package/{src/cli → cli}/commands/list.ts +2 -2
- package/{src/cli → cli}/commands/menu.ts +10 -10
- package/{src/cli → cli}/commands/postgres-tools.ts +2 -2
- package/{src/cli → cli}/commands/restore.ts +6 -6
- package/{src/cli → cli}/commands/start.ts +7 -7
- package/{src/cli → cli}/commands/stop.ts +6 -6
- package/{src/cli → cli}/index.ts +12 -12
- package/{src/cli → cli}/ui/prompts.ts +3 -3
- package/{src/core → core}/binary-manager.ts +3 -3
- package/{src/core → core}/config-manager.ts +2 -2
- package/{src/core → core}/container-manager.ts +4 -4
- package/{src/core → core}/port-manager.ts +3 -3
- package/{src/core → core}/postgres-binary-manager.ts +2 -2
- package/{src/core → core}/process-manager.ts +2 -2
- package/{src/engines → engines}/base-engine.ts +1 -1
- package/{src/engines → engines}/index.ts +3 -3
- package/{src/engines → engines}/postgresql/binary-urls.ts +1 -1
- package/{src/engines → engines}/postgresql/index.ts +7 -7
- package/{src/engines → engines}/postgresql/restore.ts +3 -3
- package/package.json +9 -10
- package/tsconfig.json +0 -27
- /package/{src/cli → cli}/ui/spinner.ts +0 -0
- /package/{src/cli → cli}/ui/theme.ts +0 -0
- /package/{src/config → config}/defaults.ts +0 -0
- /package/{src/config → config}/paths.ts +0 -0
- /package/{src/types → types}/index.ts +0 -0
package/bin/cli.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { existsSync } from 'fs'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import { dirname, join } from 'node:path'
|
|
5
|
+
import { spawn } from 'node:child_process'
|
|
7
6
|
|
|
8
|
-
// Get the directory
|
|
9
|
-
const
|
|
7
|
+
// Get the directory of this file
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
9
|
+
const __dirname = dirname(__filename)
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
const
|
|
11
|
+
// Path to the main TypeScript entry point
|
|
12
|
+
const mainScript = join(__dirname, '..', 'cli', 'bin.ts')
|
|
13
13
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
console.error('Debug: tsconfig exists:', existsSync(tsconfigPath))
|
|
14
|
+
// Use tsx to execute the TypeScript file
|
|
15
|
+
const tsxPath = join(__dirname, '..', 'node_modules', '.bin', 'tsx')
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
17
|
+
// Spawn tsx process with the main script and pass through all arguments
|
|
18
|
+
const child = spawn(tsxPath, [mainScript, ...process.argv.slice(2)], {
|
|
19
|
+
stdio: 'inherit',
|
|
20
|
+
shell: false,
|
|
21
|
+
})
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
// Forward exit code
|
|
24
|
+
child.on('exit', (code) => {
|
|
25
|
+
process.exit(code ?? 0)
|
|
27
26
|
})
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
// Handle errors
|
|
29
|
+
child.on('error', (err) => {
|
|
30
|
+
console.error('Failed to start spindb:', err.message)
|
|
31
|
+
process.exit(1)
|
|
32
|
+
})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { containerManager } from '
|
|
4
|
-
import { processManager } from '
|
|
5
|
-
import { getEngine } from '
|
|
6
|
-
import { promptContainerSelect, promptContainerName } from '
|
|
7
|
-
import { createSpinner } from '
|
|
8
|
-
import { error, warning, connectionBox } from '
|
|
3
|
+
import { containerManager } from '../../core/container-manager'
|
|
4
|
+
import { processManager } from '../../core/process-manager'
|
|
5
|
+
import { getEngine } from '../../engines'
|
|
6
|
+
import { promptContainerSelect, promptContainerName } from '../ui/prompts'
|
|
7
|
+
import { createSpinner } from '../ui/spinner'
|
|
8
|
+
import { error, warning, connectionBox } from '../ui/theme'
|
|
9
9
|
|
|
10
10
|
export const cloneCommand = new Command('clone')
|
|
11
11
|
.description('Clone a container with all its data')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
3
|
import { existsSync } from 'fs'
|
|
4
|
-
import { configManager } from '
|
|
5
|
-
import { error, success, header } from '
|
|
6
|
-
import { createSpinner } from '
|
|
7
|
-
import type { BinaryTool } from '
|
|
4
|
+
import { configManager } from '../../core/config-manager'
|
|
5
|
+
import { error, success, header } from '../ui/theme'
|
|
6
|
+
import { createSpinner } from '../ui/spinner'
|
|
7
|
+
import type { BinaryTool } from '../../types'
|
|
8
8
|
|
|
9
9
|
const VALID_TOOLS: BinaryTool[] = [
|
|
10
10
|
'psql',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import { spawn } from 'child_process'
|
|
3
3
|
import chalk from 'chalk'
|
|
4
|
-
import { containerManager } from '
|
|
5
|
-
import { processManager } from '
|
|
6
|
-
import { getEngine } from '
|
|
7
|
-
import { promptContainerSelect } from '
|
|
8
|
-
import { error, warning, info } from '
|
|
4
|
+
import { containerManager } from '../../core/container-manager'
|
|
5
|
+
import { processManager } from '../../core/process-manager'
|
|
6
|
+
import { getEngine } from '../../engines'
|
|
7
|
+
import { promptContainerSelect } from '../ui/prompts'
|
|
8
|
+
import { error, warning, info } from '../ui/theme'
|
|
9
9
|
|
|
10
10
|
export const connectCommand = new Command('connect')
|
|
11
11
|
.description('Connect to a container with psql')
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { containerManager } from '
|
|
4
|
-
import { portManager } from '
|
|
5
|
-
import { getEngine } from '
|
|
6
|
-
import { defaults } from '
|
|
7
|
-
import { promptCreateOptions } from '
|
|
8
|
-
import { createSpinner } from '
|
|
9
|
-
import { header, error, connectionBox } from '
|
|
3
|
+
import { containerManager } from '../../core/container-manager'
|
|
4
|
+
import { portManager } from '../../core/port-manager'
|
|
5
|
+
import { getEngine } from '../../engines'
|
|
6
|
+
import { defaults } from '../../config/defaults'
|
|
7
|
+
import { promptCreateOptions } from '../ui/prompts'
|
|
8
|
+
import { createSpinner } from '../ui/spinner'
|
|
9
|
+
import { header, error, connectionBox } from '../ui/theme'
|
|
10
10
|
|
|
11
11
|
export const createCommand = new Command('create')
|
|
12
12
|
.description('Create a new database container')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
|
-
import { containerManager } from '
|
|
3
|
-
import { processManager } from '
|
|
4
|
-
import { getEngine } from '
|
|
5
|
-
import { promptContainerSelect, promptConfirm } from '
|
|
6
|
-
import { createSpinner } from '
|
|
7
|
-
import { error, warning } from '
|
|
2
|
+
import { containerManager } from '../../core/container-manager'
|
|
3
|
+
import { processManager } from '../../core/process-manager'
|
|
4
|
+
import { getEngine } from '../../engines'
|
|
5
|
+
import { promptContainerSelect, promptConfirm } from '../ui/prompts'
|
|
6
|
+
import { createSpinner } from '../ui/spinner'
|
|
7
|
+
import { error, warning } from '../ui/theme'
|
|
8
8
|
|
|
9
9
|
export const deleteCommand = new Command('delete')
|
|
10
10
|
.alias('rm')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { containerManager } from '
|
|
4
|
-
import { info, error } from '
|
|
3
|
+
import { containerManager } from '../../core/container-manager'
|
|
4
|
+
import { info, error } from '../ui/theme'
|
|
5
5
|
|
|
6
6
|
export const listCommand = new Command('list')
|
|
7
7
|
.alias('ls')
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { containerManager } from '
|
|
4
|
-
import { processManager } from '
|
|
5
|
-
import { getEngine } from '
|
|
3
|
+
import { containerManager } from '../../core/container-manager'
|
|
4
|
+
import { processManager } from '../../core/process-manager'
|
|
5
|
+
import { getEngine } from '../../engines'
|
|
6
6
|
import {
|
|
7
7
|
promptContainerSelect,
|
|
8
8
|
promptDatabaseName,
|
|
9
9
|
promptCreateOptions,
|
|
10
10
|
promptConfirm,
|
|
11
|
-
} from '
|
|
12
|
-
import { createSpinner } from '
|
|
11
|
+
} from '../ui/prompts'
|
|
12
|
+
import { createSpinner } from '../ui/spinner'
|
|
13
13
|
import {
|
|
14
14
|
header,
|
|
15
15
|
success,
|
|
@@ -17,15 +17,15 @@ import {
|
|
|
17
17
|
warning,
|
|
18
18
|
info,
|
|
19
19
|
connectionBox,
|
|
20
|
-
} from '
|
|
20
|
+
} from '../ui/theme'
|
|
21
21
|
import { existsSync } from 'fs'
|
|
22
22
|
import { readdir, rm, lstat } from 'fs/promises'
|
|
23
23
|
import { spawn } from 'child_process'
|
|
24
24
|
import { platform } from 'os'
|
|
25
25
|
import { join } from 'path'
|
|
26
|
-
import { paths } from '
|
|
27
|
-
import { portManager } from '
|
|
28
|
-
import { defaults } from '
|
|
26
|
+
import { paths } from '../../config/paths'
|
|
27
|
+
import { portManager } from '../../core/port-manager'
|
|
28
|
+
import { defaults } from '../../config/defaults'
|
|
29
29
|
import inquirer from 'inquirer'
|
|
30
30
|
|
|
31
31
|
type MenuChoice =
|
|
@@ -810,7 +810,7 @@ async function handleRestore(): Promise<void> {
|
|
|
810
810
|
|
|
811
811
|
try {
|
|
812
812
|
const { updatePostgresClientTools } = await import(
|
|
813
|
-
'
|
|
813
|
+
'../../core/postgres-binary-manager'
|
|
814
814
|
)
|
|
815
815
|
const updateSuccess = await updatePostgresClientTools()
|
|
816
816
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { header, success, warning, error } from '
|
|
3
|
+
import { header, success, warning, error } from '../ui/theme'
|
|
4
4
|
import {
|
|
5
5
|
detectPackageManager,
|
|
6
6
|
getBinaryInfo,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
updatePostgresBinaries,
|
|
9
9
|
ensurePostgresBinary,
|
|
10
10
|
getPostgresVersion,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../../core/postgres-binary-manager'
|
|
12
12
|
|
|
13
13
|
export const postgresToolsCommand = new Command('postgres-tools').description(
|
|
14
14
|
'Manage PostgreSQL client tools (psql, pg_restore, etc.)',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import { existsSync } from 'fs'
|
|
3
3
|
import chalk from 'chalk'
|
|
4
|
-
import { containerManager } from '
|
|
5
|
-
import { processManager } from '
|
|
6
|
-
import { getEngine } from '
|
|
7
|
-
import { promptContainerSelect, promptDatabaseName } from '
|
|
8
|
-
import { createSpinner } from '
|
|
9
|
-
import { success, error, warning } from '
|
|
4
|
+
import { containerManager } from '../../core/container-manager'
|
|
5
|
+
import { processManager } from '../../core/process-manager'
|
|
6
|
+
import { getEngine } from '../../engines'
|
|
7
|
+
import { promptContainerSelect, promptDatabaseName } from '../ui/prompts'
|
|
8
|
+
import { createSpinner } from '../ui/spinner'
|
|
9
|
+
import { success, error, warning } from '../ui/theme'
|
|
10
10
|
import { platform } from 'os'
|
|
11
11
|
import { spawn } from 'child_process'
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
|
-
import { containerManager } from '
|
|
4
|
-
import { portManager } from '
|
|
5
|
-
import { processManager } from '
|
|
6
|
-
import { getEngine } from '
|
|
7
|
-
import { promptContainerSelect } from '
|
|
8
|
-
import { createSpinner } from '
|
|
9
|
-
import { error, warning } from '
|
|
3
|
+
import { containerManager } from '../../core/container-manager'
|
|
4
|
+
import { portManager } from '../../core/port-manager'
|
|
5
|
+
import { processManager } from '../../core/process-manager'
|
|
6
|
+
import { getEngine } from '../../engines'
|
|
7
|
+
import { promptContainerSelect } from '../ui/prompts'
|
|
8
|
+
import { createSpinner } from '../ui/spinner'
|
|
9
|
+
import { error, warning } from '../ui/theme'
|
|
10
10
|
|
|
11
11
|
export const startCommand = new Command('start')
|
|
12
12
|
.description('Start a container')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
|
-
import { containerManager } from '
|
|
3
|
-
import { processManager } from '
|
|
4
|
-
import { getEngine } from '
|
|
5
|
-
import { promptContainerSelect } from '
|
|
6
|
-
import { createSpinner } from '
|
|
7
|
-
import { success, error, warning } from '
|
|
2
|
+
import { containerManager } from '../../core/container-manager'
|
|
3
|
+
import { processManager } from '../../core/process-manager'
|
|
4
|
+
import { getEngine } from '../../engines'
|
|
5
|
+
import { promptContainerSelect } from '../ui/prompts'
|
|
6
|
+
import { createSpinner } from '../ui/spinner'
|
|
7
|
+
import { success, error, warning } from '../ui/theme'
|
|
8
8
|
|
|
9
9
|
export const stopCommand = new Command('stop')
|
|
10
10
|
.description('Stop a container')
|
package/{src/cli → cli}/index.ts
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { program } from 'commander'
|
|
2
|
-
import { createCommand } from '
|
|
3
|
-
import { listCommand } from '
|
|
4
|
-
import { startCommand } from '
|
|
5
|
-
import { stopCommand } from '
|
|
6
|
-
import { deleteCommand } from '
|
|
7
|
-
import { restoreCommand } from '
|
|
8
|
-
import { connectCommand } from '
|
|
9
|
-
import { cloneCommand } from '
|
|
10
|
-
import { menuCommand } from '
|
|
11
|
-
import { configCommand } from '
|
|
12
|
-
import { postgresToolsCommand } from '
|
|
2
|
+
import { createCommand } from './commands/create'
|
|
3
|
+
import { listCommand } from './commands/list'
|
|
4
|
+
import { startCommand } from './commands/start'
|
|
5
|
+
import { stopCommand } from './commands/stop'
|
|
6
|
+
import { deleteCommand } from './commands/delete'
|
|
7
|
+
import { restoreCommand } from './commands/restore'
|
|
8
|
+
import { connectCommand } from './commands/connect'
|
|
9
|
+
import { cloneCommand } from './commands/clone'
|
|
10
|
+
import { menuCommand } from './commands/menu'
|
|
11
|
+
import { configCommand } from './commands/config'
|
|
12
|
+
import { postgresToolsCommand } from './commands/postgres-tools'
|
|
13
13
|
|
|
14
14
|
export async function run(): Promise<void> {
|
|
15
15
|
program
|
|
@@ -31,7 +31,7 @@ export async function run(): Promise<void> {
|
|
|
31
31
|
|
|
32
32
|
// If no arguments provided, show interactive menu
|
|
33
33
|
if (process.argv.length <= 2) {
|
|
34
|
-
const { menuCommand: menu } = await import('
|
|
34
|
+
const { menuCommand: menu } = await import('./commands/menu')
|
|
35
35
|
await menu.parseAsync([])
|
|
36
36
|
return
|
|
37
37
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
3
|
import ora from 'ora'
|
|
4
|
-
import { listEngines, getEngine } from '
|
|
5
|
-
import { defaults } from '
|
|
6
|
-
import type { ContainerConfig } from '
|
|
4
|
+
import { listEngines, getEngine } from '../../engines'
|
|
5
|
+
import { defaults } from '../../config/defaults'
|
|
6
|
+
import type { ContainerConfig } from '../../types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Prompt for container name
|
|
@@ -4,9 +4,9 @@ import { join } from 'path'
|
|
|
4
4
|
import { pipeline } from 'stream/promises'
|
|
5
5
|
import { exec } from 'child_process'
|
|
6
6
|
import { promisify } from 'util'
|
|
7
|
-
import { paths } from '
|
|
8
|
-
import { defaults } from '
|
|
9
|
-
import type { ProgressCallback, InstalledBinary } from '
|
|
7
|
+
import { paths } from '../config/paths'
|
|
8
|
+
import { defaults } from '../config/defaults'
|
|
9
|
+
import type { ProgressCallback, InstalledBinary } from '../types'
|
|
10
10
|
|
|
11
11
|
const execAsync = promisify(exec)
|
|
12
12
|
|
|
@@ -3,13 +3,13 @@ import { readFile, writeFile, mkdir } from 'fs/promises'
|
|
|
3
3
|
import { exec } from 'child_process'
|
|
4
4
|
import { promisify } from 'util'
|
|
5
5
|
import { dirname } from 'path'
|
|
6
|
-
import { paths } from '
|
|
6
|
+
import { paths } from '../config/paths'
|
|
7
7
|
import type {
|
|
8
8
|
SpinDBConfig,
|
|
9
9
|
BinaryConfig,
|
|
10
10
|
BinaryTool,
|
|
11
11
|
BinarySource,
|
|
12
|
-
} from '
|
|
12
|
+
} from '../types'
|
|
13
13
|
|
|
14
14
|
const execAsync = promisify(exec)
|
|
15
15
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync } from 'fs'
|
|
2
2
|
import { mkdir, readdir, readFile, writeFile, rm, cp } from 'fs/promises'
|
|
3
|
-
import { paths } from '
|
|
4
|
-
import { processManager } from '
|
|
5
|
-
import { portManager } from '
|
|
6
|
-
import type { ContainerConfig } from '
|
|
3
|
+
import { paths } from '../config/paths'
|
|
4
|
+
import { processManager } from './process-manager'
|
|
5
|
+
import { portManager } from './port-manager'
|
|
6
|
+
import type { ContainerConfig } from '../types'
|
|
7
7
|
|
|
8
8
|
export type CreateOptions = {
|
|
9
9
|
engine: string
|
|
@@ -3,9 +3,9 @@ import { exec } from 'child_process'
|
|
|
3
3
|
import { promisify } from 'util'
|
|
4
4
|
import { existsSync } from 'fs'
|
|
5
5
|
import { readdir, readFile } from 'fs/promises'
|
|
6
|
-
import { defaults } from '
|
|
7
|
-
import { paths } from '
|
|
8
|
-
import type { ContainerConfig, PortResult } from '
|
|
6
|
+
import { defaults } from '../config/defaults'
|
|
7
|
+
import { paths } from '../config/paths'
|
|
8
|
+
import type { ContainerConfig, PortResult } from '../types'
|
|
9
9
|
|
|
10
10
|
const execAsync = promisify(exec)
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { exec } from 'child_process'
|
|
2
2
|
import { promisify } from 'util'
|
|
3
3
|
import chalk from 'chalk'
|
|
4
|
-
import { createSpinner } from '
|
|
5
|
-
import { warning, error as themeError, success } from '
|
|
4
|
+
import { createSpinner } from '../cli/ui/spinner'
|
|
5
|
+
import { warning, error as themeError, success } from '../cli/ui/theme'
|
|
6
6
|
|
|
7
7
|
const execAsync = promisify(exec)
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@ import { exec, spawn } from 'child_process'
|
|
|
2
2
|
import { promisify } from 'util'
|
|
3
3
|
import { existsSync } from 'fs'
|
|
4
4
|
import { readFile } from 'fs/promises'
|
|
5
|
-
import { paths } from '
|
|
6
|
-
import type { ProcessResult, StatusResult } from '
|
|
5
|
+
import { paths } from '../config/paths'
|
|
6
|
+
import type { ProcessResult, StatusResult } from '../types'
|
|
7
7
|
|
|
8
8
|
const execAsync = promisify(exec)
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { postgresqlEngine } from '
|
|
2
|
-
import type { BaseEngine } from '
|
|
3
|
-
import type { EngineInfo } from '
|
|
1
|
+
import { postgresqlEngine } from './postgresql'
|
|
2
|
+
import type { BaseEngine } from './base-engine'
|
|
3
|
+
import type { EngineInfo } from '../types'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Registry of available database engines
|
|
@@ -2,12 +2,12 @@ import { platform, arch } from 'os'
|
|
|
2
2
|
import { join } from 'path'
|
|
3
3
|
import { spawn, exec } from 'child_process'
|
|
4
4
|
import { promisify } from 'util'
|
|
5
|
-
import { BaseEngine } from '
|
|
6
|
-
import { binaryManager } from '
|
|
7
|
-
import { processManager } from '
|
|
8
|
-
import { configManager } from '
|
|
9
|
-
import { paths } from '
|
|
10
|
-
import { defaults } from '
|
|
5
|
+
import { BaseEngine } from '../base-engine'
|
|
6
|
+
import { binaryManager } from '../../core/binary-manager'
|
|
7
|
+
import { processManager } from '../../core/process-manager'
|
|
8
|
+
import { configManager } from '../../core/config-manager'
|
|
9
|
+
import { paths } from '../../config/paths'
|
|
10
|
+
import { defaults } from '../../config/defaults'
|
|
11
11
|
import {
|
|
12
12
|
getBinaryUrl,
|
|
13
13
|
SUPPORTED_MAJOR_VERSIONS,
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
BackupFormat,
|
|
21
21
|
RestoreResult,
|
|
22
22
|
StatusResult,
|
|
23
|
-
} from '
|
|
23
|
+
} from '../../types'
|
|
24
24
|
|
|
25
25
|
const execAsync = promisify(exec)
|
|
26
26
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile } from 'fs/promises'
|
|
2
2
|
import { exec } from 'child_process'
|
|
3
3
|
import { promisify } from 'util'
|
|
4
|
-
import { configManager } from '
|
|
5
|
-
import { findBinaryPathFresh } from '
|
|
6
|
-
import type { BackupFormat, RestoreResult } from '
|
|
4
|
+
import { configManager } from '../../core/config-manager'
|
|
5
|
+
import { findBinaryPathFresh } from '../../core/postgres-binary-manager'
|
|
6
|
+
import type { BackupFormat, RestoreResult } from '../../types'
|
|
7
7
|
|
|
8
8
|
const execAsync = promisify(exec)
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spindb",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Spin up local database containers without Docker. A DBngin-like CLI for PostgreSQL.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"spindb": "./bin/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "tsx
|
|
11
|
-
"dev": "tsx watch
|
|
12
|
-
"build": "tsc",
|
|
10
|
+
"start": "tsx cli/bin.ts",
|
|
11
|
+
"dev": "tsx watch cli/bin.ts",
|
|
13
12
|
"test": "tsx --test",
|
|
14
13
|
"format": "prettier --write .",
|
|
15
14
|
"lint": "eslint ."
|
|
@@ -49,12 +48,12 @@
|
|
|
49
48
|
"typescript": "^5.3.0",
|
|
50
49
|
"typescript-eslint": "^8.48.0"
|
|
51
50
|
},
|
|
52
|
-
"tsx": {
|
|
53
|
-
"tsconfig": "./tsconfig.json"
|
|
54
|
-
},
|
|
55
51
|
"files": [
|
|
56
|
-
"bin
|
|
57
|
-
"
|
|
58
|
-
"
|
|
52
|
+
"bin",
|
|
53
|
+
"cli",
|
|
54
|
+
"core",
|
|
55
|
+
"config",
|
|
56
|
+
"engines",
|
|
57
|
+
"types"
|
|
59
58
|
]
|
|
60
59
|
}
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"rootDir": "./src",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"declarationMap": true,
|
|
17
|
-
"sourceMap": true,
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"@/*": ["src/*"]
|
|
21
|
-
},
|
|
22
|
-
"allowImportingTsExtensions": true,
|
|
23
|
-
"noEmit": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["src/**/*"],
|
|
26
|
-
"exclude": ["node_modules", "dist"]
|
|
27
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|