Skip to content
Open
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
25 changes: 0 additions & 25 deletions .oxlintrc.effect.json

This file was deleted.

39 changes: 22 additions & 17 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -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",
Comment thread
7ttp marked this conversation as resolved.
Resolved
/* 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",
Expand Down Expand Up @@ -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": [
Expand All @@ -78,15 +87,6 @@
]
}
},
{
// `.github/scripts` is the only `bun:test` consumer; `@types/bun`'s shared `Matchers<T>`
// 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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
]
}
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion apps/cli-e2e/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
18 changes: 8 additions & 10 deletions apps/cli/src/command-internal/db-bootstrap/local-db-running.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}),
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the context on this change (i.e., making it so pnpm fix:all only lists fmt:fix as its sole task and we use the dependsOn tree in turbo.json)?

i think the previous approach (where the tasks were listed out in this turbo run command) makes more sense to me, for a few reasons:

  • these tasks not actually dependent on one another (but correct me if i'm wrong here)
  • if i as a user wanted to fix oxfmt issues, i'd expect that running pnpm exec turbo run fmt:fix would only run oxfmt and not the other fixing commands
  • it's antipattern compared to check:all

if the reasoning for this change is that we can't run these three commands in parallel, we should use --concurrency 1 instead

suggestion if these can run in parallel:

Suggested change
"fix:all": "pnpm exec turbo run fmt:fix --continue=always",
"fix:all": "pnpm exec turbo run lint:fix fmt:fix knip:fix",

suggestion if these cannot run in parallel:

Suggested change
"fix:all": "pnpm exec turbo run fmt:fix --continue=always",
"fix:all": "pnpm exec turbo run lint:fix fmt:fix knip:fix --concurrency 1 --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",
Expand Down
12 changes: 4 additions & 8 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Comment on lines +18 to +19

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per my feedback above

Suggested change
"cache": false,
"dependsOn": ["knip:fix"]
"cache": false

},
"lint:actions:check": {
"cache": false
Expand All @@ -30,7 +25,8 @@
"cache": false
},
"fmt:fix": {
"cache": false
"cache": false,
"dependsOn": ["lint:fix"]
Comment on lines +28 to +29

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per my feedback above

Suggested change
"cache": false,
"dependsOn": ["lint:fix"]
"cache": false

},
"knip:check": {
"cache": false
Expand Down
Loading