-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2424 from tvdeyen/remove-webpacker
Remove webpacker
- Loading branch information
Showing
19 changed files
with
180 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require "thor" | ||
|
||
module Alchemy | ||
class Upgrader::SevenPointZero < Upgrader | ||
include Thor::Base | ||
include Thor::Actions | ||
|
||
class << self | ||
def update_admin_entrypoint | ||
if File.exist? "app/javascript/packs/alchemy/admin.js" | ||
FileUtils.mv "app/javascript/packs/alchemy/admin.js", "app/javascript/alchemy_admin.js" | ||
else | ||
log "Skipping. No alchemy/admin entrypoint found. Maybe already migrated from Webpacker?", :info | ||
end | ||
if Dir.exist?("app/javascript/packs/alchemy") && Dir.empty?("app/javascript/packs/alchemy") | ||
FileUtils.rm_r "app/javascript/packs/alchemy" | ||
end | ||
if File.exist? "config/importmap.rb" | ||
# We want the bundled package if using importmaps | ||
task.gsub_file "app/javascript/alchemy_admin.js", 'import "@alchemy_cms/admin"', 'import "@alchemy_cms/dist/admin"' | ||
end | ||
if task.ask("Do you want to remove webpacker now? (y/N)", default: "N") == "y" | ||
task.run "yarn remove @rails/webpacker webpack webpack-cli webpack-dev-server" | ||
FileUtils.rm_r "app/javascript/packs" | ||
FileUtils.rm_r "config/webpack" | ||
FileUtils.rm "config/webpacker.yml" | ||
FileUtils.rm "bin/webpack" | ||
FileUtils.rm "bin/webpack-dev-server" | ||
end | ||
if task.ask("Do you want to add jsbundling-rails now? (Y/n)", default: "Y") == "Y" | ||
task.run "bundle add jsbundling-rails" | ||
task.run "bin/rails javascript:install:esbuild" | ||
end | ||
end | ||
|
||
private | ||
|
||
def task | ||
@_task || new | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: unset PORT && bin/rails server | ||
js: yarn build --watch |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
// | ||
//= link application.css | ||
//= link application.js | ||
//= link_tree ../builds |
Oops, something went wrong.