decidim-generators 0.28.5 → 0.29.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.version = Decidim::Generators.version
10
10
  s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
11
11
  s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
12
- s.license = "AGPL-3.0-or-later"
12
+ s.license = "AGPL-3.0"
13
13
  s.homepage = "https://decidim.org"
14
14
  s.metadata = {
15
15
  "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  "homepage_uri" => "https://decidim.org",
19
19
  "source_code_uri" => "https://github.com/decidim/decidim"
20
20
  }
21
- s.required_ruby_version = "~> 3.1.0"
21
+ s.required_ruby_version = "~> 3.2.0"
22
22
 
23
23
  s.name = "decidim-generators"
24
24
 
data/exe/decidim CHANGED
@@ -31,8 +31,8 @@ Options:
31
31
  [name] creates an application based on Decidim
32
32
 
33
33
  App generation extra options (ignored if the --component flag is on):
34
- --storage [provider] Setup the Gemfile with the appropiate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure
35
- --queue [provider] Setup the Gemfile with the appropiate gem to handle a job queue backend. Only 'sidekiq' is supported as option for now.
34
+ --storage [provider] Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure
35
+ --queue [provider] Setup the Gemfile with the appropriate gem to handle a job queue backend. Only 'sidekiq' is supported as option for now.
36
36
  --force_ssl [true|false] Enables or disables mandatory redirection to HTTPS (defaults to enabled)
37
37
  --locales [locales] Force the available locales to the ones specified. Separate with comas
38
38
  Warning: this option disables the ENV var DECIDIM_AVAILABLE_LOCALES used to setup this configuration by default.
@@ -79,11 +79,11 @@ module Decidim
79
79
 
80
80
  class_option :storage, type: :string,
81
81
  default: "local",
82
- desc: "Setup the Gemfile with the appropiate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure"
82
+ desc: "Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs, azure"
83
83
 
84
84
  class_option :queue, type: :string,
85
85
  default: "",
86
- desc: "Setup the Gemfile with the appropiate gem to handle a queue adapter provider. Supported options are: (empty, does nothing) and sidekiq"
86
+ desc: "Setup the Gemfile with the appropriate gem to handle a queue adapter provider. Supported options are: (empty, does nothing) and sidekiq"
87
87
 
88
88
  class_option :skip_webpack_install, type: :boolean,
89
89
  default: true,
@@ -98,6 +98,28 @@ module Decidim
98
98
  []
99
99
  end
100
100
 
