better-auth-studio 1.1.2-beta.15 → 1.1.2-beta.17
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.
- package/README.md +38 -25
- package/data/default-geo.json +1 -1
- package/dist/adapters/astro.d.ts +1 -1
- package/dist/adapters/astro.js +13 -13
- package/dist/adapters/elysia.d.ts +2 -2
- package/dist/adapters/elysia.js +13 -13
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +4 -4
- package/dist/adapters/hono.d.ts +2 -2
- package/dist/adapters/hono.js +12 -12
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +10 -10
- package/dist/adapters/nuxt.d.ts +1 -1
- package/dist/adapters/nuxt.js +22 -22
- package/dist/adapters/remix.d.ts +1 -1
- package/dist/adapters/remix.js +13 -13
- package/dist/adapters/solid-start.d.ts +1 -1
- package/dist/adapters/solid-start.js +13 -13
- package/dist/adapters/svelte-kit.d.ts +2 -2
- package/dist/adapters/svelte-kit.js +13 -13
- package/dist/adapters/tanstack-start.d.ts +1 -1
- package/dist/adapters/tanstack-start.js +13 -13
- package/dist/add-svelte-kit-env-modules.js +11 -11
- package/dist/auth-adapter.d.ts +1 -1
- package/dist/auth-adapter.js +96 -96
- package/dist/cli/commands/init.js +57 -57
- package/dist/cli.js +75 -75
- package/dist/config.d.ts +5 -5
- package/dist/config.js +37 -37
- package/dist/core/handler.d.ts +1 -1
- package/dist/core/handler.js +115 -115
- package/dist/data.d.ts +2 -2
- package/dist/data.js +60 -60
- package/dist/geo-service.js +78 -78
- package/dist/get-tsconfig-info.js +4 -4
- package/dist/index.d.ts +8 -8
- package/dist/index.js +6 -6
- package/dist/providers/events/helpers.d.ts +2 -2
- package/dist/providers/events/helpers.js +156 -156
- package/dist/public/assets/{main-Cu8ik7af.js → main-tA7wDMDp.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/routes/api-router.d.ts +2 -2
- package/dist/routes/api-router.js +3 -3
- package/dist/routes.d.ts +4 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +1272 -1272
- package/dist/routes.js.map +1 -1
- package/dist/studio.d.ts +3 -3
- package/dist/studio.js +64 -64
- package/dist/types/events.d.ts +7 -7
- package/dist/types/events.js +165 -165
- package/dist/types/handler.d.ts +5 -5
- package/dist/utils/auth-callbacks-injector.d.ts +2 -2
- package/dist/utils/auth-callbacks-injector.js +27 -27
- package/dist/utils/auth-callbacks-wrapper.d.ts +3 -3
- package/dist/utils/auth-callbacks-wrapper.js +117 -107
- package/dist/utils/database-detection.d.ts +1 -1
- package/dist/utils/database-detection.js +44 -44
- package/dist/utils/database-hook-injector.d.ts +3 -3
- package/dist/utils/database-hook-injector.js +135 -131
- package/dist/utils/email-otp-hooks-injector.d.ts +28 -12
- package/dist/utils/email-otp-hooks-injector.js +104 -97
- package/dist/utils/event-ingestion.d.ts +5 -5
- package/dist/utils/event-ingestion.d.ts.map +1 -1
- package/dist/utils/event-ingestion.js +14 -16
- package/dist/utils/event-ingestion.js.map +1 -1
- package/dist/utils/hook-injector.d.ts +2 -2
- package/dist/utils/hook-injector.js +199 -199
- package/dist/utils/html-injector.d.ts +3 -3
- package/dist/utils/html-injector.js +37 -37
- package/dist/utils/org-hooks-injector.d.ts +3 -3
- package/dist/utils/org-hooks-injector.js +63 -63
- package/dist/utils/org-hooks-wrapper.d.ts +41 -35
- package/dist/utils/org-hooks-wrapper.js +778 -658
- package/dist/utils/organization-hooks-wrapper.d.ts +23 -17
- package/dist/utils/organization-hooks-wrapper.js +325 -277
- package/dist/utils/package-json.js +11 -11
- package/dist/utils/paths.js +1 -1
- package/dist/utils/server-init.d.ts +1 -1
- package/dist/utils/server-init.js +25 -25
- package/dist/utils/session.js +12 -12
- package/dist/utils.js +24 -24
- package/package.json +47 -55
- package/public/assets/{main-Cu8ik7af.js → main-tA7wDMDp.js} +1 -1
- package/public/index.html +1 -1
- package/scripts/download-geolite2.js +8 -8
- package/scripts/generate-default-db.js +324 -324
- package/scripts/postinstall.js +25 -25
package/scripts/postinstall.js
CHANGED
|
@@ -6,47 +6,47 @@
|
|
|
6
6
|
* the public directory isn't extracted properly (e.g., Vercel with pnpm)
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import fs from
|
|
10
|
-
import path from
|
|
11
|
-
import { fileURLToPath } from
|
|
9
|
+
import fs from "fs";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
12
12
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = path.dirname(__filename);
|
|
15
15
|
|
|
16
|
-
const packageRoot = path.resolve(__dirname,
|
|
17
|
-
const distDir = path.join(packageRoot,
|
|
18
|
-
const publicInDist = path.join(distDir,
|
|
19
|
-
const publicInRoot = path.join(packageRoot,
|
|
16
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
17
|
+
const distDir = path.join(packageRoot, "dist");
|
|
18
|
+
const publicInDist = path.join(distDir, "public");
|
|
19
|
+
const publicInRoot = path.join(packageRoot, "public");
|
|
20
20
|
|
|
21
|
-
console.log(
|
|
22
|
-
console.log(
|
|
21
|
+
console.log("[better-auth-studio] Running postinstall...");
|
|
22
|
+
console.log("[better-auth-studio] Package root:", packageRoot);
|
|
23
23
|
|
|
24
24
|
try {
|
|
25
25
|
const packageContents = fs.readdirSync(packageRoot);
|
|
26
|
-
console.log(
|
|
26
|
+
console.log("[better-auth-studio] Package contents:", packageContents.join(", "));
|
|
27
27
|
|
|
28
28
|
if (fs.existsSync(distDir)) {
|
|
29
29
|
const distContents = fs.readdirSync(distDir);
|
|
30
|
-
console.log(
|
|
30
|
+
console.log("[better-auth-studio] dist/ contents:", distContents.join(", "));
|
|
31
31
|
} else {
|
|
32
|
-
console.log(
|
|
32
|
+
console.log("[better-auth-studio] dist/ directory does not exist");
|
|
33
33
|
}
|
|
34
34
|
} catch (err) {
|
|
35
|
-
console.warn(
|
|
35
|
+
console.warn("[better-auth-studio] Could not list package contents:", err.message);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// Check if either public directory exists
|
|
39
39
|
const hasPublicInDist =
|
|
40
|
-
fs.existsSync(publicInDist) && fs.existsSync(path.join(publicInDist,
|
|
40
|
+
fs.existsSync(publicInDist) && fs.existsSync(path.join(publicInDist, "index.html"));
|
|
41
41
|
const hasPublicInRoot =
|
|
42
|
-
fs.existsSync(publicInRoot) && fs.existsSync(path.join(publicInRoot,
|
|
42
|
+
fs.existsSync(publicInRoot) && fs.existsSync(path.join(publicInRoot, "index.html"));
|
|
43
43
|
|
|
44
|
-
console.log(
|
|
45
|
-
console.log(
|
|
46
|
-
console.log(
|
|
44
|
+
console.log("[better-auth-studio] Checking public directories...");
|
|
45
|
+
console.log("[better-auth-studio] - dist/public exists:", hasPublicInDist);
|
|
46
|
+
console.log("[better-auth-studio] - public/ exists:", hasPublicInRoot);
|
|
47
47
|
|
|
48
48
|
if (hasPublicInDist || hasPublicInRoot) {
|
|
49
|
-
console.log(
|
|
49
|
+
console.log("[better-auth-studio] ✓ Public directory found");
|
|
50
50
|
|
|
51
51
|
// Ensure both locations have the public files for maximum compatibility
|
|
52
52
|
if (hasPublicInRoot && !hasPublicInDist) {
|
|
@@ -55,24 +55,24 @@ if (hasPublicInDist || hasPublicInRoot) {
|
|
|
55
55
|
fs.mkdirSync(distDir, { recursive: true });
|
|
56
56
|
}
|
|
57
57
|
copyRecursive(publicInRoot, publicInDist);
|
|
58
|
-
console.log(
|
|
58
|
+
console.log("[better-auth-studio] ✓ Copied public/ to dist/public/");
|
|
59
59
|
} catch (err) {
|
|
60
|
-
console.warn(
|
|
60
|
+
console.warn("[better-auth-studio] Warning: Could not copy to dist/public:", err.message);
|
|
61
61
|
}
|
|
62
62
|
} else if (hasPublicInDist && !hasPublicInRoot) {
|
|
63
63
|
try {
|
|
64
64
|
copyRecursive(publicInDist, publicInRoot);
|
|
65
|
-
console.log(
|
|
65
|
+
console.log("[better-auth-studio] ✓ Copied dist/public/ to public/");
|
|
66
66
|
} catch (err) {
|
|
67
|
-
console.warn(
|
|
67
|
+
console.warn("[better-auth-studio] Warning: Could not copy to public:", err.message);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
} else {
|
|
71
71
|
console.warn(
|
|
72
|
-
|
|
72
|
+
"[better-auth-studio] ⚠ Warning: Public directory not found. Studio UI may not work correctly.",
|
|
73
73
|
);
|
|
74
74
|
console.warn(
|
|
75
|
-
|
|
75
|
+
"[better-auth-studio] Please report this issue at: https://github.com/Kinfe123/better-auth-studio/issues",
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
|