diff --git a/package-lock.json b/package-lock.json index dba52f9..3650d91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "league-of-react", - "version": "3.4.0", + "version": "5.0.0-alpha", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "league-of-react", - "version": "3.4.0", + "version": "5.0.0-alpha", "dependencies": { "@actions/core": "^1.4.0", "@svgr/webpack": "^5.5.0", diff --git a/package.json b/package.json index d377361..b1c963e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pages/_app.js b/pages/_app.js index 2e848a1..ea3390d 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -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 }) { diff --git a/scripts/screenshots.js b/scripts/screenshots.js index be01c09..702e94b 100644 --- a/scripts/screenshots.js +++ b/scripts/screenshots.js @@ -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"; diff --git a/utils/versions.js b/utils/versions.js index 64636e6..6dfd850 100644 --- a/utils/versions.js +++ b/utils/versions.js @@ -1,11 +1,11 @@ -import fetch from "node-fetch"; +const fetch = require("node-fetch"); /** * Get champions of specific version * @param {string} version * @returns {Promise} 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` ); @@ -17,10 +17,15 @@ export async function fetchVersion(version) { * Get the lastest two versions of LoL * @returns {Promise} 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 +};