-
Notifications
You must be signed in to change notification settings - Fork 9
chore: add typechecking via typescript #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds TypeScript tooling and CI type-checking: a new GitHub Actions "test" job runs yarn and Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant PR as Pull Request
participant GH as GitHub Actions (pulls.yml)
participant Runner as ubuntu-latest
participant Registry as npm Registry
PR->>GH: triggers workflow
GH->>Runner: run "build" job (existing)
GH->>Runner: run new "test" job
Runner->>Runner: actions/checkout@v5
Runner->>Runner: corepack enable
Runner->>Registry: setup-node@v6 (Node 22, npm config)
Runner->>Runner: yarn install
Runner->>Runner: yarn run typecheck (tsc --noEmit)
alt typecheck success
Runner->>GH: job passes
else typecheck failure
Runner->>GH: job fails
end
sequenceDiagram
autonumber
participant Renderer as render(resume)
participant Loader as Promise resources
Renderer->>Loader: create loading = Promise.all([css, template])
Renderer-->>Loader: do other sync work
Loader->>Renderer: await loading -> [css, template]
Renderer->>Renderer: continue to render using css and template
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
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. Comment |
efe8617 to
764c446
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
.github/workflows/pulls.yml(1 hunks)index.js(2 hunks)package.json(2 hunks)tsconfig.json(1 hunks)
🔇 Additional comments (4)
package.json (2)
31-31: Script configuration looks good, but CI workflow needs update.The
typesscript correctly runs TypeScript type checking without emitting output. However, the CI workflow callstypecheckinstead oftypes, which will cause CI to fail (already flagged in the workflow file).
44-47: LGTM!The TypeScript and type definition dependencies are appropriate for enabling type checking in this project.
index.js (2)
79-79: Temporary use ofanytype is reasonable given constraints.While
anybypasses type safety, the PR description explains this is intentional due to the lack of an official TypeScript interface for JSON Resume. Consider referencing a type definition from a community package (e.g.,@types/resume-schemaor similar) if one becomes available.
83-86: Loading refactor is functionally correct.The refactor defers awaiting file I/O until the loaded values are actually needed. While this doesn't provide measurable performance benefits (since the intervening code at lines 88-115 is synchronous), the code organization is logical and maintains correctness.
Also applies to: 117-117
764c446 to
77700f1
Compare
Adds type checking via TypeScript. As we don't officially maintain a TypeScript interface for JSON Resume, I just use
anyfor that. It's a little lazy, but I'll evaluate this later.Also adds a
testtask to CI, which will enforce types in pull requests. 💪(•ᴗ•💪)Chores
awaitright away when loading files, I load them first, do all other logic, then call await when they're actually needed. This difference is not perceivable, but it is more logical.Summary by CodeRabbit
New Features
Chores
Refactor