Skip to content

Commit

Permalink
Support for Upsilon (upsilon.js) + Upgrading monaco (Omega-Numworks#10)
Browse files Browse the repository at this point in the history
* Replacing numworks.js with upsilon.js + Upgrading monaco

* DELETE package-lock.json
  • Loading branch information
corentin703 committed Dec 28, 2022
1 parent dbe23a3 commit 3dfd37f
Show file tree
Hide file tree
Showing 7 changed files with 11,474 additions and 10,371 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@monaco-editor/react": "^4.4.6",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^13.5.0",
"firebase": "^7.17.2",
"jszip": "^3.7.1",
"numworks.js": "^1.1.0",
"nw-react-scripts": "3.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-monaco-editor": "^0.47.0",
"react-resize-detector": "^7.0.0",
"react-router-dom": "^6.2.1"
"react-router-dom": "^6.2.1",
"upsilon.js": "^1.4.0"
},
"scripts": {
"start": "nw-react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Omega IDE</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import Editor from './ide/Editor.js';
import Simulator from './ide/Simulator.js';
import LocalStorageConnector from './LocalStorageConnector.js';
Expand All @@ -9,10 +9,10 @@ function App() {
<div className="App">
<Router>
<div className="body">
<Switch>
<Route path="/" component={() => <Editor base="/" connector={LocalStorageConnector} vercel={false} />} exact />
<Route path="/simulator" component={Simulator} exact />
</Switch>
<Routes>
<Route index element={<Editor base="/" connector={LocalStorageConnector} vercel={false} />} exact />
<Route path="/simulator" element={Simulator} exact />
</Routes>
</div>
</Router>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/ide/Editor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { Redirect } from "react-router-dom";
import { Navigate } from "react-router-dom";
import "../sass/omega.ide.sass";

import File from "./components/File";
Expand Down Expand Up @@ -58,7 +58,7 @@ import {
import Monaco from "./components/Monaco";
import Loader from "./components/Loader";
import JSZip from "jszip";
import Numworks from "numworks.js";
import Numworks from "upsilon.js";

export default class IDEEditor extends Component {
constructor(props) {
Expand Down Expand Up @@ -1819,7 +1819,7 @@ export default class IDEEditor extends Component {
return this.renderEditor();
}
} else if (this.state.logged === false) {
return <Redirect to={this.props.base} />;
return <Navigate replace to={this.props.base} />;
} else {
return this.renderLoading();
}
Expand Down
4 changes: 2 additions & 2 deletions src/ide/components/Monaco.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import React, { Component } from 'react';
import MonacoEditor from 'react-monaco-editor';
import MonacoEditor from '@monaco-editor/react';
import ReactResizeDetector from 'react-resize-detector';

export default class Monaco extends Component {
Expand Down Expand Up @@ -47,7 +47,7 @@ export default class Monaco extends Component {
theme="vs-dark"
value={this.props.value}
onChange={this.handleChange}
editorDidMount={this.editorDidMount}
onMount={this.editorDidMount}
/>
</div>
</ReactResizeDetector>
Expand Down

0 comments on commit 3dfd37f

Please sign in to comment.