From ee087f9effe7b5133cf0033f7160a61995307b71 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 13 Jan 2026 10:29:00 +1100 Subject: [PATCH] Change spelling to Shakapacker --- Procfile | 2 +- Procfile.docker | 4 +-- bin/shakapacker | 13 +++++++++ bin/shakapacker-dev-server | 13 +++++++++ bin/webpacker | 14 ---------- bin/webpacker-dev-server | 17 ------------ compose.yaml | 10 +++---- config/ci_shakapacker.yml | 34 +++++++++++++++++++++++ config/{webpacker.yml => shakapacker.yml} | 2 -- 9 files changed, 68 insertions(+), 41 deletions(-) create mode 100755 bin/shakapacker create mode 100755 bin/shakapacker-dev-server delete mode 100755 bin/webpacker delete mode 100755 bin/webpacker-dev-server create mode 100644 config/ci_shakapacker.yml rename config/{webpacker.yml => shakapacker.yml} (98%) diff --git a/Procfile b/Procfile index c8f01d2a22..ef7489e2af 100644 --- a/Procfile +++ b/Procfile @@ -1,5 +1,5 @@ # Foreman Procfile. Start all dev server processes with: `foreman start` rails: DEV_CACHING=true bundle exec rails s -p 3000 -webpack: ./bin/webpacker-dev-server +webpack: ./bin/shakacker-dev-server sidekiq: DEV_CACHING=true bundle exec sidekiq -q mailers -q default diff --git a/Procfile.docker b/Procfile.docker index 08270a03a6..1e61946ee3 100644 --- a/Procfile.docker +++ b/Procfile.docker @@ -1,5 +1,5 @@ # Foreman Procfile for Docker env. Start all dev server processes with: `bundle exec foreman start -f Procfile.docker` -webpack: WEBPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/webpacker-dev-server +webpack: SHAKAPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/shakapacker-dev-server sidekiq: DEV_CACHING=true bundle exec sidekiq -q mailers -q default -rails: WEBPACKER_DEV_SERVER_HOST=0.0.0.0 DEV_CACHING=true bundle exec rails s -p 3000 -b 0.0.0.0 +rails: SHAKAPACKER_DEV_SERVER_HOST=0.0.0.0 DEV_CACHING=true bundle exec rails s -p 3000 -b 0.0.0.0 diff --git a/bin/shakapacker b/bin/shakapacker new file mode 100755 index 0000000000..13a008dcfe --- /dev/null +++ b/bin/shakapacker @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + +ENV["RAILS_ENV"] ||= "development" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) + +require "bundler/setup" +require "shakapacker" +require "shakapacker/webpack_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Shakapacker::WebpackRunner.run(ARGV) +end diff --git a/bin/shakapacker-dev-server b/bin/shakapacker-dev-server new file mode 100755 index 0000000000..5ae8897989 --- /dev/null +++ b/bin/shakapacker-dev-server @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + +ENV["RAILS_ENV"] ||= "development" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) + +require "bundler/setup" +require "shakapacker" +require "shakapacker/dev_server_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Shakapacker::DevServerRunner.run(ARGV) +end diff --git a/bin/webpacker b/bin/webpacker deleted file mode 100755 index 8a952955e9..0000000000 --- a/bin/webpacker +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -require "pathname" -require "bundler/setup" -require "webpacker" -require "webpacker/webpack_runner" - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath) - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::WebpackRunner.run(ARGV) -end diff --git a/bin/webpacker-dev-server b/bin/webpacker-dev-server deleted file mode 100755 index e921e0e53e..0000000000 --- a/bin/webpacker-dev-server +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "bundler/setup" - -require "webpacker" -require "webpacker/dev_server_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::DevServerRunner.run(ARGV) -end diff --git a/compose.yaml b/compose.yaml index b02b0077e1..b879e2be72 100644 --- a/compose.yaml +++ b/compose.yaml @@ -53,9 +53,9 @@ services: OFN_REDIS_URL: redis://redis/ OFN_REDIS_JOBS_URL: redis://redis OFN_REDIS_TEST_URL: redis://redis/3 - WEBPACKER_DEV_SERVER_HOST: webpack - WEBPACKER_DEV_SERVER_PORT: 3035 - WEBPACKER_DEV_SERVER_PUBLIC: localhost:3035 + SHAKAPACKER_DEV_SERVER_HOST: webpack + SHAKAPACKER_DEV_SERVER_PORT: 3035 + SHAKAPACKER_DEV_SERVER_PUBLIC: localhost:3035 command: > sh -lc 'rm -f tmp/pids/server.pid; @@ -89,7 +89,7 @@ services: build: . command: > sh -lc 'until [ -f /bundles/.Gemfile.lock.sha ] && sha256sum -c /bundles/.Gemfile.lock.sha >/dev/null 2>&1; do sleep 0.5; done; - exec ./bin/webpacker-dev-server' + exec ./bin/shakapacker-dev-server' ports: - "3035:3035" volumes: @@ -102,7 +102,7 @@ services: retries: 30 environment: - WEBPACKER_DEV_SERVER_HOST: 0.0.0.0 + SHAKAPACKER_DEV_SERVER_HOST: 0.0.0.0 volumes: gems: postgres: diff --git a/config/ci_shakapacker.yml b/config/ci_shakapacker.yml new file mode 100644 index 0000000000..425e975f13 --- /dev/null +++ b/config/ci_shakapacker.yml @@ -0,0 +1,34 @@ +# Note: You must restart bin/webpack-dev-server for changes to take effect + +default: &default + source_path: app/webpacker + source_entry_path: packs + public_root_path: public + public_output_path: packs + cache_path: tmp/cache/webpacker + webpack_compile_output: true + + # Additional paths webpack should look up modules + # ['app/assets', 'engine/foo/app/assets'] + additional_paths: [ + 'vendor', + 'app/webpacker/css', + 'app/webpacker/fonts', + 'app/webpacker/images', + 'engines/web/app/assets/stylesheets', + 'app/components' + ] + + # Reload manifest.json on all requests so we reload latest compiled packs + cache_manifest: false + + # Extract and emit a css file + extract_css: true + +test: + <<: *default + # Asset are precomiled on CI, so no need to compile here + compile: false + + # Compile test packs to a separate directory + public_output_path: packs-test diff --git a/config/webpacker.yml b/config/shakapacker.yml similarity index 98% rename from config/webpacker.yml rename to config/shakapacker.yml index 565596797b..2fba7f9380 100644 --- a/config/webpacker.yml +++ b/config/shakapacker.yml @@ -51,8 +51,6 @@ development: compress: true # Note that apps that do not check the host are vulnerable to DNS rebinding attacks allowed_hosts: "all" - #TODO Old config - #pretty: false pretty: true headers: 'Access-Control-Allow-Origin': '*'