@nimbuslab/cli 0.16.1 → 0.16.2
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/dist/index.js +12 -1
- package/package.json +1 -1
- package/src/commands/update.ts +16 -0
package/dist/index.js
CHANGED
|
@@ -150,7 +150,7 @@ var require_src = __commonJS((exports, module) => {
|
|
|
150
150
|
var require_package = __commonJS((exports, module) => {
|
|
151
151
|
module.exports = {
|
|
152
152
|
name: "@nimbuslab/cli",
|
|
153
|
-
version: "0.16.
|
|
153
|
+
version: "0.16.2",
|
|
154
154
|
description: "CLI para criar projetos nimbuslab",
|
|
155
155
|
type: "module",
|
|
156
156
|
bin: {
|
|
@@ -2360,6 +2360,11 @@ function printUpgradePlan(name, plan) {
|
|
|
2360
2360
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
2361
2361
|
import { execSync, spawnSync } from "child_process";
|
|
2362
2362
|
var PACKAGE_NAME = "@nimbuslab/cli";
|
|
2363
|
+
function isUsingFnm() {
|
|
2364
|
+
const fnmDir = process.env.FNM_DIR || process.env.FNM_MULTISHELL_PATH;
|
|
2365
|
+
const whichNode = spawnSync("which", ["node"], { encoding: "utf-8", shell: true });
|
|
2366
|
+
return !!(fnmDir || whichNode.stdout && whichNode.stdout.includes("fnm"));
|
|
2367
|
+
}
|
|
2363
2368
|
async function getAvailableVersions() {
|
|
2364
2369
|
try {
|
|
2365
2370
|
const res = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
|
|
@@ -2522,6 +2527,12 @@ async function update(args) {
|
|
|
2522
2527
|
} else {
|
|
2523
2528
|
M2.success(`${PACKAGE_NAME} atualizado: ${currentVersion} -> ${newVersion}`);
|
|
2524
2529
|
}
|
|
2530
|
+
if (isUsingFnm()) {
|
|
2531
|
+
console.log();
|
|
2532
|
+
console.log(import_picocolors6.default.yellow(" fnm detectado - execute para aplicar:"));
|
|
2533
|
+
console.log(import_picocolors6.default.cyan(" hash -r"));
|
|
2534
|
+
console.log(import_picocolors6.default.dim(" Ou abra um novo terminal."));
|
|
2535
|
+
}
|
|
2525
2536
|
Se(import_picocolors6.default.green("Pronto!"));
|
|
2526
2537
|
} catch (error) {
|
|
2527
2538
|
spinner.stop("Erro na atualizacao");
|
package/package.json
CHANGED
package/src/commands/update.ts
CHANGED
|
@@ -6,6 +6,13 @@ const PACKAGE_NAME = "@nimbuslab/cli"
|
|
|
6
6
|
|
|
7
7
|
type PackageManager = "bun" | "npm" | "unknown"
|
|
8
8
|
|
|
9
|
+
// Detecta se está usando fnm (Fast Node Manager)
|
|
10
|
+
function isUsingFnm(): boolean {
|
|
11
|
+
const fnmDir = process.env.FNM_DIR || process.env.FNM_MULTISHELL_PATH
|
|
12
|
+
const whichNode = spawnSync("which", ["node"], { encoding: "utf-8", shell: true })
|
|
13
|
+
return !!(fnmDir || (whichNode.stdout && whichNode.stdout.includes("fnm")))
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
async function getAvailableVersions(): Promise<string[]> {
|
|
10
17
|
try {
|
|
11
18
|
const res = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`)
|
|
@@ -229,6 +236,15 @@ export async function update(args: string[]) {
|
|
|
229
236
|
} else {
|
|
230
237
|
p.log.success(`${PACKAGE_NAME} atualizado: ${currentVersion} -> ${newVersion}`)
|
|
231
238
|
}
|
|
239
|
+
|
|
240
|
+
// Se usa fnm, avisar sobre hash
|
|
241
|
+
if (isUsingFnm()) {
|
|
242
|
+
console.log()
|
|
243
|
+
console.log(pc.yellow(" fnm detectado - execute para aplicar:"))
|
|
244
|
+
console.log(pc.cyan(" hash -r"))
|
|
245
|
+
console.log(pc.dim(" Ou abra um novo terminal."))
|
|
246
|
+
}
|
|
247
|
+
|
|
232
248
|
p.outro(pc.green("Pronto!"))
|
|
233
249
|
} catch (error) {
|
|
234
250
|
spinner.stop("Erro na atualizacao")
|