@witchcraft/nuxt-auth 0.0.1

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 (65) hide show
  1. package/README.md +693 -0
  2. package/dist/module.d.mts +170 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +146 -0
  5. package/dist/runtime/build/genAuthSecretKeys.d.ts +6 -0
  6. package/dist/runtime/build/genAuthSecretKeys.js +10 -0
  7. package/dist/runtime/components/ExternalCallback.d.vue.ts +7 -0
  8. package/dist/runtime/components/ExternalCallback.vue +96 -0
  9. package/dist/runtime/components/ExternalCallback.vue.d.ts +7 -0
  10. package/dist/runtime/components/ExternalCode.d.vue.ts +11 -0
  11. package/dist/runtime/components/ExternalCode.vue +77 -0
  12. package/dist/runtime/components/ExternalCode.vue.d.ts +11 -0
  13. package/dist/runtime/components/LoginProviderButtons.client.d.vue.ts +15 -0
  14. package/dist/runtime/components/LoginProviderButtons.client.vue +66 -0
  15. package/dist/runtime/components/LoginProviderButtons.client.vue.d.ts +15 -0
  16. package/dist/runtime/components/Mocker.d.vue.ts +2 -0
  17. package/dist/runtime/components/Mocker.vue +39 -0
  18. package/dist/runtime/components/Mocker.vue.d.ts +2 -0
  19. package/dist/runtime/components/SessionStatus.d.vue.ts +35 -0
  20. package/dist/runtime/components/SessionStatus.vue +85 -0
  21. package/dist/runtime/components/SessionStatus.vue.d.ts +35 -0
  22. package/dist/runtime/components/UserRegistration.d.vue.ts +35 -0
  23. package/dist/runtime/components/UserRegistration.vue +158 -0
  24. package/dist/runtime/components/UserRegistration.vue.d.ts +35 -0
  25. package/dist/runtime/composables/useAuth.d.ts +27 -0
  26. package/dist/runtime/composables/useAuth.js +73 -0
  27. package/dist/runtime/core/providerStyles.d.ts +2 -0
  28. package/dist/runtime/core/providerStyles.js +6 -0
  29. package/dist/runtime/core/providers/github.d.ts +89 -0
  30. package/dist/runtime/core/providers/github.js +60 -0
  31. package/dist/runtime/core/providers/google.d.ts +70 -0
  32. package/dist/runtime/core/providers/google.js +54 -0
  33. package/dist/runtime/middleware/authGlobal.d.ts +2 -0
  34. package/dist/runtime/middleware/authGlobal.js +34 -0
  35. package/dist/runtime/middleware/authProtected.d.ts +2 -0
  36. package/dist/runtime/middleware/authProtected.js +38 -0
  37. package/dist/runtime/server/helpers/getSafeSecretsInfo.d.ts +4 -0
  38. package/dist/runtime/server/helpers/getSafeSecretsInfo.js +10 -0
  39. package/dist/runtime/server/helpers/logSafeRoute.d.ts +1 -0
  40. package/dist/runtime/server/helpers/logSafeRoute.js +3 -0
  41. package/dist/runtime/server/helpers/signJwt.d.ts +5 -0
  42. package/dist/runtime/server/helpers/signJwt.js +16 -0
  43. package/dist/runtime/server/helpers/verifyJwt.d.ts +5 -0
  44. package/dist/runtime/server/helpers/verifyJwt.js +19 -0
  45. package/dist/runtime/server/tsconfig.json +3 -0
  46. package/dist/runtime/server/utils/Auth.d.ts +83 -0
  47. package/dist/runtime/server/utils/Auth.js +653 -0
  48. package/dist/runtime/server/utils/SessionManager.d.ts +25 -0
  49. package/dist/runtime/server/utils/SessionManager.js +93 -0
  50. package/dist/runtime/server/utils/createAuthHandler.d.ts +8 -0
  51. package/dist/runtime/server/utils/createAuthHandler.js +29 -0
  52. package/dist/runtime/server/utils/createAuthMiddleware.d.ts +10 -0
  53. package/dist/runtime/server/utils/createAuthMiddleware.js +28 -0
  54. package/dist/runtime/server/utils/createAuthSchema.d.ts +244 -0
  55. package/dist/runtime/server/utils/createAuthSchema.js +43 -0
  56. package/dist/runtime/types.d.ts +239 -0
  57. package/dist/runtime/types.js +15 -0
  58. package/dist/runtime/utils/createExternalAuthHandler.d.ts +36 -0
  59. package/dist/runtime/utils/createExternalAuthHandler.js +25 -0
  60. package/dist/runtime/utils/decodeQueryUri.d.ts +2 -0
  61. package/dist/runtime/utils/decodeQueryUri.js +4 -0
  62. package/dist/runtime/utils/getAuthApiRoute.d.ts +3 -0
  63. package/dist/runtime/utils/getAuthApiRoute.js +14 -0
  64. package/dist/types.d.mts +13 -0
  65. package/package.json +101 -0
