Skip to content

make repository language stats TypeScript-only#105

Merged
ndycode merged 1 commit intomainfrom
chore/ts-only-linguist
Apr 10, 2026
Merged

make repository language stats TypeScript-only#105
ndycode merged 1 commit intomainfrom
chore/ts-only-linguist

Conversation

@ndycode
Copy link
Copy Markdown
Owner

@ndycode ndycode commented Apr 10, 2026

Summary

  • move the tracked OAuth success page source into lib/oauth-success.ts and keep the generated dist/lib/oauth-success.html build artifact
  • serve the OAuth callback page directly from the TypeScript source in lib/auth/server.ts
  • add narrow .gitattributes rules so helper JavaScript and shell files stop counting toward GitHub Linguist stats

Testing

  • npm run lint
  • npm run build
  • npm test
  • Not applicable

Compliance Confirmation

  • This change stays within the repository scope and OpenAI Terms of Service expectations.
  • This change uses official authentication flows only and does not add bypass, scraping, or credential-sharing behavior.
  • I updated tests and documentation when the change affected users, maintainers, or repository behavior.

Notes

  • Linked issue: none
  • Follow-up work or rollout notes: also ran npm run typecheck; GitHub Linguist should recalculate to TypeScript-only after merge/reindex.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Optimized OAuth success page delivery mechanism to ensure consistent response handling.
  • Tests

    • Enhanced OAuth server integration tests to verify success page content is returned correctly.
  • Chores

    • Added build configuration to control GitHub language detection.
  • Documentation

    • Updated documentation describing the OAuth success page build process.

Move the OAuth success page into a TypeScript-owned module so the repo no longer tracks a standalone HTML source file, while preserving the built dist HTML artifact and the local OAuth callback response behavior.

Add narrow Linguist overrides for helper JS and shell scripts instead of broad script rewrites so the GitHub language bar reflects the package''s actual source surface without expanding scope.

Constraint: User requested a GitHub language-bar outcome without a broad repo rewrite
Rejected: Rewrite helper JS and shell scripts into TypeScript | unnecessary scope expansion for a repo-statistics goal
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep helper-script Linguist overrides narrow; do not hide runtime source files behind broad patterns
Tested: npx vitest run test/copy-oauth-success.test.ts test/oauth-server.integration.test.ts test/server.unit.test.ts
Tested: npm run lint
Tested: npm run typecheck
Tested: npm run build
Tested: npm test
Not-tested: GitHub repo language API refresh on default branch before merge
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The changes refactor OAuth success HTML handling from runtime filesystem operations to pre-compiled module exports. The HTML is converted to a string constant, imported at server startup, and the build script updated to load from the compiled module instead of copying files.

Changes

Cohort / File(s) Summary
Configuration & Documentation
.gitattributes, AGENTS.md
.gitattributes added to exclude certain files from GitHub linguist detection; documentation updated to reflect the new build process for OAuth success HTML.
OAuth Success HTML Module
lib/oauth-success.ts
HTML file converted to exported string constant oauthSuccessHtml, using String.raw template literals with escaped nested template expressions for script content.
Server Implementation
lib/auth/server.ts
Removed synchronous filesystem operations and file path resolution; now imports oauthSuccessHtml directly from the compiled module instead of reading from disk at runtime.
Build Automation
scripts/copy-oauth-success.js
API redesigned to accept modulePath and optional html content; dynamically loads and extracts the HTML export from the compiled module when not provided, writing the result via fs.writeFile instead of copying a source file.
Test Suite
test/copy-oauth-success.test.ts, test/oauth-server.integration.test.ts, test/server.unit.test.ts
Tests updated to match new contracts: copy script test passes html directly instead of source file path; server tests mock the OAuth module instead of filesystem; integration test adds content assertion.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 The HTML hops from disk to code,
No more runtime reads on the road,
Compiled and ready, clean and bright,
Module exports make it right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the primary objective of the pull request: making repository language stats TypeScript-only via .gitattributes configuration and refactoring.
Description check ✅ Passed The description comprehensively covers all required template sections with specific details about changes, testing confirmation, and compliance verification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ts-only-linguist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ndycode
Copy link
Copy Markdown
Owner Author

ndycode commented Apr 10, 2026

@greptileai rerun

@ndycode ndycode merged commit a7a24ee into main Apr 10, 2026
1 check was pending
@ndycode ndycode deleted the chore/ts-only-linguist branch April 10, 2026 15:53
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