To get the nuxt-edgedb module CLI setup wizard to run with npx nuxt-edgedb-module or pnpm exec nuxt-edgedb-module I had to manually install the EdgeDB Generators package @edgedb/generate to dev dependencies with:
pnpm add -D @edgedb/generate.
Using:
- nuxt-edgedb-module 0.0.52
- EdgeDB 5.6
- Nuxt 3.12.4
In case others have a similar issue perhaps the README.md should be updated.
Here is what is required for me to to get pnpm exec nuxt-edgedb-module to work from a clean project.
- Create a new Nuxt project
pnpm dlx nuxi@latest init new_project_name
cd new_poject_name
- Add database driver:
pnpm add --save-prod edgedb
- Add EdgeDB generators package:
pnpm add --save-dev @edgedb/generate Otherwise pnpm exec nuxt-edgedb-module will fail.
- Add this nuxt-edgedb-module module to the Nuxt project:
npx nuxi@latest module add edgedb
- Create a schema in
dbschema/default.esdl and API endpoint e.g. server/api/movies/[id].ts after seeding some data.
edgedb migration create
edgedb migrate
- Seed some data See the EdgeDB TypeScript docs.
- Create a query file e.g.
dbschema/queries/movie.ts
- Run the module
pnpm exec nuxt-edgedb-module
- Start nuxt
npm run dev and the api should be available at the API endpoint
To get the
nuxt-edgedbmodule CLI setup wizard to run withnpx nuxt-edgedb-moduleorpnpm exec nuxt-edgedb-moduleI had to manually install the EdgeDB Generators package @edgedb/generate to dev dependencies with:pnpm add -D @edgedb/generate.Using:
In case others have a similar issue perhaps the README.md should be updated.
Here is what is required for me to to get
pnpm exec nuxt-edgedb-moduleto work from a clean project.pnpm dlx nuxi@latest init new_project_namecd new_poject_namepnpm add --save-prod edgedbpnpm add --save-dev @edgedb/generateOtherwisepnpm exec nuxt-edgedb-modulewill fail.npx nuxi@latest module add edgedbdbschema/default.esdland API endpoint e.g.server/api/movies/[id].tsafter seeding some data.edgedb migration createedgedb migratedbschema/queries/movie.tspnpm exec nuxt-edgedb-modulenpm run devand the api should be available at the API endpoint