Skip to content

Commit 70897b1

Browse files
committed
chore: remove dead ink and yoga-layout dependencies
ink was removed from source but its catalog entries and yoga-layout WASM download remained. Remove: - ink, ink-table, ink-text-input, @types/ink from catalog - yoga-layout from catalog - yoga WASM download step from build-js.mjs and build.mjs - yoga asset config and transformYogaSync from download-assets.mjs
1 parent 6ed52fa commit 70897b1

File tree

4 files changed

+3
-99
lines changed

4 files changed

+3
-99
lines changed

packages/cli/scripts/build-js.mjs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,7 @@ const logger = getDefaultLogger()
1212

1313
async function main() {
1414
try {
15-
// Step 1: Download yoga WASM.
16-
logger.step('Downloading yoga WASM')
17-
const extractResult = await spawn(
18-
'node',
19-
['--max-old-space-size=8192', 'scripts/download-assets.mjs', 'yoga'],
20-
{ stdio: 'inherit' },
21-
)
22-
23-
if (!extractResult) {
24-
logger.error('Failed to start asset download')
25-
process.exitCode = 1
26-
return
27-
}
28-
29-
if (extractResult.code !== 0) {
30-
process.exitCode = extractResult.code
31-
return
32-
}
33-
34-
// Step 2: Build with esbuild.
15+
// Step 1: Build with esbuild.
3516
logger.step('Building CLI bundle')
3617
const buildResult = await spawn(
3718
'node',

packages/cli/scripts/build.mjs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,34 +104,7 @@ async function main() {
104104
logger.info('Starting watch mode...')
105105
}
106106

107-
// First download yoga WASM (only needed asset for CLI bundle).
108-
const extractResult = await spawn(
109-
'node',
110-
[...NODE_MEMORY_FLAGS, 'scripts/download-assets.mjs', 'yoga'],
111-
{
112-
shell: WIN32,
113-
stdio: 'inherit',
114-
},
115-
)
116-
117-
if (!extractResult) {
118-
const error = new Error('Failed to start asset download process')
119-
logger.error(error.message)
120-
process.exitCode = 1
121-
throw error
122-
}
123-
124-
if (extractResult.code !== 0) {
125-
const exitCode = extractResult.code ?? 1
126-
const error = new Error(
127-
`Asset download failed with exit code ${extractResult.code ?? 'unknown'}`,
128-
)
129-
logger.error(error.message)
130-
process.exitCode = exitCode
131-
throw error
132-
}
133-
134-
// Then start esbuild in watch mode.
107+
// Start esbuild in watch mode.
135108
const watchResult = await spawn(
136109
'node',
137110
[...NODE_MEMORY_FLAGS, '.config/esbuild.cli.mjs', '--watch'],

packages/cli/scripts/download-assets.mjs

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
* Usage:
66
* node scripts/download-assets.mjs [asset-names...] [options]
77
* node scripts/download-assets.mjs # Download all assets (parallel)
8-
* node scripts/download-assets.mjs yoga models # Download specific assets (parallel)
8+
* node scripts/download-assets.mjs models # Download specific assets (parallel)
99
* node scripts/download-assets.mjs --no-parallel # Download all assets (sequential)
1010
*
1111
* Assets:
1212
* binject - Binary injection tool
1313
* iocraft - iocraft native bindings (.node files)
1414
* models - AI models tar.gz (MiniLM, CodeT5)
1515
* node-smol - Minimal Node.js binaries
16-
* yoga - Yoga layout WASM (yoga-sync.mjs)
1716
*/
1817

1918
import { existsSync, promises as fs } from 'node:fs'
@@ -94,22 +93,6 @@ const ASSETS = {
9493
name: 'node-smol',
9594
type: 'binary',
9695
},
97-
yoga: {
98-
description: 'Yoga layout WASM',
99-
download: {
100-
asset: 'yoga-sync-*.mjs',
101-
cwd: rootPath,
102-
downloadDir: '../../packages/build-infra/build/downloaded',
103-
quiet: false,
104-
tool: 'yoga-layout',
105-
},
106-
name: 'yoga',
107-
process: {
108-
format: 'javascript',
109-
outputPath: path.join(rootPath, 'build/yoga-sync.mjs'),
110-
},
111-
type: 'processed',
112-
},
11396
}
11497

11598
/**
@@ -221,29 +204,6 @@ async function extractArchive(tarGzPath, extractConfig, assetName) {
221204
await fs.writeFile(versionPath, tag, 'utf-8')
222205
}
223206

224-
/**
225-
* Transform yoga-sync.mjs to remove top-level await for CJS compatibility.
226-
*
227-
* The newer yoga-sync builds incorrectly use top-level await which isn't
228-
* compatible with esbuild's CJS output format. Despite the name, yogaPromise
229-
* is synchronous (-sWASM_ASYNC_COMPILATION=0), so we can call it directly.
230-
*/
231-
function transformYogaSync(content) {
232-
// Pattern: const Yoga = wrapAssembly(await yogaPromise);
233-
// Transform to: const Yoga = wrapAssembly(yogaPromise);
234-
// (yogaPromise is synchronous despite its name)
235-
const hasTopLevelAwait = content.includes('wrapAssembly(await yogaPromise)')
236-
if (!hasTopLevelAwait) {
237-
return content
238-
}
239-
240-
// Replace the top-level await pattern with synchronous call.
241-
return content.replace(
242-
/const Yoga = wrapAssembly\(await yogaPromise\);/,
243-
'const Yoga = wrapAssembly(yogaPromise);',
244-
)
245-
}
246-
247207
/**
248208
* Process and transform asset (e.g., add header to JS file).
249209
*/
@@ -276,11 +236,6 @@ async function processAsset(assetPath, processConfig, assetName) {
276236
// Read the downloaded asset.
277237
let content = await fs.readFile(assetPath, 'utf-8')
278238

279-
// Transform yoga-sync to remove top-level await for CJS compatibility.
280-
if (assetName === 'yoga') {
281-
content = transformYogaSync(content)
282-
}
283-
284239
// Compute source hash for cache validation.
285240
const sourceHash = await computeFileHash(assetPath)
286241

pnpm-workspace.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ catalog:
5050
'@socketsecurity/sdk': 3.4.1
5151
'@types/adm-zip': 0.5.7
5252
'@types/cmd-shim': 5.0.2
53-
'@types/ink': 2.0.3
5453
'@types/js-yaml': 4.0.9
5554
'@types/micromatch': 4.0.9
5655
'@types/mock-fs': 4.13.4
@@ -97,9 +96,6 @@ catalog:
9796
husky: 9.1.7
9897
ignore: 7.0.5
9998
indent-string: npm:@socketregistry/indent-string@^1.0.14
100-
ink: 6.3.1
101-
ink-table: 3.1.0
102-
ink-text-input: 6.0.0
10399
is-core-module: npm:@socketregistry/is-core-module@^1.0.11
104100
isarray: npm:@socketregistry/isarray@^1.0.8
105101
js-yaml: npm:@zkochan/js-yaml@0.0.10
@@ -152,5 +148,4 @@ catalog:
152148
yaml: 2.8.1
153149
yargs-parser: 21.1.1
154150
yoctocolors-cjs: 2.1.3
155-
yoga-layout: 3.2.1
156151
zod: 4.1.8

0 commit comments

Comments
 (0)