Skip to content

feat(package): add node-plop and related dependencies#228

Merged
stephansama merged 6 commits into
mainfrom
stephansama/ste-121-update-turbo-template
Feb 28, 2026
Merged

feat(package): add node-plop and related dependencies#228
stephansama merged 6 commits into
mainfrom
stephansama/ste-121-update-turbo-template

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 28, 2026

⚠️ No Changeset found

Latest commit: df0095a

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 28, 2026

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

Project Deployment Actions Updated (UTC)
packages Ready Ready Preview, Comment Feb 28, 2026 11:34pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 28, 2026

Warning

Rate limit exceeded

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

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 742412e and df0095a.

📒 Files selected for processing (4)
  • .prettierrc
  • turbo/generators/templates/cli/cli.mjs
  • turbo/generators/templates/cli/package.json
  • turbo/generators/templates/lib/package.json
📝 Walkthrough

Walkthrough

Adds a Plop-based generator system: three generators (cli, env, lib), shared prompt and action utilities, new templates and configs, and workspace/package changes including a node-plop devDependency and catalog rework. No runtime API surface removals.

Changes

Cohort / File(s) Summary
Workspace & Dependency
package.json, pnpm-workspace.yaml
Added node-plop devDependency; consolidated and restructured workspace catalog settings and entries; standardized quoting and added shellEmulator.
Generator Config
turbo/generators/config.ts
Removed single package generator; added cli, env, and lib generators wired to centralized prompts/actions.
Generator Utilities
turbo/generators/utils/actions.ts, turbo/generators/utils/prompts.ts, turbo/generators/utils/index.ts
New utilities: addTemplate, addAllCommon, addCommonFile; exported actions and prompts; added name and description prompt definitions.
CLI Template Files
turbo/generators/templates/cli/cli.mjs, turbo/generators/templates/cli/package.json, turbo/generators/templates/cli/src/index.ts
Added CLI boot script, templated package.json with bin entry, and exported async run() entrypoint.
Env Template Files
turbo/generators/templates/env/README.md, turbo/generators/templates/env/package.json, turbo/generators/templates/env/src/env.d.ts
Added env package README template, package manifest, and ambient ProcessEnv augmentation (ExtendEnvironment).
Lib Template & Common Config
turbo/generators/templates/lib/package.json, turbo/generators/templates/common/tsdown.config.ts, turbo/generators/templates/lib/README.md
Adjusted lib package.json structure (keywords, license, repository url, scripts); added exports: true to common tsdown.config.ts; added lib README template.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Plop as Plop Generator
    participant Prompts as Prompts (utils/prompts)
    participant Actions as Actions (utils/actions)
    participant Templates as Templates (templates/...)

    User->>Plop: run generator (cli/env/lib)
    Plop->>Prompts: request inputs (name, description)
    Prompts-->>Plop: validated responses
    Plop->>Actions: invoke addTemplate / addAllCommon
    Actions->>Templates: resolve template files
    Templates-->>Actions: provide template content
    Actions-->>Plop: files written to core/{{dashCase name}}
    Plop-->>User: generation complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A little plop and a gentle hop,

three seeds planted where one did stop.
Prompts ask kindly, actions take care,
templates blossom from root to fair.
Hooray — new scaffolds in the air! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 describes the main change—adding node-plop as a devDependency and refactoring related generator configuration and templates to support multiple generator types (cli, env, lib).
Description check ✅ Passed The description matches the provided template with all checklist items completed, though it only includes the checklist without additional context about the PR objectives.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch stephansama/ste-121-update-turbo-template

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.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates node-plop into the development dependencies and overhauls the Turborepo generator system. The changes introduce a more structured approach to creating new packages within the monorepo, allowing for distinct cli, env, and lib package types with their own predefined templates and configurations. This enhancement aims to standardize package creation and improve developer experience.

