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

Api/Auth #652

Merged
merged 18 commits into from
Jun 28, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dependencies
/node_modules
14 changes: 7 additions & 7 deletions frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react-router": "^5.3.3",
"react-router-dom": "^5.3.3",
"react-scripts": "^5.0.1",
"react-select": "^5.7.0"
"react-select": "^5.7.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down
3 changes: 3 additions & 0 deletions frontend2/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_THIS_URL=http://localhost:3000
REACT_APP_BACKEND_URL=http://localhost:8000
REACT_APP_REPLAY_URL=https://play.battlecode.org
4 changes: 4 additions & 0 deletions frontend2/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REACT_APP_THIS_URL=https://play.battlecode.org
REACT_APP_BACKEND_URL=https://api.battlecode.org
REACT_APP_REPLAY_URL=https://play.battlecode.org
GENERATE_SOURCEMAP=false
1 change: 1 addition & 0 deletions frontend2/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
"*.json",
".eslintrc.js",
"tailwind.config.js",
"**/types/**",
],
parserOptions: {
project: "tsconfig.json",
Expand Down
1 change: 1 addition & 0 deletions frontend2/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/node_modules
/.pnp
.pnp.js
/types

# production
/build
Expand Down
11 changes: 11 additions & 0 deletions frontend2/generate_types.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Running generate_types.bat"
call conda activate galaxy
echo "navigate to galaxy folder"
cd ..
echo "Generate OpenAPI 3.0 backend schema from siarnaq"
python backend/manage.py spectacular --file schema.yml
:: echo "Download openapitools"
:: npm install @openapitools/openapi-generator-cli -g
:: if you have a java error, just install java 8 and reload terminal
echo "Generate typescript types from schema"
npx @openapitools/openapi-generator-cli generate -i schema.yml -o frontend2/src/utils/types -g typescript-jquery --additional-properties=modelPropertyNaming=camelCase --additional-properties=disallowAdditionalPropertiesIfNotPresent=false
5 changes: 5 additions & 0 deletions frontend2/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
17 changes: 17 additions & 0 deletions frontend2/package-lock.json

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

2 changes: 2 additions & 0 deletions frontend2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
]
},
"devDependencies": {
"@types/js-cookie": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
Expand All @@ -54,6 +55,7 @@
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.32.2",
"js-cookie": "^3.0.5",
"prettier": "2.8.8",
"react-scripts": "5.0.1",
"tailwindcss": "^3.3.2",
Expand Down
4 changes: 4 additions & 0 deletions frontend2/src/utils/READ_THIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**WARNING!** Everything in the types folder is automatically generated! Do not modify anything in that folder!
You can re-generate the Typescript types by running `call generate_types.bat` in the `frontend2` folder (.sh script coming soon).

Types/API Documentation: Coming soon!
Loading