Skip to content

Commit

Permalink
Merge pull request #221 from dxe/alex/devsetup
Browse files Browse the repository at this point in the history
Developer environment improvements
  • Loading branch information
alexsapps authored Feb 14, 2025
2 parents f927885 + 6a9cc61 commit 8bd6690
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"ms-vscode.makefile-tools",
"golang.go",
"Vue.volar",
"GitHub.vscode-github-actions"
"GitHub.vscode-github-actions",
"ms-vscode.vscode-typescript-next",
"esbenp.prettier-vscode"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ frontend-v2/node_modules
frontend-v2/.next
frontend-v2/out
npm-debug.log
server/src/__debug*
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Stop Makefile extension from asking about installing C++ tools when the
// project is opened.
"makefile.configureOnOpen": false,
"editor.formatOnSave": true,
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dev_db:
# Install all deps for this project.
deps:
. $(NVM_SCRIPT) && cd frontend && nvm install 16 && npm i --legacy-peer-deps
. $(NVM_SCRIPT) && cd frontend-v2 && nvm install 18 && pnpm i
. $(NVM_SCRIPT) && cd frontend-v2 && nvm install 18 && npm i -g pnpm && pnpm i
cd server/src && go get -t github.com/dxe/adb/...

# Run all tests
Expand Down Expand Up @@ -86,5 +86,5 @@ prod_build: clean set_git_hooks
# Keep in sync with hooks/pre-commit.
fmt:
cd server && gofmt -w `find . -name '*.go'`
cd frontend && npx prettier --write *.{ts,vue,js}
cd frontend && npx prettier --write **/*.{ts,vue,js}
cd frontend-v2 && pnpm fmt
3 changes: 3 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
external/**
dist/**
static/external/**
7 changes: 3 additions & 4 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Adapted from https://golang.org/misc/git/pre-commit
# Keep in sync with "make fmt".

gofiles=$(gofmt -l $(find . -name "*.go"))
webfiles=$(npx prettier -l frontend/*.{js,ts,vue})
webfilesV2=$(npx prettier -l frontend-v2/*.{ts,tsx})
gofiles=$(cd server && gofmt -l $(find . -name "*.go"))
webfiles=$(cd frontend && npx prettier -l **/*.{js,ts,vue})
webfilesV2=$(cd frontend-v2 && npx prettier -l **/*.{ts,tsx})
[ -z "$gofiles" -a -z "$webfiles" -a -z "$webfilesV2" ] && exit 0

echo >&2 "Misformatted files:"
Expand All @@ -16,4 +16,3 @@ echo >&2
echo >&2 "Please run: make fmt"

exit 1

0 comments on commit 8bd6690

Please sign in to comment.