This package provides a prepatched version of Ink with Socket-specific fixes and optimizations.
-
signal-exit import fix: Changes the default import to named import for compatibility with modern ESM bundlers
import signalExit from 'signal-exit'→import { onExit as signalExit } from 'signal-exit'
-
devtools removal: Removes the conditional devtools import that uses top-level await, which causes bundling issues
- Replaces dynamic devtools loading with a no-op function
- Prevents
react-devtools-corefrom being required as a dependency
The build rewires all yoga-layout imports to use socket-btm's synchronous yoga-sync:
import Yoga from 'yoga-layout'→import Yoga from './yoga-sync.mjs'- Bundles
yoga-sync.mjsfrom yoga-layout-builder's prod (or dev) Final dir; the exact path comes fromyoga-layout-builder/scripts/paths.mtsgetBuildPaths().outputSyncMjsFile - Removes
yoga-layoutfrom dependencies (no external yoga dependency needed)
This provides:
- Synchronous WASM instantiation (no async loading)
- Embedded WASM binary (no separate .wasm file to load)
- Optimized build from yoga-layout-builder
The dist/ directory contains the complete ink package ready to use:
- All ink source files with patches applied
build/yoga-sync.mjs- Bundled synchronous yoga layout enginepackage.jsonwithyoga-layoutdependency removed
Build yoga-layout-builder first so its yoga-sync.mjs is on disk:
pnpm --filter yoga-layout-builder run build
pnpm --filter ink-builder run buildOutput: packages/ink-builder/dist/ — the complete patched ink package, ready to consume via the workspace.
When ink is updated upstream:
- Bump
sources.ink.versionandsources.ink.refinpackage.json(therefis the commit SHA the tarball pulls from) - Update the patch files in
patches/ - Verify
YOGA_IMPORT_FILESlist inscripts/build.mtsmatches ink's imports - Rebuild and test
- Upstream: https://github.com/vadimdemedes/ink
- Version: 7.0.0