Skip to content

Commit

Permalink
Replace text editor to Monaco
Browse files Browse the repository at this point in the history
Change Alpine CDN to Webpack.
  • Loading branch information
tyfkda committed Jan 15, 2024
1 parent 156b558 commit 38f0b0a
Show file tree
Hide file tree
Showing 6 changed files with 398 additions and 395 deletions.
32 changes: 27 additions & 5 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@babel/core": "~7.22.15",
"@babel/preset-env": "~7.22.15",
"@babel/register": "~7.22.15",
"@types/ace": "~0.0.48",
"@types/alpinejs": "~3.13.6",
"@types/jest": "~29.5.4",
"@types/node": "~16.11.11",
"@types/path-browserify": "~1.0.0",
Expand Down Expand Up @@ -78,6 +78,7 @@
"dependencies": {
"@wasmer/wasi": "~0.12.0",
"@wasmer/wasmfs": "~0.12.0",
"alpinejs": "~3.13.3",
"buffer": "~6.0.3",
"core-js": "~3.32.1",
"path-browserify": "~1.0.1",
Expand Down
6 changes: 6 additions & 0 deletions src/wcc/www/@types/patch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ interface Window {
initialData: any
showOpenFilePicker(option?: any): Promise<[FileSystemFileHandle]>
showSaveFilePicker(option?: any): Promise<FileSystemFileHandle>

MonacoEnvironment: any
require: any
Alpine: any
}

interface FileSystemHandle {
Expand All @@ -23,3 +27,5 @@ interface WritableStream {
interface FileSystemWritableFileStream extends WritableStream {
write(content: any): Promise<any>
}

declare let monaco: any
4 changes: 2 additions & 2 deletions src/wcc/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<meta name="twitter:player:width" content="400">
<title>C-compiler on WASM</title>
<link rel="stylesheet" href="default.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/editor/editor.main.min.css" integrity="sha512-cglMadHaO/jAvqEM51bUj/saVbUkZwVa4PX0bcpWVlND3OrPpYcS/91uhIrgHrXmikanebYApd7UWjbDGEQUqg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>

<body>
Expand Down Expand Up @@ -71,8 +72,7 @@ <h4>About</h4>
</div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.12.5/ace.js"></script>
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js" integrity="sha512-ZG31AN9z/CQD1YDDAK4RUAvogwbJHv6bHrumrnMLzdCrVu4HeAqrUX7Jsal/cbUwXGfaMUNmQU04tQ8XXl5Znw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="main.js" type="text/javascript"></script>
</body>
Expand Down
Loading

0 comments on commit 38f0b0a

Please sign in to comment.