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
6 changes: 4 additions & 2 deletions .archgate/adrs/ARCH-001-command-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ Commands live in src/commands/ and export a register\*Command(program) function.
```typescript
// src/commands/check.ts — thin command that delegates to engine
import type { Command } from "@commander-js/extra-typings";

import { loadRuleAdrs } from "../engine/loader";
import { runChecks } from "../engine/runner";
import { reportConsole, reportJSON, getExitCode } from "../engine/reporter";
import { runChecks } from "../engine/runner";
import { exitWith, handleCommandError } from "../helpers/exit";

export function registerCheckCommand(program: Command) {
Expand Down Expand Up @@ -112,9 +113,9 @@ export function registerCheckCommand(program: Command) {
bun build --compile --bytecode — the command used to produce standalone binaries — rejects top-level await at parse time, even though bun run and tsc both accept it. All async bootstrap logic in src/cli.ts MUST be wrapped in an async function main().

```typescript
import { exitWith } from "./helpers/exit";
// src/cli.ts — GOOD: all async logic wrapped in main()
import { logError } from "./helpers/log";
import { exitWith } from "./helpers/exit";
import { captureException } from "./helpers/sentry";
import { UserError } from "./helpers/user-error";

Expand Down Expand Up @@ -161,6 +162,7 @@ await program.parseAsync(process.argv); // also breaks
```typescript
// src/commands/adr/index.ts — composes subcommand group (contains real logic)
import type { Command } from "@commander-js/extra-typings";

import { registerAdrCreateCommand } from "./create";
import { registerAdrListCommand } from "./list";

Expand Down
3 changes: 2 additions & 1 deletion .archgate/adrs/ARCH-004-no-barrel-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Files named `index.ts` that contain actual logic are **not** barrel files and ar
```typescript
// src/commands/check.ts — imports point directly to source modules
import { loadRuleAdrs } from "../engine/loader";
import { runChecks } from "../engine/runner";
import { reportConsole, reportJSON, getExitCode } from "../engine/reporter";
import { runChecks } from "../engine/runner";
```

### Bad Example
Expand All @@ -91,6 +91,7 @@ import { loadRuleAdrs, runChecks, reportConsole } from "../engine/index";
```typescript
// src/commands/adr/index.ts — PERMITTED: defines a function with composition logic
import type { Command } from "@commander-js/extra-typings";

import { registerAdrCreateCommand } from "./create";
import { registerAdrListCommand } from "./list";

Expand Down
2 changes: 1 addition & 1 deletion .archgate/adrs/ARCH-005-testing-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Use Bun's built-in test runner (`bun test`) for all tests. Test files live in `t
// tests/engine/runner.test.ts
import { describe, it, expect, afterEach } from "bun:test";
import { mkdtemp, rm } from "node:fs/promises";
import { join } from "node:path";
import { tmpdir } from "node:os";
import { join } from "node:path";

import { git } from "../test-utils";

Expand Down
1 change: 1 addition & 0 deletions .archgate/adrs/ARCH-008-typed-command-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Options that require type narrowing beyond plain strings MUST use `new Option()`
```typescript
import type { Command } from "@commander-js/extra-typings";
import { Option } from "@commander-js/extra-typings";

import { EDITOR_TARGETS } from "../helpers/init-project";

// EDITOR_TARGETS is the shared editor list — reference it instead of
Expand Down
4 changes: 2 additions & 2 deletions .archgate/adrs/GEN-001-documentation-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ docs/
### Content Layer Configuration

```typescript
// docs/src/content.config.ts — Required for Astro 5
import { defineCollection } from "astro:content";
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";
// docs/src/content.config.ts — Required for Astro 5
import { defineCollection } from "astro:content";

export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
Expand Down
216 changes: 97 additions & 119 deletions bun.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,24 @@
},
"devDependencies": {
"@commander-js/extra-typings": "15.0.0",
"@commitlint/cli": "21.2.3",
"@commitlint/config-conventional": "21.2.3",
"@commitlint/cli": "21.2.4",
"@commitlint/config-conventional": "21.2.4",
"@sentry/node-core": "10.75.2",
"@simple-release/npm": "3.2.5",
"@types/bun": "1.4.3",
"conventional-changelog": "8.1.3",
"conventional-changelog-angular": "9.4.0",
"czg": "1.14.0",
"fast-check": "4.10.2",
"inquirer": "14.2.2",
"knip": "6.38.0",
"meriyah": "7.3.3",
"oxfmt": "0.70.0",
"oxlint": "1.85.0",
"oxlint-tsgolint": "7.0.2001",
"posthog-node": "5.53.0",
"inquirer": "14.2.4",
"knip": "6.42.1",
"meriyah": "7.4.0",
"oxfmt": "0.74.0",
"oxlint": "1.89.0",
"oxlint-tsgolint": "7.0.2004",
"posthog-node": "5.56.4",
"typescript": "7.0.2",
"zod": "4.6.6"
"zod": "4.6.7"
},
"readme": "README.md"
}
2 changes: 1 addition & 1 deletion tests/engine/reporter-diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("reporter diagnostics rendering", () => {
let consoleSpy: Mock<typeof console.log>;

function output(): string {
return logs.join("\n").replace(ANSI_PATTERN, "");
return logs.join("\n").replaceAll(ANSI_PATTERN, "");
}

beforeEach(() => {
Expand Down
Loading