Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdks/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
{
"name": "@absurd-sqlite/sdk",
"version": "0.3.0-alpha.1",
"version": "0.3.0-alpha.2",
"description": "TypeScript SDK for Absurd-SQLite - SQLite-based durable task execution",
"type": "module",
"main": "dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
}
},
Comment on lines +5 to +13

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runtime behavior change (adding type: module + an exports map to fix Node ESM loading) isn’t currently covered by automated tests. Consider adding a smoke test that builds (or uses prebuilt fixtures) and spawns a real node process to import('@absurd-sqlite/sdk') (and optionally require(...)) to prevent regressions in published entrypoints.

Copilot uses AI. Check for mistakes.
"types": "dist/index.d.ts",
"files": [
"dist",
"README.md"

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new files allowlist omits LICENSE, so the published npm tarball will no longer include the license text even though the repo contains sdks/typescript/LICENSE. Consider adding LICENSE to the files array (or removing files if you want npm’s default include behavior).

Suggested change
"README.md"
"README.md",
"LICENSE"

Copilot uses AI. Check for mistakes.
],
"scripts": {
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"build": "rm -rf dist && tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf dist (and the shell redirection/quoting used to write dist/cjs/package.json) is POSIX-shell specific and will fail under Windows’ default npm script shell. If this package is expected to build cross-platform, switch to a Node-based clean/write step (e.g., fs.rmSync / fs.writeFileSync) or a cross-platform tool like rimraf.

Suggested change
"build": "rm -rf dist && tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"build": "node -e \"require(\\\"fs\\\").rmSync(\\\"dist\\\", { recursive: true, force: true })\" && tsc --project tsconfig.build.json && tsc --project tsconfig.cjs.json && node -e \"const fs = require(\\\"fs\\\"); fs.mkdirSync(\\\"dist/cjs\\\", { recursive: true }); fs.writeFileSync(\\\"dist/cjs/package.json\\\", JSON.stringify({ type: \\\"commonjs\\\" }));\"",

Copilot uses AI. Check for mistakes.
"type-check": "tsc --noEmit",
"prepare": "npm run build",
"test:prepare": "cd ../../ && cargo build -p absurd-sqlite-extension --release",
Expand Down
19 changes: 11 additions & 8 deletions sdks/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
type TaskHandler,
type TaskRegistrationOptions,
type WorkerOptions,
} from "./absurd";
import { SQLiteConnection } from "./sqlite-connection";
} from "./absurd.js";
import { SQLiteConnection } from "./sqlite-connection.js";

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

export type { Queryable } from "./absurd";
export type { Queryable } from "./absurd.js";
export {
CancelledTask,
SuspendTask,
Expand All @@ -31,12 +31,12 @@ export {
type TaskHandler,
type TaskRegistrationOptions,
type WorkerOptions,
} from "./absurd";
} from "./absurd.js";
export {
downloadExtension,
resolveExtensionPath,
type DownloadExtensionOptions,
} from "./extension-downloader";
} from "./extension-downloader.js";
export type {
SQLiteBindParams,
SQLiteBindValue,
Expand All @@ -45,9 +45,12 @@ export type {
SQLiteRestBindParams,
SQLiteStatement,
SQLiteVerboseLog,
} from "./sqlite-types";
export { SQLiteConnection } from "./sqlite-connection";
export type { SQLiteConnectionOptions, SQLiteValueCodec } from "./sqlite-connection";
} from "./sqlite-types.js";
export { SQLiteConnection } from "./sqlite-connection.js";
export type {
SQLiteConnectionOptions,
SQLiteValueCodec,
} from "./sqlite-connection.js";

/**
* SQLite-specific Absurd client that loads the extension and owns the database handle.
Expand Down
4 changes: 2 additions & 2 deletions sdks/typescript/src/sqlite-connection.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Temporal } from "temporal-polyfill";
import type { Queryable } from "./absurd";
import type { Queryable } from "./absurd.js";
import type {
SQLiteColumnDefinition,
SQLiteDatabase,
SQLiteStatement,
SQLiteVerboseLog,
SQLiteBindValue,
} from "./sqlite-types";
} from "./sqlite-types.js";

/**
* Hooks for encoding parameters and decoding query results.
Expand Down
3 changes: 2 additions & 1 deletion sdks/typescript/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"moduleResolution": "node"
"module": "NodeNext",
"moduleResolution": "nodenext"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist", "test/**/*.ts"]
Expand Down
Loading