Use turbo & fix anonymous functions

This commit is contained in:
skidoodle 2022-10-25 19:53:49 +02:00
parent 3d9fde82c8
commit 4d9964623f
9 changed files with 1161 additions and 19 deletions

3
.eslintrc.json Normal file
View file

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

3
.gitignore vendored
View file

@ -35,3 +35,6 @@ yarn-error.log*
# typescript # typescript
*.tsbuildinfo *.tsbuildinfo
next-env.d.ts next-env.d.ts
# turbo
.turbo

View file

@ -23,11 +23,14 @@
"@types/react-dom": "18.0.7", "@types/react-dom": "18.0.7",
"autoprefixer": "^10.4.12", "autoprefixer": "^10.4.12",
"copy-to-clipboard": "^3.3.2", "copy-to-clipboard": "^3.3.2",
"eslint": "8.26.0",
"eslint-config-next": "13.0.0",
"postcss": "^8.4.18", "postcss": "^8.4.18",
"react-hot-toast": "^2.4.0", "react-hot-toast": "^2.4.0",
"react-icons": "^4.6.0", "react-icons": "^4.6.0",
"sass": "^1.55.0", "sass": "^1.55.0",
"tailwindcss": "^3.2.1", "tailwindcss": "^3.2.1",
"turbo": "^1.6.1",
"typescript": "4.8.4" "typescript": "4.8.4"
} }
} }

View file

@ -3,7 +3,7 @@ import Head from 'next/head';
import { AppProps } from 'next/app'; import { AppProps } from 'next/app';
export default function ({ Component, pageProps }: AppProps) { export default function App({ Component, pageProps }: AppProps) {
return ( return (
<> <>
<Head> <Head>

View file

@ -3,7 +3,7 @@ import aws from "aws-sdk";
const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env; const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env;
export default async function (req: NextApiRequest, res: NextApiResponse) { export default async function Storage(req: NextApiRequest, res: NextApiResponse) {
aws.config.s3 = { aws.config.s3 = {
accessKeyId: ACCESS_KEY, accessKeyId: ACCESS_KEY,
secretAccessKey: SECRET_KEY, secretAccessKey: SECRET_KEY,

View file

@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'; import { NextApiRequest, NextApiResponse } from 'next';
import { SpotifyService } from 'spotify-now-playing' import { SpotifyService } from 'spotify-now-playing'
export default async function (req: NextApiRequest, res: NextApiResponse) { export default async function Spotify(req: NextApiRequest, res: NextApiResponse) {
const { CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env; const { CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env;
const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!) const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!)
const song = await spotify.getCurrentSong() const song = await spotify.getCurrentSong()

View file

@ -13,7 +13,7 @@ import profilePic from 'public/profile.webp';
export const fetcher = (url: RequestInfo) => fetch(url).then((r) => r.json()); export const fetcher = (url: RequestInfo) => fetch(url).then((r) => r.json());
export default function () { export default function Main() {
var { data: spotify } = useSWR('/api/spotify', fetcher, { var { data: spotify } = useSWR('/api/spotify', fetcher, {
refreshInterval: 3000, refreshInterval: 3000,
fallbackData: 'loading', fallbackData: 'loading',

10
turbo.json Normal file
View file

@ -0,0 +1,10 @@
{
"pipeline": {
"build": {
"outputs": [".next/**"]
},
"lint": {
"outputs": []
}
}
}

1153
yarn.lock

File diff suppressed because it is too large Load diff