Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 2.16 KB

File metadata and controls

43 lines (36 loc) · 2.16 KB

Repository Guidelines

Project Structure & Module Organization

  • src/: App code. Key areas: components/ (UI + layout), features/json/ (JSON editor, tree, table views), store/ (Zustand stores), utils/ (parsers, generators), lib/utils.ts (helpers like cn).
  • public/: Static assets served as-is.
  • index.html: Vite entry; Tailwind hooks into this.
  • dist/: Build output (ignored). Alias @./src (see vite.config.js).

Build, Test, and Development Commands

  • npm run dev: Start Vite dev server with hot reload.
  • npm run build: Production build to dist/.
  • npm run preview: Serve the production build locally.
  • npm run lint: Lint JavaScript/JSX using ESLint.

Example:

npm install
npm run dev

Coding Style & Naming Conventions

  • Indentation: 2 spaces; semicolons are omitted as in repo.
  • React: Function components; files named PascalCase.tsx/.jsx in components/ and features/.
  • State: Zustand stores named useXxxStore in src/store/.
  • Utilities: camelCase.ts/js in src/utils/; shared helpers in src/lib/.
  • CSS: Tailwind CSS (class composition via cn from lib/utils.ts).
  • Linting: ESLint (JS/JSX rules via eslint.config.js). Keep TS strict per tsconfig.json.

Testing Guidelines

  • Tests are not set up yet. If adding tests, prefer Vitest + Testing Library.
  • Place tests as __tests__/*.test.ts(x) or alongside modules as *.test.ts(x).
  • Aim for component tests of views in features/json/ and store logic in src/store/.

Commit & Pull Request Guidelines

  • Keep commits focused; write imperative subjects (e.g., "Add tree view selection state").
  • Prefer Conventional Commits for scope clarity (feat, fix, refactor, docs, chore).
  • PRs: Include a concise description, linked issue (if any), and screenshots/GIFs for UI changes.
  • Run npm run lint and ensure npm run build succeeds before opening a PR.

Security & Configuration Tips

  • This is a client-only app; do not commit secrets or private JSON samples.
  • Large sample JSON should be pasted at runtime; avoid storing PII in public/ or src/assets/.
  • Respect path alias @/... for imports and avoid relative chain imports (e.g., ../../..).