diff --git a/.prompts/project-info.prompttemplate b/.prompts/project-info.prompttemplate new file mode 100644 index 00000000..5a41c05d --- /dev/null +++ b/.prompts/project-info.prompttemplate @@ -0,0 +1,31 @@ +# JSON Forms Documentation Website + +Docusaurus-based documentation website for [JSON Forms](https://github.com/eclipsesource/jsonforms), a declarative framework for building JSON Schema based forms. + +## Key Architectural Decisions + +- **Content in `/content/`**: All MDX content lives here, NOT in `/docs/` (Docusaurus default) +- **Sidebars in `/src/sidebars/`**: Navigation configs are separate files, not in docusaurus.config.js +- **Custom Blog Plugin** (`plugins/custom-blog-plugin.js`): Injects latest post into homepage +- **Version fetching**: `build.sh` queries GitHub API, writes to `/static/current-version.js` + +## Important Patterns + +### Interactive Examples +Use the `Demo` component (`src/components/common/Demo.js`) which renders JSON Forms with Material-UI and provides tabbed Schema/UI Schema/Form views. + +### Adding Documentation +1. Create MDX file in `/content/docs/` or `/content/examples/` +2. Add entry to the appropriate sidebar in `/src/sidebars/` + +### Custom Renderers +Example custom renderers exist in `src/components/common/` (rating, country, region controls). + +### Component Development +- React components go in `/src/components/` +- Use the existing Demo component pattern for interactive examples +- Follow CSS Modules pattern for component-specific styles + +## Important Guidelines + +**Always build and test changes**: Run the build to check for compilation errors, then start the dev server and visually verify changes work correctly. Check for console errors in the browser. Do not consider a task complete until the build passes and changes have been visually verified. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..1b6dd5bb --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,34 @@ +# JSON Forms Documentation Website + +For detailed architecture, see [.prompts/project-info.prompttemplate](.prompts/project-info.prompttemplate). + +## Development Commands + +### Install Dependencies +```bash +npm ci +``` + +### Start Development Server +```bash +npm start +``` +This starts the local development server at `http://localhost:3000` with hot-reloading. + +### Build for Production +```bash +npm run build +``` +This generates static files in the `/build` directory. + +### Serve Production Build Locally +```bash +npm run serve +``` +Serves the built site locally to verify the production build. + +### Clear Cache +```bash +npm run clear +``` +Clears the Docusaurus cache if you encounter build issues.