101
+ def remove_old_assets
102
+ remove_file "config/initializers/assets.rb"
103
+ remove_dir("app/assets")
104
+ remove_dir("app/javascript")
105
+ end
106
+
107
+ def remove_sprockets_requirement
108
+ gsub_file "config/application.rb", %r{require ['"]rails/all['"]\R}, <<~RUBY
109
+ require "decidim/rails"
110
+
111
+ # Add the frameworks used by your app that are not loaded by Decidim.
112
+ # require "action_mailbox/engine"
113
+ # require "action_text/engine"
114
+ require "action_cable/engine"
115
+ require "rails/test_unit/railtie"
116
+ RUBY
117
+
118
+ gsub_file "config/environments/development.rb", /config\.assets.*$/, ""
119
+ gsub_file "config/environments/test.rb", /config\.assets.*$/, ""
120
+ gsub_file "config/environments/production.rb", /config\.assets.*$/, ""
121
+ end
122
+
101
123
  def database_yml
102
124
  template "database.yml.erb", "config/database.yml", force: true
103
125
  end
@@ -159,7 +181,7 @@ module Decidim
159
181
 
160
182
  gsub_file "Gemfile", /gem "decidim-dev".*/, "gem \"decidim-dev\", #{gem_modifier}"
161
183
 
162
- %w(conferences design elections initiatives templates).each do |component|
184
+ %w(conferences design initiatives templates).each do |component|
163
185
  if options[:demo]
164
186
  gsub_file "Gemfile", /gem "decidim-#{component}".*/, "gem \"decidim-#{component}\", #{gem_modifier}"
165
187
  else
@@ -223,10 +245,10 @@ module Decidim
223
245
  end
224
246
  end
225
247
 
226
- def tweak_spring
227
- return unless File.exist?("config/spring.rb")
228
-
229
- prepend_to_file "config/spring.rb", "require \"decidim/spring\"\n\n"
248
+ def load_defaults_rails61
249
+ gsub_file "config/application.rb",
250
+ /config.load_defaults 7.0/,
251
+ "config.load_defaults 6.1"
230
252
  end
231
253
 
232
254
  def tweak_csp_initializer
@@ -299,7 +321,7 @@ module Decidim
299
321
  "config.log_level = %w(debug info warn error fatal).include?(ENV['RAILS_LOG_LEVEL']) ? ENV['RAILS_LOG_LEVEL'] : :info"
300
322
 
301
323
  gsub_file "config/environments/production.rb",
302
- %r{# config.asset_host = 'http://assets.example.com'},
324
+ %r{# config.asset_host = "http://assets.example.com"},
303
325
  "config.asset_host = ENV['RAILS_ASSET_HOST'] if ENV['RAILS_ASSET_HOST'].present?"
304
326
 
305
327
  if options[:force_ssl] == "false"
@@ -335,6 +357,11 @@ module Decidim
335
357
  end
336
358
  end
337
359
  CONFIG
360
+
361
+ if ENV.fetch("RAILS_BOOST_PERFORMANCE", false).to_s == "true"
362
+ gsub_file "Gemfile", /gem "spring".*/, "# gem \"spring\""
363
+ gsub_file "Gemfile", /gem "spring-watcher-listen".*/, "# gem \"spring-watcher-listen\""
364
+ end
338
365
  end
339
366
 
340
367
  def authorization_handler
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.2.2
@@ -9,7 +9,7 @@ This is the open-source repository for <%= app_name %>, based on [Decidim](https
9
9
  You will need to do some steps before having the app working properly once you have deployed it:
10
10
 
11
11
  1. Create a System Admin user: `bin/rails decidim_system:create_admin`
12
- 1. Visit `<your app url>/system` and login with your system admin credentials
12
+ 1. Visit `<your app url>/system` and log in with your system admin credentials
13
13
  1. Create a new organization. Check the locales you want to use for that organization, and select a default locale.
14
14
  1. Set the correct default host for the organization, otherwise the app will not work properly. Note that you need to include any subdomain you might be using.
15
15
  1. Fill the rest of the form and submit it.
@@ -5,6 +5,8 @@ if defined?(Bullet) && !Rails.application.config.try(:boost_performance)
5
5
  Bullet.enable = true
6
6
  Bullet.bullet_logger = true
7
7
  Bullet.rails_logger = true
8
+ Bullet.add_footer = true
9
+ Bullet.skip_user_in_notification = true
8
10
  Bullet.stacktrace_includes = %w(decidim-)
9
11
  end
10
12
  end
@@ -11,7 +11,7 @@ services:
11
11
  - ETHERPAD_ADMIN_PASSWORD=CHANGE_ME_ADMIN_PASSWORD
12
12
  # If the admin password is set, this defaults to "admin". Otherwise the user can set it to another username.
13
13
  - ETHERPAD_ADMIN_USER=CHANGE_ME_ADMIN_USER
14
- # Type of databse to use. Defaults to mysql.
14
+ # Type of database to use. Defaults to mysql.
15
15
  - ETHERPAD_DB_TYPE=mysql
16
16
  # Hostname of the database to use. Defaults to mysql.
17
17
  - ETHERPAD_DB_HOST=mysql
@@ -27,7 +27,7 @@ services:
27
27
  - ETHERPAD_API_KEY=CHANGE_ME_API_KEY
28
28
  # You can skip this if you are not using any proxy to handle SSL certificates.
29
29
  - "TRUST_PROXY=true"
30
- # Ensure this etherpad allows cookies while embeded in an Iframe
30
+ # Ensure this etherpad allows cookies while embedded in an Iframe
31
31
  - "COOKIE_SAME_SITE=None"
32
32
  # Official image is etherpad/etherpad but the latest version does not allow yet setting cookies to SameSite=None
33
33
  image: 'platoniq/etherpad:1.8.7'
@@ -236,7 +236,7 @@ Decidim.configure do |config|
236
236
  #
237
237
  # Provide a class to generate a timestamp for a document. The instances of
238
238
  # this class are initialized with a hash containing the :document key with
239
- # the document to be timestamped as value. The istances respond to a
239
+ # the document to be timestamped as value. The instances respond to a
240
240
  # timestamp public method with the timestamp
241
241
  #
242
242
  # An example class would be something like:
@@ -320,7 +320,7 @@ Decidim.configure do |config|
320
320
  # to interact with third party service to translate the user content.
321
321
  #
322
322
  # If you still want to use "Decidim::Dev::DummyTranslator" as translator placeholder,
323
- # add the follwing line at the beginning of this file:
323
+ # add the following line at the beginning of this file:
324
324
  # require "decidim/dev/dummy_translator"
325
325
  #
326
326
  # An example class would be something like:
@@ -393,8 +393,6 @@ Decidim.configure do |config|
393
393
 
394
394
  # Additional optional configurations (see decidim-core/lib/decidim/core.rb)
395
395
  config.cache_key_separator = Rails.application.secrets.decidim[:cache_key_separator] if Rails.application.secrets.decidim[:cache_key_separator].present?
396
- config.cache_expiry_time = Rails.application.secrets.decidim[:cache_expiry_time].to_i.minutes if Rails.application.secrets.decidim[:cache_expiry_time].present?
397
- config.stats_cache_expiry_time = Rails.application.secrets.decidim[:stats_cache_expiry_time].to_i.minutes if Rails.application.secrets.decidim[:stats_cache_expiry_time].present?
398
396
  config.expire_session_after = Rails.application.secrets.decidim[:expire_session_after].to_i.minutes if Rails.application.secrets.decidim[:expire_session_after].present?
399
397
  config.enable_remember_me = Rails.application.secrets.decidim[:enable_remember_me].present? unless Rails.application.secrets.decidim[:enable_remember_me] == "auto"
400
398
  if Rails.application.secrets.decidim[:session_timeout_interval].present?
@@ -417,8 +415,6 @@ end
417
415
 
418
416
  if Decidim.module_installed? :proposals
419
417
  Decidim::Proposals.configure do |config|
420
- config.similarity_threshold = Rails.application.secrets.dig(:decidim, :proposals, :similarity_threshold).presence || 0.25
421
- config.similarity_limit = Rails.application.secrets.dig(:decidim, :proposals, :similarity_limit).presence || 10
422
418
  config.participatory_space_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :participatory_space_highlighted_proposals_limit).presence || 4
423
419
  config.process_group_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :process_group_highlighted_proposals_limit).presence || 3
424
420
  end
@@ -457,8 +453,6 @@ if Decidim.module_installed? :initiatives
457
453
  unless Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled) == "auto"
458
454
  config.creation_enabled = Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled).present?
459
455
  end
460
- config.similarity_threshold = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_threshold).presence || 0.25
461
- config.similarity_limit = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_limit).presence || 5
462
456
  config.minimum_committee_members = Rails.application.secrets.dig(:decidim, :initiatives, :minimum_committee_members).presence || 2
