Skip to content

Commit 88e370c

Browse files
Merge pull request #122 from Speedrunyourknowledge/develop
fix mathquill imports and use custom patch-package
2 parents 681ee31 + e147eb4 commit 88e370c

10 files changed

Lines changed: 686 additions & 750 deletions

File tree

calc-frontend/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<div id="root"></div>
1818
<script src="https://cdn.plot.ly/plotly-3.0.0.min.js"></script>
1919
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
20-
<script src="node_modules/mathquill/build/mathquill.js"></script>
2120

2221
<script type="module" src="/src/main.tsx"></script>
2322
</body>

calc-frontend/package-lock.json

Lines changed: 650 additions & 746 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

calc-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"eslint-plugin-react-hooks": "^5.0.0",
3737
"eslint-plugin-react-refresh": "^0.4.16",
3838
"globals": "^15.14.0",
39-
"patch-package": "^8.0.0",
39+
"patch-package": "github:Speedrunyourknowledge/patch-package-mod",
4040
"typescript": "~5.6.2",
4141
"typescript-eslint": "^8.18.2",
4242
"vite": "^6.1.1",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/node_modules/mathquill/build/mathquill.js b/node_modules/mathquill/build/mathquill.js
2+
index a6f7939..5d05e69 100644
3+
--- a/node_modules/mathquill/build/mathquill.js
4+
+++ b/node_modules/mathquill/build/mathquill.js
5+
@@ -8,7 +8,7 @@
6+
* one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
9+
-(function() {
10+
+export default function mathquillFunc() {
11+
12+
var jQuery = window.jQuery,
13+
undefined,
14+
@@ -4979,4 +4979,4 @@ for (var key in MQ1) (function(key, val) {
15+
else MathQuill[key] = val;
16+
}(key, MQ1[key]));
17+
18+
-}());
19+
+};

calc-frontend/src/App/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import './widgets.css'
66

77
import RoutesList from "./RoutesList";
88

9+
//@ts-ignore implicit any type
10+
import mathquillFunc from "../../node_modules/mathquill/build/mathquill";
11+
912

1013
function App() {
1114

15+
// launch mathquill instance
16+
mathquillFunc();
17+
1218
// go to the RootLayout component to edit the visual layout
1319

1420
// Handles all the routes

calc-frontend/src/App/RootLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { ScrollRestoration } from "react-router";
44
import ucfLogo from "../assets/ucf-logo.png"
55
import CalcLogo from "../components/CalcLogo"
66

7+
8+
79
function RootLayout(){
810

911

calc-frontend/src/App/RoutesList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import LimitDef from "../components/Limits/LimitDef";
4242
import CustomInt from "../pages/CustomIntegral";
4343
import CustomDeriv from "../pages/CustomDerivative";
4444

45+
4546
const RoutesList =
4647
<Route path='/' element={<RootLayout/>} >
4748
<Route index element={<Home/>}/>

calc-frontend/src/__tests__/App.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import { createMemoryRouter, createRoutesFromElements, RouterProvider } from 're
44

55
import RoutesList from '../App/RoutesList'
66

7+
//@ts-ignore implicit any type
8+
import mathquillFunc from "../../node_modules/mathquill/build/mathquill";
9+
710
test('full app rendering', () => {
811

12+
913
const router = createMemoryRouter(createRoutesFromElements(RoutesList), {
1014
initialEntries:['/'],
1115
})

calc-frontend/tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"noUnusedParameters": true,
2222
"noFallthroughCasesInSwitch": true,
2323
"noUncheckedSideEffectImports": true,
24-
"noImplicitAny": true
24+
"noImplicitAny": true,
25+
"allowJs": true,
2526
},
2627
"include": ["src"]
2728
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)