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

dev: enable vscode sdk #2970

Merged
merged 5 commits into from
Apr 26, 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
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
.PHONY: smoketest generate check all test check-js check-go
.PHONY: cy-wide cy-mobile cy-wide-prod cy-mobile-prod cypress postgres
.PHONY: config.json.bak jest new-migration cy-wide-prod-run cy-mobile-prod-run
.PHONY: goalert-container demo-container release reset-integration yarn ensure-yarn
.PHONY: goalert-container demo-container release reset-integration yarn ensure-yarn vscode upgrade-js
.SUFFIXES:

default: bin/goalert

include Makefile.binaries.mk

CFGPARAMS = devtools/configparams/*.go
Expand Down Expand Up @@ -121,6 +123,10 @@ help: ## Show all valid options
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

start: bin/goalert $(NODE_DEPS) web/src/schema.d.ts $(BIN_DIR)/tools/prometheus ## Start the developer version of the application
@if [ -d ".vscode" ]; then \
echo "Detected .vscode directory, running 'vscode' target"; \
$(MAKE) vscode; \
fi
go run ./devtools/waitfor -timeout 1s "$(DB_URL)" || make postgres
GOALERT_VERSION=$(GIT_VERSION) GOALERT_STRICT_EXPERIMENTAL=1 go run ./devtools/runproc -f Procfile -l Procfile.local

Expand Down Expand Up @@ -295,3 +301,14 @@ new-migration:
@test ! -f migrate/migrations/*-$(NAME).sql || (echo "Migration already exists with the name $(NAME)." && false)
@echo "-- +migrate Up\n\n\n-- +migrate Down\n" >migrate/migrations/$(shell date +%Y%m%d%H%M%S)-$(NAME).sql
@echo "Created: migrate/migrations/$(shell date +%Y%m%d%H%M%S)-$(NAME).sql"

.yarn/sdks/integrations.yml: $(NODE_DEPS)
yarn dlx @yarnpkg/sdks vscode

vscode: .yarn/sdks/integrations.yml ## Setup vscode integrations

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs: $(NODE_DEPS)
yarn plugin import interactive-tools

upgrade-js: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs ## Interactively upgrade javascript packages
yarn upgrade-interactive
4 changes: 3 additions & 1 deletion docs/development-setup.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Development Setup

This guide assumes you have the commands `podman`, `go` (>= 1.19), `node`, `yarn`, and `make` installed/available.
This guide assumes you have the commands `podman` (or `docker`), `go` (>= 1.19), `node` (>= 16.10), and `make` installed/available.

Targets like `make start` will automatically fallback to the `docker` command if `podman` is not available. The container tool command can be overriden by setting the `CONTAINER_TOOL` variable.

If you use Visual Studio Code, run `make vscode` to setup integrations for the project.

```bash
# force podman
make start CONTAINER_TOOL=podman
Expand Down