Skip to content

feat: modernize tooling and bump all dependencies#182

Merged
robertsLando merged 5 commits into
masterfrom
chore/modernize-tooling
Mar 24, 2026
Merged

feat: modernize tooling and bump all dependencies#182
robertsLando merged 5 commits into
masterfrom
chore/modernize-tooling

Conversation

@robertsLando

@robertsLando robertsLando commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

Major tooling modernization and dependency bump:

Dependencies bumped to latest

Package Before After Breaking
aedes ^0.50.0 ^1.0.1 Yes - now a class (new Aedes()), named export, persistence no longer on broker
aedes-persistence-redis ^10.0.0 ^11.2.2 Yes
minimatch ^9.0.3 ^10.2.4 Yes
mqemitter-mongodb ^8.1.0 ^9.0.1 Yes
yargs ^17.7.2 ^18.0.0 Yes - must call Yargs() to get instance
aedes-persistence-mongodb ^9.1.1 ^9.4.1 No
pino ^10.0.0 ^10.3.1 No
pino-pretty ^13.1.2 ^13.1.3 No
ws ^8.14.2 ^8.20.0 No
release-it ^19.0.5 ^19.2.4 No

Linting: standard → eslint + neostandard

  • Removed standard and snazzy devDependencies
  • Added eslint (^9.27.0) and neostandard (^0.13.0)
  • Created eslint.config.js using ESLint flat config with neostandard preset
  • Updated npm scripts: lint:standardlint

Testing: tap → node:test

  • Removed tap devDependency
  • Rewrote all test files to use node:test + node:assert/strict
  • Replaced t.plan() / t.equal() / t.same() / t.not() / t.teardown() with assert.equal() / assert.deepEqual() / assert.notEqual() / t.after() / assert.rejects()
  • Deleted .taprc config file
  • Updated test script: tap test/*.test.jsnode --test test/*.test.js

Code fixes for breaking changes

  • aedes v1.0: Aedes is now a class requiring new, exported as named export. broker.persistence is no longer exposed — the persistence reference is now kept separately and returned from start()
  • yargs v18: require('yargs') now returns a factory function — must call Yargs() to create an instance
  • Server error handling: Fixed createServer() to use server.on('error', reject) instead of relying on the listen callback for errors (which doesn't receive them in modern Node.js)

GitHub Actions bumped

  • actions/checkout: v5 → v6
  • actions/setup-node: v5 → v6
  • docker/setup-buildx-action: v3 → v4
  • docker/setup-qemu-action: v3 → v4
  • docker/login-action: v3 → v4
  • docker/metadata-action: v5 → v6
  • docker/build-push-action: v5 → v7

Test plan

  • npm run lint passes (eslint with neostandard)
  • node --test test/cli.test.js test/authorizer.test.js — all 8 tests pass
  • CI pipeline with mongodb/redis services (persistence.test.js)
  • Docker build verification

Closes #181

🤖 Generated with Claude Code

robertsLando and others added 5 commits March 24, 2026 08:49
- Bump all dependencies to latest: aedes ^1.0.1, aedes-persistence-redis ^11.2.2,
  minimatch ^10.2.4, mqemitter-mongodb ^9.0.1, yargs ^18.0.0, and others
- Replace standard + snazzy with eslint + neostandard (flat config)
- Replace tap with node:test + node:assert
- Delete .taprc (no longer needed)
- Fix aedes v1.0 breaking changes: Aedes is now a class (requires `new`),
  named export, persistence no longer exposed on broker instance
- Fix yargs v18 breaking change: must call Yargs() to get instance
- Fix server listen error handling to properly reject on EADDRINUSE
- Bump all GitHub Actions to latest: checkout@v6, setup-node@v6,
  setup-buildx-action@v4, setup-qemu-action@v4, login-action@v4,
  metadata-action@v6, build-push-action@v7

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace mvertes/alpine-mongo (MongoDB 3.6) with mongo:7 in CI workflow.
  The updated mongodb driver requires at least MongoDB 4.2 (wire version 8).
- Update health check command from `mongo` to `mongosh` for mongo:7.
- Return `mq` emitter from start() so tests can properly close it.
- Await persistence.destroy() and close mq emitter in test helper stop()
  to prevent process hangs during persistence tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…testing

- Use Aedes.createBroker() instead of new Aedes() to properly initialize
  persistence via the listen() method (aedes v1.0 requires this)
- Remove stale waitForReady/once(persistence, 'ready') logic — the new
  persistence versions handle readiness internally via setup()
- Simplify persistence.js: remove waitForReady flags, use SUPPORTED array
- Add docker-compose-test.yml with MongoDB 7 and Redis 7 for local testing
- Use --test-force-exit to handle lingering persistence connections
  (aedes-persistence-mongodb has a known race condition during destroy)
- Simplify test helper stop(): just close servers and broker

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wait for mqemitter-mongodb's _executingBulk to complete before calling
broker.close(), preventing an unhandled rejection from an in-flight
bulkWrite being interrupted by the client connection closing.

This removes the need for --test-force-exit.

Upstream fix: mcollina/mqemitter-mongodb#65

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robertsLando
robertsLando requested a review from Copilot March 24, 2026 09:33
@robertsLando robertsLando changed the title chore: modernize tooling and bump all dependencies feat: modernize tooling and bump all dependencies Mar 24, 2026
@robertsLando
robertsLando merged commit 3582096 into master Mar 24, 2026
11 checks passed
@robertsLando
robertsLando deleted the chore/modernize-tooling branch March 24, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes the project’s tooling and dependencies to align with the latest Node ecosystem (notably migrating from tapnode:test, standardeslint/neostandard) and updates runtime code to accommodate breaking dependency changes (Aedes v1, yargs v18), plus CI/Docker updates.

Changes:

  • Bumped major dependencies (Aedes, yargs, minimatch, mqemitter-mongodb, etc.) and adjusted CLI/runtime integration.
  • Migrated test suite to node:test + node:assert/strict and removed Tap config.
  • Introduced ESLint flat config with neostandard, added docker-compose for test services, and updated GitHub Actions workflows.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/cli.js Updates yargs initialization and Aedes broker/server startup logic for breaking dependency changes.
lib/persistence.js Simplifies supported persistence/mq validation logic.
package.json Updates scripts and bumps dependencies/devDependencies to new tooling stack.
eslint.config.js Adds ESLint flat config using neostandard preset.
test/cli.test.js Migrates CLI tests from tap to node:test/assert and adjusts ports/expectations.
test/authorizer.test.js Migrates authorizer tests from tap to node:test/assert.
test/persistence.test.js Migrates persistence test from tap to node:test.
test/helper.js Updates teardown logic for multi-server start + new persistence/mq handling.
docker-compose-test.yml Adds local MongoDB/Redis services for running persistence tests.
.github/workflows/ci.yml Updates CI service images/health checks and bumps Actions versions.
.github/workflows/dockerbuild.yml Bumps Docker build workflow actions versions.
.taprc Removes Tap configuration as part of the node:test migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/cli.js
Comment thread test/helper.js
Comment thread test/helper.js
Comment thread test/cli.test.js
Comment thread test/cli.test.js
Comment thread package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[question] New version?

2 participants