Skip to content

Commit 43d131b

Browse files
committed
Fix PostgreSQL package publishing
Replace workspace and catalog dependency specifiers in the PostgreSQL package metadata with publishable semver ranges so npm consumers can install the package without unsupported protocol errors. Move the Temporal polyfill setup out of tsdown's bundle intro and into runtime source initialization so generated declaration files stay valid for strict TypeScript consumers. Closes #11
1 parent 7e513ea commit 43d131b

4 files changed

Lines changed: 145 additions & 17 deletions

File tree

deno.lock

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

packages/botkit-postgres/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@
4343
"README.md"
4444
],
4545
"peerDependencies": {
46-
"@fedify/botkit": "workspace:"
46+
"@fedify/botkit": "^0.4.0"
4747
},
4848
"dependencies": {
49-
"@fedify/fedify": "catalog:",
50-
"@fedify/vocab": "catalog:",
51-
"@js-temporal/polyfill": "catalog:",
52-
"@logtape/logtape": "catalog:",
49+
"@fedify/fedify": "^2.1.2",
50+
"@fedify/vocab": "^2.1.2",
51+
"@js-temporal/polyfill": "^0.5.1",
52+
"@logtape/logtape": "^1.3.5",
5353
"postgres": "^3.4.8"
5454
},
5555
"devDependencies": {
56-
"tsdown": "catalog:"
56+
"tsdown": "^0.12.8"
5757
},
5858
"scripts": {
5959
"build": "tsdown",

packages/botkit-postgres/src/mod.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type {
2020
Uuid,
2121
} from "@fedify/botkit/repository";
2222
import { exportJwk, importJwk } from "@fedify/fedify/sig";
23+
import { Temporal, toTemporalInstant } from "@js-temporal/polyfill";
2324
import {
2425
Activity,
2526
type Actor,
@@ -32,6 +33,13 @@ import {
3233
import { getLogger } from "@logtape/logtape";
3334
import postgres from "postgres";
3435

36+
if (!("Temporal" in globalThis)) {
37+
Reflect.set(globalThis, "Temporal", Temporal);
38+
}
39+
if (Date.prototype.toTemporalInstant == null) {
40+
Reflect.set(Date.prototype, "toTemporalInstant", toTemporalInstant);
41+
}
42+
3543
const logger = getLogger(["botkit", "postgres"]);
3644
const schemaNamePattern = /^[A-Za-z_][A-Za-z0-9_]*$/;
3745
const followRequestAdvisoryLockNamespace = 0x4254;

packages/botkit-postgres/tsdown.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@ export default defineConfig({
77
},
88
format: "esm",
99
platform: "node",
10-
outputOptions: {
11-
intro: `
12-
import { Temporal, toTemporalInstant } from "@js-temporal/polyfill";
13-
Date.prototype.toTemporalInstant = toTemporalInstant;
14-
`,
15-
},
1610
});

0 commit comments

Comments
 (0)