chore[notask]: remove unused npm: aliases across addon packages#2108
Merged
Conversation
os, process, tty, and util were aliased to bare shims but never imported anywhere in the package source, tests, or examples.
Removes unused or unnecessary npm: module aliases from tts-onnx,
tts-ggml, bci-whispercpp, transcription-whispercpp,
transcription-parakeet, langdetect-text-cld2, and registry-server.
Most aliases (fs, os, tty, util, stream, worker_threads, path, module,
buffer, crypto, http, https, readline) were never imported in any Bare
context. registry-server is a Node.js server (engines: node >=20) so
bare shims in dependencies were incorrect entirely.
tts-onnx and tts-ggml unit tests used require('process') via the alias;
updated to require('bare-process') directly, which is already an
explicit devDependency in both packages.
Restore "util": "npm:bare-utils" in tts-onnx, tts-ggml,
transcription-parakeet, and transcription-whispercpp — sinon requires
'util' internally and these packages run their unit tests under
brittle-bare.
Restore "module": "npm:bare-module" in langdetect-text-cld2 — index.js
uses `import { createRequire } from 'module'` which requires the alias
in Bare.
… directly Remove sinon from tts-onnx, tts-ggml, transcription-parakeet, and transcription-whispercpp — replace every sinon.stub / sinon.spy call with direct property assignment (instance stubs) and a small module-level spy helper that wraps the prototype method with a counter. This eliminates the only remaining reason those four packages kept "util": "npm:bare-utils" in devDependencies, which is now removed along with sinon itself. Change langdetect-text-cld2/index.js to import createRequire from 'bare-module' instead of 'module', and declare bare-module explicitly in dependencies. This removes the last "module": "npm:bare-module" alias. All unit tests pass across all five packages after the changes.
Remove dead _origValidateModelFiles captures that triggered no-unused-vars lint errors, drop stale ?.restore?.() guard calls from integration tests that became no-ops once sinon stubs were replaced with plain prototype assignments, add bare-process to transcription-whispercpp devDependencies explicitly, and tighten the reload-spy assertion to t.is for clarity.
langdetect-text-cld2: add engines restriction (bare>=1.0.0), bump to 0.4.0, add CHANGELOG entry, and update README to remove stale Node.js compatibility claims. The import of createRequire from bare-module makes this package explicitly Bare-only; prior docs implied Node.js support. tts-onnx, tts-ggml: capture MockedBinding.prototype.runJob once at module level so spyRunJob() always wraps the pristine original rather than stacking on previous wrappers. Eliminates cross-test prototype contamination when a test throws before restore() is called.
GustavoA1604
approved these changes
May 19, 2026
gianni-cor
approved these changes
May 19, 2026
Contributor
|
/review |
Contributor
Tier-based Approval Status |
Contributor
|
/review |
aegioscy
approved these changes
May 20, 2026
Contributor
|
/review |
dev-nid
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
npm:aliases declaring bare shims or Node.js-compatible modules that were either never imported in their Bare context, or only used by Node.js scripts where native builtins apply anyway.registry-server(Node.js engine>=20) had bare shims in productiondependencies, which is incorrect for a Node.js server.📝 How does it solve it?
npm:aliases across 8 packages:llm-llamacpp,tts-onnx,tts-ggml,bci-whispercpp,transcription-whispercpp,transcription-parakeet,langdetect-text-cld2,registry-server.tts-onnxandtts-ggmlunit tests usedrequire('process')via the alias; updated torequire('bare-process')directly, which was already an explicitdevDependencyin both packages.Two aliases were intentionally kept:
util(kept intts-onnx,tts-ggml,transcription-parakeet,transcription-whispercpp): sinon and its dependencydebugboth dorequire('util')internally. Bare has no built-inutilmodule, so the alias mapping it tobare-utilsis required for unit tests to load in Bare.module(kept inlangdetect-text-cld2):index.jsdoesimport { createRequire } from 'module'. Bare has no built-inmodule, so removing this alias would require touching production source.