463
457
  config.default_signature_time_period_length = Rails.application.secrets.dig(:decidim, :initiatives, :default_signature_time_period_length).presence || 120
464
458
  config.default_components = Rails.application.secrets.dig(:decidim, :initiatives, :default_components)
@@ -473,24 +467,6 @@ if Decidim.module_installed? :initiatives
473
467
  end
474
468
  end
475
469
 
476
- if Decidim.module_installed? :elections
477
- Decidim::Elections.configure do |config|
478
- config.setup_minimum_hours_before_start = Rails.application.secrets.dig(:elections, :setup_minimum_hours_before_start).presence || 1
479
- config.start_vote_maximum_hours_before_start = Rails.application.secrets.dig(:elections, :start_vote_maximum_hours_before_start).presence || 6
480
- config.voter_token_expiration_minutes = Rails.application.secrets.dig(:elections, :voter_token_expiration_minutes).presence || 120
481
- config.document_types = Rails.application.secrets.dig(:elections, :document_types).presence || %w(identification_number passport)
482
- end
483
-
484
- Decidim::Votings.configure do |config|
485
- config.check_census_max_requests = Rails.application.secrets.dig(:elections, :votings, :check_census_max_requests).presence || 5
486
- config.throttling_period = Rails.application.secrets.dig(:elections, :votings, :throttling_period).to_i.minutes
487
- end
488
-
489
- Decidim::Votings::Census.configure do |config|
490
- config.census_access_codes_export_expiry_time = Rails.application.secrets.dig(:elections, :votings, :census, :access_codes_export_expiry_time).to_i.days
491
- end
492
- end
493
-
494
470
  Rails.application.config.i18n.available_locales = Decidim.available_locales
