@better-auth/cli 1.4.4-beta.2 → 1.4.4-beta.3
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/dist/index.mjs +20 -12
- package/package.json +6 -7
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import * as fs$2 from "node:fs";
|
|
4
|
+
import fs, { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import fs$1 from "node:fs/promises";
|
|
6
|
+
import * as path$1 from "node:path";
|
|
7
|
+
import path from "node:path";
|
|
3
8
|
import { BetterAuthError, capitalizeFirstLetter, createTelemetry, getTelemetryAuthConfig, logger } from "better-auth";
|
|
4
9
|
import { getAdapter, getAuthTables, getMigrations } from "better-auth/db";
|
|
5
10
|
import chalk from "chalk";
|
|
6
|
-
import * as fs$2 from "fs";
|
|
7
|
-
import fs, { existsSync, readFileSync } from "fs";
|
|
8
|
-
import fs$1 from "fs/promises";
|
|
9
|
-
import * as path$1 from "path";
|
|
10
|
-
import path from "path";
|
|
11
11
|
import prompts from "prompts";
|
|
12
12
|
import yoctoSpinner from "yocto-spinner";
|
|
13
13
|
import * as z from "zod/v4";
|
|
@@ -17,13 +17,13 @@ import { produceSchema } from "@mrleebo/prisma-ast";
|
|
|
17
17
|
import babelPresetReact from "@babel/preset-react";
|
|
18
18
|
import babelPresetTypeScript from "@babel/preset-typescript";
|
|
19
19
|
import { loadConfig } from "c12";
|
|
20
|
-
import { exec, execSync } from "child_process";
|
|
21
|
-
import * as os$1 from "os";
|
|
22
|
-
import os from "os";
|
|
20
|
+
import { exec, execSync } from "node:child_process";
|
|
21
|
+
import * as os$1 from "node:os";
|
|
22
|
+
import os from "node:os";
|
|
23
23
|
import { cancel, confirm, intro, isCancel, log, multiselect, outro, select, spinner, text } from "@clack/prompts";
|
|
24
24
|
import { parse } from "dotenv";
|
|
25
25
|
import semver from "semver";
|
|
26
|
-
import Crypto from "crypto";
|
|
26
|
+
import Crypto from "node:crypto";
|
|
27
27
|
import { createAuthClient } from "better-auth/client";
|
|
28
28
|
import { deviceAuthorizationClient } from "better-auth/client/plugins";
|
|
29
29
|
import open from "open";
|
|
@@ -80,7 +80,7 @@ const generateDrizzleSchema = async ({ options, file, adapter }) => {
|
|
|
80
80
|
mysql: `mysqlEnum([${type.map((x) => `'${x}'`).join(", ")}])`
|
|
81
81
|
}[databaseType];
|
|
82
82
|
else throw new TypeError(`Invalid field type for field ${name} in model ${modelName}`);
|
|
83
|
-
|
|
83
|
+
const dbTypeMap = {
|
|
84
84
|
string: {
|
|
85
85
|
sqlite: `text('${name}')`,
|
|
86
86
|
pg: `text('${name}')`,
|
|
@@ -116,7 +116,9 @@ const generateDrizzleSchema = async ({ options, file, adapter }) => {
|
|
|
116
116
|
pg: `jsonb('${name}')`,
|
|
117
117
|
mysql: `json('${name}')`
|
|
118
118
|
}
|
|
119
|
-
}[type]
|
|
119
|
+
}[type];
|
|
120
|
+
if (!dbTypeMap) throw new Error(`Unsupported field type '${field.type}' for field '${name}'.`);
|
|
121
|
+
return dbTypeMap[databaseType];
|
|
120
122
|
}
|
|
121
123
|
let id = "";
|
|
122
124
|
const useNumberId = options.advanced?.database?.useNumberId || options.advanced?.database?.generateId === "serial";
|
|
@@ -748,7 +750,13 @@ let possiblePaths = [
|
|
|
748
750
|
"auth.js",
|
|
749
751
|
"auth.jsx",
|
|
750
752
|
"auth.server.js",
|
|
751
|
-
"auth.server.ts"
|
|
753
|
+
"auth.server.ts",
|
|
754
|
+
"auth/index.ts",
|
|
755
|
+
"auth/index.tsx",
|
|
756
|
+
"auth/index.js",
|
|
757
|
+
"auth/index.jsx",
|
|
758
|
+
"auth/index.server.js",
|
|
759
|
+
"auth/index.server.ts"
|
|
752
760
|
];
|
|
753
761
|
possiblePaths = [
|
|
754
762
|
...possiblePaths,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/cli",
|
|
3
|
-
"version": "1.4.4-beta.
|
|
3
|
+
"version": "1.4.4-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The CLI for Better Auth",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
"@types/better-sqlite3": "^7.6.13",
|
|
33
33
|
"@types/prompts": "^2.4.9",
|
|
34
34
|
"@types/semver": "^7.7.1",
|
|
35
|
+
"jiti": "^2.6.0",
|
|
35
36
|
"tsdown": "^0.16.0",
|
|
36
37
|
"tsx": "^4.20.6",
|
|
37
38
|
"type-fest": "^5.2.0",
|
|
38
39
|
"typescript": "^5.9.3",
|
|
39
|
-
"@better-auth/passkey": "1.4.4-beta.
|
|
40
|
+
"@better-auth/passkey": "1.4.4-beta.3"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@babel/core": "^7.28.4",
|
|
@@ -53,19 +54,16 @@
|
|
|
53
54
|
"commander": "^12.1.0",
|
|
54
55
|
"dotenv": "^17.2.2",
|
|
55
56
|
"drizzle-orm": "^0.33.0",
|
|
56
|
-
"get-tsconfig": "^4.10.1",
|
|
57
|
-
"jiti": "^2.6.0",
|
|
58
57
|
"open": "^10.2.0",
|
|
59
58
|
"pg": "^8.16.3",
|
|
60
59
|
"prettier": "^3.6.2",
|
|
61
60
|
"prisma": "^5.22.0",
|
|
62
61
|
"prompts": "^2.4.2",
|
|
63
62
|
"semver": "^7.7.2",
|
|
64
|
-
"tinyexec": "^0.3.2",
|
|
65
63
|
"yocto-spinner": "^0.2.3",
|
|
66
64
|
"zod": "^4.1.12",
|
|
67
|
-
"better-auth": "1.4.4-beta.
|
|
68
|
-
"@better-auth/core": "1.4.4-beta.
|
|
65
|
+
"better-auth": "1.4.4-beta.3",
|
|
66
|
+
"@better-auth/core": "1.4.4-beta.3"
|
|
69
67
|
},
|
|
70
68
|
"files": [
|
|
71
69
|
"dist"
|
|
@@ -73,6 +71,7 @@
|
|
|
73
71
|
"scripts": {
|
|
74
72
|
"build": "tsdown",
|
|
75
73
|
"start": "node ./dist/index.mjs",
|
|
74
|
+
"lint:package": "publint run --strict",
|
|
76
75
|
"dev": "tsx ./src/index.ts",
|
|
77
76
|
"test": "vitest",
|
|
78
77
|
"typecheck": "tsc --project tsconfig.json"
|