From 23fa62d7a4d9bbbf10aa72bb4506bf644ca5a6c7 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 22 May 2026 16:52:47 +0100 Subject: [PATCH 1/2] fix(ci): use correct Apple signing secret names (#1006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align CI secret references with the actual secret names set in the production environment: - `secrets.CSC_LINK` → `secrets.APPLE_CERT_DATA` - `secrets.CSC_KEY_PASSWORD` → `secrets.APPLE_CERT_PASSWORD` - `vars.APPLE_TEAM_ID` → `secrets.APPLE_TEAM_ID` The previous names were copied from Spotlight's workflow but the secrets were set with different names in this repo. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ec513182..4f3266032 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,7 +259,7 @@ jobs: run: pnpm install --frozen-lockfile - name: Setup codesign dependencies env: - APPLE_CERT_DATA: ${{ secrets.CSC_LINK }} + APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }} APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} run: | curl -L 'https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.29.0/apple-codesign-0.29.0-x86_64-unknown-linux-musl.tar.gz' -o 'rcodesign.tar.gz' @@ -297,8 +297,8 @@ jobs: RELEASE_BUILD: ${{ github.event_name != 'pull_request' && '1' || '' }} # Codesigning: only on main/release pushes (fork PRs lack secrets) FOSSILIZE_SIGN: ${{ github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/')) && 'y' || 'n' }} - APPLE_CERT_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }} + APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} run: pnpm run build -- --target ${{ matrix.target }} - name: Smoke test if: matrix.can-test From d4813c197a10457902129f74b5d3575e38fe7e3f Mon Sep 17 00:00:00 2001 From: betegon Date: Fri, 22 May 2026 20:05:55 +0200 Subject: [PATCH 2/2] fix: handle with { type: "file" } import attributes in tsx dev mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Bun, `with { type: "file" }` import attributes work natively. In esbuild builds, text-import-plugin transforms them at bundle time. In tsx dev mode, Node.js throws ERR_IMPORT_ATTRIBUTE_UNSUPPORTED because it only supports `with { type: "json" }`. This caused ink-ui.ts to fail to load entirely, falling back to LoggingUI and producing: Error: The interactive UI failed to load. Run with --yes for non-interactive mode. Fix: register a synchronous Node.js module hook in require-shim.mjs via registerHooks() (available from Node 22.15, our minimum) that intercepts `with { type: "file" }` imports and returns the file's absolute path as a default export — matching Bun's native behaviour. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- script/require-shim.mjs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/script/require-shim.mjs b/script/require-shim.mjs index 2881e260b..54ccb33ff 100644 --- a/script/require-shim.mjs +++ b/script/require-shim.mjs @@ -1,5 +1,6 @@ /** - * ESM preload shim that provides `require` in ESM modules. + * ESM preload shim that provides `require` in ESM modules and handles + * `with { type: "file" }` import attributes in tsx dev mode. * * The source code uses bare `require()` for lazy loading (circular dependency * breaking, optional features). This works natively in Bun and in the CJS @@ -13,14 +14,38 @@ * must use a file-local `createRequire(import.meta.url)` instead of relying * on this global shim. * + * `with { type: "file" }` import attributes are used to embed sidecar files + * (e.g. the Ink UI app). Bun supports this natively; esbuild's + * text-import-plugin handles it at build time. In tsx dev mode neither + * applies, so we register a loader hook that returns the file path as a + * string — matching Bun's native behaviour. + * * Usage: NODE_OPTIONS="--import ./script/require-shim.mjs" tsx script/... * Or in package.json scripts via the `pnpm tsx` alias. */ -import { createRequire } from "node:module"; +import { createRequire, registerHooks } from "node:module"; if (typeof globalThis.require === "undefined") { globalThis.require = createRequire( new URL("../package.json", import.meta.url) ); } + +// Handle `with { type: "file" }` import attributes in Node.js dev mode. +// Bun supports this natively; esbuild's text-import-plugin handles it at +// build time. In tsx dev mode neither applies, so we register a synchronous +// hook that returns the file path as a string — matching Bun's behaviour. +// registerHooks() is available from Node 22.15+ (our minimum). +registerHooks({ + load(url, context, nextLoad) { + if (context.importAttributes?.type === "file") { + return { + format: "module", + shortCircuit: true, + source: `export default ${JSON.stringify(new URL(url).pathname)};`, + }; + } + return nextLoad(url, context); + }, +});