495
471
  Rails.application.config.i18n.default_locale = Decidim.default_locale
496
472
 
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "decidim-development-app",
3
+ "private": true,
4
+ "dependencies": {
5
+ "@decidim/browserslist-config": "file:packages/browserslist-config",
6
+ "@decidim/core": "file:packages/core",
7
+ "@decidim/webpacker": "file:packages/webpacker"
8
+ },
9
+ "version": "0.1.0",
10
+ "devDependencies": {
11
+ "@decidim/dev": "file:packages/dev",
12
+ "@decidim/eslint-config": "file:packages/eslint-config",
13
+ "@decidim/prettier-config": "file:packages/prettier-config",
14
+ "@decidim/stylelint-config": "file:packages/stylelint-config"
15
+ },
16
+ "browserslist": [
17
+ "extends @decidim/browserslist-config"
18
+ ]
19
+ }
@@ -6,4 +6,5 @@ if Rails.env.development? && !Rails.application.config.try(:boost_performance)
6
6
  # initialization is skipped so trigger it
7
7
  Rack::MiniProfilerRails.initialize!(Rails.application)
8
8
  Rack::MiniProfiler.config.skip_paths << "/favicon.ico"
9
+ Rack::MiniProfiler.config.position = "bottom-left"
9
10
  end
@@ -33,8 +33,6 @@ decidim_default: &decidim_default
33
33
  default_csv_col_sep: <%%= Decidim::Env.new("DECIDIM_DEFAULT_CSV_COL_SEP", ";").to_json %>
34
34
  consent_cookie_name: <%%= Decidim::Env.new("DECIDIM_CONSENT_COOKIE_NAME", "decidim-consent").to_json %>
35
35
  cache_key_separator: <%%= Decidim::Env.new("DECIDIM_CACHE_KEY_SEPARATOR", "/").to_json %>
36
- cache_expiry_time: <%%= Decidim::Env.new("DECIDIM_CACHE_EXPIRATION_TIME", "1440").to_i %>
37
- stats_cache_expiry_time: <%%= Decidim::Env.new("DECIDIM_STATS_CACHE_EXPIRATION_TIME", 10).to_i %>
38
36
  expire_session_after: <%%= Decidim::Env.new("DECIDIM_EXPIRE_SESSION_AFTER", "30").to_i %>
39
37
  session_timeout_interval: <%%= Decidim::Env.new("DECIDIM_SESSION_TIMEOUT_INTERVAL", "10").to_i %>
40
38
  enable_remember_me: <%%= Decidim::Env.new("DECIDIM_ENABLE_REMEMBER_ME", "auto").default_or_present_if_exists.to_s %>
@@ -56,8 +54,6 @@ decidim_default: &decidim_default
56
54
  schema_max_complexity: <%%= Decidim::Env.new("API_SCHEMA_MAX_COMPLEXITY", 5000).to_i %>
57
55
  schema_max_depth: <%%= Decidim::Env.new("API_SCHEMA_MAX_DEPTH", 15).to_i %>
58
56
  proposals:
59
- similarity_threshold: <%%= Decidim::Env.new("PROPOSALS_SIMILARITY_THRESHOLD", 0.25).to_f %>
60
- similarity_limit: <%%= Decidim::Env.new("PROPOSALS_SIMILARITY_LIMIT", 10).to_i %>
61
57
  participatory_space_highlighted_proposals_limit: <%%= Decidim::Env.new("PROPOSALS_PARTICIPATORY_SPACE_HIGHLIGHTED_PROPOSALS_LIMIT", 4).to_i %>
