Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b63877eaa | |||
| ba845931da | |||
| 3d7503e227 | |||
| c570597d06 | |||
| e7c7beb8fd | |||
| 037920620e | |||
| 0f73464afe | |||
| 5bf554fbdf | |||
| b566196c96 |
34
CHANGELOG.md
34
CHANGELOG.md
@ -1,6 +1,40 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## v1.0.2
|
||||
|
||||
[compare changes](https://github.com/arashsheyda/nuxt-mongoose/compare/v1.0.1...v1.0.2)
|
||||
|
||||
### 🩹 Fixes
|
||||
|
||||
- Resolve build stuck issue with nitro pre-render enabled ([#26](https://github.com/arashsheyda/nuxt-mongoose/pull/26))
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
- Default connection ([e7c7beb](https://github.com/arashsheyda/nuxt-mongoose/commit/e7c7beb))
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **release:** V1.0.2 ([ba8459](https://github.com/arashsheyda/nuxt-mongoose/commit/ba8459))
|
||||
- Lint ([3d7503e](https://github.com/arashsheyda/nuxt-mongoose/commit/3d7503e))
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
- Arash Sheyda <sheidaeearash1999@gmail.com>
|
||||
- Arash
|
||||
|
||||
## v1.0.1
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **release:** V1.0.0 ([b566196](https://github.com/arashsheyda/nuxt-mongoose/commit/b566196))
|
||||
- **release:** V1.0.1 ([5bf554f](https://github.com/arashsheyda/nuxt-mongoose/commit/5bf554f))
|
||||
- Update dependencies ([0f73464](https://github.com/arashsheyda/nuxt-mongoose/commit/0f73464))
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
- Arash Sheyda <sheidaeearash1999@gmail.com>
|
||||
|
||||
## v1.0.0
|
||||
|
||||
[compare changes](https://github.com/arashsheyda/nuxt-mongoose/compare/v0.0.9...v1.0.0)
|
||||
|
||||
@ -54,7 +54,12 @@ This function creates a new Mongoose model with schema. Example usage:
|
||||
| `hooks` | [`(schema: Schema<T>) => void`](https://mongoosejs.com/docs/middleware.html) | false | Schema Hooks Function to customize Model |
|
||||
|
||||
|
||||
|
||||
::alert
|
||||
you can access the default connection with importing it from mongoose:
|
||||
::
|
||||
```
|
||||
import { connection } from 'mongoose'
|
||||
```
|
||||
|
||||
## `defineMongooseConnection`
|
||||
This function creates a new Mongoose connection.
|
||||
|
||||
20
package.json
20
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nuxt-mongoose",
|
||||
"type": "module",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.2",
|
||||
"private": false,
|
||||
"packageManager": "pnpm@8.7.4",
|
||||
"description": "Nuxt 3 module for MongoDB with Mongoose",
|
||||
@ -10,7 +10,7 @@
|
||||
"homepage": "https://nuxt-mongoose.nuxt.space",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/arashsheyda/nuxt-mongoose"
|
||||
"url": "git+https://github.com/arashsheyda/nuxt-mongoose"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/arashsheyda/nuxt-mongoose/issues"
|
||||
@ -39,19 +39,19 @@
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "nuxt-module-build --stub && nuxi prepare client",
|
||||
"build": "nuxt-module-build && npm run build:client",
|
||||
"build:client": "nuxi generate client",
|
||||
"dev": "nuxi dev playground",
|
||||
"dev:prepare": "nuxt-module-build && nuxi prepare client",
|
||||
"dev:client": "nuxi dev client --port 3300",
|
||||
"dev:prod": "npm run build && npm run dev",
|
||||
"release": "npm run lint && npm run build && changelogen --release && npm publish",
|
||||
"lint": "eslint . --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/devtools-kit": "^0.8.2",
|
||||
"@nuxt/devtools-ui-kit": "^0.8.2",
|
||||
"@nuxt/kit": "^3.7.1",
|
||||
"@nuxt/devtools-kit": "^0.8.4",
|
||||
"@nuxt/devtools-ui-kit": "^0.8.4",
|
||||
"@nuxt/kit": "^3.7.3",
|
||||
"@vueuse/core": "^10.4.1",
|
||||
"defu": "^6.1.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
@ -62,15 +62,15 @@
|
||||
"sirv": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^0.41.0",
|
||||
"@antfu/eslint-config": "^0.43.0",
|
||||
"@nuxt/module-builder": "^0.5.1",
|
||||
"@types/fs-extra": "^11.0.2",
|
||||
"@types/pluralize": "^0.0.30",
|
||||
"changelogen": "^0.5.5",
|
||||
"eslint": "8.48.0",
|
||||
"nuxt": "^3.7.1",
|
||||
"eslint": "8.49.0",
|
||||
"nuxt": "^3.7.3",
|
||||
"sass": "^1.67.0",
|
||||
"sass-loader": "^13.3.2",
|
||||
"splitpanes": "^3.1.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2922
pnpm-lock.yaml
generated
2922
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,7 @@ import {
|
||||
import type { ConnectOptions } from 'mongoose'
|
||||
import defu from 'defu'
|
||||
import { join } from 'pathe'
|
||||
import mongoose from 'mongoose'
|
||||
import { $fetch } from 'ofetch'
|
||||
import { version } from '../package.json'
|
||||
import { setupDevToolsUI } from './devtools'
|
||||
@ -18,27 +19,27 @@ export interface ModuleOptions {
|
||||
*
|
||||
* @default process.env.MONGODB_URI
|
||||
*
|
||||
*/
|
||||
*/
|
||||
uri: string | undefined
|
||||
/**
|
||||
* Nuxt DevTools
|
||||
*
|
||||
* @default true
|
||||
*
|
||||
*/
|
||||
*/
|
||||
devtools: boolean
|
||||
/**
|
||||
* Mongoose Connections
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
*/
|
||||
options?: ConnectOptions
|
||||
/**
|
||||
* Models Directory for auto-import
|
||||
*
|
||||
* @default 'models'
|
||||
*
|
||||
*/
|
||||
*/
|
||||
modelsDir?: string
|
||||
}
|
||||
|
||||
@ -54,6 +55,11 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
options: {},
|
||||
modelsDir: 'models',
|
||||
},
|
||||
hooks: {
|
||||
close: () => {
|
||||
mongoose.disconnect()
|
||||
},
|
||||
},
|
||||
async setup(options, nuxt) {
|
||||
if (nuxt.options.dev) {
|
||||
$fetch('https://registry.npmjs.org/nuxt-mongoose/latest').then((release) => {
|
||||
|
||||
Reference in New Issue
Block a user