Skip to content

Commit fe11e2e

Browse files
authored
Merge pull request #37 from constructive-io/devin/1766738956-default-license-mit
feat(create-gen-app): make MIT the default license
2 parents 3d31881 + d5ab753 commit fe11e2e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/create-gen-app/src/licenses.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type LicenseTemplateMap = Record<string, string>;
1414
let cachedTemplates: LicenseTemplateMap | null = null;
1515

1616
export type SupportedLicense = string;
17+
export const DEFAULT_LICENSE = 'MIT';
18+
export const CLOSED_LICENSE = 'CLOSED';
1719
export const LICENSE_VALUE_KEYS = ['LICENSE', 'license'];
1820
export const LICENSE_AUTHOR_KEYS = [
1921
'USERFULLNAME',
@@ -67,7 +69,15 @@ export function renderLicense(
6769
}
6870

6971
export 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

7383
export function findLicenseValue(

0 commit comments

Comments
 (0)