62
58
  process_group_highlighted_proposals_limit: <%%= Decidim::Env.new("PROPOSALS_PROCESS_GROUP_HIGHLIGHTED_PROPOSALS_LIMIT", 3).to_i %>
63
59
  meetings:
@@ -70,8 +66,6 @@ decidim_default: &decidim_default
70
66
  enable_proposal_linking: <%%= Decidim::Env.new("ACCOUNTABILITY_ENABLE_PROPOSAL_LINKING", "auto").default_or_present_if_exists.to_s %>
71
67
  initiatives:
72
68
  creation_enabled: <%%= Decidim::Env.new("INITIATIVES_CREATION_ENABLED", "auto").default_or_present_if_exists.to_s %>
73
- similarity_threshold: <%%= Decidim::Env.new("INITIATIVES_SIMILARITY_THRESHOLD", 0.25).to_f %>
74
- similarity_limit: <%%= Decidim::Env.new("INITIATIVES_SIMILARITY_LIMIT", 5).to_i %>
75
69
  minimum_committee_members: <%%= Decidim::Env.new("INITIATIVES_MINIMUM_COMMITTEE_MEMBERS", 2).to_i %>
76
70
  default_signature_time_period_length: <%%= Decidim::Env.new("INITIATIVES_DEFAULT_SIGNATURE_TIME_PERIOD_LENGTH", 120).to_i %>
77
71
  default_components: <%%= Decidim::Env.new("INITIATIVES_DEFAULT_COMPONENTS", "pages, meetings").to_array.to_json %>
@@ -84,18 +78,6 @@ decidim_default: &decidim_default
84
78
  verifications:
85
79
  document_types: <%%= Decidim::Env.new("VERIFICATIONS_DOCUMENT_TYPES", "identification_number,passport").to_array %>
86
80
 
87
- elections_default: &elections_default
88
- bulletin_board_server: <%%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:8000/api').to_s %>
89
- bulletin_board_public_key: {"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3S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7z5XBCmAy3nLem9sbb_5wv0hMpPH0VRvbnZeBO3SBIkO0lddYCqU-8wN9HqkyoexQleSUnAm1O0iy4GIHT2aEmdNaRaKy2EhmNiTZdZeseZueOvyGPtTVONp2ofacMdcN0z39jr22qo9DWtdusd7nVPOpqkllEF6GrGUeHBnGD92n4YjDuxRnqefu8fXxUFrcLav0p8CNSv9ek291woQ","qi":"w6hfKEBLLHRWPkjajgxZyyetj-UFfVkILRT0plOllJ2JV8whcOXRXbiXH2r8zqMeyMFrrMwmuvv4TVQaruKB0ZQOG7Tz5Lw0RZEREOLnBwc3vSi_iLd-jBz01LdExTpqsAHMkaMQR9x62J8DE1ZNxVdn3ELYKik0f1L2r_WErzhvT1uq69HAybUp6WHcFYH0PSqHg4LOneXAdU1_g-ji2Zn9dlA_2oYGQ5S6JXPV7v2IVbEFpxyVD1lPbFT0iKhyZZevictjgD_JGHveIVqsq5w0Csyz08h0oEW9hYEq-4bquMxSf18gjldoS5uQPD7FUECgL8bxsCdc4hP6UEKYGw"}
91
- authority_name: "Decidim Test Authority"
92
- authority_api_key: "89Ht70GZNcicu8WEyagz_rRae6brbqZAGuBEICYBCii-PTV3MAstAtx1aRVe5H5YfODi-JgYPvyf9ZMH7tOeZ15e3mf9B2Ymgw7eknvBFMRP213YFGo1SPn_C4uLK90G"
93
- scheme_name: "dummy"
94
- quorum: 2
95
- number_of_trustees: 3
96
- setup_minimum_hours_before_start: 1
97
- document_types: <%%= Decidim::Env.new("ELECTIONS_DOCUMENT_TYPES", "identification_number,passport").to_array.to_json %>
98
-
99
81
  storage_default: &storage_default
100
82
  provider: <%%= Decidim::Env.new("STORAGE_PROVIDER", "local").to_s %>
101
83
  cdn_host: <%%= ENV["STORAGE_CDN_HOST"] %>
