Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_modules
# Ignore development related files
.git
.github
.husky
.vite-hooks
.vscode
.scratch
.agents
Expand Down
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ updates:
# carries no update-types filter: it has to catch majors, which arrive
# ungrouped otherwise. Listed before minor-and-patch because a dependency
# joins the first group it matches.
#
# The catalog aliases vite to @voidzero-dev/vite-plus-core at the vite-plus
# version, so every release splits them, not just majors. Vite, Vitest,
# oxlint, and oxfmt fixes only arrive through vite-plus releases, and
# advisories filed against vite no longer match the lockfile, so treat
# these bumps as security updates.
vite-plus:
patterns: ["vite-plus", "@voidzero-dev/*", "vite"]
react:
patterns: ["react", "react-dom", "@types/react", "@types/react-dom"]
minor-and-patch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ plans/

# Local dev default-connection fixture, generated per-environment at runtime
**/defaultConnection.json
.vitest/
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

30 changes: 0 additions & 30 deletions .oxfmtrc.jsonc

This file was deleted.

191 changes: 0 additions & 191 deletions .oxlintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .vite-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vp staged
4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"vitest.explorer"
"VoidZero.vite-plus-extension-pack"
]
}
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"editor.defaultFormatter": "oxc.oxc-vscode",
"[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"oxc.disableNestedConfig": true,
"oxc.fmt.disableNestedConfig": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.oxc": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
"editor.quickSuggestions": {
Expand Down
6 changes: 4 additions & 2 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"format_on_save": "on",
"prettier": { "allowed": false },
"prettier": {
"allowed": false
},
"formatter": [
{
"external": {
"command": "pnpm",
"arguments": ["exec", "oxfmt", "--stdin-filepath", "{buffer_path}"]
"arguments": ["exec", "vp", "fmt", "--stdin-filepath", "{buffer_path}"]
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Pass `REVIEW.md` by path to every reviewer sub-agent, not only the standards one

## Commands

Run from project root with `pnpm`. Use only these scripts — never invoke `tsc`, `vitest`, `oxlint`, or `oxfmt` directly or via `pnpx`. The scripts pin tool versions and configs and cover every workspace package; bare tools use the wrong version and miss project context.
Run from project root. Prefer these `pnpm` scripts. `vp` subcommands (`vp test`, `vp lint`, `vp fmt`, `vp check`) are fine to run directly, since `vp` resolves the project's pinned Vite+ and its config; use `pnpm exec vp` if the global CLI isn't installed. `vp check` runs format and lint only, so use `pnpm checks` when you need the type check too. Never invoke `tsc`, `vitest`, `oxlint`, or `oxfmt` directly or via `pnpx`, because bare tools use the wrong version and miss project context.

- `pnpm check:types` — typecheck all packages (no per-file/per-package option; this is the granularity)
- `pnpm checks` — all static checks (types + lint + format); default validation for small changes
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RUN yum update -y && \
FROM base

ENV HOME=/graph-explorer
# The image has no git, so skip installing the Vite+ commit hooks.
ENV VP_GIT_HOOKS=0

WORKDIR /
COPY . /graph-explorer/
Expand Down
2 changes: 1 addition & 1 deletion REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Reserve Important for the cases below. Everything else is Nit at most. That incl

## Do not report

- Anything CI enforces: oxlint (including the React Compiler rules), oxfmt, `tsc`, lockfile checks, Trivy and dependency advisories.
- Anything CI enforces: `vp lint` (oxlint, including the React Compiler rules), `vp fmt` (oxfmt), `tsc`, lockfile checks, Trivy and dependency advisories.
- Pre-existing issues, unless this PR makes them newly reachable.
- The Git rules in `AGENTS.md`. PRs are squash merged, so commit messages, branch names, and how the commits are split never reach `main`.
- `Changelog.md`. It's updated at release time.
Expand Down
6 changes: 3 additions & 3 deletions docs/agents/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Vitest. Tests co-locate with source as `*.test.ts` (or `*.test.tsx` for componen

## Where tests live

Vitest collects only the projects listed in the root `vitest.config.ts`, currently just `packages/*`. A test file outside those is never collected, and `pnpm test` still reports green, so adding a new top-level test directory means giving it a `vitest.config.ts` and adding it to that list.
Vitest collects only the projects listed in `test.projects` of the root `vite.config.ts`, currently just `packages/*`. A test file outside those is never collected, and `pnpm test` still reports green, so adding a new top-level test directory means giving it a `vite.config.ts` and adding it to that list.

Each project sets up its own environment. `setupTests.ts` below is registered by `packages/graph-explorer` only. `packages/graph-explorer-proxy-server` has its own setup file, and `packages/shared` has none, so its tests reset their own mocks.
Each project sets up its own environment. `setupTests.ts` below is registered by `packages/graph-explorer` only. `packages/graph-explorer-proxy-server` has its own setup file, and `packages/shared` has no setup file, so any tests added there must reset their own mocks.

## Rules

- Import test APIs (`describe`, `it`, `expect`, `vi`, …) from `vitest`. Globals are off, so a missing import is a type error
- Import test APIs (`describe`, `it`, `expect`, `vi`, …) from `vite-plus/test`, never `vitest`. Globals are off, so a missing import is a type error, and lint rejects a `vitest` import
- Use `renderHookWithState` for hooks, not `renderHook`
- Set up state with `DbState`, not manual atom wiring or `renderHookWithJotai`. When `DbState` can't express what a test needs, extend `DbState` — growing it is the intended path, not working around it.
- Mock only external systems (network, etc.); don't mock internal modules
Expand Down
10 changes: 9 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ No check compares the `+sha512` hash against anything, because the two tools tha

A major bump is also where `pnpm-workspace.yaml` deserves a read. Since pnpm 12, a key that pnpm does not recognize fails the install with `ERR_PNPM_UNRECOGNIZED_WORKSPACE_SETTINGS` instead of being ignored. So a setting removed or renamed upstream stops the install rather than quietly doing nothing. `pnpm config list` prints the `pnpm-workspace.yaml` settings pnpm resolved, which is the quickest way to check, though it lists neither pnpm's defaults nor anything from `.npmrc`.

### Tooling

[Vite+](https://viteplus.dev) runs linting, formatting, tests, and the pre-commit hook. It's a dev dependency, so `pnpm install` is all the setup it needs. Run `pnpm checks` for lint, format, and type checks, `pnpm test` or `pnpm test:watch` for tests, and `pnpm lint` or `pnpm format` to fix issues. A global `vp` CLI is optional; without one, `pnpm exec vp` works. Here `vp check` covers format and lint only, so run `pnpm checks` before you push.

- Run `pnpm install` after pulling the switch to Vite+. It moves your pre-commit hook from Husky to `vp staged`.
- If `pnpm install` prints `core.hooksPath is already set`, your clone or global Git config points hooks somewhere else, and the Vite+ hook isn't installed. Run `git config --unset core.hooksPath` (add `--global` if the value is global), then `pnpm install` again.
- In VS Code, install the recommended Vite+ extension pack. In Zed, install `oxc-zed`.

## Run in development mode

Install any missing or updated dependencies.
Expand Down Expand Up @@ -136,7 +144,7 @@ If you need to add, remove, or update a dependency you can easily do so from the
pnpm add react --filter graph-explorer

# Adding a dev only dependency for the server app
pnpm add -D vitest --filter graph-explorer-proxy-server
pnpm add -D supertest --filter graph-explorer-proxy-server
```

### Preparation of a release
Expand Down
Loading
Loading