Highlights

  • Dependency Update: Added node-plop as a development dependency to the project, facilitating code generation capabilities.
  • Turborepo Generator Refactor: The Turborepo generator configuration has been significantly refactored, introducing modular actions and prompts utilities for better organization and reusability.
  • New Package Generator Types: Implemented new generator types for cli, env, and lib packages, replacing the previous generic 'package' generator with more specific and tailored templates.
  • PNPM Lockfile and Workspace Updates: The pnpm-lock.yaml file was updated to reflect the new dependencies and their resolutions, while pnpm-workspace.yaml was adjusted to streamline catalog definitions and include node-plop.
Changelog
  • package.json
    • Added node-plop to devDependencies.
  • pnpm-lock.yaml
    • Updated various package resolutions and added new transitive dependencies for node-plop.
    • Updated lru-cache from 11.2.4 to 11.2.6.
    • Updated undici from 7.16.0 to 7.22.0.
  • pnpm-workspace.yaml
    • Refactored catalog definitions, moving node-plop to the main catalog.
    • Removed actions-up and taze from the main catalog.
    • Reordered top-level properties for consistency.
  • turbo/generators/config.ts
    • Refactored the generator configuration to use external actions and prompts utilities.
    • Introduced new generator types (cli, env, lib) replacing the generic 'package' generator.
  • turbo/generators/templates/cli/cli.mjs
    • Added a new executable entry point script for CLI packages.
  • turbo/generators/templates/cli/package.json
    • Added a new package.json template for CLI packages.
  • turbo/generators/templates/cli/src/index.ts
    • Added a new default source file template for CLI packages.
  • turbo/generators/templates/common/tsconfig.json
    • Renamed and moved the tsconfig.json template to a common directory.
  • turbo/generators/templates/common/tsdown.config.ts
    • Renamed and moved the tsdown.config.ts template to a common directory.
    • Updated tsdown.config.ts to include exports: true and reordered properties.
  • turbo/generators/templates/common/typedoc.json
    • Renamed and moved the typedoc.json template to a common directory.
  • turbo/generators/templates/env/README.md
    • Added a new README.md template for environment packages.
  • turbo/generators/templates/env/package.json
    • Added a new package.json template for environment packages.
  • turbo/generators/templates/env/src/env.d.ts
    • Added a new type declaration file template for environment packages.
  • turbo/generators/templates/lib/README.md
    • Renamed and moved the README.md template for library packages.
    • Updated the repository directory in the README.md template.
  • turbo/generators/templates/lib/package.json
    • Renamed and moved the package.json template for library packages.
    • Updated the repository directory and keywords in the package.json template.
  • turbo/generators/templates/lib/src/index.ts
    • Renamed and moved the index.ts template for library packages.
  • turbo/generators/utils/actions.ts
    • Added a new utility file containing Plop action helpers for template generation.
  • turbo/generators/utils/index.ts
    • Added a new index file to export generator utility modules.
  • turbo/generators/utils/prompts.ts
    • Added a new utility file to define reusable Plop prompt definitions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 introduces node-plop for scaffolding new packages and refactors the existing generator configuration. The move to separate files for prompts and actions is a good improvement for maintainability and readability. I've identified a few minor issues in the new templates for package.json files, where some fields are hardcoded or use incorrect variables. These changes will ensure that newly generated packages have correct metadata from the start.

Comment on lines +2 to +11
"name": "{{name}}",
"version": "",
"description": "{{description}}",
"keywords": [],
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/github-env"
},
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 name field is not scoped, which is inconsistent with the homepage URL and other templates. Also, the repository.directory is hardcoded. It should use the dashCase version of the package name to match the directory created by the generator.

Suggested change
"name": "{{name}}",
"version": "",
"description": "{{description}}",
"keywords": [],
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/github-env"
},
"name": "@stephansama/{{name}}",
"version": "",
"description": "{{description}}",
"keywords": [],
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/{{dashCase name}}"
},

