Skip to content

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

Merged
ghostdevv merged 7 commits intonpmx-dev:mainfrom
knotbin:deno-create-cmd
Apr 4, 2026
Merged

fix: command for create-* packages in Deno#2357
ghostdevv merged 7 commits intonpmx-dev:mainfrom
knotbin:deno-create-cmd

Conversation

@knotbin
Copy link
Copy Markdown
Contributor

@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 4, 2026 7:30pm
npmx.dev Ready Ready Preview, Comment Apr 4, 2026 7:30pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Apr 4, 2026 7:30pm

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 61.11111% 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 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 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: 1d9c0b4f-1be8-46cd-9fc2-4c8db113b664

📥 Commits

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

📒 Files selected for processing (1)
  • app/utils/install-command.ts
✅ Files skipped from review due to trivial changes (1)
  • app/utils/install-command.ts

📝 Walkthrough

Walkthrough

Updated command generation so Deno uses deno create with an npm-compatible specifier for create-* packages instead of deno run. Introduced an internal helper getCreatePackageSpecifier to derive and suppress redundant specifiers when the derived short name equals the original package name. Refactored getExecuteCommandParts to delegate create-package specifier handling to that helper. Updated unit tests and the Terminal Install component to use the revised execute-command logic. Total changes: ~+23/−7 across the install-command utility, its tests, and the Install Vue component.

Possibly related PRs

Suggested reviewers

  • serhalp
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly addresses issue #2337 and explains the fix changes Deno create commands from incorrect deno run to correct deno create npm: format.
Linked Issues check ✅ Passed The PR implements the fix for issue #2337 by changing Deno create commands to use deno create npm: format, directly addressing the reported incorrect command generation.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing Deno create command generation and related test updates, with no extraneous modifications 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
Contributor 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
Contributor 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
knotbin and others added 2 commits April 4, 2026 15:27
Co-authored-by: Willow (GHOST) <ghostdevbusiness@gmail.com>
@ghostdevv ghostdevv added this pull request to the merge queue Apr 4, 2026
Merged via the queue into npmx-dev:main with commit 4c41b7b Apr 4, 2026
20 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Thanks for your first contribution, @knotbin! 🙌

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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