@@ -47,7 +47,7 @@ export const packageManagers = [
4747 action : 'add' ,
4848 executeLocal : 'deno run' ,
4949 executeRemote : 'deno run' ,
50- create : 'deno run ' ,
50+ create : 'deno create ' ,
5151 icon : 'i-simple-icons:deno' ,
5252 } ,
5353 {
@@ -125,6 +125,24 @@ export interface ExecuteCommandOptions extends InstallCommandOptions {
125125 isCreatePackage ?: boolean
126126}
127127
128+ function getCreatePackageSpecifier ( options : ExecuteCommandOptions ) : string | null {
129+ if ( ! options . isCreatePackage ) {
130+ return null
131+ }
132+
133+ const shortName = getCreateShortName ( options . packageName )
134+ if ( shortName === options . packageName ) {
135+ return null
136+ }
137+
138+ if ( options . packageManager === 'deno' ) {
139+ // npm compatibility: npm:package-name
140+ return `npm:${ shortName } `
141+ }
142+
143+ return shortName
144+ }
145+
128146export function getExecuteCommand ( options : ExecuteCommandOptions ) : string {
129147 return getExecuteCommandParts ( options ) . join ( ' ' )
130148}
@@ -133,12 +151,10 @@ export function getExecuteCommandParts(options: ExecuteCommandOptions): string[]
133151 const pm = packageManagers . find ( p => p . id === options . packageManager )
134152 if ( ! pm ) return [ ]
135153
136- // For create-* packages, use the shorthand create command
137- if ( options . isCreatePackage ) {
138- const shortName = getCreateShortName ( options . packageName )
139- if ( shortName !== options . packageName ) {
140- return [ ...pm . create . split ( ' ' ) , shortName ]
141- }
154+ // For create-* packages, use the shorthand create command.
155+ const createSpecifier = getCreatePackageSpecifier ( options )
156+ if ( createSpecifier ) {
157+ return [ ...pm . create . split ( ' ' ) , createSpecifier ]
142158 }
143159
144160 // Choose remote or local execute based on package type
0 commit comments