From 59bbecd881e2522b9c7d5397d97f55f75e3806ce Mon Sep 17 00:00:00 2001 From: Gregory Noack Date: Tue, 19 Nov 2024 12:32:54 -0800 Subject: [PATCH 1/3] adding polling to vite config, adds watching so changes work for m3 mac --- docker-compose.yml | 2 ++ packages/openneuro-app/vite.config.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 11c260124..ca76cdf4d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,8 @@ services: - "9992:9992" environment: - NODE_ENV=development + volumes: + - ./:/srv:rw,z depends_on: node: condition: service_healthy diff --git a/packages/openneuro-app/vite.config.js b/packages/openneuro-app/vite.config.js index 691d855e9..27551f7a6 100644 --- a/packages/openneuro-app/vite.config.js +++ b/packages/openneuro-app/vite.config.js @@ -27,6 +27,10 @@ export default defineConfig({ port: 80, host: "0.0.0.0", cors: true, + watch: { + usePolling: true, // Enable polling for file watching + interval: 1000, // Set polling interval to 1000ms (1 second) + }, }, build: { sourcemap: true, From c1193e111fc308a74fe3e3238d933a5f8bc15b1f Mon Sep 17 00:00:00 2001 From: Gregory Noack Date: Tue, 19 Nov 2024 14:46:09 -0800 Subject: [PATCH 2/3] adding polling to app container, providing config.env vars, update readme, and removing polling from vite config --- README.md | 9 +++++++++ config.env.example | 4 ++++ docker-compose.yml | 2 -- packages/openneuro-app/vite.config.js | 4 ---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 537d30f8f..4d7b1f4c5 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,15 @@ GOOGLE_CLIENT_SECRET= [podman-compose](https://github.com/containers/podman-compose) is used to run a local copy of all required services together. + + +macOS Development Setup - If you're working on macOS and encounter issues with file watching in Vite, use the following environment variables (in config.env): + +``` +export CHOKIDAR_USEPOLLING=true +export CHOKIDAR_INTERVAL=1000 +``` + ```shell # This will run podman-compose in the background (-d flag is --detach) podman-compose up -d diff --git a/config.env.example b/config.env.example index d30315c44..da15fce36 100644 --- a/config.env.example +++ b/config.env.example @@ -18,6 +18,10 @@ ORCID_API_ENDPOINT=https://api.sandbox.orcid.org GLOBUS_CLIENT_ID= GLOBUS_CLIENT_SECRET= +# macOS Development Setup - Fixes issues with Vite file watching - set to CHOKIDAR_USEPOLLING=true +CHOKIDAR_USEPOLLING=false +CHOKIDAR_INTERVAL=1000 + # Relay for enabling mail - leave blank to disable email CRN_SERVER_MAIL_API_KEY= CRN_SERVER_MAIL_API_SECRET= diff --git a/docker-compose.yml b/docker-compose.yml index ca76cdf4d..11c260124 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,6 @@ services: - "9992:9992" environment: - NODE_ENV=development - volumes: - - ./:/srv:rw,z depends_on: node: condition: service_healthy diff --git a/packages/openneuro-app/vite.config.js b/packages/openneuro-app/vite.config.js index 27551f7a6..691d855e9 100644 --- a/packages/openneuro-app/vite.config.js +++ b/packages/openneuro-app/vite.config.js @@ -27,10 +27,6 @@ export default defineConfig({ port: 80, host: "0.0.0.0", cors: true, - watch: { - usePolling: true, // Enable polling for file watching - interval: 1000, // Set polling interval to 1000ms (1 second) - }, }, build: { sourcemap: true, From e56253fad0c2cb11944e4cdba663ae5e5cd066d6 Mon Sep 17 00:00:00 2001 From: Gregory Noack Date: Tue, 19 Nov 2024 14:48:16 -0800 Subject: [PATCH 3/3] small text update to readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d7b1f4c5..a8e0ad654 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,7 @@ GOOGLE_CLIENT_SECRET= macOS Development Setup - If you're working on macOS and encounter issues with file watching in Vite, use the following environment variables (in config.env): ``` -export CHOKIDAR_USEPOLLING=true -export CHOKIDAR_INTERVAL=1000 +CHOKIDAR_USEPOLLING=true ``` ```shell