From ddacde5753c0d24f1dd2baeeb17985689b848596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?witty=20=F0=9F=AA=BF?= <131909329+0xwitty@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:21:17 +0300 Subject: [PATCH] fix: array sorting to ensure `magic-sdk` comes first --- scripts/utils/workspace-helpers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/utils/workspace-helpers.ts b/scripts/utils/workspace-helpers.ts index 060d5ec92..2e94bd1b5 100644 --- a/scripts/utils/workspace-helpers.ts +++ b/scripts/utils/workspace-helpers.ts @@ -38,7 +38,11 @@ export async function promptForPackage(options: { allowAll?: boolean } = {}) { const sdkPkgs = packages .filter((i) => i.includes('@magic-sdk') || i === 'magic-sdk') // sort `magic-sdk` first - .sort((i) => (i.startsWith('@') ? 0 : -1)); + .sort((a, b) => { + if (a === 'magic-sdk') return -1; + if (b === 'magic-sdk') return 1; + return 0; + }); const sep = { role: 'separator' };