Skip to content

Commit

Permalink
fix: lint & upgrade monaco editor
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac committed Dec 24, 2023
1 parent 9133475 commit 9e8cee5
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 31 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@mantine/code-highlight": "^7.3.2",
"@mantine/core": "^7.3.2",
"@mantine/hooks": "^7.3.2",
"@monaco-editor/react": "^4.5.2",
"@monaco-editor/react": "^4.6.0",
"@sentry/nextjs": "^7.91.0",
"@supabase/auth-helpers-nextjs": "^0.8.1",
"@supabase/auth-helpers-react": "^0.4.2",
Expand All @@ -30,6 +30,7 @@
"html-to-image": "^1.11.11",
"jq-in-the-browser": "^0.7.2",
"jq-web": "^0.5.1",
"js-yaml": "^4.1.0",
"json-2-csv": "^5.0.1",
"json-to-ts": "^1.7.0",
"jsonc-parser": "^3.2.0",
Expand Down Expand Up @@ -58,6 +59,7 @@
"devDependencies": {
"@next/bundle-analyzer": "^13.4.12",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/js-yaml": "^4.0.9",
"@types/jsonwebtoken": "^9.0.5",
"@types/jxon": "^2.0.5",
"@types/lodash.debounce": "^4.0.9",
Expand Down
20 changes: 14 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/MonacoEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const MonacoEditor = () => {
...(jsonSchema && {
schemas: [
{
uri: "http://myserver/foo-schema.json",
fileMatch: ["*"],
schema: jsonSchema,
},
Expand Down
7 changes: 1 addition & 6 deletions src/containers/Editor/BottomBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import { useRouter } from "next/router";
import styled from "styled-components";
import { Flex, Popover, Text } from "@mantine/core";
import styled from "styled-components";
import toast from "react-hot-toast";
import {
AiOutlineCloudSync,
Expand Down Expand Up @@ -153,11 +153,6 @@ export const BottomBar = () => {
user,
]);

const handleLoginClick = () => {
if (user) return setVisible("account")(true);
else setVisible("login")(true);
};

const setPrivate = async () => {
try {
if (!query.json) return handleSaveJson();
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Editor/JsonEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import { ActionIcon, TextInput, Loader, Tooltip } from "@mantine/core";
import { getHotkeyHandler, useSessionStorage } from "@mantine/hooks";
import styled from "styled-components";
import { toast } from "react-hot-toast";
import { GoDependabot } from "react-icons/go";
import { VscClose, VscQuestion } from "react-icons/vsc";
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Editor/LiveEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { Menu, Text } from "@mantine/core";
import styled from "styled-components";
import { firaMono } from "src/constants/fonts";
import { Graph } from "src/containers/Views/GraphView";
import { TreeView } from "src/containers/Views/TreeView";
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Modals/ImportModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { Modal, Group, Button, TextInput, Stack, Divider, ModalProps } from "@mantine/core";
import styled from "styled-components";
import toast from "react-hot-toast";
import { AiOutlineUpload } from "react-icons/ai";
import useFile from "src/store/useFile";
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Modals/NodeModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { CodeHighlight } from "@mantine/code-highlight";
import { Modal, Stack, Text, ScrollArea, ModalProps, Button } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import Editor from "@monaco-editor/react";
import { VscLock } from "react-icons/vsc";
import { isIframe } from "src/lib/utils/widget";
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Modals/TypeModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { CodeHighlight } from "@mantine/code-highlight";
import { Stack, Modal, ModalProps, ScrollArea, Select } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import useJson from "src/store/useJson";

enum Language {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Views/GraphView/CustomNode/TextRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { ColorSwatch } from "@mantine/core";
import styled from "styled-components";
import * as Styled from "./styles";

const StyledRow = styled.span`
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Views/GraphView/PremiumView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { Button, Image, List, ThemeIcon, Title } from "@mantine/core";
import styled from "styled-components";
import { BsCheck } from "react-icons/bs";
import { paymentURL } from "src/constants/data";

Expand Down
2 changes: 1 addition & 1 deletion src/layout/ExternalMode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { Anchor, Button, Group, Modal, Text } from "@mantine/core";
import styled from "styled-components";
import { VscCode } from "react-icons/vsc";

const StyledAlert = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/layout/Loading/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled, { keyframes } from "styled-components";
import { Center, Image, Stack } from "@mantine/core";
import styled, { keyframes } from "styled-components";
import { JSONCrackLogo } from "../JsonCrackLogo";

interface LoadingProps {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import { useRouter } from "next/router";
import styled from "styled-components";
import { Button, Text, Title } from "@mantine/core";
import styled from "styled-components";
import Layout from "src/layout/Layout";

const StyledNotFound = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import type { AppProps } from "next/app";
import dynamic from "next/dynamic";
import { useRouter } from "next/router";
import { MantineProvider, createTheme, ColorSchemeScript } from "@mantine/core";
import { MantineProvider, createTheme } from "@mantine/core";
import "@mantine/core/styles.css";
import "@mantine/code-highlight/styles.css";
import { ThemeProvider } from "styled-components";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_error.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { useRouter } from "next/router";
import styled from "styled-components";
import { Button } from "@mantine/core";
import styled from "styled-components";

const StyledNotFound = styled.div`
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import styled from "styled-components";
import { CodeHighlight } from "@mantine/code-highlight";
import { Group, Paper, Stack, Text, Title } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import styled from "styled-components";
import Layout from "src/layout/Layout";

const StyledFrame = styled.iframe`
Expand Down
4 changes: 1 addition & 3 deletions src/pages/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import dynamic from "next/dynamic";
import Head from "next/head";
import { useRouter } from "next/router";
import { MantineProvider, useMantineColorScheme } from "@mantine/core";
import { MantineProvider } from "@mantine/core";
import { ThemeProvider } from "styled-components";
import toast from "react-hot-toast";
import { darkTheme, lightTheme } from "src/constants/theme";
Expand All @@ -28,7 +28,6 @@ const WidgetPage = () => {
const setContents = useFile(state => state.setContents);
const setDirection = useGraph(state => state.setDirection);
const clearGraph = useGraph(state => state.clearGraph);
const { setColorScheme } = useMantineColorScheme();

React.useEffect(() => {
if (isReady) {
Expand All @@ -44,7 +43,6 @@ const WidgetPage = () => {
if (!event.data?.json) return;
if (event.data?.options?.theme === "light" || event.data?.options?.theme === "dark") {
setTheme(event.data.options.theme);
setColorScheme(event.data.options.theme);
}

setContents({ contents: event.data.json, hasChanges: false });
Expand Down
2 changes: 1 addition & 1 deletion src/store/useFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface JsonActions {
getContents: () => string;
getFormat: () => FileFormat;
getHasChanges: () => boolean;
setError: (error: object | null) => void;
setError: (error: string | null) => void;
setHasChanges: (hasChanges: boolean) => void;
setContents: (data: SetContents) => void;
fetchFile: (fileId: string) => void;
Expand Down

0 comments on commit 9e8cee5

Please sign in to comment.