mirror of
https://github.com/LukeHagar/usage-statistics.git
synced 2025-12-06 04:21:55 +00:00
chore: bump version to 1.0.9 and build action
This commit is contained in:
10
dist/index.js
vendored
10
dist/index.js
vendored
@@ -64244,7 +64244,7 @@ async function createGitHubReleaseChart(platformMetrics, outputPath) {
|
|||||||
function groupByReleaseCumulative(releaseRange) {
|
function groupByReleaseCumulative(releaseRange) {
|
||||||
const releases = {};
|
const releases = {};
|
||||||
for (const release of releaseRange.sort((a, b) => {
|
for (const release of releaseRange.sort((a, b) => {
|
||||||
return semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0');
|
return semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim());
|
||||||
})) {
|
})) {
|
||||||
if (!release.tagName) {
|
if (!release.tagName) {
|
||||||
continue;
|
continue;
|
||||||
@@ -64258,7 +64258,7 @@ function groupByReleaseCumulative(releaseRange) {
|
|||||||
}
|
}
|
||||||
let cumulativeDownloads = 0;
|
let cumulativeDownloads = 0;
|
||||||
for (const release of Object.keys(releases).sort((a, b) => {
|
for (const release of Object.keys(releases).sort((a, b) => {
|
||||||
return semver.compare(a, b);
|
return semver.compare(a.trim(), b.trim());
|
||||||
})) {
|
})) {
|
||||||
cumulativeDownloads += releases[release].downloads;
|
cumulativeDownloads += releases[release].downloads;
|
||||||
releases[release].downloads = cumulativeDownloads;
|
releases[release].downloads = cumulativeDownloads;
|
||||||
@@ -64269,7 +64269,7 @@ async function createDownloadsPerReleaseChart(metric, outputPath) {
|
|||||||
const downloadsRange = metric.metrics?.downloadRange || [];
|
const downloadsRange = metric.metrics?.downloadRange || [];
|
||||||
const svgOutputPath = `${outputPath}/${metric.name.replace('/', '-')}-release-downloads.svg`;
|
const svgOutputPath = `${outputPath}/${metric.name.replace('/', '-')}-release-downloads.svg`;
|
||||||
const sortedReleases = downloadsRange.sort((a, b) => {
|
const sortedReleases = downloadsRange.sort((a, b) => {
|
||||||
return semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0');
|
return semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim());
|
||||||
});
|
});
|
||||||
const canvas = new Canvas(1000, 800);
|
const canvas = new Canvas(1000, 800);
|
||||||
const chart = new Chart(canvas, {
|
const chart = new Chart(canvas, {
|
||||||
@@ -64326,7 +64326,7 @@ async function createCumulativeDownloadsChart(metric, outputPath) {
|
|||||||
const groupedDownloads = groupByReleaseCumulative(downloadsRange);
|
const groupedDownloads = groupByReleaseCumulative(downloadsRange);
|
||||||
// Sort months chronologically
|
// Sort months chronologically
|
||||||
const semVerSortedReleases = Object.keys(groupedDownloads).sort((a, b) => {
|
const semVerSortedReleases = Object.keys(groupedDownloads).sort((a, b) => {
|
||||||
return semver.compare(a, b);
|
return semver.compare(a.trim(), b.trim());
|
||||||
});
|
});
|
||||||
const canvas = new Canvas(1000, 800);
|
const canvas = new Canvas(1000, 800);
|
||||||
const chart = new Chart(canvas, {
|
const chart = new Chart(canvas, {
|
||||||
@@ -64387,7 +64387,7 @@ async function createReleaseDownloadsChart(metric, outputPath) {
|
|||||||
.filter((release) => release.tagName && release.downloads > 0)
|
.filter((release) => release.tagName && release.downloads > 0)
|
||||||
.sort((a, b) => b.downloads - a.downloads)
|
.sort((a, b) => b.downloads - a.downloads)
|
||||||
.slice(0, 10) // Show top 10 releases
|
.slice(0, 10) // Show top 10 releases
|
||||||
.sort((a, b) => semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0'));
|
.sort((a, b) => semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim()));
|
||||||
if (sortedReleases.length === 0) {
|
if (sortedReleases.length === 0) {
|
||||||
// Return empty chart if no releases
|
// Return empty chart if no releases
|
||||||
return svgOutputPath;
|
return svgOutputPath;
|
||||||
|
|||||||
10
dist/summaries/github.js
vendored
10
dist/summaries/github.js
vendored
@@ -81,7 +81,7 @@ export async function createGitHubReleaseChart(platformMetrics, outputPath) {
|
|||||||
function groupByReleaseCumulative(releaseRange) {
|
function groupByReleaseCumulative(releaseRange) {
|
||||||
const releases = {};
|
const releases = {};
|
||||||
for (const release of releaseRange.sort((a, b) => {
|
for (const release of releaseRange.sort((a, b) => {
|
||||||
return semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0');
|
return semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim());
|
||||||
})) {
|
})) {
|
||||||
if (!release.tagName) {
|
if (!release.tagName) {
|
||||||
continue;
|
continue;
|
||||||
@@ -95,7 +95,7 @@ function groupByReleaseCumulative(releaseRange) {
|
|||||||
}
|
}
|
||||||
let cumulativeDownloads = 0;
|
let cumulativeDownloads = 0;
|
||||||
for (const release of Object.keys(releases).sort((a, b) => {
|
for (const release of Object.keys(releases).sort((a, b) => {
|
||||||
return semver.compare(a, b);
|
return semver.compare(a.trim(), b.trim());
|
||||||
})) {
|
})) {
|
||||||
cumulativeDownloads += releases[release].downloads;
|
cumulativeDownloads += releases[release].downloads;
|
||||||
releases[release].downloads = cumulativeDownloads;
|
releases[release].downloads = cumulativeDownloads;
|
||||||
@@ -106,7 +106,7 @@ export async function createDownloadsPerReleaseChart(metric, outputPath) {
|
|||||||
const downloadsRange = metric.metrics?.downloadRange || [];
|
const downloadsRange = metric.metrics?.downloadRange || [];
|
||||||
const svgOutputPath = `${outputPath}/${metric.name.replace('/', '-')}-release-downloads.svg`;
|
const svgOutputPath = `${outputPath}/${metric.name.replace('/', '-')}-release-downloads.svg`;
|
||||||
const sortedReleases = downloadsRange.sort((a, b) => {
|
const sortedReleases = downloadsRange.sort((a, b) => {
|
||||||
return semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0');
|
return semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim());
|
||||||
});
|
});
|
||||||
const canvas = new Canvas(1000, 800);
|
const canvas = new Canvas(1000, 800);
|
||||||
const chart = new Chart(canvas, {
|
const chart = new Chart(canvas, {
|
||||||
@@ -163,7 +163,7 @@ export async function createCumulativeDownloadsChart(metric, outputPath) {
|
|||||||
const groupedDownloads = groupByReleaseCumulative(downloadsRange);
|
const groupedDownloads = groupByReleaseCumulative(downloadsRange);
|
||||||
// Sort months chronologically
|
// Sort months chronologically
|
||||||
const semVerSortedReleases = Object.keys(groupedDownloads).sort((a, b) => {
|
const semVerSortedReleases = Object.keys(groupedDownloads).sort((a, b) => {
|
||||||
return semver.compare(a, b);
|
return semver.compare(a.trim(), b.trim());
|
||||||
});
|
});
|
||||||
const canvas = new Canvas(1000, 800);
|
const canvas = new Canvas(1000, 800);
|
||||||
const chart = new Chart(canvas, {
|
const chart = new Chart(canvas, {
|
||||||
@@ -224,7 +224,7 @@ export async function createReleaseDownloadsChart(metric, outputPath) {
|
|||||||
.filter((release) => release.tagName && release.downloads > 0)
|
.filter((release) => release.tagName && release.downloads > 0)
|
||||||
.sort((a, b) => b.downloads - a.downloads)
|
.sort((a, b) => b.downloads - a.downloads)
|
||||||
.slice(0, 10) // Show top 10 releases
|
.slice(0, 10) // Show top 10 releases
|
||||||
.sort((a, b) => semver.compare(a.tagName || '0.0.0', b.tagName || '0.0.0'));
|
.sort((a, b) => semver.compare((a.tagName || '0.0.0').trim(), (b.tagName || '0.0.0').trim()));
|
||||||
if (sortedReleases.length === 0) {
|
if (sortedReleases.length === 0) {
|
||||||
// Return empty chart if no releases
|
// Return empty chart if no releases
|
||||||
return svgOutputPath;
|
return svgOutputPath;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "usage-statistics",
|
"name": "usage-statistics",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "A comprehensive GitHub Action for tracking download statistics across multiple platforms",
|
"description": "A comprehensive GitHub Action for tracking download statistics across multiple platforms",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user