This monorepo is created with 3 goals:
- To learn deno & workspace.
- To develop a todo-list app based on couchdb.
- To serve as a playground to build UI library.
You can read the background story as well as the system design in this design doc
mkdir couchdb-todo-list && cd couchdb-todo-listcat << EOF > deno.json
{
"workspace": ["apps/*"]
}
EOF# from the project root
deno init --npm vite-extra apps/todo-list --template deno-react-tsPay attention to the deno task dev : when specifying subproject, add --cwd xxx AFTER task but before dev.
deno install
deno task --cwd apps/todo-list devpouchdb is the couchdb js-client. It is a legacy project that uses common-js as the module system.
To use pouchdb inside deno + vite + react, here is my way:
- add a script tag inside
index.htmlat the end of the body. - install several
@types/pouchdb-xxxpackages viadeno install npm:xxx - add a directive on top of
vite-env.d.ts, then add a type declaraion inside the same file that says "here is a globalPouchDBavailable"// apps/todo-list/src/vite-env.d.ts // ... /// <reference types="@types/pouchdb" /> declare var PouchDB: PouchDB.Static;