nex-framework-cli 1.0.22 → 1.0.23
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 +2 -2
- package/package.json +1 -1
- package/scripts/postinstall.js +36 -33
package/cli/nex-cli.js
CHANGED
|
@@ -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.23', '-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.23 ║
|
|
35
35
|
║ Framework completo de agentes AI ║
|
|
36
36
|
╚════════════════════════════════════════════════════════════════╝
|
|
37
37
|
`))
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* NEX CLI Post-Install Script
|
|
4
4
|
* Runs after npm install to configure the CLI
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: This script must be FAST and NON-BLOCKING
|
|
7
|
+
* Interactive setup is done via: nex config reset
|
|
5
8
|
*/
|
|
6
9
|
|
|
7
|
-
import inquirer from 'inquirer'
|
|
8
10
|
import fs from 'fs-extra'
|
|
9
11
|
import path from 'path'
|
|
10
12
|
import os from 'os'
|
|
11
|
-
import chalk from 'chalk'
|
|
12
13
|
import { fileURLToPath } from 'url'
|
|
13
14
|
|
|
14
15
|
const __filename = fileURLToPath(import.meta.url)
|
|
@@ -27,7 +28,12 @@ export function getGlobalConfigPath() {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
// Interactive setup (only called by nex config reset)
|
|
30
32
|
export async function runSetup(force = false) {
|
|
33
|
+
// Dynamic import to avoid loading inquirer during postinstall
|
|
34
|
+
const inquirer = (await import('inquirer')).default
|
|
35
|
+
const chalk = (await import('chalk')).default
|
|
36
|
+
|
|
31
37
|
// Check if config already exists
|
|
32
38
|
const configPath = getGlobalConfigPath()
|
|
33
39
|
const configDir = path.dirname(configPath)
|
|
@@ -116,7 +122,7 @@ export async function runSetup(force = false) {
|
|
|
116
122
|
enabled: answers.cursorIntegration
|
|
117
123
|
},
|
|
118
124
|
installedAt: new Date().toISOString(),
|
|
119
|
-
version: '1.0.
|
|
125
|
+
version: '1.0.23'
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
// Save config
|
|
@@ -132,39 +138,36 @@ export async function runSetup(force = false) {
|
|
|
132
138
|
console.log(chalk.cyan('\n💡 Dica: Para reconfigurar, execute: nex config reset\n'))
|
|
133
139
|
}
|
|
134
140
|
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
// Post-install: Create default config SYNCHRONOUSLY and EXIT IMMEDIATELY
|
|
142
|
+
// This must be FAST - no async operations, no prompts, no delays
|
|
143
|
+
try {
|
|
144
|
+
const configPath = getGlobalConfigPath()
|
|
145
|
+
const configDir = path.dirname(configPath)
|
|
146
|
+
const defaultConfig = {
|
|
147
|
+
user: {
|
|
148
|
+
name: process.env.USER || process.env.USERNAME || 'Developer',
|
|
149
|
+
conversationLanguage: 'pt-BR',
|
|
150
|
+
documentLanguage: 'pt-BR'
|
|
151
|
+
},
|
|
145
152
|
cursor: {
|
|
146
153
|
enabled: false
|
|
147
154
|
},
|
|
148
155
|
installedAt: new Date().toISOString(),
|
|
149
|
-
version: '1.0.
|
|
156
|
+
version: '1.0.23'
|
|
150
157
|
}
|
|
151
158
|
|
|
152
|
-
// Create
|
|
153
|
-
fs.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
.finally(() => {
|
|
168
|
-
// Always exit successfully to not block npm install
|
|
169
|
-
process.exit(0)
|
|
170
|
-
})
|
|
159
|
+
// Create directory and file synchronously (fast)
|
|
160
|
+
if (!fs.existsSync(configDir)) {
|
|
161
|
+
fs.mkdirSync(configDir, { recursive: true })
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Only create if doesn't exist (don't overwrite existing config)
|
|
165
|
+
if (!fs.existsSync(configPath)) {
|
|
166
|
+
fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), 'utf8')
|
|
167
|
+
}
|
|
168
|
+
} catch (error) {
|
|
169
|
+
// Silently fail - don't block installation
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Exit immediately - don't wait for anything
|
|
173
|
+
process.exit(0)
|