From 74d953ca763bcffd078d5d96bc3036a0f628796c Mon Sep 17 00:00:00 2001 From: jdalton Date: Fri, 1 May 2026 13:01:34 -0400 Subject: [PATCH] =?UTF-8?q?refactor(release-naming):=20align=20win=20?= =?UTF-8?q?=E2=86=92=20win32=20with=20pnpm=20pack-app=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match Node.js's `process.platform` string verbatim (`win32`, not the shortened `win`) across release-asset filenames, build directories, and source-code platform vocabularies. Aligns btm with the fleet's canonical naming used by ultrathink (and pnpm pack-app's target convention more broadly), eliminating the translation layer between what consumers see (`@ultrathink/acorn-win32-x64` etc.) and what btm produces. Surgical fix: drops the win32→win conversion in the canonical `set-platform-arch` composite action. All 71 downstream `${{ steps.platform-arch.outputs.platform_arch }}` references in the build-* workflows automatically pick up the new value — no further workflow edits needed for that 71. The 36 literal win-{x64,arm64} strings in workflow release-notes blocks are updated by hand. Source-code refs (3 files): - build-infra/lib/platform-mappings.mts: RELEASE_PLATFORM_MAP win32 entry no longer rewrites to 'win'. - opentui-builder/lib/index.mts: same map shape. - binpress/scripts/generate-embedded-stubs.mts: stubConfigs and extractedName comparison switched to 'win32'. Deliberately preserved (NOT changed): - lief-builder constructs URLs against the upstream LIEF project's release naming, which uses `win` natively. - node-smol-builder's `getArchivePlatform()` produces archive names matching Node.js's official upstream convention (`node-vX.Y.Z-win-x64.zip`). The published `@socketbin/...` package names are baked into consumers; renaming would break them. - opentui-builder/scripts/build.mts:210 uses `platformArch.startsWith('win')` which matches both old and new forms — works correctly without a change. Consumer impact: btm's GH Release asset filenames change from `iocraft-${VERSION}-win-x64.node` to `iocraft-${VERSION}-win32-x64.node` etc. This intentionally aligns with `getBinaryAssetName()` in @socketsecurity/lib (which already returns the win32 form), fixing a latent bug where the lib's download helper would 404 on Windows targets. Existing released assets keep their old URLs (no rename of historic releases); new releases use the new naming. Pre-existing logger violations + other unrelated check failures ignored via --no-verify per session-wide authorization. --- .github/actions/set-platform-arch/action.yml | 17 ++++++----- .github/workflows/binsuite.yml | 28 +++++++++---------- .github/workflows/curl.yml | 4 +-- .github/workflows/iocraft.yml | 4 +-- .github/workflows/lief.yml | 4 +-- .github/workflows/node-smol.yml | 18 ++++++------ .github/workflows/opentui.yml | 4 +-- .github/workflows/stubs.yml | 4 +-- .../scripts/generate-embedded-stubs.mts | 8 +++--- .../build-infra/lib/platform-mappings.mts | 7 ++++- packages/opentui-builder/lib/index.mts | 2 +- 11 files changed, 52 insertions(+), 48 deletions(-) diff --git a/.github/actions/set-platform-arch/action.yml b/.github/actions/set-platform-arch/action.yml index 6cd1d1bb..ac297f67 100644 --- a/.github/actions/set-platform-arch/action.yml +++ b/.github/actions/set-platform-arch/action.yml @@ -1,5 +1,5 @@ name: Set Platform-Arch -description: Composes the platform-arch string (converting win32→win, appending -musl when applicable) from matrix inputs +description: Composes the platform-arch string from matrix inputs, matching pnpm pack-app's target convention (win32, darwin, linux + arch + optional -musl) inputs: platform: @@ -15,7 +15,7 @@ inputs: outputs: platform_arch: - description: 'Release-ready platform-arch string (e.g. darwin-arm64, linux-x64-musl, win-x64)' + description: 'Release-ready platform-arch string (e.g. darwin-arm64, linux-x64-musl, win32-x64) — matches pack-app target naming' value: ${{ steps.resolve.outputs.platform_arch }} runs: @@ -29,13 +29,12 @@ runs: ARCH: ${{ inputs.arch }} LIBC: ${{ inputs.libc }} run: | - # Convert win32 -> win for file/folder names. - if [ "${PLATFORM}" = "win32" ]; then - RELEASE_PLATFORM="win" - else - RELEASE_PLATFORM="${PLATFORM}" - fi - PLATFORM_ARCH="${RELEASE_PLATFORM}-${ARCH}" + # Use Node.js platform string verbatim (win32, not win) so + # asset filenames, build dirs, and consumer-side + # process.platform comparisons all share one vocabulary. + # Aligns with pnpm pack-app's target convention used fleet- + # wide (ultrathink, future stuie/cli, etc.). + PLATFORM_ARCH="${PLATFORM}-${ARCH}" if [ "${LIBC}" = "musl" ]; then PLATFORM_ARCH="${PLATFORM_ARCH}-musl" fi diff --git a/.github/workflows/binsuite.yml b/.github/workflows/binsuite.yml index 2fa7662b..ac699798 100644 --- a/.github/workflows/binsuite.yml +++ b/.github/workflows/binsuite.yml @@ -1430,19 +1430,19 @@ jobs: fi # Windows x64 - if [ -d "artifacts/${TOOL}-win-x64" ]; then - mv artifacts/${TOOL}-win-x64/${TOOL}.exe \ - dist/${TOOL}/${TOOL}-win-x64.exe 2>/dev/null || \ - mv artifacts/${TOOL}-win-x64/${TOOL} \ - dist/${TOOL}/${TOOL}-win-x64 2>/dev/null || true + if [ -d "artifacts/${TOOL}-win32-x64" ]; then + mv artifacts/${TOOL}-win32-x64/${TOOL}.exe \ + dist/${TOOL}/${TOOL}-win32-x64.exe 2>/dev/null || \ + mv artifacts/${TOOL}-win32-x64/${TOOL} \ + dist/${TOOL}/${TOOL}-win32-x64 2>/dev/null || true fi # Windows ARM64 - if [ -d "artifacts/${TOOL}-win-arm64" ]; then - mv artifacts/${TOOL}-win-arm64/${TOOL}.exe \ - dist/${TOOL}/${TOOL}-win-arm64.exe 2>/dev/null || \ - mv artifacts/${TOOL}-win-arm64/${TOOL} \ - dist/${TOOL}/${TOOL}-win-arm64 2>/dev/null || true + if [ -d "artifacts/${TOOL}-win32-arm64" ]; then + mv artifacts/${TOOL}-win32-arm64/${TOOL}.exe \ + dist/${TOOL}/${TOOL}-win32-arm64.exe 2>/dev/null || \ + mv artifacts/${TOOL}-win32-arm64/${TOOL} \ + dist/${TOOL}/${TOOL}-win32-arm64 2>/dev/null || true fi # Make Unix binaries executable @@ -1528,8 +1528,8 @@ jobs: - linux-x64 - linux-arm64-musl - linux-x64-musl - - win-arm64 - - win-x64 + - win32-arm64 + - win32-x64 ## Files - \`${TOOL}-darwin-arm64\` - macOS Apple Silicon @@ -1538,8 +1538,8 @@ jobs: - \`${TOOL}-linux-x64\` - Linux x64 (glibc) - \`${TOOL}-linux-arm64-musl\` - Linux ARM64 (musl/Alpine) - \`${TOOL}-linux-x64-musl\` - Linux x64 (musl/Alpine) - - \`${TOOL}-win-arm64.exe\` - Windows ARM64 - - \`${TOOL}-win-x64.exe\` - Windows x64 + - \`${TOOL}-win32-arm64.exe\` - Windows ARM64 + - \`${TOOL}-win32-x64.exe\` - Windows x64 - \`checksums.txt\` - SHA256 checksums ## Usage diff --git a/.github/workflows/curl.yml b/.github/workflows/curl.yml index 23fe1333..83cfe737 100644 --- a/.github/workflows/curl.yml +++ b/.github/workflows/curl.yml @@ -594,8 +594,8 @@ jobs: - linux-x64 - linux-arm64-musl - linux-x64-musl - - win-arm64 - - win-x64 + - win32-arm64 + - win32-x64 ## Files Each platform archive contains: diff --git a/.github/workflows/iocraft.yml b/.github/workflows/iocraft.yml index 34cab846..cbdfe40e 100644 --- a/.github/workflows/iocraft.yml +++ b/.github/workflows/iocraft.yml @@ -508,8 +508,8 @@ jobs: - \`iocraft-${VERSION}-linux-arm64-musl.node\` - Linux ARM64 musl native module - \`iocraft-${VERSION}-darwin-x64.node\` - macOS Intel native module - \`iocraft-${VERSION}-darwin-arm64.node\` - macOS Apple Silicon native module - - \`iocraft-${VERSION}-win-x64.node\` - Windows x64 native module - - \`iocraft-${VERSION}-win-arm64.node\` - Windows ARM64 native module + - \`iocraft-${VERSION}-win32-x64.node\` - Windows x64 native module + - \`iocraft-${VERSION}-win32-arm64.node\` - Windows ARM64 native module - \`checksums.txt\` - SHA256 checksums ## Usage diff --git a/.github/workflows/lief.yml b/.github/workflows/lief.yml index a94a1ab4..469d4593 100644 --- a/.github/workflows/lief.yml +++ b/.github/workflows/lief.yml @@ -707,8 +707,8 @@ jobs: - linux-x64 - linux-arm64-musl - linux-x64-musl - - win-arm64 - - win-x64 + - win32-arm64 + - win32-x64 ## Files Each platform archive contains: diff --git a/.github/workflows/node-smol.yml b/.github/workflows/node-smol.yml index fcd3feda..878d0031 100644 --- a/.github/workflows/node-smol.yml +++ b/.github/workflows/node-smol.yml @@ -1115,7 +1115,7 @@ jobs: - name: Validate artifact count run: | - # Expected artifacts: 8 (darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win-x64, win-arm64) + # Expected artifacts: 8 (darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win32-x64, win32-arm64) EXPECTED_COUNT=8 ACTUAL_COUNT=$(find artifacts -mindepth 1 -maxdepth 1 -type d | wc -l) if [ "$ACTUAL_COUNT" -ne "$EXPECTED_COUNT" ]; then @@ -1149,10 +1149,10 @@ jobs: mv artifacts/node-smol-linux-arm64-musl/node packages/node-smol-builder/dist/node-linux-arm64-musl # Windows x64 - mv artifacts/node-smol-win-x64/node.exe packages/node-smol-builder/dist/node-win-x64.exe + mv artifacts/node-smol-win32-x64/node.exe packages/node-smol-builder/dist/node-win32-x64.exe # Windows ARM64 (cross-compiled) - mv artifacts/node-smol-win-arm64/node.exe packages/node-smol-builder/dist/node-win-arm64.exe + mv artifacts/node-smol-win32-arm64/node.exe packages/node-smol-builder/dist/node-win32-arm64.exe # Make Unix binaries executable. The prior `node-*[!.exe]` glob # used a single-character negated class which matches any char @@ -1172,8 +1172,8 @@ jobs: "node-linux-arm64" "node-linux-x64-musl" "node-linux-arm64-musl" - "node-win-x64.exe" - "node-win-arm64.exe" + "node-win32-x64.exe" + "node-win32-arm64.exe" ) MISSING=() @@ -1264,8 +1264,8 @@ jobs: - linux-x64 - linux-arm64-musl - linux-x64-musl - - win-arm64 - - win-x64 + - win32-arm64 + - win32-x64 ## Files - \`node-darwin-arm64\` - macOS Apple Silicon @@ -1274,8 +1274,8 @@ jobs: - \`node-linux-x64\` - Linux x64 (glibc) - \`node-linux-arm64-musl\` - Linux ARM64 (musl/Alpine) - \`node-linux-x64-musl\` - Linux x64 (musl/Alpine) - - \`node-win-arm64.exe\` - Windows ARM64 - - \`node-win-x64.exe\` - Windows x64 + - \`node-win32-arm64.exe\` - Windows ARM64 + - \`node-win32-x64.exe\` - Windows x64 - \`checksums.txt\` - SHA256 checksums ## Usage diff --git a/.github/workflows/opentui.yml b/.github/workflows/opentui.yml index ce669b1b..400b187a 100644 --- a/.github/workflows/opentui.yml +++ b/.github/workflows/opentui.yml @@ -496,8 +496,8 @@ jobs: - \`opentui-${VERSION}-linux-arm64-musl.node\` - Linux ARM64 musl native module - \`opentui-${VERSION}-darwin-x64.node\` - macOS Intel native module - \`opentui-${VERSION}-darwin-arm64.node\` - macOS Apple Silicon native module - - \`opentui-${VERSION}-win-x64.node\` - Windows x64 native module - - \`opentui-${VERSION}-win-arm64.node\` - Windows ARM64 native module + - \`opentui-${VERSION}-win32-x64.node\` - Windows x64 native module + - \`opentui-${VERSION}-win32-arm64.node\` - Windows ARM64 native module - \`checksums.txt\` - SHA256 checksums ## Usage diff --git a/.github/workflows/stubs.yml b/.github/workflows/stubs.yml index 72ef8a39..ae56c62d 100644 --- a/.github/workflows/stubs.yml +++ b/.github/workflows/stubs.yml @@ -606,8 +606,8 @@ jobs: - linux-x64 - linux-arm64-musl - linux-x64-musl - - win-arm64 - - win-x64 + - win32-arm64 + - win32-x64 ## Files Each platform archive contains a small stub binary used by \`binpress\` to create self-extracting executables. diff --git a/packages/binpress/scripts/generate-embedded-stubs.mts b/packages/binpress/scripts/generate-embedded-stubs.mts index cb109f29..3440180e 100644 --- a/packages/binpress/scripts/generate-embedded-stubs.mts +++ b/packages/binpress/scripts/generate-embedded-stubs.mts @@ -74,7 +74,7 @@ await safeMkdir(BUILD_DIR) await safeMkdir(path.dirname(OUTPUT_FILE)) // Detect current platform for local stub usage -const currentPlatform = WIN32 ? 'win' : process.platform +const currentPlatform = process.platform const currentArch = process.env.TARGET_ARCH || process.arch const currentLibc = (await isMusl()) ? 'musl' : undefined @@ -179,7 +179,7 @@ async function downloadStub( } // Determine extracted file name - const extractedName = platform === 'win' ? 'smol_stub.exe' : 'smol_stub' + const extractedName = platform === 'win32' ? 'smol_stub.exe' : 'smol_stub' const extractedPath = path.join(platformDir, extractedName) // Move to build directory with platform-specific name for embedding @@ -260,8 +260,8 @@ const stubConfigs = [ { arch: 'x64', libc: undefined, name: 'linux-x64', platform: 'linux' }, { arch: 'arm64', libc: 'musl', name: 'linux-arm64-musl', platform: 'linux' }, { arch: 'x64', libc: 'musl', name: 'linux-x64-musl', platform: 'linux' }, - { arch: 'arm64', libc: undefined, name: 'win-arm64', platform: 'win' }, - { arch: 'x64', libc: undefined, name: 'win-x64', platform: 'win' }, + { arch: 'arm64', libc: undefined, name: 'win32-arm64', platform: 'win32' }, + { arch: 'x64', libc: undefined, name: 'win32-x64', platform: 'win32' }, ] const stubResults = await Promise.allSettled( stubConfigs.map(config => diff --git a/packages/build-infra/lib/platform-mappings.mts b/packages/build-infra/lib/platform-mappings.mts index 660f1e38..ceb25fe4 100644 --- a/packages/build-infra/lib/platform-mappings.mts +++ b/packages/build-infra/lib/platform-mappings.mts @@ -19,13 +19,18 @@ const logger = getDefaultLogger() /** * Maps Node.js platform names to GitHub release platform names. * + * Aligned with pnpm pack-app's target convention so asset filenames, + * internal build directories, and consumer-side process.platform + * comparisons all share one vocabulary. Historical naming used the + * shortened `win` form; that translation layer is removed. + * * @type {Readonly>} */ export const RELEASE_PLATFORM_MAP = Object.freeze({ __proto__: null, darwin: 'darwin', linux: 'linux', - win32: 'win', + win32: 'win32', }) /** diff --git a/packages/opentui-builder/lib/index.mts b/packages/opentui-builder/lib/index.mts index 5786d424..f85b84fc 100644 --- a/packages/opentui-builder/lib/index.mts +++ b/packages/opentui-builder/lib/index.mts @@ -33,7 +33,7 @@ const PLATFORM_ARCH_MAP = { __proto__: null, darwin: 'darwin', linux: 'linux', - win32: 'win', + win32: 'win32', } function detectMusl() {