@batijs/cli 0.0.443 → 0.0.445
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/boilerplates/@batijs/auth0/files/$.env.js +5 -5
- package/dist/boilerplates/@batijs/auth0/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +9 -9
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/d1/files/$wrangler.toml.js +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +6 -12
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +4 -16
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/eslint/files/eslint.config.ts +5 -5
- package/dist/boilerplates/@batijs/express/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/express/files/express-entry.ts +0 -24
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/fastify/files/fastify-entry.ts +0 -24
- package/dist/boilerplates/@batijs/firebase-auth/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/firebase-auth/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/h3/files/h3-entry.ts +0 -24
- package/dist/boilerplates/@batijs/hattip/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/hattip/files/hattip-entry.ts +0 -24
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/hono/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +0 -24
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/panda-css/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +3 -3
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/prisma/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/react/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$package.json.js +9 -9
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/react/files/layouts/LayoutDefault.tsx +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +7 -7
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +9 -9
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/solid/files/layouts/LayoutDefault.tsx +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/sqlite/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +5 -17
- package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/all.ts +0 -2
- package/dist/boilerplates/@batijs/sqlite/types/database/sqlite/schema/all.d.ts +0 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
- package/dist/boilerplates/@batijs/trpc/types/trpc/server.d.ts +8 -8
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/vercel/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +6 -6
- package/dist/boilerplates/@batijs/vue/files/layouts/LayoutDefault.vue +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +5 -5
- package/dist/boilerplates/boilerplates.json +0 -59
- package/dist/{chunk-4WNEELKU.js → chunk-YO6CY4MA.js} +53461 -53354
- package/dist/index.js +63 -92
- package/package.json +6 -6
- package/dist/boilerplates/@batijs/d1-sqlite/files/database/d1/queries/lucia-auth.ts +0 -29
- package/dist/boilerplates/@batijs/d1-sqlite/files/database/migrations/lucia-auth.sql +0 -20
- package/dist/boilerplates/@batijs/d1-sqlite/types/database/d1/queries/lucia-auth.d.ts +0 -5
- package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/queries/lucia-auth.ts +0 -56
- package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/schema/lucia-auth.ts +0 -41
- package/dist/boilerplates/@batijs/drizzle/types/database/drizzle/queries/lucia-auth.d.ts +0 -25
- package/dist/boilerplates/@batijs/drizzle/types/database/drizzle/schema/lucia-auth.d.ts +0 -190
- package/dist/boilerplates/@batijs/lucia-auth/files/$.env.js +0 -32
- package/dist/boilerplates/@batijs/lucia-auth/files/$README.md.js +0 -38
- package/dist/boilerplates/@batijs/lucia-auth/files/$package.json.js +0 -113
- package/dist/boilerplates/@batijs/lucia-auth/files/global.d.ts +0 -11
- package/dist/boilerplates/@batijs/lucia-auth/files/lib/lucia-auth.ts +0 -136
- package/dist/boilerplates/@batijs/lucia-auth/files/pages/login/+guard.ts +0 -11
- package/dist/boilerplates/@batijs/lucia-auth/files/pages/login/style.css +0 -94
- package/dist/boilerplates/@batijs/lucia-auth/files/server/lucia-auth-handlers.ts +0 -401
- package/dist/boilerplates/@batijs/lucia-auth/types/lib/lucia-auth.d.ts +0 -63
- package/dist/boilerplates/@batijs/lucia-auth/types/pages/login/+guard.d.ts +0 -3
- package/dist/boilerplates/@batijs/lucia-auth/types/server/lucia-auth-handlers.d.ts +0 -65
- package/dist/boilerplates/@batijs/react-lucia-auth/files/pages/login/+Page.tsx +0 -97
- package/dist/boilerplates/@batijs/react-lucia-auth/types/pages/login/+Page.d.ts +0 -2
- package/dist/boilerplates/@batijs/solid-lucia-auth/files/pages/login/+Page.tsx +0 -97
- package/dist/boilerplates/@batijs/solid-lucia-auth/types/pages/login/+Page.d.ts +0 -2
- package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/queries/lucia-auth.ts +0 -27
- package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/lucia-auth.ts +0 -32
- package/dist/boilerplates/@batijs/sqlite/types/database/sqlite/queries/lucia-auth.d.ts +0 -5
- package/dist/boilerplates/@batijs/sqlite/types/database/sqlite/schema/lucia-auth.d.ts +0 -1
- package/dist/boilerplates/@batijs/vue-lucia-auth/files/pages/login/+Page.vue +0 -88
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*# BATI include-if-imported #*/
|
|
2
|
-
import { int, integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
3
|
-
|
|
4
|
-
export const userTable = sqliteTable("users", {
|
|
5
|
-
id: text("id").notNull().primaryKey(),
|
|
6
|
-
username: text("username").notNull().unique(),
|
|
7
|
-
password: text("password"),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const oauthAccountTable = sqliteTable(
|
|
11
|
-
"oauth_accounts",
|
|
12
|
-
{
|
|
13
|
-
providerId: text("provider_id").notNull(),
|
|
14
|
-
providerUserId: int("provider_user_id").notNull(),
|
|
15
|
-
userId: text("user_id")
|
|
16
|
-
.notNull()
|
|
17
|
-
.references(() => userTable.id, {
|
|
18
|
-
onUpdate: "cascade",
|
|
19
|
-
onDelete: "cascade",
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
(table) => {
|
|
23
|
-
return {
|
|
24
|
-
pk: primaryKey({ columns: [table.providerId, table.providerUserId] }),
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export const sessionTable = sqliteTable("sessions", {
|
|
30
|
-
id: text("id").notNull().primaryKey(),
|
|
31
|
-
userId: text("user_id")
|
|
32
|
-
.notNull()
|
|
33
|
-
.references(() => userTable.id, {
|
|
34
|
-
onUpdate: "cascade",
|
|
35
|
-
onDelete: "cascade",
|
|
36
|
-
}),
|
|
37
|
-
expiresAt: integer("expires_at").notNull(),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export type UserItem = typeof userTable.$inferSelect;
|
|
41
|
-
export type UserInsert = typeof userTable.$inferInsert;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { dbD1, dbSqlite } from "../db";
|
|
2
|
-
export declare function getExistingUser(db: BATI.If<{
|
|
3
|
-
"!BATI.hasD1": ReturnType<typeof dbSqlite>;
|
|
4
|
-
_: ReturnType<typeof dbD1>;
|
|
5
|
-
}>, username: string): Promise<{
|
|
6
|
-
id: string;
|
|
7
|
-
username: string;
|
|
8
|
-
password: string | null;
|
|
9
|
-
} | undefined>;
|
|
10
|
-
export declare function getExistingAccount(db: BATI.If<{
|
|
11
|
-
"!BATI.hasD1": ReturnType<typeof dbSqlite>;
|
|
12
|
-
_: ReturnType<typeof dbD1>;
|
|
13
|
-
}>, providerId: string, providerUserId: number): Promise<{
|
|
14
|
-
providerId: string;
|
|
15
|
-
providerUserId: number;
|
|
16
|
-
userId: string;
|
|
17
|
-
} | undefined>;
|
|
18
|
-
export declare function signupWithGithub(db: BATI.If<{
|
|
19
|
-
"!BATI.hasD1": ReturnType<typeof dbSqlite>;
|
|
20
|
-
_: ReturnType<typeof dbD1>;
|
|
21
|
-
}>, userId: string, username: string, githubUserId: number): Promise<void>;
|
|
22
|
-
export declare function signupWithCredentials(db: BATI.If<{
|
|
23
|
-
"!BATI.hasD1": ReturnType<typeof dbSqlite>;
|
|
24
|
-
_: ReturnType<typeof dbD1>;
|
|
25
|
-
}>, userId: string, username: string, passwordHash: string): Promise<import("better-sqlite3").RunResult>;
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
export declare const userTable: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
-
name: "users";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
-
name: "id";
|
|
7
|
-
tableName: "users";
|
|
8
|
-
dataType: "string";
|
|
9
|
-
columnType: "SQLiteText";
|
|
10
|
-
data: string;
|
|
11
|
-
driverParam: string;
|
|
12
|
-
notNull: true;
|
|
13
|
-
hasDefault: false;
|
|
14
|
-
isPrimaryKey: true;
|
|
15
|
-
isAutoincrement: false;
|
|
16
|
-
hasRuntimeDefault: false;
|
|
17
|
-
enumValues: [string, ...string[]];
|
|
18
|
-
baseColumn: never;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}, {}, {
|
|
22
|
-
length: number | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
username: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
25
|
-
name: "username";
|
|
26
|
-
tableName: "users";
|
|
27
|
-
dataType: "string";
|
|
28
|
-
columnType: "SQLiteText";
|
|
29
|
-
data: string;
|
|
30
|
-
driverParam: string;
|
|
31
|
-
notNull: true;
|
|
32
|
-
hasDefault: false;
|
|
33
|
-
isPrimaryKey: false;
|
|
34
|
-
isAutoincrement: false;
|
|
35
|
-
hasRuntimeDefault: false;
|
|
36
|
-
enumValues: [string, ...string[]];
|
|
37
|
-
baseColumn: never;
|
|
38
|
-
identity: undefined;
|
|
39
|
-
generated: undefined;
|
|
40
|
-
}, {}, {
|
|
41
|
-
length: number | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
password: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
|
-
name: "password";
|
|
45
|
-
tableName: "users";
|
|
46
|
-
dataType: "string";
|
|
47
|
-
columnType: "SQLiteText";
|
|
48
|
-
data: string;
|
|
49
|
-
driverParam: string;
|
|
50
|
-
notNull: false;
|
|
51
|
-
hasDefault: false;
|
|
52
|
-
isPrimaryKey: false;
|
|
53
|
-
isAutoincrement: false;
|
|
54
|
-
hasRuntimeDefault: false;
|
|
55
|
-
enumValues: [string, ...string[]];
|
|
56
|
-
baseColumn: never;
|
|
57
|
-
identity: undefined;
|
|
58
|
-
generated: undefined;
|
|
59
|
-
}, {}, {
|
|
60
|
-
length: number | undefined;
|
|
61
|
-
}>;
|
|
62
|
-
};
|
|
63
|
-
dialect: "sqlite";
|
|
64
|
-
}>;
|
|
65
|
-
export declare const oauthAccountTable: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
66
|
-
name: "oauth_accounts";
|
|
67
|
-
schema: undefined;
|
|
68
|
-
columns: {
|
|
69
|
-
providerId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
70
|
-
name: "provider_id";
|
|
71
|
-
tableName: "oauth_accounts";
|
|
72
|
-
dataType: "string";
|
|
73
|
-
columnType: "SQLiteText";
|
|
74
|
-
data: string;
|
|
75
|
-
driverParam: string;
|
|
76
|
-
notNull: true;
|
|
77
|
-
hasDefault: false;
|
|
78
|
-
isPrimaryKey: false;
|
|
79
|
-
isAutoincrement: false;
|
|
80
|
-
hasRuntimeDefault: false;
|
|
81
|
-
enumValues: [string, ...string[]];
|
|
82
|
-
baseColumn: never;
|
|
83
|
-
identity: undefined;
|
|
84
|
-
generated: undefined;
|
|
85
|
-
}, {}, {
|
|
86
|
-
length: number | undefined;
|
|
87
|
-
}>;
|
|
88
|
-
providerUserId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
89
|
-
name: "provider_user_id";
|
|
90
|
-
tableName: "oauth_accounts";
|
|
91
|
-
dataType: "number";
|
|
92
|
-
columnType: "SQLiteInteger";
|
|
93
|
-
data: number;
|
|
94
|
-
driverParam: number;
|
|
95
|
-
notNull: true;
|
|
96
|
-
hasDefault: false;
|
|
97
|
-
isPrimaryKey: false;
|
|
98
|
-
isAutoincrement: false;
|
|
99
|
-
hasRuntimeDefault: false;
|
|
100
|
-
enumValues: undefined;
|
|
101
|
-
baseColumn: never;
|
|
102
|
-
identity: undefined;
|
|
103
|
-
generated: undefined;
|
|
104
|
-
}, {}, {}>;
|
|
105
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
106
|
-
name: "user_id";
|
|
107
|
-
tableName: "oauth_accounts";
|
|
108
|
-
dataType: "string";
|
|
109
|
-
columnType: "SQLiteText";
|
|
110
|
-
data: string;
|
|
111
|
-
driverParam: string;
|
|
112
|
-
notNull: true;
|
|
113
|
-
hasDefault: false;
|
|
114
|
-
isPrimaryKey: false;
|
|
115
|
-
isAutoincrement: false;
|
|
116
|
-
hasRuntimeDefault: false;
|
|
117
|
-
enumValues: [string, ...string[]];
|
|
118
|
-
baseColumn: never;
|
|
119
|
-
identity: undefined;
|
|
120
|
-
generated: undefined;
|
|
121
|
-
}, {}, {
|
|
122
|
-
length: number | undefined;
|
|
123
|
-
}>;
|
|
124
|
-
};
|
|
125
|
-
dialect: "sqlite";
|
|
126
|
-
}>;
|
|
127
|
-
export declare const sessionTable: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
128
|
-
name: "sessions";
|
|
129
|
-
schema: undefined;
|
|
130
|
-
columns: {
|
|
131
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
132
|
-
name: "id";
|
|
133
|
-
tableName: "sessions";
|
|
134
|
-
dataType: "string";
|
|
135
|
-
columnType: "SQLiteText";
|
|
136
|
-
data: string;
|
|
137
|
-
driverParam: string;
|
|
138
|
-
notNull: true;
|
|
139
|
-
hasDefault: false;
|
|
140
|
-
isPrimaryKey: true;
|
|
141
|
-
isAutoincrement: false;
|
|
142
|
-
hasRuntimeDefault: false;
|
|
143
|
-
enumValues: [string, ...string[]];
|
|
144
|
-
baseColumn: never;
|
|
145
|
-
identity: undefined;
|
|
146
|
-
generated: undefined;
|
|
147
|
-
}, {}, {
|
|
148
|
-
length: number | undefined;
|
|
149
|
-
}>;
|
|
150
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
151
|
-
name: "user_id";
|
|
152
|
-
tableName: "sessions";
|
|
153
|
-
dataType: "string";
|
|
154
|
-
columnType: "SQLiteText";
|
|
155
|
-
data: string;
|
|
156
|
-
driverParam: string;
|
|
157
|
-
notNull: true;
|
|
158
|
-
hasDefault: false;
|
|
159
|
-
isPrimaryKey: false;
|
|
160
|
-
isAutoincrement: false;
|
|
161
|
-
hasRuntimeDefault: false;
|
|
162
|
-
enumValues: [string, ...string[]];
|
|
163
|
-
baseColumn: never;
|
|
164
|
-
identity: undefined;
|
|
165
|
-
generated: undefined;
|
|
166
|
-
}, {}, {
|
|
167
|
-
length: number | undefined;
|
|
168
|
-
}>;
|
|
169
|
-
expiresAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
170
|
-
name: "expires_at";
|
|
171
|
-
tableName: "sessions";
|
|
172
|
-
dataType: "number";
|
|
173
|
-
columnType: "SQLiteInteger";
|
|
174
|
-
data: number;
|
|
175
|
-
driverParam: number;
|
|
176
|
-
notNull: true;
|
|
177
|
-
hasDefault: false;
|
|
178
|
-
isPrimaryKey: false;
|
|
179
|
-
isAutoincrement: false;
|
|
180
|
-
hasRuntimeDefault: false;
|
|
181
|
-
enumValues: undefined;
|
|
182
|
-
baseColumn: never;
|
|
183
|
-
identity: undefined;
|
|
184
|
-
generated: undefined;
|
|
185
|
-
}, {}, {}>;
|
|
186
|
-
};
|
|
187
|
-
dialect: "sqlite";
|
|
188
|
-
}>;
|
|
189
|
-
export type UserItem = typeof userTable.$inferSelect;
|
|
190
|
-
export type UserInsert = typeof userTable.$inferInsert;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
ata
|
|
7
|
-
} from "../../../../chunk-4WNEELKU.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/lucia-auth/dist/files/$.env.js
|
|
12
|
-
async function getEnv(props) {
|
|
13
|
-
const githubClientId = process.env.TEST_GITHUB_CLIENT_ID;
|
|
14
|
-
const githubClientSecret = process.env.TEST_GITHUB_CLIENT_SECRET;
|
|
15
|
-
let envContent = await props.readfile?.();
|
|
16
|
-
envContent = ata(
|
|
17
|
-
envContent,
|
|
18
|
-
"GITHUB_CLIENT_ID",
|
|
19
|
-
githubClientId ?? "",
|
|
20
|
-
"GitHub Client ID. Used for authentication"
|
|
21
|
-
);
|
|
22
|
-
envContent = ata(
|
|
23
|
-
envContent,
|
|
24
|
-
"GITHUB_CLIENT_SECRET",
|
|
25
|
-
githubClientSecret ?? "",
|
|
26
|
-
"GitHub Client Secret. Used for authentication"
|
|
27
|
-
);
|
|
28
|
-
return envContent;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
getEnv as default
|
|
32
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Wea
|
|
7
|
-
} from "../../../../chunk-4WNEELKU.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/lucia-auth/dist/files/$README.md.js
|
|
12
|
-
async function getReadme(props) {
|
|
13
|
-
const content = await Wea(props);
|
|
14
|
-
const todo = `
|
|
15
|
-
## *Example: Lucia Auth with GitHub OAuth*
|
|
16
|
-
- Create a [GitHub OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app). Set the Authorization callback URL to \`http://localhost:3000/api/login/github/callback\`.
|
|
17
|
-
- Copy your \`Client ID\` and \`Client Secret\` then paste it in \`.env\` file like this:
|
|
18
|
-
|
|
19
|
-
\`\`\`env
|
|
20
|
-
// .env
|
|
21
|
-
GITHUB_CLIENT_ID=<Client ID>
|
|
22
|
-
GITHUB_CLIENT_SECRET=<Client Secret>
|
|
23
|
-
\`\`\`
|
|
24
|
-
|
|
25
|
-
- Read more [Lucia Auth: OAuth](https://lucia-auth.com/guides/oauth/)
|
|
26
|
-
|
|
27
|
-
> [!NOTE]
|
|
28
|
-
> Username & Password signup route : \`http://localhost:3000/api/signup\`.
|
|
29
|
-
> Username & Password login route : \`http://localhost:3000/api/login\`.
|
|
30
|
-
> GitHub login route : \`http://localhost:3000/api/login/github\`.
|
|
31
|
-
> Logout route : \`http://localhost:3000/api/auth/logout\`.
|
|
32
|
-
`;
|
|
33
|
-
content.addMarkdownFeature(todo, "lucia-auth");
|
|
34
|
-
return content;
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
getReadme as default
|
|
38
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
$ea
|
|
7
|
-
} from "../../../../chunk-4WNEELKU.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/lucia-auth/dist/files/$package.json.js
|
|
12
|
-
var __create = Object.create;
|
|
13
|
-
var __defProp = Object.defineProperty;
|
|
14
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
19
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(from))
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var require_package = __commonJS({
|
|
38
|
-
"package.json"(exports, module) {
|
|
39
|
-
module.exports = {
|
|
40
|
-
name: "@batijs/lucia-auth",
|
|
41
|
-
private: true,
|
|
42
|
-
version: "0.0.1",
|
|
43
|
-
description: "",
|
|
44
|
-
type: "module",
|
|
45
|
-
scripts: {
|
|
46
|
-
"check-types": "tsc --noEmit",
|
|
47
|
-
build: "bati-compile-boilerplate"
|
|
48
|
-
},
|
|
49
|
-
keywords: [],
|
|
50
|
-
author: "",
|
|
51
|
-
license: "MIT",
|
|
52
|
-
devDependencies: {
|
|
53
|
-
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@cloudflare/workers-types": "^4.20250607.0",
|
|
55
|
-
"@lucia-auth/adapter-drizzle": "^1.1.0",
|
|
56
|
-
"@lucia-auth/adapter-sqlite": "^3.0.2",
|
|
57
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
58
|
-
"@types/node": "^18.19.110",
|
|
59
|
-
"@universal-middleware/core": "^0.4.7",
|
|
60
|
-
arctic: "^3.7.0",
|
|
61
|
-
"better-sqlite3": "^11.10.0",
|
|
62
|
-
cookie: "^1.0.2",
|
|
63
|
-
dotenv: "^16.5.0",
|
|
64
|
-
"drizzle-orm": "^0.44.2",
|
|
65
|
-
lucia: "^3.2.2",
|
|
66
|
-
vike: "^0.4.231",
|
|
67
|
-
vite: "^6.3.5"
|
|
68
|
-
},
|
|
69
|
-
dependencies: {
|
|
70
|
-
"@batijs/core": "workspace:*"
|
|
71
|
-
},
|
|
72
|
-
files: [
|
|
73
|
-
"dist/"
|
|
74
|
-
],
|
|
75
|
-
bati: {
|
|
76
|
-
if: {
|
|
77
|
-
flag: "lucia-auth"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
exports: {
|
|
81
|
-
"./lib/lucia-auth": {
|
|
82
|
-
types: "./dist/types/lib/lucia-auth.d.ts"
|
|
83
|
-
},
|
|
84
|
-
"./pages/login/+guard": {
|
|
85
|
-
types: "./dist/types/pages/login/+guard.d.ts"
|
|
86
|
-
},
|
|
87
|
-
"./server/lucia-auth-handlers": {
|
|
88
|
-
types: "./dist/types/server/lucia-auth-handlers.d.ts"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
typesVersions: {
|
|
92
|
-
"*": {
|
|
93
|
-
"lib/lucia-auth": [
|
|
94
|
-
"./dist/types/lib/lucia-auth.d.ts"
|
|
95
|
-
],
|
|
96
|
-
"pages/login/+guard": [
|
|
97
|
-
"./dist/types/pages/login/+guard.d.ts"
|
|
98
|
-
],
|
|
99
|
-
"server/lucia-auth-handlers": [
|
|
100
|
-
"./dist/types/server/lucia-auth-handlers.d.ts"
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
async function getPackageJson(props) {
|
|
108
|
-
const packageJson = await $ea(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
109
|
-
return packageJson.addDependencies(["arctic", "cookie", "lucia", "@universal-middleware/core", "dotenv"]).addDependencies(["@lucia-auth/adapter-drizzle"], props.meta.BATI.has("drizzle")).addDependencies(["@lucia-auth/adapter-sqlite"], !props.meta.BATI.has("drizzle")).addDevDependencies(["@types/better-sqlite3"], !props.meta.BATI.hasD1).addDependencies(["better-sqlite3"], !props.meta.BATI.hasD1);
|
|
110
|
-
}
|
|
111
|
-
export {
|
|
112
|
-
getPackageJson as default
|
|
113
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
|
-
import { Lucia, type Register } from "lucia";
|
|
3
|
-
import { BetterSqlite3Adapter, D1Adapter } from "@lucia-auth/adapter-sqlite";
|
|
4
|
-
import { GitHub } from "arctic";
|
|
5
|
-
import { DrizzleSQLiteAdapter } from "@lucia-auth/adapter-drizzle";
|
|
6
|
-
import { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
|
|
7
|
-
import { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
|
|
8
|
-
import { sessionTable, userTable } from "@batijs/drizzle/database/drizzle/schema/lucia-auth";
|
|
9
|
-
import { D1Database } from "@cloudflare/workers-types";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Polyfill needed if you're using Node.js 18 or below
|
|
13
|
-
*
|
|
14
|
-
* @link {@see https://lucia-auth.com/getting-started/#polyfill}
|
|
15
|
-
*/
|
|
16
|
-
if (!globalThis.crypto) {
|
|
17
|
-
Object.defineProperty(globalThis, "crypto", {
|
|
18
|
-
value: await import("node:crypto").then((crypto) => crypto.webcrypto as Crypto),
|
|
19
|
-
writable: false,
|
|
20
|
-
configurable: true,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function initializeLucia(
|
|
25
|
-
db: BATI.If<
|
|
26
|
-
{
|
|
27
|
-
'BATI.has("sqlite") && !BATI.hasD1': ReturnType<typeof sqliteDb>;
|
|
28
|
-
'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
|
|
29
|
-
'BATI.has("drizzle")': ReturnType<typeof dbD1>;
|
|
30
|
-
"BATI.hasD1": D1Database;
|
|
31
|
-
},
|
|
32
|
-
"union"
|
|
33
|
-
>,
|
|
34
|
-
) {
|
|
35
|
-
/**
|
|
36
|
-
* Database setup
|
|
37
|
-
*
|
|
38
|
-
* @link {@see https://lucia-auth.com/database/#database-setup}
|
|
39
|
-
**/
|
|
40
|
-
const adapter = BATI.has("drizzle")
|
|
41
|
-
? new DrizzleSQLiteAdapter(db as BATI.Any, sessionTable as BATI.Any, userTable as BATI.Any)
|
|
42
|
-
: BATI.hasD1
|
|
43
|
-
? new D1Adapter(db as BATI.Any, {
|
|
44
|
-
user: "users",
|
|
45
|
-
session: "sessions",
|
|
46
|
-
})
|
|
47
|
-
: new BetterSqlite3Adapter(db as BATI.Any, {
|
|
48
|
-
user: "users",
|
|
49
|
-
session: "sessions",
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Initialize Lucia
|
|
54
|
-
*
|
|
55
|
-
* @link {@see https://lucia-auth.com/getting-started/#initialize-lucia}
|
|
56
|
-
*/
|
|
57
|
-
return new Lucia(adapter, {
|
|
58
|
-
/**
|
|
59
|
-
* Lucia Configuration
|
|
60
|
-
*
|
|
61
|
-
* @link {@see https://lucia-auth.com/basics/configuration}
|
|
62
|
-
*/
|
|
63
|
-
sessionCookie: {
|
|
64
|
-
attributes: {
|
|
65
|
-
secure: process.env.NODE_ENV === "production",
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
getUserAttributes: (attributes) => {
|
|
69
|
-
return {
|
|
70
|
-
username: attributes.username,
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Initialize OAuth provider
|
|
78
|
-
*
|
|
79
|
-
* @link {@see https://lucia-auth.com/guides/oauth/basics#initialize-oauth-provider}
|
|
80
|
-
*/
|
|
81
|
-
export const github = new GitHub(
|
|
82
|
-
process.env.GITHUB_CLIENT_ID as string,
|
|
83
|
-
process.env.GITHUB_CLIENT_SECRET as string,
|
|
84
|
-
null,
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Define user attributes
|
|
89
|
-
*
|
|
90
|
-
* @link {@see https://lucia-auth.com/basics/users#define-user-attributes}
|
|
91
|
-
*/
|
|
92
|
-
declare module "lucia" {
|
|
93
|
-
interface Register {
|
|
94
|
-
Lucia: ReturnType<typeof initializeLucia>;
|
|
95
|
-
DatabaseUserAttributes: Omit<DatabaseUser, "id">;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
declare global {
|
|
100
|
-
namespace Universal {
|
|
101
|
-
interface Context {
|
|
102
|
-
lucia: Register["Lucia"];
|
|
103
|
-
db: BATI.If<{
|
|
104
|
-
'BATI.has("sqlite") && !BATI.hasD1': ReturnType<typeof sqliteDb>;
|
|
105
|
-
'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
|
|
106
|
-
'BATI.has("drizzle")': ReturnType<typeof dbD1>;
|
|
107
|
-
"BATI.hasD1": D1Database;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface DatabaseUser {
|
|
114
|
-
id: string;
|
|
115
|
-
username: string;
|
|
116
|
-
password?: string | null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
//# !BATI.has("drizzle")
|
|
120
|
-
export interface DatabaseOAuthAccount {
|
|
121
|
-
provider_id: string;
|
|
122
|
-
provider_user_id: string;
|
|
123
|
-
user_id: string;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//# BATI.has("drizzle")
|
|
127
|
-
export interface DatabaseOAuthAccount {
|
|
128
|
-
providerId: string;
|
|
129
|
-
providerUserId: string;
|
|
130
|
-
userId: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface GitHubUser {
|
|
134
|
-
id: number;
|
|
135
|
-
login: string; // username
|
|
136
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// https://vike.dev/guard
|
|
2
|
-
import { redirect } from "vike/abort";
|
|
3
|
-
import type { GuardAsync } from "vike/types";
|
|
4
|
-
|
|
5
|
-
const guard: GuardAsync = async (pageContext): ReturnType<GuardAsync> => {
|
|
6
|
-
if (pageContext.user) {
|
|
7
|
-
throw redirect("/");
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { guard };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
header {
|
|
2
|
-
font-size: 28px;
|
|
3
|
-
font-weight: 600;
|
|
4
|
-
text-align: center;
|
|
5
|
-
}
|
|
6
|
-
.form {
|
|
7
|
-
position: absolute;
|
|
8
|
-
max-width: 430px;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
.form .field {
|
|
12
|
-
position: relative;
|
|
13
|
-
height: 50px;
|
|
14
|
-
width: 100%;
|
|
15
|
-
margin-top: 20px;
|
|
16
|
-
border-radius: 6px;
|
|
17
|
-
}
|
|
18
|
-
.field input,
|
|
19
|
-
.button-field {
|
|
20
|
-
height: 100%;
|
|
21
|
-
width: 100%;
|
|
22
|
-
border: none;
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
font-weight: 400;
|
|
25
|
-
border-radius: 6px;
|
|
26
|
-
}
|
|
27
|
-
.button-group {
|
|
28
|
-
display: flex;
|
|
29
|
-
}
|
|
30
|
-
.login-button {
|
|
31
|
-
background-color: #0171d3e8;
|
|
32
|
-
}
|
|
33
|
-
.login-button:hover {
|
|
34
|
-
background-color: #016dcb;
|
|
35
|
-
}
|
|
36
|
-
.signup-button {
|
|
37
|
-
background-color: #d30101f6;
|
|
38
|
-
}
|
|
39
|
-
.signup-button:hover {
|
|
40
|
-
background-color: #cb010b;
|
|
41
|
-
}
|
|
42
|
-
.field input {
|
|
43
|
-
outline: none;
|
|
44
|
-
padding: 0 15px;
|
|
45
|
-
border: 1px solid#CACACA;
|
|
46
|
-
}
|
|
47
|
-
.field input:focus {
|
|
48
|
-
border-bottom-width: 2px;
|
|
49
|
-
}
|
|
50
|
-
.field button {
|
|
51
|
-
color: #fff;
|
|
52
|
-
margin: 0 2px;
|
|
53
|
-
transition: all 0.3s ease;
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
}
|
|
56
|
-
.field-error {
|
|
57
|
-
display: block;
|
|
58
|
-
width: 100%;
|
|
59
|
-
margin-top: 0.25rem;
|
|
60
|
-
font-size: 85%;
|
|
61
|
-
color: #dc3545;
|
|
62
|
-
}
|
|
63
|
-
.media-options a {
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
}
|
|
68
|
-
a.github {
|
|
69
|
-
color: #fff;
|
|
70
|
-
background-color: #000;
|
|
71
|
-
}
|
|
72
|
-
a.github .github-icon {
|
|
73
|
-
height: 28px;
|
|
74
|
-
width: 28px;
|
|
75
|
-
color: #000;
|
|
76
|
-
font-size: 20px;
|
|
77
|
-
border-radius: 50%;
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
background-color: #fff;
|
|
82
|
-
}
|
|
83
|
-
.github-icon {
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 50%;
|
|
86
|
-
left: 15px;
|
|
87
|
-
transform: translateY(-50%);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@media screen and (max-width: 400px) {
|
|
91
|
-
.form {
|
|
92
|
-
padding: 20px 10px;
|
|
93
|
-
}
|
|
94
|
-
}
|