Skip to content

v0.4.0 — Moleculer 0.15 + Node 22+#91

Merged
icebob merged 32 commits intomasterfrom
next
Mar 28, 2026
Merged

v0.4.0 — Moleculer 0.15 + Node 22+#91
icebob merged 32 commits intomasterfrom
next

Conversation

@icebob-ai
Copy link
Copy Markdown
Contributor

@icebob-ai icebob-ai commented Mar 27, 2026

Summary

  • Moleculer 0.15 compatibility: fix TypeScript types (ServiceEvents, GenericObject, Logger), keep peer dependency supporting both ^0.14.12 and ^0.15.0
  • Node.js 22+ minimum: drop Node 20 from CI matrix, update engines field
  • Tooling modernization: ESLint 8→10 (flat config), TypeScript 5→6, all safe dependencies updated
  • Version bump: 0.3.0 → 0.4.0

Breaking changes

  • Minimum Node.js version: 20 → 22
  • ESLint config migrated to flat config (.eslintrc.jseslint.config.js)

Changes

  • Fix index.d.ts: remove ServiceEvents (unused), replace GenericObjectRecord<string, any>, fix LoggersLogger
  • Upgrade ESLint 8→10 with flat config, replace eslint-plugin-nodeeslint-plugin-n, drop eslint-plugin-promise
  • Upgrade TypeScript 5→6 with ignoreDeprecations: "6.0" for node10 moduleResolution
  • Update safe dependencies: lodash, semver, axios, knex, mysql2, pg, prettier, qs, nodemon, nedb, sequelize, eslint-plugin-prettier

Test plan

  • Unit tests pass locally (123/123)
  • TypeScript type check clean (tsc --noEmit)
  • ESLint clean (only pre-existing warnings)
  • npm ci succeeds without peer dep conflicts
  • CI: Unit Test workflow
  • CI: TypeScript Type Check workflow
  • CI: Integration Test workflow (Docker Hub auth issue — unrelated)

🤖 Generated with Claude Code

icebob and others added 21 commits August 9, 2025 22:47
- Remove unused ServiceEvents import (removed in 0.15)
- Replace GenericObject with Record<string, any> (not exported in 0.15)
- Fix logger type: Loggers namespace → Logger interface

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lodash 4.17.23, semver 7.7.4, axios 1.13.6, knex 3.2.6,
mysql2 3.20.0, pg 8.20.0, prettier 3.8.1, qs 6.15.0,
nodemon 3.1.14, @seald-io/nedb 4.1.2, sequelize 6.37.8,
eslint-plugin-prettier 5.5.5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Migrate .eslintrc.js → eslint.config.js (flat config)
- Replace deprecated eslint-plugin-node with eslint-plugin-n
- Remove eslint-plugin-prettier (handled by eslint-config-prettier)
- Add @eslint/js, globals as new deps
- Upgrade eslint-config-prettier 9→10, eslint-plugin-promise 6→7,
  eslint-plugin-security 2→4
- TypeScript 5.7→6.0: add ignoreDeprecations for node10 moduleResolution
- tsconfig: moduleResolution node→node10 (explicit naming)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eslint-plugin-promise and eslint-plugin-security don't support
ESLint 10 yet (peer dep: ^7 || ^8 || ^9). Downgrade to ESLint 9
which still uses flat config but is compatible with all plugins.
Fixes npm ci failure in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eslint-plugin-promise doesn't support ESLint 10 yet. Remove it
instead of downgrading ESLint. The promise rules weren't actively
used in this codebase anyway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ignoreDeprecations and moduleResolution: node10 to
test/typescript/tsconfig.json (same fix as root tsconfig).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Version bump 0.3.0 → 0.4.0
- Minimum Node.js: 20 → 22
- Peer dependency: ^0.14.12 || ^0.15.0-0 → ^0.15.0
- CI matrix: drop Node 20, keep 22 + 24
- Fix lint script for ESLint flat config (remove --ext)
- Update CHANGELOG

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No 0.15-specific APIs were introduced, so keep supporting
both ^0.14.12 and ^0.15.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prepares the @moleculer/database package for the v0.4.0 release by modernizing tooling (ESLint flat config, TS upgrade), updating supported runtimes (Node 22+ in CI/engines), and adding/adjusting TypeScript typings plus a TS compilation test project.

Changes:

  • Add TypeScript configs + a compile-only TS “typings validation” project and CI workflow.
  • Modernize tooling (ESLint flat config) and bump package version/engines/dependencies.
  • Adjust typings and small runtime refactor in validation logic; minor docs/changelog updates.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tsconfig.json Adds root TS config used by npm run typecheck for typings.
test/typescript/tsconfig.json Adds strict TS project for compiling a typings validation test.
test/typescript/index.ts Large compile-only TS file exercising public typings.
src/validation.js Refactors field.set invocation to reuse a shared args object.
src/index.js Updates JSDoc type for settings.scopes.
package.json Bumps version to 0.4.0, adds typings entry + typecheck scripts, updates engines/deps/peer range.
index.d.ts Introduces/updates the package’s public TypeScript declarations.
eslint.config.js Migrates ESLint config to flat config.
docs/README.md Escapes pipe characters in type tables.
CHANGELOG.md Adds v0.4.0 entry describing breaking changes and updates.
.github/workflows/unit.yml Drops Node 20 from unit test matrix.
.github/workflows/integration.yml Drops Node 20 from integration test matrix.
.github/workflows/typecheck.yml Adds CI workflow to run typecheck and TS compilation test.
.eslintrc.js Removes legacy ESLint config file.
.claude/settings.local.json Adds Claude Code local permissions config.

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

