From ae0418599db9b15b20b4eae710e92be22290c740 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Wed, 2 Sep 2026 01:01:02 +0530 Subject: [PATCH] chore: export BUILD_CRITICAL_PACKAGES for the test, drop dead default export Follow-up to the salvaged #87980: the test kept its own copy of the build-critical package list (drift hazard) and the module's default export had no consumer. --- apps/desktop/scripts/assert-root-install.mjs | 3 +-- apps/desktop/scripts/assert-root-install.test.mjs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/desktop/scripts/assert-root-install.mjs b/apps/desktop/scripts/assert-root-install.mjs index 5ea3a3dc4e..bb1daa2dbf 100644 --- a/apps/desktop/scripts/assert-root-install.mjs +++ b/apps/desktop/scripts/assert-root-install.mjs @@ -32,6 +32,7 @@ import { isMain } from "./utils.mjs" // an unresolved `katex/dist/katex.min.css` with no hint that the install — not // the source — was at fault (#86443). const BUILD_CRITICAL_PACKAGES = ["vite", "katex", "electron", "electron-builder"] +export { BUILD_CRITICAL_PACKAGES } // Resolve the way Node's own lookup does — walk `node_modules` upward — rather // than through `require.resolve`. A package whose `exports` map does not expose @@ -114,5 +115,3 @@ function main() { if (isMain(import.meta.url)) { main() } - -export default { checkRootInstall } diff --git a/apps/desktop/scripts/assert-root-install.test.mjs b/apps/desktop/scripts/assert-root-install.test.mjs index c32c4bd104..4f1403b80c 100644 --- a/apps/desktop/scripts/assert-root-install.test.mjs +++ b/apps/desktop/scripts/assert-root-install.test.mjs @@ -4,9 +4,7 @@ import os from 'node:os' import path from 'node:path' import { test } from 'vitest' -import { checkRootInstall } from '../scripts/assert-root-install.mjs' - -const BUILD_CRITICAL = ['vite', 'katex', 'electron', 'electron-builder'] +import { BUILD_CRITICAL_PACKAGES as BUILD_CRITICAL, checkRootInstall } from '../scripts/assert-root-install.mjs' // Build a throwaway repo shaped like this one: an app workspace whose // dependencies are hoisted to the repo root, which is what the guard walks.