Skip to content

Commit

Permalink
fix config to support FE and BE repos
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed May 24, 2024
1 parent ff36496 commit 0e75520
Showing 1 changed file with 112 additions and 98 deletions.
210 changes: 112 additions & 98 deletions .submodules/config/configs.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,11 @@
}
}
},
"javascript": {
"javascript.devcontainer": {
"inherits": [
"base"
],
"description": "A devcontainer with a javascript environment.",
"submodules": [
"codeforlife-package-javascript"
],
"devcontainer": {
"features": {
"ghcr.io/devcontainers/features/node:1": {
Expand All @@ -93,36 +90,24 @@
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
// "dsznajder.es7-react-js-snippets",
// "ecmel.vscode-html-css",
// "jock.svg"
]
}
}
},
}
},
"javascript.config": {
"inherits": [
"base"
],
"description": "A configured javascript environment.",
"vscode": {
"settings": {
"javascript.format.semicolons": "remove",
"typescript.format.semicolons": "remove",
"javascript.preferences.quoteStyle": "double",
"typescript.preferences.quoteStyle": "double",
"!prettier.configPath": ".prettierrc.json",
"[javascript]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"codeSnippets": {
"javascript.module.doccomment": {
Expand All @@ -142,17 +127,21 @@
}
}
},
"python": {
"javascript": {
"inherits": [
"base"
"javascript.devcontainer",
"javascript.config"
],
"description": "A devcontainer with a python environment.",
"description": "A devcontainer with a configured javascript environment.",
"submodules": [
"codeforlife-deploy-appengine",
"codeforlife-package-python",
"codeforlife-portal",
"rapid-router"
"codeforlife-package-javascript"
]
},
"python.devcontainer": {
"inherits": [
"base"
],
"description": "A devcontainer with a python environment.",
"devcontainer": {
"features": {
"ghcr.io/devcontainers/features/python:1": {
Expand All @@ -178,7 +167,13 @@
]
}
}
},
}
},
"python.config": {
"inherits": [
"base"
],
"description": "A configured python environment.",
"vscode": {
"settings": {
"python.defaultInterpreterPath": ".venv/bin/python",
Expand Down Expand Up @@ -303,74 +298,71 @@
}
}
},
"service": {
"python": {
"inherits": [
"javascript",
"python"
"python.devcontainer",
"python.config"
],
"description": "A devcontainer for a micro-service.",
"description": "A devcontainer with a configured python environment.",
"submodules": [
"codeforlife-service-template",
"codeforlife-portal-react",
"codeforlife-sso"
"codeforlife-deploy-appengine",
"codeforlife-package-python",
"codeforlife-portal",
"rapid-router"
]
},
"service.devcontainer": {
"inherits": [
"python.devcontainer",
"javascript.devcontainer"
],
"description": "The devcontainer for a micro-service.",
"devcontainer": {
"postCreateCommand": "./setup",
"postCreateCommand": "chmod u+x ./setup && ./setup",
"mounts": [
"source=./codeforlife-package-javascript,target=/workspace/codeforlife-package-javascript,type=bind,consistency=cached",
"source=./codeforlife-package-python,target=/workspace/codeforlife-package-python,type=bind,consistency=cached"
]
},
"workspace": {
"folders": [
{
"path": "../codeforlife-package-python",
"name": "package-python"
},
{
"path": "../codeforlife-package-javascript",
"name": "package-javascript"
}
]
}
},
"service.backend": {
"inherits": [
"service.devcontainer",
"python.config"
],
"description": "A devcontainer for a backend micro-service.",
"submodules": [
"codeforlife-portal-react"
],
"vscode": {
"settings": {
"python.defaultInterpreterPath": "backend/.venv/bin/python",
"python.analysis.extraPaths": [
"../codeforlife-package-python"
],
"!isort.path": [
"backend/.venv/bin/python",
"-m",
"isort"
],
"!isort.args": [
"--settings-file=backend/pyproject.toml"
],
"black-formatter.cwd": "${workspaceFolder}/backend",
"mypy-type-checker.cwd": "${workspaceFolder}/backend",
"pylint.cwd": "${workspaceFolder}/backend",
"python.testing.cwd": "${workspaceFolder}/backend",
"!prettier.configPath": "frontend/.prettierrc.json"
]
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "start-react-dev-server",
"isBackground": true,
"type": "npm",
"script": "start",
"options": {
"env": {
"BROWSER": "none"
}
},
"path": "frontend",
"problemMatcher": []
},
{
"label": "pipenv-install-dev",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"command": "pipenv install --dev"
},
{
"label": "migrate-db",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"dependsOn": [
"pipenv-install-dev"
],
Expand All @@ -381,20 +373,13 @@
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "React Dev Server",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"preLaunchTask": "start-react-dev-server"
},
{
"name": "Django Server",
"type": "debugpy",
"request": "launch",
"django": true,
"justMyCode": false,
"program": "${workspaceFolder}/backend/manage.py",
"program": "${workspaceFolder}/manage.py",
"?args": [
"runserver",
"localhost:8000"
Expand All @@ -403,23 +388,52 @@
}
]
}
},
"workspace": {
"folders": [
{
"path": "../codeforlife-package-python",
"name": "package-python"
},
{
"path": "../codeforlife-package-javascript",
"name": "package-javascript"
}
]
}
},
"service.frontend": {
"inherits": [
"service.devcontainer",
"javascript.config"
],
"description": "A devcontainer for a frontend micro-service.",
"submodules": [
"codeforlife-portal-frontend"
],
"vscode": {
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "start-react-dev-server",
"isBackground": true,
"type": "npm",
"script": "start",
"options": {
"env": {
"BROWSER": "none"
}
},
"problemMatcher": []
}
]
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "React Dev Server",
"type": "chrome",
"request": "launch",
"url": "http://localhost:5173",
"preLaunchTask": "start-react-dev-server"
}
]
}
}
},
"service+sso": {
"inherits": [
"service"
"service.devcontainer"
],
"description": "A service that also runs the SSO service in the background.",
// TODO: set submodules after testing how this would work.
Expand All @@ -438,9 +452,9 @@
"type": "shell",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/../codeforlife-sso/backend",
"cwd": "${workspaceFolder}/../codeforlife-sso",
"env": {
"DB_NAME": "${fileWorkspaceFolder}/backend/db.sqlite3",
"DB_NAME": "${fileWorkspaceFolder}/db.sqlite3",
"SERVICE_NAME": "sso",
"SERVICE_PORT": "8001"
}
Expand All @@ -461,7 +475,7 @@
"request": "launch",
"django": true,
"justMyCode": false,
"program": "${fileWorkspaceFolder}/backend/manage.py",
"program": "${fileWorkspaceFolder}/manage.py",
"args": [
"runserver",
"localhost:8000"
Expand Down

0 comments on commit 0e75520

Please sign in to comment.