From c7b40c5dc86885fcf381cde5c7517afb4276330b Mon Sep 17 00:00:00 2001 From: Ava Gaiety W Date: Fri, 11 Apr 2025 13:13:22 -0600 Subject: [PATCH] gitignore dist --- .gitignore | 3 +- dist/action.js | 173 --- dist/api/history.js | 83 -- dist/api/profile.js | 83 -- dist/api/top-langs.js | 80 -- dist/index.js | 19 - dist/src/cards/HistoryCard.js | 225 ---- dist/src/cards/ProfileCard.js | 127 --- dist/src/cards/TopLanguagesCard.js | 132 --- dist/src/common/Card.js | 60 - dist/src/common/icons.js | 16 - dist/src/common/retryer.js | 63 - dist/src/common/utils.js | 267 ----- dist/src/components/Error.js | 38 - dist/src/components/FlexLayout.js | 41 - dist/src/fetcher/index.js | 159 --- dist/themes/language-bar.json | 1713 ---------------------------- dist/themes/themes.json | 218 ---- 18 files changed, 2 insertions(+), 3498 deletions(-) delete mode 100644 dist/action.js delete mode 100644 dist/api/history.js delete mode 100644 dist/api/profile.js delete mode 100644 dist/api/top-langs.js delete mode 100644 dist/index.js delete mode 100644 dist/src/cards/HistoryCard.js delete mode 100644 dist/src/cards/ProfileCard.js delete mode 100644 dist/src/cards/TopLanguagesCard.js delete mode 100644 dist/src/common/Card.js delete mode 100644 dist/src/common/icons.js delete mode 100644 dist/src/common/retryer.js delete mode 100644 dist/src/common/utils.js delete mode 100644 dist/src/components/Error.js delete mode 100644 dist/src/components/FlexLayout.js delete mode 100644 dist/src/fetcher/index.js delete mode 100644 dist/themes/language-bar.json delete mode 100644 dist/themes/themes.json diff --git a/.gitignore b/.gitignore index c803c69..7b091e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .vercel .env .vscode/ -node_modules/ +./dist/ +./node_modules/ coverage yarn-error.log diff --git a/dist/action.js b/dist/action.js deleted file mode 100644 index 82e4620..0000000 --- a/dist/action.js +++ /dev/null @@ -1,173 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var core = __importStar(require("@actions/core")); -var fs = __importStar(require("fs")); -var themes_json_1 = __importDefault(require("./themes/themes.json")); -var fetcher_1 = require("./src/fetcher"); -var ProfileCard_1 = __importDefault(require("./src/cards/ProfileCard")); -var TopLanguagesCard_1 = __importDefault(require("./src/cards/TopLanguagesCard")); -var HistoryCard_1 = __importDefault(require("./src/cards/HistoryCard")); -var server_1 = __importDefault(require("react-dom/server")); -var utils_1 = require("./src/common/utils"); -function main() { - return __awaiter(this, void 0, void 0, function () { - var username, profile, toplang, history_1, profilecard, toplangcard, historycard, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 4, , 5]); - username = core.getInput("username"); - // Fetch Code::Stats API - console.log("Fetch account data: codestats.net/users/".concat(username)); - return [4 /*yield*/, (0, fetcher_1.fetchProfile)(username)]; - case 1: - profile = _a.sent(); - return [4 /*yield*/, (0, fetcher_1.fetchTopLanguages)(username)]; - case 2: - toplang = _a.sent(); - return [4 /*yield*/, (0, fetcher_1.fetchHistory)(username, (0, utils_1.parseNumber)(core.getInput("history_card_days_count")))]; - case 3: - history_1 = _a.sent(); - profilecard = server_1.default.renderToStaticMarkup(new ProfileCard_1.default(profile.username, profile.xp, profile.recentXp, { - hide: (0, utils_1.parseArray)(core.getInput("profile_card_hide_lines")), - show_icons: core.getBooleanInput("profile_card_show_icons"), - hide_rank: core.getBooleanInput("profile_card_hide_rank"), - line_height: (0, utils_1.parseNumber)(core.getInput("profile_card_line_height")), - title: core.getInput("profile_card_title") - ? core.getInput("profile_card_title") - : "Code::Stats of ".concat(username), - title_color: core.getInput("common_title_color"), - icon_color: core.getInput("common_icon_color"), - text_color: core.getInput("common_text_color"), - bg_color: core.getInput("common_bg_color"), - hide_title: core.getBooleanInput("common_hide_title"), - hide_border: core.getBooleanInput("common_hide_border"), - theme: core.getInput("theme") in themes_json_1.default - ? core.getInput("theme") - : "default", - }).render()); - console.log("Generated ./codestats_profilecard_".concat(username, ".svg")); - fs.writeFileSync("./codestats_profilecard_".concat(username, ".svg"), profilecard); - toplangcard = server_1.default.renderToStaticMarkup(new TopLanguagesCard_1.default(username, toplang.langs, { - hide: (0, utils_1.parseArray)(core.getInput("common_hide_languages")), - language_count: (0, utils_1.parseNumber)(core.getInput("toplangs_card_language_count")), - card_width: 500, - layout: core.getBooleanInput("toplangs_card_compact_layout") - ? "compact" - : undefined, - title: core.getInput("toplangs_card_title") - ? core.getInput("toplangs_card_title") - : "Code::Stats of ".concat(username), - title_color: core.getInput("common_title_color"), - text_color: core.getInput("common_text_color"), - bg_color: core.getInput("common_bg_color"), - hide_title: core.getBooleanInput("common_hide_title"), - hide_border: core.getBooleanInput("common_hide_border"), - theme: core.getInput("theme") in themes_json_1.default - ? core.getInput("theme") - : "default", - }).render()); - console.log("Generated ./codestats_toplangs_".concat(username, ".svg")); - fs.writeFileSync("./codestats_toplangs_".concat(username, ".svg"), toplangcard); - historycard = server_1.default.renderToStaticMarkup(new HistoryCard_1.default(username, history_1, { - hide: (0, utils_1.parseArray)(core.getInput("common_hide_languages")), - language_count: (0, utils_1.parseNumber)(core.getInput("history_card_language_count")), - hide_legend: core.getBooleanInput("history_card_hide_legend"), - reverse_order: core.getBooleanInput("history_card_reverse_order"), - width: 500, - height: 300, - title_color: core.getInput("common_title_color"), - text_color: core.getInput("common_text_color"), - bg_color: core.getInput("common_bg_color"), - layout: core.getBooleanInput("history_card_horizontal_layout") - ? "horizontal" - : undefined, - hide_title: core.getBooleanInput("common_hide_title"), - title: core.getInput("history_card_title") - ? core.getInput("history_card_title") - : "Last ".concat((0, utils_1.parseNumber)(core.getInput("history_card_language_count")), " days XP history"), - hide_border: core.getBooleanInput("common_hide_border"), - theme: core.getInput("theme") in themes_json_1.default - ? core.getInput("theme") - : "default", - }).render()); - console.log("Generated ./codestats_history_".concat(username, ".svg")); - fs.writeFileSync("./codestats_history_".concat(username, ".svg"), historycard); - return [3 /*break*/, 5]; - case 4: - error_1 = _a.sent(); - if (error_1 instanceof Error) { - core.setFailed(error_1.message); - } - else { - console.log(error_1); - } - return [3 /*break*/, 5]; - case 5: return [2 /*return*/]; - } - }); - }); -} -main(); diff --git a/dist/api/history.js b/dist/api/history.js deleted file mode 100644 index 39a2a61..0000000 --- a/dist/api/history.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var server_1 = __importDefault(require("react-dom/server")); -var utils_1 = require("../src/common/utils"); -var fetcher_1 = require("../src/fetcher"); -var Error_1 = __importDefault(require("../src/components/Error")); -var HistoryCard_1 = __importDefault(require("../src/cards/HistoryCard")); -exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () { - var _a, username, days_count, cache_seconds, width, height, language_count, hide, layout, reverse_order, hide_legend, - // Master - bg_color, hide_border, hide_title, theme, title_color, data, err_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = req.query, username = _a.username, days_count = _a.days_count, cache_seconds = _a.cache_seconds, width = _a.width, height = _a.height, language_count = _a.language_count, hide = _a.hide, layout = _a.layout, reverse_order = _a.reverse_order, hide_legend = _a.hide_legend, bg_color = _a.bg_color, hide_border = _a.hide_border, hide_title = _a.hide_title, theme = _a.theme, title_color = _a.title_color; - (0, utils_1.prepareResponse)(res); - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, fetcher_1.fetchHistory)(username, (0, utils_1.clampValue)((0, utils_1.parseNumber)(days_count) || 14, 1, 30))]; - case 2: - data = _b.sent(); - (0, utils_1.setCache)(res, parseInt(cache_seconds || '', 10)); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new HistoryCard_1.default(username, data, { - hide_title: (0, utils_1.parseBoolean)(hide_title), - hide_border: (0, utils_1.parseBoolean)(hide_border), - title_color: title_color, - hide_legend: (0, utils_1.parseBoolean)(hide_legend), - bg_color: bg_color, - layout: layout, - theme: theme, - reverse_order: (0, utils_1.parseBoolean)(reverse_order), - language_count: (0, utils_1.parseNumber)(language_count), - width: (0, utils_1.parseNumber)(width), - height: (0, utils_1.clampValue)((0, utils_1.parseNumber)(height) || 300, 200), - hide: (0, utils_1.parseArray)(hide) - }).render()))]; - case 3: - err_1 = _b.sent(); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new Error_1.default(err_1).render()))]; - case 4: return [2 /*return*/]; - } - }); -}); }); diff --git a/dist/api/profile.js b/dist/api/profile.js deleted file mode 100644 index fc584a9..0000000 --- a/dist/api/profile.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var server_1 = __importDefault(require("react-dom/server")); -var utils_1 = require("../src/common/utils"); -var fetcher_1 = require("../src/fetcher"); -var ProfileCard_1 = __importDefault(require("../src/cards/ProfileCard")); -var Error_1 = __importDefault(require("../src/components/Error")); -exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () { - var _a, username, hide, hide_rank, show_icons, line_height, icon_color, text_color, cache_seconds, title, - // Master - bg_color, hide_border, hide_title, theme, title_color, data, err_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = req.query, username = _a.username, hide = _a.hide, hide_rank = _a.hide_rank, show_icons = _a.show_icons, line_height = _a.line_height, icon_color = _a.icon_color, text_color = _a.text_color, cache_seconds = _a.cache_seconds, title = _a.title, bg_color = _a.bg_color, hide_border = _a.hide_border, hide_title = _a.hide_title, theme = _a.theme, title_color = _a.title_color; - (0, utils_1.prepareResponse)(res); - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, fetcher_1.fetchProfile)(username)]; - case 2: - data = _b.sent(); - (0, utils_1.setCache)(res, parseInt(cache_seconds || '', 10)); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new ProfileCard_1.default(data.username, data.xp, data.recentXp, { - hide: (0, utils_1.parseArray)(hide), - show_icons: (0, utils_1.parseBoolean)(show_icons), - hide_title: (0, utils_1.parseBoolean)(hide_title), - hide_border: (0, utils_1.parseBoolean)(hide_border), - hide_rank: (0, utils_1.parseBoolean)(hide_rank), - line_height: (0, utils_1.parseNumber)(line_height), - title: title, - title_color: title_color, - icon_color: icon_color, - text_color: text_color, - bg_color: bg_color, - theme: theme, - }).render()))]; - case 3: - err_1 = _b.sent(); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new Error_1.default(err_1).render()))]; - case 4: return [2 /*return*/]; - } - }); -}); }); diff --git a/dist/api/top-langs.js b/dist/api/top-langs.js deleted file mode 100644 index 866544c..0000000 --- a/dist/api/top-langs.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var server_1 = __importDefault(require("react-dom/server")); -var utils_1 = require("../src/common/utils"); -var fetcher_1 = require("../src/fetcher"); -var TopLanguagesCard_1 = __importDefault(require("../src/cards/TopLanguagesCard")); -var Error_1 = __importDefault(require("../src/components/Error")); -exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () { - var _a, username, hide, hide_title, hide_border, card_width, title_color, text_color, bg_color, language_count, theme, cache_seconds, layout, title, topLangs, err_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = req.query, username = _a.username, hide = _a.hide, hide_title = _a.hide_title, hide_border = _a.hide_border, card_width = _a.card_width, title_color = _a.title_color, text_color = _a.text_color, bg_color = _a.bg_color, language_count = _a.language_count, theme = _a.theme, cache_seconds = _a.cache_seconds, layout = _a.layout, title = _a.title; - (0, utils_1.prepareResponse)(res); - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, fetcher_1.fetchTopLanguages)(username)]; - case 2: - topLangs = _b.sent(); - (0, utils_1.setCache)(res, parseInt(cache_seconds || '', 10)); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new TopLanguagesCard_1.default(username, topLangs.langs, { - hide: (0, utils_1.parseArray)(hide), - language_count: (0, utils_1.parseNumber)(language_count), - card_width: (0, utils_1.parseNumber)(card_width), - layout: layout, - text_color: text_color, - theme: theme, - title: title, - title_color: title_color, - bg_color: bg_color, - hide_border: (0, utils_1.parseBoolean)(hide_border), - hide_title: (0, utils_1.parseBoolean)(hide_title) - }).render()))]; - case 3: - err_1 = _b.sent(); - return [2 /*return*/, res.send(server_1.default.renderToStaticMarkup(new Error_1.default(err_1).render()))]; - case 4: return [2 /*return*/]; - } - }); -}); }); diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 16eafbb..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var express_1 = __importDefault(require("express")); -var history_1 = __importDefault(require("./api/history")); -var top_langs_1 = __importDefault(require("./api/top-langs")); -var profile_1 = __importDefault(require("./api/profile")); -var app = (0, express_1.default)(); -app.use('/profile', profile_1.default); -app.use('/history', history_1.default); -app.use('/toplang', top_langs_1.default); -app.get('/', function (_, res) { - res.redirect(301, 'https://github.com/domai-tb/codestats-readme'); -}); -app.listen(3000, function () { - console.log('server launched!'); -}); diff --git a/dist/src/cards/HistoryCard.js b/dist/src/cards/HistoryCard.js deleted file mode 100644 index 8d50007..0000000 --- a/dist/src/cards/HistoryCard.js +++ /dev/null @@ -1,225 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var utils_1 = require("../common/utils"); -var Card_1 = __importDefault(require("../common/Card")); -var FlexLayout_1 = __importDefault(require("../components/FlexLayout")); -var HistoryCard = /** @class */ (function (_super) { - __extends(HistoryCard, _super); - function HistoryCard(username, days, options) { - var _this = _super.call(this, options) || this; - _this.username = username; - _this.days = days; - _this.options = options; - _this.legendMinWidth = 180; - _this.processOptions(); - var languagesToHide = options.hide || []; - var languageCount = []; - for (var _i = 0, _a = _this.days; _i < _a.length; _i++) { - var day = _a[_i]; - var _loop_1 = function (data) { - var index = languageCount.findIndex(function (item) { return item.language === data.language; }); - if (index === -1) { - index = languageCount.push({ - language: data.language, - xp: 0 - }) - 1; - } - languageCount[index].xp += data.xp; - }; - for (var _b = 0, _c = day.data; _b < _c.length; _b++) { - var data = _c[_b]; - _loop_1(data); - } - } - _this.topLanguages = languageCount - .sort(function (a, b) { return b.xp - a.xp; }) - .map(function (item) { return item.language; }) - .filter(function (lang) { return !languagesToHide.includes(lang); }); - languagesToHide.push.apply(languagesToHide, _this.topLanguages.splice((options.language_count || 8))); - if (languagesToHide.length > 0) { - _this.topLanguages.push('Other'); - } - _this.hideLanguages(languagesToHide); - return _this; - } - HistoryCard.prototype.hideLanguages = function (languagesToHide) { - for (var _i = 0, _a = this.days; _i < _a.length; _i++) { - var day = _a[_i]; - // Prepare array of indexes to remove - var toRemove = []; - // Loop through data - for (var i = 0; i < day.data.length; i++) { - var element = day.data[i]; - // If Language should not be hidden: goto next - if (!languagesToHide.includes(element.language)) { - continue; - } - // Search indexOf 'Others' - var otherIndex = day.data.findIndex(function (el) { return el.language === 'Others'; }); - if (otherIndex === -1) { - day.data.push({ - language: 'Others', - xp: element.xp - }); - } - else { - day.data[otherIndex].xp += element.xp; - } - toRemove.push(i); - } - // Reverse array and remove each indexes - for (var _b = 0, _c = toRemove.reverse(); _b < _c.length; _b++) { - var index = _c[_b]; - day.data.splice(index, 1); - } - } - }; - HistoryCard.prototype.processOptions = function () { - var _a, _b, _c; - this.height = 45 + (this.days.length + 1) * 40; - this.width = (_a = this.options.width) !== null && _a !== void 0 ? _a : 500; - if (this.options.layout === 'horizontal') { - this.width = 45 + (this.days.length + 1) * 40 + (this.options.hide_legend ? 0 : this.legendMinWidth); - this.height = (_b = this.options.height) !== null && _b !== void 0 ? _b : 300; - } - this.title = (_c = this.options.title) !== null && _c !== void 0 ? _c : "Last ".concat(this.days.length, " days XP history"); - this.css = ProgressNode.getCSS((0, utils_1.getColor)('text_color', this.options.text_color, this.options.theme)); - if (this.options.reverse_order) { - this.days = this.days.reverse(); - } - }; - HistoryCard.prototype.render = function () { - var _this = this; - var totalTotal = this.days.reduce(function (prvs, crnt) { - if (prvs < crnt.total) { - return crnt.total; - } - return prvs; - }, 0); - var legendWidth = this.options.hide_legend ? 0 : Math.max(this.width * 20 / 100 + 60, this.legendMinWidth); - var historyWidth = this.width - legendWidth; - var items = []; - // Format History bars - var history = this.options.layout === 'horizontal' ? (react_1.default.createElement(FlexLayout_1.default, { key: 0, items: this.days.reverse().map(function (el, index) { return (react_1.default.createElement(VerticalProgressNode, __assign({ key: index }, el, { totalTotal: totalTotal, height: _this.height - 120 }))); }), gap: 40 })) : (react_1.default.createElement(FlexLayout_1.default, { key: 0, items: this.days.map(function (el, index) { return (react_1.default.createElement(ProgressNode, __assign({ key: index }, el, { totalTotal: totalTotal, width: historyWidth - 60 }))); }), gap: 40, direction: "column" })); - items.push(history); - if (!this.options.hide_legend) { - items.push(react_1.default.createElement(FlexLayout_1.default, { key: 1, items: this.topLanguages.map(function (el, index) { return (react_1.default.createElement(react_1.default.Fragment, { key: index }, - react_1.default.createElement("rect", { rx: "5", x: "2", y: "7", height: "12", width: "12", fill: (0, utils_1.getColorOfLanguage)(el) }), - react_1.default.createElement("text", { x: "18", y: "18", className: "lang-name", key: index }, el))); }), gap: 20, direction: "column" })); - } - return _super.prototype.render.call(this, react_1.default.createElement("svg", { x: "25" }, - react_1.default.createElement(FlexLayout_1.default, { items: items, gap: historyWidth }))); - }; - return HistoryCard; -}(Card_1.default)); -exports.default = HistoryCard; -var ProgressNode = /** @class */ (function (_super) { - __extends(ProgressNode, _super); - function ProgressNode() { - return _super !== null && _super.apply(this, arguments) || this; - } - ProgressNode.prototype.render = function () { - var _this = this; - var offset = 0; - var maskId = "mask-".concat(this.props.day); - return (react_1.default.createElement(react_1.default.Fragment, null, - react_1.default.createElement("text", { x: "2", y: "15", className: "lang-name" }, new Date(this.props.day).toDateString().substr(4, 6)), - react_1.default.createElement("svg", { width: this.props.width }, - react_1.default.createElement("mask", { id: maskId }, - react_1.default.createElement("rect", { x: "0", y: "20", width: this.calcSize(this.props.total), height: "16", fill: "white", rx: "5" })), - react_1.default.createElement("rect", { rx: "5", ry: "5", x: "0", y: "20", width: this.props.width, height: "16", fill: "#ddd" }), - this.props.data.map(function (el, index) { - var color = (0, utils_1.getColorOfLanguage)(el.language); - offset += el.xp; - return (react_1.default.createElement("rect", { key: index, mask: "url(#".concat(maskId, ")"), height: "16", fill: color, x: _this.calcSize(offset - el.xp), y: "20", width: "".concat(_this.calcSize(el.xp), "px") })); - }), - this.getXPText(offset)))); - }; - ProgressNode.prototype.calcSize = function (number) { - return number * this.props.width / this.props.totalTotal; - }; - ProgressNode.prototype.getXPText = function (offset) { - var size = this.calcSize(offset) + 6; - var txtSize = (this.props.total.toString().length + 3) * 8; - var classes = 'xp-txt'; - if (size + txtSize >= this.calcSize(this.props.totalTotal)) { - size -= txtSize; - classes += ' xp-txt-invert'; - } - return (react_1.default.createElement("text", { x: size, y: "33", className: classes }, - this.props.total, - " XP")); - }; - ProgressNode.getCSS = function (textColor) { return "\n\t.lang-name {\n\t\tfont: 400 16px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\tfill: ".concat(textColor, ";\n\t}\n\t.xp-txt {\n\t\tfont: 400 12px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\tfill: black;\n\t}\n\t.xp-txt-invert {\n\t\tfont: 600 12px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\tfill: white;\n\t}\n\t.subtitle {\n\t\tfont: 400 14px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\tfill: ").concat(textColor, ";\n\t}\n"); }; - return ProgressNode; -}(react_1.default.Component)); -var VerticalProgressNode = /** @class */ (function (_super) { - __extends(VerticalProgressNode, _super); - function VerticalProgressNode() { - return _super !== null && _super.apply(this, arguments) || this; - } - VerticalProgressNode.prototype.render = function () { - var _this = this; - var offset = this.props.totalTotal; - var maskId = "mask-".concat(this.props.day); - return (react_1.default.createElement(react_1.default.Fragment, null, - react_1.default.createElement("svg", { x: "7", y: "-20", height: this.props.height + 60 }, - react_1.default.createElement("mask", { id: maskId }, - react_1.default.createElement("rect", { x: "0", y: 25 + this.calcSize(this.props.totalTotal - this.props.total), width: "16", height: this.calcSize(this.props.total), fill: "white", rx: "5" })), - react_1.default.createElement("rect", { rx: "5", ry: "5", x: "0", y: "25", width: "16", height: this.props.height, fill: "#ddd" }), - this.props.data.map(function (el, index) { - var color = (0, utils_1.getColorOfLanguage)(el.language); - offset -= el.xp; - return (react_1.default.createElement("rect", { key: index, mask: "url(#".concat(maskId, ")"), width: "16", fill: color, y: 25 + _this.calcSize(offset), x: "0", height: "".concat(_this.calcSize(el.xp), "px") })); - }), - this.getXPTxt()), - react_1.default.createElement("text", { x: "2", y: this.props.height + 18, className: "subtitle" }, new Date(this.props.day).toDateString().substr(4, 3)), - react_1.default.createElement("text", { x: "6", y: this.props.height + 34, className: "subtitle" }, (0, utils_1.formatDateNumber)(new Date(this.props.day).getDate())))); - }; - VerticalProgressNode.prototype.calcSize = function (number) { - return number * this.props.height / this.props.totalTotal; - }; - VerticalProgressNode.prototype.getXPTxt = function () { - var txtLength = (this.props.total.toString().length + 3) * 13; - var position = 25 + this.calcSize(this.props.totalTotal - this.props.total) - txtLength; - var classes = 'xp-txt'; - if (position <= 28) { - position += txtLength + 16; - classes += ' xp-txt-invert'; - } - return (react_1.default.createElement("text", { transform: "rotate(90, 4, ".concat(position, ")"), letterSpacing: "5", y: position, x: "4", rotate: "-90", className: classes }, - this.props.total, - " XP")); - }; - return VerticalProgressNode; -}(react_1.default.Component)); diff --git a/dist/src/cards/ProfileCard.js b/dist/src/cards/ProfileCard.js deleted file mode 100644 index 382d279..0000000 --- a/dist/src/cards/ProfileCard.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var utils_1 = require("../common/utils"); -var icons_1 = __importDefault(require("../common/icons")); -var Card_1 = __importDefault(require("../common/Card")); -var FlexLayout_1 = __importDefault(require("../components/FlexLayout")); -var ProfileCard = /** @class */ (function (_super) { - __extends(ProfileCard, _super); - function ProfileCard(username, xp, recentXp, options) { - var _a; - var _this = _super.call(this, options) || this; - _this.username = username; - _this.xp = xp; - _this.recentXp = recentXp; - _this.options = options; - _this.defaults = { - line_height: 25, - hide: [] - }; - // This Element - _this.stats = { - xp: { - icon: icons_1.default.star, - label: 'XP', - value: xp - }, - recent_xp: { - icon: icons_1.default.commits, - label: 'Recent xp', - value: _this.recentXp - } - }; - // Card Settings - _this.width = 495; - _this.height = Math.max(45 + (Object.keys(_this.stats).length + 1) * (_this.options.line_height || _this.defaults.line_height), options.hide_rank ? 0 : 120); - _this.title = (_a = _this.options.title) !== null && _a !== void 0 ? _a : "".concat((0, utils_1.encodeHTML)(_this.username)).concat(['x', 's'].includes(_this.username.slice(-1)) ? '\'' : '\'s', " Code::Stats Profile"); - var textColor = (0, utils_1.getColor)('text_color', options.text_color, options.theme); - var iconColor = (0, utils_1.getColor)('icon_color', options.icon_color, options.theme); - if (!_this.options.hide_rank) { - _this.css += RankCircle.getCSS(textColor, iconColor, (0, utils_1.getProgress)(xp)); - } - if ((_this.options.hide || []) < Object.keys(_this.stats)) { - _this.css += TextNode.getCSS(textColor, _this.options.show_icons ? iconColor : undefined); - } - return _this; - } - ProfileCard.prototype.render = function () { - var _this = this; - return _super.prototype.render.call(this, react_1.default.createElement(react_1.default.Fragment, null, - !this.options.hide_rank && (react_1.default.createElement(RankCircle, { xp: this.xp })), - react_1.default.createElement("svg", { x: "0", y: "0" }, - react_1.default.createElement(FlexLayout_1.default, { items: Object - .keys(this.stats) - .filter(function (item) { return !(_this.options.hide || []).includes(item); }) - .map(function (el, index) { - var item = _this.stats[el]; - return (react_1.default.createElement(TextNode, __assign({}, item, { icon: _this.options.show_icons ? item.icon : undefined, key: index, index: index }))); - }), gap: this.options.line_height || this.defaults.line_height, direction: "column" })))); - }; - return ProfileCard; -}(Card_1.default)); -exports.default = ProfileCard; -var RankCircle = /** @class */ (function (_super) { - __extends(RankCircle, _super); - function RankCircle() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.render = function () { return (react_1.default.createElement("g", { "data-testid": "rank-circle", transform: "translate(400, 0)" }, - react_1.default.createElement("circle", { className: "rank-circle-rim", cx: "-10", cy: "8", r: "40" }), - react_1.default.createElement("circle", { className: "rank-circle", cx: "-10", cy: "8", r: "40" }), - react_1.default.createElement("g", { className: "rank-text" }, - react_1.default.createElement("text", { x: "-4", y: "0", alignmentBaseline: "central", dominantBaseline: "central", textAnchor: "middle" }, - "lv ", - (0, utils_1.getLevel)(_this.props.xp))))); }; - return _this; - } - RankCircle.getCSS = function (textColor, titleColor, progress) { return "\n\t\t.rank-text {\n\t\t\tfont: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: ".concat(textColor, ";\n\t\t\tanimation: scaleInAnimation 0.3s ease-in-out forwards;\n\t\t}\n\n\t\t.rank-circle-rim {\n\t\t\tstroke: ").concat(titleColor, ";\n\t\t\tfill: none;\n\t\t\tstroke-width: 6;\n\t\t\topacity: 0.2;\n\t\t}\n\t\t.rank-circle {\n\t\t\tstroke: ").concat(titleColor, ";\n\t\t\tstroke-dasharray: 250;\n\t\t\tfill: none;\n\t\t\tstroke-width: 6;\n\t\t\tstroke-linecap: round;\n\t\t\topacity: 0.8;\n\t\t\ttransform-origin: -10px 8px;\n\t\t\ttransform: rotate(-90deg);\n\t\t\tanimation: rankAnimation 1s forwards ease-in-out;\n\t\t}\n\n\t\t@keyframes rankAnimation {\n\t\t\tfrom {\n\t\t\t\tstroke-dashoffset: ").concat((0, utils_1.calculateCircleProgress)(0), ";\n\t\t\t}\n\t\t\tto {\n\t\t\t\tstroke-dashoffset: ").concat((0, utils_1.calculateCircleProgress)(progress), ";\n\t\t\t}\n\t\t}\n\t"); }; - return RankCircle; -}(react_1.default.Component)); -var TextNode = /** @class */ (function (_super) { - __extends(TextNode, _super); - function TextNode() { - return _super !== null && _super.apply(this, arguments) || this; - } - TextNode.prototype.render = function () { - var delay = (this.props.index + 3 * 150); - // Icon prefixing line - var icon = this.props.icon ? (react_1.default.createElement("svg", { "data-testid": "icon", className: "icon", viewBox: "0 0 16 16", version: "1.1", width: "16", height: "16" }, this.props.icon)) : undefined; - return (react_1.default.createElement("g", { className: "stagger", style: { animationDelay: "".concat(delay, "ms") }, transform: "translate(25, 0)" }, - icon, - react_1.default.createElement("text", { className: "stat bold", x: this.props.icon ? 25 : undefined, y: "12.5" }, - this.props.label, - ":"), - react_1.default.createElement("text", { className: "stat", x: this.props.icon ? 120 : 100, y: "12.5" }, (0, utils_1.kFormatter)(this.props.value)))); - }; - TextNode.getCSS = function (textColor, iconColor) { return "\n\t\t".concat(iconColor ? ".icon {\n\t\t\t\tfill: ".concat(iconColor, ";\n\t\t\t\t// display: block;\n\t\t\t}") : '', "\n\t\t.stagger {\n\t\t\topacity: 0;\n\t\t\tanimation: fadeInAnimation 0.3s ease-in-out forwards;\n\t\t}\n\t\t.stat {\n\t\t\tfont: 600 14px 'Segoe UI', Ubuntu, \"Helvetica Neue\", Sans-Serif; fill: ").concat(textColor, ";\n\t\t}\n\t\t.bold {\n\t\t\tfont-weight: 700\n\t\t}\n\t"); }; - return TextNode; -}(react_1.default.Component)); diff --git a/dist/src/cards/TopLanguagesCard.js b/dist/src/cards/TopLanguagesCard.js deleted file mode 100644 index bfb6396..0000000 --- a/dist/src/cards/TopLanguagesCard.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var utils_1 = require("../common/utils"); -var Card_1 = __importDefault(require("../common/Card")); -var FlexLayout_1 = __importDefault(require("../components/FlexLayout")); -var TopLanguagesCard = /** @class */ (function (_super) { - __extends(TopLanguagesCard, _super); - function TopLanguagesCard(username, langs, options) { - var _a; - var _this = _super.call(this, options) || this; - _this.username = username; - _this.langs = langs; - _this.options = options; - _this.langs = _this.langs - .filter(function (item) { return !(options.hide || []).includes(item.name); }) - .slice(0, options.language_count || 5); - _this.height = 45 + (_this.langs.length + 1) * 40; - _this.width = 300; - if (options.card_width && !isNaN(options.card_width)) { - _this.width = options.card_width; - } - var textColor = (0, utils_1.getColor)('text_color', options.text_color, options.theme); - _this.title = (_a = _this.options.title) !== null && _a !== void 0 ? _a : 'Most Used Languages'; - _this.css = CompactTextNode.getCSS(textColor); - return _this; - } - TopLanguagesCard.prototype.render = function () { - var _this = this; - var total = this.langs.reduce(function (acc, curr) { return acc + curr.xp; }, 0); - if (this.options.layout === 'compact') { - this.width = this.width + 50; - this.height = 90 + Math.round(this.langs.length / 2) * 25; - return _super.prototype.render.call(this, react_1.default.createElement("svg", { x: "25" }, - react_1.default.createElement("mask", { id: "rect-mask" }, - react_1.default.createElement("rect", { x: "0", y: "0", width: this.width - 50, height: "8", fill: "white", rx: "5" })), - react_1.default.createElement(CompactProgressBar, { langs: this.langs, total: total, parentWidth: this.width }), - this.langs.map(function (el, index) { return (react_1.default.createElement(CompactTextNode, { key: index, index: index, total: total, lang: el })); }))); - } - else { - return _super.prototype.render.call(this, react_1.default.createElement("svg", { x: "25" }, - react_1.default.createElement(FlexLayout_1.default, { items: this.langs.map(function (el, index) { return (react_1.default.createElement(ProgressNode, { key: index, lang: el, total: total, parentWidth: _this.width })); }), gap: 40, direction: "column" }))); - } - }; - return TopLanguagesCard; -}(Card_1.default)); -exports.default = TopLanguagesCard; -var CompactProgressBar = /** @class */ (function (_super) { - __extends(CompactProgressBar, _super); - function CompactProgressBar() { - return _super !== null && _super.apply(this, arguments) || this; - } - CompactProgressBar.prototype.render = function () { - var _this = this; - var offset = 0; - return this.props.langs.map(function (lang, index) { - var percent = (0, utils_1.trunc)((lang.xp / _this.props.total) * (_this.props.parentWidth - 50), 2); - var progress = percent < 10 ? percent + 10 : percent; - var output = (react_1.default.createElement("rect", { key: index, mask: "url(#rect-mask)", "data-testid": "lang-progress", x: offset, y: "0", width: progress, height: "8", fill: lang.color || '#858585' })); - offset += percent; - return output; - }); - }; - return CompactProgressBar; -}(react_1.default.Component)); -var CompactTextNode = /** @class */ (function (_super) { - __extends(CompactTextNode, _super); - function CompactTextNode() { - return _super !== null && _super.apply(this, arguments) || this; - } - CompactTextNode.prototype.render = function () { - var index = this.props.index; - var x = 0; - var y = 12.5 * index + 25; - if (index % 2 !== 0) { - x = 150; - y = 12.5 + 12.5 * index; - } - return (react_1.default.createElement("g", { transform: "translate(".concat(x, ", ").concat(y, ")") }, - react_1.default.createElement("circle", { cx: "5", cy: "6", r: "5", fill: this.props.lang.color }), - react_1.default.createElement("text", { "data-testid": "lang-name", x: "15", y: "10", className: 'lang-name' }, - this.props.lang.name, - " ", - (0, utils_1.getPercent)(this.props.lang.xp, this.props.total), - "%"))); - }; - CompactTextNode.getCSS = function (textColor) { return "\n\t\t.lang-name {\n\t\t\tfont: 400 11px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\t\tfill: ".concat(textColor, ";\n\t\t}\n\t"); }; - return CompactTextNode; -}(react_1.default.Component)); -var ProgressNode = /** @class */ (function (_super) { - __extends(ProgressNode, _super); - function ProgressNode() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.paddingRight = 60; - return _this; - } - ProgressNode.prototype.render = function () { - var width = this.props.parentWidth - this.paddingRight; - var progress1 = (0, utils_1.getPercent)(this.props.lang.xp, this.props.total); - var progress2 = (0, utils_1.getPercent)(this.props.lang.xp - this.props.lang.recentXp, this.props.total); - return (react_1.default.createElement(react_1.default.Fragment, null, - react_1.default.createElement("text", { x: "2", y: "15", className: "lang-name" }, - this.props.lang.name, - " ", - progress1, - "% ", - this.props.lang.recentXp >= 1 ? " + ".concat((0, utils_1.trunc)(progress1 - progress2, 2), "%") : ''), - react_1.default.createElement("svg", { width: width }, - react_1.default.createElement("rect", { rx: "5", ry: "5", x: "0", y: "25", width: width, height: "8", fill: "#ddd" }), - progress1 !== progress2 && (react_1.default.createElement("rect", { height: "8", fill: "#f2b866", rx: "5", ry: "5", x: "1", y: "25", width: "".concat(progress1, "%") })), - progress1 >= progress2 && (react_1.default.createElement("rect", { height: "8", fill: this.props.lang.color, rx: "5", ry: "5", x: "0", y: "25", "data-testid": "lang-progress", width: "".concat(progress2, "%") }))))); - }; - return ProgressNode; -}(react_1.default.Component)); diff --git a/dist/src/common/Card.js b/dist/src/common/Card.js deleted file mode 100644 index 1283d28..0000000 --- a/dist/src/common/Card.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var FlexLayout_1 = __importDefault(require("../components/FlexLayout")); -var utils_1 = require("./utils"); -var Card = /** @class */ (function () { - function Card(options) { - this.hideBorder = false; - this.hideTitle = false; - this.css = ''; - this.paddingX = 25; - this.paddingY = 35; - this.animations = true; - this.height = 100; - this.width = 100; - this.title = ''; - this.colors = {}; - if (options) { - this.hideBorder = (0, utils_1.parseBoolean)(options.hide_border); - this.hideTitle = (0, utils_1.parseBoolean)(options.hide_title); - this.colors = { - titleColor: (0, utils_1.getColor)('title_color', options === null || options === void 0 ? void 0 : options.title_color, options === null || options === void 0 ? void 0 : options.theme), - bgColor: (0, utils_1.getColor)('bg_color', options === null || options === void 0 ? void 0 : options.bg_color, options === null || options === void 0 ? void 0 : options.theme) - }; - } - } - Card.prototype.renderTitle = function () { - var titleText = (react_1.default.createElement("text", { x: "0", y: "0", className: "header" }, this.title)); - var prefixIcon = (react_1.default.createElement("svg", { className: "icon", x: "0", y: "-13", viewBox: "0 0 16 16", version: "1.1", width: "16", height: "16" }, this.titlePrefix)); - return (react_1.default.createElement("g", { transform: "translate(".concat(this.paddingX, ", ").concat(this.paddingY, ")") }, - react_1.default.createElement(FlexLayout_1.default, { items: [this.titlePrefix && prefixIcon, titleText], gap: 25 }))); - }; - Card.prototype.renderGradient = function () { - if (typeof this.colors.bgColor !== 'object') - return; - var gradients = this.colors.bgColor.slice(1); - return typeof this.colors.bgColor === 'object' ? - (react_1.default.createElement("defs", null, - react_1.default.createElement("linearGradient", { id: "gradient", gradientTransform: "rotate(".concat(this.colors.bgColor[0], ")") }, gradients.map(function (grad, index) { - var offset = (index * 100) / (gradients.length - 1); - return ""); - })))) : - ''; - }; - Card.prototype.render = function (body) { - return (react_1.default.createElement("svg", { width: this.width, height: this.height - (this.hideTitle ? 30 : 0), viewBox: "0 0 ".concat(this.width, " ").concat(this.height), fill: "none", xmlns: "http://www.w3.org/2000/svg" }, - react_1.default.createElement("style", null, "\n\t\t\t\t\t.header {\n\t\t\t\t\t\tfont: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;\n\t\t\t\t\t\tfill: ".concat(this.colors.titleColor, ";\n\t\t\t\t\t\tanimation: fadeInAnimation 0.8s ease-in-out forwards;\n\t\t\t\t\t}\n\t\t\t\t\t").concat(this.css, "\n\n\t\t\t\t\t/* Animations */\n\t\t\t\t\t@keyframes scaleInAnimation {\n\t\t\t\t\t\tfrom {\n\t\t\t\t\t\t\ttransform: translate(-5px, 5px) scale(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto {\n\t\t\t\t\t\t\ttransform: translate(-5px, 5px) scale(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@keyframes fadeInAnimation {\n\t\t\t\t\t\tfrom {\n\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto {\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t")), - this.renderGradient(), - react_1.default.createElement("rect", { x: "0.5", y: "0.5", rx: "4.5", height: "99%", stroke: "#E4E2E2", width: this.width - 1, fill: typeof this.colors.bgColor === 'object' ? - 'url(#gradient)' : - this.colors.bgColor, strokeOpacity: this.hideBorder ? 0 : 1 }), - this.hideTitle ? '' : this.renderTitle(), - react_1.default.createElement("g", { transform: "translate(0, ".concat(this.hideTitle ? this.paddingX : this.paddingY + 20, ")") }, body))); - }; - return Card; -}()); -exports.default = Card; diff --git a/dist/src/common/icons.js b/dist/src/common/icons.js deleted file mode 100644 index dc5d852..0000000 --- a/dist/src/common/icons.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var icons = { - star: react_1.default.createElement("path", { fillRule: "evenodd", d: "M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z" }), - commits: react_1.default.createElement("path", { fillRule: "evenodd", d: "M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z" }), - prs: react_1.default.createElement("path", { fillRule: "evenodd", d: "M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z" }), - issues: react_1.default.createElement("path", { fillRule: "evenodd", d: "M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z" }), - icon: react_1.default.createElement("path", { fillRule: "evenodd", d: "M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z" }), - contribs: react_1.default.createElement("path", { fillRule: "evenodd", d: "M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z" }), - fork: react_1.default.createElement("path", { fillRule: "evenodd", d: "M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z" }) -}; -exports.default = icons; diff --git a/dist/src/common/retryer.js b/dist/src/common/retryer.js deleted file mode 100644 index 8fdfb20..0000000 --- a/dist/src/common/retryer.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var utils_1 = require("./utils"); -function retryer(fetcher, data, retries, err) { - if (retries === void 0) { retries = 0; } - return __awaiter(this, void 0, void 0, function () { - var err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (retries > 7) { - throw new utils_1.CustomError('Maximum retries exceeded. ' + err, 'MAX_RETRY'); - } - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, fetcher(data)]; - case 2: return [2 /*return*/, _a.sent()]; - case 3: - err_1 = _a.sent(); - return [2 /*return*/, retryer(fetcher, data, ++retries, err_1)]; - case 4: return [2 /*return*/]; - } - }); - }); -} -exports.default = retryer; diff --git a/dist/src/common/utils.js b/dist/src/common/utils.js deleted file mode 100644 index 7eb2748..0000000 --- a/dist/src/common/utils.js +++ /dev/null @@ -1,267 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getColorOfLanguage = exports.formatDate = exports.formatDateNumber = exports.lowercaseTrim = exports.setCache = exports.prepareResponse = exports.calculateCircleProgress = exports.parseNumber = exports.trunc = exports.getPercent = exports.getProgress = exports.getLevel = exports.CustomError = exports.SECONDARY_ERROR_MESSAGES = exports.CONSTANTS = exports.wrapTextMultiline = exports.getColor = exports.profileGraphRequest = exports.request = exports.clampValue = exports.parseArray = exports.parseBoolean = exports.kFormatter = exports.encodeHTML = void 0; -var node_fetch_1 = __importDefault(require("node-fetch")); -var word_wrap_1 = __importDefault(require("word-wrap")); -var themes_json_1 = __importDefault(require("../../themes/themes.json")); -var language_bar_json_1 = __importDefault(require("../../themes/language-bar.json")); -/** - * Encode a string to escape HTML - * - * https://stackoverflow.com/a/48073476/10629172 - * @param str the string to encode - */ -function encodeHTML(str) { - return str - .replace(/[\u00A0-\u9999<>&](?!#)/gim, function (i) { - return '&#' + i.charCodeAt(0) + ';'; - }); -} -exports.encodeHTML = encodeHTML; -function kFormatter(num) { - return Math.abs(num) > 999 ? - trunc(num / 1000) + 'k' : - num; -} -exports.kFormatter = kFormatter; -/** - * Transform the `value` query string into a Boolean - * @param value the value to transform - */ -function parseBoolean(value) { - return value === 'true' || value === '' || value === true; -} -exports.parseBoolean = parseBoolean; -function parseArray(str) { - if (!str) - return []; - return str.split(','); -} -exports.parseArray = parseArray; -function clampValue(number, min, max) { - return Math.max(min, max ? Math.min(number, max) : number); -} -exports.clampValue = clampValue; -function request(username) { - return __awaiter(this, void 0, void 0, function () { - var resp; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, node_fetch_1.default)("https://codestats.net/api/users/".concat(username))]; - case 1: - resp = _a.sent(); - return [2 /*return*/, resp.json()]; - } - }); - }); -} -exports.request = request; -function profileGraphRequest(body) { - return __awaiter(this, void 0, void 0, function () { - var resp; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, node_fetch_1.default)('https://codestats.net/profile-graph', { - body: body, - method: 'POST' - })]; - case 1: - resp = _a.sent(); - return [2 /*return*/, resp.json()]; - } - }); - }); -} -exports.profileGraphRequest = profileGraphRequest; -function getColor(color, replacementColor, theme) { - if (theme === void 0) { theme = 'default'; } - return '#' + (replacementColor ? replacementColor : themes_json_1.default[theme][color]); -} -exports.getColor = getColor; -function wrapTextMultiline(text, width, maxLines) { - if (width === void 0) { width = 60; } - if (maxLines === void 0) { maxLines = 3; } - var wrapped = (0, word_wrap_1.default)(encodeHTML(text), { width: width }) - .split('\n') // Split wrapped lines to get an array of lines - .map(function (line) { return line.trim(); }); // Remove leading and trailing whitespace of each line - var lines = wrapped.slice(0, maxLines); // Only consider maxLines lines - // Add "..." to the last line if the text exceeds maxLines - if (wrapped.length > maxLines) { - lines[maxLines - 1] += '...'; - } - // Remove empty lines if text fits in less than maxLines lines - return lines.filter(Boolean); -} -exports.wrapTextMultiline = wrapTextMultiline; -exports.CONSTANTS = { - THIRTY_MINUTES: 1800, - TWO_HOURS: 7200, - FOUR_HOURS: 14400, - ONE_DAY: 86400, - LEVEL_FACTOR: 0.025 -}; -exports.SECONDARY_ERROR_MESSAGES = { - MAX_RETRY: 'Make sure your profile is not private' -}; -var CustomError = /** @class */ (function (_super) { - __extends(CustomError, _super); - function CustomError(message, type) { - var _this = _super.call(this, message) || this; - _this.type = type; - _this.secondaryMessage = exports.SECONDARY_ERROR_MESSAGES[type] || 'adsad'; - return _this; - } - CustomError.MAX_RETRY = 'MAX_RETRY'; - CustomError.USER_NOT_FOUND = 'USER_NOT_FOUND'; - return CustomError; -}(Error)); -exports.CustomError = CustomError; -/** - * Return the level depending on the xp - * - * https://codestats.net/api-docs - * @param xp the xp count - */ -function getLevel(xp) { - return Math.trunc(Math.floor(exports.CONSTANTS.LEVEL_FACTOR * Math.sqrt(xp))); -} -exports.getLevel = getLevel; -/** - * Return the progress (0-99)% til next level - * @param xp Xp number - */ -function getProgress(xp) { - var currentLvl = getLevel(xp); - return trunc((exports.CONSTANTS.LEVEL_FACTOR * Math.sqrt(xp) - currentLvl) * 100, 2); -} -exports.getProgress = getProgress; -function getPercent(number, total) { - return trunc(number * 100 / total, 2); -} -exports.getPercent = getPercent; -/** - * Round a number without moving it to a string and reparsing it - * - * https://stackoverflow.com/a/29494612/7335674 - * @param number the number to truncate - * @param digits the number of digits after the dot - */ -function trunc(number, digits) { - if (digits === void 0) { digits = 0; } - var pow = Math.pow(10, digits); - return Math.round(number * pow) / pow; -} -exports.trunc = trunc; -function parseNumber(number) { - if (typeof number === 'undefined' || typeof number === 'number') { - return 0; - } - var n = parseFloat(number); - if (isNaN(n)) { - return 0; - } - return n; -} -exports.parseNumber = parseNumber; -function calculateCircleProgress(percent, radius) { - if (radius === void 0) { radius = 40; } - var c = Math.PI * radius * 2; - percent = clampValue(percent, 0, 100); - return ((100 - percent) / 100) * c; -} -exports.calculateCircleProgress = calculateCircleProgress; -/** - * Prepare the response - * @param res the response object - */ -function prepareResponse(res) { - res.setHeader('Content-Type', 'image/svg+xml'); -} -exports.prepareResponse = prepareResponse; -/** - * set the cache in the response - * @param res the Response object - * @param cache The cache time in seconds - */ -function setCache(res, cache) { - if (cache === void 0) { cache = exports.CONSTANTS.THIRTY_MINUTES; } - if (isNaN(cache)) { - cache = exports.CONSTANTS.THIRTY_MINUTES; - } - var clampedCache = clampValue(cache, exports.CONSTANTS.THIRTY_MINUTES, exports.CONSTANTS.ONE_DAY); - res.setHeader('Cache-Control', "public, stale-while-revalidate, max-age=".concat(clampedCache, " s-maxage=").concat(clampedCache)); -} -exports.setCache = setCache; -function lowercaseTrim(str) { - return str.toLowerCase().trim(); -} -exports.lowercaseTrim = lowercaseTrim; -function formatDateNumber(number) { - if (number < 10) { - return '0' + number; - } - return number + ''; -} -exports.formatDateNumber = formatDateNumber; -function formatDate(date) { - return "".concat(date.getFullYear(), "-").concat(formatDateNumber(date.getMonth() + 1), "-").concat(formatDateNumber(date.getDate())); -} -exports.formatDate = formatDate; -function getColorOfLanguage(name) { - return name in language_bar_json_1.default ? language_bar_json_1.default[name].color || '#3e4053' : '#3e4053'; -} -exports.getColorOfLanguage = getColorOfLanguage; diff --git a/dist/src/components/Error.js b/dist/src/components/Error.js deleted file mode 100644 index bacf6eb..0000000 --- a/dist/src/components/Error.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var utils_1 = require("../common/utils"); -var Error = /** @class */ (function (_super) { - __extends(Error, _super); - function Error() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.render = function () { return (react_1.default.createElement("svg", { width: "495", height: "120", viewBox: "0 0 495 120", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, - react_1.default.createElement("style", null, "\n\t\t\t\t.text { font: 600 16px 'Segoe UI', Ubuntu, Sans-Serif; fill: #2F80ED }\n\t\t\t\t.small { font: 600 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #252525 }\n\t\t\t\t.gray { fill: #858585 }\n\t\t\t"), - react_1.default.createElement("rect", { x: "0.5", y: "0.5", width: "494", height: "99%", rx: "4.5", fill: "#FFFEFE", stroke: "#E4E2E2" }), - react_1.default.createElement("text", { x: "25", y: "45", className: "text" }, "Something went wrong!"), - react_1.default.createElement("text", { "data-testid": "message", x: "25", y: "55", className: "text small" }, - react_1.default.createElement("tspan", { x: "25", dy: "18" }, (0, utils_1.encodeHTML)(_this.props.message)), - react_1.default.createElement("tspan", { x: "25", dy: "18", className: "gray" }, _this.props.secondaryMessage)))); }; - return _this; - } - return Error; -}(react_1.default.Component)); -exports.default = Error; diff --git a/dist/src/components/FlexLayout.js b/dist/src/components/FlexLayout.js deleted file mode 100644 index a183177..0000000 --- a/dist/src/components/FlexLayout.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = __importDefault(require("react")); -var FlexLayout = /** @class */ (function (_super) { - __extends(FlexLayout, _super); - function FlexLayout() { - return _super !== null && _super.apply(this, arguments) || this; - } - FlexLayout.prototype.render = function () { - var _this = this; - return this.props.items.filter(Boolean).map(function (item, index) { return (react_1.default.createElement("g", { key: index, transform: _this.getGap(index) }, item)); }); - }; - FlexLayout.prototype.getGap = function (index) { - var gap = this.props.gap * index; - var transform = "translate(".concat(gap, ", 0)"); - if (this.props.direction === 'column') { - transform = "translate(0, ".concat(gap, ")"); - } - return transform; - }; - return FlexLayout; -}(react_1.default.Component)); -exports.default = FlexLayout; diff --git a/dist/src/fetcher/index.js b/dist/src/fetcher/index.js deleted file mode 100644 index 5d754ff..0000000 --- a/dist/src/fetcher/index.js +++ /dev/null @@ -1,159 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fetchTopLanguages = exports.fetchHistory = exports.fetchProfile = void 0; -var utils_1 = require("../common/utils"); -var retryer_1 = __importDefault(require("../common/retryer")); -function fetchProfile(username) { - return __awaiter(this, void 0, void 0, function () { - var response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!username) - throw Error('Invalid Username'); - return [4 /*yield*/, (0, retryer_1.default)(utils_1.request, username)]; - case 1: - response = _a.sent(); - return [2 /*return*/, { - username: username, - xp: response.total_xp, - recentXp: response.new_xp, - level: (0, utils_1.getLevel)(response.total_xp) - }]; - } - }); - }); -} -exports.fetchProfile = fetchProfile; -function fetchHistory(username, days) { - return __awaiter(this, void 0, void 0, function () { - var date, body, response, result, languagesData, _i, _a, data, day, keys, _b, keys_1, day, item, date2, oldDate; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!username) - throw Error('Invalid Username'); - date = new Date(); - date.setDate(date.getDate() - (days - 1)); - body = "{\n\t\tprofile(username: \"".concat(username, "\") {\n\t\t\tday_language_xps: dayLanguageXps(since: \"").concat((0, utils_1.formatDate)(date), "\") {date language xp}\n\t\t}\n\t}"); - return [4 /*yield*/, (0, retryer_1.default)(utils_1.profileGraphRequest, body)]; - case 1: - response = _c.sent(); - if (response.errors) { - throw new utils_1.CustomError(response.errors[0].message, 'MAX_RETRY'); - } - result = {}; - languagesData = {}; - for (_i = 0, _a = response.data.profile.day_language_xps; _i < _a.length; _i++) { - data = _a[_i]; - day = result[data.date]; - if (!day) { - day = []; - } - day.push({ - xp: data.xp, - language: data.language - }); - if (!(data.language in languagesData)) { - languagesData[data.language] = 0; - } - languagesData[data.language] += data.xp; - result[data.date] = day; - } - keys = Object.keys(result); - for (_b = 0, keys_1 = keys; _b < keys_1.length; _b++) { - day = keys_1[_b]; - item = result[day]; - result[day] = item.sort(function (a, b) { return languagesData[b.language] - languagesData[a.language]; }); - if (keys.indexOf(day) === 0 && day === (0, utils_1.formatDate)(date)) { - continue; - } - date2 = new Date(day); - date2.setDate(date2.getDate() - 1); - oldDate = (0, utils_1.formatDate)(date2); - if (!(oldDate in result)) { - result[oldDate] = []; - } - } - return [2 /*return*/, Object.keys(result).map(function (el) { return ({ - data: result[el], - day: el, - total: result[el].reduce(function (prvs, crnt) { return prvs + crnt.xp; }, 0) - }); }).sort(function (a, b) { return a.day < b.day ? 1 : -1; })]; - } - }); - }); -} -exports.fetchHistory = fetchHistory; -function fetchTopLanguages(username) { - return __awaiter(this, void 0, void 0, function () { - var res, langs, resp; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!username) - throw Error('Invalid username'); - return [4 /*yield*/, (0, retryer_1.default)(utils_1.request, username)]; - case 1: - res = _a.sent(); - langs = res.languages; - resp = Object.keys(langs) - .map(function (key) { - var item = langs[key]; - return { - xp: item.xps, - recentXp: item.new_xps, - color: (0, utils_1.getColorOfLanguage)(key), - name: key, - level: (0, utils_1.getLevel)(item.xps) - }; - }) - .sort(function (a, b) { return (b.xp + b.recentXp) - (a.xp + a.recentXp); }); - return [2 /*return*/, { - username: username, - langs: resp - }]; - } - }); - }); -} -exports.fetchTopLanguages = fetchTopLanguages; diff --git a/dist/themes/language-bar.json b/dist/themes/language-bar.json deleted file mode 100644 index ddd5e0e..0000000 --- a/dist/themes/language-bar.json +++ /dev/null @@ -1,1713 +0,0 @@ -{ - "1C Enterprise": { - "color": "#814CCC", - "url": "https://github.com/trending?l=1C-Enterprise" - }, - "4D": { - "color": null, - "url": "https://github.com/trending?l=4D" - }, - "ABAP": { - "color": "#E8274B", - "url": "https://github.com/trending?l=ABAP" - }, - "ActionScript": { - "color": "#882B0F", - "url": "https://github.com/trending?l=ActionScript" - }, - "Ada": { - "color": "#02f88c", - "url": "https://github.com/trending?l=Ada" - }, - "Agda": { - "color": "#315665", - "url": "https://github.com/trending?l=Agda" - }, - "AGS Script": { - "color": "#B9D9FF", - "url": "https://github.com/trending?l=AGS-Script" - }, - "AL Code": { - "color": "#3AA2B5", - "url": "https://github.com/trending?l=AL-Code" - }, - "Alloy": { - "color": "#64C800", - "url": "https://github.com/trending?l=Alloy" - }, - "Alpine Abuild": { - "color": null, - "url": "https://github.com/trending?l=Alpine-Abuild" - }, - "AMPL": { - "color": "#E6EFBB", - "url": "https://github.com/trending?l=AMPL" - }, - "AngelScript": { - "color": "#C7D7DC", - "url": "https://github.com/trending?l=AngelScript" - }, - "ANTLR": { - "color": "#9DC3FF", - "url": "https://github.com/trending?l=ANTLR" - }, - "Apex": { - "color": "#1797c0", - "url": "https://github.com/trending?l=Apex" - }, - "API Blueprint": { - "color": "#2ACCA8", - "url": "https://github.com/trending?l=API-Blueprint" - }, - "APL": { - "color": "#5A8164", - "url": "https://github.com/trending?l=APL" - }, - "Apollo Guidance Computer": { - "color": null, - "url": "https://github.com/trending?l=Apollo-Guidance-Computer" - }, - "AppleScript": { - "color": "#101F1F", - "url": "https://github.com/trending?l=AppleScript" - }, - "Arc": { - "color": "#aa2afe", - "url": "https://github.com/trending?l=Arc" - }, - "ASL": { - "color": null, - "url": "https://github.com/trending?l=ASL" - }, - "ASP.NET": { - "color": "#9400ff", - "url": "https://github.com/trending?l=ASP.NET" - }, - "AspectJ": { - "color": "#a957b0", - "url": "https://github.com/trending?l=AspectJ" - }, - "Assembly": { - "color": "#6E4C13", - "url": "https://github.com/trending?l=Assembly" - }, - "Asymptote": { - "color": "#ff0000", - "url": "https://github.com/trending?l=Asymptote" - }, - "ATS": { - "color": "#1ac620", - "url": "https://github.com/trending?l=ATS" - }, - "Augeas": { - "color": null, - "url": "https://github.com/trending?l=Augeas" - }, - "AutoHotkey": { - "color": "#6594b9", - "url": "https://github.com/trending?l=AutoHotkey" - }, - "AutoIt": { - "color": "#1C3552", - "url": "https://github.com/trending?l=AutoIt" - }, - "Awk": { - "color": null, - "url": "https://github.com/trending?l=Awk" - }, - "Ballerina": { - "color": "#FF5000", - "url": "https://github.com/trending?l=Ballerina" - }, - "Batchfile": { - "color": "#C1F12E", - "url": "https://github.com/trending?l=Batchfile" - }, - "Befunge": { - "color": null, - "url": "https://github.com/trending?l=Befunge" - }, - "Bison": { - "color": null, - "url": "https://github.com/trending?l=Bison" - }, - "BitBake": { - "color": null, - "url": "https://github.com/trending?l=BitBake" - }, - "Blade": { - "color": "#f7523f", - "url": "https://github.com/trending?l=Blade" - }, - "BlitzBasic": { - "color": null, - "url": "https://github.com/trending?l=BlitzBasic" - }, - "BlitzMax": { - "color": "#cd6400", - "url": "https://github.com/trending?l=BlitzMax" - }, - "Bluespec": { - "color": null, - "url": "https://github.com/trending?l=Bluespec" - }, - "Boo": { - "color": "#d4bec1", - "url": "https://github.com/trending?l=Boo" - }, - "Brainfuck": { - "color": "#2F2530", - "url": "https://github.com/trending?l=Brainfuck" - }, - "Brightscript": { - "color": null, - "url": "https://github.com/trending?l=Brightscript" - }, - "C": { - "color": "#555555", - "url": "https://github.com/trending?l=C" - }, - "C#": { - "color": "#178600", - "url": "https://github.com/trending?l=Csharp" - }, - "C++": { - "color": "#f34b7d", - "url": "https://github.com/trending?l=C++" - }, - "C2hs Haskell": { - "color": null, - "url": "https://github.com/trending?l=C2hs-Haskell" - }, - "Cap'n Proto": { - "color": null, - "url": "https://github.com/trending?l=Cap'n-Proto" - }, - "CartoCSS": { - "color": null, - "url": "https://github.com/trending?l=CartoCSS" - }, - "Ceylon": { - "color": "#dfa535", - "url": "https://github.com/trending?l=Ceylon" - }, - "Chapel": { - "color": "#8dc63f", - "url": "https://github.com/trending?l=Chapel" - }, - "Charity": { - "color": null, - "url": "https://github.com/trending?l=Charity" - }, - "ChucK": { - "color": null, - "url": "https://github.com/trending?l=ChucK" - }, - "Cirru": { - "color": "#ccccff", - "url": "https://github.com/trending?l=Cirru" - }, - "Clarion": { - "color": "#db901e", - "url": "https://github.com/trending?l=Clarion" - }, - "Classic ASP": { - "color": "#6a40fd", - "url": "https://github.com/trending?l=Classic-ASP" - }, - "Clean": { - "color": "#3F85AF", - "url": "https://github.com/trending?l=Clean" - }, - "Click": { - "color": "#E4E6F3", - "url": "https://github.com/trending?l=Click" - }, - "CLIPS": { - "color": null, - "url": "https://github.com/trending?l=CLIPS" - }, - "Clojure": { - "color": "#db5855", - "url": "https://github.com/trending?l=Clojure" - }, - "CMake": { - "color": null, - "url": "https://github.com/trending?l=CMake" - }, - "COBOL": { - "color": null, - "url": "https://github.com/trending?l=COBOL" - }, - "CodeQL": { - "color": null, - "url": "https://github.com/trending?l=CodeQL" - }, - "CoffeeScript": { - "color": "#244776", - "url": "https://github.com/trending?l=CoffeeScript" - }, - "ColdFusion": { - "color": "#ed2cd6", - "url": "https://github.com/trending?l=ColdFusion" - }, - "ColdFusion CFC": { - "color": null, - "url": "https://github.com/trending?l=ColdFusion-CFC" - }, - "Common Lisp": { - "color": "#3fb68b", - "url": "https://github.com/trending?l=Common-Lisp" - }, - "Common Workflow Language": { - "color": "#B5314C", - "url": "https://github.com/trending?l=Common-Workflow-Language" - }, - "Component Pascal": { - "color": "#B0CE4E", - "url": "https://github.com/trending?l=Component-Pascal" - }, - "Cool": { - "color": null, - "url": "https://github.com/trending?l=Cool" - }, - "Coq": { - "color": null, - "url": "https://github.com/trending?l=Coq" - }, - "Crystal": { - "color": "#000100", - "url": "https://github.com/trending?l=Crystal" - }, - "CSON": { - "color": "#244776", - "url": "https://github.com/trending?l=CSON" - }, - "Csound": { - "color": null, - "url": "https://github.com/trending?l=Csound" - }, - "Csound Document": { - "color": null, - "url": "https://github.com/trending?l=Csound-Document" - }, - "Csound Score": { - "color": null, - "url": "https://github.com/trending?l=Csound-Score" - }, - "CSS": { - "color": "#563d7c", - "url": "https://github.com/trending?l=CSS" - }, - "Cuda": { - "color": "#3A4E3A", - "url": "https://github.com/trending?l=Cuda" - }, - "CWeb": { - "color": null, - "url": "https://github.com/trending?l=CWeb" - }, - "Cycript": { - "color": null, - "url": "https://github.com/trending?l=Cycript" - }, - "Cython": { - "color": null, - "url": "https://github.com/trending?l=Cython" - }, - "D": { - "color": "#ba595e", - "url": "https://github.com/trending?l=D" - }, - "Dafny": { - "color": "#FFEC25", - "url": "https://github.com/trending?l=Dafny" - }, - "Dart": { - "color": "#00B4AB", - "url": "https://github.com/trending?l=Dart" - }, - "DataWeave": { - "color": "#003a52", - "url": "https://github.com/trending?l=DataWeave" - }, - "Dhall": { - "color": "#dfafff", - "url": "https://github.com/trending?l=Dhall" - }, - "DIGITAL Command Language": { - "color": null, - "url": "https://github.com/trending?l=DIGITAL-Command-Language" - }, - "DM": { - "color": "#447265", - "url": "https://github.com/trending?l=DM" - }, - "Dockerfile": { - "color": "#384d54", - "url": "https://github.com/trending?l=Dockerfile" - }, - "Dogescript": { - "color": "#cca760", - "url": "https://github.com/trending?l=Dogescript" - }, - "DTrace": { - "color": null, - "url": "https://github.com/trending?l=DTrace" - }, - "Dylan": { - "color": "#6c616e", - "url": "https://github.com/trending?l=Dylan" - }, - "E": { - "color": "#ccce35", - "url": "https://github.com/trending?l=E" - }, - "eC": { - "color": "#913960", - "url": "https://github.com/trending?l=eC" - }, - "ECL": { - "color": "#8a1267", - "url": "https://github.com/trending?l=ECL" - }, - "ECLiPSe": { - "color": null, - "url": "https://github.com/trending?l=ECLiPSe" - }, - "Eiffel": { - "color": "#4d6977", - "url": "https://github.com/trending?l=Eiffel" - }, - "Elixir": { - "color": "#6e4a7e", - "url": "https://github.com/trending?l=Elixir" - }, - "Elm": { - "color": "#60B5CC", - "url": "https://github.com/trending?l=Elm" - }, - "Emacs Lisp": { - "color": "#c065db", - "url": "https://github.com/trending?l=Emacs-Lisp" - }, - "EmberScript": { - "color": "#FFF4F3", - "url": "https://github.com/trending?l=EmberScript" - }, - "EQ": { - "color": "#a78649", - "url": "https://github.com/trending?l=EQ" - }, - "Erlang": { - "color": "#B83998", - "url": "https://github.com/trending?l=Erlang" - }, - "F#": { - "color": "#b845fc", - "url": "https://github.com/trending?l=Fsharp" - }, - "F*": { - "color": "#572e30", - "url": "https://github.com/trending?l=F*" - }, - "Factor": { - "color": "#636746", - "url": "https://github.com/trending?l=Factor" - }, - "Fancy": { - "color": "#7b9db4", - "url": "https://github.com/trending?l=Fancy" - }, - "Fantom": { - "color": "#14253c", - "url": "https://github.com/trending?l=Fantom" - }, - "Faust": { - "color": "#c37240", - "url": "https://github.com/trending?l=Faust" - }, - "Filebench WML": { - "color": null, - "url": "https://github.com/trending?l=Filebench-WML" - }, - "Filterscript": { - "color": null, - "url": "https://github.com/trending?l=Filterscript" - }, - "fish": { - "color": null, - "url": "https://github.com/trending?l=fish" - }, - "FLUX": { - "color": "#88ccff", - "url": "https://github.com/trending?l=FLUX" - }, - "Forth": { - "color": "#341708", - "url": "https://github.com/trending?l=Forth" - }, - "Fortran": { - "color": "#4d41b1", - "url": "https://github.com/trending?l=Fortran" - }, - "Fortran Free Form": { - "color": null, - "url": "https://github.com/trending?l=Fortran-Free-Form" - }, - "FreeMarker": { - "color": "#0050b2", - "url": "https://github.com/trending?l=FreeMarker" - }, - "Frege": { - "color": "#00cafe", - "url": "https://github.com/trending?l=Frege" - }, - "Futhark": { - "color": "#5f021f", - "url": "https://github.com/trending?l=Futhark" - }, - "G-code": { - "color": "#D08CF2", - "url": "https://github.com/trending?l=G-code" - }, - "Game Maker Language": { - "color": "#71b417", - "url": "https://github.com/trending?l=Game-Maker-Language" - }, - "GAML": { - "color": "#FFC766", - "url": "https://github.com/trending?l=GAML" - }, - "GAMS": { - "color": null, - "url": "https://github.com/trending?l=GAMS" - }, - "GAP": { - "color": null, - "url": "https://github.com/trending?l=GAP" - }, - "GCC Machine Description": { - "color": null, - "url": "https://github.com/trending?l=GCC-Machine-Description" - }, - "GDB": { - "color": null, - "url": "https://github.com/trending?l=GDB" - }, - "GDScript": { - "color": "#355570", - "url": "https://github.com/trending?l=GDScript" - }, - "Genie": { - "color": "#fb855d", - "url": "https://github.com/trending?l=Genie" - }, - "Genshi": { - "color": null, - "url": "https://github.com/trending?l=Genshi" - }, - "Gentoo Ebuild": { - "color": null, - "url": "https://github.com/trending?l=Gentoo-Ebuild" - }, - "Gentoo Eclass": { - "color": null, - "url": "https://github.com/trending?l=Gentoo-Eclass" - }, - "Gherkin": { - "color": "#5B2063", - "url": "https://github.com/trending?l=Gherkin" - }, - "GLSL": { - "color": null, - "url": "https://github.com/trending?l=GLSL" - }, - "Glyph": { - "color": "#c1ac7f", - "url": "https://github.com/trending?l=Glyph" - }, - "Gnuplot": { - "color": "#f0a9f0", - "url": "https://github.com/trending?l=Gnuplot" - }, - "Go": { - "color": "#00ADD8", - "url": "https://github.com/trending?l=Go" - }, - "Golo": { - "color": "#88562A", - "url": "https://github.com/trending?l=Golo" - }, - "Gosu": { - "color": "#82937f", - "url": "https://github.com/trending?l=Gosu" - }, - "Grace": { - "color": null, - "url": "https://github.com/trending?l=Grace" - }, - "Grammatical Framework": { - "color": "#ff0000", - "url": "https://github.com/trending?l=Grammatical-Framework" - }, - "Groovy": { - "color": "#e69f56", - "url": "https://github.com/trending?l=Groovy" - }, - "Groovy Server Pages": { - "color": null, - "url": "https://github.com/trending?l=Groovy-Server-Pages" - }, - "Hack": { - "color": "#878787", - "url": "https://github.com/trending?l=Hack" - }, - "Haml": { - "color": "#ece2a9", - "url": "https://github.com/trending?l=Haml" - }, - "Handlebars": { - "color": "#f7931e", - "url": "https://github.com/trending?l=Handlebars" - }, - "Harbour": { - "color": "#0e60e3", - "url": "https://github.com/trending?l=Harbour" - }, - "Haskell": { - "color": "#5e5086", - "url": "https://github.com/trending?l=Haskell" - }, - "Haxe": { - "color": "#df7900", - "url": "https://github.com/trending?l=Haxe" - }, - "HCL": { - "color": null, - "url": "https://github.com/trending?l=HCL" - }, - "HiveQL": { - "color": "#dce200", - "url": "https://github.com/trending?l=HiveQL" - }, - "HLSL": { - "color": null, - "url": "https://github.com/trending?l=HLSL" - }, - "HolyC": { - "color": "#ffefaf", - "url": "https://github.com/trending?l=HolyC" - }, - "HTML": { - "color": "#e34c26", - "url": "https://github.com/trending?l=HTML" - }, - "Hy": { - "color": "#7790B2", - "url": "https://github.com/trending?l=Hy" - }, - "HyPhy": { - "color": null, - "url": "https://github.com/trending?l=HyPhy" - }, - "IDL": { - "color": "#a3522f", - "url": "https://github.com/trending?l=IDL" - }, - "Idris": { - "color": "#b30000", - "url": "https://github.com/trending?l=Idris" - }, - "IGOR Pro": { - "color": "#0000cc", - "url": "https://github.com/trending?l=IGOR-Pro" - }, - "Inform 7": { - "color": null, - "url": "https://github.com/trending?l=Inform-7" - }, - "Inno Setup": { - "color": null, - "url": "https://github.com/trending?l=Inno-Setup" - }, - "Io": { - "color": "#a9188d", - "url": "https://github.com/trending?l=Io" - }, - "Ioke": { - "color": "#078193", - "url": "https://github.com/trending?l=Ioke" - }, - "Isabelle": { - "color": "#FEFE00", - "url": "https://github.com/trending?l=Isabelle" - }, - "Isabelle ROOT": { - "color": null, - "url": "https://github.com/trending?l=Isabelle-ROOT" - }, - "J": { - "color": "#9EEDFF", - "url": "https://github.com/trending?l=J" - }, - "Jasmin": { - "color": null, - "url": "https://github.com/trending?l=Jasmin" - }, - "Java": { - "color": "#b07219", - "url": "https://github.com/trending?l=Java" - }, - "Java Server Pages": { - "color": null, - "url": "https://github.com/trending?l=Java-Server-Pages" - }, - "JavaScript": { - "color": "#f1e05a", - "url": "https://github.com/trending?l=JavaScript" - }, - "JavaScript+ERB": { - "color": null, - "url": "https://github.com/trending?l=JavaScript+ERB" - }, - "JFlex": { - "color": null, - "url": "https://github.com/trending?l=JFlex" - }, - "Jison": { - "color": null, - "url": "https://github.com/trending?l=Jison" - }, - "Jison Lex": { - "color": null, - "url": "https://github.com/trending?l=Jison-Lex" - }, - "Jolie": { - "color": "#843179", - "url": "https://github.com/trending?l=Jolie" - }, - "JSONiq": { - "color": "#40d47e", - "url": "https://github.com/trending?l=JSONiq" - }, - "Jsonnet": { - "color": "#0064bd", - "url": "https://github.com/trending?l=Jsonnet" - }, - "JSX": { - "color": null, - "url": "https://github.com/trending?l=JSX" - }, - "Julia": { - "color": "#a270ba", - "url": "https://github.com/trending?l=Julia" - }, - "Jupyter Notebook": { - "color": "#DA5B0B", - "url": "https://github.com/trending?l=Jupyter-Notebook" - }, - "Kaitai Struct": { - "color": "#773b37", - "url": "https://github.com/trending?l=Kaitai-Struct" - }, - "Kotlin": { - "color": "#F18E33", - "url": "https://github.com/trending?l=Kotlin" - }, - "KRL": { - "color": "#28430A", - "url": "https://github.com/trending?l=KRL" - }, - "LabVIEW": { - "color": null, - "url": "https://github.com/trending?l=LabVIEW" - }, - "Lasso": { - "color": "#999999", - "url": "https://github.com/trending?l=Lasso" - }, - "Latte": { - "color": "#f2a542", - "url": "https://github.com/trending?l=Latte" - }, - "Lean": { - "color": null, - "url": "https://github.com/trending?l=Lean" - }, - "Less": { - "color": "#1d365d", - "url": "https://github.com/trending?l=Less" - }, - "Lex": { - "color": "#DBCA00", - "url": "https://github.com/trending?l=Lex" - }, - "LFE": { - "color": "#4C3023", - "url": "https://github.com/trending?l=LFE" - }, - "LilyPond": { - "color": null, - "url": "https://github.com/trending?l=LilyPond" - }, - "Limbo": { - "color": null, - "url": "https://github.com/trending?l=Limbo" - }, - "Literate Agda": { - "color": null, - "url": "https://github.com/trending?l=Literate-Agda" - }, - "Literate CoffeeScript": { - "color": null, - "url": "https://github.com/trending?l=Literate-CoffeeScript" - }, - "Literate Haskell": { - "color": null, - "url": "https://github.com/trending?l=Literate-Haskell" - }, - "LiveScript": { - "color": "#499886", - "url": "https://github.com/trending?l=LiveScript" - }, - "LLVM": { - "color": "#185619", - "url": "https://github.com/trending?l=LLVM" - }, - "Logos": { - "color": null, - "url": "https://github.com/trending?l=Logos" - }, - "Logtalk": { - "color": null, - "url": "https://github.com/trending?l=Logtalk" - }, - "LOLCODE": { - "color": "#cc9900", - "url": "https://github.com/trending?l=LOLCODE" - }, - "LookML": { - "color": "#652B81", - "url": "https://github.com/trending?l=LookML" - }, - "LoomScript": { - "color": null, - "url": "https://github.com/trending?l=LoomScript" - }, - "LSL": { - "color": "#3d9970", - "url": "https://github.com/trending?l=LSL" - }, - "Lua": { - "color": "#000080", - "url": "https://github.com/trending?l=Lua" - }, - "M": { - "color": null, - "url": "https://github.com/trending?l=M" - }, - "M4": { - "color": null, - "url": "https://github.com/trending?l=M4" - }, - "M4Sugar": { - "color": null, - "url": "https://github.com/trending?l=M4Sugar" - }, - "Macaulay2": { - "color": "#d8ffff", - "url": "https://github.com/trending?l=Macaulay2" - }, - "Makefile": { - "color": "#427819", - "url": "https://github.com/trending?l=Makefile" - }, - "Mako": { - "color": null, - "url": "https://github.com/trending?l=Mako" - }, - "Markdown": { - "color": "#083fa1", - "url": "https://github.com/trending?l=Markdown" - }, - "Marko": { - "color": "#42bff2", - "url": "https://github.com/trending?l=Marko" - }, - "Mask": { - "color": "#f97732", - "url": "https://github.com/trending?l=Mask" - }, - "Mathematica": { - "color": null, - "url": "https://github.com/trending?l=Mathematica" - }, - "MATLAB": { - "color": "#e16737", - "url": "https://github.com/trending?l=MATLAB" - }, - "Max": { - "color": "#c4a79c", - "url": "https://github.com/trending?l=Max" - }, - "MAXScript": { - "color": "#00a6a6", - "url": "https://github.com/trending?l=MAXScript" - }, - "mcfunction": { - "color": "#E22837", - "url": "https://github.com/trending?l=mcfunction" - }, - "Mercury": { - "color": "#ff2b2b", - "url": "https://github.com/trending?l=Mercury" - }, - "Meson": { - "color": "#007800", - "url": "https://github.com/trending?l=Meson" - }, - "Metal": { - "color": "#8f14e9", - "url": "https://github.com/trending?l=Metal" - }, - "MiniD": { - "color": null, - "url": "https://github.com/trending?l=MiniD" - }, - "Mirah": { - "color": "#c7a938", - "url": "https://github.com/trending?l=Mirah" - }, - "mIRC Script": { - "color": "#3d57c3", - "url": "https://github.com/trending?l=mIRC-Script" - }, - "MLIR": { - "color": "#5EC8DB", - "url": "https://github.com/trending?l=MLIR" - }, - "Modelica": { - "color": null, - "url": "https://github.com/trending?l=Modelica" - }, - "Modula-2": { - "color": null, - "url": "https://github.com/trending?l=Modula-2" - }, - "Modula-3": { - "color": "#223388", - "url": "https://github.com/trending?l=Modula-3" - }, - "Module Management System": { - "color": null, - "url": "https://github.com/trending?l=Module-Management-System" - }, - "Monkey": { - "color": null, - "url": "https://github.com/trending?l=Monkey" - }, - "Moocode": { - "color": null, - "url": "https://github.com/trending?l=Moocode" - }, - "MoonScript": { - "color": null, - "url": "https://github.com/trending?l=MoonScript" - }, - "Motorola 68K Assembly": { - "color": null, - "url": "https://github.com/trending?l=Motorola-68K-Assembly" - }, - "MQL4": { - "color": "#62A8D6", - "url": "https://github.com/trending?l=MQL4" - }, - "MQL5": { - "color": "#4A76B8", - "url": "https://github.com/trending?l=MQL5" - }, - "MTML": { - "color": "#b7e1f4", - "url": "https://github.com/trending?l=MTML" - }, - "MUF": { - "color": null, - "url": "https://github.com/trending?l=MUF" - }, - "mupad": { - "color": null, - "url": "https://github.com/trending?l=mupad" - }, - "Myghty": { - "color": null, - "url": "https://github.com/trending?l=Myghty" - }, - "NASL": { - "color": null, - "url": "https://github.com/trending?l=NASL" - }, - "NCL": { - "color": "#28431f", - "url": "https://github.com/trending?l=NCL" - }, - "Nearley": { - "color": "#990000", - "url": "https://github.com/trending?l=Nearley" - }, - "Nemerle": { - "color": "#3d3c6e", - "url": "https://github.com/trending?l=Nemerle" - }, - "nesC": { - "color": "#94B0C7", - "url": "https://github.com/trending?l=nesC" - }, - "NetLinx": { - "color": "#0aa0ff", - "url": "https://github.com/trending?l=NetLinx" - }, - "NetLinx+ERB": { - "color": "#747faa", - "url": "https://github.com/trending?l=NetLinx+ERB" - }, - "NetLogo": { - "color": "#ff6375", - "url": "https://github.com/trending?l=NetLogo" - }, - "NewLisp": { - "color": "#87AED7", - "url": "https://github.com/trending?l=NewLisp" - }, - "Nextflow": { - "color": "#3ac486", - "url": "https://github.com/trending?l=Nextflow" - }, - "Nim": { - "color": "#ffc200", - "url": "https://github.com/trending?l=Nim" - }, - "Nit": { - "color": "#009917", - "url": "https://github.com/trending?l=Nit" - }, - "Nix": { - "color": "#7e7eff", - "url": "https://github.com/trending?l=Nix" - }, - "NSIS": { - "color": null, - "url": "https://github.com/trending?l=NSIS" - }, - "Nu": { - "color": "#c9df40", - "url": "https://github.com/trending?l=Nu" - }, - "NumPy": { - "color": null, - "url": "https://github.com/trending?l=NumPy" - }, - "Objective-C": { - "color": "#438eff", - "url": "https://github.com/trending?l=Objective-C" - }, - "Objective-C++": { - "color": "#6866fb", - "url": "https://github.com/trending?l=Objective-C++" - }, - "Objective-J": { - "color": "#ff0c5a", - "url": "https://github.com/trending?l=Objective-J" - }, - "ObjectScript": { - "color": "#424893", - "url": "https://github.com/trending?l=ObjectScript" - }, - "OCaml": { - "color": "#3be133", - "url": "https://github.com/trending?l=OCaml" - }, - "Odin": { - "color": "#60AFFE", - "url": "https://github.com/trending?l=Odin" - }, - "Omgrofl": { - "color": "#cabbff", - "url": "https://github.com/trending?l=Omgrofl" - }, - "ooc": { - "color": "#b0b77e", - "url": "https://github.com/trending?l=ooc" - }, - "Opa": { - "color": null, - "url": "https://github.com/trending?l=Opa" - }, - "Opal": { - "color": "#f7ede0", - "url": "https://github.com/trending?l=Opal" - }, - "Open Policy Agent": { - "color": null, - "url": "https://github.com/trending?l=Open-Policy-Agent" - }, - "OpenCL": { - "color": null, - "url": "https://github.com/trending?l=OpenCL" - }, - "OpenEdge ABL": { - "color": null, - "url": "https://github.com/trending?l=OpenEdge-ABL" - }, - "OpenQASM": { - "color": "#AA70FF", - "url": "https://github.com/trending?l=OpenQASM" - }, - "OpenRC runscript": { - "color": null, - "url": "https://github.com/trending?l=OpenRC-runscript" - }, - "OpenSCAD": { - "color": null, - "url": "https://github.com/trending?l=OpenSCAD" - }, - "Others": { - "color": "#b276b2" - }, - "Ox": { - "color": null, - "url": "https://github.com/trending?l=Ox" - }, - "Oxygene": { - "color": "#cdd0e3", - "url": "https://github.com/trending?l=Oxygene" - }, - "Oz": { - "color": "#fab738", - "url": "https://github.com/trending?l=Oz" - }, - "P4": { - "color": "#7055b5", - "url": "https://github.com/trending?l=P4" - }, - "Pan": { - "color": "#cc0000", - "url": "https://github.com/trending?l=Pan" - }, - "Papyrus": { - "color": "#6600cc", - "url": "https://github.com/trending?l=Papyrus" - }, - "Parrot": { - "color": "#f3ca0a", - "url": "https://github.com/trending?l=Parrot" - }, - "Parrot Assembly": { - "color": null, - "url": "https://github.com/trending?l=Parrot-Assembly" - }, - "Parrot Internal Representation": { - "color": null, - "url": "https://github.com/trending?l=Parrot-Internal-Representation" - }, - "Pascal": { - "color": "#E3F171", - "url": "https://github.com/trending?l=Pascal" - }, - "Pawn": { - "color": "#dbb284", - "url": "https://github.com/trending?l=Pawn" - }, - "Pep8": { - "color": "#C76F5B", - "url": "https://github.com/trending?l=Pep8" - }, - "Perl": { - "color": "#0298c3", - "url": "https://github.com/trending?l=Perl" - }, - "PHP": { - "color": "#4F5D95", - "url": "https://github.com/trending?l=PHP" - }, - "PicoLisp": { - "color": null, - "url": "https://github.com/trending?l=PicoLisp" - }, - "PigLatin": { - "color": "#fcd7de", - "url": "https://github.com/trending?l=PigLatin" - }, - "Pike": { - "color": "#005390", - "url": "https://github.com/trending?l=Pike" - }, - "PLpgSQL": { - "color": null, - "url": "https://github.com/trending?l=PLpgSQL" - }, - "PLSQL": { - "color": "#dad8d8", - "url": "https://github.com/trending?l=PLSQL" - }, - "PogoScript": { - "color": "#d80074", - "url": "https://github.com/trending?l=PogoScript" - }, - "Pony": { - "color": null, - "url": "https://github.com/trending?l=Pony" - }, - "PostScript": { - "color": "#da291c", - "url": "https://github.com/trending?l=PostScript" - }, - "POV-Ray SDL": { - "color": null, - "url": "https://github.com/trending?l=POV-Ray-SDL" - }, - "PowerBuilder": { - "color": "#8f0f8d", - "url": "https://github.com/trending?l=PowerBuilder" - }, - "PowerShell": { - "color": "#012456", - "url": "https://github.com/trending?l=PowerShell" - }, - "Prisma": { - "color": "#0c344b", - "url": "https://github.com/trending?l=Prisma" - }, - "Processing": { - "color": "#0096D8", - "url": "https://github.com/trending?l=Processing" - }, - "Prolog": { - "color": "#74283c", - "url": "https://github.com/trending?l=Prolog" - }, - "Propeller Spin": { - "color": "#7fa2a7", - "url": "https://github.com/trending?l=Propeller-Spin" - }, - "Pug": { - "color": "#a86454", - "url": "https://github.com/trending?l=Pug" - }, - "Puppet": { - "color": "#302B6D", - "url": "https://github.com/trending?l=Puppet" - }, - "PureBasic": { - "color": "#5a6986", - "url": "https://github.com/trending?l=PureBasic" - }, - "PureScript": { - "color": "#1D222D", - "url": "https://github.com/trending?l=PureScript" - }, - "Python": { - "color": "#3572A5", - "url": "https://github.com/trending?l=Python" - }, - "Python console": { - "color": null, - "url": "https://github.com/trending?l=Python-console" - }, - "q": { - "color": "#0040cd", - "url": "https://github.com/trending?l=q" - }, - "Q#": { - "color": "#fed659", - "url": "https://github.com/trending?l=Qsharp" - }, - "QMake": { - "color": null, - "url": "https://github.com/trending?l=QMake" - }, - "QML": { - "color": "#44a51c", - "url": "https://github.com/trending?l=QML" - }, - "Qt Script": { - "color": "#00b841", - "url": "https://github.com/trending?l=Qt-Script" - }, - "Quake": { - "color": "#882233", - "url": "https://github.com/trending?l=Quake" - }, - "R": { - "color": "#198CE7", - "url": "https://github.com/trending?l=R" - }, - "Racket": { - "color": "#3c5caa", - "url": "https://github.com/trending?l=Racket" - }, - "Ragel": { - "color": "#9d5200", - "url": "https://github.com/trending?l=Ragel" - }, - "Raku": { - "color": "#0000fb", - "url": "https://github.com/trending?l=Raku" - }, - "RAML": { - "color": "#77d9fb", - "url": "https://github.com/trending?l=RAML" - }, - "Rascal": { - "color": "#fffaa0", - "url": "https://github.com/trending?l=Rascal" - }, - "REALbasic": { - "color": null, - "url": "https://github.com/trending?l=REALbasic" - }, - "Reason": { - "color": "#ff5847", - "url": "https://github.com/trending?l=Reason" - }, - "Rebol": { - "color": "#358a5b", - "url": "https://github.com/trending?l=Rebol" - }, - "Red": { - "color": "#f50000", - "url": "https://github.com/trending?l=Red" - }, - "Redcode": { - "color": null, - "url": "https://github.com/trending?l=Redcode" - }, - "Ren'Py": { - "color": "#ff7f7f", - "url": "https://github.com/trending?l=Ren'Py" - }, - "RenderScript": { - "color": null, - "url": "https://github.com/trending?l=RenderScript" - }, - "REXX": { - "color": null, - "url": "https://github.com/trending?l=REXX" - }, - "Ring": { - "color": "#2D54CB", - "url": "https://github.com/trending?l=Ring" - }, - "Riot": { - "color": "#A71E49", - "url": "https://github.com/trending?l=Riot" - }, - "RobotFramework": { - "color": null, - "url": "https://github.com/trending?l=RobotFramework" - }, - "Roff": { - "color": "#ecdebe", - "url": "https://github.com/trending?l=Roff" - }, - "Rouge": { - "color": "#cc0088", - "url": "https://github.com/trending?l=Rouge" - }, - "RPC": { - "color": null, - "url": "https://github.com/trending?l=RPC" - }, - "Ruby": { - "color": "#701516", - "url": "https://github.com/trending?l=Ruby" - }, - "RUNOFF": { - "color": "#665a4e", - "url": "https://github.com/trending?l=RUNOFF" - }, - "Rust": { - "color": "#dea584", - "url": "https://github.com/trending?l=Rust" - }, - "Sage": { - "color": null, - "url": "https://github.com/trending?l=Sage" - }, - "SaltStack": { - "color": "#646464", - "url": "https://github.com/trending?l=SaltStack" - }, - "SAS": { - "color": "#B34936", - "url": "https://github.com/trending?l=SAS" - }, - "Sass": { - "color": "#a53b70", - "url": "https://github.com/trending?l=Sass" - }, - "Scala": { - "color": "#c22d40", - "url": "https://github.com/trending?l=Scala" - }, - "Scheme": { - "color": "#1e4aec", - "url": "https://github.com/trending?l=Scheme" - }, - "Scilab": { - "color": null, - "url": "https://github.com/trending?l=Scilab" - }, - "SCSS": { - "color": "#c6538c", - "url": "https://github.com/trending?l=SCSS" - }, - "sed": { - "color": "#64b970", - "url": "https://github.com/trending?l=sed" - }, - "Self": { - "color": "#0579aa", - "url": "https://github.com/trending?l=Self" - }, - "ShaderLab": { - "color": null, - "url": "https://github.com/trending?l=ShaderLab" - }, - "Shell": { - "color": "#89e051", - "url": "https://github.com/trending?l=Shell" - }, - "ShellSession": { - "color": null, - "url": "https://github.com/trending?l=ShellSession" - }, - "Shen": { - "color": "#120F14", - "url": "https://github.com/trending?l=Shen" - }, - "Sieve": { - "color": null, - "url": "https://github.com/trending?l=Sieve" - }, - "Slash": { - "color": "#007eff", - "url": "https://github.com/trending?l=Slash" - }, - "Slice": { - "color": "#003fa2", - "url": "https://github.com/trending?l=Slice" - }, - "Slim": { - "color": "#2b2b2b", - "url": "https://github.com/trending?l=Slim" - }, - "Smali": { - "color": null, - "url": "https://github.com/trending?l=Smali" - }, - "Smalltalk": { - "color": "#596706", - "url": "https://github.com/trending?l=Smalltalk" - }, - "Smarty": { - "color": null, - "url": "https://github.com/trending?l=Smarty" - }, - "SmPL": { - "color": "#c94949", - "url": "https://github.com/trending?l=SmPL" - }, - "SMT": { - "color": null, - "url": "https://github.com/trending?l=SMT" - }, - "Solidity": { - "color": "#AA6746", - "url": "https://github.com/trending?l=Solidity" - }, - "SourcePawn": { - "color": "#f69e1d", - "url": "https://github.com/trending?l=SourcePawn" - }, - "SQF": { - "color": "#3F3F3F", - "url": "https://github.com/trending?l=SQF" - }, - "SQLPL": { - "color": null, - "url": "https://github.com/trending?l=SQLPL" - }, - "Squirrel": { - "color": "#800000", - "url": "https://github.com/trending?l=Squirrel" - }, - "SRecode Template": { - "color": "#348a34", - "url": "https://github.com/trending?l=SRecode-Template" - }, - "Stan": { - "color": "#b2011d", - "url": "https://github.com/trending?l=Stan" - }, - "Standard ML": { - "color": "#dc566d", - "url": "https://github.com/trending?l=Standard-ML" - }, - "Starlark": { - "color": "#76d275", - "url": "https://github.com/trending?l=Starlark" - }, - "Stata": { - "color": null, - "url": "https://github.com/trending?l=Stata" - }, - "Stylus": { - "color": "#ff6347", - "url": "https://github.com/trending?l=Stylus" - }, - "SuperCollider": { - "color": "#46390b", - "url": "https://github.com/trending?l=SuperCollider" - }, - "Svelte": { - "color": "#ff3e00", - "url": "https://github.com/trending?l=Svelte" - }, - "SVG": { - "color": "#ff9900", - "url": "https://github.com/trending?l=SVG" - }, - "Swift": { - "color": "#ffac45", - "url": "https://github.com/trending?l=Swift" - }, - "SWIG": { - "color": null, - "url": "https://github.com/trending?l=SWIG" - }, - "SystemVerilog": { - "color": "#DAE1C2", - "url": "https://github.com/trending?l=SystemVerilog" - }, - "Tcl": { - "color": "#e4cc98", - "url": "https://github.com/trending?l=Tcl" - }, - "Tcsh": { - "color": null, - "url": "https://github.com/trending?l=Tcsh" - }, - "Terra": { - "color": "#00004c", - "url": "https://github.com/trending?l=Terra" - }, - "TeX": { - "color": "#3D6117", - "url": "https://github.com/trending?l=TeX" - }, - "Thrift": { - "color": null, - "url": "https://github.com/trending?l=Thrift" - }, - "TI Program": { - "color": "#A0AA87", - "url": "https://github.com/trending?l=TI-Program" - }, - "TLA": { - "color": null, - "url": "https://github.com/trending?l=TLA" - }, - "TSQL": { - "color": null, - "url": "https://github.com/trending?l=TSQL" - }, - "TSX": { - "color": null, - "url": "https://github.com/trending?l=TSX" - }, - "Turing": { - "color": "#cf142b", - "url": "https://github.com/trending?l=Turing" - }, - "Twig": { - "color": "#c1d026", - "url": "https://github.com/trending?l=Twig" - }, - "TXL": { - "color": null, - "url": "https://github.com/trending?l=TXL" - }, - "TypeScript": { - "color": "#2b7489", - "url": "https://github.com/trending?l=TypeScript" - }, - "TypeScript (JSX)": { - "color": "#2b7489", - "url": "https://github.com/trending?l=TypeScript" - }, - "Unified Parallel C": { - "color": null, - "url": "https://github.com/trending?l=Unified-Parallel-C" - }, - "Unix Assembly": { - "color": null, - "url": "https://github.com/trending?l=Unix-Assembly" - }, - "Uno": { - "color": "#9933cc", - "url": "https://github.com/trending?l=Uno" - }, - "UnrealScript": { - "color": "#a54c4d", - "url": "https://github.com/trending?l=UnrealScript" - }, - "UrWeb": { - "color": null, - "url": "https://github.com/trending?l=UrWeb" - }, - "V": { - "color": "#4f87c4", - "url": "https://github.com/trending?l=V" - }, - "Vala": { - "color": "#fbe5cd", - "url": "https://github.com/trending?l=Vala" - }, - "VBA": { - "color": "#867db1", - "url": "https://github.com/trending?l=VBA" - }, - "VBScript": { - "color": "#15dcdc", - "url": "https://github.com/trending?l=VBScript" - }, - "VCL": { - "color": "#148AA8", - "url": "https://github.com/trending?l=VCL" - }, - "Verilog": { - "color": "#b2b7f8", - "url": "https://github.com/trending?l=Verilog" - }, - "VHDL": { - "color": "#adb2cb", - "url": "https://github.com/trending?l=VHDL" - }, - "Vim script": { - "color": "#199f4b", - "url": "https://github.com/trending?l=Vim-script" - }, - "Visual Basic .NET": { - "color": "#945db7", - "url": "https://github.com/trending?l=Visual-Basic-.NET" - }, - "Volt": { - "color": "#1F1F1F", - "url": "https://github.com/trending?l=Volt" - }, - "Vue": { - "color": "#2c3e50", - "url": "https://github.com/trending?l=Vue" - }, - "wdl": { - "color": "#42f1f4", - "url": "https://github.com/trending?l=wdl" - }, - "WebAssembly": { - "color": "#04133b", - "url": "https://github.com/trending?l=WebAssembly" - }, - "WebIDL": { - "color": null, - "url": "https://github.com/trending?l=WebIDL" - }, - "wisp": { - "color": "#7582D1", - "url": "https://github.com/trending?l=wisp" - }, - "Wollok": { - "color": "#a23738", - "url": "https://github.com/trending?l=Wollok" - }, - "X10": { - "color": "#4B6BEF", - "url": "https://github.com/trending?l=X10" - }, - "xBase": { - "color": "#403a40", - "url": "https://github.com/trending?l=xBase" - }, - "XC": { - "color": "#99DA07", - "url": "https://github.com/trending?l=XC" - }, - "Xojo": { - "color": null, - "url": "https://github.com/trending?l=Xojo" - }, - "XProc": { - "color": null, - "url": "https://github.com/trending?l=XProc" - }, - "XQuery": { - "color": "#5232e7", - "url": "https://github.com/trending?l=XQuery" - }, - "XS": { - "color": null, - "url": "https://github.com/trending?l=XS" - }, - "XSLT": { - "color": "#EB8CEB", - "url": "https://github.com/trending?l=XSLT" - }, - "Xtend": { - "color": null, - "url": "https://github.com/trending?l=Xtend" - }, - "Yacc": { - "color": "#4B6C4B", - "url": "https://github.com/trending?l=Yacc" - }, - "YAML": { - "color": "#cb171e", - "url": "https://github.com/trending?l=YAML" - }, - "YARA": { - "color": "#220000", - "url": "https://github.com/trending?l=YARA" - }, - "YASnippet": { - "color": "#32AB90", - "url": "https://github.com/trending?l=YASnippet" - }, - "ZAP": { - "color": "#0d665e", - "url": "https://github.com/trending?l=ZAP" - }, - "Zeek": { - "color": null, - "url": "https://github.com/trending?l=Zeek" - }, - "ZenScript": { - "color": "#00BCD1", - "url": "https://github.com/trending?l=ZenScript" - }, - "Zephir": { - "color": "#118f9e", - "url": "https://github.com/trending?l=Zephir" - }, - "Zig": { - "color": "#ec915c", - "url": "https://github.com/trending?l=Zig" - }, - "ZIL": { - "color": "#dc75e5", - "url": "https://github.com/trending?l=ZIL" - }, - "Zimpl": { - "color": null, - "url": "https://github.com/trending?l=Zimpl" - } -} diff --git a/dist/themes/themes.json b/dist/themes/themes.json deleted file mode 100644 index 13eb81d..0000000 --- a/dist/themes/themes.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "default": { - "title_color": "2f80ed", - "icon_color": "4c71f2", - "text_color": "333", - "bg_color": "fffefe" - }, - "dark": { - "title_color": "fff", - "icon_color": "79ff97", - "text_color": "9f9f9f", - "bg_color": "151515" - }, - "radical": { - "title_color": "fe428e", - "icon_color": "f8d847", - "text_color": "a9fef7", - "bg_color": "141321" - }, - "merko": { - "title_color": "abd200", - "icon_color": "b7d364", - "text_color": "68b587", - "bg_color": "0a0f0b" - }, - "gruvbox": { - "title_color": "fabd2f", - "icon_color": "fe8019", - "text_color": "8ec07c", - "bg_color": "282828" - }, - "tokyonight": { - "title_color": "70a5fd", - "icon_color": "bf91f3", - "text_color": "38bdae", - "bg_color": "1a1b27" - }, - "onedark": { - "title_color": "e4bf7a", - "icon_color": "8eb573", - "text_color": "df6d74", - "bg_color": "282c34" - }, - "cobalt": { - "title_color": "e683d9", - "icon_color": "0480ef", - "text_color": "75eeb2", - "bg_color": "193549" - }, - "synthwave": { - "title_color": "e2e9ec", - "icon_color": "ef8539", - "text_color": "e5289e", - "bg_color": "2b213a" - }, - "highcontrast": { - "title_color": "e7f216", - "icon_color": "00ffff", - "text_color": "fff", - "bg_color": "000" - }, - "dracula": { - "title_color": "ff6e96", - "icon_color": "79dafa", - "text_color": "f8f8f2", - "bg_color": "282a36" - }, - "prussian": { - "title_color": "bddfff", - "icon_color": "38a0ff", - "text_color": "6e93b5", - "bg_color": "172f45" - }, - "monokai": { - "title_color": "eb1f6a", - "icon_color": "e28905", - "text_color": "f1f1eb", - "bg_color": "272822" - }, - "vue": { - "title_color": "41b883", - "icon_color": "41b883", - "text_color": "273849", - "bg_color": "fffefe" - }, - "vue-dark": { - "title_color": "41b883", - "icon_color": "41b883", - "text_color": "fffefe", - "bg_color": "273849" - }, - "shades-of-purple": { - "title_color": "fad000", - "icon_color": "b362ff", - "text_color": "a599e9", - "bg_color": "2d2b55" - }, - "nightowl": { - "title_color": "c792ea", - "icon_color": "ffeb95", - "text_color": "7fdbca", - "bg_color": "011627" - }, - "buefy": { - "title_color": "7957d5", - "icon_color": "ff3860", - "text_color": "363636", - "bg_color": "ffffff" - }, - "blue-green": { - "title_color": "2f97c1", - "icon_color": "f5b700", - "text_color": "0cf574", - "bg_color": "040f0f" - }, - "algolia": { - "title_color": "00AEFF", - "icon_color": "2DDE98", - "text_color": "FFFFFF", - "bg_color": "050F2C" - }, - "great-gatsby": { - "title_color": "ffa726", - "icon_color": "ffb74d", - "text_color": "ffd95b", - "bg_color": "000000" - }, - "darcula": { - "title_color": "BA5F17", - "icon_color": "84628F", - "text_color": "BEBEBE", - "bg_color": "242424" - }, - "bear": { - "title_color": "e03c8a", - "icon_color": "00AEFF", - "text_color": "bcb28d", - "bg_color": "1f2023" - }, - "solarized-dark": { - "title_color": "268bd2", - "icon_color": "b58900", - "text_color": "859900", - "bg_color": "002b36" - }, - "solarized-light": { - "title_color": "268bd2", - "icon_color": "b58900", - "text_color": "859900", - "bg_color": "fdf6e3" - }, - "chartreuse-dark": { - "title_color": "7fff00", - "icon_color": "00AEFF", - "text_color": "fff", - "bg_color": "000" - }, - "nord": { - "title_color": "81a1c1", - "text_color": "d8dee9", - "icon_color": "88c0d0", - "bg_color": "2e3440" - }, - "gotham": { - "title_color": "2aa889", - "icon_color": "599cab", - "text_color": "99d1ce", - "bg_color": "0c1014" - }, - "material-palenight": { - "title_color": "c792ea", - "icon_color": "89ddff", - "text_color": "a6accd", - "bg_color": "292d3e" - }, - "graywhite": { - "title_color": "24292e", - "icon_color": "24292e", - "text_color": "24292e", - "bg_color": "ffffff" - }, - "vision-friendly-dark": { - "title_color": "ffb000", - "icon_color": "785ef0", - "text_color": "ffffff", - "bg_color": "000000" - }, - "ayu-mirage": { - "title_color": "f4cd7c", - "icon_color": "73d0ff", - "text_color": "c7c8c2", - "bg_color": "1f2430" - }, - "midnight-purple": { - "title_color": "9745f5", - "icon_color": "9f4bff", - "text_color": "ffffff", - "bg_color": "000000" - }, - "calm": { - "title_color": "e07a5f", - "icon_color": "edae49", - "text_color": "ebcfb2", - "bg_color": "373f51" - }, - "omni": { - "title_color": "FF79C6", - "icon_color": "e7de79", - "text_color": "E1E1E6", - "bg_color": "191622" - }, - "react": { - "title_color": "61dafb", - "icon_color": "61dafb", - "text_color": "ffffff", - "bg_color": "20232a" - } -}