"lib": ["es2020"],
"strict": true,
"noEmit": true,
"skipLibCheck": true,
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This TypeScript test project is meant to validate the package's typings, but skipLibCheck: true suppresses errors inside declaration files (including ../../index.d.ts). That means broken or internally inconsistent type definitions can slip through CI. Consider setting skipLibCheck to false here (and fixing any upstream type issues explicitly) so the test actually validates the published typings.

Suggested change
"skipLibCheck": true,
"skipLibCheck": false,

Copilot uses AI. Check for mistakes.
CHANGELOG.md Outdated
Comment on lines +7 to +10
- add Moleculer 0.15 support (peer dependency: `^0.14.12 || ^0.15.0`).
- upgrade ESLint to 9 with flat config (`.eslintrc.js` → `eslint.config.js`).
- upgrade TypeScript to 6.
- remove `eslint-plugin-promise` (not compatible with ESLint 9+).
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The changelog says "upgrade ESLint to 9" and references ESLint 9+ compatibility, but package.json in this PR bumps ESLint to ^10.1.0. Please update the v0.4.0 changelog entry to match the actual version being released so users don't get misleading upgrade notes.

Copilot uses AI. Check for mistakes.
Comment on lines 35 to 37
"peerDependencies": {
"moleculer": "^0.14.12 || ^0.15.0-0"
"moleculer": "^0.14.12 || ^0.15.0"
},
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

PR description lists a breaking change "Minimum Moleculer version: 0.14.12 → 0.15.0", but the updated peerDependencies.moleculer still allows ^0.14.12. Either update the peer range to ^0.15.0 only (if 0.14 is no longer supported) or adjust the PR description/changelog to reflect that 0.14.x remains supported.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +8
{
"permissions": {
"allow": [
"Bash(npm run test:ts:*)"
],
"deny": []
}
} No newline at end of file
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This file name (settings.local.json) suggests machine-local Claude Code configuration. Committing it may create noisy diffs and override contributors' local preferences. Consider moving this to a non-.local file intended for version control, or add .claude/settings.local.json to .gitignore if it should remain developer-specific.

Copilot uses AI. Check for mistakes.
icebob-ai and others added 6 commits March 27, 2026 21:16
- Fix CHANGELOG: ESLint 9 → 10 (actual version)
- Remove .claude/settings.local.json from repo (local-only)
- Add .claude/settings.local.json to .gitignore
- Update PR description to reflect 0.14 compatibility kept

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sqlite3 6.0.1 requires Node.js >=20.17.0 (already met with Node 22+).
No API breaking changes — only Node.js minimum version bump and
bundled SQLite version update (3.45.0 → 3.52.0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The lockfile was out of sync after dependency upgrades,
causing npm ci to fail in GitHub Actions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- @vscode/sqlite3: 5.1.2 → 5.1.12-vscode
- axios: 1.13.6 → 1.14.0
- globals: 16.5.0 → 17.4.0
- knex: 3.2.6 → 3.2.7
- mongodb: 6.16.0 → 6.21.0
- npm-check-updates: 16.14.20 → 19.6.6
- tedious: 18.6.2 → 19.2.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
npm on Node 24 (npm 11.x) requires optional platform-specific
dependencies to be present in the lockfile even on Linux,
otherwise npm ci fails with "Missing: fsevents" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Node 24 ships with npm 11.9.0 which has a known bug (npm/cli#8805)
where npm ci fails with "Missing: fsevents from lock file" when the
lockfile was generated on Linux. fsevents is a macOS-only optional
dep that's irrelevant on Linux CI runners.

Using --omit=optional skips platform-specific optional deps entirely,
which is the correct behavior for Linux CI and avoids the npm bug.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sonny (AI Assistant) and others added 5 commits March 28, 2026 16:26
npm ci --omit=optional doesn't help because the lockfile validation
happens before the omit filter is applied (npm/cli#8805).

Instead, upgrade npm to latest (>=11.10.1) on Node 24.x runners
where the bug is fixed. Only runs on 24.x matrix entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
npm ci fails on Node 24 due to a persistent fsevents lockfile bug
(npm/cli#8805) that isn't fully fixed even in npm@latest (11.12.1).
The bug causes npm ci to reject lockfiles generated on Linux because
the macOS-only fsevents optional dep is missing.

Switch to npm install which tolerates the missing optional dep entry.
This is the recommended workaround until npm properly fixes the issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Breaking changes in mongodb 7.x that don't affect this adapter:
- Requires Node.js >=20.19.0 (already met with Node 22+)
- FindOptions no longer generic (not used in JS code)
- cursor.stream({ transform }) removed (not used)
- useNewUrlParser/useUnifiedTopology removed (not used)
- Default cursor batchSize removed (not relied upon)

Updated version check to accept both ^6.0.0 and ^7.0.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace GitHub branch references with npm registry versions
now that both packages are officially released.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@icebob icebob merged commit d4fe4a4 into master Mar 28, 2026
36 checks passed
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.

3 participants