Skip to content

perf(core): update package manager and fix paths#276

Merged
stephansama merged 5 commits into
mainfrom
stephansama/ste-192-migrate-to-pnpm-11
May 15, 2026
Merged

perf(core): update package manager and fix paths#276
stephansama merged 5 commits into
mainfrom
stephansama/ste-192-migrate-to-pnpm-11

Conversation

@stephansama
Copy link
Copy Markdown
Owner

Checklist

  • Latest changes from main have been merged
  • Conflicts have been resolved
  • The branch is pointing to main
  • Eslint hasn't reported any issues.
  • All unit tests pass

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
packages Ready Ready Preview, Comment May 15, 2026 3:35am

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 67ece3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the pnpm version to 11.1.2, refactors workspace build configurations to use the new allowBuilds field, and adjusts file paths in several package.json files. The prepare-local.ts script was modified to ensure local binaries are correctly linked, though feedback suggests this implementation could cause recursive execution loops and unnecessary overhead in CI environments. Additionally, a safety check was recommended to prevent the script from crashing if the node_modules/.bin directory is missing.

Comment on lines +51 to 53
if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Executing pnpm install from within a script called by the prepare hook (which is itself triggered by pnpm install) can cause recursive execution. While it might terminate after the second run if no more builds are needed, it significantly increases installation time and can lead to lockfile contention. Consider if this automatic re-install is strictly necessary or if there's a more efficient way to ensure binaries are linked, such as a manual step or a more targeted linking script.

import * as fs from "node:fs";
import path from "node:path";

