From 31dfaebc8573d690631dcb1636a32cefd8f2fa8d Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 24 Dec 2025 18:51:49 +0800 Subject: [PATCH] chore: remove Windows ARM64 build support and add npm publish scripts - Add publish-npm and publish-npm:dry-run scripts to root package.json (forwarding to cli) - Remove Windows ARM64 (bun-windows-arm64) from DEFAULT_TARGETS in build-executable.ts - Remove Windows ARM64 check from getPlatformDir in build-executable.ts - Remove HAPI_TARGET_WIN32_ARM64 from bunBundle.d.ts type definitions - Remove Windows ARM64 check from embeddedAssets.bun.ts --- cli/package.json | 10 +++++----- cli/scripts/build-executable.ts | 6 +----- cli/src/runtime/embeddedAssets.bun.ts | 4 ---- cli/src/types/bunBundle.d.ts | 3 +-- package.json | 4 +++- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/cli/package.json b/cli/package.json index a0e0db3b..6538e1c1 100644 --- a/cli/package.json +++ b/cli/package.json @@ -25,11 +25,11 @@ } }, "optionalDependencies": { - "@twsxtd/hapi-darwin-arm64": "0.0.0-placeholder", - "@twsxtd/hapi-darwin-x64": "0.0.0-placeholder", - "@twsxtd/hapi-linux-arm64": "0.0.0-placeholder", - "@twsxtd/hapi-linux-x64": "0.0.0-placeholder", - "@twsxtd/hapi-win32-x64": "0.0.0-placeholder" + "@twsxtd/hapi-darwin-arm64": "0.1.0", + "@twsxtd/hapi-darwin-x64": "0.1.0", + "@twsxtd/hapi-linux-arm64": "0.1.0", + "@twsxtd/hapi-linux-x64": "0.1.0", + "@twsxtd/hapi-win32-x64": "0.1.0" }, "scripts": { "typecheck": "tsc --noEmit", diff --git a/cli/scripts/build-executable.ts b/cli/scripts/build-executable.ts index 6c67687e..bc4c3903 100644 --- a/cli/scripts/build-executable.ts +++ b/cli/scripts/build-executable.ts @@ -7,8 +7,7 @@ const DEFAULT_TARGETS = [ 'bun-darwin-arm64', 'bun-linux-x64', 'bun-linux-arm64', - 'bun-windows-x64', - 'bun-windows-arm64' + 'bun-windows-x64' ]; const SUPPORTED_PLATFORMS = new Set(['darwin', 'linux', 'windows']); const SUPPORTED_ARCHES = new Set(['x64', 'arm64']); @@ -99,9 +98,6 @@ function getPlatformDir(platform: string, arch: string): string { } if (platform === 'win32') { - if (arch !== 'x64') { - throw new Error('Windows arm64 archives are missing; add arm64 tool archives before building.'); - } return 'x64-win32'; } diff --git a/cli/src/runtime/embeddedAssets.bun.ts b/cli/src/runtime/embeddedAssets.bun.ts index 8cfc7ab8..83fd6605 100644 --- a/cli/src/runtime/embeddedAssets.bun.ts +++ b/cli/src/runtime/embeddedAssets.bun.ts @@ -85,10 +85,6 @@ async function selectEmbeddedAssets(): Promise { ]; } - if (feature('HAPI_TARGET_WIN32_ARM64')) { - throw new Error('Windows arm64 archives are missing; add arm64 tool archives before building.'); - } - throw new Error('No build target feature flag set. Build with --feature=HAPI_TARGET_*.'); } diff --git a/cli/src/types/bunBundle.d.ts b/cli/src/types/bunBundle.d.ts index 46523caf..36bd29ba 100644 --- a/cli/src/types/bunBundle.d.ts +++ b/cli/src/types/bunBundle.d.ts @@ -5,8 +5,7 @@ declare module 'bun:bundle' { | 'HAPI_TARGET_DARWIN_X64' | 'HAPI_TARGET_LINUX_ARM64' | 'HAPI_TARGET_LINUX_X64' - | 'HAPI_TARGET_WIN32_X64' - | 'HAPI_TARGET_WIN32_ARM64'; + | 'HAPI_TARGET_WIN32_X64'; } export function feature(name: Registry['features']): boolean; diff --git a/package.json b/package.json index 67caecee..512166c1 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "typecheck:server": "cd server && bun run typecheck", "typecheck:web": "cd web && bun run typecheck", "test": "cd cli && bun run test", - "clean-session": "bun run server/scripts/cleanup-sessions.ts" + "clean-session": "bun run server/scripts/cleanup-sessions.ts", + "publish-npm": "cd cli && bun run publish-npm", + "publish-npm:dry-run": "cd cli && bun run publish-npm:dry-run" }, "devDependencies": { "concurrently": "^9.2.1",