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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig (https://editorconfig.org) - matches the Biome formatter settings
# so editors agree before Biome ever runs.
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
# Markdown hard line breaks are two trailing spaces; do not strip them.
trim_trailing_whitespace = false
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run ESLint
- name: Check formatting (Biome)
run: bun run format

- name: Run linters (oxlint + ESLint)
run: bun run lint

- name: Run TypeScript type check
Expand All @@ -48,6 +51,12 @@ jobs:
USER_EMAIL: user@libredb.org
USER_PASSWORD: test-user

- name: Build library package (tsup)
run: bun run build:lib

- name: Check package types resolution (attw)
run: bun run attw

test:
name: Unit & Integration Tests
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,7 @@ data/

docs/superpowers/

# attw packaging scratch (type-resolution check)
.attw/
*.tgz

42 changes: 42 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"plugins": ["typescript", "oxc", "react", "react-hooks", "jsx-a11y", "nextjs", "import"],
"categories": {
"correctness": "error",
"suspicious": "error",
"perf": "warn",
"pedantic": "off",
"style": "off"
},
"rules": {
"react/react-in-jsx-scope": "off",
"react/no-unstable-nested-components": "off",
"import/no-unassigned-import": "off",
"import/no-named-as-default": "off",
"react-hooks/exhaustive-deps": "off",
"no-unused-vars": "off",
"no-underscore-dangle": "off",
"no-shadow": "off",
"no-control-regex": "off",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/prefer-tag-over-role": "warn",
"jsx-a11y/no-autofocus": "warn",
"jsx-a11y/control-has-associated-label": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
"jsx-a11y/anchor-has-content": "warn"
},
"overrides": [
{
"files": ["tests/**", "**/*.test.ts", "**/*.test.tsx"],
"rules": {
"typescript/no-extraneous-class": "off",
"no-useless-constructor": "off",
"no-new": "off",
"no-constant-binary-expression": "off"
}
}
],
"ignorePatterns": ["dist/**", ".next/**", "out/**", "build/**", "coverage/**", "node_modules/**", "next-env.d.ts"]
}
9 changes: 7 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ Web-based SQL IDE for cloud-native teams: PostgreSQL, MySQL, SQLite, Oracle, SQL
bun install # deps (Bun preferred)
bun dev # dev server (Turbopack)
bun run build # production build
bun run lint # ESLint 9
bun run format # Biome formatter check (format:fix to write); CSS/JSON excluded
bun run lint # oxlint (fast, syntactic) then ESLint 9 (eslint-config-next + narrow type-aware layer)
bun run lint:oxc # oxlint only
bun run typecheck # TypeScript strict
bun run test # all layers: unit + api + integration + hooks + components
bun run test:e2e # Playwright (requires build)
bun run test:coverage # coverage report
bun run build:lib # tsup → @libredb/studio package dist (see rule below)
bun run attw # validate published type-resolution against the packed tarball (needs build:lib first)
```

> **Toolchain rationale (Biome formatter, oxlint, type-aware ESLint layer, attw) lives in [`docs/TOOLCHAIN.md`](docs/TOOLCHAIN.md).** Biome is formatter-only (lineWidth 120); oxlint is the fast syntactic layer in front of ESLint; `eslint-config-next` still owns React/Next/hooks; a narrow `typescript-eslint` type-aware layer guards `src/app/api` + `src/lib/db` against floating promises; attw uses `--profile node16` (the package targets Node >=24 + modern bundlers, so node10 is ignored).

> **`build:lib` after platform-facing changes:** after changing any component used by platform (workspace, providers, …), run `build:lib` — `bun run build` (Next.js) does NOT update the package dist.

> **Tests — always `bun run test`, never bare `bun test`.** Component tests need isolated execution groups (`tests/run-components.sh`) to avoid `mock.module()` cross-contamination.
Expand All @@ -40,7 +45,7 @@ bun run build:lib # tsup → @libredb/studio package dist (see rule below

## Pre-Commit Verification (MANDATORY)

After every code change, run all four locally before claiming done — they match CI (`ci.yml`, `docker-build-push.yml`): `bun run lint` · `bun run typecheck` · `bun run test` · `bun run build`. A local pass on all four guarantees CI passes; do not skip any.
After every code change, run all five locally before claiming done — they match CI (`ci.yml`, `docker-build-push.yml`): `bun run format` · `bun run lint` · `bun run typecheck` · `bun run test` · `bun run build`. A local pass guarantees CI passes; do not skip any. (`bun run lint` runs oxlint then ESLint; the CI `lint-and-build` job additionally runs `build:lib` + `attw`.)

## Architecture

Expand Down
23 changes: 23 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.1/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": {
"includes": ["src/**", "tests/**", "e2e/**", "scripts/**", "*.ts", "*.mts", "*.mjs"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always"
}
},
"css": { "formatter": { "enabled": false } },
"json": { "formatter": { "enabled": false } },
"linter": { "enabled": false },
"assist": { "enabled": false }
}
Loading
Loading