From 0e4c270ff8161ff1a51a5488ea6ca24c0589115a Mon Sep 17 00:00:00 2001 From: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> Date: Sat, 9 Aug 2025 16:55:08 +0900 Subject: [PATCH 01/26] =?UTF-8?q?Python=E3=81=AEREPL=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=A7=E3=81=8D=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/terminal/python/page.tsx | 18 ++++++ app/terminal/python/pyodide.ts | 98 ++++++++++++++++++++++++++++++ app/terminal/terminal.tsx | 105 +++++++++++++++++++++++++++++++++ next.config.ts | 4 ++ package-lock.json | 30 ++++++++++ package.json | 3 + 6 files changed, 258 insertions(+) create mode 100644 app/terminal/python/page.tsx create mode 100644 app/terminal/python/pyodide.ts create mode 100644 app/terminal/terminal.tsx diff --git a/app/terminal/python/page.tsx b/app/terminal/python/page.tsx new file mode 100644 index 0000000..fe0f196 --- /dev/null +++ b/app/terminal/python/page.tsx @@ -0,0 +1,18 @@ +"use client"; + +import { TerminalComponent } from "../terminal"; +import { usePyodide } from "./pyodide"; + +export default function PythonPage() { + const { isPyodideReady, runPython } = usePyodide(); + return ( +
);
@@ -75,7 +80,7 @@ const components: Components = {
},
pre: ({ node, ...props }) => (
),
diff --git a/app/globals.css b/app/globals.css
index 4c1b0c2..3bb351d 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -1,2 +1,20 @@
@import "tailwindcss";
@plugin "daisyui";
+
+/* fira-code-latin-wght-normal */
+@font-face {
+ font-family: "Fira Code Variable";
+ font-style: normal;
+ font-display: swap;
+ font-weight: 300 700;
+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/fira-code:vf@latest/latin-wght-normal.woff2)
+ format("woff2-variations");
+ unicode-range:
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
+ U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
+ U+2215, U+FEFF, U+FFFD;
+}
+
+@theme {
+ --font-mono: "Fira Code Variable", monospace;
+}
diff --git a/app/layout.tsx b/app/layout.tsx
index 5a0f953..df211e0 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -3,6 +3,7 @@ import "./globals.css";
import { Navbar } from "./navbar";
import { Sidebar } from "./sidebar";
import { ReactNode } from "react";
+import { PyodideProvider } from "./terminal/python/pyodide";
export const metadata: Metadata = {
title: "Create Next App",
@@ -19,7 +20,7 @@ export default function RootLayout({