Add @objectstack/cli serve command to examples#392
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds convenient serve entrypoints so the example workspaces can be started as API servers via @objectstack/cli, and documents the workflow at the repo and example level.
Changes:
- Added root-level convenience scripts (
serve:crm,serve:todo,serve:kitchen-sink) to run example servers from the monorepo root. - Added
servescripts to the Todo and Kitchen Sink example packages usingobjectstack serve objectstack.config.ts. - Updated documentation (root README and todo README) with instructions and endpoints.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds root convenience serve:* scripts that run example serve via pnpm filters. |
| examples/todo/package.json | Adds serve script using objectstack serve objectstack.config.ts. |
| examples/todo/README.md | Documents running Todo as an API server and updates build/type-check commands. |
| examples/kitchen-sink/package.json | Adds serve script using objectstack serve objectstack.config.ts. |
| README.md | Expands examples section and documents how to run examples as API servers. |
| pnpm --filter @object-ui/example-todo build | ||
|
|
||
| # Run type checking | ||
| pnpm --filter @objectstack/example-todo typecheck | ||
| pnpm --filter @object-ui/example-todo typecheck |
There was a problem hiding this comment.
The README instructs running pnpm --filter @object-ui/example-todo typecheck, but this package doesn’t define a typecheck (or type-check) script in examples/todo/package.json, so the command will fail. Either add a type-checking script to the package (e.g., tsc --noEmit) or update the README to point to the correct repo-wide type-check command.
Enables examples to run as API servers via
@objectstack/cli serve, providing GraphQL and REST endpoints with sample data.Changes
Example packages: Added
servescript totodoandkitchen-sinkexamples (CRM already had it)Root convenience scripts: Added
serve:crm,serve:todo,serve:kitchen-sinkfor starting examples from monorepo rootDocumentation: Updated README.md and examples/todo/README.md with usage instructions
Usage
Server starts on
http://localhost:3000with GraphQL at/graphqland REST endpoints based on object definitions.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.