Conversation
…tories and remove explicit webpack disabling.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR addresses size-limit workflow failures by improving package resolution logic and adjusting bundler configuration. The package detection now climbs upward from changed files to find the nearest package.json with regex fallback, and the bundler configuration expands the external ignore list to include peer dependencies. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/actions/size-limit/src/package/changes.ts (1)
65-109: Workspace package detection via nearest package.json looks correct; only minor edge‑case ideasThis new “walk up to nearest package.json and use its
name” approach should fix the earlier mismatch between directory names (e.g.vite-plugin) and actual workspace package names (e.g.@arkenv/vite-plugin), and the regex fallback for deleted/invalid package.json paths is a good safety net.Two optional refinements you might consider, not blockers:
- To avoid accidentally picking a nested fixture package.json under
packages/<root>/..., you could stop the upward search once you’ve successfully checkedpackages/<firstSegment>(the canonical workspace package root) rather than iterating all the way from deepest to shallowest. This would better match the “packages/*/package.json are real packages” convention. Based on learnings, workspace packages live directly underpackages/.- If this logic ever needs to scale to larger diffs, you could memoize the mapping from
potentialPackageDir→ resolved package name so multiple changed files under the same directory don’t repeatedly hit the filesystem.Overall, the change looks sound and should make changed‑package detection far more reliable.
.github/actions/size-limit/src/size-limit/package.ts (1)
95-115: Externalizing Node built‑ins and peerDependencies inignorealigns with size‑limit goalsTreating Node built‑ins and peerDependencies as ignored (i.e., external) when using the esbuild preset is a good fit for measuring just the library’s own bundle size, and it complements the temp
package.jsonthat still installs peerDependencies for resolution.Two small, optional tweaks:
- You could precompute the peer dependency keys once (e.g.
const peerDepNames = packageJson.peerDependencies ? Object.keys(packageJson.peerDependencies) : [];) and reuse inside themapto avoid recomputing per‑config.- It’s worth double‑checking against the versioned size‑limit docs that
ignoreis still the right knob for feeding esbuild’sexternallist in@size-limit/preset-small-lib11.2.0, just to ensure behavior doesn’t change subtly on upgrade.Functionally this looks correct and should reduce spurious bundling and output parsing issues.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/actions/size-limit/src/package/changes.ts(1 hunks).github/actions/size-limit/src/size-limit/package.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Consider bundle size impact when adding new dependencies - aspirational goal: <1kB gzipped, enforced limit: 2kB gzipped
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Applies to packages/*/package.json : Packages in packages/ directory must be published to npm and require changesets for versioning, proper exports, and type definitions
Applied to files:
.github/actions/size-limit/src/package/changes.ts.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Always run `pnpm changeset` for version bumps in published packages - never skip changesets
Applied to files:
.github/actions/size-limit/src/package/changes.ts
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Only packages in packages/ directory are published to npm; publishing is handled by changesets using pnpm release
Applied to files:
.github/actions/size-limit/src/package/changes.ts
📚 Learning: 2025-11-29T08:00:08.044Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/pnpm.mdc:0-0
Timestamp: 2025-11-29T08:00:08.044Z
Learning: Organize workspace packages into appropriate directories: `packages/` for published npm packages, `apps/` for applications, `tooling/` for development tools (not published), and `examples/` for example projects
Applied to files:
.github/actions/size-limit/src/package/changes.ts
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Applies to tooling/*/package.json : Tooling in tooling/ directory contains development and testing tools that are not published to npm and excluded from changesets
Applied to files:
.github/actions/size-limit/src/package/changes.ts.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-29T08:00:08.044Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/pnpm.mdc:0-0
Timestamp: 2025-11-29T08:00:08.044Z
Learning: Applies to package.json : Configure only built dependencies (native modules) in `pnpm.onlyBuiltDependencies`, including: biomejs/biome, sentry/cli, swc/core, tailwindcss/oxide, vercel/speed-insights, esbuild, and sharp
Applied to files:
.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Prefer tree-shakeable exports for better bundling
Applied to files:
.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Consider bundle size impact when adding new dependencies - aspirational goal: <1kB gzipped, enforced limit: 2kB gzipped
Applied to files:
.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling
Applied to files:
.github/actions/size-limit/src/size-limit/package.ts
📚 Learning: 2025-11-29T08:57:24.056Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-29T08:57:24.056Z
Learning: Applies to examples/with-bun-react/**/*.{html,ts,tsx,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
Applied to files:
.github/actions/size-limit/src/size-limit/package.ts
🧬 Code graph analysis (2)
.github/actions/size-limit/src/package/changes.ts (2)
.github/actions/size-limit/src/results.ts (3)
results(71-93)result(86-87)results(5-66).github/actions/size-limit/src/utils/parser.ts (1)
currentPackage(42-69)
.github/actions/size-limit/src/size-limit/package.ts (3)
.github/actions/size-limit/src/output.ts (1)
Promise(40-51).github/actions/size-limit/src/results.ts (1)
results(5-66).github/actions/size-limit/src/npm/baseline.ts (1)
filter(11-139)
Closes #502
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.