Skip to content

Commit

Permalink
v5.0.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
kristiandrex committed Jan 10, 2022
1 parent de7b78d commit 6f9aa8b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "league-of-react",
"version": "3.4.0",
"version": "5.0.0-alpha",
"private": true,
"type": "module",
"dependencies": {
"@actions/core": "^1.4.0",
"@svgr/webpack": "^5.5.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import App from "next/app";
import Header from "@/components/Header";
import { ThemeProvider } from "@/context/theme";
import { getVersions } from "@/services/champions";
import { getVersions } from "@/utils/versions";
import "@/styles/index.css";

function MyApp({ Component, pageProps, version }) {
Expand Down
10 changes: 5 additions & 5 deletions scripts/screenshots.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";

import fs from "fs";
import puppeteer from "puppeteer";
import chalk from "chalk";
import core from "@actions/core";
const fs = require("fs");
const puppeteer = require("puppeteer");
const chalk = require("chalk");
const core = require("@actions/core");

import { getVersions, fetchVersion } from "../utils/versions.js";
const { getVersions, fetchVersion } = require("../utils/versions");

const VERSION_FILE = "public/data/version.txt";

Expand Down
11 changes: 8 additions & 3 deletions utils/versions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fetch from "node-fetch";
const fetch = require("node-fetch");

/**
* Get champions of specific version
* @param {string} version
* @returns {Promise<IChampion[]>} Champions array
*/
export async function fetchVersion(version) {
async function fetchVersion(version) {
const response = await fetch(
`http://ddragon.leagueoflegends.com/cdn/${version}/data/es_MX/champion.json`
);
Expand All @@ -17,10 +17,15 @@ export async function fetchVersion(version) {
* Get the lastest two versions of LoL
* @returns {Promise<Versions>} Two latest versions
*/
export async function getVersions() {
async function getVersions() {
const url = "https://ddragon.leagueoflegends.com/api/versions.json";
const response = await fetch(url);
const [latest, previous] = await response.json();

return { latest, previous };
}

module.exports = {
fetchVersion,
getVersions
};

1 comment on commit 6f9aa8b

@vercel
Copy link

@vercel vercel bot commented on 6f9aa8b Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.