Skip to content

Commit 5af758d

Browse files
committed
...
1 parent 1ccedcd commit 5af758d

13 files changed

Lines changed: 50 additions & 154 deletions

deno.check.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
Selectable,
88
SqlBool,
99
Updateable,
10-
} from './dist/esm'
10+
} from './dist'
1111

1212
export interface Database {
1313
audit: AuditTable

deno.check.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"imports": {
77
"@electric-sql/pglite": "npm:@electric-sql/pglite",
88
"better-sqlite3": "npm:better-sqlite3",
9-
"kysely": "./dist/esm",
10-
"kysely/helpers/mssql": "./dist/esm/helpers/mssql.js",
11-
"kysely/helpers/mysql": "./dist/esm/helpers/mysql.js",
12-
"kysely/helpers/postgres": "./dist/esm/helpers/postgres.js",
13-
"kysely/helpers/sqlite": "./dist/esm/helpers/sqlite.js",
14-
"kysely/migration": "./dist/esm/migration",
15-
"kysely/readonly": "./dist/esm/readonly",
9+
"kysely": "./dist",
10+
"kysely/helpers/mssql": "./dist/helpers/mssql.js",
11+
"kysely/helpers/mysql": "./dist/helpers/mysql.js",
12+
"kysely/helpers/postgres": "./dist/helpers/postgres.js",
13+
"kysely/helpers/sqlite": "./dist/helpers/sqlite.js",
14+
"kysely/migration": "./dist/migration",
15+
"kysely/readonly": "./dist/readonly",
1616
"lodash/snakeCase": "npm:lodash/snakeCase",
1717
"mysql2": "npm:mysql2",
1818
"pg": "npm:pg",

package.json

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"node": ">=20.0.0"
2929
},
3030
"type": "module",
31-
"main": "dist/cjs/index.js",
32-
"module": "dist/esm/index.js",
31+
"main": "dist/index.js",
32+
"module": "dist/index.js",
3333
"typesVersions": {
3434
"<5.4": {
3535
"*": [
@@ -39,54 +39,23 @@
3939
},
4040
"files": [
4141
"dist",
42-
"helpers",
43-
"migration.d.ts",
44-
"migration.js",
45-
"outdated-typescript.d.ts",
46-
"readonly.d.ts",
47-
"readonly.js"
42+
"outdated-typescript.d.ts"
4843
],
4944
"exports": {
5045
".": {
5146
"types@<5.4": "./outdated-typescript.d.ts",
52-
"import": "./dist/esm/index.js",
53-
"require": "./dist/cjs/index.js",
54-
"default": "./dist/cjs/index.js"
47+
"default": "./dist/index.js"
5548
},
56-
"./helpers/postgres": {
57-
"import": "./dist/esm/helpers/postgres.js",
58-
"require": "./dist/cjs/helpers/postgres.js",
59-
"default": "./dist/cjs/helpers/postgres.js"
60-
},
61-
"./helpers/mysql": {
62-
"import": "./dist/esm/helpers/mysql.js",
63-
"require": "./dist/cjs/helpers/mysql.js",
64-
"default": "./dist/cjs/helpers/mysql.js"
65-
},
66-
"./helpers/mssql": {
67-
"import": "./dist/esm/helpers/mssql.js",
68-
"require": "./dist/cjs/helpers/mssql.js",
69-
"default": "./dist/cjs/helpers/mssql.js"
70-
},
71-
"./helpers/sqlite": {
72-
"import": "./dist/esm/helpers/sqlite.js",
73-
"require": "./dist/cjs/helpers/sqlite.js",
74-
"default": "./dist/cjs/helpers/sqlite.js"
75-
},
76-
"./migration": {
77-
"import": "./dist/esm/migration/index.js",
78-
"require": "./dist/cjs/migration/index.js",
79-
"default": "./dist/cjs/migration/index.js"
80-
},
81-
"./readonly": {
82-
"import": "./dist/esm/readonly/index.js",
83-
"require": "./dist/cjs/readonly/index.js",
84-
"default": "./dist/cjs/readonly/index.js"
85-
}
49+
"./helpers/mssql": "./dist/helpers/mssql.js",
50+
"./helpers/mysql": "./dist/helpers/mysql.js",
51+
"./helpers/postgres": "./dist/helpers/postgres.js",
52+
"./helpers/sqlite": "./dist/helpers/sqlite.js",
53+
"./migration": "./dist/migration/index.js",
54+
"./readonly": "./dist/readonly/index.js"
8655
},
8756
"sideEffects": false,
8857
"scripts": {
89-
"clean": "rm -rf dist & rm -rf test/node/dist & rm -rf test/browser/bundle.js & rm -rf helpers",
58+
"clean": "rm -rf dist & rm -rf test/node/dist & rm -rf test/browser/bundle.js",
9059
"bench:ts": "pnpm build && node --experimental-strip-types ./test/ts-benchmarks/index.ts",
9160
"test": "pnpm build && pnpm test:node:build && pnpm test:node:run && pnpm test:typings && pnpm test:esmimports && pnpm test:exports",
9261
"test:node:build": "tsc -p test/node",
@@ -99,16 +68,13 @@
9968
"test:deno": "deno run --allow-env --allow-read --allow-net --no-lock test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net --no-lock test/deno/cdn.test.ts",
10069
"test:typings": "tsd test/typings",
10170
"test:esmimports": "node scripts/check-esm-imports.cjs",
102-
"test:esbuild": "esbuild --bundle --platform=node --external:pg-native dist/esm/index.js --outfile=/dev/null",
71+
"test:esbuild": "esbuild --bundle --platform=node --external:pg-native dist/index.js --outfile=/dev/null",
10372
"test:exports": "attw --pack . && node scripts/check-exports.cjs",
10473
"test:jsdocs": "deno check --doc-only --no-lock --unstable-sloppy-imports --config=\"deno.check.json\" ./src",
10574
"test:outdatedts": "pnpm build && cd test/outdated-ts && pnpm i && pnpm test",
10675
"lint:deno": "deno lint --config=\"deno.lint.json\" ./src",
10776
"prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
108-
"build": "pnpm clean && (pnpm build:esm & pnpm build:cjs) && pnpm script:module-fixup && pnpm script:copy-interface-doc",
109-
"build:esm": "tsc -p tsconfig.json && pnpm script:add-deno-type-references",
110-
"build:cjs": "tsc -p tsconfig-cjs.json",
111-
"script:module-fixup": "node scripts/module-fixup.cjs",
77+
"build": "pnpm clean && tsc && pnpm script:add-deno-type-references && pnpm script:copy-interface-doc",
11278
"script:copy-interface-doc": "node scripts/copy-interface-documentation.cjs",
11379
"script:add-deno-type-references": "node scripts/add-deno-type-references.cjs",
11480
"script:align-versions": "node --experimental-strip-types scripts/align-versions.mts",

scripts/add-deno-type-references.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
*/
66

77
const fs = require('fs')
8-
const path = require('path')
8+
const path = require('pathe')
99
const forEachFile = require('./util/for-each-file.cjs')
1010

11-
const ESM_DIST_PATH = path.join(__dirname, '..', 'dist', 'esm')
11+
const DIST_PATH = path.join(__dirname, '..', 'dist')
1212

13-
forEachFile(ESM_DIST_PATH, (filePath) => {
13+
forEachFile(DIST_PATH, (filePath) => {
1414
if (filePath.endsWith('.js')) {
1515
const dTsFile = path.basename(filePath).replace(/\.js$/, '.d.ts')
1616
const content = fs.readFileSync(filePath, { encoding: 'utf-8' })

scripts/copy-interface-documentation.cjs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,24 @@ const JSDOC_START_REGEX = /^\s+\/\*\*/
2727
const JSDOC_END_REGEX = /^\s+\*\//
2828

2929
function main() {
30-
for (const distSubDir of ['cjs', 'esm']) {
31-
const subDirPath = path.join(DIST_PATH, distSubDir)
32-
const files = []
30+
const files = []
3331

34-
if (!fs.existsSync(subDirPath)) {
35-
continue
36-
}
37-
38-
forEachFile(subDirPath, (filePath) => {
39-
if (filePath.endsWith('.d.ts')) {
40-
const file = {
41-
path: filePath,
42-
lines: readLines(filePath),
43-
}
32+
forEachFile(DIST_PATH, (filePath) => {
33+
if (filePath.endsWith('.d.ts')) {
34+
const file = {
35+
path: filePath,
36+
lines: readLines(filePath),
37+
}
4438

45-
file.objects = parseObjects(file)
39+
file.objects = parseObjects(file)
4640

47-
if (file.objects.length > 0) {
48-
files.push(file)
49-
}
41+
if (file.objects.length > 0) {
42+
files.push(file)
5043
}
51-
})
44+
}
45+
})
5246

53-
copyDocumentation(files)
54-
}
47+
copyDocumentation(files)
5548
}
5649

5750
function readLines(filePath) {

scripts/generate-site-examples.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const path = require('path')
1010
const forEachFile = require('./util/for-each-file.cjs')
1111
const _ = require('lodash')
1212

13-
const ESM_PATH = path.join(__dirname, '..', 'dist', 'esm')
13+
const DIST_PATH = path.join(__dirname, '..', 'dist')
1414
const SITE_EXAMPLE_PATH = path.join(__dirname, '..', 'site', 'docs', 'examples')
1515

1616
const SITE_EXAMPLE_START_REGEX = /<!--\s*siteExample\(/
@@ -98,7 +98,7 @@ const moreExamplesByCategory = {
9898
function main() {
9999
deleteAllExamples()
100100

101-
forEachFile(ESM_PATH, (filePath) => {
101+
forEachFile(DIST_PATH, (filePath) => {
102102
if (!filePath.endsWith('.d.ts')) {
103103
return
104104
}

scripts/module-fixup.cjs

Lines changed: 0 additions & 55 deletions
This file was deleted.

site/docs/runtimes/deno.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
PostgresAdapter,
1717
PostgresIntrospector,
1818
PostgresQueryCompiler,
19-
} from 'https://cdn.jsdelivr.net/npm/kysely/dist/esm/index.js'
19+
} from 'https://cdn.jsdelivr.net/npm/kysely/dist/index.js'
2020

2121
interface Person {
2222
id: Generated<number>

test/browser/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
22
Kysely,
3-
Generated,
3+
type Generated,
44
DummyDriver,
55
SqliteAdapter,
66
SqliteIntrospector,
77
SqliteQueryCompiler,
8-
} from '../../dist/esm/index.js'
8+
} from '../../dist/index.js'
99

1010
interface Person {
1111
id: Generated<number>

test/browser/tsconfig.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": ["../../tsconfig-base.json"],
3-
"compilerOptions": {
4-
"rootDir": "."
5-
}
2+
"extends": ["../../tsconfig-base.json"],
3+
"compilerOptions": {
4+
"lib": ["es2023", "dom"],
5+
"rootDir": "."
6+
}
67
}

0 commit comments

Comments
 (0)