@flydocs/cli 0.5.0-beta.5 → 0.5.0-beta.6
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 +79 -35
- package/package.json +1 -1
- package/template/.flydocs/config.json +1 -1
- package/template/.flydocs/version +1 -1
- package/template/manifest.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ var CLI_VERSION, CLI_NAME, PACKAGE_NAME;
|
|
|
15
15
|
var init_constants = __esm({
|
|
16
16
|
"src/lib/constants.ts"() {
|
|
17
17
|
"use strict";
|
|
18
|
-
CLI_VERSION = "0.5.0-beta.
|
|
18
|
+
CLI_VERSION = "0.5.0-beta.6";
|
|
19
19
|
CLI_NAME = "flydocs";
|
|
20
20
|
PACKAGE_NAME = "@flydocs/cli";
|
|
21
21
|
}
|
|
@@ -1514,7 +1514,7 @@ __export(install_exports, {
|
|
|
1514
1514
|
import { defineCommand } from "citty";
|
|
1515
1515
|
import { resolve as resolve2 } from "path";
|
|
1516
1516
|
import { join as join11 } from "path";
|
|
1517
|
-
import { confirm as confirm2, isCancel as isCancel3, cancel as cancel2 } from "@clack/prompts";
|
|
1517
|
+
import { confirm as confirm2, select, isCancel as isCancel3, cancel as cancel2 } from "@clack/prompts";
|
|
1518
1518
|
var install_default;
|
|
1519
1519
|
var init_install = __esm({
|
|
1520
1520
|
"src/commands/install.ts"() {
|
|
@@ -1886,41 +1886,85 @@ var init_install = __esm({
|
|
|
1886
1886
|
return false;
|
|
1887
1887
|
}
|
|
1888
1888
|
};
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1889
|
+
const ideOptions = [];
|
|
1890
|
+
if (isInstalled("claude")) {
|
|
1891
|
+
ideOptions.push({
|
|
1892
|
+
cmd: "claude",
|
|
1893
|
+
label: "Claude Code",
|
|
1894
|
+
hint: "Opens and runs /flydocs-setup automatically",
|
|
1895
|
+
passCommand: true
|
|
1895
1896
|
});
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1897
|
+
}
|
|
1898
|
+
if (isInstalled("cursor")) {
|
|
1899
|
+
ideOptions.push({
|
|
1900
|
+
cmd: "cursor",
|
|
1901
|
+
label: "Cursor",
|
|
1902
|
+
hint: copiedToClipboard ? "Opens project \u2014 paste /flydocs-setup from clipboard" : "Opens project \u2014 run /flydocs-setup in chat",
|
|
1903
|
+
passCommand: false
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
if (isInstalled("code")) {
|
|
1907
|
+
ideOptions.push({
|
|
1908
|
+
cmd: "code",
|
|
1909
|
+
label: "VS Code",
|
|
1910
|
+
hint: copiedToClipboard ? "Opens project \u2014 paste /flydocs-setup from clipboard" : "Opens project \u2014 run /flydocs-setup in chat",
|
|
1911
|
+
passCommand: false
|
|
1906
1912
|
});
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
+
}
|
|
1914
|
+
if (ideOptions.length === 1) {
|
|
1915
|
+
const ide = ideOptions[0];
|
|
1916
|
+
const launchConfirm = await confirm2({
|
|
1917
|
+
message: ide.passCommand ? `Open ${ide.label} and run /flydocs-setup now?` : `Open ${ide.label}?`
|
|
1918
|
+
});
|
|
1919
|
+
if (!isCancel3(launchConfirm) && launchConfirm) {
|
|
1920
|
+
if (ide.passCommand) {
|
|
1921
|
+
spawn(ide.cmd, ["/flydocs-setup"], {
|
|
1922
|
+
cwd: targetDir,
|
|
1923
|
+
stdio: "inherit"
|
|
1924
|
+
});
|
|
1925
|
+
return;
|
|
1926
|
+
} else {
|
|
1927
|
+
spawn(ide.cmd, [targetDir], {
|
|
1928
|
+
stdio: "ignore",
|
|
1929
|
+
detached: true
|
|
1930
|
+
}).unref();
|
|
1931
|
+
printInfo(
|
|
1932
|
+
`${ide.label} opening \u2014 paste /flydocs-setup in the chat panel`
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1913
1935
|
}
|
|
1914
|
-
} else if (
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1936
|
+
} else if (ideOptions.length > 1) {
|
|
1937
|
+
const options = [
|
|
1938
|
+
...ideOptions.map((ide) => ({
|
|
1939
|
+
value: ide.cmd,
|
|
1940
|
+
label: ide.label,
|
|
1941
|
+
hint: ide.hint
|
|
1942
|
+
})),
|
|
1943
|
+
{ value: "skip", label: "Skip", hint: "I'll open my IDE manually" }
|
|
1944
|
+
];
|
|
1945
|
+
const choice = await select({
|
|
1946
|
+
message: "Open an IDE to run /flydocs-setup?",
|
|
1947
|
+
options
|
|
1917
1948
|
});
|
|
1918
|
-
if (!isCancel3(
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1949
|
+
if (!isCancel3(choice) && choice !== "skip") {
|
|
1950
|
+
const ide = ideOptions.find((o) => o.cmd === choice);
|
|
1951
|
+
if (ide) {
|
|
1952
|
+
if (ide.passCommand) {
|
|
1953
|
+
spawn(ide.cmd, ["/flydocs-setup"], {
|
|
1954
|
+
cwd: targetDir,
|
|
1955
|
+
stdio: "inherit"
|
|
1956
|
+
});
|
|
1957
|
+
return;
|
|
1958
|
+
} else {
|
|
1959
|
+
spawn(ide.cmd, [targetDir], {
|
|
1960
|
+
stdio: "ignore",
|
|
1961
|
+
detached: true
|
|
1962
|
+
}).unref();
|
|
1963
|
+
printInfo(
|
|
1964
|
+
`${ide.label} opening \u2014 paste /flydocs-setup in the chat panel`
|
|
1965
|
+
);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1924
1968
|
}
|
|
1925
1969
|
}
|
|
1926
1970
|
} catch {
|
|
@@ -1945,7 +1989,7 @@ __export(update_exports, {
|
|
|
1945
1989
|
import { defineCommand as defineCommand2 } from "citty";
|
|
1946
1990
|
import { resolve as resolve3, join as join12 } from "path";
|
|
1947
1991
|
import { mkdir as mkdir5, cp as cp2, readFile as readFile8, readdir as readdir3, rm as rm4 } from "fs/promises";
|
|
1948
|
-
import { select, text, confirm as confirm3, isCancel as isCancel4, cancel as cancel3 } from "@clack/prompts";
|
|
1992
|
+
import { select as select2, text, confirm as confirm3, isCancel as isCancel4, cancel as cancel3 } from "@clack/prompts";
|
|
1949
1993
|
import pc6 from "picocolors";
|
|
1950
1994
|
var update_default;
|
|
1951
1995
|
var init_update = __esm({
|
|
@@ -2011,7 +2055,7 @@ var init_update = __esm({
|
|
|
2011
2055
|
} else if (args.here) {
|
|
2012
2056
|
targetDir = process.cwd();
|
|
2013
2057
|
} else {
|
|
2014
|
-
const choice = await
|
|
2058
|
+
const choice = await select2({
|
|
2015
2059
|
message: "Which project would you like to update?",
|
|
2016
2060
|
options: [
|
|
2017
2061
|
{
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.0-beta.
|
|
1
|
+
0.5.0-beta.6
|
package/template/manifest.json
CHANGED