Comment on lines +5 to +10
"homepage": "https://packages.stephansama.info/api/@stephansama/github-env",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/github-env"
},
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 homepage and repository.directory fields are hardcoded. They should be generated dynamically using the package name.

Suggested change
"homepage": "https://packages.stephansama.info/api/@stephansama/github-env",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/github-env"
},
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/{{dashCase name}}"
},

Comment thread turbo/generators/templates/lib/package.json
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 28, 2026

More templates

@stephansama/ai-commit-msg

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

@stephansama/alfred-kaomoji

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

@stephansama/astro-iconify-svgmap

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

@stephansama/auto-readme

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

@stephansama/catppuccin-opml

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

@stephansama/catppuccin-rss

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

@stephansama/catppuccin-typedoc

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

@stephansama/catppuccin-xsl

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

create-stephansama-example

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

@stephansama/find-makefile-targets

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

@stephansama/github-env

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

@stephansama/multipublish

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

@stephansama/prettier-plugin-handlebars

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

@stephansama/remark-asciinema

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

@stephansama/svelte-social-share-links

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

@stephansama/typed-env

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

@stephansama/typed-events

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

@stephansama/typed-nocodb-api

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

@stephansama/typed-templates

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

@stephansama/types-lhci

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

commit: 324be19

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 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!

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: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@turbo/generators/templates/cli/cli.mjs`:
- Line 5: The CLI entrypoint currently calls
import("./dist/index.js").then((mod) => mod.run()) without handling failures;
change it to perform the dynamic import and call mod.run() inside a try/catch
(or use .catch) so both import() and the async run() rejection are caught, log
the error via console.error or a logger, and call process.exit(1) on failure to
ensure deterministic exit codes; target the import("./dist/index.js") call and
the exported run() invocation when adding the error handling.

In `@turbo/generators/templates/cli/package.json`:
- Line 10: The package.json template currently hardcodes repository.directory to
"core/github-env"; change it to use a template variable instead (replace the
literal "core/github-env" with the generator/template token that emits the
actual package path) so generated CLIs get correct repository metadata; update
the template's repository.directory field and ensure the generator that renders
this template (the CLI package generator) supplies the corresponding directory
value.
- Line 3: The template's package.json has an invalid empty "version" value;
change the default to a valid semver string (e.g., "0.1.0" or "1.0.0") so
generated packages meet npm/node-semver requirements—update the "version" field
in the CLI package.json template to a proper SemVer literal instead of an empty
string.

In `@turbo/generators/templates/env/package.json`:
- Around line 5-10: Replace the hardcoded package identity strings so generated
packages get correct metadata: change the "homepage" value and the
"repository.directory" (and if present the "repository.url" path segment
referencing the package) to use the template variable for the package name
instead of "github-env"; update the JSON keys "homepage" and
"repository.directory" to interpolate the package name template (the same
template used elsewhere for package name) so homepage and repo directory point
to the generated package rather than the hardcoded one.
- Around line 18-23: The package.json is pointing at a non-existent "types"
directory so declarations are excluded and linting fails; update the "files"
entry and the lint scripts to reference the actual declaration and source
location (e.g., "src" and/or "src/env.d.ts") instead of "types". Modify the
"files" array to include "src" (or "src/env.d.ts") and change the "lint" and
"lint:fix" scripts to run ESLint against "./src" (or the specific declaration
file) so generated packages include declarations and lint commands succeed;
update the entries named "files", "lint", and "lint:fix" accordingly.

In `@turbo/generators/templates/env/README.md`:
- Line 10: The "Table of contents" heading uses "##### Table of contents" which
jumps from H1 to H5; update that heading (the line containing "##### Table of
contents") to a consistent level such as "## Table of contents" or "### Table of
contents" so the README markdown uses sequential heading levels and proper
hierarchy.

In `@turbo/generators/templates/env/src/env.d.ts`:
- Line 7: Add a Biome suppression comment immediately above the intentional
empty extension interface to silence the noEmptyInterface rule: place a
single-line or block Biome ignore for noEmptyInterface directly before the
declaration of interface ExtendEnvironment so the empty interface remains but
linter noEmptyInterface is suppressed.

In `@turbo/generators/templates/lib/package.json`:
- Line 30: Update the packageManager field in the template package.json: replace
the pinned value "pnpm@10.11.0" with the repository baseline "pnpm@10.29.3" so
generated packages use the same Corepack/pnpm version as the rest of the repo;
edit the "packageManager" entry in turbo/generators/templates/lib/package.json
(the packageManager key currently set to pnpm@10.11.0) to pnpm@10.29.3.

In `@turbo/generators/utils/actions.ts`:
- Around line 23-27: The template path in addCommonFile currently uses a
relative templateFile ("templateFile: `templates/common/${file}`") which can
fail when the generator runs from a different cwd; update addCommonFile to build
the templateFile with the root token consistent with other actions (use the same
{{ turbo.paths.root }} prefix like the path field) so templateFile resolves to
the repo root + templates/common/${file}, leaving the rest of the return shape
(path, type: "add") unchanged.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d441a8a and d61ac1f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • package.json
  • pnpm-workspace.yaml
  • turbo/generators/config.ts
  • turbo/generators/templates/cli/cli.mjs
  • turbo/generators/templates/cli/package.json
  • turbo/generators/templates/cli/src/index.ts
  • turbo/generators/templates/common/tsconfig.json
  • turbo/generators/templates/common/tsdown.config.ts
  • turbo/generators/templates/common/typedoc.json
  • turbo/generators/templates/env/README.md
  • turbo/generators/templates/env/package.json
  • turbo/generators/templates/env/src/env.d.ts
  • turbo/generators/templates/lib/README.md
  • turbo/generators/templates/lib/package.json
  • turbo/generators/templates/lib/src/index.ts
  • turbo/generators/utils/actions.ts
  • turbo/generators/utils/index.ts
  • turbo/generators/utils/prompts.ts

Comment thread turbo/generators/templates/cli/cli.mjs Outdated
Comment thread turbo/generators/templates/cli/package.json Outdated
Comment thread turbo/generators/templates/cli/package.json Outdated
Comment thread turbo/generators/templates/env/package.json Outdated
Comment thread turbo/generators/templates/env/package.json Outdated

{{description}}

##### Table of contents
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 | 🟡 Minor

Fix heading level jump in template README.

Line 10 skips heading levels (H1 to H5). Use ## (or ###) for consistent markdown structure.

Proposed fix
-##### Table of contents
+## Table of contents
📝 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
##### Table of contents
## Table of contents
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 10-10: Heading levels should only increment by one level at a time
Expected: h2; Actual: h5

(MD001, heading-increment)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/env/README.md` at line 10, The "Table of contents"
heading uses "##### Table of contents" which jumps from H1 to H5; update that
heading (the line containing "##### Table of contents") to a consistent level
such as "## Table of contents" or "### Table of contents" so the README markdown
uses sequential heading levels and proper hierarchy.

}
}

