Skip to content

Commit

Permalink
chore(readme): add minimal-starter; improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Nov 13, 2023
1 parent e900c9a commit 9b7da2b
Show file tree
Hide file tree
Showing 8 changed files with 6,088 additions and 9 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,52 @@ pnpm stub
cd playground && pnpm run dev
```

## Module options

You can configure any behavior from the module from your `nuxt.config.ts` file:

```typescript
export default defineNuxtConfig({
modules: ['nuxt-edgedb-module'],
edgeDb: {
// Devtools integrations
devtools: true,
// Completely toggle watchers feature
watch: true,
// Enable or disable prompts on watch events
watchPrompt: true,
// Generate target for your queries and query builder
generateTarget: 'ts',
// dbschema/ dir (you should not touch this)
dbschemaDir: 'dbschema',
// dbschema/ dir (you should not touch this)
queriesDir: 'queries',
// dbschema/ dir (you should not touch this)
queryBuilderDir: 'dbschema/query-builder',
// Toggles typings generation (@db/interfaces)
generateInterfaces: true,
// Toggles typings generation (@db/queries)
generateQueries: true,
// Toggles typings generation (@db/builder)
generateQueryBuilder: true,
// Toggles logging messages on code generation
generateQuiet: true,
// Toggles project init wizard
projectInit: true,
// Toggle CLI install wizard
installCli: true,
// Toggles composables
composables: true,
// Toggles auto-injection on auth credentials
injectDbCredentials: true,
// Enables authentication intergation
auth: false,
// Enables oauth intergation
oauth: false,
}
})
```

## Server usage

The module provides auto-imported composables available anywhere inside `server/` context of your Nuxt app.
Expand Down
9 changes: 9 additions & 0 deletions minimal-starter/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup lang="ts">
</script>

<template>
<div>
Hello world
</div>
</template>
10 changes: 10 additions & 0 deletions minimal-starter/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default defineNuxtConfig({
modules: [
'../src/module'
],
edgeDb: {
auth: true,
oauth: true
},
devtools: { enabled: true }
})
17 changes: 17 additions & 0 deletions minimal-starter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"private": true,
"name": "my-module-playground",
"type": "module",
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate"
},
"devDependencies": {
"@nuxt/devtools": "latest",
"nuxt": "latest"
},
"dependencies": {
"@edgedb/generate": "^0.4.1"
}
}
Loading

0 comments on commit 9b7da2b

Please sign in to comment.