@batijs/cli 0.0.679 → 0.0.680
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/{asset-package.json-ZxmvjHsQ.js → asset-package.json-D8gWgpen.js} +1 -1
- package/dist/boilerplates/@batijs/better-auth/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/better-auth/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/better-auth/files/database/drizzle/schema/auth.ts +45 -33
- package/dist/boilerplates/@batijs/better-auth/files/database/migrations/$better-auth.sql.js +3 -0
- package/dist/boilerplates/@batijs/better-auth/types/database/drizzle/schema/auth.d.mts +36 -0
- package/dist/boilerplates/@batijs/react-sentry/files/pages/sentry/+Page.tsx +13 -13
- package/dist/index.js +1 -1
- package/package.json +5 -5
|
@@ -30,7 +30,7 @@ var package_default = {
|
|
|
30
30
|
"postgres": "^3.4.9",
|
|
31
31
|
"tsx": "^4.23.12"
|
|
32
32
|
},
|
|
33
|
-
dependencies: { "better-auth": "^1.
|
|
33
|
+
dependencies: { "better-auth": "^1.7.1" },
|
|
34
34
|
files: ["dist/"],
|
|
35
35
|
exports: {
|
|
36
36
|
"./database/better-auth/migrate": { "types": "./dist/types/database/better-auth/migrate.d.mts" },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { loadPackageJson, packageManager } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/better-auth/dist/files/$package.json.mjs
|
|
5
5
|
async function getPackageJson(props) {
|
|
6
|
-
const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-
|
|
6
|
+
const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-D8gWgpen.js").then((x) => x.default));
|
|
7
7
|
const { BATI } = props.meta;
|
|
8
8
|
packageJson.addDependencies(["better-auth", "@universal-middleware/core"]);
|
|
9
9
|
if (BATI.has("drizzle")) return packageJson;
|
|
@@ -28,7 +28,7 @@ var package_default = {
|
|
|
28
28
|
"postgres": "^3.4.9",
|
|
29
29
|
"tsx": "^4.23.12"
|
|
30
30
|
},
|
|
31
|
-
dependencies: { "better-auth": "^1.
|
|
31
|
+
dependencies: { "better-auth": "^1.7.1" },
|
|
32
32
|
files: ["dist/"],
|
|
33
33
|
exports: {
|
|
34
34
|
"./database/better-auth/migrate": { "types": "./dist/types/database/better-auth/migrate.d.mts" },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* $$.keepFileIfImported */
|
|
2
|
-
import { boolean, pgTable, text as pgText, timestamp } from "drizzle-orm/pg-core";
|
|
3
|
-
import { integer, sqliteTable, text as sqliteText } from "drizzle-orm/sqlite-core";
|
|
2
|
+
import { boolean, pgTable, text as pgText, timestamp, uniqueIndex as pgUniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
+
import { integer, sqliteTable, text as sqliteText, uniqueIndex as sqliteUniqueIndex } from "drizzle-orm/sqlite-core";
|
|
4
4
|
|
|
5
5
|
// Better Auth's tables, owned by Drizzle so its migrations create them.
|
|
6
|
-
// Regenerate with `npx
|
|
6
|
+
// Regenerate with `npx auth generate` if you customize the Better Auth config.
|
|
7
7
|
// Column names are snake_case to match Better Auth's Drizzle adapter defaults.
|
|
8
8
|
|
|
9
9
|
export const user = $$.BATI.has("postgres")
|
|
@@ -48,37 +48,49 @@ export const session = $$.BATI.has("postgres")
|
|
|
48
48
|
userId: sqliteText("user_id").notNull(),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
// Since Better Auth 1.7 account identity is scoped by `issuer`: the column is required and
|
|
52
|
+
// (issuer, accountId) must be unique. https://better-auth.com/docs/guides/1-7-upgrade-guide
|
|
51
53
|
export const account = $$.BATI.has("postgres")
|
|
52
|
-
? pgTable(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
54
|
+
? pgTable(
|
|
55
|
+
"account",
|
|
56
|
+
{
|
|
57
|
+
id: pgText("id").primaryKey(),
|
|
58
|
+
accountId: pgText("account_id").notNull(),
|
|
59
|
+
providerId: pgText("provider_id").notNull(),
|
|
60
|
+
issuer: pgText("issuer").notNull(),
|
|
61
|
+
userId: pgText("user_id").notNull(),
|
|
62
|
+
accessToken: pgText("access_token"),
|
|
63
|
+
refreshToken: pgText("refresh_token"),
|
|
64
|
+
idToken: pgText("id_token"),
|
|
65
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
66
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
67
|
+
scope: pgText("scope"),
|
|
68
|
+
password: pgText("password"),
|
|
69
|
+
createdAt: timestamp("created_at").notNull(),
|
|
70
|
+
updatedAt: timestamp("updated_at").notNull(),
|
|
71
|
+
},
|
|
72
|
+
(table) => [pgUniqueIndex("account_issuer_accountId_uidx").on(table.issuer, table.accountId)],
|
|
73
|
+
)
|
|
74
|
+
: sqliteTable(
|
|
75
|
+
"account",
|
|
76
|
+
{
|
|
77
|
+
id: sqliteText("id").primaryKey(),
|
|
78
|
+
accountId: sqliteText("account_id").notNull(),
|
|
79
|
+
providerId: sqliteText("provider_id").notNull(),
|
|
80
|
+
issuer: sqliteText("issuer").notNull(),
|
|
81
|
+
userId: sqliteText("user_id").notNull(),
|
|
82
|
+
accessToken: sqliteText("access_token"),
|
|
83
|
+
refreshToken: sqliteText("refresh_token"),
|
|
84
|
+
idToken: sqliteText("id_token"),
|
|
85
|
+
accessTokenExpiresAt: integer("access_token_expires_at", { mode: "timestamp_ms" }),
|
|
86
|
+
refreshTokenExpiresAt: integer("refresh_token_expires_at", { mode: "timestamp_ms" }),
|
|
87
|
+
scope: sqliteText("scope"),
|
|
88
|
+
password: sqliteText("password"),
|
|
89
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
90
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
91
|
+
},
|
|
92
|
+
(table) => [sqliteUniqueIndex("account_issuer_accountId_uidx").on(table.issuer, table.accountId)],
|
|
93
|
+
);
|
|
82
94
|
|
|
83
95
|
export const verification = $$.BATI.has("postgres")
|
|
84
96
|
? pgTable("verification", {
|
|
@@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS "account" (
|
|
|
28
28
|
"id" text NOT NULL PRIMARY KEY,
|
|
29
29
|
"accountId" text NOT NULL,
|
|
30
30
|
"providerId" text NOT NULL,
|
|
31
|
+
"issuer" text NOT NULL,
|
|
31
32
|
"userId" text NOT NULL REFERENCES "user" ("id"),
|
|
32
33
|
"accessToken" text,
|
|
33
34
|
"refreshToken" text,
|
|
@@ -40,6 +41,8 @@ CREATE TABLE IF NOT EXISTS "account" (
|
|
|
40
41
|
"updatedAt" date NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
41
42
|
);
|
|
42
43
|
|
|
44
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "account_issuer_accountId_uidx" ON "account" ("issuer", "accountId");
|
|
45
|
+
|
|
43
46
|
CREATE TABLE IF NOT EXISTS "verification" (
|
|
44
47
|
"id" text NOT NULL PRIMARY KEY,
|
|
45
48
|
"identifier" text NOT NULL,
|
|
@@ -608,6 +608,23 @@ declare const account: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
608
608
|
identity: undefined;
|
|
609
609
|
generated: undefined;
|
|
610
610
|
}, {}, {}>;
|
|
611
|
+
issuer: import("drizzle-orm/pg-core").PgColumn<{
|
|
612
|
+
name: "issuer";
|
|
613
|
+
tableName: "account";
|
|
614
|
+
dataType: "string";
|
|
615
|
+
columnType: "PgText";
|
|
616
|
+
data: string;
|
|
617
|
+
driverParam: string;
|
|
618
|
+
notNull: true;
|
|
619
|
+
hasDefault: false;
|
|
620
|
+
isPrimaryKey: false;
|
|
621
|
+
isAutoincrement: false;
|
|
622
|
+
hasRuntimeDefault: false;
|
|
623
|
+
enumValues: [string, ...string[]];
|
|
624
|
+
baseColumn: never;
|
|
625
|
+
identity: undefined;
|
|
626
|
+
generated: undefined;
|
|
627
|
+
}, {}, {}>;
|
|
611
628
|
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
612
629
|
name: "user_id";
|
|
613
630
|
tableName: "account";
|
|
@@ -841,6 +858,25 @@ declare const account: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
841
858
|
}, {}, {
|
|
842
859
|
length: number | undefined;
|
|
843
860
|
}>;
|
|
861
|
+
issuer: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
862
|
+
name: "issuer";
|
|
863
|
+
tableName: "account";
|
|
864
|
+
dataType: "string";
|
|
865
|
+
columnType: "SQLiteText";
|
|
866
|
+
data: string;
|
|
867
|
+
driverParam: string;
|
|
868
|
+
notNull: true;
|
|
869
|
+
hasDefault: false;
|
|
870
|
+
isPrimaryKey: false;
|
|
871
|
+
isAutoincrement: false;
|
|
872
|
+
hasRuntimeDefault: false;
|
|
873
|
+
enumValues: [string, ...string[]];
|
|
874
|
+
baseColumn: never;
|
|
875
|
+
identity: undefined;
|
|
876
|
+
generated: undefined;
|
|
877
|
+
}, {}, {
|
|
878
|
+
length: number | undefined;
|
|
879
|
+
}>;
|
|
844
880
|
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
845
881
|
name: "user_id";
|
|
846
882
|
tableName: "account";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import * as Sentry from "@sentry/react";
|
|
2
|
-
import { useEffect,
|
|
2
|
+
import { useEffect, useSyncExternalStore } from "react";
|
|
3
|
+
|
|
4
|
+
const subscribe = () => () => {};
|
|
3
5
|
|
|
4
6
|
export default function ReactSentryErrorPage() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// Sentry is initialized in the browser only, so read its client via useSyncExternalStore:
|
|
8
|
+
// the server (and hydration) snapshot has no client, and the page re-renders with the real
|
|
9
|
+
// client state right after hydration — without a setState inside an effect.
|
|
10
|
+
const options = useSyncExternalStore(subscribe, () => Sentry?.getClient()?.getOptions(), () => undefined);
|
|
11
|
+
const sentryClientStatus = {
|
|
12
|
+
client_not_loaded: !options,
|
|
13
|
+
dsn_missing: (options?.dsn?.length ?? 0) < 2,
|
|
14
|
+
enabled: options?.enabled ?? true,
|
|
15
|
+
};
|
|
10
16
|
useEffect(() => {
|
|
11
|
-
const options = Sentry?.getClient()?.getOptions();
|
|
12
|
-
setSentryClientStatus({
|
|
13
|
-
client_not_loaded: !options,
|
|
14
|
-
dsn_missing: (options?.dsn?.length ?? 0) < 2,
|
|
15
|
-
enabled: options?.enabled ?? true,
|
|
16
|
-
});
|
|
17
17
|
console.log("Sentry DSN: ", options?.dsn);
|
|
18
|
-
}, []);
|
|
18
|
+
}, [options]);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<>
|
package/dist/index.js
CHANGED
|
@@ -2638,7 +2638,7 @@ function kebabCase(str, joiner) {
|
|
|
2638
2638
|
//#endregion
|
|
2639
2639
|
//#region package.json
|
|
2640
2640
|
var name = "@batijs/cli";
|
|
2641
|
-
var version = "0.0.
|
|
2641
|
+
var version = "0.0.680";
|
|
2642
2642
|
var description = "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want";
|
|
2643
2643
|
//#endregion
|
|
2644
2644
|
//#region rules.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.680",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"check-types": "tsc --noEmit",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"repository": "https://github.com/vikejs/bati",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@batijs/build": "0.0.
|
|
17
|
-
"@batijs/compile": "0.0.
|
|
16
|
+
"@batijs/build": "0.0.680",
|
|
17
|
+
"@batijs/compile": "0.0.680",
|
|
18
18
|
"@inquirer/prompts": "^8.5.2",
|
|
19
19
|
"@types/node": "^20.19.37",
|
|
20
20
|
"@types/which": "^3.0.4",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"vite": "^8.2.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@batijs/core": "0.0.
|
|
34
|
-
"@batijs/features": "0.0.
|
|
33
|
+
"@batijs/core": "0.0.680",
|
|
34
|
+
"@batijs/features": "0.0.680"
|
|
35
35
|
},
|
|
36
36
|
"bin": "./cli.js",
|
|
37
37
|
"exports": {
|