interface ExtendEnvironment {}
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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Search for Biome configuration files
echo "=== Searching for Biome config files ==="
fd -type f \( -name "biome.json" -o -name "biome.jsonc" -o -name ".biomerc*" \)

echo ""
echo "=== Checking for Biome in package.json ==="
fd -type f -name "package.json" | head -5 | xargs -I {} sh -c 'echo "File: {}"; grep -i "biome" "{}" || echo "No biome reference found"'

echo ""
echo "=== Checking for Biome in pnpm-workspace.yaml or similar ==="
fd -type f \( -name "pnpm-workspace.yaml" -o -name "pnpm-workspace.yml" \) | xargs -I {} sh -c 'echo "File: {}"; cat "{}"'

Repository: stephansama/packages

Length of output: 740


🏁 Script executed:

#!/bin/bash

echo "=== Searching for Biome config files ==="
find . -maxdepth 2 -name "biome.json*" -o -name ".biomerc*"

echo ""
echo "=== Checking root and workspace structure ==="
ls -la | head -20

echo ""
echo "=== Searching for biome in package.json files ==="
find . -maxdepth 3 -name "package.json" -exec grep -l "biome" {} \;

echo ""
echo "=== Checking if Biome is referenced anywhere in config files ==="
rg -l "biome" --max-count 10 2>/dev/null || echo "No biome references found"

