opacacms 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAuth,
3
3
  sanitizeConfig
4
- } from "./chunk-dy5t83hr.js";
4
+ } from "./chunk-b5qdy72a.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-62ev8gnc.js";
@@ -2,15 +2,11 @@ import {
2
2
  getSystemCollections,
3
3
  init_system_schema
4
4
  } from "./chunk-ybbbqj63.js";
5
- import {
6
- __require
7
- } from "./chunk-8sqjbsgt.js";
8
5
 
9
6
  // src/auth/index.ts
10
7
  import { apiKey } from "@better-auth/api-key";
11
8
  import { betterAuth } from "better-auth";
12
9
  import { admin } from "better-auth/plugins";
13
- import { CamelCasePlugin } from "kysely";
14
10
 
15
11
  // src/auth/premissions.ts
16
12
  import { createAccessControl } from "better-auth/plugins/access";
@@ -66,32 +62,16 @@ async function createAuth(config) {
66
62
  process.env.BETTER_AUTH_URL = authURL;
67
63
  }
68
64
  let databaseConfig;
69
- if (config.db.name === "postgres" && rawDb) {
70
- const { PostgresJSDialect } = await import("kysely-postgres-js");
71
- const { Kysely } = await import("kysely");
72
- const kysely = new Kysely({
73
- dialect: new PostgresJSDialect({ postgres: rawDb }),
74
- plugins: [new CamelCasePlugin]
75
- });
76
- databaseConfig = {
77
- db: kysely,
78
- type: "pg"
79
- };
80
- } else if (config.db.name === "d1" && rawDb) {
81
- const { D1Dialect } = await import("kysely-d1");
82
- const { Kysely } = await import("kysely");
83
- const kysely = new Kysely({
84
- dialect: new D1Dialect({ database: rawDb }),
85
- plugins: [new CamelCasePlugin]
86
- });
65
+ const kysely = config.db.db;
66
+ if (kysely && typeof kysely.selectFrom === "function") {
87
67
  databaseConfig = {
88
68
  db: kysely,
89
- type: "sqlite"
69
+ type: config.db.name === "postgres" ? "pg" : "sqlite"
90
70
  };
91
71
  } else {
92
72
  databaseConfig = {
93
73
  db: rawDb,
94
- type: "sqlite"
74
+ type: config.db.name === "postgres" ? "pg" : "sqlite"
95
75
  };
96
76
  }
97
77
  const isSecure = baseURL.startsWith("https");
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  createAuth,
10
10
  sanitizeConfig
11
- } from "./chunk-dy5t83hr.js";
11
+ } from "./chunk-b5qdy72a.js";
12
12
  import"./chunk-ybbbqj63.js";
13
13
  import"./chunk-8sqjbsgt.js";
14
14
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-6typkt16.js";
4
- import"../chunk-dy5t83hr.js";
3
+ } from "../chunk-9rqm0emy.js";
4
+ import"../chunk-b5qdy72a.js";
5
5
  import"../chunk-62ev8gnc.js";
6
6
  import"../chunk-2kyhqvhc.js";
7
7
  import"../chunk-ybbbqj63.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-6typkt16.js";
4
- import"../chunk-dy5t83hr.js";
3
+ } from "../chunk-9rqm0emy.js";
4
+ import"../chunk-b5qdy72a.js";
5
5
  import"../chunk-62ev8gnc.js";
6
6
  import"../chunk-2kyhqvhc.js";
7
7
  import"../chunk-ybbbqj63.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-6typkt16.js";
4
- import"../chunk-dy5t83hr.js";
3
+ } from "../chunk-9rqm0emy.js";
4
+ import"../chunk-b5qdy72a.js";
5
5
  import"../chunk-62ev8gnc.js";
6
6
  import"../chunk-2kyhqvhc.js";
7
7
  import"../chunk-ybbbqj63.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-6typkt16.js";
4
- import"../chunk-dy5t83hr.js";
3
+ } from "../chunk-9rqm0emy.js";
4
+ import"../chunk-b5qdy72a.js";
5
5
  import"../chunk-62ev8gnc.js";
6
6
  import"../chunk-2kyhqvhc.js";
7
7
  import"../chunk-ybbbqj63.js";
package/dist/server.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  createGlobalHandlers,
5
5
  createHandlers,
6
6
  hydrateDoc
7
- } from "./chunk-6typkt16.js";
7
+ } from "./chunk-9rqm0emy.js";
8
8
  import {
9
9
  defineConfig
10
10
  } from "./chunk-zvwb67nd.js";
11
- import"./chunk-dy5t83hr.js";
11
+ import"./chunk-b5qdy72a.js";
12
12
  import {
13
13
  BaseDatabaseAdapter
14
14
  } from "./chunk-s8mqwnm1.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opacacms",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "scripts": {
5
5
  "build": "bun run ../../scripts/build.ts && tsc --emitDeclarationOnly",
6
6
  "build:publish": "bun run ../../scripts/build.ts --publish && tsc --emitDeclarationOnly",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "exports": {
30
30
  "./styles.css": {
31
- "import": "./src/admin.css"
31
+ "import": "./dist/admin.css"
32
32
  },
33
33
  ".": {
34
34
  "types": "./dist/index.d.ts",