Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved to vite and monaco #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 6 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
node_modules
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
package-lock.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
dist
dist-ssr
*.local

*-lock.*
4 changes: 0 additions & 4 deletions README.md

This file was deleted.

13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
11,647 changes: 0 additions & 11,647 deletions package-lock.json

This file was deleted.

66 changes: 21 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,29 @@
{
"name": "test",
"version": "0.1.0",
"private": true,
"name": "vite-project",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.21",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"ace-builds": "^1.4.13",
"@babel/core": "^7.16.12",
"@chakra-ui/react": "^1.8.1",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@monaco-editor/react": "^4.3.1",
"framer-motion": "^5",
"monaco-editor": "^0.31.1",
"react": "^17.0.2",
"react-ace": "^9.5.0",
"react-codemirror2": "^7.2.1",
"react-d3-tree": "^3.2.1",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
"react-split": "^2.0.14",
"typescript": "^4.5.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"react-split": "^2.0.14"
},
"devDependencies": {
"autoprefixer": "^10.4.2",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.15"
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@vitejs/plugin-react": "^1.0.7",
"typescript": "^4.4.4",
"vite": "^2.7.2"
}
}
}
6 changes: 0 additions & 6 deletions postcss.config.js

This file was deleted.

Binary file removed public/favicon.ico
Binary file not shown.
43 changes: 0 additions & 43 deletions public/index.html

This file was deleted.

Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

Empty file removed src/App.css
Empty file.
71 changes: 15 additions & 56 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,21 @@
import React, { useState } from 'react';
import Tree from 'react-d3-tree'
import Editor from './components/Editor';
import Split from 'react-split';

const initalState = {
name: "root",
children: [
{ name: "test1" },
{ name: "test2" },

]
}

import { useState } from 'react'
import { Box, Flex, HStack, SimpleGrid, Text } from '@chakra-ui/react'
import Editor from './components/Editor'
import Tree from './components/Tree'
import EditorContext from './context/EditorContext'
import EditorProvider from './context/EditorProvider'
function App() {


const [editorString, setEditorString] = useState<string>("");

function test() {
let x = { name: "json error" };
try {
x = JSON.parse(editorString);
} catch (error) {
}

return x;
}

const [value, setValue] = useState<EditorState>({ text: "", errors: [] });
return (
<div className="App">
<div className="h-screen w-screen flex flex-col">

<div className="header bg-neutral-800">
<h1 className='py-3 pl-3 text-xl text-slate-100'>Treeviz</h1>
</div>

<Split
gutterSize={5}
// minSize={500}
direction='horizontal'
sizes={[50, 50]}
collapsed={500}
className='flex flex-1'
>

<Editor getData={setEditorString} />

<div className="left h-full bg-slate-300 ">
<Tree data={test()} translate={{ x: 250, y: 330 }} />
</div>
</Split>



<EditorProvider value={value}>
<SimpleGrid columns={2} spacing={0} backgroundColor={"gray.500"} height={"100vh"} >
<Editor onChange={(t) => setValue(t)} />
<Tree />
</SimpleGrid>
</EditorProvider>

</div>
</div>
);
)
}

export default App;
export default App