echo ""
echo "=== Check the specific file to understand context ==="
cat -n turbo/generators/templates/env/src/env.d.ts

Repository: stephansama/packages

Length of output: 1751


🏁 Script executed:

cat -n biome.json

Repository: stephansama/packages

Length of output: 2357


Add Biome suppression comment for empty interface extension point.

The noEmptyInterface rule is enabled in this repository's Biome configuration and will flag the empty interface on Line 7. While the empty interface is an intentional template extension point, it requires a suppression comment to comply with linting.

Proposed fix
-interface ExtendEnvironment {}
+// biome-ignore lint/suspicious/noEmptyInterface: Template extension point for project-specific env keys.
+interface ExtendEnvironment {}
📝 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
interface ExtendEnvironment {}
// biome-ignore lint/suspicious/noEmptyInterface: Template extension point for project-specific env keys.
interface ExtendEnvironment {}
🧰 Tools
🪛 Biome (2.4.4)

[error] 7-7: An empty interface is equivalent to {}.

(lint/suspicious/noEmptyInterface)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/env/src/env.d.ts` at line 7, Add a Biome
suppression comment immediately above the intentional empty extension interface
to silence the noEmptyInterface rule: place a single-line or block Biome ignore
for noEmptyInterface directly before the declaration of interface
ExtendEnvironment so the empty interface remains but linter noEmptyInterface is
suppressed.

"devDependencies": {
"tsdown": "catalog:"
},
"packageManager": "pnpm@10.11.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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# List packageManager values across repository manifests
rg -n '"packageManager"\s*:\s*"pnpm@[^"]+"' --glob '**/package.json'

# Also explicitly check the root package.json
echo "---"
echo "Root package.json packageManager:"
cat -n package.json | grep -A1 -B1 "packageManager"

Repository: stephansama/packages

Length of output: 1577


Align template packageManager version with repository baseline.

The template at turbo/generators/templates/lib/package.json pins pnpm@10.11.0, while the root and all other packages use pnpm@10.29.3. Keeping these aligned prevents Corepack version drift in generated packages.

Proposed fix
-	"packageManager": "pnpm@10.11.0",
+	"packageManager": "pnpm@10.29.3",
📝 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
"packageManager": "pnpm@10.11.0",
"packageManager": "pnpm@10.29.3",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/lib/package.json` at line 30, Update the
packageManager field in the template package.json: replace the pinned value
"pnpm@10.11.0" with the repository baseline "pnpm@10.29.3" so generated packages
use the same Corepack/pnpm version as the rest of the repo; edit the
"packageManager" entry in turbo/generators/templates/lib/package.json (the
packageManager key currently set to pnpm@10.11.0) to pnpm@10.29.3.

