diff --git a/.gitignore b/.gitignore index 32fcfb22..b33a62e1 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,7 @@ vendor.bundle.js bundle.js.map dist/ yarn-error.log -src/app/public/data +src/app/data # Bundled JS src/app/build diff --git a/docker-compose.yml b/docker-compose.yml index ad27d507..f614c13c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,21 +14,20 @@ services: retries: 6 app: - image: node:18-slim + image: oven/bun:1 stdin_open: true working_dir: /usr/local/src environment: - - REACT_APP_GIT_COMMIT=${REACT_APP_GIT_COMMIT:-latest} + - VITE_GIT_COMMIT=${VITE_GIT_COMMIT:-latest} - CHOKIDAR_USEPOLLING=true - CHOKIDAR_INTERVAL=100 - PORT=4545 - - NODE_OPTIONS=--openssl-legacy-provider volumes: - ./src/app:/usr/local/src - - ./src/django/static:/usr/local/src/build + - ./src/django/static:/usr/local/src/dist # Ensure node_modules cache doesn't clash with other jobs on CI. - - node-modules-volume:/usr/local/src/node_modules - command: yarn start + # - node-modules-volume:/usr/local/src/node_modules + command: bun start django: image: iow-django diff --git a/scripts/yarn b/scripts/bun similarity index 86% rename from scripts/yarn rename to scripts/bun index 0558131d..fd625e7a 100755 --- a/scripts/yarn +++ b/scripts/bun @@ -9,7 +9,7 @@ fi function usage() { echo -n \ "Usage: $(basename "$0") -Execute Yarn CLI commands. +Execute Bun CLI commands. " } @@ -19,6 +19,6 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then else docker-compose \ run --rm --no-deps --entrypoint "bash -c" app \ - "yarn ${*:1}" + "bun ${*:1}" fi fi diff --git a/scripts/format b/scripts/format index f7803e9d..c8bddf9e 100755 --- a/scripts/format +++ b/scripts/format @@ -1,6 +1,6 @@ #!/bin/bash # Disable "double quote to prevent globbing and word splitting" -# ${changed_files} is a list that needs to be split on words +# ${changed_files} is a list that needs to be split on words # shellcheck disable=SC2086 set -e @@ -22,7 +22,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then else # Format JavaScript app docker-compose \ - run --rm --no-TTY --entrypoint yarn app \ + run --rm --no-TTY app \ prettier --loglevel warn --write src/ # Format Django app diff --git a/scripts/lint b/scripts/lint index b1305746..7145ba53 100755 --- a/scripts/lint +++ b/scripts/lint @@ -23,12 +23,8 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then scripts/* # Lint JavaScript - docker-compose \ - run --rm --entrypoint yarn app prettier --check src/ - - docker-compose \ - run --rm --entrypoint ./node_modules/.bin/eslint \ - app src/ --ext .js --ext .jsx + ./scripts/bun run prettier --check src/ + ./scripts/bun run eslint src/ --ext .js --ext .jsx if [[ -n "${CI}" ]]; then # Lint Django app diff --git a/scripts/test b/scripts/test index b1e86e84..1003e0bc 100755 --- a/scripts/test +++ b/scripts/test @@ -47,19 +47,19 @@ function test_django_ci() { function test_app() { docker-compose \ run --rm --no-deps app \ - yarn test --watchAll=false + bun test --watchAll=false } function test_app_watch() { docker-compose \ run --rm --no-deps app \ - yarn test + bun test } function test_app_ci() { docker-compose \ run --rm --no-deps -e CI app \ - yarn test --watchAll=false + bun test --watchAll=false } if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then diff --git a/scripts/update b/scripts/update index a43e538b..5d58a76f 100755 --- a/scripts/update +++ b/scripts/update @@ -19,15 +19,15 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Ensure container images are current docker-compose build - # Update Yarn dependencies + # Update Bun dependencies docker-compose \ run --rm --no-deps app \ - yarn install + bun install # Build static asset bundle for React frontend docker-compose \ run --rm --no-deps app \ - yarn run build + bun run build # Bring up PostgreSQL and Django in a way that respects # configured service health checks. @@ -38,5 +38,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then # Collect Django static files ./scripts/manage collectstatic --no-input + + docker-compose stop fi fi diff --git a/src/app/.prettierignore b/src/app/.prettierignore new file mode 100644 index 00000000..88cc1070 --- /dev/null +++ b/src/app/.prettierignore @@ -0,0 +1,2 @@ +*.jpg +*.png diff --git a/src/app/bun.lockb b/src/app/bun.lockb new file mode 100755 index 00000000..09e57863 Binary files /dev/null and b/src/app/bun.lockb differ diff --git a/src/app/craco.config.js b/src/app/craco.config.js deleted file mode 100644 index fada05a7..00000000 --- a/src/app/craco.config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - webpack: { - configure: (webpackConfig, { env }) => { - if (env !== 'development') { - return webpackConfig; - } - - webpackConfig.module.rules.unshift({ - test: /\.js?$/, - use: ['prettier-loader'], - // force this loader to run first if it's not first in loaders list - enforce: 'pre', - exclude: /node_modules/, - }); - - return webpackConfig; - }, - }, -}; diff --git a/src/app/public/data/.gitkeep b/src/app/data/.gitkeep similarity index 100% rename from src/app/public/data/.gitkeep rename to src/app/data/.gitkeep diff --git a/src/app/public/favicon.ico b/src/app/favicon.ico similarity index 100% rename from src/app/public/favicon.ico rename to src/app/favicon.ico diff --git a/src/app/public/index.html b/src/app/index.html similarity index 60% rename from src/app/public/index.html rename to src/app/index.html index bf9089c9..bd850104 100644 --- a/src/app/public/index.html +++ b/src/app/index.html @@ -2,35 +2,27 @@ - + - + - - + Boundary Sync - +
+