Skip to content

feat: add typed readJSON overload for package.json#162

Merged
rhuanbarreto merged 1 commit intomainfrom
feat/readjson-package-json-overload
Mar 23, 2026
Merged

feat: add typed readJSON overload for package.json#162
rhuanbarreto merged 1 commit intomainfrom
feat/readjson-package-json-overload

Conversation

@rhuanbarreto
Copy link
Copy Markdown
Contributor

Summary

  • Adds a PackageJson interface with common fields (name, version, dependencies, devDependencies, scripts, workspaces, catalog, etc.) plus an index signature for flexibility
  • Adds a readJSON("package.json") overload on RuleContext that returns Promise<PackageJson> instead of Promise<unknown>
  • Mirrors the type and overload in the generated rules.d.ts shim
  • Removes now-unnecessary as casts from existing rules (ARCH-006, ARCH-013)

Test plan

  • bun run validate passes (lint, typecheck, format, tests, ADR check, build)

Add a PackageJson interface and a readJSON("package.json") overload
that returns Promise<PackageJson> instead of Promise<unknown>, removing
the need for manual type assertions in rules. Includes workspaces and
catalog fields. Mirrors the overload in both the canonical RuleContext
and the generated rules.d.ts shim.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 06ef9c7
Status: ✅  Deploy successful!
Preview URL: https://41012145.archgate-cli.pages.dev
Branch Preview URL: https://feat-readjson-package-json-o.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit 1240080 into main Mar 23, 2026
8 checks passed
@rhuanbarreto rhuanbarreto deleted the feat/readjson-package-json-overload branch March 23, 2026 21:51
@github-actions github-actions bot mentioned this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant