Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft Project Refactor DO NOT MERGE #4

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,488 changes: 1,488 additions & 0 deletions .build-cache/foo.tsbuildinfo

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

# Indentation override for all JS under lib directory
[*.{js,ts,json,yml,yaml}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
max_line_length = off
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
66 changes: 66 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const common = {
env: {
node: true,
es6: true,
'jest/globals': true,
},
plugins: ['prettier', 'jest', 'markdown'],
extends: ['airbnb-base', 'prettier', 'plugin:jest/all'],
rules: {
'prettier/prettier': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
'jest/expect-expect': 'off',
'jest/prefer-expect-assertions': 'off',
'jest/no-test-return-statement': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-console': 'off',
'no-iterator': 'off',
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'consistent-return': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
},
}

module.exports = {
root: true,
overrides: [
{
/*
eslint-plugin-markdown only finds javascript code block snippet.
For specific spec, refer to https://github.com/eslint/eslint-plugin-markdown
*/
files: ['**/*.js', '**/*.md'],
...common,
},
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
env: common.env,
plugins: [...common.plugins, '@typescript-eslint'],
extends: [
...common.extends,
'prettier/@typescript-eslint',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
rules: {
...common.rules,
'@typescript-eslint/explicit-function-return-type': 'off',
},
settings: {
'import/resolver': {
typescript: {},
},
},
},
],
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
client/node_modules
server/node_modules
shared/node_modules
.history
10 changes: 10 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
singleQuote: true,
semi: false,
useTabs: false,
tabWidth: 2,
trailingComma: 'all',
endOfLine: 'lf',
// bracketSpacing: true
// printWidth: 80
}
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to server",
"port": 9229,
"request": "attach",
"sourceMaps": true,

"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"outFiles": [
"${workspaceFolder}/packages/quick-3d-mmo-server/dist",
"!**/node_modules/**"
]
},

{
"type": "pwa-node",
"request": "launch",
"name": "Debug Server",
"skipFiles": [
"<node_internals>/**"
],
"runtimeExecutable": "yarn",
"runtimeArgs": ["run-script", "server", "debug"],
"preLaunchTask": "yarn: server build"
}
]
}
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# QUICK_3D_MMORPG
## [Original Youtube Video](https://www.youtube.com/watch?v=IptkgFOoci0)

## How to Work on This :ox:
- _Only tested this with node v15.11.0. YMMV_
- Clone the repository
- *From the root folder*
- run `yarn`. The Yarn workspace settings will handle installing the packages for client and server.
- run `yarn shared build`
- run `yarn server start:dev`
- Ensure a browser is open to localhost:7700 _(Maybe. See below)_
- Example `yarn client start:dev`
- This should set the server to auto restart on changes.
- The client will need to be manually refreshed, if you want it to display any changes. That's by design. Noone wants to relog every time they make a change.

<details>
<summary>What are Yarn Workspaces?</summary>
<p>
https://yarnpkg.com/
Put some really good documentation on what they are here.

</p>
</details>
157 changes: 0 additions & 157 deletions client/shared/defs.mjs

This file was deleted.

42 changes: 0 additions & 42 deletions client/shared/math.mjs

This file was deleted.

Loading