fix: remove dead ternary in WORKSPACE_ROOT resolution (#487)

* fix: remove dead ternary in WORKSPACE_ROOT resolution

Both tools/dev and tools/pack config files had:
  ENTRY_DIR_NAME === "dist" ? "../../.." : "../../.."
with identical branches. Since `src/` and `dist/` are siblings under
`tools/{dev,pack}/`, both resolve to the same path. The ternary and
ENTRY_DIR_NAME constant were dead code — simplify to "../..".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Fix workspace root depth

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: PerishCode <perishcode@gmail.com>
This commit is contained in:
Qiaochu Hu
2026-05-18 15:50:07 +08:00
committed by GitHub
co-authored by Claude Opus 4.7 Test User PerishCode
parent e8887aab13
commit d55f05fcfa
2 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -19,9 +19,8 @@ import {
} from "@open-design/sidecar";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ENTRY_DIR_NAME = path.basename(__dirname);
export const WORKSPACE_ROOT = path.resolve(__dirname, ENTRY_DIR_NAME === "dist" ? "../../.." : "../../..");
export const WORKSPACE_ROOT = path.resolve(__dirname, "../../..");
export const ALL_APPS = [APP_KEYS.DAEMON, APP_KEYS.WEB, APP_KEYS.DESKTOP] as const;
export const DEFAULT_START_APPS = [APP_KEYS.DAEMON, APP_KEYS.WEB, APP_KEYS.DESKTOP] as const;
+1 -2
View File
@@ -10,9 +10,8 @@ import {
import { resolveNamespace } from "@open-design/sidecar";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ENTRY_DIR_NAME = path.basename(__dirname);
export const WORKSPACE_ROOT = resolve(__dirname, ENTRY_DIR_NAME === "dist" ? "../../.." : "../../..");
export const WORKSPACE_ROOT = resolve(__dirname, "../../..");
export type ToolPackPlatform = "mac" | "win" | "linux";
export type ToolPackBuildOutput = "all" | "app" | "appimage" | "dir" | "dmg" | "nsis" | "zip";