lean-spec 0.2.3 → 0.2.4
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.
|
@@ -6974,7 +6974,7 @@ function detectPackageManager(baseDir = process.cwd()) {
|
|
|
6974
6974
|
|
|
6975
6975
|
// src/commands/ui.ts
|
|
6976
6976
|
function uiCommand() {
|
|
6977
|
-
return new Command("ui").description("Start local web UI for spec management").option("-s, --specs <dir>", "Specs directory (auto-detected if not specified)").option("-p, --port <port>", "Port to run on", "3000").option("--no-open", "Don't open browser automatically").option("--dry-run", "Show what would run without executing").action(async (options) => {
|
|
6977
|
+
return new Command("ui").description("Start local web UI for spec management").option("-s, --specs <dir>", "Specs directory (auto-detected if not specified)").option("-p, --port <port>", "Port to run on", "3000").option("--no-open", "Don't open browser automatically").option("--dev", "Run in development mode (only works in LeanSpec monorepo)").option("--dry-run", "Show what would run without executing").action(async (options) => {
|
|
6978
6978
|
try {
|
|
6979
6979
|
await startUi(options);
|
|
6980
6980
|
} catch (error) {
|
|
@@ -7002,12 +7002,29 @@ async function startUi(options) {
|
|
|
7002
7002
|
console.log(chalk18.dim("\nRun `lean-spec init` to initialize LeanSpec in this directory."));
|
|
7003
7003
|
throw new Error(`Specs directory not found: ${specsDir}`);
|
|
7004
7004
|
}
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7005
|
+
if (options.dev) {
|
|
7006
|
+
const isLeanSpecMonorepo = checkIsLeanSpecMonorepo(cwd);
|
|
7007
|
+
if (!isLeanSpecMonorepo) {
|
|
7008
|
+
console.error(chalk18.red(`\u2717 Development mode only works in the LeanSpec monorepo`));
|
|
7009
|
+
console.log(chalk18.dim("Remove --dev flag to use production mode"));
|
|
7010
|
+
throw new Error("Not in LeanSpec monorepo");
|
|
7011
|
+
}
|
|
7012
|
+
const localWebDir = join(cwd, "packages/web");
|
|
7008
7013
|
return runLocalWeb(localWebDir, specsDir, options);
|
|
7009
|
-
}
|
|
7010
|
-
|
|
7014
|
+
}
|
|
7015
|
+
return runPublishedUI(cwd, specsDir, options);
|
|
7016
|
+
}
|
|
7017
|
+
function checkIsLeanSpecMonorepo(cwd) {
|
|
7018
|
+
const localWebDir = join(cwd, "packages/web");
|
|
7019
|
+
const webPackageJson = join(localWebDir, "package.json");
|
|
7020
|
+
if (!existsSync(webPackageJson)) {
|
|
7021
|
+
return false;
|
|
7022
|
+
}
|
|
7023
|
+
try {
|
|
7024
|
+
const packageJson2 = JSON.parse(readFileSync(webPackageJson, "utf-8"));
|
|
7025
|
+
return packageJson2.name === "@leanspec/web";
|
|
7026
|
+
} catch {
|
|
7027
|
+
return false;
|
|
7011
7028
|
}
|
|
7012
7029
|
}
|
|
7013
7030
|
async function runLocalWeb(webDir, specsDir, options) {
|
|
@@ -7112,7 +7129,7 @@ function buildUiRunner(packageManager, specsDir, port, openBrowser) {
|
|
|
7112
7129
|
uiArgs.push("--no-open");
|
|
7113
7130
|
}
|
|
7114
7131
|
if (packageManager === "pnpm") {
|
|
7115
|
-
const args2 = ["dlx",
|
|
7132
|
+
const args2 = ["dlx", ...uiArgs];
|
|
7116
7133
|
return { command: "pnpm", args: args2, preview: `pnpm ${args2.join(" ")}` };
|
|
7117
7134
|
}
|
|
7118
7135
|
if (packageManager === "yarn") {
|
|
@@ -8406,5 +8423,5 @@ if (import.meta.url === `file://${process.argv[1]}`) {
|
|
|
8406
8423
|
}
|
|
8407
8424
|
|
|
8408
8425
|
export { analyzeCommand, archiveCommand, backfillCommand, boardCommand, checkCommand, compactCommand, createCommand, createMcpServer, depsCommand, filesCommand, ganttCommand, initCommand, linkCommand, listCommand, mcpCommand, migrateCommand, openCommand, searchCommand, splitCommand, statsCommand, templatesCommand, timelineCommand, tokensCommand, uiCommand, unlinkCommand, updateCommand, validateCommand, viewCommand };
|
|
8409
|
-
//# sourceMappingURL=chunk-
|
|
8410
|
-
//# sourceMappingURL=chunk-
|
|
8426
|
+
//# sourceMappingURL=chunk-UHMYFCXJ.js.map
|
|
8427
|
+
//# sourceMappingURL=chunk-UHMYFCXJ.js.map
|