2.0.0: one import, a letter grade, and a CLI - #3
Merged
Merged
Conversation
Rework the public interface around the calls people actually make. The headline calls (gradeDomain, verifyMessage, analyzeHeaders) are on the root barrel, resolver is optional everywhere and defaults to DNS over HTTPS, and DomainGrade carries a letter from "A+" to "F" with the rubric in the spec corpus. Adds a bin: npx mailgrade <domain> prints the grade, with --json for scripts and --strict for CI. verifyMessage takes mta and returns a folded, CRLF-terminated Received-SPF and Authentication-Results block, sanitised against header injection. BREAKING CHANGE: the root barrel is a curated list rather than export *, the spec corpus is no longer published in the tarball, checkDomain is now gradeDomain and the old gradeDomain is gradeRecords. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the public interface around the calls people actually make, puts a letter on the grade, and ships the grade as a CLI. Carries a
majorchangeset, so merging opens the version PR that cuts 2.0.0.What changes
npx mailgrade acme.com. The package has a bin: the grade in a terminal (letter, verdict, per-mechanism headlines, and the fixes), with--jsonfor scripts and--strictfor CI, where a non-zero exit catches the day someone "temporarily" weakens the DMARC record. Zero dependencies, like everything else here.DomainGradecarriesletter,"A+"down to"F". The verdict sets the band and the details move within it;+allis an automaticF. The rubric lives inspec/grade.json, so ports share it.gradeDomain,verifyMessageandanalyzeHeadersare onmailgradeitself. Every existing entry point still resolves; the subpaths are now for narrowing a bundle, not for finding the API.resolveris optional everywhere it was required, defaulting to DNS over HTTPS. A Node service that wants the system resolver still passesnodeResolver()frommailgrade/node-dns.verifyMessagetakesmtaand returnsauthResultsandheaders: a folded, CRLF-terminatedReceived-SPFandAuthentication-Resultsblock, ready to prepend. Embedded values come off the wire, so they are sanitised on the way in, and the folder is quote-aware.--stand-ins and a stray…are gone from the docs and comments across the repo.Breaking
export *, so roughly 25 internals no longer appear onmailgrade. Each is still exported from the entry point for its own area.mailgrade/spec/*subpath is gone with it. The corpus stays in the repository.checkDomainis nowgradeDomain; the pure function that held that name is nowgradeRecords.DohOptionsis nowGradeDomainOptions.Checks
pnpm checkis green locally: oxlint,tsc, 288 tests across 10 files,tsdownbuild,publint, andattw --profile node16(all entry points 🟢 for CJS, ESM and bundler).🤖 Generated with Claude Code