Skip to content

fix: create packages being broken for scoped packages#2079

Merged
serhalp merged 1 commit intonpmx-dev:mainfrom
lino-levan:lino/fix-get-create-short-name
Mar 15, 2026
Merged

fix: create packages being broken for scoped packages#2079
serhalp merged 1 commit intonpmx-dev:mainfrom
lino-levan:lino/fix-get-create-short-name

Conversation

@lino-levan
Copy link
Contributor

🧭 Context

I noticed a couple of bugs on the create package suggestions and wondered what the root cause was. This was it. According to the npm docs (https://docs.npmjs.com/cli/v11/commands/npm-init), @scope/create-package should be called with npm create @scope/package. Code existed that handled that case, but it was... wrong? Idk how that happened. I also noticed we didn't handle @scope/create correctly either so I fixed both and added tests.

@vercel
Copy link

vercel bot commented Mar 15, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 15, 2026 0:56am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 15, 2026 0:56am
npmx-lunaria Ignored Ignored Mar 15, 2026 0:56am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8bb7840-e6a1-439f-8f24-c887c49497a0

📥 Commits

Reviewing files that changed from the base of the PR and between a170292 and e5c46e7.

📒 Files selected for processing (3)
  • shared/utils/package-analysis.ts
  • test/unit/app/utils/install-command.spec.ts
  • test/unit/shared/utils/package-analysis.spec.ts

📝 Walkthrough

Walkthrough

The changes modify the getCreateShortName function in the package analysis utility to provide scope-aware handling for scoped create-* packages. For scoped packages, the function now preserves the package scope in its return value. When the package name is create or starts with create-, the function returns the scope with the appropriate suffix. For example, @scope/create returns @scope, and @scope/create-foo returns @scope/foo. Non-scoped packages maintain their existing behaviour. Corresponding test cases have been updated to reflect these new scoped package handling patterns.

Suggested reviewers

  • danielroe
  • wojtekmaj
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly identifies a bug fix for scoped package handling in create-package suggestions, references npm documentation, and explains the specific cases addressed.

✏️ 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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
shared/utils/package-analysis.ts 0.00% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

Thank you!

@serhalp serhalp added this pull request to the merge queue Mar 15, 2026
Merged via the queue into npmx-dev:main with commit c784a68 Mar 15, 2026
20 checks passed
@github-actions github-actions bot mentioned this pull request Mar 15, 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.

2 participants