diff --git a/.oxlintrc.effect.json b/.oxlintrc.effect.json deleted file mode 100644 index d3209edd72..0000000000 --- a/.oxlintrc.effect.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "./node_modules/@effect/tsgo/oxlint-schema.json", - "extends": ["./.oxlintrc.json", "./node_modules/@effect/tsgo/oxlint-presets/recommended.json"], - "options": { - "denyWarnings": true - }, - "ignorePatterns": [ - "**", - "!packages/api/**", - "!packages/config/**", - "!packages/stack/**", - "!apps/cli-e2e/**", - "!apps/cli/**", - "!apps/docs/**", - "!packages/cli-test-helpers/**", - "!tools/**", - // Last match wins across the whole list: keep bare re-exclusions after every - // `!` entry that would otherwise re-include them. - "apps/cli/src/shared/cli/bin.ts", - "apps/cli/src/shared/compute/stacks/**", - "apps/cli/src/shared/feedback/database.types.ts", - "apps/cli/src/command-internal/db-bootstrap/local-db-running.ts", - "packages/api/src/generated/contracts.ts" - ] -} diff --git a/.oxlintrc.json b/.oxlintrc.json index 51bff7da6a..f48e4f2a84 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,15 +1,28 @@ { - "$schema": "./node_modules/oxlint/configuration_schema.json", + "$schema": "./node_modules/@effect/tsgo/oxlint-schema.json", + "extends": ["./node_modules/@effect/tsgo/oxlint-presets/recommended.json"], "options": { "typeAware": true, "denyWarnings": true }, "ignorePatterns": [ + /* Reference submodules, populated by `repos:install`. */ ".repos", + /* Generated from the OpenAPI spec by `packages/api/scripts/generate.ts`. */ + "packages/api/src/generated/contracts.ts", // Generated by `supabase gen types` (see `gen:feedback-types` in apps/cli). "apps/cli/src/shared/feedback/database.types.ts", + /* Standalone Node shim built with `bun build --target node` that does not use Effect. */ + "apps/cli/src/shared/cli/bin.ts", + // Templates that run inside the user's deployed container, not in the CLI process. + "apps/cli/src/shared/compute/stacks", + /* Standalone CI automation, not Effect code. `github-scripts-ci.yml` type-checks and tests it. */ + ".github/scripts", + /* Static JSON fixtures served by the e2e replay server. */ "apps/cli-e2e/fixtures", + /* Test fixtures and golden snapshots. */ "**/testdata", + /* Build, coverage and docs output. */ "**/dist", "**/coverage", "**/.next", @@ -51,11 +64,7 @@ "excludeFiles": [ "apps/cli/src/**/*.test.ts", "apps/cli/src/shared/config/cli-config-provider.layer.ts", - "apps/cli/src/shared/config/cli-config-env.ts", - // Standalone node shim built with `bun build --target node`; it cannot import effect. - "apps/cli/src/shared/cli/bin.ts", - // Templates that run inside the user's deployed container, not in the CLI process. - "apps/cli/src/shared/compute/stacks/**" + "apps/cli/src/shared/config/cli-config-env.ts" ], "rules": { "no-restricted-properties": [ @@ -78,15 +87,6 @@ ] } }, - { - // `.github/scripts` is the only `bun:test` consumer; `@types/bun`'s shared `Matchers` - // types `.rejects.toThrow(...)` as returning `void`, even though it must be awaited at - // runtime. Removing the `await` would make the assertion racy. - "files": [".github/scripts/**"], - "rules": { - "typescript/await-thenable": "off" - } - }, { // The namespace owns paths, leases, artifact pins, and port reservations; everywhere // in the repo, outside `src/namespace/**` itself, reaches that state through @@ -118,8 +118,6 @@ "apps/cli/src/**/*.test.ts", "apps/cli/src/shared/config/cli-config-provider.layer.ts", "apps/cli/src/shared/config/cli-config-env.ts", - "apps/cli/src/shared/cli/bin.ts", - "apps/cli/src/shared/compute/stacks/**", "apps/cli/src/cli/complete.ts", "apps/cli/src/command-internal/colors.ts", "apps/cli/src/command-internal/db-config.parse.ts", @@ -574,6 +572,13 @@ } ] } + }, + { + /* The Docker Engine probe needs `node:http`'s `socketPath` for unix and npipe sockets. */ + "files": ["apps/cli/src/command-internal/db-bootstrap/local-db-running.ts"], + "rules": { + "effecttsgo/node-builtin-import": "off" + } } ] } diff --git a/AGENTS.md b/AGENTS.md index 3afcece062..ad5787f493 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ Bun monorepo with workspaces under `apps/` and `packages/`. `pnpm` is the packag Use an existing TypeScript/Bun workspace, especially `packages/api`, as the package-structure reference. Published `apps/cli` and `packages/config` are not private; `apps/docs` and -`packages/cli-*` have their own shapes. Generic lint, format, and unused-code tooling is +`packages/cli-*` have their own shapes. Lint, format, and unused-code tooling is root-owned. ### Config Naming Vocabulary @@ -35,8 +35,10 @@ all TypeScript runtime code in Effect. Promise-returning APIs are allowed only a for consumers that do not use Effect. The skill is authoritative for Effect coding practices when repository instructions conflict. -Effect linting uses oxlint via `.oxlintrc.effect.json`; run `pnpm lint:effect:check` or -`pnpm lint:effect:fix` from the repository root. +Effect linting is part of the repo lint (`.oxlintrc.json` extends the Effect oxlint preset); run +`pnpm lint:check` or `pnpm lint:fix` from the repository root; `lint:fix` also applies suggestion +fixes, so review its diff. `ignorePatterns` keeps `.github/scripts`, the npm launcher shim, compute +stack templates and the generated API contracts and feedback types out of the lint. Instrument by default: when you add or change code that does I/O (HTTP, SQL, filesystem beyond a small read, child processes, containers, waits) or millisecond-scale work, give it a named span @@ -67,9 +69,9 @@ Keep the local feedback loop fast; full CI runs for ready PRs targeting `develop Use `pnpm test` only when its scope fits the change; the CLI's aggregate script includes full E2E, so use `pnpm run test:unit` and `pnpm run test:integration` with affected test files locally. When repo-wide validation is warranted, use root `pnpm check:all` or `pnpm fix:all`. These are the -repo-wide quality entrypoints: `check:all` runs generic and Effect lint, format, knip, type, and +repo-wide quality entrypoints: `check:all` runs lint, format, knip, type, and GitHub Actions workflow checks (jactionlint and shellcheck, installed by mise); `fix:all` applies -generic and Effect lint, format, and knip fixes. Do not use production `as` casts to silence type +lint, format, and knip fixes. Do not use production `as` casts to silence type errors. Use root Turbo entrypoints for live and auxiliary workflows: diff --git a/apps/cli-e2e/AGENTS.md b/apps/cli-e2e/AGENTS.md index 0b75112979..0ee5456bfc 100644 --- a/apps/cli-e2e/AGENTS.md +++ b/apps/cli-e2e/AGENTS.md @@ -80,7 +80,7 @@ The `workspace` fixture is what triggers scenario setup — if you destructure ` Always return `runE2e(...)` from the body: Vitest does not run a returned Effect, so the harness fails a test that requests `run` or `runNoProjectId` and passes without executing it. A custom runner added with `testBehaviour.extend` gets the same check by wrapping its CLI Effect in `runGuard.track(...)`, as `stackRun` does. Pass the test's `signal` so a Vitest timeout interrupts the body. -This workspace is under the Effect lint (`.oxlintrc.effect.json`, warnings are errors), which rejects `async` test bodies, global `fetch`, `process.env` and `JSON.parse` in Effect code. Decode JSON stdout with `decodeJsonOutput(schema)(result.stdout)`, which reports a stdout excerpt on failure. +This workspace is under the Effect lint (`.oxlintrc.json`, warnings are errors), which rejects `async` test bodies, global `fetch`, `process.env` and `JSON.parse` in Effect code. Decode JSON stdout with `decodeJsonOutput(schema)(result.stdout)`, which reports a stdout excerpt on failure. Available fixtures: diff --git a/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts b/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts index df89a0d462..312776a23e 100644 --- a/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts +++ b/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts @@ -390,16 +390,14 @@ export function localDbState( if (!isContainerNotFoundMessage(stderr)) { // Surface the Docker install hint instead of raw stderr when the daemon is unreachable. const daemonDown = isDockerDaemonUnreachable(stderr); - return yield* Effect.fail( - new LocalDbRunningError({ - message: - stderr.length > 0 - ? `failed to inspect service: ${stderr}` - : "failed to inspect service", - daemonDown, - ...(daemonDown ? { suggestion: SUGGEST_DOCKER_INSTALL } : {}), - }), - ); + return yield* new LocalDbRunningError({ + message: + stderr.length > 0 + ? `failed to inspect service: ${stderr}` + : "failed to inspect service", + daemonDown, + ...(daemonDown ? { suggestion: SUGGEST_DOCKER_INSTALL } : {}), + }); } return { exists: false } satisfies LocalDbState; }), diff --git a/package.json b/package.json index e0b88a787c..90da749c76 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,10 @@ "test:integration": "pnpm exec turbo run test:integration:run --continue=always --", "test:e2e": "pnpm exec turbo run supabase#build && pnpm exec turbo run test:e2e:run --only --concurrency=1 --continue=always --", "test:vitest": "bun --bun vitest run --project '!*e2e*' --project '!*live*'", - "check:all": "pnpm exec turbo run types:check lint:check fmt:check knip:check lint:effect:check lint:actions:check", - "fix:all": "pnpm exec turbo run lint:fix fmt:fix knip:fix && pnpm run lint:effect:fix", + "check:all": "pnpm exec turbo run types:check lint:check fmt:check knip:check lint:actions:check", + "fix:all": "pnpm exec turbo run fmt:fix --continue=always", "lint:check": "oxlint --config .oxlintrc.json", - "lint:fix": "oxlint --config .oxlintrc.json --fix", - "lint:effect:check": "oxlint --config .oxlintrc.effect.json", - "lint:effect:fix": "oxlint --config .oxlintrc.effect.json --fix --fix-suggestions", + "lint:fix": "oxlint --config .oxlintrc.json --fix --fix-suggestions", "lint:actions:check": "jactionlint", "fmt:check": "oxfmt --config .oxfmtrc.json --check", "fmt:fix": "oxfmt --config .oxfmtrc.json", diff --git a/turbo.json b/turbo.json index 2cdbbc3bee..a1b7ea322e 100644 --- a/turbo.json +++ b/turbo.json @@ -15,13 +15,8 @@ "cache": false }, "lint:fix": { - "cache": false - }, - "lint:effect:check": { - "cache": false - }, - "lint:effect:fix": { - "cache": false + "cache": false, + "dependsOn": ["knip:fix"] }, "lint:actions:check": { "cache": false @@ -30,7 +25,8 @@ "cache": false }, "fmt:fix": { - "cache": false + "cache": false, + "dependsOn": ["lint:fix"] }, "knip:check": { "cache": false