forked from mirrored/github-readme-stats
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08da088359 | ||
|
|
4d1d83d5e5 | ||
|
|
d8244a7fe5 | ||
|
|
b928f51442 | ||
|
|
32998295b7 | ||
|
|
2bd9d457ac | ||
|
|
c5063b92b6 | ||
|
|
b93aee34d0 | ||
|
|
ed18914fa4 | ||
|
|
1e61f9f3fe | ||
|
|
976771080f | ||
|
|
7bc8f19a7f | ||
|
|
9ec2c8367a | ||
|
|
a1c3c6accc | ||
|
|
8849b5f5fc |
@@ -35,6 +35,7 @@ export default async (req, res) => {
|
|||||||
locale,
|
locale,
|
||||||
disable_animations,
|
disable_animations,
|
||||||
border_radius,
|
border_radius,
|
||||||
|
number_format,
|
||||||
border_color,
|
border_color,
|
||||||
} = req.query;
|
} = req.query;
|
||||||
res.setHeader("Content-Type", "image/svg+xml");
|
res.setHeader("Content-Type", "image/svg+xml");
|
||||||
@@ -88,6 +89,7 @@ export default async (req, res) => {
|
|||||||
custom_title,
|
custom_title,
|
||||||
border_radius,
|
border_radius,
|
||||||
border_color,
|
border_color,
|
||||||
|
number_format,
|
||||||
locale: locale ? locale.toLowerCase() : null,
|
locale: locale ? locale.toLowerCase() : null,
|
||||||
disable_animations: parseBoolean(disable_animations),
|
disable_animations: parseBoolean(disable_animations),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
* @file Contains a simple cloud function that can be used to check which PATs are no
|
* @file Contains a simple cloud function that can be used to check which PATs are no
|
||||||
* longer working. It returns a list of valid PATs, expired PATs and PATs with errors.
|
* longer working. It returns a list of valid PATs, expired PATs and PATs with errors.
|
||||||
*
|
*
|
||||||
* @description This function is currently rate limited to 1 request per 10 minutes.
|
* @description This function is currently rate limited to 1 request per 5 minutes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { logger, request, dateDiff } from "../../src/common/utils.js";
|
import { logger, request, dateDiff } from "../../src/common/utils.js";
|
||||||
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 10 minutes
|
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 5 minutes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple uptime check fetcher for the PATs.
|
* Simple uptime check fetcher for the PATs.
|
||||||
|
|||||||
+2
-2
@@ -2,13 +2,13 @@
|
|||||||
* @file Contains a simple cloud function that can be used to check if the PATs are still
|
* @file Contains a simple cloud function that can be used to check if the PATs are still
|
||||||
* functional.
|
* functional.
|
||||||
*
|
*
|
||||||
* @description This function is currently rate limited to 1 request per 10 minutes.
|
* @description This function is currently rate limited to 1 request per 5 minutes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import retryer from "../../src/common/retryer.js";
|
import retryer from "../../src/common/retryer.js";
|
||||||
import { logger, request } from "../../src/common/utils.js";
|
import { logger, request } from "../../src/common/utils.js";
|
||||||
|
|
||||||
export const RATE_LIMIT_SECONDS = 60 * 10; // 1 request per 10 minutes
|
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 5 minutes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple uptime check fetcher for the PATs.
|
* Simple uptime check fetcher for the PATs.
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve!</p>
|
<p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve!</p>
|
||||||
|
|
||||||
<a href="https://indiafightscorona.giveindia.org">
|
<a href="https://indiafightscorona.giveindia.org">
|
||||||
<img src="https://indiaspora.org/wp-content/uploads/2021/04/give-India-logo.png" alt="Give india logo" width="200" />
|
<img src="https://cfstatic.give.do/logo.png" alt="Give india logo" width="200" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
Are you considering supporting the project by donating? Please DO NOT!!
|
Are you considering supporting the project by donating? Please DO NOT!!
|
||||||
@@ -289,6 +289,7 @@ You can provide multiple comma-separated values in the bg_color option to render
|
|||||||
- `text_bold` - Use bold text _(boolean)_. Default: `true`.
|
- `text_bold` - Use bold text _(boolean)_. Default: `true`.
|
||||||
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
|
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
|
||||||
- `ring_color` - Color of the rank circle _(hex color)_. Defaults to the theme ring color if it exists and otherwise the title color.
|
- `ring_color` - Color of the rank circle _(hex color)_. Defaults to the theme ring color if it exists and otherwise the title color.
|
||||||
|
- `number_format` - Switch between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). Default: `short`.
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
> When hide_rank=`true`, the minimum card width is 270 px + the title length and padding.
|
> When hide_rank=`true`, the minimum card width is 270 px + the title length and padding.
|
||||||
|
|||||||
+123
-56
@@ -43,6 +43,23 @@ const ACCEPTED_COLOR_PROPS = Object.keys(COLOR_PROPS);
|
|||||||
const REQUIRED_COLOR_PROPS = ACCEPTED_COLOR_PROPS.slice(0, 4);
|
const REQUIRED_COLOR_PROPS = ACCEPTED_COLOR_PROPS.slice(0, 4);
|
||||||
const INVALID_REVIEW_COMMENT = (commentUrl) =>
|
const INVALID_REVIEW_COMMENT = (commentUrl) =>
|
||||||
`Some themes are invalid. See the [Automated Theme Preview](${commentUrl}) comment above for more information.`;
|
`Some themes are invalid. See the [Automated Theme Preview](${commentUrl}) comment above for more information.`;
|
||||||
|
var OCTOKIT;
|
||||||
|
var OWNER;
|
||||||
|
var REPO;
|
||||||
|
var PULL_REQUEST_ID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Incorrect JSON format error.
|
||||||
|
* @extends Error
|
||||||
|
* @param {string} message Error message.
|
||||||
|
* @returns {Error} IncorrectJsonFormatError.
|
||||||
|
*/
|
||||||
|
class IncorrectJsonFormatError extends Error {
|
||||||
|
constructor(message) {
|
||||||
|
super(message);
|
||||||
|
this.name = "IncorrectJsonFormatError";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve PR number from the event payload.
|
* Retrieve PR number from the event payload.
|
||||||
@@ -126,15 +143,36 @@ const findComment = async (octokit, issueNumber, owner, repo, commenter) => {
|
|||||||
* Create or update the preview comment.
|
* Create or update the preview comment.
|
||||||
*
|
*
|
||||||
* @param {Object} octokit Octokit instance.
|
* @param {Object} octokit Octokit instance.
|
||||||
* @param {Object} props Comment properties.
|
* @param {number} issueNumber Issue number.
|
||||||
|
* @param {Object} repo Repository name.
|
||||||
|
* @param {Object} owner Owner of the repository.
|
||||||
|
* @param {number} commentId Comment ID.
|
||||||
|
* @param {string} body Comment body.
|
||||||
* @return {string} The comment URL.
|
* @return {string} The comment URL.
|
||||||
*/
|
*/
|
||||||
const upsertComment = async (octokit, props) => {
|
const upsertComment = async (
|
||||||
|
octokit,
|
||||||
|
issueNumber,
|
||||||
|
repo,
|
||||||
|
owner,
|
||||||
|
commentId,
|
||||||
|
body,
|
||||||
|
) => {
|
||||||
let resp;
|
let resp;
|
||||||
if (props.comment_id !== undefined) {
|
if (commentId !== undefined) {
|
||||||
resp = await octokit.issues.updateComment(props);
|
resp = await octokit.issues.updateComment({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
comment_id: commentId,
|
||||||
|
body,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
resp = await octokit.issues.createComment(props);
|
resp = await octokit.issues.createComment({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: issueNumber,
|
||||||
|
body,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return resp.data.html_url;
|
return resp.data.html_url;
|
||||||
};
|
};
|
||||||
@@ -269,22 +307,38 @@ const parseJSON = (json) => {
|
|||||||
if (typeof parsedJson === "object") {
|
if (typeof parsedJson === "object") {
|
||||||
return parsedJson;
|
return parsedJson;
|
||||||
} else {
|
} else {
|
||||||
throw new Error("PR diff is not a valid theme JSON object.");
|
throw new IncorrectJsonFormatError(
|
||||||
|
"PR diff is not a valid theme JSON object.",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
let parsedJson = json
|
// Remove trailing commas (if any).
|
||||||
|
let parsedJson = json.replace(/(,\s*})/g, "}");
|
||||||
|
|
||||||
|
// Remove JS comments (if any).
|
||||||
|
parsedJson = parsedJson.replace(/\/\/[A-z\s]*\s/g, "");
|
||||||
|
|
||||||
|
// Fix incorrect open bracket (if any).
|
||||||
|
const splitJson = parsedJson
|
||||||
.split(/([\s\r\s]*}[\s\r\s]*,[\s\r\s]*)(?=[\w"-]+:)/)
|
.split(/([\s\r\s]*}[\s\r\s]*,[\s\r\s]*)(?=[\w"-]+:)/)
|
||||||
.filter((x) => typeof x !== "string" || !!x.trim());
|
.filter((x) => typeof x !== "string" || !!x.trim()); // Split json into array of strings and objects.
|
||||||
if (parsedJson[0].replace(/\s+/g, "") === "},") {
|
if (splitJson[0].replace(/\s+/g, "") === "},") {
|
||||||
parsedJson[0] = "},";
|
splitJson[0] = "},";
|
||||||
if (!/\s*}\s*,?\s*$/.test(parsedJson[1])) {
|
if (!/\s*}\s*,?\s*$/.test(splitJson[1])) {
|
||||||
parsedJson.push(parsedJson.shift());
|
splitJson.push(splitJson.shift());
|
||||||
} else {
|
} else {
|
||||||
parsedJson.shift();
|
splitJson.shift();
|
||||||
}
|
}
|
||||||
return Hjson.parse(parsedJson.join(""));
|
parsedJson = splitJson.join("");
|
||||||
} else {
|
}
|
||||||
throw error;
|
|
||||||
|
// Try to parse the fixed json.
|
||||||
|
try {
|
||||||
|
return Hjson.parse(parsedJson);
|
||||||
|
} catch (error) {
|
||||||
|
throw new IncorrectJsonFormatError(
|
||||||
|
`Theme JSON file could not be parsed: ${error.message}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -303,7 +357,7 @@ const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
|||||||
/**
|
/**
|
||||||
* Main function.
|
* Main function.
|
||||||
*/
|
*/
|
||||||
export const run = async (prNumber) => {
|
export const run = async () => {
|
||||||
try {
|
try {
|
||||||
debug("Retrieve action information from context...");
|
debug("Retrieve action information from context...");
|
||||||
debug(`Context: ${inspect(github.context)}`);
|
debug(`Context: ${inspect(github.context)}`);
|
||||||
@@ -312,40 +366,50 @@ export const run = async (prNumber) => {
|
|||||||
\r${THEME_CONTRIB_GUIDELINESS}
|
\r${THEME_CONTRIB_GUIDELINESS}
|
||||||
`;
|
`;
|
||||||
const ccc = new ColorContrastChecker();
|
const ccc = new ColorContrastChecker();
|
||||||
const octokit = github.getOctokit(getGithubToken());
|
OCTOKIT = github.getOctokit(getGithubToken());
|
||||||
const pullRequestId = prNumber ? prNumber : getPrNumber();
|
PULL_REQUEST_ID = getPrNumber();
|
||||||
const commenter = getCommenter();
|
|
||||||
const { owner, repo } = getRepoInfo(github.context);
|
const { owner, repo } = getRepoInfo(github.context);
|
||||||
debug(`Owner: ${owner}`);
|
OWNER = owner;
|
||||||
debug(`Repo: ${repo}`);
|
REPO = repo;
|
||||||
|
const commenter = getCommenter();
|
||||||
|
PULL_REQUEST_ID = getPrNumber();
|
||||||
|
debug(`Owner: ${OWNER}`);
|
||||||
|
debug(`Repo: ${REPO}`);
|
||||||
debug(`Commenter: ${commenter}`);
|
debug(`Commenter: ${commenter}`);
|
||||||
|
|
||||||
// Retrieve the PR diff and preview-theme comment.
|
// Retrieve the PR diff and preview-theme comment.
|
||||||
debug("Retrieve PR diff...");
|
debug("Retrieve PR diff...");
|
||||||
const res = await octokit.pulls.get({
|
const res = await OCTOKIT.pulls.get({
|
||||||
owner,
|
owner: OWNER,
|
||||||
repo,
|
repo: REPO,
|
||||||
pull_number: pullRequestId,
|
pull_number: PULL_REQUEST_ID,
|
||||||
mediaType: {
|
mediaType: {
|
||||||
format: "diff",
|
format: "diff",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
debug("Retrieve preview-theme comment...");
|
debug("Retrieve preview-theme comment...");
|
||||||
const comment = await findComment(
|
const comment = await findComment(
|
||||||
octokit,
|
OCTOKIT,
|
||||||
pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
OWNER,
|
||||||
repo,
|
REPO,
|
||||||
commenter,
|
commenter,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Retrieve theme changes from the PR diff.
|
// Retrieve theme changes from the PR diff.
|
||||||
debug("Retrieve themes...");
|
debug("Retrieve themes...");
|
||||||
const diff = parse(res.data);
|
const diff = parse(res.data);
|
||||||
|
|
||||||
|
// Retrieve all theme changes from the PR diff and convert to JSON.
|
||||||
|
debug("Retrieve theme changes...");
|
||||||
const content = diff
|
const content = diff
|
||||||
.find((file) => file.to === "themes/index.js")
|
.find((file) => file.to === "themes/index.js")
|
||||||
.chunks[0].changes.filter((c) => c.type === "add")
|
.chunks.map((chunk) =>
|
||||||
.map((c) => c.content.replace("+", ""))
|
chunk.changes
|
||||||
|
.filter((c) => c.type === "add")
|
||||||
|
.map((c) => c.content.replace("+", ""))
|
||||||
|
.join(""),
|
||||||
|
)
|
||||||
.join("");
|
.join("");
|
||||||
const themeObject = parseJSON(content);
|
const themeObject = parseJSON(content);
|
||||||
if (
|
if (
|
||||||
@@ -515,13 +579,14 @@ export const run = async (prNumber) => {
|
|||||||
debug("Create or update theme-preview comment...");
|
debug("Create or update theme-preview comment...");
|
||||||
let comment_url;
|
let comment_url;
|
||||||
if (!DRY_RUN) {
|
if (!DRY_RUN) {
|
||||||
comment_url = await upsertComment(octokit, {
|
comment_url = await upsertComment(
|
||||||
comment_id: comment?.id,
|
OCTOKIT,
|
||||||
issue_number: pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
REPO,
|
||||||
repo,
|
OWNER,
|
||||||
body: commentBody,
|
comment?.id,
|
||||||
});
|
commentBody,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
info(`DRY_RUN: Comment body: ${commentBody}`);
|
info(`DRY_RUN: Comment body: ${commentBody}`);
|
||||||
comment_url = "";
|
comment_url = "";
|
||||||
@@ -538,18 +603,18 @@ export const run = async (prNumber) => {
|
|||||||
: INVALID_REVIEW_COMMENT(comment_url);
|
: INVALID_REVIEW_COMMENT(comment_url);
|
||||||
if (!DRY_RUN) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
OCTOKIT,
|
||||||
pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
OWNER,
|
||||||
repo,
|
REPO,
|
||||||
reviewState,
|
reviewState,
|
||||||
reviewReason,
|
reviewReason,
|
||||||
);
|
);
|
||||||
await addRemoveLabel(
|
await addRemoveLabel(
|
||||||
octokit,
|
OCTOKIT,
|
||||||
pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
OWNER,
|
||||||
repo,
|
REPO,
|
||||||
"invalid",
|
"invalid",
|
||||||
!themesValid,
|
!themesValid,
|
||||||
);
|
);
|
||||||
@@ -561,18 +626,20 @@ export const run = async (prNumber) => {
|
|||||||
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
||||||
if (!DRY_RUN) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
OCTOKIT,
|
||||||
pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
OWNER,
|
||||||
repo,
|
REPO,
|
||||||
"REQUEST_CHANGES",
|
"REQUEST_CHANGES",
|
||||||
error.message,
|
"**Something went wrong in the theme preview action:** `" +
|
||||||
|
error.message +
|
||||||
|
"`",
|
||||||
);
|
);
|
||||||
await addRemoveLabel(
|
await addRemoveLabel(
|
||||||
octokit,
|
OCTOKIT,
|
||||||
pullRequestId,
|
PULL_REQUEST_ID,
|
||||||
owner,
|
OWNER,
|
||||||
repo,
|
REPO,
|
||||||
"invalid",
|
"invalid",
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export BRANCH_NAME=updated-theme-readme
|
|||||||
git --version
|
git --version
|
||||||
git config --global user.email "no-reply@githubreadmestats.com"
|
git config --global user.email "no-reply@githubreadmestats.com"
|
||||||
git config --global user.name "GitHub Readme Stats Bot"
|
git config --global user.name "GitHub Readme Stats Bot"
|
||||||
|
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||||
git branch -d $BRANCH_NAME || true
|
git branch -d $BRANCH_NAME || true
|
||||||
git checkout -b $BRANCH_NAME
|
git checkout -b $BRANCH_NAME
|
||||||
git add --all
|
git add --all
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ const createTextNode = ({
|
|||||||
showIcons,
|
showIcons,
|
||||||
shiftValuePos,
|
shiftValuePos,
|
||||||
bold,
|
bold,
|
||||||
|
number_format,
|
||||||
}) => {
|
}) => {
|
||||||
const kValue = kFormatter(value);
|
const kValue =
|
||||||
|
number_format.toLowerCase() === "long" ? value : kFormatter(value);
|
||||||
const staggerDelay = (index + 3) * 150;
|
const staggerDelay = (index + 3) * 150;
|
||||||
|
|
||||||
const labelOffset = showIcons ? `x="25"` : "";
|
const labelOffset = showIcons ? `x="25"` : "";
|
||||||
@@ -103,6 +105,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
custom_title,
|
custom_title,
|
||||||
border_radius,
|
border_radius,
|
||||||
border_color,
|
border_color,
|
||||||
|
number_format = "short",
|
||||||
locale,
|
locale,
|
||||||
disable_animations = false,
|
disable_animations = false,
|
||||||
} = options;
|
} = options;
|
||||||
@@ -192,6 +195,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
showIcons: show_icons,
|
showIcons: show_icons,
|
||||||
shiftValuePos: 79.01 + (isLongLocale ? 50 : 0),
|
shiftValuePos: 79.01 + (isLongLocale ? 50 : 0),
|
||||||
bold: text_bold,
|
bold: text_bold,
|
||||||
|
number_format,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -22,6 +22,7 @@ export type StatCardOptions = CommonOptions & {
|
|||||||
line_height: number | string;
|
line_height: number | string;
|
||||||
custom_title: string;
|
custom_title: string;
|
||||||
disable_animations: boolean;
|
disable_animations: boolean;
|
||||||
|
number_format: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RepoCardOptions = CommonOptions & {
|
export type RepoCardOptions = CommonOptions & {
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
"Elixir": "#6e4a7e",
|
"Elixir": "#6e4a7e",
|
||||||
"Elm": "#60B5CC",
|
"Elm": "#60B5CC",
|
||||||
"Elvish": "#55BB55",
|
"Elvish": "#55BB55",
|
||||||
|
"Elvish Transcript": "#55BB55",
|
||||||
"Emacs Lisp": "#c065db",
|
"Emacs Lisp": "#c065db",
|
||||||
"EmberScript": "#FFF4F3",
|
"EmberScript": "#FFF4F3",
|
||||||
"Erlang": "#B83998",
|
"Erlang": "#B83998",
|
||||||
@@ -453,6 +454,7 @@
|
|||||||
"Smalltalk": "#596706",
|
"Smalltalk": "#596706",
|
||||||
"Smarty": "#f0c040",
|
"Smarty": "#f0c040",
|
||||||
"Smithy": "#c44536",
|
"Smithy": "#c44536",
|
||||||
|
"Snakemake": "#419179",
|
||||||
"Solidity": "#AA6746",
|
"Solidity": "#AA6746",
|
||||||
"SourcePawn": "#f69e1d",
|
"SourcePawn": "#f69e1d",
|
||||||
"Squirrel": "#800000",
|
"Squirrel": "#800000",
|
||||||
@@ -466,6 +468,7 @@
|
|||||||
"SugarSS": "#2fcc9f",
|
"SugarSS": "#2fcc9f",
|
||||||
"SuperCollider": "#46390b",
|
"SuperCollider": "#46390b",
|
||||||
"Svelte": "#ff3e00",
|
"Svelte": "#ff3e00",
|
||||||
|
"Sway": "#dea584",
|
||||||
"Swift": "#F05138",
|
"Swift": "#F05138",
|
||||||
"SystemVerilog": "#DAE1C2",
|
"SystemVerilog": "#DAE1C2",
|
||||||
"TI Program": "#A0AA87",
|
"TI Program": "#A0AA87",
|
||||||
|
|||||||
@@ -357,4 +357,13 @@ describe("Test renderStatsCard", () => {
|
|||||||
document.body.innerHTML = renderStatsCard(stats, {});
|
document.body.innerHTML = renderStatsCard(stats, {});
|
||||||
expect(document.querySelector("rect")).toHaveAttribute("rx", "4.5");
|
expect(document.querySelector("rect")).toHaveAttribute("rx", "4.5");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should shorten values", () => {
|
||||||
|
stats["totalCommits"] = 1999;
|
||||||
|
|
||||||
|
document.body.innerHTML = renderStatsCard(stats);
|
||||||
|
expect(getByTestId(document.body, "commits").textContent).toBe("2k");
|
||||||
|
document.body.innerHTML = renderStatsCard(stats, { number_format: "long" });
|
||||||
|
expect(getByTestId(document.body, "commits").textContent).toBe("1999");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+8
-6
@@ -32,10 +32,11 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
| `jolly` ![jolly][jolly] | `maroongold` ![maroongold][maroongold] | `yeblu` ![yeblu][yeblu] |
|
| `jolly` ![jolly][jolly] | `maroongold` ![maroongold][maroongold] | `yeblu` ![yeblu][yeblu] |
|
||||||
| `blueberry` ![blueberry][blueberry] | `slateorange` ![slateorange][slateorange] | `kacho_ga` ![kacho_ga][kacho_ga] |
|
| `blueberry` ![blueberry][blueberry] | `slateorange` ![slateorange][slateorange] | `kacho_ga` ![kacho_ga][kacho_ga] |
|
||||||
| `outrun` ![outrun][outrun] | `ocean_dark` ![ocean_dark][ocean_dark] | `city_lights` ![city_lights][city_lights] |
|
| `outrun` ![outrun][outrun] | `ocean_dark` ![ocean_dark][ocean_dark] | `city_lights` ![city_lights][city_lights] |
|
||||||
| `github_dark` ![github_dark][github_dark] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] | `aura_dark` ![aura_dark][aura_dark] |
|
| `github_dark` ![github_dark][github_dark] | `github_dark_dimmed` ![github_dark_dimmed][github_dark_dimmed] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] |
|
||||||
| `panda` ![panda][panda] | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] |
|
| `panda` ![panda][panda] | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] |
|
||||||
| `swift` ![swift][swift] | `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] |
|
| `swift` ![swift][swift] | `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] |
|
||||||
| `moltack` ![moltack][moltack] | `codeSTACKr` ![codeSTACKr][codeSTACKr] | `rose_pine` ![rose_pine][rose_pine] |
|
| `moltack` ![moltack][moltack] | `codeSTACKr` ![codeSTACKr][codeSTACKr] | `rose_pine` ![rose_pine][rose_pine] |
|
||||||
|
| `aura_dark` ![aura_dark][aura_dark] | | |
|
||||||
| [Add your theme][add-theme] | | |
|
| [Add your theme][add-theme] | | |
|
||||||
|
|
||||||
## Repo Card
|
## Repo Card
|
||||||
@@ -60,10 +61,11 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
| `jolly` ![jolly][jolly_repo] | `maroongold` ![maroongold][maroongold_repo] | `yeblu` ![yeblu][yeblu_repo] |
|
| `jolly` ![jolly][jolly_repo] | `maroongold` ![maroongold][maroongold_repo] | `yeblu` ![yeblu][yeblu_repo] |
|
||||||
| `blueberry` ![blueberry][blueberry_repo] | `slateorange` ![slateorange][slateorange_repo] | `kacho_ga` ![kacho_ga][kacho_ga_repo] |
|
| `blueberry` ![blueberry][blueberry_repo] | `slateorange` ![slateorange][slateorange_repo] | `kacho_ga` ![kacho_ga][kacho_ga_repo] |
|
||||||
| `outrun` ![outrun][outrun_repo] | `ocean_dark` ![ocean_dark][ocean_dark_repo] | `city_lights` ![city_lights][city_lights_repo] |
|
| `outrun` ![outrun][outrun_repo] | `ocean_dark` ![ocean_dark][ocean_dark_repo] | `city_lights` ![city_lights][city_lights_repo] |
|
||||||
| `github_dark` ![github_dark][github_dark_repo] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] | `aura_dark` ![aura_dark][aura_dark_repo] |
|
| `github_dark` ![github_dark][github_dark_repo] | `github_dark_dimmed` ![github_dark_dimmed][github_dark_dimmed_repo] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] |
|
||||||
| `panda` ![panda][panda_repo] | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] |
|
| `panda` ![panda][panda_repo] | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] |
|
||||||
| `swift` ![swift][swift_repo] | `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] |
|
| `swift` ![swift][swift_repo] | `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] |
|
||||||
| `moltack` ![moltack][moltack_repo] | `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | `rose_pine` ![rose_pine][rose_pine_repo] |
|
| `moltack` ![moltack][moltack_repo] | `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | `rose_pine` ![rose_pine][rose_pine_repo] |
|
||||||
|
| `aura_dark` ![aura_dark][aura_dark_repo] | | |
|
||||||
| [Add your theme][add-theme] | | |
|
| [Add your theme][add-theme] | | |
|
||||||
|
|
||||||
|
|
||||||
@@ -117,8 +119,8 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
[ocean_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=ocean_dark
|
[ocean_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=ocean_dark
|
||||||
[city_lights]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=city_lights
|
[city_lights]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=city_lights
|
||||||
[github_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=github_dark
|
[github_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=github_dark
|
||||||
|
[github_dark_dimmed]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=github_dark_dimmed
|
||||||
[discord_old_blurple]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=discord_old_blurple
|
[discord_old_blurple]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=discord_old_blurple
|
||||||
[aura_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura_dark
|
|
||||||
[panda]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=panda
|
[panda]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=panda
|
||||||
[noctis_minimus]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=noctis_minimus
|
[noctis_minimus]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=noctis_minimus
|
||||||
[cobalt2]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=cobalt2
|
[cobalt2]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=cobalt2
|
||||||
@@ -128,7 +130,7 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
[moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack
|
[moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack
|
||||||
[codeSTACKr]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=codeSTACKr
|
[codeSTACKr]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=codeSTACKr
|
||||||
[rose_pine]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=rose_pine
|
[rose_pine]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=rose_pine
|
||||||
|
[aura_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura_dark
|
||||||
|
|
||||||
[default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
|
[default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
|
||||||
[default_repocard_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default_repocard
|
[default_repocard_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default_repocard
|
||||||
@@ -180,8 +182,8 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
[ocean_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=ocean_dark
|
[ocean_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=ocean_dark
|
||||||
[city_lights_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=city_lights
|
[city_lights_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=city_lights
|
||||||
[github_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=github_dark
|
[github_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=github_dark
|
||||||
|
[github_dark_dimmed_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=github_dark_dimmed
|
||||||
[discord_old_blurple_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=discord_old_blurple
|
[discord_old_blurple_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=discord_old_blurple
|
||||||
[aura_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura_dark
|
|
||||||
[panda_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=panda
|
[panda_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=panda
|
||||||
[noctis_minimus_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=noctis_minimus
|
[noctis_minimus_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=noctis_minimus
|
||||||
[cobalt2_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=cobalt2
|
[cobalt2_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=cobalt2
|
||||||
@@ -191,7 +193,7 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
[moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack
|
[moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack
|
||||||
[codeSTACKr_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=codeSTACKr
|
[codeSTACKr_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=codeSTACKr
|
||||||
[rose_pine_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=rose_pine
|
[rose_pine_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=rose_pine
|
||||||
|
[aura_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura_dark
|
||||||
|
|
||||||
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
|
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
|
||||||
|
|
||||||
|
|||||||
+29
-1
@@ -18,6 +18,27 @@ export const themes = {
|
|||||||
text_color: "417E87",
|
text_color: "417E87",
|
||||||
bg_color: "ffffff00",
|
bg_color: "ffffff00",
|
||||||
},
|
},
|
||||||
|
shadow_red: {
|
||||||
|
title_color: "9A0000",
|
||||||
|
text_color: "444",
|
||||||
|
icon_color: "4F0000",
|
||||||
|
border_color: "4F0000",
|
||||||
|
bg_color: "ffffff00",
|
||||||
|
},
|
||||||
|
shadow_green: {
|
||||||
|
title_color: "007A00",
|
||||||
|
text_color: "444",
|
||||||
|
icon_color: "003D00",
|
||||||
|
border_color: "003D00",
|
||||||
|
bg_color: "ffffff00",
|
||||||
|
},
|
||||||
|
shadow_blue: {
|
||||||
|
title_color: "00779A",
|
||||||
|
text_color: "444",
|
||||||
|
icon_color: "004450",
|
||||||
|
border_color: "004490",
|
||||||
|
bg_color: "ffffff00",
|
||||||
|
},
|
||||||
dark: {
|
dark: {
|
||||||
title_color: "fff",
|
title_color: "fff",
|
||||||
icon_color: "79ff97",
|
icon_color: "79ff97",
|
||||||
@@ -300,6 +321,13 @@ export const themes = {
|
|||||||
text_color: "C3D1D9",
|
text_color: "C3D1D9",
|
||||||
bg_color: "0D1117",
|
bg_color: "0D1117",
|
||||||
},
|
},
|
||||||
|
github_dark_dimmed: {
|
||||||
|
title_color: "539bf5",
|
||||||
|
icon_color: "539bf5",
|
||||||
|
text_color: "ADBAC7",
|
||||||
|
bg_color: "24292F",
|
||||||
|
border_color: "373E47",
|
||||||
|
},
|
||||||
discord_old_blurple: {
|
discord_old_blurple: {
|
||||||
title_color: "7289DA",
|
title_color: "7289DA",
|
||||||
icon_color: "7289DA",
|
icon_color: "7289DA",
|
||||||
@@ -388,7 +416,7 @@ export const themes = {
|
|||||||
border_color: "e9d8d4",
|
border_color: "e9d8d4",
|
||||||
bg_color: "e9d8d4",
|
bg_color: "e9d8d4",
|
||||||
},
|
},
|
||||||
holi_theme: {
|
holi: {
|
||||||
title_color: "5FABEE",
|
title_color: "5FABEE",
|
||||||
text_color: "D6E7FF",
|
text_color: "D6E7FF",
|
||||||
icon_color: "5FABEE",
|
icon_color: "5FABEE",
|
||||||
|
|||||||
Reference in New Issue
Block a user