From 3a0b8ed7ea162da555b301db30878262f46a7b59 Mon Sep 17 00:00:00 2001 From: sjwie Date: Wed, 7 Feb 2024 18:55:23 +0900 Subject: [PATCH] use semicolon && add speed insights --- .prettierrc | 2 +- app/draw-io/page.tsx | 22 +++++++++++----------- app/layout.tsx | 2 ++ app/page.tsx | 6 +++--- package.json | 1 + yarn.lock | 5 +++++ 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.prettierrc b/.prettierrc index bc4bbb2..d27c631 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "semi": false, + "semi": true, "singleQuote": false, "trailingComma": "all", "useTabs": false, diff --git a/app/draw-io/page.tsx b/app/draw-io/page.tsx index 52b519b..14edaa5 100644 --- a/app/draw-io/page.tsx +++ b/app/draw-io/page.tsx @@ -1,12 +1,12 @@ -"use client" -import Image from "next/image" -import Link from "next/link" -import { useRef, useState } from "react" -import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio" +"use client"; +import Image from "next/image"; +import Link from "next/link"; +import { useRef, useState } from "react"; +import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio"; export default function Home() { - const [imgData, setImgData] = useState("") - const drawioRef = useRef(null) + const [imgData, setImgData] = useState(""); + const drawioRef = useRef(null); return (
@@ -40,12 +40,12 @@ export default function Home() { ref={drawioRef} onExport={(data) => { console.log(`onExport executed: - ${JSON.stringify(data, null, 2)}`) - setImgData(data.data) + ${JSON.stringify(data, null, 2)}`); + setImgData(data.data); }} onClose={(data) => { console.log(`onClose executed: - ${JSON.stringify(data, null, 2)}`) + ${JSON.stringify(data, null, 2)}`); }} />
@@ -58,5 +58,5 @@ export default function Home() { /> )}
- ) + ); } diff --git a/app/layout.tsx b/app/layout.tsx index 3314e47..b28544c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,3 +1,4 @@ +import { SpeedInsights } from "@vercel/speed-insights/next"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; @@ -16,6 +17,7 @@ export default function RootLayout({ }>) { return ( + {children} ); diff --git a/app/page.tsx b/app/page.tsx index d3fda2b..9fad5c5 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ -import Image from "next/image" -import Link from "next/link" +import Image from "next/image"; +import Link from "next/link"; export default function Home() { return ( @@ -118,5 +118,5 @@ export default function Home() { - ) + ); } diff --git a/package.json b/package.json index 8cd0ef5..c1fd6d4 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@vercel/speed-insights": "^1.0.9", "next": "14.1.0", "react": "^18", "react-dom": "^18", diff --git a/yarn.lock b/yarn.lock index 85fa347..101dec2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -298,6 +298,11 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@vercel/speed-insights@^1.0.9": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@vercel/speed-insights/-/speed-insights-1.0.9.tgz#ad748c238c4ed58b32cc8a398f28abe507dabd53" + integrity sha512-f+XFP0O+aZ4Olj9h+BitkB1b4NJQaxtyCb69wWuDxytJHY6Pa4QtZPdBUftHOcajUCHRVeq062fk3MKXKtjNVQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"