if (process.env.CI) process.exit(0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The removal of the process.env.CI check will cause this script to run in CI environments. Since this script triggers builds for workspace packages, it may lead to redundant build steps if your CI pipeline already handles building. It's generally recommended to keep this check to avoid unnecessary overhead in CI.


const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = await fs.promises.readdir(nodeBinDirectory);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The fs.promises.readdir call will throw an error if the node_modules/.bin directory does not exist. It is safer to check for the directory's existence before attempting to read it to prevent the script from crashing.

const nodeBins = fs.existsSync(nodeBinDirectory) ? await fs.promises.readdir(nodeBinDirectory) : [];

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Review Change Stack

Warning

Rate limit exceeded

@stephansama has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 4 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 710d72d0-ed7a-4dc3-b808-ccf53b25f77f

📥 Commits

Reviewing files that changed from the base of the PR and between f060ebd and 67ece3b.

📒 Files selected for processing (13)
  • .github/workflows/check-skills.yml
  • core/ai-commit-msg/package.json
  • core/astro-iconify-svgmap/package.json
  • core/auto-readme/package.json
  • core/catppuccin-jsonresume-theme/package.json
  • core/eslint-config/package.json
  • core/multipublish/package.json
  • core/typed-events/package.json
  • core/typed-nocodb-api/package.json
  • core/typed-templates/package.json
  • core/types-lhci/package.json
  • scripts/src/prepare-local.ts
  • turbo.json
📝 Walkthrough

Walkthrough

The PR normalizes package distribution file path formats, upgrades PNPM to version 11.1.2 with revised workspace build allowlist configuration, and enhances the local build preparation script with binary entry detection and conditional dependency installation.

Changes

Build and package configuration updates

Layer / File(s) Summary
Package distribution path normalization
core/auto-readme/package.json, core/multipublish/package.json
Distribution file paths in package publish whitelists are normalized from ./dist/./config to dist/config, and the multipublish schema export is redirected from config to dist directory.
PNPM version and workspace build configuration
package.json, pnpm-workspace.yaml
PNPM is upgraded to 11.1.2, and workspace build configuration transitions from ignoredBuiltDependencies/onlyBuiltDependencies to an allowBuilds map that enables esbuild and lefthook while disabling builds for optional dependencies.
Build script binary detection and conditional install
scripts/types/packagejson.d.ts, scripts/src/prepare-local.ts
PackageJSON type is extended with an optional bin field, and prepare-local.ts refactors dependency collection, removes CI early-exit, and adds binary detection with conditional pnpm install when expected binaries are missing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • stephansama/packages#264: Both PRs modify scripts/src/prepare-local.ts, updating how workspace package detection and binary outputs are handled during local builds.
  • stephansama/packages#257: Both PRs extend the PackageJSON interface in scripts/types/packagejson.d.ts for the @manypkg/tools module.
  • stephansama/packages#187: The multipublish schema export path change from config/ to dist/ aligns with the new package structure introduced in that PR.

Poem

🐰 The bins are bustling, paths made clean,
With PNPM upgraded to the latest scene,
We normalize the dot-slashes with care,
And builds now detect what binaries are there! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: updating the package manager to pnpm 11 and fixing package.json paths/exports across multiple files.
Description check ✅ Passed The description matches the required template with all checklist items completed, though it lacks substantive detail about the actual changes made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stephansama/ste-192-migrate-to-pnpm-11

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 15, 2026

Open in StackBlitz

@stephansama/ai-commit-msg

pnpm add https://pkg.pr.new/@stephansama/ai-commit-msg@276

@stephansama/alfred-kaomoji

pnpm add https://pkg.pr.new/@stephansama/alfred-kaomoji@276

@stephansama/astro-iconify-svgmap

pnpm add https://pkg.pr.new/@stephansama/astro-iconify-svgmap@276

@stephansama/auto-readme

pnpm add https://pkg.pr.new/@stephansama/auto-readme@276

@stephansama/catppuccin-jsonresume-theme

pnpm add https://pkg.pr.new/@stephansama/catppuccin-jsonresume-theme@276

@stephansama/catppuccin-opml

pnpm add https://pkg.pr.new/@stephansama/catppuccin-opml@276

@stephansama/catppuccin-rss

pnpm add https://pkg.pr.new/@stephansama/catppuccin-rss@276

@stephansama/catppuccin-typedoc

pnpm add https://pkg.pr.new/@stephansama/catppuccin-typedoc@276

@stephansama/catppuccin-xsl

pnpm add https://pkg.pr.new/@stephansama/catppuccin-xsl@276

@stephansama/eslint-config

pnpm add https://pkg.pr.new/@stephansama/eslint-config@276

create-stephansama-example

pnpm add https://pkg.pr.new/create-stephansama-example@276

@stephansama/find-makefile-targets

pnpm add https://pkg.pr.new/@stephansama/find-makefile-targets@276

@stephansama/github-env

pnpm add https://pkg.pr.new/@stephansama/github-env@276

@stephansama/multipublish

pnpm add https://pkg.pr.new/@stephansama/multipublish@276

@stephansama/prettier-plugin-handlebars

pnpm add https://pkg.pr.new/@stephansama/prettier-plugin-handlebars@276

@stephansama/remark-asciinema

pnpm add https://pkg.pr.new/@stephansama/remark-asciinema@276

@stephansama/single-file

pnpm add https://pkg.pr.new/@stephansama/single-file@276

@stephansama/svelte-social-share-links

pnpm add https://pkg.pr.new/@stephansama/svelte-social-share-links@276

@stephansama/typed-env

pnpm add https://pkg.pr.new/@stephansama/typed-env@276

@stephansama/typed-events

pnpm add https://pkg.pr.new/@stephansama/typed-events@276

@stephansama/typed-nocodb-api

pnpm add https://pkg.pr.new/@stephansama/typed-nocodb-api@276

@stephansama/typed-templates

pnpm add https://pkg.pr.new/@stephansama/typed-templates@276

@stephansama/types-github-action-env

pnpm add https://pkg.pr.new/@stephansama/types-github-action-env@276

@stephansama/types-lhci

pnpm add https://pkg.pr.new/@stephansama/types-lhci@276

commit: 67ece3b

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/multipublish/package.json`:
- Line 28: The package.json currently points the "types" field at a non-existent
path (./config/schema.d.cts); update the "types" entry to reference the
generated declaration inside dist (e.g., "./dist/schema.d.ts") so consumers can
find the emitted type definitions; edit the package.json "types" field to
"./dist/schema.d.ts" (or the exact generated file name) to match the schema
export ("./dist/schema.json") and the build setting that emits d.ts files.

In `@scripts/src/prepare-local.ts`:
- Around line 47-53: The code calls fs.promises.readdir(nodeBinDirectory)
without handling the case where node_modules/.bin doesn't exist; wrap that call
in a try/catch inside prepare-local (around the nodeBinDirectory/nodeBins logic)
so that on ENOENT (or other expected filesystem errors) you set nodeBins = []
(or fallback to an empty array) and optionally log a warning, and only call
cp.execSync(sh`pnpm install`, ...) when packageBins.some(bin =>
!nodeBins.includes(bin)) remains true; reference the existing symbols
nodeBinDirectory, nodeBins, fs.promises.readdir, packageBins, and cp.execSync
when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 99359456-9f95-4eed-9bbd-a4ef71b4c4f9

📥 Commits

Reviewing files that changed from the base of the PR and between 09f7eff and f060ebd.

📒 Files selected for processing (6)
  • core/auto-readme/package.json
  • core/multipublish/package.json
  • package.json
  • pnpm-workspace.yaml
  • scripts/src/prepare-local.ts
  • scripts/types/packagejson.d.ts

"./package.json": "./package.json",
"./schema": "./dist/schema.mjs",
"./schema.json": "./config/schema.json"
"./schema.json": "./dist/schema.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify schema.json and schema.d.cts locations in multipublish package

# Check if schema.json exists in dist after build
fd -t f 'schema.json' core/multipublish/

# Check if schema.d.cts exists in config
fd -t f 'schema.d.cts' core/multipublish/

# Check the build configuration to see where schema files are generated
cat core/multipublish/tsdown.config.ts 2>/dev/null || echo "No tsdown config found"

Repository: stephansama/packages

Length of output: 1126


🏁 Script executed:

cat -n core/multipublish/package.json | sed -n '25,35p'

Repository: stephansama/packages

Length of output: 410


🏁 Script executed:

fd -t f 'schema.d.*' core/multipublish/

Repository: stephansama/packages

Length of output: 46


🏁 Script executed:

grep -r "schema.d.cts" core/multipublish/ --include="*.ts" --include="*.js" --include="*.json"

Repository: stephansama/packages

Length of output: 131


Update the types field to point to the correct location in dist directory.

The types field on line 30 points to ./config/schema.d.cts, but this file does not exist. Since the schema export now points to ./dist/schema.json and the build is configured with dts: true for the schema entry, the type declaration file should be generated in the dist directory. Update the types field to ./dist/schema.d.ts or the appropriate generated file location to ensure the package exports valid type definitions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/multipublish/package.json` at line 28, The package.json currently points
the "types" field at a non-existent path (./config/schema.d.cts); update the
"types" entry to reference the generated declaration inside dist (e.g.,
"./dist/schema.d.ts") so consumers can find the emitted type definitions; edit
the package.json "types" field to "./dist/schema.d.ts" (or the exact generated
file name) to match the schema export ("./dist/schema.json") and the build
setting that emits d.ts files.

Comment on lines +47 to 53
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = await fs.promises.readdir(nodeBinDirectory);

if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add error handling for missing node_modules/.bin directory.

Line 49 calls fs.promises.readdir on node_modules/.bin/ without error handling. If the directory doesn't exist (e.g., on a fresh clone before any install), the script will crash with an unhandled promise rejection.

🛡️ Proposed fix to add error handling
 const dirname = path.dirname(url.fileURLToPath(import.meta.url));
 const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
-const nodeBins = await fs.promises.readdir(nodeBinDirectory);
+const nodeBins = fs.existsSync(nodeBinDirectory) 
+  ? await fs.promises.readdir(nodeBinDirectory)
+  : [];
 
 if (packageBins.some((bin) => !nodeBins.includes(bin))) {
   cp.execSync(sh`pnpm install`, { stdio: "inherit" });
 }
📝 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
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = await fs.promises.readdir(nodeBinDirectory);
if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = fs.existsSync(nodeBinDirectory)
? await fs.promises.readdir(nodeBinDirectory)
: [];
if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/src/prepare-local.ts` around lines 47 - 53, The code calls
fs.promises.readdir(nodeBinDirectory) without handling the case where
node_modules/.bin doesn't exist; wrap that call in a try/catch inside
prepare-local (around the nodeBinDirectory/nodeBins logic) so that on ENOENT (or
other expected filesystem errors) you set nodeBins = [] (or fallback to an empty
array) and optionally log a warning, and only call cp.execSync(sh`pnpm install`,
...) when packageBins.some(bin => !nodeBins.includes(bin)) remains true;
reference the existing symbols nodeBinDirectory, nodeBins, fs.promises.readdir,
packageBins, and cp.execSync when making the change.

@stephansama stephansama merged commit 15efa5b into main May 15, 2026
13 checks passed
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