Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.

Commit 7c45fd6

Browse files
committed
refactor: remove external dependency on drizzle-kit, nanoid and deno_kv_oauth by adding them to deps/
1 parent 8a4102b commit 7c45fd6

File tree

12 files changed

+17
-13
lines changed

12 files changed

+17
-13
lines changed

deno.jsonc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
"react-dom": "npm:[email protected]/compat",
5353
"@preact/signals": "npm:@preact/[email protected]",
5454
"@preact/signals-core": "npm:@preact/[email protected]",
55-
"std/": "https://deno.land/[email protected]/",
56-
"drizzle-orm": "npm:[email protected]",
57-
"deno_kv_oauth/": "https://deno.land/x/[email protected]/"
55+
"std/": "https://deno.land/[email protected]/"
5856
}
5957
}

lib/database/mod.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// see https://github.com/tursodatabase/libsql-client-ts/issues/138#issuecomment-1921954374
33
import { IS_BROWSER } from "fresh/runtime.ts";
44
import { createClient } from "npm:/@libsql/[email protected]";
5-
import { drizzle } from "npm:/drizzle-orm@0.30.10/libsql";
6-
import { drizzle as drizzleSqliteProxy } from "npm:/drizzle-orm@0.30.10/sqlite-proxy";
7-
import type { DrizzleConfig } from "npm:drizzle-orm@0.30.10/utils";
5+
import { drizzle } from "../deps/drizzle-orm/libsql.ts";
6+
import { drizzle as drizzleSqliteProxy } from "../deps/drizzle-orm/sqlite-proxy.ts";
7+
import type { DrizzleConfig } from "../deps/drizzle-orm/utils.ts";
88

99
export { nanoid as id } from "./mod.utils.ts";
1010

lib/database/mod.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// NOTE: reasoning on chosing nanoid for IDs with the following alphabet and size
22
// from https://planetscale.com/blog/why-we-chose-nanoids-for-planetscales-api
3-
import { customAlphabet } from "npm:[email protected]";
3+
import { customAlphabet } from "../deps/nanoid.ts";
44

55
export const ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
66
export const DEFAULT_SIZE = 12;

lib/deps/drizzle-orm/libsql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]/libsql";

lib/deps/drizzle-orm/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]";

lib/deps/drizzle-orm/sqlite-core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]/sqlite-core";

lib/deps/drizzle-orm/sqlite-proxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]/sqlite-proxy";

lib/deps/drizzle-orm/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]/utils";

lib/deps/nanoid.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "npm:[email protected]";

lib/plugins/auth/utils/adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { eq } from "drizzle-orm";
21
import { database, id } from "../../../database/mod.ts";
2+
import { eq } from "../../../deps/drizzle-orm/mod.ts";
33
import type { Auth, AuthUser } from "./types.ts";
44

55
export const createDatabaseAuth = (db: ReturnType<typeof database>): Auth => {

lib/plugins/auth/utils/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// NOTE: the $users and $sessions tables and their relations can be used as
22
// a reference when vendoring them within projects that use the auth plugin.
3-
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
4-
import { customAlphabet } from "nanoid";
3+
import { sqliteTable, text } from "../../../deps/drizzle-orm/sqlite-core.ts";
4+
import { customAlphabet } from "../../../deps/nanoid.ts";
55

66
export const id = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz", 12);
77

lib/plugins/database/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// deno-lint-ignore-file no-explicit-any
22
import type { Plugin, PluginRoute } from "fresh/server.ts";
33
import { createClient } from "npm:@libsql/[email protected]";
4-
import { eq, getTableColumns, SQL, sql } from "npm:[email protected]";
5-
import { SQLiteTable } from "npm:[email protected]/sqlite-core";
6-
import { DrizzleConfig } from "npm:[email protected]/utils";
74
import { database as createDatabase } from "../../database/mod.ts";
5+
import { SQL, eq, getTableColumns, sql } from "../../deps/drizzle-orm/mod.ts";
6+
import { SQLiteTable } from "../../deps/drizzle-orm/sqlite-core.ts";
7+
import { DrizzleConfig } from "../../deps/drizzle-orm/utils.ts";
88
import { apiKeyAuthentication, cors } from "../middleware.ts";
99
import { parseRequestBody } from "../utils.ts";
1010

0 commit comments

Comments
 (0)