Repository navigation
Conversation
koral--
added a commit
that referenced
this pull request
Oct 24, 2026
* fix(sync): stop calling the deprecated fs.Stats constructor Node 22 warns with DEP0180 whenever `new fs.Stats()` runs, which Stats did through `super()` on every stat, sta2 and readdir entry, and @types/node 22 marks the constructor private. Stats no longer extends fs.Stats; its prototype chains to fs.Stats.prototype instead, so `instanceof fs.Stats`, isFile(), isDirectory() and the lazy mtime getter keep working, and it sets the same own properties the constructor used to. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * chore!: move to ESLint 10, TypeScript 6 and Node 22 - ESLint flat config with typescript-eslint 8; Prettier runs on its own instead of as an ESLint plugin, and the tests are linted too (the old .eslintignore skipped them). Fix what the new recommended rules flag. - TypeScript 6 with module node20, targeting ES2023. The emitted declarations and the published files are unchanged. - Tests converted to ESM .mts run by Node's type stripping, with mocha 12, chai 6, sinon 22 and sinon-chai 4. They import the compiled dist/, so `npm test` compiles first. ts-node and rimraf are gone. - Drop the unused tsconfig-dist.json, compile2 and testJS. - Regenerate the lockfile for the new dev dependencies. - Weekly grouped Dependabot updates; hold TypeScript 7 until typescript-eslint supports it. BREAKING CHANGE: requires Node.js 22 or newer. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * feat!: replace bluebird with native promises Every public method now returns a native Promise. Bluebird features replaced: - .finally() and Promise.resolve/reject: the native ones. - Filtered .catch(ErrorClass, fn) and .catch(predicate, fn): instanceof or predicate checks that rethrow anything else. - .return(x): .then(() => x). - .nodeify(callback): a nodeify() helper that returns the same promise and rethrows a throwing callback on the next tick. sync.stat(), sync.sta2(), sync.readdir(), util.readAll() and util.parsePublicKey() keep their callbacks. - Promise.try: new Promise(resolve => resolve(fn())), which also runs fn synchronously; the tcpusb packet order depends on that. - Promise.delay: timers/promises setTimeout. - Promise.promisify(crypto.randomBytes): the callback form wrapped in a Promise. - Promise.defer(): plain Promise executors in the sync writer. - .timeout(1000) and TimeoutError in the monkey command: a timer that cancels the parser, so the search stops consuming the monkey's output. - Cancellation (.cancel(), onCancel, CancellationError, Bluebird.config({ cancellation })): Parser.cancel(), which rejects the pending and every later read with Parser.CancellationError. It is sticky, so a cancel that lands between two reads still stops a loop. tracker.end(), jdwpTracker.end(), pushTransfer.cancel() and pullTransfer.cancel() use it. - waitBootComplete() and waitForDevice() take { signal }: on abort they close the connection and reject with signal.reason, which replaces calling .timeout() or .cancel() on their promises. Chains nobody awaits (tracker loops, sync transfers, ProcStat's timer, tcpusb packet handling) end in a handler that turns a stray rejection into a process warning, as bluebird did, instead of crashing the process. openMonkey() is typed as adbkit-monkey's connectStream() return type, `any` with adbkit-monkey 1.x, so the typed monkey slots in without code changes. SocketOptions.auth may return any PromiseLike. BREAKING CHANGE: methods return native Promises, so bluebird-only methods (.timeout(), .delay(), .return(), .tap(), .spread(), .cancel() ...) are gone. jdwpTracker.end() now ends the connection and emits 'end', and cancelling a push or pull transfer ends the sync connection as documented; a cancelled pull transfer also ends. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * feat!: define package exports, including the internals stf imports stf deep-imports Parser, PushTransfer and the TCP-USB bridge Server. Export them under short subpaths (adb/parser, adb/sync/pushtransfer, adb/tcpusb/server, as asked in #91) and, so that existing imports keep working, under the dist/src/... paths stf uses today. Each entry lists its declarations first, so the subpaths are typed under node16/nodenext resolution. BREAKING CHANGE: other internal modules can no longer be imported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * chore(deps): update commander to 15 and node-forge to 1.4 commander 15 is ESM-only, so the CLI loads it with a dynamic import, which works on every Node.js 22 (require() of an ES module needs 22.12), and parses with parseAsync() so a failing action exits with an error. The @ts-ignore comments around node-forge's BigInteger are no longer needed with the current @types/node-forge. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * fix: address review of the native promises migration - Cancellation is per operation. Parser reads take an optional AbortSignal that cancels just that read and rejects with signal.reason, so the caller can tell its own cancel apart. Push and pull transfers, the monkey command's 1 s timeout and the transfer readers use it. Parser.cancel() is left for tearing a whole connection down (the trackers, and abortable() for the connection it owns). A transfer removes its 'cancel' listener when it ends, so a late cancel() no longer poisons the shared Sync. - JdwpTracker reads in a loop until end() or the connection closes, and emits 'end' (after 'error' for failures) when it stops. end() works when called from a 'changeSet', 'add' or 'remove' listener. update() now keeps every current pid in its map, so surviving pids are no longer reported as removed by the next list. - Parser notices a stream that ended between two reads. - Sync transfers and the tcpusb socket and service clean up before emitting 'error', so a missing listener no longer leaves a transfer or bridge connection hanging. - abortable() races the signal: an abort rejects with signal.reason at once, also while connecting or on a stalled socket, and the connection is torn down in the background. - engines.node >= 22.12, as commander 15 requires. - Parser.readAll() concatenates once instead of per chunk. - A single promiseTry() helper replaces the three hand-written copies; _createToken() uses util.promisify(crypto.randomBytes). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> * chore(deps): keep @types/node on the supported Node.js major Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Karol Wrótniak <[email protected]> --------- Signed-off-by: Karol Wrótniak <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Member
Author
|
Thanks! |
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.
No description provided.