@nimbuslab/cli 0.17.2 → 0.17.3
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/README.md +0 -41
- package/dist/index.js +91 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,14 +5,7 @@ CLI para criar projetos com a stack moderna da nimbuslab.
|
|
|
5
5
|
## Instalacao
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
# Instalar CLI
|
|
9
8
|
npm install -g @nimbuslab/cli
|
|
10
|
-
|
|
11
|
-
# IMPORTANTE: Configurar ambiente Node.js (remove fnm/nvm, instala Volta)
|
|
12
|
-
nimbus setup node
|
|
13
|
-
|
|
14
|
-
# Instalar Lola (Code Agent)
|
|
15
|
-
nimbus lola install
|
|
16
9
|
```
|
|
17
10
|
|
|
18
11
|
## Comandos
|
|
@@ -23,7 +16,6 @@ nimbus analyze # Analisar stack do projeto atual
|
|
|
23
16
|
nimbus upgrade # Planejar upgrades de dependencias
|
|
24
17
|
nimbus update # Atualizar o CLI
|
|
25
18
|
nimbus setup node # Configurar ambiente Node.js (Volta)
|
|
26
|
-
nimbus lola install # Instalar Lola (Code Agent)
|
|
27
19
|
nimbus help # Ajuda
|
|
28
20
|
```
|
|
29
21
|
|
|
@@ -112,39 +104,6 @@ curl -fsSL https://bun.sh/install | bash
|
|
|
112
104
|
- [create-next-app](https://github.com/nimbuslab/create-next-app)
|
|
113
105
|
- [create-turborepo](https://github.com/nimbuslab/create-turborepo)
|
|
114
106
|
|
|
115
|
-
## Desenvolvimento
|
|
116
|
-
|
|
117
|
-
### Release
|
|
118
|
-
|
|
119
|
-
O projeto usa injecao de versao no build time para evitar problemas de versionamento.
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Release interativo (recomendado)
|
|
123
|
-
bun run release
|
|
124
|
-
|
|
125
|
-
# Release especifico
|
|
126
|
-
bun run release:patch # 0.17.1 -> 0.17.2
|
|
127
|
-
bun run release:minor # 0.17.1 -> 0.18.0
|
|
128
|
-
bun run release:major # 0.17.1 -> 1.0.0
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Como funciona:**
|
|
132
|
-
1. `bumpp` faz o bump da versao no `package.json`
|
|
133
|
-
2. `scripts/build.ts` le a versao e injeta no bundle via `--define`
|
|
134
|
-
3. `npm publish` publica o pacote
|
|
135
|
-
|
|
136
|
-
**Importante:** O script `prepublishOnly` garante que o build sempre roda antes do publish, mesmo se voce esquecer.
|
|
137
|
-
|
|
138
|
-
### Build Local
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# Build de desenvolvimento
|
|
142
|
-
bun run build
|
|
143
|
-
|
|
144
|
-
# Testar localmente
|
|
145
|
-
bun run dist/index.js --version
|
|
146
|
-
```
|
|
147
|
-
|
|
148
107
|
## Licenca
|
|
149
108
|
|
|
150
109
|
UNLICENSED - [nimbuslab](https://nimbuslab.com.br) 2026
|
package/dist/index.js
CHANGED
|
@@ -3449,11 +3449,14 @@ function detectFnm() {
|
|
|
3449
3449
|
const fnmLocations = IS_WINDOWS ? [
|
|
3450
3450
|
join4(HOME2, "scoop", "shims", "fnm.exe"),
|
|
3451
3451
|
join4(HOME2, "scoop", "apps", "fnm", "current", "fnm.exe"),
|
|
3452
|
-
|
|
3452
|
+
"C:\\ProgramData\\chocolatey\\bin\\fnm.exe",
|
|
3453
3453
|
join4(HOME2, ".cargo", "bin", "fnm.exe"),
|
|
3454
3454
|
join4(HOME2, ".fnm", "fnm.exe"),
|
|
3455
3455
|
join4(HOME2, "AppData", "Local", "fnm", "fnm.exe"),
|
|
3456
|
-
join4(HOME2, "AppData", "Roaming", "fnm", "fnm.exe")
|
|
3456
|
+
join4(HOME2, "AppData", "Roaming", "fnm", "fnm.exe"),
|
|
3457
|
+
join4(HOME2, "AppData", "Local", "Microsoft", "fnm", "fnm.exe"),
|
|
3458
|
+
join4(HOME2, "AppData", "Roaming", "fnm"),
|
|
3459
|
+
join4(HOME2, "AppData", "Local", "fnm_multishells")
|
|
3457
3460
|
] : [
|
|
3458
3461
|
join4(HOME2, ".local", "share", "fnm", "fnm"),
|
|
3459
3462
|
join4(HOME2, ".fnm", "fnm"),
|
|
@@ -3474,6 +3477,17 @@ function detectFnm() {
|
|
|
3474
3477
|
}
|
|
3475
3478
|
}
|
|
3476
3479
|
}
|
|
3480
|
+
if (!fnmPath && process.env.FNM_DIR) {
|
|
3481
|
+
if (existsSync3(process.env.FNM_DIR)) {
|
|
3482
|
+
fnmPath = process.env.FNM_DIR;
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
if (!fnmPath && IS_WINDOWS) {
|
|
3486
|
+
const fnmMultishells = join4(HOME2, "AppData", "Local", "fnm_multishells");
|
|
3487
|
+
if (existsSync3(fnmMultishells)) {
|
|
3488
|
+
fnmPath = fnmMultishells;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3477
3491
|
if (!fnmPath)
|
|
3478
3492
|
return result;
|
|
3479
3493
|
result.installed = true;
|
|
@@ -3516,8 +3530,9 @@ function detectNvm() {
|
|
|
3516
3530
|
const check = spawnSync2(CHECK_CMD2, ["nvm"], { encoding: "utf-8", shell: true });
|
|
3517
3531
|
const nvmWinLocations = [
|
|
3518
3532
|
join4(HOME2, "AppData", "Roaming", "nvm", "nvm.exe"),
|
|
3519
|
-
|
|
3520
|
-
|
|
3533
|
+
"C:\\Program Files\\nvm\\nvm.exe",
|
|
3534
|
+
"C:\\ProgramData\\nvm\\nvm.exe",
|
|
3535
|
+
join4(HOME2, "nvm", "nvm.exe")
|
|
3521
3536
|
];
|
|
3522
3537
|
let nvmPath = null;
|
|
3523
3538
|
if (check.exitCode === 0) {
|
|
@@ -3716,7 +3731,9 @@ async function removeFnm(fnm) {
|
|
|
3716
3731
|
const winFnmDirs = [
|
|
3717
3732
|
join4(HOME2, ".fnm"),
|
|
3718
3733
|
join4(HOME2, "AppData", "Local", "fnm"),
|
|
3719
|
-
join4(HOME2, "AppData", "Roaming", "fnm")
|
|
3734
|
+
join4(HOME2, "AppData", "Roaming", "fnm"),
|
|
3735
|
+
join4(HOME2, "AppData", "Local", "fnm_multishells"),
|
|
3736
|
+
join4(HOME2, "AppData", "Local", "Microsoft", "fnm")
|
|
3720
3737
|
];
|
|
3721
3738
|
for (const dir of winFnmDirs) {
|
|
3722
3739
|
if (existsSync3(dir)) {
|
|
@@ -3724,9 +3741,21 @@ async function removeFnm(fnm) {
|
|
|
3724
3741
|
execSync2(`rmdir /s /q "${dir}"`, { stdio: "pipe", shell: true });
|
|
3725
3742
|
console.log(import_picocolors8.default.dim(` Removido ${dir}`));
|
|
3726
3743
|
removed = true;
|
|
3727
|
-
} catch {
|
|
3744
|
+
} catch {
|
|
3745
|
+
try {
|
|
3746
|
+
execSync2(`powershell -Command "Remove-Item -Path '${dir}' -Recurse -Force"`, { stdio: "pipe" });
|
|
3747
|
+
console.log(import_picocolors8.default.dim(` Removido ${dir}`));
|
|
3748
|
+
removed = true;
|
|
3749
|
+
} catch {}
|
|
3750
|
+
}
|
|
3728
3751
|
}
|
|
3729
3752
|
}
|
|
3753
|
+
try {
|
|
3754
|
+
execSync2(`powershell -Command "[Environment]::SetEnvironmentVariable('FNM_DIR', $null, 'User')"`, { stdio: "pipe" });
|
|
3755
|
+
execSync2(`powershell -Command "[Environment]::SetEnvironmentVariable('FNM_MULTISHELL_PATH', $null, 'User')"`, { stdio: "pipe" });
|
|
3756
|
+
console.log(import_picocolors8.default.dim(" Variaveis de ambiente FNM removidas"));
|
|
3757
|
+
removed = true;
|
|
3758
|
+
} catch {}
|
|
3730
3759
|
for (const configFile of fnm.configFiles || []) {
|
|
3731
3760
|
if (removeFnmFromConfig(configFile)) {
|
|
3732
3761
|
console.log(import_picocolors8.default.dim(` Removido de ${configFile}`));
|
|
@@ -3853,29 +3882,70 @@ async function installVolta() {
|
|
|
3853
3882
|
try {
|
|
3854
3883
|
if (IS_WINDOWS) {
|
|
3855
3884
|
spinner.start("Verificando metodo de instalacao...");
|
|
3856
|
-
const chocoCheck = spawnSync2(CHECK_CMD2, ["choco"], { encoding: "utf-8", shell: true });
|
|
3857
|
-
if (chocoCheck.exitCode === 0) {
|
|
3858
|
-
spinner.stop("Chocolatey detectado");
|
|
3859
|
-
spinner.start("Instalando Volta via Chocolatey...");
|
|
3860
|
-
execSync2("choco install volta -y", { stdio: "pipe" });
|
|
3861
|
-
spinner.stop("Volta instalado!");
|
|
3862
|
-
return true;
|
|
3863
|
-
}
|
|
3864
3885
|
const wingetCheck = spawnSync2(CHECK_CMD2, ["winget"], { encoding: "utf-8", shell: true });
|
|
3865
3886
|
if (wingetCheck.exitCode === 0) {
|
|
3866
3887
|
spinner.stop("winget detectado");
|
|
3867
3888
|
spinner.start("Instalando Volta via winget...");
|
|
3868
|
-
|
|
3889
|
+
try {
|
|
3890
|
+
execSync2("winget install Volta.Volta --silent --accept-package-agreements --accept-source-agreements", {
|
|
3891
|
+
stdio: "pipe",
|
|
3892
|
+
timeout: 120000
|
|
3893
|
+
});
|
|
3894
|
+
spinner.stop("Volta instalado!");
|
|
3895
|
+
const voltaPath = join4(HOME2, ".volta", "bin");
|
|
3896
|
+
console.log(import_picocolors8.default.dim(` Adicionando ${voltaPath} ao PATH...`));
|
|
3897
|
+
try {
|
|
3898
|
+
execSync2(`setx PATH "%PATH%;${voltaPath}"`, { stdio: "pipe", shell: true });
|
|
3899
|
+
} catch {}
|
|
3900
|
+
return true;
|
|
3901
|
+
} catch (e2) {
|
|
3902
|
+
spinner.stop(import_picocolors8.default.yellow("winget falhou, tentando outro metodo..."));
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
const chocoCheck = spawnSync2(CHECK_CMD2, ["choco"], { encoding: "utf-8", shell: true });
|
|
3906
|
+
if (chocoCheck.exitCode === 0) {
|
|
3907
|
+
spinner.start("Instalando Volta via Chocolatey...");
|
|
3908
|
+
try {
|
|
3909
|
+
execSync2("choco install volta -y", { stdio: "pipe", timeout: 120000 });
|
|
3910
|
+
spinner.stop("Volta instalado!");
|
|
3911
|
+
return true;
|
|
3912
|
+
} catch {
|
|
3913
|
+
spinner.stop(import_picocolors8.default.yellow("Chocolatey falhou"));
|
|
3914
|
+
}
|
|
3915
|
+
}
|
|
3916
|
+
spinner.start("Baixando Volta diretamente...");
|
|
3917
|
+
try {
|
|
3918
|
+
const psScript = `
|
|
3919
|
+
$ErrorActionPreference = 'Stop'
|
|
3920
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
3921
|
+
$voltaUrl = 'https://get.volta.sh'
|
|
3922
|
+
$response = Invoke-WebRequest -Uri $voltaUrl -UseBasicParsing
|
|
3923
|
+
# Volta nao tem instalador PS nativo, usar release direto
|
|
3924
|
+
$releaseUrl = 'https://github.com/volta-cli/volta/releases/latest/download/volta-windows.msi'
|
|
3925
|
+
$msiPath = "$env:TEMP\\volta-installer.msi"
|
|
3926
|
+
Invoke-WebRequest -Uri $releaseUrl -OutFile $msiPath
|
|
3927
|
+
Start-Process msiexec.exe -ArgumentList '/i', $msiPath, '/quiet', '/norestart' -Wait
|
|
3928
|
+
Remove-Item $msiPath -Force
|
|
3929
|
+
`;
|
|
3930
|
+
execSync2(`powershell -ExecutionPolicy Bypass -Command "${psScript.replace(/\n/g, " ")}"`, {
|
|
3931
|
+
stdio: "pipe",
|
|
3932
|
+
timeout: 180000
|
|
3933
|
+
});
|
|
3869
3934
|
spinner.stop("Volta instalado!");
|
|
3870
3935
|
return true;
|
|
3936
|
+
} catch (e2) {
|
|
3937
|
+
spinner.stop(import_picocolors8.default.yellow("Download direto falhou"));
|
|
3871
3938
|
}
|
|
3872
|
-
spinner.stop(import_picocolors8.default.yellow("Instale manualmente"));
|
|
3873
3939
|
console.log();
|
|
3874
|
-
console.log(import_picocolors8.default.bold("
|
|
3875
|
-
console.log(
|
|
3940
|
+
console.log(import_picocolors8.default.bold(" Instale manualmente:"));
|
|
3941
|
+
console.log();
|
|
3942
|
+
console.log(import_picocolors8.default.cyan(" 1. Baixe: https://github.com/volta-cli/volta/releases/latest"));
|
|
3943
|
+
console.log(import_picocolors8.default.dim(" (arquivo volta-windows.msi)"));
|
|
3944
|
+
console.log();
|
|
3945
|
+
console.log(import_picocolors8.default.cyan(" 2. Execute o instalador"));
|
|
3946
|
+
console.log();
|
|
3947
|
+
console.log(import_picocolors8.default.cyan(" 3. Reinicie o terminal"));
|
|
3876
3948
|
console.log();
|
|
3877
|
-
console.log(import_picocolors8.default.dim(" Ou instale Chocolatey primeiro:"));
|
|
3878
|
-
console.log(import_picocolors8.default.dim(" https://chocolatey.org/install"));
|
|
3879
3949
|
return false;
|
|
3880
3950
|
} else {
|
|
3881
3951
|
spinner.start("Baixando e instalando Volta...");
|
|
@@ -4065,7 +4135,7 @@ async function setupNode(args) {
|
|
|
4065
4135
|
|
|
4066
4136
|
// src/index.ts
|
|
4067
4137
|
var PACKAGE_NAME2 = "@nimbuslab/cli";
|
|
4068
|
-
var CURRENT_VERSION = "0.17.
|
|
4138
|
+
var CURRENT_VERSION = "0.17.3";
|
|
4069
4139
|
var LOGO = `
|
|
4070
4140
|
\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
4071
4141
|
\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|