porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.37k stars 267 forks source link

postgresjs fails `deno check` #624

Closed ChristianSiegert closed 1 year ago

ChristianSiegert commented 1 year ago

574 was closed but not resolved. So here it is again with a rephrased explanation:

postgresjs uses an old Deno std lib version that does not pass deno check in newer Deno versions. This is problematic because I cannot update to a Deno version after 1.28.3 or else the CI/CD job fails because of the failing deno check.

Steps to reproduce:

  1. Create a .ts file and import postgresjs:
    // main.ts
    import "https://deno.land/x/postgresjs@v3.3.5/mod.js";
  2. Run deno vendor main.ts
  3. Run deno check --import-map=vendor/import_map.json main.ts

Expected: No errors

Actual:

Check file:///<redacted>/main.ts
error: TS2367 [ERROR]: This comparison appears to be unintentional because the types 'rmdirOptions | undefined' and 'boolean' have no overlap.
    if (options === false) {
        ~~~~~~~~~~~~~~~~~
    at file:///<redacted>/vendor/deno.land/std@0.132.0/node/_fs/_fs_rmdir.ts:82:9

Environment:

deno --version
deno 1.34.3 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4
porsager commented 1 year ago

Once https://github.com/denoland/deno/issues/18303 lands I think we can pull out the entire polyfill I made in favor of the node support in deno core.

Even so, this seems like the usual typescript breakage (again) of working code - tests pass..

porsager commented 1 year ago

With that being the case, I don't want to kill my own energy by having typescript issues hanging around which I am not able to fix, which was the reason I closed the other issue too..