Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install correct npm package #2204

Merged
merged 2 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/alchemy/upgrader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def copy_new_config_file
todo "Check the default configuration file (./config/alchemy/config.yml.defaults) for new configuration options and insert them into your config file.", "Configuration has changed"
end
end

def update_npm_package
desc "Install new npm package."
`yarn add @alchemy_cms/admin@~#{Alchemy.version}`
tvdeyen marked this conversation as resolved.
Show resolved Hide resolved
log "Installed new npm package."
end
end
end
end
3 changes: 2 additions & 1 deletion lib/generators/alchemy/install/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "rails/generators"
require "alchemy/install/tasks"
require "alchemy/version"

module Alchemy
module Generators
Expand Down Expand Up @@ -88,7 +89,7 @@ def run_webpacker_installer
end

def add_npm_package
run "yarn add @alchemy_cms/admin"
run "yarn add @alchemy_cms/admin@~#{Alchemy.version}"
end

def copy_alchemy_entry_point
Expand Down
6 changes: 6 additions & 0 deletions lib/tasks/alchemy/upgrade.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace :alchemy do
task prepare: [
"alchemy:upgrade:database",
"alchemy:upgrade:config",
"alchemy:upgrade:package",
]

desc "Alchemy Upgrader: Prepares the database."
Expand All @@ -30,6 +31,11 @@ namespace :alchemy do
Alchemy::Upgrader.copy_new_config_file
end

desc "Alchemy Upgrader: Install new Node package."
task package: [:environment] do
Alchemy::Upgrader.update_npm_package
end

desc "Upgrade Alchemy to v5.0"
task "5.0" => [
"alchemy:upgrade:prepare",
Expand Down