@@ -156,8 +138,6 @@ default: &default
156
138
  server: <%%= ENV["ETHERPAD_SERVER"] %>
157
139
  api_key: <%%= ENV["ETHERPAD_API_KEY"] %>
158
140
  api_version: <%%= Decidim::Env.new("ETHERPAD_API_VERSION", "1.2.1") %>
159
- elections:
160
- <<: *elections_default
161
141
  storage:
162
142
  <<: *storage_default
163
143
  vapid:
@@ -189,12 +169,6 @@ test:
189
169
  enabled: true
190
170
  client_id:
191
171
  client_secret:
192
- test:
193
- enabled: true
194
- icon: tools-line
195
- elections:
196
- <<: *elections_default
197
- bulletin_board_server: <%%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:5017/api').to_s %>
198
172
 
199
173
  # Do not keep production secrets in the repository,
200
174
  # instead read values from the environment.
@@ -208,21 +182,3 @@ production:
208
182
  smtp_port: <%%= Decidim::Env.new("SMTP_PORT", 587).to_i %>
209
183
  smtp_starttls_auto: <%%= Decidim::Env.new("SMTP_STARTTLS_AUTO").to_boolean_string %>
210
184
  smtp_authentication: <%%= Decidim::Env.new("SMTP_AUTHENTICATION", "plain").to_s %>
211
- elections:
212
- bulletin_board_server: <%%= ENV["BULLETIN_BOARD_SERVER"] %>
213
- bulletin_board_public_key: <%%= ENV["BULLETIN_BOARD_PUBLIC_KEY"] %>
214
- authority_api_key: <%%= ENV["BULLETIN_BOARD_API_KEY"] %>
215
- authority_name: <%%= ENV["AUTHORITY_NAME"] %>
216
- authority_private_key: <%%= ENV["AUTHORITY_PRIVATE_KEY"] %>
217
- scheme_name: <%%= Decidim::Env.new("ELECTIONS_SCHEME_NAME", "electionguard").to_s %>
218
- number_of_trustees: <%%= Decidim::Env.new("ELECTIONS_NUMBER_OF_TRUSTEES").to_i %>
219
- quorum: <%%= Decidim::Env.new("ELECTIONS_QUORUM").to_i %>
220
- setup_minimum_hours_before_start: <%%= Decidim::Env.new("ELECTIONS_SETUP_MINIMUM_HOURS_BEFORE_START", 1).to_i %>
221
- start_vote_maximum_hours_before_start: <%%= Decidim::Env.new("ELECTIONS_START_VOTE_MAXIMUM_HOURS_BEFORE_START", 6).to_i %>
222
- voter_token_expiration_minutes: <%%= Decidim::Env.new("ELECTIONS_VOTER_TOKEN_EXPIRATION_MINUTES", 120).to_i %>
223
- document_types: <%%= Decidim::Env.new("ELECTIONS_DOCUMENT_TYPES", "identification_number,passport").to_array.to_json %>
224
- votings:
225
- check_census_max_requests: <%%= Decidim::Env.new("VOTINGS_CHECK_CENSUS_MAX_REQUESTS", 5).to_i %>
226
- throttling_period: <%%= Decidim::Env.new("VOTINGS_THROTTLING_PERIOD", 1).to_i %>
227
- census:
228
- access_codes_export_expiry_time: <%%= Decidim::Env.new("VOTINGS_CENSUS_ACCESS_CODES_EXPORT_EXPIRY_TIME", 2).to_i %>
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.2.2
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
 
6
6
  ruby RUBY_VERSION
7
7
 
8
- gem "decidim", "~> 0.28.5"
8
+ gem "decidim", "~> 0.29.0.rc1"
9
9
  gem "decidim-<%= component_name %>", path: "."
10
10
 
11
11
  gem "puma", ">= 6.3.1"
@@ -14,12 +14,14 @@ gem "bootsnap", "~> 1.4"
14
14
  group :development, :test do
15
15
  gem "byebug", "~> 11.0", platform: :mri
16
16
 
17
- gem "decidim-dev", "~> 0.28.5"
17
+ gem "decidim-dev", "~> 0.29.0.rc1"
18
18
  end
19
19
 
20
20
  group :development do
