@wrongstack/cli 0.1.1 → 0.1.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.d.ts +3 -1
- package/dist/index.js +27 -19
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1229,6 +1229,27 @@ function summarize(value, name) {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
return "";
|
|
1231
1231
|
}
|
|
1232
|
+
var req = createRequire(import.meta.url);
|
|
1233
|
+
function readOwnVersion() {
|
|
1234
|
+
const candidates = ["../package.json", "../../package.json"];
|
|
1235
|
+
for (const rel of candidates) {
|
|
1236
|
+
try {
|
|
1237
|
+
const pkg = req(rel);
|
|
1238
|
+
if (typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
1239
|
+
} catch {
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
return "dev";
|
|
1243
|
+
}
|
|
1244
|
+
var CLI_VERSION = readOwnVersion();
|
|
1245
|
+
var API_VERSION = "0.0.0";
|
|
1246
|
+
try {
|
|
1247
|
+
const corePkg = req("@wrongstack/core/package.json");
|
|
1248
|
+
if (corePkg.wrongstackApiVersion) API_VERSION = corePkg.wrongstackApiVersion;
|
|
1249
|
+
} catch {
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
// src/repl.ts
|
|
1232
1253
|
async function runRepl(opts) {
|
|
1233
1254
|
if (opts.banner !== false) printBanner(opts.renderer);
|
|
1234
1255
|
let activeCtrl;
|
|
@@ -1359,7 +1380,7 @@ function renderProgress(ratio, width) {
|
|
|
1359
1380
|
}
|
|
1360
1381
|
function printBanner(renderer) {
|
|
1361
1382
|
const lines = [
|
|
1362
|
-
theme.primary(theme.bold("WrongStack")) + color.dim(
|
|
1383
|
+
theme.primary(theme.bold("WrongStack")) + color.dim(` v${CLI_VERSION}`),
|
|
1363
1384
|
color.dim("Built on the wrong stack. Shipped anyway."),
|
|
1364
1385
|
color.dim("Type /help for commands, /exit to quit."),
|
|
1365
1386
|
""
|
|
@@ -1934,7 +1955,7 @@ async function diagCmd(_args, deps) {
|
|
|
1934
1955
|
const age = await deps.modelsRegistry.ageSeconds();
|
|
1935
1956
|
const lines = [
|
|
1936
1957
|
color.bold("WrongStack diagnostics"),
|
|
1937
|
-
` apiVersion:
|
|
1958
|
+
` apiVersion: ${API_VERSION}`,
|
|
1938
1959
|
` cwd: ${deps.cwd}`,
|
|
1939
1960
|
` projectRoot: ${deps.projectRoot}`,
|
|
1940
1961
|
` projectHash: ${deps.paths.projectHash}`,
|
|
@@ -1964,7 +1985,7 @@ async function usageCmd(_args, deps) {
|
|
|
1964
1985
|
}
|
|
1965
1986
|
async function versionCmd(_args, deps) {
|
|
1966
1987
|
deps.renderer.write(
|
|
1967
|
-
`WrongStack
|
|
1988
|
+
`WrongStack ${CLI_VERSION} (apiVersion ${API_VERSION}, node ${process.version}, ${os2.platform()})
|
|
1968
1989
|
`
|
|
1969
1990
|
);
|
|
1970
1991
|
return 0;
|
|
@@ -2121,26 +2142,13 @@ function flagsToConfigPatch(flags) {
|
|
|
2121
2142
|
}
|
|
2122
2143
|
function resolveBundledSkillsDir() {
|
|
2123
2144
|
try {
|
|
2124
|
-
const
|
|
2125
|
-
const corePkg =
|
|
2145
|
+
const req2 = createRequire(import.meta.url);
|
|
2146
|
+
const corePkg = req2.resolve("@wrongstack/core/package.json");
|
|
2126
2147
|
return path2.join(path2.dirname(corePkg), "skills");
|
|
2127
2148
|
} catch {
|
|
2128
2149
|
return void 0;
|
|
2129
2150
|
}
|
|
2130
2151
|
}
|
|
2131
|
-
function readOwnVersion() {
|
|
2132
|
-
const req = createRequire(import.meta.url);
|
|
2133
|
-
const candidates = ["../package.json", "../../package.json"];
|
|
2134
|
-
for (const rel of candidates) {
|
|
2135
|
-
try {
|
|
2136
|
-
const pkg = req(rel);
|
|
2137
|
-
if (typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
2138
|
-
} catch {
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
return "dev";
|
|
2142
|
-
}
|
|
2143
|
-
var CLI_VERSION = readOwnVersion();
|
|
2144
2152
|
async function ensureProjectMeta(paths, projectRoot) {
|
|
2145
2153
|
try {
|
|
2146
2154
|
await fs2.mkdir(paths.projectDir, { recursive: true });
|
|
@@ -2848,6 +2856,6 @@ if (isMain) {
|
|
|
2848
2856
|
);
|
|
2849
2857
|
}
|
|
2850
2858
|
|
|
2851
|
-
export { main };
|
|
2859
|
+
export { CLI_VERSION, main };
|
|
2852
2860
|
//# sourceMappingURL=index.js.map
|
|
2853
2861
|
//# sourceMappingURL=index.js.map
|