rickbergfalk / postgrator

A PostgreSQL, MySQL, and SQL Server migration tool using plain sql scripts.
MIT License
449 stars 70 forks source link

Deprecation warning reported for v6.0.0 #145

Closed bajtos closed 2 years ago

bajtos commented 2 years ago

When I install postgrator@6.0.0 and run my migration script, I am getting the following deprecation warning in the console:

(node:40498) [DEP0151] DeprecationWarning: Package /Users/bajtos/src/zebra/backend/node_modules/postgrator/ has a "main" field set to "postgrator", excluding the full filename and extension to the resolved file at "postgrator.js", imported from /Users/bajtos/src/zebra/backend/data/migrate.js.
 Automatic extension resolution of the "main" field is deprecated for ES modules.

Reproduction

index.js

import Postgrator from 'postgrator';

package.json

{
  "name": "repro",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
    "postgrator": "^6.0.0"
  }
}

Command to run:

$ node index.js

Additional info

My Node.js version: v16.13.1

I think this issue was introduced by https://github.com/rickbergfalk/postgrator/pull/143

bajtos commented 2 years ago

The fix is pretty trivial: https://github.com/rickbergfalk/postgrator/pull/146