From 85acc1bdace8af80aca4d1b6b132ffa30c975fce Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Mon, 3 Oct 2022 01:35:03 +0200 Subject: [PATCH] Remove unused imports, packages and add lang --- components/Terminal/REPL/REPLInput.tsx | 4 ++-- components/Terminal/REPL/index.tsx | 1 - lib/commands/definitions.ts | 12 ++++++------ next.config.js | 6 +++++- package-lock.json | 17 +---------------- package.json | 3 +-- pages/_app.tsx | 1 - pages/index.tsx | 8 +------- 8 files changed, 16 insertions(+), 36 deletions(-) diff --git a/components/Terminal/REPL/REPLInput.tsx b/components/Terminal/REPL/REPLInput.tsx index 8667830..08ccbf1 100644 --- a/components/Terminal/REPL/REPLInput.tsx +++ b/components/Terminal/REPL/REPLInput.tsx @@ -3,7 +3,7 @@ import { MutableRefObject, useState, createRef, useEffect } from "react"; import { CommandInterface } from "../../../lib/commands"; import styles from "../../../styles/Terminal/REPL/REPLInput.module.css"; import { useCommands } from "../../../lib/commands/ContextProvider"; -import { useModalFunctions } from "../contexts/ModalFunctions"; +//import { useModalFunctions } from "../contexts/ModalFunctions"; interface REPLInputParams { historyCallback: CallableFunction; @@ -20,7 +20,7 @@ const REPLInput: NextPage = ({historyCallback, historyClear, in const [cmdHistory, setCmdHistory] = useState([]); const [usrInputTmp, setUsrInputTmp] = useState(""); const {cmdContext: cmdIf, updateCallbacks} = useCommands(); - const { modalFunctions } = useModalFunctions(); + //const { modalFunctions } = useModalFunctions(); updateCallbacks({ getCmdHistory: () => cmdHistory }); diff --git a/components/Terminal/REPL/index.tsx b/components/Terminal/REPL/index.tsx index cb62ebd..b825a33 100644 --- a/components/Terminal/REPL/index.tsx +++ b/components/Terminal/REPL/index.tsx @@ -3,7 +3,6 @@ import REPLInput from "./REPLInput"; import REPLHistory from "./REPLHistory"; import styles from "../../../styles/Terminal/REPL/REPLComplete.module.css"; import type { NextPage } from "next"; -// import { useCommands } from "../../../lib/commands/ContextProvider"; interface IREPLProps { inputRef: MutableRefObject; diff --git a/lib/commands/definitions.ts b/lib/commands/definitions.ts index 10eb1d7..2eea758 100644 --- a/lib/commands/definitions.ts +++ b/lib/commands/definitions.ts @@ -9,15 +9,15 @@ function getCommandByName(name: string): Command | undefined { return commandList.find(cmd => cmd.name === name); } -function illegalUse(raw: string, cmd: Command): string[] { +/*function illegalUse(raw: string, cmd: Command): string[] { return [ "Syntax error!", `Cannot parse "${raw}"`, "" ].concat(printSyntax(cmd)); -} +}*/ -function checkFlags(flags: string[], cmd: Command): boolean { +/*function checkFlags(flags: string[], cmd: Command): boolean { if (!flags || flags.length === 0) return true; if (!cmd.flags) return false; @@ -27,9 +27,9 @@ function checkFlags(flags: string[], cmd: Command): boolean { if (!flagObj) return false; } return true; -} +}*/ -function checkSubcmd(subcmds: string[], cmd: Command): boolean { +/*function checkSubcmd(subcmds: string[], cmd: Command): boolean { if (!subcmds || subcmds.length === 0) return true; if (!cmd.subcommands) return false; @@ -38,7 +38,7 @@ function checkSubcmd(subcmds: string[], cmd: Command): boolean { if (!flagObj) return false; } return true; -} +}*/ function checkFlagInclude(flagsProvided: string[], flag: Flag): boolean { if (!flag) return false; diff --git a/next.config.js b/next.config.js index 5e46f31..55bf7c9 100644 --- a/next.config.js +++ b/next.config.js @@ -3,5 +3,9 @@ module.exports = { reactStrictMode: true, images: { domains: ["openai-labs-public-images-prod.azureedge.net"] + }, + i18n: { + locales: ["en"], + defaultLocale: "en", } -}; +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 301d4fb..653009c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,7 @@ "node-fetch": "^3.2.0", "phosphor-react": "^1.3.1", "react": "17.0.2", - "react-dom": "17.0.2", - "swr": "^1.1.2" + "react-dom": "17.0.2" }, "devDependencies": { "@types/color": "^3.0.3", @@ -3351,14 +3350,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/swr": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/swr/-/swr-1.2.2.tgz", - "integrity": "sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==", - "peerDependencies": { - "react": "^16.11.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/table": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", @@ -5973,12 +5964,6 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "swr": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/swr/-/swr-1.2.2.tgz", - "integrity": "sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==", - "requires": {} - }, "table": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", diff --git a/package.json b/package.json index d1e9634..628b704 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,7 @@ "node-fetch": "^3.2.0", "phosphor-react": "^1.3.1", "react": "17.0.2", - "react-dom": "17.0.2", - "swr": "^1.1.2" + "react-dom": "17.0.2" }, "devDependencies": { "@types/color": "^3.0.3", diff --git a/pages/_app.tsx b/pages/_app.tsx index cf09ab4..09d4d7f 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,7 +1,6 @@ import type { AppProps } from "next/app"; import Head from "next/head"; import "../styles/globals.css"; -//import "../styles/customAsciidoc.scss"; import { CommandsProvider } from "../lib/commands/ContextProvider"; import { ModalFunctionProvider } from "../components/Terminal/contexts/ModalFunctions"; diff --git a/pages/index.tsx b/pages/index.tsx index ec529f5..e146b27 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,19 +1,13 @@ import type { NextPage } from "next"; import Head from "next/head"; -import useSWR from "swr"; import type { ContentList } from "../lib/content/types"; import Navigation from "../components/Blog/Navigation"; import ProjectCard from "../components/Blog/Card"; -import Spinner from "../components/Spinner"; import styles from "../styles/Blog/Front.module.scss"; const Blog: NextPage<{ content: ContentList }> = ({content}) => { - //const { data: projectList, error } = useSWR("/content/list.json", (...args) => fetch(...args).then(res => res.json())); - const generateCards = (type: string) => { - //if (error) return
Error on fetching projects.
; - //if (!projectList) return ; - /*else*/ return
{content.filter(p => p.type === type).map(p => )}
; + return
{content.filter(p => p.type === type).map(p => )}
; }; return <>