Skip to content

fix: command for create-* packages in Deno#2357

Open
knotbin wants to merge 5 commits intonpmx-dev:mainfrom
knotbin:deno-create-cmd
Open

fix: command for create-* packages in Deno#2357
knotbin wants to merge 5 commits intonpmx-dev:mainfrom
knotbin:deno-create-cmd

Conversation

@knotbin
Copy link
Copy Markdown

@knotbin knotbin commented Apr 1, 2026

🔗 Linked issue

resolves #2337

🧭 Context

For example package create-example, Current Deno command deno run example is incorrect and errors out.

This PR fixes that and changes it to the correct deno create command.

📚 Description

This is a simple change that just changes the Deno command for create to the correct deno create npm:example command.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Apr 3, 2026 7:15pm
npmx.dev Ready Ready Preview, Comment Apr 3, 2026 7:15pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Apr 3, 2026 7:15pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Hello! Thank you for opening your first PR to npmx, @knotbin! 🚀

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@knotbin knotbin changed the title fix: Deno command for create- packages fix: command for create-* packages in Deno Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/components/Terminal/Install.vue 0.00% 4 Missing and 2 partials ⚠️
app/utils/install-command.ts 92.30% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

This PR updates Deno's package managers configuration to use deno create instead of deno run for create-* packages. It refactors the create-* handling by introducing getCreatePackageSpecifier and updates command generation to use npm-style compatibility (npm:${shortName}) for Deno. Changes are made across three files: the install command utility, its unit tests, and the Terminal Install Vue component, with approximately 23 additions and 7 deletions total.

Possibly related PRs

Suggested reviewers

  • serhalp
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly explains the fix: changing Deno's create command from the incorrect deno run example to the correct deno create npm:example for create-* packages.
Linked Issues check ✅ Passed The PR implements the fix for #2337 by updating Deno's create command handling to use deno create npm:example instead of the incorrect deno run example.
Out of Scope Changes check ✅ Passed All changes focus on fixing Deno's create command handling and are directly related to resolving issue #2337; no out-of-scope changes detected.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (1)
test/unit/app/utils/install-command.spec.ts (1)

397-417: Consider adding test coverage for Deno scoped create packages.

The scoped create package tests only cover npm. Since the Deno implementation now includes the npm: prefix handling (lines 140-142 in install-command.ts), it would be beneficial to verify this works correctly for scoped packages like @vue/create-app['deno', 'create', 'npm:@vue/app'].

🧪 Suggested test additions
       it('handles `@scope/create` pattern', () => {
         expect(
           getExecuteCommandParts({
             packageName: '@angular/create',
             packageManager: 'npm',
             isCreatePackage: true,
           }),
         ).toEqual(['npm', 'create', '@angular'])
       })
+
+      it('handles `@scope/create-app` pattern for deno with npm: prefix', () => {
+        expect(
+          getExecuteCommandParts({
+            packageName: '@vue/create-app',
+            packageManager: 'deno',
+            isCreatePackage: true,
+          }),
+        ).toEqual(['deno', 'create', 'npm:`@vue/app`'])
+      })
     })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e552c239-b5fb-47f2-941a-926cabf91abb

📥 Commits

Reviewing files that changed from the base of the PR and between 2af4011 and 71ba4c2.

📒 Files selected for processing (2)
  • app/utils/install-command.ts
  • test/unit/app/utils/install-command.spec.ts

Copy link
Copy Markdown
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

Could you take a look at the coderabbit suggestion?

@knotbin
Copy link
Copy Markdown
Author

knotbin commented Apr 1, 2026

@ghostdevv So sorry, I should have scrolled farther when I got the CodeRabbit review, I assumed the first comment was its full review. 😅

Comment on lines +140 to +142
if (options.packageManager === 'deno') {
return ['deno', 'create', `npm:${shortName}`]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we instead set the shortName to npm:? How are we handling the other cases where we need to prefix with npm: for deno?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added a helper function getCreatePackageSpecifier to handle this logic, similar to the getPackageSpecifier function that handles other cases of the npm: prefix.

This logic is purposefully separate from the other npm prefix logic because JSR is not yet handled (out of this PR's scope) for create-* packages and if checks for matching JSR packages of create-* packages are added in the future (as they are for the other logic), it would be very different from the JSR logic in getPackageSpecifier because:

  • jsr: specifier isn't needed for create command, unlike install command
  • JSR "create" or "template" packages are required to have a ./create export

@ghostdevv
Copy link
Copy Markdown
Contributor

@ghostdevv So sorry, I should have scrolled farther when I got the CodeRabbit review, I assumed the first comment was its full review. 😅

no worries!

Copy link
Copy Markdown
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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: face9f72-296d-40a4-acec-f22fb58083dd

📥 Commits

Reviewing files that changed from the base of the PR and between 71ba4c2 and ad11fa9.

📒 Files selected for processing (3)
  • app/components/Terminal/Install.vue
  • app/utils/install-command.ts
  • shared/utils/package-analysis.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/utils/install-command.ts

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
app/utils/install-command.ts (1)

128-144: Well-structured helper function for Deno npm compatibility.

The new getCreatePackageSpecifier function cleanly encapsulates the logic for generating create package specifiers with appropriate Deno-specific handling (npm: prefix). The guard at lines 135-137 is a sensible defensive check to ensure we only use the create command flow when an actual transformation occurred.

One minor consideration: if getCreateShortName ever returns an empty string unexpectedly, Deno would receive npm: as the specifier. Consider whether additional validation is warranted:

💡 Optional defensive check
   const shortName = getCreateShortName(packageName)
-  if (shortName === packageName) {
+  if (!shortName || shortName === packageName) {
     return null
   }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bcdeb143-59ad-4a65-8950-4485ef929e6a

📥 Commits

Reviewing files that changed from the base of the PR and between ad11fa9 and 78dd9c4.

📒 Files selected for processing (1)
  • app/utils/install-command.ts

@knotbin knotbin requested a review from ghostdevv April 3, 2026 19:11
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.

Deno command for create- packages is wrong/non-functional

2 participants