docs: explain the TypeScript file layout for contributors - #129
Merged
Conversation
Converted modules now exist as a .ts source plus a committed .js and .d.ts emit, but CONTRIBUTING.md did not say so, and its rule-implementation steps still told contributors to edit tests/testaro.js and to write new rules in JavaScript. A contributor recently hand-edited an emitted file for exactly this reason (#112). Adds an "Editing TypeScript files" section covering which file to edit, why the emit is committed, the build:ts and build:registry commands, and the CI drift gate, and updates steps 3 and 4 to point at it. Also corrects the validator job directory, which is validation/tests/jobProperties, not validation/tests/jobs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Converted modules now exist as a
.tssource plus a committed.jsand.d.tsemit, butCONTRIBUTING.mdnever said so — and its rule-implementation steps still told contributors to add rule metadata totests/testaro.js(now generated) and to implement new rules in JavaScript.This is not hypothetical: in #112 a contributor hand-edited the emitted
tests/testaro.jsand noted in the PR body that "instructions inCONTRIBUTING.mddo not yet advise on what to do about them, so, to avoid doing anything wrong, I have not touched those files." That was a fair complaint about our documentation.What's in it
patch-packageneed the layout unchanged), the in-file "edit this file, not the emitted one" marker, thenpm run build:ts/npm run build:registrycommands, the CI drift gate that fails a PR whose emit doesn't match, and what to do about not-yet-converted modules and their hand-written.d.tsneighbors.tests/testaro.tsand a TypeScript rule file, each linking to the new section.validation/tests/jobProperties, notvalidation/tests/jobs.Verified that both npm scripts exist as documented and that the "only
hoverandroleusegetBasicResult" statement elsewhere in the file is still accurate.🤖 Generated with Claude Code