File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed
Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,22 @@ image:
8282 fontSize: 100px
8383 icon: code
8484
85- packageManager: auto # composer | npm | yarn | auto | none
85+ # Declares the use of the package manager.
86+ # It is a regular string that will be substituted into the URL address.
87+ #
88+ # Reserved words: composer | npm | yarn | auto | none
89+ #
90+ # Any package manager name can be specified.
91+ #
92+ # By default, auto
93+ packageManager: auto
8694
8795 # By default, the package name is taken from the composer.json or package.json file.
8896 packageName: ''
8997
9098 # Add a prefix for global installation (` composer global require`, `npm install -g`)
99+ # The parameter will be ignored when a non-standard package manager name is specified in
100+ # the `packageManager` parameter.
91101 packageGlobal : false
92102
93103 # By default, the repository name will be used.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export interface ImageParameters {
44 fontSize : string ;
55 icon : string ;
66
7- packageManager : "composer" | "npm" | "yarn" | "auto" | "none" ;
7+ packageManager : "composer" | "npm" | "yarn" | "auto" | "none" | string ;
88 packageName ?: string ;
99 packageGlobal : boolean ;
1010
Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ const packageManager = (config: Config): string => {
3030 return `yarn${ visibility } add` ;
3131 case "auto" :
3232 return detectPackageManager ( config , visibility ) ;
33- default :
33+ case "none" :
3434 return "" ;
35+ default :
36+ return config . image . parameters . packageManager ;
3537 }
3638} ;
3739
Original file line number Diff line number Diff line change @@ -4,13 +4,16 @@ import type { Package } from "../types/package";
44
55export const hasComposer = ( config : Config ) : boolean =>
66 fileExists ( config , "composer.json" ) ;
7+
78export const hasNpm = ( config : Config ) : boolean =>
89 fileExists ( config , "package.json" ) ;
10+
911export const hasYarn = ( config : Config ) : boolean =>
1012 fileExists ( config , "yarn.lock" ) ;
1113
1214export const getComposer = ( config : Config ) : Package =>
1315 < Package > JSON . parse ( readFile ( config , "composer.json" ) ) ;
16+
1417export const getNpm = ( config : Config ) : Package =>
1518 < Package > JSON . parse ( readFile ( config , "package.json" ) ) ;
1619
You can’t perform that action at this time.
0 commit comments