Skip to content

Conversation

@MarcelOlsen
Copy link
Owner

@MarcelOlsen MarcelOlsen commented Jul 9, 2025

Summary by CodeRabbit

  • New Features

    • Introduced automated publishing workflow to NPM, including version bumping and GitHub release creation.
    • Added compatibility checks to ensure successful local package installation after build.
  • Chores

    • Updated continuous integration workflow with modernized steps, improved caching, and consolidated jobs.
    • Added a dedicated build configuration for TypeScript output.
    • Introduced an .npmignore file to exclude unnecessary files from published packages.
    • Updated package metadata and scripts to support a compiled output in the distribution directory.
  • Style

    • Removed extraneous blank lines from type definitions for improved code cleanliness.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 9, 2025

Walkthrough

Alright, chat, here’s the rundown: We’ve got a totally revamped CI/CD pipeline with new workflows for testing, publishing, and compatibility checks. The package.json and TypeScript configs are now all about that sweet dist/ output, and there’s a new .npmignore to keep the npm package lean. src/types.ts lost some whitespace—classic cleanup.

Changes

File(s) Change Summary
.github/workflows/ci.yml CI workflow renamed, triggers adjusted, jobs consolidated and modernized, compatibility job added
.github/workflows/publish.yml New workflow for publishing to NPM with test and publish jobs, auto-versioning, tagging, and release creation
.npmignore New file to exclude unnecessary files from npm package
package.json Updated for dist/ output, new scripts, version reset, improved fields for packaging
tsconfig.build.json New TypeScript build config for compiling to dist/, with declarations and source maps
src/types.ts Removed trailing blank lines

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Bun
    participant NPM

    Developer->>GitHub Actions: Push or PR to master
    GitHub Actions->>Bun: Setup Bun environment
    GitHub Actions->>GitHub Actions: Run tests, lint, format, build
    alt On push to master
        GitHub Actions->>GitHub Actions: Bump version, tag, push changes
        GitHub Actions->>NPM: Publish package
        GitHub Actions->>GitHub Actions: Create GitHub Release
    end
    GitHub Actions->>GitHub Actions: Run compatibility check
Loading

Poem

🚀
Oh chat, the CI’s been reborn,
With Bun and builds from dusk till morn.
Publish flows, dist grows,
TypeScript’s config now truly glows.
NPM gets just what it needs—
No extra fluff, just lightning speeds!
GG, let’s ship it, no copium, only seeds.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
.github/workflows/publish.yml (2)

60-80: grep-based conventional-commit parsing = brittle
Single-line commit messages work, multiline bodies or merge commits… not so much. Consider conventional-changelog/standard-version or at least a tiny Node script to parse the commit header robustly.


90-97: Potential infinite-loop dodged, but still spams history
npm version --no-git-tag-version + manual commit is fine, but every publish adds another “bump version” commit. Over time the git log becomes a graveyard. Squash-merge the bumps or move to tags-only versioning (npm version --git-tag-version).

package.json (1)

34-38: bun test is great, but CI also calls bun test – duplication?
Scripts are ⌨️ muscle memory. If a maintainer runs npm test locally it’s fine, but remember anyone without Bun installed is toast. Maybe add a Node-based fallback or document Bun as a hard dep in the README.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f53c879 and c116dc7.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/publish.yml (1 hunks)
  • .npmignore (1 hunks)
  • package.json (1 hunks)
  • src/types.ts (0 hunks)
  • tsconfig.build.json (1 hunks)
💤 Files with no reviewable changes (1)
  • src/types.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: MarcelOlsen
PR: MarcelOlsen/mini-react#8
File: README.md:701-708
Timestamp: 2025-06-17T12:40:39.737Z
Learning: MarcelOlsen prefers to keep test documentation simple with just one example of running specific test files, rather than listing detailed commands for each test suite in the README.
🔇 Additional comments (4)
tsconfig.build.json (1)

