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
2 changes: 1 addition & 1 deletion .claude/agent-memory/archgate-developer/MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Skipping steps 2 or 3 is a workflow violation. The user should NEVER have to inv

## Distribution / Packaging

- **npm shim + GitHub Releases** — The npm package is a thin shim (`bin/archgate.cjs` + `scripts/postinstall.cjs`). On first run, the shim downloads the platform binary from GitHub Releases and caches it to `~/.archgate/bin/`. No platform-specific npm packages.
- **npm shim + GitHub Releases** — The npm package is a thin shim (`bin/archgate.cjs`). On first run, the shim downloads the platform binary from GitHub Releases and caches it to `~/.archgate/bin/`. No platform-specific npm packages.
- **`.cjs` extension is mandatory** — Root `package.json` has `"type": "module"`. Any Node.js CJS wrapper script placed at the package root MUST use `.cjs`, not `.js`, or Node.js will attempt to parse it as ESM and fail.

## Telemetry Strategy
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Zod schemas are the single source of truth. Types derived via `z.infer<>` — ne

## npm Distribution

The npm package is a **thin shim** — it contains only `bin/archgate.cjs` and `scripts/postinstall.cjs`. The shim downloads the platform binary from GitHub Releases on first run and caches it to `~/.archgate/bin/`. All runtime dependencies (commander, inquirer, zod) are bundled into the compiled binary via `bun build --compile`, so they belong in `devDependencies`, not `dependencies`.
The npm package is a **thin shim** — it contains only `bin/archgate.cjs`. The shim downloads the platform binary from GitHub Releases on first run and caches it to `~/.archgate/bin/`. All runtime dependencies (commander, inquirer, zod) are bundled into the compiled binary via `bun build --compile`, so they belong in `devDependencies`, not `dependencies`.

## Conventions

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"archgate": "bin/archgate.cjs"
},
"files": [
"bin/archgate.cjs",
"scripts/postinstall.cjs"
"bin/archgate.cjs"
],
"os": [
"darwin",
Expand All @@ -49,7 +48,6 @@
"format:check": "oxfmt --check .",
"knip": "knip",
"lint": "oxlint --deny-warnings .",
"postinstall": "node scripts/postinstall.cjs",
"test": "bun test --timeout 60000",
"test:coverage": "bun test --timeout 60000 --coverage --reporter=junit --reporter-outfile=coverage/junit.xml",
"test:watch": "bun test --watch --timeout 60000",
Expand Down
34 changes: 0 additions & 34 deletions scripts/postinstall.cjs

This file was deleted.

13 changes: 7 additions & 6 deletions src/commands/adr/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import {
existsSync,
mkdirSync,
readFileSync,
rmSync,
unlinkSync,
writeFileSync,
Expand Down Expand Up @@ -37,11 +36,13 @@ import { ensureRulesShim } from "../../helpers/rules-shim";

// ---------- Imports manifest I/O ----------

function loadImportsManifest(projectRoot: string): ImportsManifest {
async function loadImportsManifest(
projectRoot: string
): Promise<ImportsManifest> {
const importsPath = join(projectRoot, ".archgate", "imports.json");
if (!existsSync(importsPath)) return { imports: [] };
const raw = readFileSync(importsPath, "utf-8");
return ImportsManifestSchema.parse(JSON.parse(raw));
const raw = await Bun.file(importsPath).json();
return ImportsManifestSchema.parse(raw);
}

function saveImportsManifest(
Expand Down Expand Up @@ -255,7 +256,7 @@ export function registerAdrImportCommand(adr: Command) {

// --list: show previously imported ADRs
if (opts.list) {
const manifest = loadImportsManifest(projectRoot);
const manifest = await loadImportsManifest(projectRoot);
if (useJson) {
console.log(formatJSON(manifest, opts.json ? true : undefined));
} else if (manifest.imports.length === 0) {
Expand Down Expand Up @@ -392,7 +393,7 @@ export function registerAdrImportCommand(adr: Command) {

// ---------- Update imports.json ----------

const manifest = loadImportsManifest(projectRoot);
const manifest = await loadImportsManifest(projectRoot);
const sourceGroups = new Map<
string,
{ version?: string; ids: string[] }
Expand Down
Loading