Skip to content

Commit 89798a4

Browse files
committed
🐞 fix: use correct pothos references
1 parent 2a5e9ff commit 89798a4

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

β€Žbuild.tsβ€Ž

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { exists, mkdir, readFile, rm, writeFile } from "node:fs/promises";
1+
import {
2+
exists,
3+
mkdir,
4+
readFile,
5+
readdir,
6+
rm,
7+
writeFile,
8+
} from "node:fs/promises";
29
import { join } from "node:path";
310
import { build } from "tsup";
411
import packagejson from "./package.json";
@@ -29,6 +36,27 @@ await build({
2936
splitting: true,
3037
});
3138

39+
// ==============================
40+
// Correct pothos reference
41+
// ==============================
42+
43+
// iterate through all d.ts file of the output
44+
console.info("Correcting pothos reference...");
45+
for (const file of await readdir(outDir)) {
46+
if (!file.endsWith(".d.ts")) {
47+
continue;
48+
}
49+
const content = (await readFile(join(outDir, file))).toString();
50+
await writeFile(
51+
join(outDir, file),
52+
content.replace(
53+
"declare const drizzleTableKey: unique symbol;",
54+
'import { drizzleTableKey } from "@pothos/plugin-drizzle"',
55+
),
56+
);
57+
}
58+
console.info("Corrected pothos reference!");
59+
3260
// ==============================
3361
// Create package.json
3462
// ==============================

β€Žlib/abilities/builder.tsβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { SQL, or } from "drizzle-orm";
2-
import type { ExcludeFromUnionIfNotOnlyType } from "../helpers/unionTypeExclude";
3-
import type { ExcludeFirst } from "../helpers/unionTypeExtractor";
1+
import { or } from "drizzle-orm";
42
import type {
53
GenericDrizzleDbTypeConstraints,
64
QueryConditionObject,

β€Žlib/gql/builder.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SchemaBuilder, { FieldRef } from "@pothos/core";
1+
import SchemaBuilder from "@pothos/core";
22
import DrizzlePlugin from "@pothos/plugin-drizzle";
33
import { type YogaServerOptions, createYoga } from "graphql-yoga";
44
import { createAbilityBuilder } from "../abilities/builder";

0 commit comments

Comments
Β (0)