oryon-framework 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +12 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oryon-framework",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Oryon — IA orquestra. Você descreve. JARVIS entrega.",
5
5
  "bin": {
6
6
  "oryon": "bin/oryon.js"
package/src/init.js CHANGED
@@ -3,7 +3,6 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
- const readline = require('readline');
7
6
 
8
7
  // ─── Helpers ──────────────────────────────────────────────────────────────────
9
8
 
@@ -12,22 +11,11 @@ const BOLD = '\x1b[1m';
12
11
  const DIM = '\x1b[2m';
13
12
  const GREEN = '\x1b[32m';
14
13
  const CYAN = '\x1b[36m';
15
- const YELLOW = '\x1b[33m';
16
14
 
17
15
  const log = (msg) => console.log(msg);
18
16
  const ok = (msg) => console.log(`${GREEN}✓${RESET} ${msg}`);
19
- const dim = (msg) => console.log(`${DIM}${msg}${RESET}`);
20
17
  const sep = () => console.log(`${DIM}────────────────────────────────${RESET}`);
21
18
 
22
- function ask(rl, question, defaultVal) {
23
- return new Promise((resolve) => {
24
- const hint = defaultVal ? `${DIM} [${defaultVal}]${RESET}` : '';
25
- rl.question(`${CYAN}?${RESET} ${question}${hint}: `, (answer) => {
26
- resolve(answer.trim() || defaultVal || '');
27
- });
28
- });
29
- }
30
-
31
19
  function copyRecursive(src, dest) {
32
20
  if (!fs.existsSync(src)) return;
33
21
  const stat = fs.statSync(src);
@@ -191,68 +179,34 @@ function scaffoldProject(targetDir, vaultPath, projectName, packageRoot) {
191
179
 
192
180
  // ─── Main ─────────────────────────────────────────────────────────────────────
193
181
 
194
- async function main() {
182
+ function main() {
195
183
  const packageRoot = path.resolve(__dirname, '..');
196
- const yes = process.argv.includes('--yes') || process.argv.includes('-y');
197
-
198
- log('');
199
- log(`${BOLD}Oryon Framework${RESET} — instalação`);
200
- sep();
201
- log('');
202
-
203
- // Detecta contexto
204
184
  const cwd = process.cwd();
205
- const isExisting = fs.existsSync(path.join(cwd, 'package.json'))
206
- || fs.existsSync(path.join(cwd, 'index.html'))
207
- || fs.existsSync(path.join(cwd, 'src'));
208
185
 
209
- if (isExisting) {
210
- log(`${YELLOW}Projeto existente detectado.${RESET} O Oryon será adicionado a esta pasta.`);
211
- } else {
212
- dim(`Pasta atual: ${cwd}`);
213
- }
214
- log('');
215
-
216
- const folderName = path.basename(cwd);
217
- const defaultName = folderName.toLowerCase().replace(/\s+/g, '-');
218
- const vaultDefault = resolveVaultDefault();
219
-
220
- let projectName, vaultPath;
221
-
222
- if (yes) {
223
- // Modo silencioso — usa defaults
224
- projectName = defaultName;
225
- vaultPath = vaultDefault;
226
- log(`${DIM}Modo automático: projeto="${projectName}", vault="${vaultPath}"${RESET}`);
227
- log('');
228
- } else {
229
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
230
- projectName = await ask(rl, 'Nome do projeto', defaultName);
231
- const vaultInput = await ask(rl, 'Onde criar o vault Oryon', vaultDefault);
232
- vaultPath = path.resolve(vaultInput.replace(/^~/, os.homedir()));
233
- rl.close();
234
- }
235
186
  log('');
187
+ log(`${BOLD}Oryon Framework${RESET} — instalando...`);
236
188
  sep();
237
189
  log('');
238
190
 
191
+ // Tudo automático — sem perguntas
192
+ const projectName = path.basename(cwd).toLowerCase().replace(/\s+/g, '-');
193
+ const vaultPath = resolveVaultDefault();
194
+
239
195
  // Cria vault
240
- log(`Criando vault em ${DIM}${vaultPath}${RESET}...`);
241
196
  try {
242
197
  createVault(vaultPath, projectName);
243
- ok('Vault criado');
198
+ ok('Memória do JARVIS criada');
244
199
  } catch (e) {
245
- console.error(`Erro ao criar vault: ${e.message}`);
200
+ console.error(`Erro: ${e.message}`);
246
201
  process.exit(1);
247
202
  }
248
203
 
249
204
  // Scaffold do projeto
250
- log('Copiando arquivos do framework...');
251
205
  try {
252
206
  scaffoldProject(cwd, vaultPath, projectName, packageRoot);
253
207
  ok('Framework instalado');
254
208
  } catch (e) {
255
- console.error(`Erro ao copiar arquivos: ${e.message}`);
209
+ console.error(`Erro: ${e.message}`);
256
210
  process.exit(1);
257
211
  }
258
212
 
@@ -261,16 +215,10 @@ async function main() {
261
215
  log('');
262
216
  log(`${GREEN}${BOLD}Pronto.${RESET}`);
263
217
  log('');
264
- log('Próximos passos:');
265
218
  log(` ${CYAN}1.${RESET} Abra esta pasta no ${BOLD}VS Code${RESET}`);
266
- log(` ${CYAN}2.${RESET} Abra o ${BOLD}Claude Code${RESET} (extensão ou terminal)`);
267
- log(` ${CYAN}3.${RESET} Fale o que você quer construir`);
268
- log('');
269
- log(`${DIM}JARVIS vai assumir a partir daí.${RESET}`);
219
+ log(` ${CYAN}2.${RESET} Abra o ${BOLD}Claude Code${RESET}`);
220
+ log(` ${CYAN}3.${RESET} Fale o que quer construir — JARVIS responde`);
270
221
  log('');
271
222
  }
272
223
 
273
- main().catch((e) => {
274
- console.error(e.message);
275
- process.exit(1);
276
- });
224
+ main();