diff --git a/.env.sample b/.env.sample index 6246c9bae..e00e5e286 100644 --- a/.env.sample +++ b/.env.sample @@ -21,4 +21,13 @@ TOP_MESSAGE_INVERTED='false' UNLEASH_ENV='' UNLEASH_TOKEN='' UNLEASH_TOKEN_RAILS='' -UNLEASH_URL='' \ No newline at end of file +UNLEASH_URL='' + +# Database connection settings. On Mac/Linux with peer authentication, these can often +# be left empty. On Windows or other environments using password authentication, set +# these to match your local PostgreSQL configuration. +DATABASE_USERNAME='' +DATABASE_PASSWORD='' +DATABASE_HOST='' +# Windows only: set to 0 to disable Puma worker forking (not supported on Windows) +# WEB_CONCURRENCY=0 diff --git a/Gemfile b/Gemfile index f5d6c389e..fcb0132ce 100644 --- a/Gemfile +++ b/Gemfile @@ -56,6 +56,9 @@ gem 'public_suffix' # used for config/initializers/cookie_jar.rb # handy ruby extensions gem 'facets', require: false +# Windows does not have zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] + gem 'rack', '>= 2.2.3' # for redirecting gem 'rack-rewrite', '~> 1.5.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2fa609efd..bd4440507 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -211,6 +211,7 @@ GEM ffi (1.17.3-aarch64-linux-gnu) ffi (1.17.3-aarch64-linux-musl) ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x64-mingw-ucrt) ffi (1.17.3-x86_64-darwin) ffi (1.17.3-x86_64-linux-gnu) ffi (1.17.3-x86_64-linux-musl) @@ -262,6 +263,9 @@ GEM google-protobuf (4.33.4-arm64-darwin) bigdecimal rake (>= 13) + google-protobuf (4.33.4-x64-mingw-ucrt) + bigdecimal + rake (>= 13) google-protobuf (4.33.4-x86_64-darwin) bigdecimal rake (>= 13) @@ -294,6 +298,9 @@ GEM grpc (1.76.0-arm64-darwin) google-protobuf (>= 3.25, < 5.0) googleapis-common-protos-types (~> 1.0) + grpc (1.76.0-x64-mingw-ucrt) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) grpc (1.76.0-x86_64-darwin) google-protobuf (>= 3.25, < 5.0) googleapis-common-protos-types (~> 1.0) @@ -402,6 +409,8 @@ GEM racc (~> 1.4) nokogiri (1.19.1-arm64-darwin) racc (~> 1.4) + nokogiri (1.19.1-x64-mingw-ucrt) + racc (~> 1.4) nokogiri (1.19.1-x86_64-darwin) racc (~> 1.4) nokogiri (1.19.1-x86_64-linux-gnu) @@ -427,6 +436,7 @@ GEM pg (1.6.3-aarch64-linux) pg (1.6.3-aarch64-linux-musl) pg (1.6.3-arm64-darwin) + pg (1.6.3-x64-mingw-ucrt) pg (1.6.3-x86_64-darwin) pg (1.6.3-x86_64-linux) pg (1.6.3-x86_64-linux-musl) @@ -641,6 +651,8 @@ GEM tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + tzinfo-data (1.2026.1) + tzinfo (>= 1.0.0) uglifier (3.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (3.2.0) @@ -671,6 +683,8 @@ GEM ffi (~> 1.17.2) yggdrasil-engine (1.1.1-arm64-darwin) ffi (~> 1.17.2) + yggdrasil-engine (1.1.1-x64-mingw-ucrt) + ffi (~> 1.17.2) yggdrasil-engine (1.1.1-x86_64-darwin) ffi (~> 1.17.2) yggdrasil-engine (1.1.1-x86_64-linux) @@ -684,6 +698,7 @@ PLATFORMS aarch64-linux-gnu aarch64-linux-musl arm64-darwin + x64-mingw-ucrt x86_64-darwin x86_64-linux x86_64-linux-gnu @@ -768,6 +783,7 @@ DEPENDENCIES spring sprockets-rails sprockets_uglifier_with_source_maps + tzinfo-data uglifier (~> 3.2) unleash (~> 6.4.1) vcr diff --git a/config/database.yml b/config/database.yml index 4169db098..ce1beb9e6 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,6 +3,13 @@ default: &default encoding: utf8 pool: 5 timeout: 5000 +<% if ENV['DATABASE_USERNAME'] %> + username: <%= ENV['DATABASE_USERNAME'] %> +<% end %> +<% if ENV['DATABASE_PASSWORD'] %> + password: <%= ENV['DATABASE_PASSWORD'] %> +<% end %> + host: <%= ENV['DATABASE_HOST'] || 'localhost' %> development: <<: *default diff --git a/package.json b/package.json index 7129c8592..927b38563 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "babel-loader": "^9.1.2", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "bower": "1.8.8", - "react-dropzone": "^14.3.8", "clone-deep": "^4.0.1", "compression-webpack-plugin": "^10.0.0", "core-js": "^3.19", @@ -46,6 +45,7 @@ "prop-types": "^15.7.2", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-dropzone": "^14.3.8", "react-gtm-module": "^2.0.11", "react-helmet-async": "^1.3.0", "react-hook-form": "^6.15.5", @@ -104,6 +104,7 @@ "coffee-script": "1.12.7", "coffeelint": "^2.1.0", "concurrently": "^8.0.1", + "cross-env": "^10.1.0", "cucumber": "^2.3.1", "cypress": "13.6.3", "eslint": "9.37.0", @@ -149,22 +150,22 @@ "scripts": { "postinstall": "bower install", "protractor": "protractor ./spec/e2e/conf.js", - "test": "TZ='UTC' NODE_OPTIONS=\"--max-old-space-size=4096\" jest --coverage --maxWorkers=2", - "test:inspect": "TZ='UTC' NODE_OPTIONS=\"--inspect --max-old-space-size=4096\" INSPECT_MODE=true jest --runInBand --logHeapUsage 2>&1 | tee jestInspectOutput.txt", + "test": "cross-env TZ=UTC NODE_OPTIONS=\"--max-old-space-size=4096\" jest --coverage --maxWorkers=2", + "test:inspect": "cross-env TZ=UTC NODE_OPTIONS=\"--inspect --max-old-space-size=4096\" INSPECT_MODE=true jest --runInBand --logHeapUsage 2>&1 | tee jestInspectOutput.txt", "test:e2e": "cypress run --browser chrome", "test:e2e:open": "cypress open --browser chrome", "lint": "eslint", "lint:c": "eslint --cache", "lint:fix": "eslint --fix", "lint:config": "eslint --insepct-config", - "lint:benchmark": "TIMING=all eslint --stats", + "lint:benchmark": "cross-env TIMING=all eslint --stats", "format": "prettier --write .", "webpack:analyze": "yarn webpack:build_json && yarn webpack:analyze_json", - "webpack:build_json": "RAILS_ENV=${RAILS_ENV:-production} NODE_ENV=${NODE_ENV:-production} bin/webpack --profile --json > tmp/webpack-stats.json", + "webpack:build_json": "cross-env RAILS_ENV=${RAILS_ENV:-production} NODE_ENV=${NODE_ENV:-production} bin/webpack --profile --json > tmp/webpack-stats.json", "webpack:analyze_json": "webpack-bundle-analyzer tmp/webpack-stats.json public/packs", - "start": "concurrently --names \"SERVER,CLIENT\" -c \"bgBlue.bold,bgMagenta.bold\" \"bundle exec rails s -p 3000\" \"NODE_OPTIONS=\"\" ./bin/shakapacker-dev-server\"", + "start": "concurrently --names \"SERVER,CLIENT\" -c \"bgBlue.bold,bgMagenta.bold\" \"yarn server\" \"yarn client\"", "server": "bundle exec rails s -p 3000", - "client": "./bin/shakapacker-dev-server", + "client": "cross-env NODE_OPTIONS= ./bin/shakapacker-dev-server", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" }, diff --git a/yarn.lock b/yarn.lock index 560176237..a558a3e5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1383,6 +1383,11 @@ dependencies: tslib "^2.4.0" +"@epic-web/invariant@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@epic-web/invariant/-/invariant-1.0.0.tgz#1073e5dee6dd540410784990eb73e4acd25c9813" + integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA== + "@esbuild/aix-ppc64@0.25.12": version "0.25.12" resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c" @@ -5250,6 +5255,14 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" +cross-env@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-10.1.0.tgz#cfd2a6200df9ed75bfb9cb3d7ce609c13ea21783" + integrity sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw== + dependencies: + "@epic-web/invariant" "^1.0.0" + cross-spawn "^7.0.6" + cross-spawn@^6.0.0: version "6.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57"