From 0756cb057a4e75e5a0f36216d46a32c753fb8ac1 Mon Sep 17 00:00:00 2001 From: DuCanhGH <75556609+DuCanhGH@users.noreply.github.com> Date: Mon, 11 Sep 2023 22:55:01 +0700 Subject: [PATCH 01/10] refactor: migrate websocket to ESM --- .gitignore | 5 +- .prettierignore | 12 + .prettierrc | 9 + 502.html | 4 +- README.md | 30 +- make_style.sh | 10 +- package-lock.json | 1103 ++++++++++++++++++++++++++++++++++++++++++ package.json | 22 + websocket/config.js | 13 + websocket/daemon.js | 420 +++++++++------- websocket/queue.js | 130 +++++ websocket/types.d.ts | 32 ++ websocket/wscat.js | 325 +++++++------ 13 files changed, 1774 insertions(+), 341 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 websocket/config.js create mode 100644 websocket/queue.js create mode 100644 websocket/types.d.ts diff --git a/.gitignore b/.gitignore index 23bffc56c..4b5db87d4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.mo *~ *.swp +dmojsite/ dmoj/local_settings.py dmoj-site.pid dmoj-site.sock @@ -33,11 +34,9 @@ language_voj.json /static backup*.json custom_script_* -websocket/config.js node_modules/ -package-lock.json db.json tmp.sh *.sql fc_* -local_urls.py +local_urls.py \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..f2899c9e7 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,12 @@ +.DS_Store +node_modules +/build +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..a64cbe601 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "semi": true, + "useTabs": false, + "tabWidth": 2, + "printWidth": 100, + "singleQuote": false, + "trailingComma": "all", + "bracketSameLine": false +} diff --git a/502.html b/502.html index 43e80e392..d39ec8df2 100644 --- a/502.html +++ b/502.html @@ -1,7 +1,7 @@
-