Skip to content

Upgrade node-cron to v4 - #1499

Open
merencia wants to merge 1 commit into
dbgate:masterfrom
merencia:chore/upgrade-node-cron-v4
Open

Upgrade node-cron to v4#1499
merencia wants to merge 1 commit into
dbgate:masterfrom
merencia:chore/upgrade-node-cron-v4

Conversation

@merencia

Copy link
Copy Markdown

Bumps node-cron from ^2.0.3 to ^4.5.0 in dbgate-api.

Context: I maintain node-cron, and v2 is on its way out, so it's a good time to move.

Why

node-cron v2 is several major versions behind. v4 is a TypeScript rewrite
with a maintained, actively supported codebase.

Changes

  • packages/api/package.json: node-cron ^2.0.3 -> ^4.5.0
  • yarn.lock: updated entry, plus removal of the now-unused transitive deps
    opencollective-postinstall and tz-offset (pulled only by node-cron v2)

No source changes were needed. The scheduler controller
(packages/api/src/controllers/scheduler.js) uses only three node-cron APIs,
all unchanged in v4:

  • cron.validate(pattern)
  • cron.schedule(pattern, fn)
  • task.destroy()

Bump node-cron from ^2.0.3 to ^4.5.0 in dbgate-api. The scheduler
controller uses cron.validate, cron.schedule(expr, fn) and task.destroy,
all of which keep the same signatures in v4, so no code changes are
needed. Drop the now-unused opencollective-postinstall and tz-offset
transitive deps from the lockfile.
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.

1 participant