Skip to content

Commit

Permalink
Merge pull request #7 from CodiTramuntana/migrate-from-sprockets-to-w…
Browse files Browse the repository at this point in the history
…ebpacker

Migrate from sprockets to webpacker
  • Loading branch information
laurajaime authored Jun 27, 2022
2 parents c490c5f + e86b919 commit b372e31
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 4 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog
Current version is defined at `lib/decidim/verify_wo_registration/version.rb`

## Version 0.0.2
*Migrate Sprockets to Webpacker to fit the 0.25 version of decidim
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://rubygems.org'

ruby RUBY_VERSION

DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim', branch: 'develop' }.freeze
DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim', branch: "release/0.25-stable" }.freeze
gem 'decidim-budgets', DECIDIM_VERSION
gem 'decidim-core', DECIDIM_VERSION
gem 'decidim-proposals', DECIDIM_VERSION
Expand Down
Empty file.
40 changes: 40 additions & 0 deletions lib/decidim/verify_wo_registration/config/assets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true
# This file is located at `config/assets.rb` of your module.

# Define the base path of your module. Please note that `Rails.root` may not be
# used because we are not inside the Rails environment when this file is loaded.
base_path = File.expand_path("..", __dir__)

# Register an additional load path for webpack. All the assets within these
# directories will be available for inclusion within the Decidim assets. For
# example, if you have `app/packs/src/decidim/foo.js`, you can include that file
# in your JavaScript entrypoints (or other JavaScript files within Decidim)
# using `import "src/decidim/foo"` after you have registered the additional path
# as follows.
Decidim::Webpacker.register_path("#{base_path}/app/packs")

# Register the entrypoints for your module. These entrypoints can be included
# within your application using `javascript_pack_tag` and if you include any
# SCSS files within the entrypoints, they become available for inclusion using
# `stylesheet_pack_tag`.
#Decidim::Webpacker.register_entrypoints(
# decidim_foo: "#{base_path}/app/packs/entrypoints/decidim_foo.js",
# decidim_foo_admin: "#{base_path}/app/packs/entrypoints/decidim_foo_admin.js"
#)

# If you want to import some extra SCSS files in the Decidim main SCSS file
# without adding any extra stylesheet inclusion tags, you can use the following
# method to register the stylesheet import for the main application.
#Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/verify_wo_registration/engine")

# If you want to do the same but include the SCSS file for the admin panel's
# main SCSS file, you can use the following method.
#Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/verify_wo_registration/admin_engine", group: :admin)

# If you want to override some SCSS variables/settings for Foundation from the
# module, you can add the following registered import.
#Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/foo/settings", type: :settings)

# If you want to do the same but override the SCSS variables of the admin
# panel's styles, you can use the following method.
#Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/foo/admin_settings", type: :settings, group: :admin)
4 changes: 2 additions & 2 deletions lib/decidim/verify_wo_registration/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Engine < ::Rails::Engine
end
end

initializer 'decidim_verify_wo_registration.assets' do |app|
app.config.assets.precompile += %w[decidim_verify_wo_registration_manifest.js decidim_verify_wo_registration_manifest.css]
initializer "decidim_verify_wo_registration.webpacker.assets_path" do
Decidim.register_assets_path File.expand_path("app/packs", root)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/decidim/verify_wo_registration/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Decidim
# This holds the decidim-meetings version.
module VerifyWoRegistration
def self.version
'0.0.1'
'0.0.2'
end
end
end

0 comments on commit b372e31

Please sign in to comment.