Skip to content

Commit d6d22c7

Browse files
committed
refactor: delete TUI code (mask, prompts, progress, clear, inquirer vendoring)
The TUI surface — interactive keyboard handling (mask), inquirer-based prompts (prompts), progress bars (progress), and cursor control (clear) — is being replaced by a dedicated TUI package. Removing here per the 'FORBIDDEN to maintain backward compatibility — actively remove' rule. Removed: - src/stdio/mask.ts + tests (ctrl+o toggle runner, uses setRawMode/keypress) - src/stdio/prompts.ts + tests (inquirer wrappers) - src/stdio/clear.ts + tests (cursor/line clear, only mask consumed it) - src/stdio/progress.ts (progress bar, zero callers) - src/external/@inquirer/{checkbox,confirm,input,password,search,select}.js (vendored inquirer — only stdio/prompts used them) - scripts/utils/interactive-runner.mts (consumed mask from lib-stable) - package.json ./stdio/{clear,mask,progress,prompts} exports - package.json @inquirer/* devDeps (6 packages) - pnpm-workspace.yaml @inquirer/* overrides (3 entries) - build/validator refs to @inquirer/* and external-pack rewrote to drop them - scripts/test/main.mts: removed TTY branch that used interactive-runner Public API surface drops from 144 exports to 140. Build passes, all 6207 tests pass.
1 parent 421f7e2 commit d6d22c7

26 files changed

Lines changed: 22 additions & 3588 deletions

docs/api-index.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,13 @@ Each entry links to the source module and shows the first sentence of its `@file
192192

193193
## stdio/
194194

195-
| Subpath | Description |
196-
| ---------------------------------------------------------------- | --------------------------------------------------- |
197-
| [`@socketsecurity/lib/stdio/clear`](../src/stdio/clear.ts) | Terminal clearing and cursor utilities. |
198-
| [`@socketsecurity/lib/stdio/divider`](../src/stdio/divider.ts) | Console divider and separator utilities. |
199-
| [`@socketsecurity/lib/stdio/footer`](../src/stdio/footer.ts) | Console footer/summary formatting utilities. |
200-
| [`@socketsecurity/lib/stdio/header`](../src/stdio/header.ts) | Console header/banner formatting utilities. |
201-
| [`@socketsecurity/lib/stdio/mask`](../src/stdio/mask.ts) | Interactive output masking utilities for CLI tools. |
202-
| [`@socketsecurity/lib/stdio/progress`](../src/stdio/progress.ts) | Progress bar utilities for CLI applications. |
203-
| [`@socketsecurity/lib/stdio/prompts`](../src/stdio/prompts.ts) | User prompt utilities for interactive scripts. |
204-
| [`@socketsecurity/lib/stdio/stderr`](../src/stdio/stderr.ts) | Standard error stream utilities. |
205-
| [`@socketsecurity/lib/stdio/stdout`](../src/stdio/stdout.ts) | Standard output stream utilities. |
195+
| Subpath | Description |
196+
| -------------------------------------------------------------- | -------------------------------------------- |
197+
| [`@socketsecurity/lib/stdio/divider`](../src/stdio/divider.ts) | Console divider and separator utilities. |
198+
| [`@socketsecurity/lib/stdio/footer`](../src/stdio/footer.ts) | Console footer/summary formatting utilities. |
199+
| [`@socketsecurity/lib/stdio/header`](../src/stdio/header.ts) | Console header/banner formatting utilities. |
200+
| [`@socketsecurity/lib/stdio/stderr`](../src/stdio/stderr.ts) | Standard error stream utilities. |
201+
| [`@socketsecurity/lib/stdio/stdout`](../src/stdio/stdout.ts) | Standard output stream utilities. |
206202

207203
## themes/
208204

package.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,6 @@
559559
"types": "./dist/ssri.d.ts",
560560
"default": "./dist/ssri.js"
561561
},
562-
"./stdio/clear": {
563-
"types": "./dist/stdio/clear.d.ts",
564-
"default": "./dist/stdio/clear.js"
565-
},
566562
"./stdio/divider": {
567563
"types": "./dist/stdio/divider.d.ts",
568564
"default": "./dist/stdio/divider.js"
@@ -575,18 +571,6 @@
575571
"types": "./dist/stdio/header.d.ts",
576572
"default": "./dist/stdio/header.js"
577573
},
578-
"./stdio/mask": {
579-
"types": "./dist/stdio/mask.d.ts",
580-
"default": "./dist/stdio/mask.js"
581-
},
582-
"./stdio/progress": {
583-
"types": "./dist/stdio/progress.d.ts",
584-
"default": "./dist/stdio/progress.js"
585-
},
586-
"./stdio/prompts": {
587-
"types": "./dist/stdio/prompts.d.ts",
588-
"default": "./dist/stdio/prompts.js"
589-
},
590574
"./stdio/stderr": {
591575
"types": "./dist/stdio/stderr.d.ts",
592576
"default": "./dist/stdio/stderr.js"
@@ -707,12 +691,6 @@
707691
"@babel/parser": "7.28.4",
708692
"@babel/traverse": "7.28.4",
709693
"@babel/types": "7.28.4",
710-
"@inquirer/checkbox": "4.3.1",
711-
"@inquirer/confirm": "5.1.16",
712-
"@inquirer/input": "4.2.2",
713-
"@inquirer/password": "4.0.18",
714-
"@inquirer/search": "3.1.1",
715-
"@inquirer/select": "4.3.2",
716694
"@npmcli/arborist": "9.1.4",
717695
"@npmcli/package-json": "7.0.0",
718696
"@npmcli/promise-spawn": "8.0.3",

pnpm-lock.yaml

Lines changed: 0 additions & 193 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ allowBuilds:
88
esbuild: true
99

1010
overrides:
11-
'@inquirer/ansi': 1.0.2
12-
'@inquirer/core': 10.3.1
13-
'@inquirer/figures': 1.0.15
1411
'@npmcli/arborist': 9.1.6
1512
'@npmcli/git': 6.0.3
1613
'@npmcli/installed-package-contents': 4.0.0

scripts/build-externals/config.mts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
// Define which packages need bundling (ones that are actual npm packages).
77
export const externalPackages = [
8-
// external-pack: Shared dependencies and @inquirer packages bundled together.
8+
// external-pack: Shared dependencies bundled together.
99
// Bundled first so npm-pack can mark shared deps as external.
10-
// Contains: has-flag, signal-exit, supports-color, yoctocolors-cjs, @inquirer/*.
10+
// Contains: has-flag, signal-exit, supports-color, yoctocolors-cjs.
1111
{ name: 'external-pack', bundle: true },
1212
// NPM bundles - grouped for better deduplication.
1313
// npm-pack: arborist, cacache, libnpmpack, make-fetch-happen, npm-package-arg,
@@ -67,20 +67,6 @@ export const scopedPackages = [
6767
bundle: true,
6868
subpaths: ['package-json/lib/read-package.js', 'package-json/lib/sort.js'],
6969
},
70-
{
71-
scope: '@inquirer',
72-
packages: [
73-
// Only bundle packages that are in devDependencies
74-
'checkbox',
75-
'confirm',
76-
'input',
77-
'password',
78-
'search',
79-
'select',
80-
],
81-
bundle: false,
82-
optional: true,
83-
},
8470
{
8571
scope: '@socketregistry',
8672
packages: ['packageurl-js', 'is-unicode-supported', 'yocto-spinner'],

scripts/build-externals/esbuild-config.mts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,6 @@ export function getPackageSpecificOptions(packageName) {
194194
} else if (packageName === 'zod') {
195195
// Zod has localization files we don't need.
196196
opts.external = [...(opts.external || []), './locales/*']
197-
} else if (packageName === 'external-pack') {
198-
// Inquirer packages have heavy dependencies we can exclude.
199-
opts.external = [...(opts.external || []), 'rxjs/operators']
200-
} else if (packageName.startsWith('@inquirer/')) {
201-
// @inquirer packages export default only - unwrap for CJS compatibility.
202-
opts.footer = {
203-
js: 'if (module.exports && module.exports.default && Object.keys(module.exports).length === 1) { module.exports = module.exports.default; }',
204-
}
205197
} else if (packageName === '@socketregistry/packageurl-js') {
206198
// packageurl-js imports from socket-lib, creating a circular dependency.
207199
// Mark socket-lib imports as external to avoid bundling issues.

0 commit comments

Comments
 (0)