Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

chillcicada/codemirror4hw

Repository files navigation

CodeMirror For HW

English docs | 中文文档

wakatime

Emmm, this is my final homework for Fundamentals of Computer Network Technology. (Maybe a little scribble)

Brief Introduction

This project is a web python editor and compiler, which is based on CodeMirror6 and WebSocket.

Frontend: Typescript + Vue3 + Vite + MDUI + CodeMirror6

Communication: WebSocket

Backend: Node.js (CommonJS) + Python3

Dependency

Install

# pnpm and yarn are also recommended
git clone git@github.com:chillcicada/codemirror4hw.git
cd codemirror4hw
npm i

Inspiration

Refer to Online Python Tutor.

Usage

There are many ways to run this project.

Emphasis

The project uses vite-plugin-eslint to lint the code, if you run npm run build you may meet an error caused by the conflict between vite-plugin-eslint and new current typescript. Below is the solution:

Add the "type": "index.d.ts" to the "exports" of vite-plugin-eslint's package.json.

// node_modules/vite-plugin-eslint/package.json
"exports": {
  ".": {
    "import": "./dist/index.mjs",
    "require": "./dist/index.js",
    "types": "./dist/index.d.ts"  // add this line
  }
}

Node.js

# start the websocket server
npm run start
# start the preview web
npm run dev

Or, you can build it and set proxy server.

npm run build

The dist/ folder is under the project's root directory.

TODO

Some features have not yet been implemented, so stay tuned :)

  • refine Nginx.conf
  • add Dockerfile
  • add debug mode
  • ......

Acknowledgement

All other mentioned dependencies are also appreciated.

LICENSE

MIT

Except for the following situations:

If you are a student of THU and you are doing the same or similar final homework, you can use this project as a reference without limitation, but you should not copy the code directly. Well, if you make your homework based on this project, you should shoot me an email, and don't forget to invite me for a fruit tea.

:)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published