@jvittechs/jai1-cli 0.1.50 → 0.1.52
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/cli.js +33 -15
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var NetworkError = class extends Jai1Error {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@jvittechs/jai1-cli",
|
|
36
|
-
version: "0.1.
|
|
36
|
+
version: "0.1.52",
|
|
37
37
|
description: "Unified CLI for Jai1 Framework Management and Redmine Context Sync",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -240,7 +240,7 @@ function showUpdateNotification(latestVersion) {
|
|
|
240
240
|
console.log("");
|
|
241
241
|
console.log(`${colors.yellow}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${colors.reset}`);
|
|
242
242
|
console.log(`${colors.yellow}\u2502${colors.reset} ${colors.bold}\u2B06\uFE0F Update available!${colors.reset} ${package_default.version} \u2192 ${colors.cyan}${latestVersion}${colors.reset} ${colors.yellow}\u2502${colors.reset}`);
|
|
243
|
-
console.log(`${colors.yellow}\u2502${colors.reset} Run: ${colors.cyan}jai1
|
|
243
|
+
console.log(`${colors.yellow}\u2502${colors.reset} Run: ${colors.cyan}jai1 upgrade${colors.reset} ${colors.yellow}\u2502${colors.reset}`);
|
|
244
244
|
console.log(`${colors.yellow}\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${colors.reset}`);
|
|
245
245
|
console.log("");
|
|
246
246
|
}
|
|
@@ -4856,9 +4856,9 @@ ${colors2.bold}Current version:${colors2.reset} ${currentVersion}`);
|
|
|
4856
4856
|
${colors2.cyan}\u{1F4E5} Installing latest version...${colors2.reset}
|
|
4857
4857
|
`);
|
|
4858
4858
|
try {
|
|
4859
|
-
const
|
|
4860
|
-
const installCommand = getInstallCommand(
|
|
4861
|
-
console.log(`${colors2.cyan}Using ${
|
|
4859
|
+
const packageManager2 = detectPackageManager();
|
|
4860
|
+
const installCommand = getInstallCommand(packageManager2);
|
|
4861
|
+
console.log(`${colors2.cyan}Using ${packageManager2}...${colors2.reset}`);
|
|
4862
4862
|
execSync(installCommand, {
|
|
4863
4863
|
stdio: "inherit",
|
|
4864
4864
|
env: { ...process.env, FORCE_COLOR: "1" }
|
|
@@ -4869,7 +4869,7 @@ ${colors2.green}\u2705 Successfully upgraded to version ${latestVersion}!${color
|
|
|
4869
4869
|
trackAction("upgrade", {
|
|
4870
4870
|
from_version: currentVersion,
|
|
4871
4871
|
to_version: latestVersion,
|
|
4872
|
-
package_manager:
|
|
4872
|
+
package_manager: packageManager2
|
|
4873
4873
|
});
|
|
4874
4874
|
} catch (error) {
|
|
4875
4875
|
console.error(`
|
|
@@ -4877,7 +4877,13 @@ ${colors2.red}\u274C Upgrade failed!${colors2.reset}`);
|
|
|
4877
4877
|
console.error(`${colors2.red}Error: ${error instanceof Error ? error.message : "Unknown error"}${colors2.reset}
|
|
4878
4878
|
`);
|
|
4879
4879
|
console.error(`${colors2.yellow}\u{1F4A1} You can try manually upgrading with:${colors2.reset}`);
|
|
4880
|
-
|
|
4880
|
+
const manualCommands = {
|
|
4881
|
+
npm: `npm install -g @jvittechs/jai1-client@latest`,
|
|
4882
|
+
pnpm: `pnpm add -g @jvittechs/jai1-client@latest`,
|
|
4883
|
+
yarn: `yarn global add @jvittechs/jai1-client@latest`,
|
|
4884
|
+
bun: `bun add -g @jvittechs/jai1-client@latest`
|
|
4885
|
+
};
|
|
4886
|
+
console.error(` ${colors2.cyan}${manualCommands[packageManager]}${colors2.reset}
|
|
4881
4887
|
`);
|
|
4882
4888
|
throw error;
|
|
4883
4889
|
}
|
|
@@ -4900,6 +4906,18 @@ function isNewerVersion2(remote, local) {
|
|
|
4900
4906
|
return false;
|
|
4901
4907
|
}
|
|
4902
4908
|
function detectPackageManager() {
|
|
4909
|
+
try {
|
|
4910
|
+
const jai1Path = execSync("which jai1 || where jai1", {
|
|
4911
|
+
encoding: "utf-8",
|
|
4912
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
4913
|
+
}).trim();
|
|
4914
|
+
if (jai1Path) {
|
|
4915
|
+
if (jai1Path.includes("pnpm")) return "pnpm";
|
|
4916
|
+
if (jai1Path.includes("yarn")) return "yarn";
|
|
4917
|
+
if (jai1Path.includes(".bun")) return "bun";
|
|
4918
|
+
}
|
|
4919
|
+
} catch {
|
|
4920
|
+
}
|
|
4903
4921
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
4904
4922
|
if (userAgent.includes("pnpm")) return "pnpm";
|
|
4905
4923
|
if (userAgent.includes("yarn")) return "yarn";
|
|
@@ -4921,9 +4939,9 @@ function detectPackageManager() {
|
|
|
4921
4939
|
}
|
|
4922
4940
|
return "npm";
|
|
4923
4941
|
}
|
|
4924
|
-
function getInstallCommand(
|
|
4942
|
+
function getInstallCommand(packageManager2) {
|
|
4925
4943
|
const packageName = "@jvittechs/jai1-client@latest";
|
|
4926
|
-
switch (
|
|
4944
|
+
switch (packageManager2) {
|
|
4927
4945
|
case "pnpm":
|
|
4928
4946
|
return `pnpm add -g ${packageName}`;
|
|
4929
4947
|
case "yarn":
|
|
@@ -6065,9 +6083,9 @@ ${colors3.bold}Current version:${colors3.reset} ${currentVersion}`);
|
|
|
6065
6083
|
${colors3.cyan}\u{1F4E5} Installing latest version...${colors3.reset}
|
|
6066
6084
|
`);
|
|
6067
6085
|
try {
|
|
6068
|
-
const
|
|
6069
|
-
const installCommand = getInstallCommand2(
|
|
6070
|
-
console.log(`${colors3.cyan}Using ${
|
|
6086
|
+
const packageManager2 = detectPackageManager2();
|
|
6087
|
+
const installCommand = getInstallCommand2(packageManager2);
|
|
6088
|
+
console.log(`${colors3.cyan}Using ${packageManager2}...${colors3.reset}`);
|
|
6071
6089
|
execSync2(installCommand, {
|
|
6072
6090
|
stdio: "inherit",
|
|
6073
6091
|
env: { ...process.env, FORCE_COLOR: "1" }
|
|
@@ -6078,7 +6096,7 @@ ${colors3.green}\u2705 Successfully updated to version ${latestVersion}!${colors
|
|
|
6078
6096
|
trackAction("self_update", {
|
|
6079
6097
|
from_version: currentVersion,
|
|
6080
6098
|
to_version: latestVersion,
|
|
6081
|
-
package_manager:
|
|
6099
|
+
package_manager: packageManager2
|
|
6082
6100
|
});
|
|
6083
6101
|
} catch (error) {
|
|
6084
6102
|
console.error(`
|
|
@@ -6130,9 +6148,9 @@ function detectPackageManager2() {
|
|
|
6130
6148
|
}
|
|
6131
6149
|
return "npm";
|
|
6132
6150
|
}
|
|
6133
|
-
function getInstallCommand2(
|
|
6151
|
+
function getInstallCommand2(packageManager2) {
|
|
6134
6152
|
const packageName = "@jvittechs/jai1-client@latest";
|
|
6135
|
-
switch (
|
|
6153
|
+
switch (packageManager2) {
|
|
6136
6154
|
case "pnpm":
|
|
6137
6155
|
return `pnpm add -g ${packageName}`;
|
|
6138
6156
|
case "yarn":
|