@@ -0,0 +1,239 @@
1
+ import type { EnumLike } from "@alanscodelog/utils";
2
+ import type { OAuth2Tokens } from "arctic";
3
+ import type { H3Event, Router } from "h3";
4
+ import type { StringValue } from "ms";
5
+ import type { InjectionKey } from "vue";
6
+ import { z } from "zod";
7
+ import "./core/providers/github.js.js";
8
+ import "./core/providers/google.js.js";
9
+ import type { AuthAccount, AuthSession as DbAuthSession, AuthUserFields as DbAuthUser } from "./server/utils/createAuthSchema.js.js";
10
+ import type { ModulePublicRuntimeConfig } from "../module.js.js";
11
+ export type * from "./server/utils/createAuthSchema.js";
12
+ /**
13
+ * This is the minimum information providers need to return.
14
+ *
15
+ * It is standardized out across all providers since they all use different fields for this.
16
+ *
17
+ * @internal
18
+ */
19
+ export type InitialAccountInfo = {
20
+ providerId: string;
21
+ email: string;
22
+ isVerified: boolean;
23
+ };
24
+ /** @internal */
25
+ export type ProviderHandlerClass<TProviderName extends ProviderNames = ProviderNames> = new (providerOptions: ProviderHandlerOptions, options?: Partial<ProviderOptions<TProviderName>>) => ProviderHandler<any, TProviderName, any>;
26
+ /** @internal */
27
+ export type ProviderHandlerOptions = {
28
+ clientId: string;
29
+ clientSecret: string;
30
+ redirectUri: string;
31
+ };
32
+ interface OAuth2Provider {
33
+ createAuthorizationURL(state: string, scopes: string[]): URL;
34
+ validateAuthorizationCode(code: string): Promise<OAuth2Tokens>;
35
+ refreshAccessToken?(refreshToken: string): Promise<OAuth2Tokens>;
36
+ }
37
+ interface OAuth2ProviderWithPKCE {
38
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
39
+ validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
40
+ refreshAccessToken?(refreshToken: string): Promise<OAuth2Tokens>;
41
+ }
42
+ export interface ProviderHandler<TType extends "oauth2" | "oauth2_pcke" = "oauth2" | "oauth2_pcke", TProviderName extends ProviderNames = ProviderNames, TProvider extends TType extends "oauth2" ? OAuth2Provider : TType extends "oauth2_pcke" ? OAuth2ProviderWithPKCE : never = TType extends "oauth2" ? OAuth2Provider : TType extends "oauth2_pcke" ? OAuth2ProviderWithPKCE : never> {
43
+ provider: TProvider;
44
+ type: TType;
45
+ name: TProviderName;
46
+ getAccountInfo: (tokens: OAuth2Tokens) => Promise<Omit<BaseProviderAccountInfo, "userId">>;
47
+ getLoginInfo: (state: string) => TType extends "oauth2" ? OAuth2AuthUrl : TType extends "oauth2_pcke" ? OAuth2PkceAuthUrl : never;
48
+ }
49
+ export type OAuth2AuthUrl = {
50
+ type: "oauth2";
51
+ url: URL;
52
+ };
53
+ export type OAuth2PkceAuthUrl = {
54
+ type: "oauth2_pcke";
55
+ url: URL;
56
+ codeVerifier: string;
57
+ };
58
+ export interface Register {
59
+ }
60
+ export interface InternalProviders {
61
+ }
62
+ type InternalProviderObject = {
63
+ [k in keyof InternalProviders]: InternalProviders[k];
64
+ };
65
+ type AdditionalProviders = Register extends {
66
+ AdditionalProviders: infer T;
67
+ } ? T extends Record<string, any> ? T : never : never;
68
+ export type AdditionalAccountInfo = Register extends {
69
+ AdditionalAccountInfo: infer T;
70
+ } ? T : never;
71
+ export type AdditionalApiRoutes = (Register extends {
72
+ ApiRoutes: infer T;
73
+ } ? T extends Record<string, any> ? T : {} : {});
74
+ export type ApiRoutesParams = (Register extends {
75
+ ApiRoutesParams: infer T;
76
+ } ? T extends Record<string, any> ? T : {} : {}) & {
77
+ userIdAccounts: Record<"id", string>;
78
+ login: Record<"provider", string>;
79
+ callback: Record<"provider", string>;
80
+ usernameValid: Record<"username", string>;
81
+ };
82
+ export type AuthSession = (Register extends {
83
+ AuthSession: infer T;
84
+ } ? T extends Record<string, any> ? T : {} : {}) & DbAuthSession;
85
+ export type AuthUser = (Register extends {
86
+ AuthUser: infer T;
87
+ } ? T extends Record<string, any> ? T : {} : {}) & DbAuthUser;
88
+ export type SessionValidationResult = {
89
+ session: AuthSession;
90
+ user: AuthUser;
91
+ fresh: boolean;
92
+ } | {
93
+ session: null;
94
+ user: null;
95
+ fresh: false;
96
+ };
97
+ export type SessionCookieOptions = {
98
+ secure?: boolean;
99
+ path?: string;
100
+ domain?: string;
101
+ sameSite?: "lax" | "strict" | "none";
102
+ httpOnly?: boolean;
103
+ maxAge?: number;
104
+ expires?: Date;
105
+ };
106
+ export type SessionCookie = {
107
+ name: string;
108
+ value: string;
109
+ attributes: SessionCookieOptions;
110
+ };
111
+ export type ProviderAccountInfo = InternalProviderObject | AdditionalProviders;
112
+ export type MockUser = Partial<Omit<BaseProviderAccountInfo, "userId">>;
113
+ export type ProviderOptions<TProviderName extends ProviderNames = ProviderNames, TProviderAccountInfo extends ProviderAccountInfo[TProviderName] = ProviderAccountInfo[TProviderName]> = {
114
+ /**
115
+ * This determines what additional account information the provider should return and save to the *accounts* table under the `info` field.
116
+ *
117
+ * For example, say you also wanted to return the user's avatar to populate a user with on registration.
118
+ *
119
+ * Each provider defines it in a different way, so you'd need to specify this function for each provider you're interested in.
120
+ *
121
+ * You can type the return by declaration merging with the `AuthExtendedUserInfo` interface.
122
+ *
123
+ * This is set only once per provider account creation and can the info column can just be cleared after the information is no longer needed.
124
+ */
125
+ getAdditionalAccountInfo?: (user: TProviderAccountInfo) => Promise<AdditionalAccountInfo>;
126
+ };
127
+ export type AuthOptions = {
128
+ /** The url for the site (e.g. http:/localhost:3000 during dev), required for the redirectUri. */
129
+ appUrl?: string;
130
+ runtimeConfig: ModulePublicRuntimeConfig;
131
+ handlers: {
132
+ [k in ProviderNames]: ProviderHandlerClass<k>;
133
+ };
134
+ enabledProviders: ProviderNames[];
135
+ } & Partial<Omit<AuthHandlerOptions, "customProviders">>;
136
+ export type AuthHandlerOptions<T = any> = {
137
+ /**
138
+ * For the short lived access tokens used for external logins.
139
+ *
140
+ * Uses vercel/ms package to parse durations.
141
+ *
142
+ * @default 10m
143
+ */
144
+ externalAccessTokenExpiresIn?: StringValue;
145
+ /**
146
+ * Modify the callback redirect url AFTER the provider has redirected to the app and an account has been created / user has been logged in.
147
+ *
148
+ * Useful, to, fore example, redirect instead to a special schema / deep link (e.g. from the browser to a desktop app).
149
+ */
150
+ modifyCallbackRedirect: (event: H3Event,
151
+ /** The url here does not yet have the deeplink query param. This is because it's relative and can get complicated to parse. So it's added afterwards, only if the link wasn't modified. */
152
+ redirectUrl: string, userId: string, isRegistered: boolean, additionalState: T, deeplink?: string) => string | undefined;
153
+ /**
154
+ * Store additional state in the callback url.
155
+ *
156
+ * Is later available in the `modifyCallbackRedirect` option.
157
+ */
158
+ additionalState?: (event: H3Event) => T;
159
+ customProviders?: {
160
+ [k in ProviderNames]: ProviderHandlerClass<k>;
161
+ };
162
+ providerOptions?: {
163
+ [k in ProviderNames]: ProviderOptions<k>;
164
+ };
165
+ appUrl: string;
166
+ /**
167
+ * Is called on user registration. User is guaranteed to be authenticated and not already registered.
168
+ *
169
+ * Return something and it will be returned as the response.
170
+ *
171
+ * If you return `false` or `undefined`, the handler will redirect to `authRoutes.postRegisteredLogin`.
172
+ */
173
+ onRegister?: (event: H3Event) => Promise<any>;
174
+ /**
175
+ * Extend the router with your own routes.
176
+ *
177
+ * This is useful for adding custom endpoints like `/api/auth/public/users/:username/valid`.
178
+ */
179
+ extendRouter?: (router: Router) => void;
180
+ /**
181
+ * A mapping of deeplink type to a scheme (e.g. electron => `app-name-electron:`).
182
+ *
183
+ * This is used to generate the redirect url for the external auth handler, see the readme for more info.
184
+ */
185
+ deeplinkSchemes?: Record<string, string>;
186
+ devBypassAuth?: boolean;
187
+ /**
188
+ * When bypassing auth, this function is called to create the mock user info. Note that it's called whether the user exists or not. If seeding you database with test users, you should attempt to fetch any existing users here.
189
+ *
190
+ * Any missing fields will be filled in with the defualt generator. Same thing if you return undefined.
191
+ */
192
+ createMockUser?: (username: string | undefined, id: string | undefined, provider: string) => MockUser | Promise<MockUser> | undefined | Promise<undefined>;
193
+ /** Should return any additional fields non-nullable fields without defaults that are needed to be able to add a user. */
194
+ generateUser?: () => any;
195
+ };
196
+ /**
197
+ * A zod username schema to use for validating usernames.
198
+ */
199
+ export declare const defaultZodUsernameSchema: z.ZodString;
200
+ export type ProviderNames = keyof InternalProviders | (AdditionalProviders extends never ? never : keyof AdditionalProviders);
201
+ export type Secrets = Partial<Record<`auth${Capitalize<ProviderNames>}ClientId`, string> & Record<`auth${Capitalize<ProviderNames>}ClientSecret`, string>>;
202
+ export interface BaseProviderAccountInfo extends AuthAccount, InitialAccountInfo {
203
+ }
204
+ export type ProviderStyle = {
205
+ name: string;
206
+ logo: any;
207
+ style: {
208
+ bg: string;
209
+ text: string;
210
+ bgDark: string;
211
+ textDark: string;
212
+ };
213
+ };
214
+ export declare const providerStylesInjectionKey: InjectionKey<Partial<Record<ProviderNames, Partial<ProviderStyle>>>>;
215
+ export type FullProviderStyles = Record<"github" | "google", ProviderStyle> & Record<ProviderNames, Partial<ProviderStyle>>;
216
+ export type UseAuthComposableOptions = {
217
+ /**
218
+ * Handle login and logout actions yourself.
219
+ *
220
+ * Return `true` to let prevent the handler from handling the action.
221
+ */
222
+ handleActions?: ActionHandler;
223
+ };
224
+ /**
225
+ * See {@link UseAuthComposableOptions.handleActions}
226
+ */
227
+ export type ActionHandler = ((action: "login", url: string, provider: ProviderNames) => any | false) & ((action: "logout", url: string) => any | false);
228
+ export declare const AUTH_ERROR: {
229
+ USER_ALREADY_REGISTERED: "AUTH.USER_ALREADY_REGISTERED";
230
+ UNKNOWN_PROVIDER: "AUTH.UNKNOWN_PROVIDER";
231
+ ACCOUNT_ALREADY_LINKED: "AUTH.ACCOUNT_ALREADY_LINKED";
232
+ FAILED_TO_ADD_PROVIDER_ACCOUNT: "AUTH.FAILED_TO_ADD_PROVIDER_ACCOUNT";
233
+ FAILED_TO_CREATE_USER: "AUTH.FAILED_TO_CREATE_USER";
234
+ INVALID_AUTH_CALLBACK: "AUTH.INVALID_AUTH_CALLBACK";
235
+ INTERNAL_ERROR: "AUTH.INTERNAL_ERROR";
236
+ INVALID_DEEPLINK: "AUTH.INVALID_DEEPLINK";
237
+ INVALID_ACCESS_TOKEN: "AUTH.INVALID_ACCESS_TOKEN";
238
+ };
239
+ export type AuthError = EnumLike<typeof AUTH_ERROR>;
@@ -0,0 +1,15 @@
1
+ import { enumFromArray } from "@alanscodelog/utils/enumFromArray";
2
+ import { z } from "zod";
3
+ export const defaultZodUsernameSchema = z.string().min(3).max(32).regex(/^[\w.]+$/, "Username can only contain letters, numbers, underscores, and periods.");
4
+ export const providerStylesInjectionKey = Symbol("providerStyles");
5
+ export const AUTH_ERROR = enumFromArray([
6
+ "USER_ALREADY_REGISTERED",
7
+ "UNKNOWN_PROVIDER",
8
+ "ACCOUNT_ALREADY_LINKED",
9
+ "FAILED_TO_ADD_PROVIDER_ACCOUNT",
10
+ "FAILED_TO_CREATE_USER",
11
+ "INVALID_AUTH_CALLBACK",
12
+ "INTERNAL_ERROR",
13
+ "INVALID_DEEPLINK",
14
+ "INVALID_ACCESS_TOKEN"
15
+ ], "AUTH.");
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Creates an external (e.g. desktop) auth handler.
3
+ */
4
+ export declare function createExternalAuthHandler(
5
+ /**
6
+ * The name of the platform.
7
+ *
8
+ * The `deeplink` query param will be set to this.
9
+ *
10
+ * The actual protocol scheme it maps to can be set in {@link createAuthHandler}.
11
+ */
12
+ name: string,
13
+ /**
14
+ * Should return whether on this platform.
15
+ *
16
+ * e.g. isElectron()
17
+ */
18
+ isExternal: () => boolean,
19
+ /**
20
+ * The url of the server on which to open the auth action url.
21
+ *
22
+ * This is allowed to be undefined because it might only be available in some environments, BUT, it cannot be undefined when isExternal returns true.
23
+ */
24
+ serverUrl: string | (() => string) | (() => Promise<string>) | undefined,
25
+ /**
26
+ * The function on the external **platform** to open the url on a browser.
27
+ *
28
+ * This is allowed to be undefined because it might only be available in some environments, BUT, it cannot be undefined when isExternal returns true.
29
+ */
30
+ open: ((url: string) => void | Promise<void>) | undefined,
31
+ /**
32
+ * The callback path on the external **platform**, it will be redirected here using `navigateTo`.
33
+ *
34
+ * @default runctimeConfig().public.auth.authRoutes.deeplink
35
+ */
36
+ deeplinkCallbackPath?: string): (_action: "login" | "logout", url: string) => Promise<boolean>;
@@ -0,0 +1,25 @@
1
+ import { navigateTo, useRuntimeConfig } from "#imports";
2
+ export function createExternalAuthHandler(name, isExternal, serverUrl, open, deeplinkCallbackPath = useRuntimeConfig().public.auth.authRoutes.deeplink) {
3
+ return async (_action, url) => {
4
+ if (!isExternal()) return false;
5
+ if (deeplinkCallbackPath === void 0) {
6
+ throw new Error("createExternalAuthHandler: deeplinkCallbackPath cannot be undefined. See docs for more info.");
7
+ }
8
+ if (!serverUrl) throw new Error("createExternalAuthHandler: serverUrl cannot be undefined when isExternal returns true. See docs for more info.");
9
+ if (!open) throw new Error("createExternalAuthHandler: open cannot be undefined when isExternal returns true. See docs for more info.");
10
+ let origin = typeof serverUrl === "function" ? serverUrl() : serverUrl;
11
+ if (origin instanceof Promise) {
12
+ origin = await origin;
13
+ }
14
+ const serverAuth = new URL(url, origin);
15
+ serverAuth.searchParams.set("deeplink", name);
16
+ const serverAuthUri = encodeURIComponent(serverAuth.toString());
17
+ const callbackUrl = new URL(deeplinkCallbackPath, window.location.origin);
18
+ callbackUrl.searchParams.set("authUri", serverAuthUri);
19
+ void open(serverAuth.toString());
20
+ setTimeout(() => {
21
+ void navigateTo(callbackUrl.toString(), { external: true });
22
+ }, 0);
23
+ return true;
24
+ };
25
+ }
@@ -0,0 +1,2 @@
1
+ import type { LocationQueryValue } from "vue-router";
2
+ export declare function decodeQueryUri(queryValueryValue: string | LocationQueryValue | LocationQueryValue[]): string | undefined;
@@ -0,0 +1,4 @@
1
+ export function decodeQueryUri(queryValueryValue) {
2
+ if (typeof queryValueryValue !== "string") return void 0;
3
+ return decodeURIComponent(queryValueryValue);
4
+ }
@@ -0,0 +1,3 @@
1
+ import type { PublicRuntimeConfig } from "@nuxt/schema";
2
+ import type { ApiRoutesParams } from "../../module.js.js";
3
+ export declare function getAuthApiRoute<T extends keyof PublicRuntimeConfig["auth"]["authApiRoutes"], TParams extends T extends keyof ApiRoutesParams ? ApiRoutesParams[T] : never>(rc: PublicRuntimeConfig, route: T, params?: TParams, queryParams?: Record<string, any>): string;
@@ -0,0 +1,14 @@
1
+ import { keys } from "@alanscodelog/utils/keys";
2
+ export function getAuthApiRoute(rc, route, params, queryParams) {
3
+ const routes = rc.auth.authApiRoutes;
4
+ let finalRoute = routes[route];
5
+ if (!finalRoute) throw new Error(`Invalid route: ${route}`);
6
+ if (params) {
7
+ for (const key of keys(params)) {
8
+ finalRoute = finalRoute.replace(`:${key}`, params[key]);
9
+ }
10
+ }
11
+ if (route === "base") return finalRoute;
12
+ const query = queryParams ? `?${new URLSearchParams(queryParams).toString()}` : "";
13
+ return `${routes.base}${finalRoute}${query}`;
14
+ }
@@ -0,0 +1,13 @@
1
+ import type { ModulePublicRuntimeConfig } from './module.mjs'
2
+
3
+ declare module '@nuxt/schema' {
4
+ interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
5
+ }
6
+
7
+ export { default } from './module.mjs'
8
+
9
+ export { type ModuleOptions, type ModulePublicRuntimeConfig } from './module.mjs'
10
+
11
+ export * from '../dist/runtime/types.js'
12
+
13
+ export * from '../dist/runtime/server/utils/createAuthSchema.js'
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@witchcraft/nuxt-auth",
3
+ "version": "0.0.1",
4
+ "description": "Nuxt module for logging.",
5
+ "repository": "witchcraftjs/nuxt-auth",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "//exports": {
10
+ "require in ./*": "Temporary for drizzle."
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types.d.mts",
15
+ "import": "./dist/module.mjs"
16
+ },
17
+ "./*": {
18
+ "types": "./dist/runtime/*.d.ts",
19
+ "import": "./dist/runtime/*.js",
20
+ "require": "./dist/runtime/*.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "prepare": "husky && cd playground && pnpm i",
28
+ "build": "cross-env-shell DISABLE_POSTGRES_ENSURE_ENV=true 'nuxt-module-build prepare && nuxt-module-build build && pnpm nuxi build playground'",
29
+ "build:only": "nuxt-module-build build",
30
+ "//": "drizzle requires we run from playground",
31
+ "dev:playground": "cd playground && pnpm dev",
32
+ "dev:prepare": "cross-env-shell DISABLE_POSTGRES_ENSURE_ENV=true 'pnpm nuxt-module-build build --stub && pnpm nuxt-module-build prepare && pnpm nuxi prepare playground'",
33
+ "lint": "eslint \"{src,test,playground/app}/**/*.{ts,vue}\" \"*.{js,cjs,mjs,ts}\"",
34
+ "lint:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
35
+ "test": "echo no tests and not working yet vitest run --exclude .direnv",
36
+ "test:watch": "vitest watch --exclude .direnv"
37
+ },
38
+ "peerDependencies": {
39
+ "drizzle-orm": "^0.44.3"
40
+ },
41
+ "@comments": {
42
+ "dependencies": {
43
+ "@witchcraft/nuxt-logger": "This is only for some types for the logger, but is otherwise unused."
44
+ }
45
+ },
46
+ "dependencies": {
47
+ "@alanscodelog/tsconfigs": "^6.2.0",
48
+ "@alanscodelog/utils": "^6.0.1",
49
+ "@iconify/json": "^2.2.384",
50
+ "@nuxt/kit": "^4.1.2",
51
+ "@oslojs/crypto": "^1.0.1",
52
+ "@oslojs/encoding": "^1.1.0",
53
+ "@vueuse/core": "^13.9.0",
54
+ "@witchcraft/nuxt-logger": "^0.0.2",
55
+ "@witchcraft/ui": "^0.2.3",
56
+ "arctic": "~3.7.0",
57
+ "cookie-es": "^2.0.0",
58
+ "defu": "latest",
59
+ "jsonwebtoken": "^9.0.2",
60
+ "ms": "^2.1.3",
61
+ "nuxt-security": "^2.4.0",
62
+ "unplugin-icons": "^22.3.0",
63
+ "unplugin-vue-components": "^29.0.0",
64
+ "zod": "^4.1.8"
65
+ },
66
+ "devDependencies": {
67
+ "@alanscodelog/eslint-config": "^6.3.1",
68
+ "@alanscodelog/semantic-release-config": "^5.0.4",
69
+ "@nuxt/eslint-config": "^1.9.0",
70
+ "@nuxt/module-builder": "^1.0.2",
71
+ "@nuxt/schema": "^4.1.2",
72
+ "@nuxt/test-utils": "^3.19.2",
73
+ "@tailwindcss/cli": "^4.1.13",
74
+ "@types/node": "latest",
75
+ "changelogen": "^0.6.2",
76
+ "cross-env": "^10.0.0",
77
+ "drizzle-orm": "^0.44.5",
78
+ "electron": "^38.1.0",
79
+ "eslint": "^9.35.0",
80
+ "husky": "^9.1.7",
81
+ "nuxt": "^4.1.2",
82
+ "reka-ui": "^2.5.0",
83
+ "tailwindcss": "^4.1.13",
84
+ "typescript": "^5.9.2",
85
+ "vitest": "^3.2.4",
86
+ "vue-tsc": "^3.0.7"
87
+ },
88
+ "release": {
89
+ "extends": [
90
+ "@alanscodelog/semantic-release-config"
91
+ ]
92
+ },
93
+ "commitlint": {
94
+ "extends": [
95
+ "@alanscodelog"
96
+ ]
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ }
101
+ }