Comment on lines +23 to +27
export function addCommonFile<S extends string>(file: S) {
return {
path: `{{ turbo.paths.root }}/core/{{ dashCase name }}/${file}`,
templateFile: `templates/common/${file}`,
type: "add",
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

Fix template path resolution in addCommonFile (generator can fail).

Line 26 uses a relative template path while other actions use root-based paths. This can fail to locate common templates when the generator runs from a different cwd.

💡 Proposed fix
 export function addCommonFile<S extends string>(file: S) {
 	return {
 		path: `{{ turbo.paths.root }}/core/{{ dashCase name }}/${file}`,
-		templateFile: `templates/common/${file}`,
+		templateFile: `{{ turbo.paths.root }}/turbo/generators/templates/common/${file}`,
 		type: "add",
 	} as const;
 }
📝 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
export function addCommonFile<S extends string>(file: S) {
return {
path: `{{ turbo.paths.root }}/core/{{ dashCase name }}/${file}`,
templateFile: `templates/common/${file}`,
type: "add",
export function addCommonFile<S extends string>(file: S) {
return {
path: `{{ turbo.paths.root }}/core/{{ dashCase name }}/${file}`,
templateFile: `{{ turbo.paths.root }}/turbo/generators/templates/common/${file}`,
type: "add",
} as const;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/utils/actions.ts` around lines 23 - 27, The template path in
addCommonFile currently uses a relative templateFile ("templateFile:
`templates/common/${file}`") which can fail when the generator runs from a
different cwd; update addCommonFile to build the templateFile with the root
token consistent with other actions (use the same {{ turbo.paths.root }} prefix
like the path field) so templateFile resolves to the repo root +
templates/common/${file}, leaving the rest of the return shape (path, type:
"add") unchanged.

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: 3

♻️ Duplicate comments (3)
turbo/generators/templates/lib/package.json (1)

31-31: ⚠️ Potential issue | 🟡 Minor

Align template pnpm pin with repository baseline (still unresolved).

Line 31 still pins pnpm@10.11.0. If the repo baseline is newer, generated packages may drift in Corepack behavior/tooling.

Proposed fix
-	"packageManager": "pnpm@10.11.0",
+	"packageManager": "pnpm@10.29.3",

Run this read-only check to confirm the baseline before applying:

#!/bin/bash
# List packageManager pins across manifests
rg -n '"packageManager"\s*:\s*"pnpm@[^"]+"' --glob '**/package.json'

echo "--- Root package.json context ---"
rg -n -C1 '"packageManager"\s*:' package.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/lib/package.json` at line 31, The template's
packageManager pin ("packageManager" field in the template package.json) is out
of sync with the repository baseline; update the value to match the repo-wide
pnpm pin used as the baseline (replace "pnpm@10.11.0" with the baseline
version), and re-run the read-only scan across manifests to confirm consistency
before committing; locate the packageManager key in the template file
(packageManager) and change only the version string so generated packages use
the same Corepack/tooling pin as the rest of the repo.
turbo/generators/templates/cli/cli.mjs (1)

5-5: ⚠️ Potential issue | 🟠 Major

Handle bootstrap rejections explicitly in the CLI entrypoint.

Line 5 invokes import() + run() without a failure path. Catch both import and async run failures, log, and set a non-zero exit code.

Proposed fix
-import("./dist/index.js").then((mod) => mod.run());
+import("./dist/index.js")
+	.then((mod) => mod.run())
+	.catch((error) => {
+		console.error(error);
+		process.exitCode = 1;
+	});
#!/bin/bash
# Verify current bootstrap lacks explicit rejection handling.
cat -n turbo/generators/templates/cli/cli.mjs
rg -n 'import\("./dist/index\.js"\)\.then\(\(mod\) => mod\.run\(\)\);' turbo/generators/templates/cli/cli.mjs
rg -n '\.catch\(' turbo/generators/templates/cli/cli.mjs
# Expected: Line with `.then(...)` exists; no `.catch(` match in this file.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/cli/cli.mjs` at line 5, The CLI entrypoint calls
import("./dist/index.js").then((mod) => mod.run()) with no rejection handling;
update this bootstrap to catch both import and async run failures by chaining a
.catch handler (or using async/await with try/catch) that logs the error
(including stack/message) and calls process.exit with a non-zero code; target
the top-level invocation (the import(...) promise and the run() call) so any
errors from module loading or mod.run() are caught and handled.
turbo/generators/templates/cli/package.json (1)

3-3: ⚠️ Potential issue | 🔴 Critical

Use a valid SemVer default for version.

Line 3 sets an empty version, which is invalid for npm package metadata and can break packaging/publish tooling.

Proposed fix
-	"version": "",
+	"version": "0.1.0",
According to the npm package.json specification, is an empty string valid for the "version" field, and what SemVer format is required?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/cli/package.json` at line 3, The package.json
template currently sets "version" to an empty string which is invalid; update
the "version" field in the CLI template to a valid SemVer default (for example
"0.1.0") so npm tooling and publishing work correctly; locate the package.json
template entry for "version" and replace the empty string with a valid semantic
version (MAJOR.MINOR.PATCH) such as "0.1.0".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@turbo/generators/templates/lib/README.md`:
- Line 10: The "Table of contents" heading uses '##### Table of contents' which
jumps levels; update the heading level for "Table of contents" in README.md to
follow sequential markdown heading order (e.g., change to '## Table of contents'
or the next appropriate level directly following the document's top-level
heading) so headings increment by one level at a time to satisfy MD001.
- Line 25: Add a short placeholder under the "## Usage" heading in the template
README.md that demonstrates how consumers should populate the section (e.g., a
one-line comment or minimal example showing the intended usage pattern), so
users have a clear starting point when generating a new project; update the
content immediately below the "## Usage" heading to include that placeholder
guidance.
- Around line 5-6: The two NPM badge URLs are inconsistent: one uses URL-encoded
package name "%40stephansama%2F{{name}}" and the other uses the raw
"@stephansama/{{name}}"; update the raw occurrence to use the encoded form so
both badges use "%40stephansama%2F{{name}}", e.g., replace the string
"@stephansama/{{name}}" in the second badge link with
"%40stephansama%2F{{name}}" to ensure consistent encoding.

---

Duplicate comments:
In `@turbo/generators/templates/cli/cli.mjs`:
- Line 5: The CLI entrypoint calls import("./dist/index.js").then((mod) =>
mod.run()) with no rejection handling; update this bootstrap to catch both
import and async run failures by chaining a .catch handler (or using async/await
with try/catch) that logs the error (including stack/message) and calls
process.exit with a non-zero code; target the top-level invocation (the
import(...) promise and the run() call) so any errors from module loading or
mod.run() are caught and handled.

In `@turbo/generators/templates/cli/package.json`:
- Line 3: The package.json template currently sets "version" to an empty string
which is invalid; update the "version" field in the CLI template to a valid
SemVer default (for example "0.1.0") so npm tooling and publishing work
correctly; locate the package.json template entry for "version" and replace the
empty string with a valid semantic version (MAJOR.MINOR.PATCH) such as "0.1.0".

In `@turbo/generators/templates/lib/package.json`:
- Line 31: The template's packageManager pin ("packageManager" field in the
template package.json) is out of sync with the repository baseline; update the
value to match the repo-wide pnpm pin used as the baseline (replace
"pnpm@10.11.0" with the baseline version), and re-run the read-only scan across
manifests to confirm consistency before committing; locate the packageManager
key in the template file (packageManager) and change only the version string so
generated packages use the same Corepack/tooling pin as the rest of the repo.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d61ac1f and 742412e.

📒 Files selected for processing (6)
  • turbo/generators/templates/cli/cli.mjs
  • turbo/generators/templates/cli/package.json
  • turbo/generators/templates/cli/src/index.ts
  • turbo/generators/templates/env/package.json
  • turbo/generators/templates/lib/README.md
  • turbo/generators/templates/lib/package.json

Comment thread turbo/generators/templates/lib/README.md
Comment thread turbo/generators/templates/lib/README.md
Comment thread turbo/generators/templates/lib/README.md
@stephansama stephansama merged commit 9c085c8 into main Feb 28, 2026
10 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 10, 2026
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