21
21
  gem "faker", "~> 3.2"
22
22
  gem "letter_opener_web", "~> 2.0"
23
23
  gem "listen", "~> 3.1"
24
+ gem "spring", "~> 4.0"
25
+ gem "spring-watcher-listen", "~> 2.0"
24
26
  gem "web-console", "~> 4.2"
25
27
  end
@@ -29,7 +29,7 @@ We expect the contributions to follow the [Decidim's contribution guide](https:/
29
29
 
30
30
  ## Security
31
31
 
32
- Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to __<%= security_email %>__ and not by creating a Github issue.
32
+ Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to __<%= security_email %>__ and not by creating a GitHub issue.
33
33
 
34
34
  ## License
35
35
 
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.version = Decidim::<%= component_module_name %>.version
9
9
  s.authors = ["<%= %x[git config user.name].chomp %>"]
10
10
  s.email = ["<%= %x[git config user.email].chomp %>"]
11
- s.license = "AGPL-3.0-or-later"
11
+ s.license = "AGPL-3.0"
12
12
  s.homepage = "https://decidim.org"
13
13
  s.metadata = {
14
14
  "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
@@ -21,7 +21,7 @@ concurrency:
21
21
  jobs:
22
22
  main:
23
23
  name: Tests
24
- runs-on: ubuntu-22.04
24
+ runs-on: ubuntu-latest
25
25
  timeout-minutes: 30
26
26
  services:
27
27
  postgres:
@@ -39,19 +39,19 @@ jobs:
39
39
  DATABASE_PASSWORD: postgres
40
40
  DATABASE_HOST: localhost
41
41
  steps:
42
- - uses: actions/checkout@v3
42
+ - uses: actions/checkout@v4
43
43
  with:
44
44
  fetch-depth: 1
45
45
  - uses: ruby/setup-ruby@v1
46
46
  with:
47
47
  bundler-cache: true
48
- - uses: actions/setup-node@v3
48
+ - uses: actions/setup-node@v4
49
49
  with:
50
50
  node-version: ${{ env.NODE_VERSION }}
51
51
  - name: Get npm cache directory path
52
52
  id: npm-cache-dir-path
53
53
  run: echo "dir=$(npm get cache)-<%= component_name %>" >> $GITHUB_OUTPUT
54
- - uses: actions/cache@v3
54
+ - uses: actions/cache@v4
55
55
  id: npm-cache
56
56
  with:
57
57
  path: ${{ steps.npm-cache-dir-path.outputs.dir }}
@@ -63,12 +63,12 @@ jobs:
63
63
  - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
64
64
  name: Create the screenshots folder
65
65
  - uses: nanasess/setup-chromedriver@v2
66
- - run: RAILS_ENV=test bundle exec rails assets:precompile
66
+ - run: RAILS_ENV=test bundle exec rails shakapacker:compile
67
67
  name: Precompile assets
68
68
  working-directory: ./spec/decidim_dummy_app/
69
69
  - run: bundle exec rspec
70
70
  name: RSpec
71
- - uses: codecov/codecov-action@v3
71
+ - uses: codecov/codecov-action@v4
72
72
  - uses: actions/upload-artifact@v4
73
73
  if: always()
74
74
  with:
@@ -3,7 +3,7 @@
3
3
  "version": "0.0.1",
4
4
  "description": <%= JSON.generate(component_description || "") %>,
5
5
  "private": true,
6
- "license": "AGPL-3.0-or-later",
6
+ "license": "AGPL-3.0",
7
7
  "scripts": {
8
8
  "lint": "eslint -c .eslintrc.json --no-error-on-unmatched-pattern --ignore-pattern app/packs/vendor --ext .js app/packs",
9
9
  "stylelint": "stylelint app/packs/**/*.scss"
@@ -45,10 +45,6 @@ module Decidim
45
45
  RUBY
46
46
  end
47
47
 
48
- def copy_initializer
49
- copy_file "carrierwave.rb", "config/initializers/carrierwave.rb"
50
- end
51
-
52
48
  def secrets
53
49
  template "secrets.yml.erb", "config/secrets.yml", force: true
54
50
  end
@@ -77,6 +73,12 @@ module Decidim
77
73
  end
78
74
  end
79
75
 
76
+ def skip_gemfile_if_defined
77
+ return unless options[:skip_gemfile]
78
+
79
+ remove_file "Gemfile"
80
+ end
81
+
80
82
  def install_decidim_webpacker
81
83
  # Copy CSS file
82
84
  copy_file "decidim_application.scss", "app/packs/stylesheets/decidim/decidim_application.scss"
@@ -94,6 +96,9 @@ module Decidim
94
96
  bundle_install
95
97
  rails "shakapacker:binstubs"
96
98
 
99
+ # Copy package.json
100
+ copy_file "package.json", "package.json"
101
+
97
102
  # Run Decidim custom webpacker installation
98
103
  rails "decidim:webpacker:install"
99
104
 
@@ -109,33 +114,6 @@ module Decidim
109
114
  rails "decidim_api:generate_docs"
110
115
  end
111
116
 
112
- def remove_old_assets
113
- remove_file "config/initializers/assets.rb"
114
- remove_dir("app/assets")
115
- remove_dir("app/javascript")
116
- end
117
-
118
- def remove_sprockets_requirement
119
- gsub_file "config/application.rb", %r{require ['"]rails/all['"]\R}, <<~RUBY
120
- require "decidim/rails"
121
-
122
- # Add the frameworks used by your app that are not loaded by Decidim.
123
- # require "action_mailbox/engine"
124
- # require "action_text/engine"
125
- require "action_cable/engine"
126
- require "rails/test_unit/railtie"
127
- RUBY
128
-
129
- gsub_file "config/environments/development.rb", /config\.assets.*$/, ""
130
- gsub_file "config/environments/test.rb", /config\.assets.*$/, ""
131
- gsub_file "config/environments/production.rb", /config\.assets.*$/, ""
132
- end
133
-
134
- def copy_migrations
135
- rails "decidim:choose_target_plugins", "railties:install:migrations"
136
- recreate_db if options[:recreate_db]
137
- end
138
-
139
117
  def letter_opener_web
140
118
  route <<~RUBY
141
119
  if Rails.env.development?
@@ -173,10 +151,31 @@ module Decidim
173
151
  copy_file "rack_profiler_initializer.rb", "config/initializers/rack_profiler.rb"
174
152
  end
175
153
 
154
+ def tweak_spring
155
+ run "bundle exec spring stop"
156
+ run "bundle exec spring binstub --all"
157
+
158
+ create_file "config/spring.rb", <<~CONFIG
159
+ require "decidim/spring"
160
+
161
+ Spring.watch(
162
+ ".ruby-version",
163
+ ".rbenv-vars",
164
+ "tmp/restart.txt",
165
+ "tmp/caching-dev.txt"
166
+ )
167
+ CONFIG
168
+ end
169
+
176
170
  def bundle_install
177
171
  run "bundle install"
178
172
  end
179
173
 
174
+ def copy_migrations
175
+ rails "decidim:choose_target_plugins", "railties:install:migrations"
176
+ recreate_db if options[:recreate_db]
177
+ end
178
+
180
179
  private
181
180
 
182
181
  def recreate_db
@@ -185,19 +184,21 @@ module Decidim
185
184
 
186
185
  rails "db:migrate"
187
186
 
188
- rails "db:seed" if options[:seed_db]
187
+ rails "assets:precompile"
188
+
189
+ rails "--trace", "db:seed" if options[:seed_db]
189
190
 
190
191
  rails "db:test:prepare"
191
192
  end
192
193
 
193
- # Runs rails commands in a subprocess, and aborts if it does not suceeed
194
- def rails(*args)
195
- abort unless system("bin/rails", *args)
194
+ # Runs rails commands in a subprocess, and aborts if it does not succeed
195
+ def rails(*)
196
+ abort unless system("bin/rails", *)
196
197
  end
197
198
 
198
199
  # Runs rails commands in a subprocess silencing errors, and ignores status
199
- def soft_rails(*args)
200
- system("bin/rails", *args, err: File::NULL)
200
+ def soft_rails(*)
201
+ system("bin/rails", *, err: File::NULL)
201
202
  end
202
203
 
203
204
  def cut(text, strip: true)