Skip to content

Commit f542f36

Browse files
authored
chore: align formatting/linting with roci (#208)
* chore: rename to zero-drizzle * chore: rename * chore: further rename * chore: further work * 0.25 (#6) * chore: updates for 0.25 coordination * chore: fix tests * chore: version * chore: updates to coordinate with 0.25 * fix: tests * chore: fix tests * chore: change to run on ubuntu * chore: update versions * chore: align linting and formatting w/ roci * chore: version * chore: concurrency * chore: test fix
1 parent 23a6e0a commit f542f36

File tree

115 files changed

+22811
-20943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+22811
-20943
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm" # See documentation for possible values
4-
directory: "/" # Location of package manifests
3+
- package-ecosystem: 'npm' # See documentation for possible values
4+
directory: '/' # Location of package manifests
55
schedule:
6-
interval: "weekly"
6+
interval: 'weekly'

.github/workflows/test-and-build.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1216
jobs:
1317
build-and-test:
14-
runs-on: self-hosted
18+
runs-on: ubuntu-latest
1519

1620
steps:
1721
- name: Checkout
@@ -26,7 +30,7 @@ jobs:
2630
uses: actions/setup-node@v4
2731
with:
2832
node-version: 22.x
29-
cache: "pnpm"
33+
cache: 'pnpm'
3034

3135
- name: Install dependencies
3236
run: pnpm install
@@ -37,14 +41,17 @@ jobs:
3741
- name: Install dependencies
3842
run: pnpm install
3943

44+
- name: Type check tests
45+
run: pnpm run check-types
46+
47+
- name: Check format
48+
run: pnpm run check-format
49+
4050
- name: Run tests
4151
run: pnpm test
4252

43-
- name: Type check tests
44-
run: pnpm run test:types
45-
4653
integration-tests:
47-
runs-on: self-hosted
54+
runs-on: ubuntu-latest
4855
needs: build-and-test
4956

5057
strategy:
@@ -68,7 +75,7 @@ jobs:
6875
uses: actions/setup-node@v4
6976
with:
7077
node-version: ${{ matrix.node-version }}
71-
cache: "pnpm"
78+
cache: 'pnpm'
7279

7380
- name: Install dependencies
7481
run: pnpm install

.oxlintrc.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"plugins": ["eslint", "typescript", "unicorn", "jest"],
3+
"ignorePatterns": ["node_modules", "dist", "coverage", "out", "tool", "bin"],
4+
"rules": {
5+
// Disable unsafe optional chaining - many legitimate patterns in codebase
6+
"no-unsafe-optional-chaining": "off",
7+
8+
"eqeqeq": "error",
9+
"arrow-body-style": "error",
10+
11+
// Handle unused variables consistently with ESLint config
12+
"no-unused-vars": [
13+
"error",
14+
{
15+
"argsIgnorePattern": "^_",
16+
"varsIgnorePattern": "^_",
17+
"caughtErrorsIgnorePattern": "^_"
18+
}
19+
],
20+
21+
// TypeScript-specific rules
22+
"typescript/no-explicit-any": "warn",
23+
"typescript/no-floating-promises": "error",
24+
"typescript/no-non-null-assertion": "warn",
25+
"typescript/consistent-type-imports": "error",
26+
"typescript/no-unused-vars": [
27+
"error",
28+
{
29+
"argsIgnorePattern": "^_",
30+
"varsIgnorePattern": "^_",
31+
"caughtErrorsIgnorePattern": "^_"
32+
}
33+
],
34+
35+
// Require await in async functions
36+
"require-await": "error",
37+
38+
// Vitest rules uses "jest" plugin
39+
"jest/no-focused-tests": "error",
40+
"jest/no-standalone-expect": "off",
41+
42+
// Private class members (with inline disables for false positives)
43+
"no-unused-private-class-members": "error",
44+
45+
// Additional beneficial rules
46+
"unicorn/prefer-set-size": "error",
47+
"unicorn/prefer-string-starts-ends-with": "error",
48+
"unicorn/prefer-array-find": "error",
49+
"unicorn/prefer-array-flat-map": "error",
50+
"unicorn/prefer-set-has": "error"
51+
}
52+
}

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
{
2-
3-
}
1+
{}

AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Project Structure & Module Organization
44

5-
Core CLI logic lives in `src/`: `cli/` exposes the executable wrapper, `drizzle-to-zero.ts` coordinates schema translation, adapters sit in `node-postgres/` and `postgres-js/`, and helpers such as `tables.ts` or `relations.ts` centralize shared builders. Vitest unit suites reside in `tests/`, while end-to-end fixtures live under `integration/`, `no-config-integration/`, and `db/`. Generated bundles land in `dist/` and coverage reports in `coverage/`; treat them as expendable artifacts unless you are preparing a release.
5+
Core CLI logic lives in `src/`: `cli/` exposes the executable wrapper, `drizzle-to-zero.ts` coordinates schema translation, and helpers such as `tables.ts` or `relations.ts` centralize shared builders. Vitest unit suites reside in `tests/`, while end-to-end fixtures live under `integration/`, `no-config-integration/`, and `db/`. Generated bundles land in `dist/` and coverage reports in `coverage/`; treat them as expendable artifacts unless you are preparing a release.
66

77
## Build, Test, and Development Commands
88

9-
- `pnpm install` keeps the workspace lockfile authoritative; avoid mixing package managers to preserve reproducible installs.
10-
- `pnpm build` wipes `dist/`, runs `tsx build.ts`, and ensures `dist/cli/index.js` remains executable—run this before publishing.
11-
- `pnpm test` executes `vitest run --typecheck --coverage`, so you catch type regressions and produce V8 coverage in one pass.
12-
- `pnpm test:types` runs `tsc --noEmit` for faster feedback while iterating on signatures.
13-
- `pnpm test:ui` opens the Vitest UI for debugging flaky specs.
9+
- `pnpm install` keeps the workspace lockfile authoritative; avoid mixing package managers to preserve reproducible installs.
10+
- `pnpm build` wipes `dist/`, runs `tsx build.ts`, and ensures `dist/cli/index.js` remains executable—run this before publishing.
11+
- `pnpm test` executes `vitest run --typecheck --coverage`, so you catch type regressions and produce V8 coverage in one pass.
12+
- `pnpm check-types` runs `tsc --noEmit` for faster feedback while iterating on signatures.
13+
- `pnpm test:ui` opens the Vitest UI for debugging flaky specs.
1414
- `pnpm clean` removes build output plus fixture `node_modules`; run it before cross-platform repros.
1515

1616
## Coding Style & Naming Conventions
@@ -27,4 +27,4 @@ Follow the conventional-commit style found in `git log` (`feat:`, `fix:`, `chore
2727

2828
## Configuration & Security Tips
2929

30-
Ensure both `drizzle.config.ts` and any `drizzle-zero.config.ts` files stay inside the `tsconfig` `include` glob so type extraction works. Never commit credentials inside fixture configs—use environment variables or `.env.local` ignored by git. When adding new CLI flags, document them in `README.md` and consider wiring sanity tests in `integration/` to prevent regressions around schema casing or output paths.
30+
Ensure both `drizzle.config.ts` and any `zero-drizzle.config.ts` files stay inside the `tsconfig` `include` glob so type extraction works. Never commit credentials inside fixture configs—use environment variables or `.env.local` ignored by git. When adding new CLI flags, document them in `README.md` and consider wiring sanity tests in `integration/` to prevent regressions around schema casing or output paths.

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@AGENTS.md
1+
@AGENTS.md

0 commit comments

Comments
 (0)