forked from mirrored/github-readme-stats
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1da12ad80 | ||
|
|
6c79c2d82d | ||
|
|
4f1fa61b25 |
@@ -1,4 +1,3 @@
|
|||||||
themes: themes/index.js
|
themes: themes/index.js
|
||||||
doc-translation: docs/*
|
doc-translation: docs/*
|
||||||
card-i18n: src/translations.js
|
card-i18n: src/translations.js
|
||||||
documentation: readme.md
|
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ jobs:
|
|||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|
||||||
# Fix the unsafe repo error which was introduced by the CVE-2022-24765 git patches.
|
|
||||||
- name: Fix unsafe repo error
|
|
||||||
run: git config --global --add safe.directory ${{ github.workspace }}
|
|
||||||
|
|
||||||
- name: npm install, generate readme
|
- name: npm install, generate readme
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
|
|||||||
@@ -10,5 +10,3 @@ vercel_token
|
|||||||
# IDE
|
# IDE
|
||||||
.vscode
|
.vscode
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
||||||
.vercel
|
|
||||||
|
|||||||
@@ -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 5 minutes.
|
* @description This function is currently rate limited to 1 request per 10 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 5 minutes
|
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 10 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 5 minutes.
|
* @description This function is currently rate limited to 1 request per 10 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 * 5; // 1 request per 5 minutes
|
export const RATE_LIMIT_SECONDS = 60 * 10; // 1 request per 10 minutes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple uptime check fetcher for the PATs.
|
* Simple uptime check fetcher for the PATs.
|
||||||
|
|||||||
+13
-13
@@ -1,15 +1,15 @@
|
|||||||
import statsCard from "./api/index.js";
|
import statsCard from './api/index.js'
|
||||||
import repoCard from "./api/pin.js";
|
import repoCard from './api/pin.js'
|
||||||
import langCard from "./api/top-langs.js";
|
import langCard from './api/top-langs.js'
|
||||||
import wakatimeCard from "./api/wakatime.js";
|
import wakatimeCard from './api/wakatime.js'
|
||||||
import express from "express";
|
import express from 'express'
|
||||||
import dotenv from "dotenv";
|
import dotenv from 'dotenv'
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config()
|
||||||
const app = express();
|
const app = express()
|
||||||
app.listen(process.env.port || 9000);
|
app.listen(process.env.port || 9000)
|
||||||
|
|
||||||
app.get("/", statsCard);
|
app.get('/', statsCard)
|
||||||
app.get("/pin", repoCard);
|
app.get('/pin', repoCard)
|
||||||
app.get("/top-langs", langCard);
|
app.get('/top-langs', langCard)
|
||||||
app.get("/wakatime", wakatimeCard);
|
app.get('/wakatime', wakatimeCard)
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ You can add the count of all your private contributions to the total commits cou
|
|||||||
|
|
||||||
### Showing icons
|
### Showing icons
|
||||||
|
|
||||||
To enable icons, you can pass `&show_icons=true` in the query param, like so:
|
To enable icons, you can pass `show_icons=true` in the query param, like so:
|
||||||
|
|
||||||
```md
|
```md
|
||||||

|

|
||||||
|
|||||||
+60
-128
@@ -43,23 +43,6 @@ 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.
|
||||||
@@ -143,36 +126,15 @@ 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 {number} issueNumber Issue number.
|
* @param {Object} props Comment properties.
|
||||||
* @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 (
|
const upsertComment = async (octokit, props) => {
|
||||||
octokit,
|
|
||||||
issueNumber,
|
|
||||||
repo,
|
|
||||||
owner,
|
|
||||||
commentId,
|
|
||||||
body,
|
|
||||||
) => {
|
|
||||||
let resp;
|
let resp;
|
||||||
if (commentId !== undefined) {
|
if (props.comment_id !== undefined) {
|
||||||
resp = await octokit.issues.updateComment({
|
resp = await octokit.issues.updateComment(props);
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
comment_id: commentId,
|
|
||||||
body,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
resp = await octokit.issues.createComment({
|
resp = await octokit.issues.createComment(props);
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
issue_number: issueNumber,
|
|
||||||
body,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return resp.data.html_url;
|
return resp.data.html_url;
|
||||||
};
|
};
|
||||||
@@ -307,38 +269,22 @@ const parseJSON = (json) => {
|
|||||||
if (typeof parsedJson === "object") {
|
if (typeof parsedJson === "object") {
|
||||||
return parsedJson;
|
return parsedJson;
|
||||||
} else {
|
} else {
|
||||||
throw new IncorrectJsonFormatError(
|
throw new Error("PR diff is not a valid theme JSON object.");
|
||||||
"PR diff is not a valid theme JSON object.",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Remove trailing commas (if any).
|
let parsedJson = json
|
||||||
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()); // Split json into array of strings and objects.
|
.filter((x) => typeof x !== "string" || !!x.trim());
|
||||||
if (splitJson[0].replace(/\s+/g, "") === "},") {
|
if (parsedJson[0].replace(/\s+/g, "") === "},") {
|
||||||
splitJson[0] = "},";
|
parsedJson[0] = "},";
|
||||||
if (!/\s*}\s*,?\s*$/.test(splitJson[1])) {
|
if (!/\s*}\s*,?\s*$/.test(parsedJson[1])) {
|
||||||
splitJson.push(splitJson.shift());
|
parsedJson.push(parsedJson.shift());
|
||||||
} else {
|
} else {
|
||||||
splitJson.shift();
|
parsedJson.shift();
|
||||||
}
|
}
|
||||||
parsedJson = splitJson.join("");
|
return Hjson.parse(parsedJson.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}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -352,13 +298,12 @@ const themeNameAlreadyExists = (name) => {
|
|||||||
return themes[name] !== undefined;
|
return themes[name] !== undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function.
|
* Main function.
|
||||||
*/
|
*/
|
||||||
export const run = async () => {
|
export const run = async (prNumber) => {
|
||||||
try {
|
try {
|
||||||
|
const dryRun = process.env.DRY_RUN === "true" || false;
|
||||||
debug("Retrieve action information from context...");
|
debug("Retrieve action information from context...");
|
||||||
debug(`Context: ${inspect(github.context)}`);
|
debug(`Context: ${inspect(github.context)}`);
|
||||||
let commentBody = `
|
let commentBody = `
|
||||||
@@ -366,50 +311,40 @@ export const run = async () => {
|
|||||||
\r${THEME_CONTRIB_GUIDELINESS}
|
\r${THEME_CONTRIB_GUIDELINESS}
|
||||||
`;
|
`;
|
||||||
const ccc = new ColorContrastChecker();
|
const ccc = new ColorContrastChecker();
|
||||||
OCTOKIT = github.getOctokit(getGithubToken());
|
const octokit = github.getOctokit(getGithubToken());
|
||||||
PULL_REQUEST_ID = getPrNumber();
|
const pullRequestId = prNumber ? prNumber : getPrNumber();
|
||||||
const { owner, repo } = getRepoInfo(github.context);
|
|
||||||
OWNER = owner;
|
|
||||||
REPO = repo;
|
|
||||||
const commenter = getCommenter();
|
const commenter = getCommenter();
|
||||||
PULL_REQUEST_ID = getPrNumber();
|
const { owner, repo } = getRepoInfo(github.context);
|
||||||
debug(`Owner: ${OWNER}`);
|
debug(`Owner: ${owner}`);
|
||||||
debug(`Repo: ${REPO}`);
|
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: PULL_REQUEST_ID,
|
pull_number: pullRequestId,
|
||||||
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,
|
||||||
PULL_REQUEST_ID,
|
pullRequestId,
|
||||||
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.map((chunk) =>
|
.chunks[0].changes.filter((c) => c.type === "add")
|
||||||
chunk.changes
|
.map((c) => c.content.replace("+", ""))
|
||||||
.filter((c) => c.type === "add")
|
|
||||||
.map((c) => c.content.replace("+", ""))
|
|
||||||
.join(""),
|
|
||||||
)
|
|
||||||
.join("");
|
.join("");
|
||||||
const themeObject = parseJSON(content);
|
const themeObject = parseJSON(content);
|
||||||
if (
|
if (
|
||||||
@@ -578,15 +513,14 @@ export const run = async () => {
|
|||||||
// Create or update theme-preview comment.
|
// Create or update theme-preview comment.
|
||||||
debug("Create or update theme-preview comment...");
|
debug("Create or update theme-preview comment...");
|
||||||
let comment_url;
|
let comment_url;
|
||||||
if (!DRY_RUN) {
|
if (!dryRun) {
|
||||||
comment_url = await upsertComment(
|
comment_url = await upsertComment(octokit, {
|
||||||
OCTOKIT,
|
comment_id: comment?.id,
|
||||||
PULL_REQUEST_ID,
|
issue_number: pullRequestId,
|
||||||
REPO,
|
owner,
|
||||||
OWNER,
|
repo,
|
||||||
comment?.id,
|
body: commentBody,
|
||||||
commentBody,
|
});
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
info(`DRY_RUN: Comment body: ${commentBody}`);
|
info(`DRY_RUN: Comment body: ${commentBody}`);
|
||||||
comment_url = "";
|
comment_url = "";
|
||||||
@@ -601,20 +535,20 @@ export const run = async () => {
|
|||||||
const reviewReason = themesValid
|
const reviewReason = themesValid
|
||||||
? undefined
|
? undefined
|
||||||
: INVALID_REVIEW_COMMENT(comment_url);
|
: INVALID_REVIEW_COMMENT(comment_url);
|
||||||
if (!DRY_RUN) {
|
if (!dryRun) {
|
||||||
await addReview(
|
await addReview(
|
||||||
OCTOKIT,
|
octokit,
|
||||||
PULL_REQUEST_ID,
|
pullRequestId,
|
||||||
OWNER,
|
owner,
|
||||||
REPO,
|
repo,
|
||||||
reviewState,
|
reviewState,
|
||||||
reviewReason,
|
reviewReason,
|
||||||
);
|
);
|
||||||
await addRemoveLabel(
|
await addRemoveLabel(
|
||||||
OCTOKIT,
|
octokit,
|
||||||
PULL_REQUEST_ID,
|
pullRequestId,
|
||||||
OWNER,
|
owner,
|
||||||
REPO,
|
repo,
|
||||||
"invalid",
|
"invalid",
|
||||||
!themesValid,
|
!themesValid,
|
||||||
);
|
);
|
||||||
@@ -624,22 +558,20 @@ export const run = async () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
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 (!dryRun) {
|
||||||
await addReview(
|
await addReview(
|
||||||
OCTOKIT,
|
octokit,
|
||||||
PULL_REQUEST_ID,
|
pullRequestId,
|
||||||
OWNER,
|
owner,
|
||||||
REPO,
|
repo,
|
||||||
"REQUEST_CHANGES",
|
"REQUEST_CHANGES",
|
||||||
"**Something went wrong in the theme preview action:** `" +
|
error.message,
|
||||||
error.message +
|
|
||||||
"`",
|
|
||||||
);
|
);
|
||||||
await addRemoveLabel(
|
await addRemoveLabel(
|
||||||
OCTOKIT,
|
octokit,
|
||||||
PULL_REQUEST_ID,
|
pullRequestId,
|
||||||
OWNER,
|
owner,
|
||||||
REPO,
|
repo,
|
||||||
"invalid",
|
"invalid",
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ 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
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import { langCardLocales } from "../translations.js";
|
import { langCardLocales } from "../translations.js";
|
||||||
|
|
||||||
const DEFAULT_CARD_WIDTH = 300;
|
const DEFAULT_CARD_WIDTH = 300;
|
||||||
const MIN_CARD_WIDTH = 280;
|
const MIN_CARD_WIDTH = 230;
|
||||||
const DEFAULT_LANGS_COUNT = 5;
|
const DEFAULT_LANGS_COUNT = 5;
|
||||||
const DEFAULT_LANG_COLOR = "#858585";
|
const DEFAULT_LANG_COLOR = "#858585";
|
||||||
const CARD_PADDING = 25;
|
const CARD_PADDING = 25;
|
||||||
@@ -317,6 +317,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
|||||||
|
|
||||||
let finalLayout = "";
|
let finalLayout = "";
|
||||||
if (layout === "compact" || hide_progress == true) {
|
if (layout === "compact" || hide_progress == true) {
|
||||||
|
width = width + 50; // padding
|
||||||
height =
|
height =
|
||||||
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
|
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ const createTextNode = ({
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
name: label,
|
name: label,
|
||||||
progressBarBackgroundColor,
|
progressBarBackgroundColor,
|
||||||
delay: staggerDelay + 300,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return `
|
return `
|
||||||
@@ -277,12 +276,11 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
} else {
|
} else {
|
||||||
finalLayout = flexLayout({
|
finalLayout = flexLayout({
|
||||||
items: filteredLanguages.length
|
items: filteredLanguages.length
|
||||||
? filteredLanguages.map((language, index) => {
|
? filteredLanguages.map((language) => {
|
||||||
return createTextNode({
|
return createTextNode({
|
||||||
id: language.name,
|
id: language.name,
|
||||||
label: language.name,
|
label: language.name,
|
||||||
value: language.text,
|
value: language.text,
|
||||||
index: index,
|
|
||||||
percent: language.percent,
|
percent: language.percent,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
progressBarColor: titleColor,
|
progressBarColor: titleColor,
|
||||||
@@ -323,29 +321,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
card.setCSS(
|
card.setCSS(
|
||||||
`
|
`
|
||||||
${cssStyles}
|
${cssStyles}
|
||||||
@keyframes slideInAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: calc(100%-100px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes growWidthAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
|
||||||
#rect-mask rect{
|
|
||||||
animation: slideInAnimation 1s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
.lang-progress{
|
|
||||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@
|
|||||||
"Ceylon": "#dfa535",
|
"Ceylon": "#dfa535",
|
||||||
"Chapel": "#8dc63f",
|
"Chapel": "#8dc63f",
|
||||||
"ChucK": "#3f8000",
|
"ChucK": "#3f8000",
|
||||||
"Circom": "#707575",
|
|
||||||
"Cirru": "#ccccff",
|
"Cirru": "#ccccff",
|
||||||
"Clarion": "#db901e",
|
"Clarion": "#db901e",
|
||||||
"Clarity": "#5546ff",
|
"Clarity": "#5546ff",
|
||||||
@@ -117,7 +116,6 @@
|
|||||||
"DirectX 3D File": "#aace60",
|
"DirectX 3D File": "#aace60",
|
||||||
"Dockerfile": "#384d54",
|
"Dockerfile": "#384d54",
|
||||||
"Dogescript": "#cca760",
|
"Dogescript": "#cca760",
|
||||||
"Dotenv": "#e5d559",
|
|
||||||
"Dylan": "#6c616e",
|
"Dylan": "#6c616e",
|
||||||
"E": "#ccce35",
|
"E": "#ccce35",
|
||||||
"ECL": "#8a1267",
|
"ECL": "#8a1267",
|
||||||
@@ -151,7 +149,7 @@
|
|||||||
"Forth": "#341708",
|
"Forth": "#341708",
|
||||||
"Fortran": "#4d41b1",
|
"Fortran": "#4d41b1",
|
||||||
"Fortran Free Form": "#4d41b1",
|
"Fortran Free Form": "#4d41b1",
|
||||||
"FreeBasic": "#141AC9",
|
"FreeBasic": "#867db1",
|
||||||
"FreeMarker": "#0050b2",
|
"FreeMarker": "#0050b2",
|
||||||
"Frege": "#00cafe",
|
"Frege": "#00cafe",
|
||||||
"Futhark": "#5f021f",
|
"Futhark": "#5f021f",
|
||||||
@@ -184,7 +182,6 @@
|
|||||||
"Go": "#00ADD8",
|
"Go": "#00ADD8",
|
||||||
"Go Checksums": "#00ADD8",
|
"Go Checksums": "#00ADD8",
|
||||||
"Go Module": "#00ADD8",
|
"Go Module": "#00ADD8",
|
||||||
"Godot Resource": "#355570",
|
|
||||||
"Golo": "#88562A",
|
"Golo": "#88562A",
|
||||||
"Gosu": "#82937f",
|
"Gosu": "#82937f",
|
||||||
"Grace": "#615f8b",
|
"Grace": "#615f8b",
|
||||||
@@ -195,7 +192,6 @@
|
|||||||
"Groovy": "#4298b8",
|
"Groovy": "#4298b8",
|
||||||
"Groovy Server Pages": "#4298b8",
|
"Groovy Server Pages": "#4298b8",
|
||||||
"HAProxy": "#106da9",
|
"HAProxy": "#106da9",
|
||||||
"HCL": "#844FBA",
|
|
||||||
"HLSL": "#aace60",
|
"HLSL": "#aace60",
|
||||||
"HOCON": "#9ff8ee",
|
"HOCON": "#9ff8ee",
|
||||||
"HTML": "#e34c26",
|
"HTML": "#e34c26",
|
||||||
@@ -229,7 +225,6 @@
|
|||||||
"Isabelle ROOT": "#FEFE00",
|
"Isabelle ROOT": "#FEFE00",
|
||||||
"J": "#9EEDFF",
|
"J": "#9EEDFF",
|
||||||
"JAR Manifest": "#b07219",
|
"JAR Manifest": "#b07219",
|
||||||
"JCL": "#d90e09",
|
|
||||||
"JFlex": "#DBCA00",
|
"JFlex": "#DBCA00",
|
||||||
"JSON": "#292929",
|
"JSON": "#292929",
|
||||||
"JSON with Comments": "#292929",
|
"JSON with Comments": "#292929",
|
||||||
@@ -252,11 +247,9 @@
|
|||||||
"Jsonnet": "#0064bd",
|
"Jsonnet": "#0064bd",
|
||||||
"Julia": "#a270ba",
|
"Julia": "#a270ba",
|
||||||
"Jupyter Notebook": "#DA5B0B",
|
"Jupyter Notebook": "#DA5B0B",
|
||||||
"Just": "#384d54",
|
|
||||||
"KRL": "#28430A",
|
"KRL": "#28430A",
|
||||||
"Kaitai Struct": "#773b37",
|
"Kaitai Struct": "#773b37",
|
||||||
"KakouneScript": "#6f8042",
|
"KakouneScript": "#6f8042",
|
||||||
"KerboScript": "#41adf0",
|
|
||||||
"KiCad Layout": "#2f4aab",
|
"KiCad Layout": "#2f4aab",
|
||||||
"KiCad Legacy Layout": "#2f4aab",
|
"KiCad Legacy Layout": "#2f4aab",
|
||||||
"KiCad Schematic": "#2f4aab",
|
"KiCad Schematic": "#2f4aab",
|
||||||
@@ -369,7 +362,6 @@
|
|||||||
"PicoLisp": "#6067af",
|
"PicoLisp": "#6067af",
|
||||||
"PigLatin": "#fcd7de",
|
"PigLatin": "#fcd7de",
|
||||||
"Pike": "#005390",
|
"Pike": "#005390",
|
||||||
"PlantUML": "#fbbd16",
|
|
||||||
"PogoScript": "#d80074",
|
"PogoScript": "#d80074",
|
||||||
"Polar": "#ae81ff",
|
"Polar": "#ae81ff",
|
||||||
"Portugol": "#f8bd00",
|
"Portugol": "#f8bd00",
|
||||||
@@ -387,7 +379,6 @@
|
|||||||
"Puppet": "#302B6D",
|
"Puppet": "#302B6D",
|
||||||
"PureBasic": "#5a6986",
|
"PureBasic": "#5a6986",
|
||||||
"PureScript": "#1D222D",
|
"PureScript": "#1D222D",
|
||||||
"Pyret": "#ee1e10",
|
|
||||||
"Python": "#3572A5",
|
"Python": "#3572A5",
|
||||||
"Python console": "#3572A5",
|
"Python console": "#3572A5",
|
||||||
"Python traceback": "#3572A5",
|
"Python traceback": "#3572A5",
|
||||||
@@ -540,6 +531,7 @@
|
|||||||
"fish": "#4aae47",
|
"fish": "#4aae47",
|
||||||
"hoon": "#00b171",
|
"hoon": "#00b171",
|
||||||
"jq": "#c7254e",
|
"jq": "#c7254e",
|
||||||
|
"just": "#384d54",
|
||||||
"kvlang": "#1da6e0",
|
"kvlang": "#1da6e0",
|
||||||
"mIRC Script": "#3d57c3",
|
"mIRC Script": "#3d57c3",
|
||||||
"mcfunction": "#E22837",
|
"mcfunction": "#E22837",
|
||||||
|
|||||||
@@ -69,29 +69,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@keyframes slideInAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: calc(100%-100px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes growWidthAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||||
#rect-mask rect{
|
|
||||||
animation: slideInAnimation 1s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
.lang-progress{
|
|
||||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -249,29 +227,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout w
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@keyframes slideInAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: calc(100%-100px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes growWidthAnimation {
|
|
||||||
from {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||||
#rect-mask rect{
|
|
||||||
animation: slideInAnimation 1s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
.lang-progress{
|
|
||||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ const REPO = "curly-fiesta";
|
|||||||
const USER = "catelinemnemosyne";
|
const USER = "catelinemnemosyne";
|
||||||
const STATS_DATA = {
|
const STATS_DATA = {
|
||||||
name: "Cateline Mnemosyne",
|
name: "Cateline Mnemosyne",
|
||||||
totalPRs: 2,
|
totalPRs: 1,
|
||||||
totalCommits: 8,
|
totalCommits: 7,
|
||||||
totalIssues: 1,
|
totalIssues: 1,
|
||||||
totalStars: 1,
|
totalStars: 1,
|
||||||
contributedTo: 1,
|
contributedTo: 1,
|
||||||
rank: {
|
rank: {
|
||||||
level: "A+",
|
level: "A+",
|
||||||
score: 50.88831151384285,
|
score: 50.893750297869225,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"100",
|
"120",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
|
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
|
||||||
@@ -224,7 +224,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"100",
|
"120",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
|
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
|
||||||
@@ -232,7 +232,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"50",
|
"60",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,27 +18,6 @@ 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",
|
||||||
@@ -395,13 +374,6 @@ export const themes = {
|
|||||||
border_color: "170F0C",
|
border_color: "170F0C",
|
||||||
bg_color: "170F0C",
|
bg_color: "170F0C",
|
||||||
},
|
},
|
||||||
one_dark_pro: {
|
|
||||||
title_color: "61AFEF",
|
|
||||||
text_color: "E5C06E",
|
|
||||||
icon_color: "C678DD",
|
|
||||||
border_color: "3B4048",
|
|
||||||
bg_color: "23272E",
|
|
||||||
},
|
|
||||||
rose: {
|
rose: {
|
||||||
title_color: "8d192b",
|
title_color: "8d192b",
|
||||||
text_color: "862931",
|
text_color: "862931",
|
||||||
@@ -409,13 +381,6 @@ export const themes = {
|
|||||||
border_color: "e9d8d4",
|
border_color: "e9d8d4",
|
||||||
bg_color: "e9d8d4",
|
bg_color: "e9d8d4",
|
||||||
},
|
},
|
||||||
holi_theme: {
|
|
||||||
title_color: "5FABEE",
|
|
||||||
text_color: "D6E7FF",
|
|
||||||
icon_color: "5FABEE",
|
|
||||||
border_color: "85A4C0",
|
|
||||||
bg_color: "030314",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default themes;
|
export default themes;
|
||||||
|
|||||||
Reference in New Issue
Block a user