File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/create-gen-app/src Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ type LicenseTemplateMap = Record<string, string>;
1414let cachedTemplates : LicenseTemplateMap | null = null ;
1515
1616export type SupportedLicense = string ;
17+ export const DEFAULT_LICENSE = 'MIT' ;
18+ export const CLOSED_LICENSE = 'CLOSED' ;
1719export const LICENSE_VALUE_KEYS = [ 'LICENSE' , 'license' ] ;
1820export const LICENSE_AUTHOR_KEYS = [
1921 'USERFULLNAME' ,
@@ -67,7 +69,15 @@ export function renderLicense(
6769}
6870
6971export function listSupportedLicenses ( ) : string [ ] {
70- return Object . keys ( loadLicenseTemplates ( ) ) ;
72+ const licenses = Object . keys ( loadLicenseTemplates ( ) ) ;
73+ // Sort with DEFAULT_LICENSE first, CLOSED_LICENSE last, then alphabetically
74+ return licenses . sort ( ( a , b ) => {
75+ if ( a === DEFAULT_LICENSE ) return - 1 ;
76+ if ( b === DEFAULT_LICENSE ) return 1 ;
77+ if ( a === CLOSED_LICENSE ) return 1 ;
78+ if ( b === CLOSED_LICENSE ) return - 1 ;
79+ return a . localeCompare ( b ) ;
80+ } ) ;
7181}
7282
7383export function findLicenseValue (
You can’t perform that action at this time.
0 commit comments