Unverified Commit e6352c12 authored by Hong Minhee's avatar Hong Minhee
Browse files

Fix duplicate Temporal import error in @fedify/sqlite

Remove direct import of Temporal from @js-temporal/polyfill in kv.ts
since tsdown already injects the polyfill via outputOptions.intro.
This prevents "Identifier 'Temporal' has already been declared" error
on Node.js and Bun.

Closes https://github.com/fedify-dev/fedify/issues/487



Co-Authored-By: default avatarClaude <noreply@anthropic.com>
parent 8a40b0d9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -8,6 +8,15 @@ Version 1.8.15

To be released.

### @fedify/sqlite

 -  Fixed `SyntaxError: Identifier 'Temporal' has already been declared` error
    that occurred when using `SqliteKvStore` on Node.js or Bun.  The error
    was caused by duplicate `Temporal` imports during the build process.
    [[#487]]

[#487]: https://github.com/fedify-dev/fedify/issues/487


Version 1.8.14
--------------
+0 −2
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@
    "./kv": "./src/kv.ts"
  },
  "imports": {
    "@fedify/sqlite": "./src/mod.ts",
    "@fedify/sqlite/": "./src/",
    "#sqlite": "./src/sqlite.node.ts"
  },
  "exclude": [
+3 −3
Original line number Diff line number Diff line
import { PlatformDatabase } from "#sqlite";
import { SqliteKvStore } from "@fedify/sqlite/kv";
import * as temporal from "@js-temporal/polyfill";
import { delay } from "@std/async/delay";
import assert from "node:assert/strict";
import { test } from "node:test";
import { SqliteKvStore } from "./kv.ts";

let Temporal: typeof temporal.Temporal;
if ("Temporal" in globalThis) {
+5 −6
Original line number Diff line number Diff line
import { type PlatformDatabase, SqliteDatabase } from "#sqlite";
import type { KvKey, KvStore, KvStoreSetOptions } from "@fedify/fedify";
import { Temporal } from "@js-temporal/polyfill";
import { getLogger } from "@logtape/logtape";
import { isEqual } from "es-toolkit";
import type { SqliteDatabaseAdapter } from "./adapter.ts";