File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Use FormKit to build forms
21When db0 is used in the queryies if the ${var} format gives an error try using {${var}}
Original file line number Diff line number Diff line change 4545 },
4646 "main" : " ./dist/module.mjs" ,
4747 "types" : " ./dist/types.d.mts" ,
48- "typesVersions" : {
49- "*" : {
50- "." : [
51- " ./dist/types.d.mts"
52- ],
53- "utils" : [
54- " ./dist/utils.d.mts"
55- ]
56- }
57- },
5848 "files" : [
5949 " dist"
6050 ],
6151 "bin" : {
6252 "nuxt-users" : " ./dist/cli.mjs"
6353 },
64- "engines" : {
65- "node" : " >=22.0.0"
66- },
67-
6854 "scripts" : {
6955 "prepack" : " nuxt-module-build build" ,
7056 "postinstall" : " node -e \" try { require('fs').chmodSync('./dist/cli.mjs', '755') } catch(e) {}\" " ,
7157 "predev" : " node -v | grep -q 'v22' || (echo 'Please use Node.js v22 for development' && exit 1)" ,
7258 "dev" : " yarn dev:prepare && nuxi dev playground" ,
7359 "dev:build" : " nuxi build playground" ,
74- "dev:prepare" : " yarn nuxt-module-build build && yarn nuxt-module-build prepare && nuxi prepare playground" ,
60+ "dev:prepare" : " yarn nuxt-module-build build --stub && yarn nuxt-module-build prepare && nuxi prepare playground" ,
7561 "build" : " nuxt-module-build build" ,
7662 "prerelease" : " node -v | grep -q 'v22' || (echo 'Please use Node.js v22 for deployment' && exit 1)" ,
7763 "release" : " yarn lint && yarn test && yarn build && changelogen --release && yarn publish && git push --follow-tags" ,
Original file line number Diff line number Diff line change 11import { defineCommand } from 'citty'
22import { loadNuxt } from '@nuxt/kit'
3+ import type { ModuleOptions } from '../types'
34
45export default defineCommand ( {
56 meta : {
@@ -16,7 +17,7 @@ export default defineCommand({
1617 console . log ( '🌐 Base URL:' , nuxt . options . app ?. baseURL || '/' )
1718
1819 // Check if nuxt-users module is configured
19- const nuxtUsersConfig = nuxt . options . runtimeConfig ?. nuxtUsers
20+ const nuxtUsersConfig = nuxt . options . runtimeConfig ?. nuxtUsers as ModuleOptions
2021 if ( nuxtUsersConfig ) {
2122 console . log ( '🔧 Nuxt Users module configuration:' )
2223 console . log ( ' Database connector:' , nuxtUsersConfig . connector ?. name )
@@ -29,7 +30,7 @@ export default defineCommand({
2930 }
3031
3132 // Check public runtime config
32- const publicConfig = nuxt . options . runtimeConfig ?. public ?. nuxtUsers
33+ const publicConfig = nuxt . options . runtimeConfig ?. public ?. nuxtUsers as ModuleOptions
3334 if ( publicConfig ) {
3435 console . log ( '🌍 Public runtime config:' )
3536 console . log ( ' Users table exists:' , publicConfig . tables ?. users )
Original file line number Diff line number Diff line change 11import { defineNuxtPlugin , useRuntimeConfig } from '#app'
22import type { ModuleOptions } from '../types'
3- import { checkTableExists } from 'nuxt-users /utils'
3+ import { checkTableExists } from '.. /utils'
44
55export default defineNuxtPlugin ( async ( _nuxtApp ) => {
66 // Only run on server side since we're checking database tables
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import bcrypt from 'bcrypt'
33import crypto from 'node:crypto'
44import type { ModuleOptions , User } from '../../../types'
55import { useRuntimeConfig } from '#imports'
6- import { useDb } from 'nuxt-users /utils'
6+ import { useDb } from '../../.. /utils'
77
88export default defineEventHandler ( async ( event ) => {
99 const body = await readBody ( event )
Original file line number Diff line number Diff line change 11import { createTransport } from 'nodemailer'
22import crypto from 'node:crypto'
33import bcrypt from 'bcrypt'
4- import { findUserByEmail , updateUserPassword } from 'nuxt-users/utils'
5- import { useDb } from 'nuxt-users/utils'
4+ import { findUserByEmail , updateUserPassword , useDb } from '../../../utils'
65import type { ModuleOptions } from '../../../types'
76
87const TOKEN_EXPIRATION_HOURS = 1
Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ export const getConnector = async (name: string) => {
1313 default :
1414 throw new Error ( `Unsupported database connector: ${ name } ` )
1515 }
16- } catch ( error ) {
16+ }
17+ catch ( error ) {
1718 if ( error instanceof Error && error . message . includes ( 'Cannot resolve' ) ) {
18- throw new Error ( `Database connector "${ name } " not found. Please install the required peer dependency:\n` +
19- ` - For sqlite: yarn add better-sqlite3\n` +
20- ` - For mysql: yarn add mysql2\n` +
21- ` - For postgresql: yarn add pg` )
19+ throw new Error ( `Database connector "${ name } " not found. Please install the required peer dependency:\n`
20+ + ' - For sqlite: yarn add better-sqlite3\n'
21+ + ' - For mysql: yarn add mysql2\n'
22+ + ' - For postgresql: yarn add pg' )
2223 }
2324 throw error
2425 }
Original file line number Diff line number Diff line change 11{
22 "extends" : " ./.nuxt/tsconfig.json" ,
3- "compilerOptions" : {
4- "paths" : {
5- "nuxt-users/utils" : [" ./src/utils/index" ]
6- }
7- },
83 "exclude" : [
94 " dist" ,
105 " node_modules" ,
You can’t perform that action at this time.
0 commit comments