From 5b0243e98c0db29fc9f006424de5470e59eaa49c Mon Sep 17 00:00:00 2001 From: Toni Sharpe Date: Mon, 20 May 2024 17:46:00 +0100 Subject: [PATCH] Improve make file commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * if the TMux window is closed then ==> Checking your local environment has the necessary commands... ==> Validating your .env file for make up .env file valid for make up ==> Checking port ==> Building grapher yarn lerna run build > Lerna (powered by Nx) Running target build for 5 projects: - @ourworldindata/components - @ourworldindata/core-table - @ourworldindata/grapher - @ourworldindata/types - @ourworldindata/utils > @ourworldindata/types:build [existing outputs match the cache, left as is] > @ourworldindata/utils:build [existing outputs match the cache, left as is] > @ourworldindata/core-table:build [existing outputs match the cache, left as is] > @ourworldindata/components:build [existing outputs match the cache, left as is] > @ourworldindata/grapher:build [existing outputs match the cache, left as is] CLI Building entry: src/index.ts CLI Using tsconfig: tsconfig.src.json CLI tsup v7.2.0 CLI Using tsup config: /Users/brainstem/owid-grapher/packages/@ourworldindata/grapher/tsup.config.ts CLI Target: es2019 CLI Cleaning output folder CJS Build start DTS Build start CJS dist/index.css 103.74 KB CJS dist/index.css.map 194.07 KB CJS dist/index.js 1.38 MB CJS dist/index.js.map 2.59 MB CJS ⚡️ Build success in 1051ms DTS ⚡️ Build success in 6581ms DTS dist/index.d.ts 64.51 KB > Lerna (powered by Nx) Successfully ran target build for 5 projects Nx read the output from the cache instead of running the command for 5 out of 5 tasks. ==> Starting dev environment tmux new-session -s grapher \ -n docker 'docker compose -f docker-compose.grapher.yml up' \; \ set remain-on-exit on \; \ set-option -g default-shell /bin/zsh \; \ new-window -n admin \ 'devTools/docker/wait-for-mysql.sh && yarn startAdminDevServer' \; \ set remain-on-exit on \; \ new-window -n vite 'yarn run startSiteFront' \; \ set remain-on-exit on \; \ new-window -n lerna 'yarn startLernaWatcher' \; \ set remain-on-exit on \; \ new-window -n welcome 'devTools/docker/banner.sh; exec /bin/zsh' \; \ bind R respawn-pane -k \; \ bind X kill-pane \; \ bind Q kill-server \; \ set -g mouse on \ || make down [exited] will error, throwing duplicate session - this change checks for a session and removes the grapher session if it's found before going back to where the contributor was --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index bd489d8b906..02bfb2ade38 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,10 @@ up: require create-if-missing.env ../owid-content tmp-downloads/owid_metadata.sq @echo '==> Starting dev environment' @mkdir -p logs + + @if tmux has-session; then \ + tmux kill-session -t grapher; \ + fi tmux new-session -s grapher \ -n docker 'docker compose -f docker-compose.grapher.yml up' \; \ set remain-on-exit on \; \ @@ -77,6 +81,10 @@ up.devcontainer: create-if-missing.env.devcontainer tmp-downloads/owid_metadata. @echo '==> Starting dev environment' @mkdir -p logs + + @if tmux has-session; then \ + tmux kill-session -t grapher; \ + fi tmux new-session -s grapher \ -n admin \ 'devTools/docker/wait-for-mysql.sh && yarn startAdminDevServer' \; \ @@ -100,6 +108,10 @@ up.full: require create-if-missing.env.full ../owid-content tmp-downloads/owid_m yarn lerna run build @echo '==> Starting dev environment' + + @if tmux has-session; then \ + tmux kill-session -t grapher; \ + fi tmux new-session -s grapher \ -n docker 'docker compose -f docker-compose.grapher.yml up' \; \ set remain-on-exit on \; \