From a952ed7d86f7d03c5489715ccc3a30c008ed715a Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 18 Jun 2026 23:34:31 -0700 Subject: [PATCH] Revert type emission and copy with esbuild. Fix exports to make types available for test module. --- esbuild/config.mjs | 5 ++++- package.json | 6 ++++-- tsconfig.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/esbuild/config.mjs b/esbuild/config.mjs index e712a47..958781c 100644 --- a/esbuild/config.mjs +++ b/esbuild/config.mjs @@ -7,7 +7,9 @@ const commonOptions = { bundle: true, loader: { - '.wasm': 'binary' + '.wasm': 'binary', + '.d.ts': 'copy', + '.d.ts.map': 'copy', }, format: 'esm', legalComments: 'inline', @@ -37,6 +39,7 @@ export const nodeOptions = { target: 'node22', entryPoints: [ 'src/*', + 'types/src/*', ], entryNames: '[name]', dropLabels: ['BROWSER'], diff --git a/package.json b/package.json index b1a6372..704fcb3 100644 --- a/package.json +++ b/package.json @@ -54,11 +54,13 @@ }, "./sync": { "types": "./dist/sync.d.ts", - "node": "./dist/sync.js" + "node": "./dist/sync.js", + "import": "./dist/sync.js" }, "./async": { "types": "./dist/async.d.ts", - "node": "./dist/async.js" + "node": "./dist/async.js", + "import": "./dist/async.js" } }, "browser": { diff --git a/tsconfig.json b/tsconfig.json index 0ad3321..96d42b2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "declaration": true, "emitDeclarationOnly": true, "rootDir": ".", - "outDir": "dist", + "outDir": "types", "declarationMap": true, "lib": [ "DOM", -- 2.52.0