Skip to content

Commit 8a17d1b

Browse files
committed
fix(sdk): publish Node-compatible ESM imports
1 parent 1b1840f commit 8a17d1b

5 files changed

Lines changed: 31 additions & 15 deletions

File tree

sdks/typescript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdks/typescript/package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
{
22
"name": "@absurd-sqlite/sdk",
3-
"version": "0.3.0-alpha.1",
3+
"version": "0.3.0-alpha.2",
44
"description": "TypeScript SDK for Absurd-SQLite - SQLite-based durable task execution",
5+
"type": "module",
56
"main": "dist/index.js",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/index.js",
11+
"require": "./dist/cjs/index.js"
12+
}
13+
},
614
"types": "dist/index.d.ts",
15+
"files": [
16+
"dist",
17+
"README.md"
18+
],
719
"scripts": {
8-
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
20+
"build": "rm -rf dist && tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
921
"type-check": "tsc --noEmit",
1022
"prepare": "npm run build",
1123
"test:prepare": "cd ../../ && cargo build -p absurd-sqlite-extension --release",

sdks/typescript/src/index.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {
88
type TaskHandler,
99
type TaskRegistrationOptions,
1010
type WorkerOptions,
11-
} from "./absurd";
12-
import { SQLiteConnection } from "./sqlite-connection";
11+
} from "./absurd.js";
12+
import { SQLiteConnection } from "./sqlite-connection.js";
1313

1414
// Re-export Temporal from temporal-polyfill
1515
export { Temporal } from "temporal-polyfill";
1616

17-
export type { Queryable } from "./absurd";
17+
export type { Queryable } from "./absurd.js";
1818
export {
1919
CancelledTask,
2020
SuspendTask,
@@ -31,12 +31,12 @@ export {
3131
type TaskHandler,
3232
type TaskRegistrationOptions,
3333
type WorkerOptions,
34-
} from "./absurd";
34+
} from "./absurd.js";
3535
export {
3636
downloadExtension,
3737
resolveExtensionPath,
3838
type DownloadExtensionOptions,
39-
} from "./extension-downloader";
39+
} from "./extension-downloader.js";
4040
export type {
4141
SQLiteBindParams,
4242
SQLiteBindValue,
@@ -45,9 +45,12 @@ export type {
4545
SQLiteRestBindParams,
4646
SQLiteStatement,
4747
SQLiteVerboseLog,
48-
} from "./sqlite-types";
49-
export { SQLiteConnection } from "./sqlite-connection";
50-
export type { SQLiteConnectionOptions, SQLiteValueCodec } from "./sqlite-connection";
48+
} from "./sqlite-types.js";
49+
export { SQLiteConnection } from "./sqlite-connection.js";
50+
export type {
51+
SQLiteConnectionOptions,
52+
SQLiteValueCodec,
53+
} from "./sqlite-connection.js";
5154

5255
/**
5356
* SQLite-specific Absurd client that loads the extension and owns the database handle.

sdks/typescript/src/sqlite-connection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Temporal } from "temporal-polyfill";
2-
import type { Queryable } from "./absurd";
2+
import type { Queryable } from "./absurd.js";
33
import type {
44
SQLiteColumnDefinition,
55
SQLiteDatabase,
66
SQLiteStatement,
77
SQLiteVerboseLog,
88
SQLiteBindValue,
9-
} from "./sqlite-types";
9+
} from "./sqlite-types.js";
1010

1111
/**
1212
* Hooks for encoding parameters and decoding query results.

sdks/typescript/tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"rootDir": "./src",
5-
"moduleResolution": "node"
5+
"module": "NodeNext",
6+
"moduleResolution": "nodenext"
67
},
78
"include": ["src/**/*.ts"],
89
"exclude": ["node_modules", "dist", "test/**/*.ts"]

0 commit comments

Comments
 (0)