mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
build: add esm exports
This commit is contained in:
parent
477f812984
commit
98bc876b49
6
packages/pg-cloudflare/esm/index.js
Normal file
6
packages/pg-cloudflare/esm/index.js
Normal file
@ -0,0 +1,6 @@
|
||||
// ESM wrapper for pg-cloudflare
|
||||
import module from '../dist/empty.js';
|
||||
|
||||
// Re-export any named exports and the default
|
||||
export const CloudflareSocket = module.CloudflareSocket;
|
||||
export default module;
|
||||
6
packages/pg-cloudflare/esm/worker.js
Normal file
6
packages/pg-cloudflare/esm/worker.js
Normal file
@ -0,0 +1,6 @@
|
||||
// ESM wrapper for pg-cloudflare in Cloudflare Workers
|
||||
import module from '../dist/index.js';
|
||||
|
||||
// Re-export CloudflareSocket and the default
|
||||
export const CloudflareSocket = module.CloudflareSocket;
|
||||
export default module;
|
||||
@ -10,8 +10,15 @@
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"exports": {
|
||||
"workerd": "./dist/index.js",
|
||||
"default": "./dist/empty.js"
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./dist/empty.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"./worker": {
|
||||
"import": "./esm/worker.js",
|
||||
"require": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
@ -26,6 +33,7 @@
|
||||
},
|
||||
"files": [
|
||||
"/dist/*{js,ts,map}",
|
||||
"/src"
|
||||
"/src",
|
||||
"/esm"
|
||||
]
|
||||
}
|
||||
|
||||
8
packages/pg-connection-string/esm/index.js
Normal file
8
packages/pg-connection-string/esm/index.js
Normal file
@ -0,0 +1,8 @@
|
||||
// ESM wrapper for pg-connection-string
|
||||
import connectionString from '../index.js';
|
||||
|
||||
// Re-export the parse function
|
||||
export const parse = connectionString.parse;
|
||||
|
||||
// Re-export the default
|
||||
export default connectionString;
|
||||
@ -4,6 +4,13 @@
|
||||
"description": "Functions for dealing with a PostgresSQL connection string",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha && npm run check-coverage",
|
||||
"check-coverage": "istanbul check-coverage --statements 100 --branches 100 --lines 100 --functions 100",
|
||||
@ -34,6 +41,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"esm"
|
||||
]
|
||||
}
|
||||
|
||||
5
packages/pg-cursor/esm/index.js
Normal file
5
packages/pg-cursor/esm/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
// ESM wrapper for pg-cursor
|
||||
import Cursor from '../index.js';
|
||||
|
||||
// Export as default only to match CJS module
|
||||
export default Cursor;
|
||||
@ -3,6 +3,12 @@
|
||||
"version": "2.13.1",
|
||||
"description": "Query cursor extension for node-postgres",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./index.js"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
@ -22,5 +28,9 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"pg": "^8"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"esm"
|
||||
]
|
||||
}
|
||||
|
||||
5
packages/pg-native/esm/index.js
Normal file
5
packages/pg-native/esm/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
// ESM wrapper for pg-native
|
||||
import Client from '../index.js';
|
||||
|
||||
// Export as default only to match CJS module
|
||||
export default Client;
|
||||
@ -3,6 +3,12 @@
|
||||
"version": "3.3.0",
|
||||
"description": "A slightly nicer interface to Postgres over node-libpq",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
@ -34,5 +40,9 @@
|
||||
"node-gyp": ">=10.x",
|
||||
"okay": "^0.3.0",
|
||||
"semver": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"esm"
|
||||
]
|
||||
}
|
||||
|
||||
5
packages/pg-pool/esm/index.js
Normal file
5
packages/pg-pool/esm/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
// ESM wrapper for pg-pool
|
||||
import Pool from '../index.js';
|
||||
|
||||
// Export as default only to match CJS module
|
||||
export default Pool;
|
||||
@ -3,6 +3,12 @@
|
||||
"version": "3.8.0",
|
||||
"description": "Connection pool for node-postgres",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./index.js"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
@ -36,5 +42,9 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"pg": ">=8.0"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"esm"
|
||||
]
|
||||
}
|
||||
|
||||
11
packages/pg-protocol/esm/index.js
Normal file
11
packages/pg-protocol/esm/index.js
Normal file
@ -0,0 +1,11 @@
|
||||
// ESM wrapper for pg-protocol
|
||||
import protocol from '../dist/index.js';
|
||||
|
||||
// Re-export all the properties
|
||||
export const DatabaseError = protocol.DatabaseError;
|
||||
export const SASL = protocol.SASL;
|
||||
export const serialize = protocol.serialize;
|
||||
export const parse = protocol.parse;
|
||||
|
||||
// Re-export the default
|
||||
export default protocol;
|
||||
@ -4,6 +4,13 @@
|
||||
"description": "The postgres client/server binary protocol, implemented in TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.2.7",
|
||||
@ -29,6 +36,7 @@
|
||||
},
|
||||
"files": [
|
||||
"/dist/*{js,ts,map}",
|
||||
"/src"
|
||||
"/src",
|
||||
"/esm"
|
||||
]
|
||||
}
|
||||
|
||||
5
packages/pg-query-stream/esm/index.js
Normal file
5
packages/pg-query-stream/esm/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
// ESM wrapper for pg-query-stream
|
||||
import QueryStream from '../dist/index.js';
|
||||
|
||||
// Export as default only to match CJS module
|
||||
export default QueryStream;
|
||||
@ -4,6 +4,13 @@
|
||||
"description": "Postgres query result returned as readable stream",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha -r ts-node/register test/**/*.ts"
|
||||
},
|
||||
@ -21,7 +28,8 @@
|
||||
],
|
||||
"files": [
|
||||
"/dist/*{js,ts,map}",
|
||||
"/src"
|
||||
"/src",
|
||||
"/esm"
|
||||
],
|
||||
"author": "Brian M. Carlson",
|
||||
"license": "MIT",
|
||||
|
||||
18
packages/pg/esm/index.js
Normal file
18
packages/pg/esm/index.js
Normal file
@ -0,0 +1,18 @@
|
||||
// ESM wrapper for pg
|
||||
import pg from '../lib/index.js';
|
||||
|
||||
// Re-export all the properties
|
||||
export const Client = pg.Client;
|
||||
export const Pool = pg.Pool;
|
||||
export const Connection = pg.Connection;
|
||||
export const types = pg.types;
|
||||
export const Query = pg.Query;
|
||||
export const DatabaseError = pg.DatabaseError;
|
||||
export const escapeIdentifier = pg.escapeIdentifier;
|
||||
export const escapeLiteral = pg.escapeLiteral;
|
||||
|
||||
// Also export the defaults
|
||||
export const defaults = pg.defaults;
|
||||
|
||||
// Re-export the default
|
||||
export default pg;
|
||||
@ -19,6 +19,12 @@
|
||||
},
|
||||
"author": "Brian Carlson <brian.m.carlson@gmail.com>",
|
||||
"main": "./lib",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"pg-connection-string": "^2.7.0",
|
||||
"pg-pool": "^3.8.0",
|
||||
@ -52,6 +58,7 @@
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"esm",
|
||||
"SPONSORS.md"
|
||||
],
|
||||
"license": "MIT",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user