Skip to content

Commit 5cc5b9e

Browse files
Merge pull request #462 from chocolatey/release/1.2.1
(#460)(#458)(#194) choco-theme v1.2.1
2 parents f93f290 + af72170 commit 5cc5b9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1836
-1369
lines changed

CREDITS.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
677677
678678
```
679679

680-
#### [@eonasdan/tempus-dominus@6.10.3](https://github.com/Eonasdan/tempus-dominus)
680+
#### [@eonasdan/tempus-dominus@v6.10.4](https://github.com/Eonasdan/tempus-dominus)
681681

682682
[Repository Link](https://github.com/Eonasdan/tempus-dominus)
683683

684684
No additional license information is available for this package.
685685
Refer to the license text above, listed under [MIT License](#mit-license).
686686

687-
#### [@eslint/js@9.26.0](https://github.com/eslint/eslint)
687+
#### [@eslint/js@9.28.0](https://github.com/eslint/eslint)
688688

689689
[Repository Link](https://github.com/eslint/eslint)
690690

@@ -698,7 +698,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
698698
No additional license information is available for this package.
699699
Refer to the license text above, listed under [MIT License](#mit-license).
700700

701-
#### [@stylistic/eslint-plugin@4.2.0](https://github.com/eslint-stylistic/eslint-stylistic)
701+
#### [@stylistic/eslint-plugin@4.4.1](https://github.com/eslint-stylistic/eslint-stylistic)
702702

703703
[Repository Link](https://github.com/eslint-stylistic/eslint-stylistic)
704704

@@ -719,7 +719,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
719719
No additional license information is available for this package.
720720
Refer to the license text above, listed under [MIT License](#mit-license).
721721

722-
#### [@types/node@22.15.14](https://github.com/DefinitelyTyped/DefinitelyTyped)
722+
#### [@types/node@22.15.31](https://github.com/DefinitelyTyped/DefinitelyTyped)
723723

724724
[Repository Link](https://github.com/DefinitelyTyped/DefinitelyTyped)
725725

@@ -768,28 +768,28 @@ Refer to the license text above, listed under [MIT License](#mit-license).
768768
No additional license information is available for this package.
769769
Refer to the license text above, listed under [MIT License](#mit-license).
770770

771-
#### [[email protected].0](https://github.com/DataTables/Dist-DataTables-Bootstrap5)
771+
#### [[email protected].2](https://github.com/DataTables/Dist-DataTables-Bootstrap5)
772772

773773
[Repository Link](https://github.com/DataTables/Dist-DataTables-Bootstrap5)
774774

775775
No additional license information is available for this package.
776776
Refer to the license text above, listed under [MIT License](#mit-license).
777777

778-
#### [[email protected].0](https://github.com/DataTables/Dist-DataTables-DataTables)
778+
#### [[email protected].2](https://github.com/DataTables/Dist-DataTables-DataTables)
779779

780780
[Repository Link](https://github.com/DataTables/Dist-DataTables-DataTables)
781781

782782
No additional license information is available for this package.
783783
Refer to the license text above, listed under [MIT License](#mit-license).
784784

785-
#### [[email protected].4](https://github.com/evanw/esbuild)
785+
#### [[email protected].5](https://github.com/evanw/esbuild)
786786

787787
[Repository Link](https://github.com/evanw/esbuild)
788788

789789
No additional license information is available for this package.
790790
Refer to the license text above, listed under [MIT License](#mit-license).
791791

792-
#### [eslint@9.26.0](https://github.com/eslint/eslint)
792+
#### [eslint@9.28.0](https://github.com/eslint/eslint)
793793

794794
[Repository Link](https://github.com/eslint/eslint)
795795

@@ -887,7 +887,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
887887
No additional license information is available for this package.
888888
Refer to the license text above, listed under [MIT License](#mit-license).
889889

890-
#### [[email protected].3](https://github.com/postcss/postcss)
890+
#### [[email protected].4](https://github.com/postcss/postcss)
891891

892892
[Repository Link](https://github.com/postcss/postcss)
893893

@@ -922,7 +922,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
922922
No additional license information is available for this package.
923923
Refer to the license text above, listed under [MIT License](#mit-license).
924924

925-
#### [stylelint@16.19.1](https://github.com/stylelint/stylelint)
925+
#### [stylelint@16.20.0](https://github.com/stylelint/stylelint)
926926

927927
[Repository Link](https://github.com/stylelint/stylelint)
928928

@@ -950,7 +950,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
950950
No additional license information is available for this package.
951951
Refer to the license text above, listed under [MIT License](#mit-license).
952952

953-
#### [sweetalert2@11.21.0](https://github.com/sweetalert2/sweetalert2)
953+
#### [sweetalert2@11.22.0](https://github.com/sweetalert2/sweetalert2)
954954

955955
[Repository Link](https://github.com/sweetalert2/sweetalert2)
956956

@@ -978,7 +978,7 @@ Refer to the license text above, listed under [MIT License](#mit-license).
978978
No additional license information is available for this package.
979979
Refer to the license text above, listed under [MIT License](#mit-license).
980980

981-
#### [typescript-eslint@8.32.0](https://github.com/typescript-eslint/typescript-eslint)
981+
#### [typescript-eslint@8.34.0](https://github.com/typescript-eslint/typescript-eslint)
982982

983983
[Repository Link](https://github.com/typescript-eslint/typescript-eslint)
984984

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Chocolatey choco-theme 1.2.0
1+
# Chocolatey choco-theme 1.2.1
22

33
**NOTE: This project is used on Chocolatey websites and is being released for the benefit of the community. While we endeavour to help and fix issues, it will be limited to GitHub issues, discussions and pull requests when we are able to.**
44

build/build-partials.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ const init = async () => {
8787
replacementContentIsFile: false
8888
});
8989

90+
// astro files
91+
await updateContent({
92+
destination: destinationAstro,
93+
targetFile: 'SocialMedia.html',
94+
targetFileDestination: destinationAstro,
95+
targetFileContentToReplace: '@@chocolatey',
96+
replaceWithContent: '@chocolatey',
97+
replacementContentIsFile: false
98+
});
99+
90100
// Delete TopAlertBanner.html
91101
await fs.rm(path.join(destinationHbs, 'TopAlertBanner.html'));
92102
await fs.rm(path.join(destinationAstro, 'TopAlertBanner.html'));

build/credits-rename.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env ts-node
2+
3+
/*!
4+
* Script to rename the credits.json file.
5+
* Copyright 2020-2025 Chocolatey Software
6+
* Licensed under Apache License (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
7+
*/
8+
9+
import * as fs from 'fs/promises';
10+
11+
export const init = async () => {
12+
await fs.rename('./credits.json', './credits.old.json');
13+
};
14+
15+
init().catch(error => {
16+
console.error(error);
17+
process.exit(1);
18+
});

build/credits.ts

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
#!/usr/bin/env ts-node
2+
3+
/*!
4+
* Script to generate the credits.json file.
5+
* Copyright 2020-2025 Chocolatey Software
6+
* Licensed under Apache License (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
7+
*/
8+
9+
import * as fs from 'fs/promises';
10+
11+
const file = 'credits.json';
12+
const oldFile = 'credits.old.json';
13+
const packageJsonFile = 'package.json';
14+
const yellowOpen = '\x1b[33m';
15+
const yellowClose = '\x1b[0m';
16+
17+
interface DependencyEntry {
18+
name: string;
19+
link: string;
20+
version: string;
21+
licenseType?: string | string[];
22+
installedVersion?: string;
23+
licenses: {
24+
type: string;
25+
link: string;
26+
}[];
27+
}
28+
29+
interface OutputJson {
30+
name: string;
31+
version: string;
32+
dependencies: DependencyEntry[];
33+
}
34+
35+
const splitLicenses = (str: string) =>
36+
str
37+
.replace(/[()]/g, '')
38+
.split(/\s+(AND|OR)\s+/i)
39+
.filter(part => part !== 'AND' && part !== 'OR');
40+
41+
const init = async () => {
42+
const data = await fs.readFile(file, 'utf8');
43+
const rawArray: DependencyEntry[] = JSON.parse(data);
44+
45+
// Load old data if available
46+
let oldDependencies: Record<string, DependencyEntry> = {};
47+
try {
48+
const oldData = await fs.readFile(oldFile, 'utf8');
49+
const oldJson: OutputJson = JSON.parse(oldData);
50+
oldDependencies = Object.fromEntries(
51+
oldJson.dependencies.map(dep => [dep.name, dep])
52+
);
53+
} catch {
54+
console.warn(`${yellowOpen}No old file found or failed to parse. Proceeding with empty defaults.${yellowClose}`);
55+
}
56+
57+
for (const entry of rawArray) {
58+
// Rename installedVersion to version
59+
entry.version = entry.installedVersion;
60+
delete entry.installedVersion;
61+
62+
// Remove git+ and .git from urls
63+
if (entry.link) {
64+
entry.link = entry.link
65+
.replaceAll('git+', '')
66+
.replaceAll('.git', '')
67+
.replaceAll('git://', 'https://');
68+
}
69+
70+
// If no licenseType is provided
71+
if (!entry.licenseType) {
72+
switch (entry.name) {
73+
case 'block-ui':
74+
entry.licenseType = 'MIT';
75+
break;
76+
default:
77+
// Default to 'Other' if no specific license is known
78+
entry.licenseType = 'Other';
79+
console.warn(`${yellowOpen}No licenseType provided for ${entry.name}. Setting to 'Other'. License must be updated manually.${yellowClose}`);
80+
break;
81+
}
82+
}
83+
84+
// Manually update/keep licenseType if it contains multiple licenses
85+
switch (entry.name) {
86+
case 'chartist':
87+
case 'pwstrength-bootstrap':
88+
entry.licenseType = 'MIT';
89+
break;
90+
}
91+
92+
if (typeof entry.licenseType === 'string') {
93+
entry.licenseType = splitLicenses(entry.licenseType);
94+
}
95+
96+
const old = oldDependencies[entry.name];
97+
98+
// Set licenses array with preserved links if versions match
99+
entry.licenses = entry.licenseType.map(type => {
100+
const oldLink = old?.licenses?.find(l => l.type === type)?.link ?? '';
101+
const keepLink = old && old.version === entry.version;
102+
103+
if (!keepLink && oldLink) {
104+
console.warn(`${yellowOpen}License link for ${entry.name} has been removed. The license url must be manually updated.${yellowClose}`);
105+
}
106+
107+
return {
108+
type: type,
109+
link: keepLink ? oldLink : ''
110+
};
111+
});
112+
113+
// If no license link are found, warn the user
114+
if (!entry.licenses.some(l => l.link)) {
115+
console.warn(`${yellowOpen}No license link found for ${entry.name}. The license url must be manually updated.${yellowClose}`);
116+
}
117+
118+
// If the entry has multiple licenses, either add to the known multi-license packages or warn the user
119+
const knownMultiLicensePackages = ['@fortawesome/fontawesome-free'];
120+
121+
if (entry.licenses.length > 1) {
122+
if (!knownMultiLicensePackages.includes(entry.name)) {
123+
console.warn(`${yellowOpen}Multiple licenses detected for ${entry.name}. You must manually inspect and choose the correct license, or include multiple if needed.${yellowClose}`);
124+
}
125+
}
126+
127+
// Remove licenseType from the entry
128+
delete entry.licenseType;
129+
}
130+
131+
// Get the package.json content to extract the version
132+
const packageJsonContent = await fs.readFile(packageJsonFile, 'utf8');
133+
const parsedPackageJson = JSON.parse(packageJsonContent);
134+
135+
const wrapped: OutputJson = {
136+
name: 'choco-theme',
137+
version: parsedPackageJson.version,
138+
dependencies: rawArray
139+
};
140+
141+
// Generate the new file
142+
await fs.writeFile(file, JSON.stringify(wrapped, null, 4));
143+
144+
// Delete the old file if everything succeeded
145+
await fs.unlink(oldFile);
146+
};
147+
148+
init().catch(err => {
149+
console.error('Error generating credits.json:', err);
150+
process.exit(1);
151+
});

build/esbuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const init = async () => {
1313
const minify = process.argv.includes('--minify');
1414

1515
const banner = `/*!
16-
* choco-theme v1.2.0 (https://github.com/chocolatey/choco-theme#readme)
16+
* choco-theme v1.2.1 (https://github.com/chocolatey/choco-theme#readme)
1717
* Copyright 2020-2024 Chocolatey Software
1818
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
1919
*/`;

0 commit comments

Comments
 (0)