11-12: skipLibCheck: true – great for speed, terrible for catching dumb mistakes
Totally fine for CI speed-runs, but remember you’re shipping a library. If a downstream TS user hits a lib-type error we never saw, we look like clowns. Consider flipping this to false on release builds or adding a dedicated “strict” job.

.npmignore (1)

1-4: You’re nuking src/ & index.ts from the published package – intentional?
Given package.json#files already whitelists dist/**/*, this ignore entry is fine, but double-check you don’t rely on source maps pointing back to the original TS inside the tarball. If you do want source maps debuggable from NPM installs, you’ll need the sources too.

.github/workflows/ci.yml (1)

5-8: Pushes to master skip CI entirely – brave move
branches-ignore: [master] means a direct push to prod won’t even lint. If that’s by design (because the publish workflow re-runs tests) cool; otherwise rethink the trigger.

package.json (1)

3-8: Shipping with 0.0.0 – NPM thinks this is pre-alpha
If you accidently npm publish locally you’re stuck with 0.0.0 forever (NPM disallows re-use). Might be safer to start at 0.1.0 to reserve some semantic-version breathing room.

Comment on lines +4 to +6
"outDir": "./dist",
"rootDir": "./",
"declaration": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

rootDir set to “./” is a little too YOLO
Right now the compiler thinks the entire repo is fair game. If someone drops an extra file at the project root it’ll end up in dist/ faster than you can say chat, that’s a bug. Point this at "src" (and maybe the root index.ts) so we only emit what we actually ship.

-    "rootDir": "./",
+    "rootDir": "./src",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"outDir": "./dist",
"rootDir": "./",
"declaration": true,
"outDir": "./dist",
- "rootDir": "./",
+ "rootDir": "./src",
"declaration": true,
🤖 Prompt for AI Agents
In tsconfig.build.json around lines 4 to 6, the rootDir is set to "./", which
causes the compiler to include the entire repository in the output. Change the
rootDir value to "src" to restrict compilation to the source directory and avoid
accidentally including unrelated files in the dist output.

Comment on lines 35 to +38
run: |
curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.16"
- name: Add bun to PATH
run: echo "$HOME/.bun/bin" >> $GITHUB_PATH
BUNDLE_SIZE=$(du -sh dist/ | cut -f1)
echo "📦 Bundle size: $BUNDLE_SIZE"
echo "bundle-size=$BUNDLE_SIZE" >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Step writes an output nobody can read – missing id tag
You’re echo-ing bundle-size to $GITHUB_OUTPUT, but without id: bundle (or similar) the value can’t be referenced later. Either add an id or ditch the output entirely.

-      - name: 📏 Check bundle size
+      - id: bundle-size
+        name: 📏 Check bundle size
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: |
curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.16"
- name: Add bun to PATH
run: echo "$HOME/.bun/bin" >> $GITHUB_PATH
BUNDLE_SIZE=$(du -sh dist/ | cut -f1)
echo "📦 Bundle size: $BUNDLE_SIZE"
echo "bundle-size=$BUNDLE_SIZE" >> $GITHUB_OUTPUT
- id: bundle-size
name: 📏 Check bundle size
run: |
BUNDLE_SIZE=$(du -sh dist/ | cut -f1)
echo "📦 Bundle size: $BUNDLE_SIZE"
echo "bundle-size=$BUNDLE_SIZE" >> $GITHUB_OUTPUT
🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 35 to 38, the step writes an output to
$GITHUB_OUTPUT without specifying an id for the step, so the output cannot be
referenced later. Fix this by adding an id field (e.g., id: bundle) to the step
that runs this script, enabling other steps to access the bundle-size output.
Alternatively, remove the output if it is not needed.

@MarcelOlsen MarcelOlsen merged commit c98e5bf into master Jul 9, 2025
11 checks passed
@MarcelOlsen MarcelOlsen deleted the chore/clean-git-history branch July 9, 2025 15:23
This was referenced Jul 15, 2025
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.

2 participants