**refactor(cli): remove unused Brainy CLI implementation**

- Deleted the entire `src/cli.ts` file, effectively removing the Brainy CLI component.
- The change streamlines the codebase by eliminating unused and redundant code related to the CLI.
- This refactor supports maintaining a cleaner and more focused project architecture.
This commit is contained in:
David Snelling 2025-07-02 11:55:44 -07:00
parent c5461d7ea1
commit 3f4266ae4f
10 changed files with 120 additions and 92 deletions

View file

@ -19,16 +19,16 @@ const __dirname = dirname(__filename)
// Find the main package
const mainPackagePath = join(__dirname, 'node_modules', '@soulcraft', 'brainy')
// Path to the actual CLI script in the main package
const cliPath = join(mainPackagePath, 'dist', 'cli.js')
// Path to the actual CLI script in this package
const cliPath = join(__dirname, 'dist', 'cli.js')
// Check if the CLI script exists
if (!fs.existsSync(cliPath)) {
console.error(`Error: CLI script not found at ${cliPath}`)
console.error('This is likely because the main package is not installed correctly.')
console.error('This is likely because the CLI was not built during package installation.')
console.error('Please reinstall the package with:')
console.error('npm uninstall -g @soulcraft/brainy-cli')
console.error('npm install -g @soulcraft/brainy-cli --legacy-peer-deps')
console.error('npm install -g @soulcraft/brainy-cli')
process.exit(1)
}

View file

@ -1,6 +1,6 @@
{
"name": "@soulcraft/brainy-cli",
"version": "0.9.16",
"version": "0.9.17",
"description": "Command-line interface for the Brainy vector graph database",
"type": "module",
"bin": {
@ -8,9 +8,13 @@
},
"files": [
"cli-wrapper.js",
"README.md"
"README.md",
"dist/cli.js",
"dist/cli.js.map"
],
"scripts": {
"build": "rollup -c rollup.config.js",
"prepare": "npm run build",
"postinstall": "node cli-wrapper.js --version"
},
"keywords": [
@ -35,7 +39,20 @@
"url": "https://github.com/soulcraft-research/brainy.git"
},
"dependencies": {
"@soulcraft/brainy": "0.9.16"
"@soulcraft/brainy": "0.9.17",
"commander": "^14.0.0",
"omelette": "^0.4.17"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.4.5",
"@types/omelette": "^0.4.5",
"rollup": "^4.12.0",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^5.1.6"
},
"engines": {
"node": ">=24.0.0"

View file

@ -0,0 +1,42 @@
import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import { terser } from 'rollup-plugin-terser'
// CLI configuration
export default {
input: 'src/cli.ts',
output: {
dir: 'dist',
entryFileNames: 'cli.js',
format: 'es',
sourcemap: true,
inlineDynamicImports: true
},
plugins: [
resolve({
browser: false,
preferBuiltins: true
}),
commonjs({
transformMixedEsModules: true
}),
json(),
typescript({
tsconfig: './tsconfig.json',
declaration: false,
declarationMap: false
})
],
external: [
// External dependencies that should not be bundled
'@soulcraft/brainy',
'commander',
'omelette',
'fs',
'path',
'url',
'child_process'
]
}

1286
cli-package/src/cli.ts Normal file

File diff suppressed because it is too large Load diff

15
cli-package/tsconfig.json Normal file
View file

@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"outDir": "dist",
"declaration": true,
"sourceMap": true,
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}