nex-framework-cli 1.0.23 → 1.0.25
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/cli/nex-cli.js +24 -5
- package/package.json +1 -1
- package/scripts/postinstall.js +2 -2
package/cli/nex-cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import chalk from 'chalk'
|
|
|
8
8
|
import inquirer from 'inquirer'
|
|
9
9
|
import fs from 'fs-extra'
|
|
10
10
|
import path from 'path'
|
|
11
|
-
import { fileURLToPath } from 'url'
|
|
11
|
+
import { fileURLToPath, pathToFileURL } from 'url'
|
|
12
12
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url)
|
|
14
14
|
const __dirname = path.dirname(__filename)
|
|
@@ -28,10 +28,10 @@ program.configureHelp({
|
|
|
28
28
|
program
|
|
29
29
|
.name('nex')
|
|
30
30
|
.description('NEX Framework - Framework completo de agentes AI')
|
|
31
|
-
.version('1.0.
|
|
31
|
+
.version('1.0.24', '-v, --version', 'Mostra a versão')
|
|
32
32
|
.addHelpText('before', chalk.bold.cyan(`
|
|
33
33
|
╔════════════════════════════════════════════════════════════════╗
|
|
34
|
-
║ NEX Framework - CLI v1.0.
|
|
34
|
+
║ NEX Framework - CLI v1.0.24 ║
|
|
35
35
|
║ Framework completo de agentes AI ║
|
|
36
36
|
╚════════════════════════════════════════════════════════════════╝
|
|
37
37
|
`))
|
|
@@ -364,8 +364,27 @@ configCmd
|
|
|
364
364
|
.command('reset')
|
|
365
365
|
.description('Reconfigura o NEX CLI (nome, idiomas, integração Cursor)')
|
|
366
366
|
.action(async () => {
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
try {
|
|
368
|
+
// Resolve path to postinstall.js relative to CLI location (works for global installs)
|
|
369
|
+
const postinstallPath = path.join(__dirname, '..', 'scripts', 'postinstall.js')
|
|
370
|
+
// Convert to file URL for ES module import
|
|
371
|
+
const postinstallUrl = pathToFileURL(postinstallPath).href
|
|
372
|
+
const { runSetup } = await import(postinstallUrl)
|
|
373
|
+
await runSetup(true) // Force reconfiguration
|
|
374
|
+
} catch (error) {
|
|
375
|
+
// Fallback: try relative import (works in development)
|
|
376
|
+
try {
|
|
377
|
+
const { runSetup } = await import('../scripts/postinstall.js')
|
|
378
|
+
await runSetup(true)
|
|
379
|
+
} catch (fallbackError) {
|
|
380
|
+
console.error(chalk.red(`\n❌ Erro ao reconfigurar: ${fallbackError.message}`))
|
|
381
|
+
if (fallbackError.code === 'ERR_MODULE_NOT_FOUND') {
|
|
382
|
+
console.error(chalk.yellow(`\n💡 Arquivo não encontrado. Verifique se o pacote está instalado corretamente.`))
|
|
383
|
+
}
|
|
384
|
+
console.error(chalk.gray(`\nCaminho tentado: ${path.join(__dirname, '..', 'scripts', 'postinstall.js')}`))
|
|
385
|
+
process.exit(1)
|
|
386
|
+
}
|
|
387
|
+
}
|
|
369
388
|
})
|
|
370
389
|
|
|
371
390
|
configCmd
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -122,7 +122,7 @@ export async function runSetup(force = false) {
|
|
|
122
122
|
enabled: answers.cursorIntegration
|
|
123
123
|
},
|
|
124
124
|
installedAt: new Date().toISOString(),
|
|
125
|
-
version: '1.0.
|
|
125
|
+
version: '1.0.24'
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// Save config
|
|
@@ -153,7 +153,7 @@ try {
|
|
|
153
153
|
enabled: false
|
|
154
154
|
},
|
|
155
155
|
installedAt: new Date().toISOString(),
|
|
156
|
-
version: '1.0.
|
|
156
|
+
version: '1.0.24'
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// Create directory and file synchronously (fast)
|