jakajancar / pgc4d

A full-featured PostgreSQL Client for Deno
MIT License
21 stars 3 forks source link

use 'export type' #10

Closed MichaelTheriot closed 3 years ago

MichaelTheriot commented 3 years ago

Deno 1.5.0 includes a breaking change to enable the isolatedModules flag by default: https://github.com/denoland/deno/pull/8050

The following errors in mod.ts on Deno v1.5.0:

error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

This re-exports types using export type to fix it.

jakajancar commented 3 years ago

Hi Michael,

Looks like the tests fail, though due to an unrelated problem (fails also on master now): appears like Deno decided to break imports with v in the name, but I'm not sure if I'm missing anything. Looks to me like the entire ecosystem would break 🤷‍♂️ I'm surprised this still works for you, perhaps due to cached sources?

jakajancar commented 3 years ago

I fixed the "v" imports and also upgraded to Deno 1.5.3 on master. I'm not getting the error you mention above.

MichaelTheriot commented 3 years ago

Here is the minimal reproducible example I have.

main.ts:

import { connectPg } from 'https://deno.land/x/pgc4d/src/mod.ts';

console.log(connectPg);
$ deno --version
deno 1.5.3 (ab7b8ba, release, x86_64-pc-windows-msvc)
v8 8.7.220.3
typescript 4.0.5

$ deno run main.ts
error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    ConnectPgOptions,
    ~~~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:2:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    PgConn,
    ~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:7:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    ErrorAndNoticeFields,
    ~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:11:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    PreparedStatement,
    ~~~~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:15:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    CompletionInfo,
    ~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:19:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    Notification,
    ~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:26:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    PgNotice,
    ~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:28:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    ColumnMetadata,
    ~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:29:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    ParameterMetadata,
    ~~~~~~~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:30:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    ColumnValue,
    ~~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:31:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    IndexedRow,
    ~~~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:32:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    KeyedRow,
    ~~~~~~~~
    at https://deno.land/x/pgc4d@v1.3.3/src/mod.ts:33:5

Found 12 errors.

I only get this error on 1.5.0+.

jakajancar commented 3 years ago

@MichaelTheriot 1.3.6 should work, thanks!