-
Notifications
You must be signed in to change notification settings - Fork 84
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
Configuration to work with GitHub Codespaces #3493
base: integration
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"name": "LiteFarm Codespace", | ||
"image": "mcr.microsoft.com/devcontainers/base:bookworm", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "18.16.1", | ||
"installYarnUsingApt": false | ||
}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"cSpell.language": "pl,en", | ||
"cSpell.words": ["LiteFarm"], | ||
"cSpell.overrides": [ | ||
{ | ||
"filename": "packages/api/src/jobs/locales/en/*.*", | ||
"language": "en" | ||
}, | ||
{ | ||
"filename": "packages/api/src/jobs/locales/pl/*.*", | ||
"language": "pl" | ||
}, | ||
{ | ||
"filename": "packages/api/src/templates/locales/en.json", | ||
"language": "en" | ||
}, | ||
{ | ||
"filename": "packages/api/src/templates/locales/pl.json", | ||
"language": "pl" | ||
}, | ||
{ | ||
"filename": "packages/webapp/public/locales/en/*.*", | ||
"language": "en" | ||
}, | ||
{ | ||
"filename": "packages/webapp/public/locales/pl/*.*", | ||
"language": "pl" | ||
} | ||
], | ||
"cSpell.ignorePaths": [ | ||
"package-lock.json", | ||
"node_modules", | ||
"**/node_modules", | ||
"vscode-extension", | ||
".git/objects", | ||
".vscode", | ||
".vscode-insiders", | ||
".gradle", | ||
".svn", | ||
"logs", | ||
".cache" | ||
], | ||
"files.defaultLanguage": "en", | ||
"vscode.php-language-features": false, | ||
"vscode.php": false, | ||
"vscode.swift": false, | ||
"vscode.rust": false, | ||
"vscode.ruby": false, | ||
"vscode.r": false, | ||
"vscode.pug": false, | ||
"vscode.objective-c": false, | ||
"vscode.make": false, | ||
"vscode.lua": false, | ||
"vscode.less": false, | ||
"vscode.go": false, | ||
"vscode.dart": false, | ||
"vscode.fsharp": false, | ||
"vscode.coffeescript": false, | ||
"vscode.csharp": false, | ||
"vscode.vb": false, | ||
"vscode.latex": false, | ||
"vscjava.vscode-maven": false | ||
}, | ||
"extensions": [ | ||
"streetsidesoftware.code-spell-checker", | ||
"streetsidesoftware.code-spell-checker-polish", | ||
"streetsidesoftware.code-spell-checker-british-english", | ||
"redhat.vscode-yaml", | ||
"shd101wyy.markdown-preview-enhanced" | ||
] | ||
} | ||
}, | ||
"forwardPorts": [3000, 5001, 5433, 9000, 8088], | ||
"portsAttributes": { | ||
"3000": { | ||
"label": "Frontend (React)" | ||
}, | ||
"5001": { | ||
"label": "Backend (Express)" | ||
}, | ||
"5433": { | ||
"label": "Postgres" | ||
}, | ||
"9000": { | ||
"label": "MinIO" | ||
}, | ||
"8088": { | ||
"label": "Imaginary" | ||
} | ||
}, | ||
"postCreateCommand": "bash .devcontainer/post-create.sh", | ||
"postStartCommand": "bash .devcontainer/post-start.sh" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
DIR=`pwd` | ||
echo "Current directory: $DIR" | ||
|
||
nvm use | ||
|
||
# Install the root package dependencies | ||
npm install | ||
|
||
# Install the API package dependencies | ||
cd $DIR/packages/api | ||
npm install | ||
|
||
# Install the API package dependencies | ||
cd $DIR/packages/webapp | ||
pnpm install | ||
|
||
# Install the shared package dependencies | ||
cd $DIR/packages/shared | ||
npm install | ||
|
||
# Copy the default environment files | ||
cp $DIR/packages/api/.env.default $DIR/packages/api/.env | ||
cp $DIR/packages/webapp/.env.default $DIR/packages/webapp/.env | ||
|
||
if [ -x "$(command -v docker-compose)" ]; then | ||
docker-compose up --detach | ||
else | ||
docker compose up --detach | ||
fi | ||
Comment on lines
+27
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please explain what this block should be doing? It seems it does the same in both cases of the condition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my computer (Debian Bookworm) there is command
On the other hand in GitHub Codespaces there is command Command In summary this is only for backward compatibility. I use this script to start development on my local computer (it works not only in GitHub Codespaces). (I'm not sure why Debian Bookworm has such old version of Docker - |
||
|
||
sleep 10 | ||
|
||
# Set up the PostgreSQL database used by the app | ||
cd $DIR/packages/api | ||
npm run migrate:dev:db |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ -x "$(command -v docker-compose)" ]; then | ||
docker-compose up --detach | ||
else | ||
docker compose up --detach | ||
fi | ||
Comment on lines
+3
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this redundant since it's in the post-create script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At first I had this only in Script I'm not sure, if there should be another check if docker isn't running. Because on the first time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running multiple times In summary this block in # Get script directory
DIR="$(cd "$(dirname "$0")" && pwd)"
# Start Docker before running: npm run migrate:dev:db
sh "$DIR/post-start.sh" The |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably comes from your organization's specific setup, but we don't currently support pl locale -- could we remove references to this? Actually, I'm thinking it might be better to remove the extensions from this file altogether, since we don't currently have a unified criteria on extensions to use as a team and it's up to each developer to use the tools they deem necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and no. We were working on polish translation to LiteFarm and it is almost done: https://github.com/Lukasiewicz-Instytut-Lotnictwa/LiteFarm/tree/feature/GL-4-polish-translation.
Expect a pull request soon. But of course this is not important. It just helps to find spelling errors in translation files when working with Visual Studio Code.