diff --git a/.claude/skills/generate-evitadb-client/SKILL.md b/.claude/skills/generate-evitadb-client/SKILL.md new file mode 100644 index 00000000..82c20495 --- /dev/null +++ b/.claude/skills/generate-evitadb-client/SKILL.md @@ -0,0 +1,99 @@ +--- +name: generate-evitadb-client +description: Regenerate gRPC TypeScript types from the evitaDB repository. Use when the user wants to refresh, regenerate, or update gRPC/proto-generated TS client code in evitaLab. +user_invocable: true +--- + +# generate-evitadb-client + +Regenerate gRPC TypeScript types in evitaLab from the evitaDB repository's proto definitions. + +## Strict rules + +- **Do NOT edit any source code**, even if compilation, lint, or test errors appear after regeneration. +- **Do NOT commit anything** to git. +- Only run the steps below and report results. + +## Workflow + +### Step 1 — Activate the Node version from `.nvmrc` + +Run: + +```bash +nvm use +``` + +This switches Node to the version pinned in `.nvmrc`. + +**If the command fails with a "not yet installed" error** (or similar — e.g. `N/A: version "vX.Y.Z" is not yet installed`), install that version and retry, all in one shell invocation: + +```bash +nvm install && nvm use +``` + +If activation still fails after that (network errors, version not found on remote, etc.), **stop immediately** and report the error to the user. + +### Step 2 — Ensure yarn is installed + +Run: + +```bash +npm install -g yarn +``` + +This installs (or refreshes) the `yarn` binary globally for the active Node version. If install fails, **stop immediately** and report the error. + +### Step 3 — Install project dependencies + +Run: + +```bash +yarn install +``` + +This ensures `@bufbuild/buf` and other tooling have their platform binaries downloaded. If install fails, **stop immediately** and report the error. + +### Step 4 — Ask for evitaDB repo path + +Ask the user for the absolute path to their local evitaDB repository checkout. Wait for their answer before proceeding. Do not guess or assume the path. + +### Step 5 — Run the generator script + +Run the project's generator script with the user-provided path as the first argument: + +```bash +./generate-evitadb-client.sh +``` + +If this script exits with a non-zero status, **stop immediately** and report the error to the user. Do not proceed to later steps. + +### Step 6 — Run tests + +Run: + +```bash +yarn test +``` + +Capture the output. **Do not stop** if tests fail — continue to the next step. Note which tests failed and why (especially type errors caused by the regeneration). + +### Step 7 — Run lint + +Run: + +```bash +yarn lint +``` + +Capture the output. Note any linting errors. + +### Step 8 — Summarize compilation errors + +Give the user a concise summary covering: +- Whether generation succeeded +- Test failures (counts + likely cause: type mismatches, missing exports, renamed symbols, etc.) +- Lint errors (counts + categories) +- A short list of the most likely **compilation errors** the user will need to fix manually (e.g. removed fields, renamed messages, changed enum values) + +Remind the user that per the skill rules, no code was edited and nothing was committed — fixes are up to them. diff --git a/.evitadbrc b/.evitadbrc index 65bd990d..9ef8d5e8 100644 --- a/.evitadbrc +++ b/.evitadbrc @@ -1 +1 @@ -2025.8.0 \ No newline at end of file +2026.2.0 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea3e6a7b..cbd5069a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -262,7 +262,7 @@ jobs: const { data: pullRequest } = await github.rest.pulls.create({ owner: 'FgForrest', repo: 'evitaDB', - title: 'Update evitaLab to ${{ needs.build.outputs.released_version }}', + title: 'build: Update evitaLab to ${{ needs.build.outputs.released_version }}', head: branchName, base: 'dev', body: 'This PR updates embedded evitaLab with new released version.' diff --git a/.gitignore b/.gitignore index 0940ebb7..53721893 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ pnpm-debug.log* *.sln *.sw? *.iml + +.hole/ \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 5a601996..92f279e3 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v22.16.0 \ No newline at end of file +v22 \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..4e58ceaa --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,122 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +evitaLab is the official web-based GUI client for evitaDB e-commerce database. It's a Vue.js SPA that allows users to browse entities, execute queries (GraphQL/evitaQL), inspect schemas, manage server connections, and more. + +## Development Commands + +```bash +# Install dependencies +yarn install + +# Run development server (localhost:3000/lab) +yarn dev + +# Run in driver mode for evitaLab Desktop (localhost:3000) +yarn dev-driver + +# Build for production +yarn build # Standalone mode +yarn build-driver # Driver mode for Desktop app + +# Lint with auto-fix +yarn lint + +# Run tests +yarn test +``` + +**Environment Configuration:** Set `VITE_DEV_CONNECTION` in `.env.local` to `DEMO` (default) or `LOCAL` to change the dev connection target. + +## Architecture + +### Module System + +The codebase is organized into **modules** under `src/modules/`. Each module is a semantic domain separation with its own services, components, and models. Modules communicate via dependency injection. + +**Module types:** +- **Abstract modules** (`base`, `console`, `code-editor`): Shared services, models, and UI components +- **Generic modules** (`config`, `connection`, `workspace`, `storage`, `keymap`): Core evitaLab infrastructure +- **Feature modules** (`entity-viewer`, `evitaql-console`, `graphql-console`, `schema-viewer`, etc.): User-facing features + +**Key modules:** +- `database-driver`: `EvitaClient` class - the single entrypoint for all evitaDB server communication. Uses gRPC internally but exposes an internal model tailored to evitaLab +- `workspace`: Manages tabs, history, and overall UI structure. Use `WorkspaceService` to create tabs +- `connection`: Manages connections to evitaDB instances + +### Module Registration + +Modules that need dependency injection implement `ModuleRegistrar` interface and are registered in `src/modules/modules.ts`. The registration order matters - base modules must be registered before feature modules that depend on them. + +```typescript +// Example: injecting EvitaClient in a module registrar +const evitaClient: EvitaClient = builder.inject(evitaClientInjectionKey) + +// In components, use the helper +const evitaClient = useEvitaClient() +``` + +### Bootstrapping + +`main.ts` initializes Vue, plugins, and calls each module's `register()` method. `Lab.vue` is the root component. + +## Code Conventions + +### Vue Components + +- Use **Single-File Components** with **Composition API** +- Order: `