Change spelling to Shakapacker

This commit is contained in:
Gaetan Craig-Riou
2026-01-13 10:29:00 +11:00
committed by Rachel Arnould
parent 3152362b9d
commit ee087f9eff
9 changed files with 68 additions and 41 deletions

View File

@@ -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

View File

@@ -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

13
bin/shakapacker Executable file
View File

@@ -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

13
bin/shakapacker-dev-server Executable file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

34
config/ci_shakapacker.yml Normal file
View File

@@ -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

View File

@@ -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': '*'