@better-auth/cli 1.4.4-beta.1 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +13 -11
  2. package/package.json +9 -9
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
- return {
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][databaseType];
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/cli",
3
- "version": "1.4.4-beta.1",
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",
@@ -25,16 +25,19 @@
25
25
  "better-auth"
26
26
  ],
27
27
  "exports": "./dist/index.mjs",
28
- "bin": "./dist/index.mjs",
28
+ "bin": {
29
+ "better-auth": "./dist/index.mjs"
30
+ },
29
31
  "devDependencies": {
30
32
  "@types/better-sqlite3": "^7.6.13",
31
33
  "@types/prompts": "^2.4.9",
32
34
  "@types/semver": "^7.7.1",
33
- "tsdown": "^0.16.6",
35
+ "jiti": "^2.6.0",
36
+ "tsdown": "^0.16.0",
34
37
  "tsx": "^4.20.6",
35
38
  "type-fest": "^5.2.0",
36
39
  "typescript": "^5.9.3",
37
- "@better-auth/passkey": "1.4.4-beta.1"
40
+ "@better-auth/passkey": "1.4.4-beta.3"
38
41
  },
39
42
  "dependencies": {
40
43
  "@babel/core": "^7.28.4",
@@ -51,19 +54,16 @@
51
54
  "commander": "^12.1.0",
52
55
  "dotenv": "^17.2.2",
53
56
  "drizzle-orm": "^0.33.0",
54
- "get-tsconfig": "^4.10.1",
55
- "jiti": "^2.6.0",
56
57
  "open": "^10.2.0",
57
58
  "pg": "^8.16.3",
58
59
  "prettier": "^3.6.2",
59
60
  "prisma": "^5.22.0",
60
61
  "prompts": "^2.4.2",
61
62
  "semver": "^7.7.2",
62
- "tinyexec": "^0.3.2",
63
63
  "yocto-spinner": "^0.2.3",
64
64
  "zod": "^4.1.12",
65
- "better-auth": "1.4.4-beta.1",
66
- "@better-auth/core": "1.4.4-beta.1"
65
+ "better-auth": "1.4.4-beta.3",
66
+ "@better-auth/core": "1.4.4-beta.3"
67
67
  },
68
68
  "files": [
69
69
  "dist"