decidim 0.25.0.rc1 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim might be problematic. Click here for more details.

Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +27 -2
  3. data/decidim-core/lib/decidim/webpacker/webpacker.yml +13 -16
  4. data/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc +2 -2
  5. data/docs/modules/install/pages/manual.adoc +2 -2
  6. data/lib/decidim/gem_manager.rb +39 -18
  7. data/lib/decidim/version.rb +1 -1
  8. data/package-lock.json +1578 -4459
  9. data/package.json +10 -6
  10. data/packages/browserslist-config/package.json +2 -6
  11. data/packages/core/node_modules/uuid/AUTHORS +5 -0
  12. data/packages/core/node_modules/uuid/CHANGELOG.md +119 -0
  13. data/packages/core/node_modules/uuid/LICENSE.md +21 -0
  14. data/packages/core/node_modules/uuid/README.md +276 -0
  15. data/packages/core/node_modules/uuid/bin/uuid +65 -0
  16. data/packages/core/node_modules/uuid/index.js +8 -0
  17. data/packages/core/node_modules/uuid/lib/bytesToUuid.js +26 -0
  18. data/packages/core/node_modules/uuid/lib/md5-browser.js +216 -0
  19. data/packages/core/node_modules/uuid/lib/md5.js +25 -0
  20. data/packages/core/node_modules/uuid/lib/rng-browser.js +34 -0
  21. data/packages/core/node_modules/uuid/lib/rng.js +8 -0
  22. data/packages/core/node_modules/uuid/lib/sha1-browser.js +89 -0
  23. data/packages/core/node_modules/uuid/lib/sha1.js +25 -0
  24. data/packages/core/node_modules/uuid/lib/v35.js +57 -0
  25. data/packages/core/node_modules/uuid/package.json +49 -0
  26. data/packages/core/node_modules/uuid/v1.js +109 -0
  27. data/packages/core/node_modules/uuid/v3.js +4 -0
  28. data/packages/core/node_modules/uuid/v4.js +29 -0
  29. data/packages/core/node_modules/uuid/v5.js +3 -0
  30. data/packages/core/package.json +5 -5
  31. data/packages/dev/package.json +2 -8
  32. data/packages/elections/package.json +1 -5
  33. data/packages/eslint-config/package.json +3 -7
  34. data/packages/stylelint-config/package.json +2 -6
  35. data/packages/webpacker/package.json +4 -9
  36. data/packages/webpacker/src/override-config.js +3 -1
  37. metadata +64 -46
  38. data/packages/all/package.json +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f0872745142de196217d5e776c6e730a5959c1595dadf21f64a98e9e594341b
4
- data.tar.gz: b5c07a3463d76611a9935723b3285861328a184b7f83e9898ae5e19815d7ff2d
3
+ metadata.gz: b4b9922e88de129b511673c9ba40958c2afacdcaa07ec038b500af10badf4678
4
+ data.tar.gz: c7361bb91075206b25d6f737af846350b949971d6ccb4e4d3a4ada591c2631c0
5
5
  SHA512:
6
- metadata.gz: ec01ba4ce4f74ccf4238cdc74b02a5c718911c427dcdd9a9c74991933c7fdc4b173ca58ae7015343f938f2334f46b71a827604086c1c7da4dfab8cddf0834a44
7
- data.tar.gz: 90dbbc1250e18400ee0d5dbdf62193960aaef4dad895b5a3cfa6c6ff7bdef36bc4c00e20d88934e361ec295ef84021c7d836023fa365c0e8cb3ab80a6615e07b
6
+ metadata.gz: 806beb8e688782393414029fc83af33b50e9cde93a61f2da505473db0300fe768a560588c8b294149849c79c36a4fc31c38fbba3ff17df701440ae3337ad7cd9
7
+ data.tar.gz: 2dd05493e0d2702c7294e391551df7bafe27f4cd5039656591ac609c9b4f78c968f824076542166ce621a001576e590341519628160389abe4c4d6fe1fc13b1d
data/Rakefile CHANGED
@@ -56,9 +56,10 @@ task :uninstall_all do
56
56
  Decidim::GemManager.uninstall_all
57
57
  end
58
58
 
59
- desc "Pushes a new build for each gem."
59
+ desc "Pushes a new build for each gem and package."
60
60
  task release_all: [:update_versions, :check_locale_completeness] do
61
61
  Decidim::GemManager.run_all("rake release")
62
+ Decidim::GemManager.run_packages("npm publish --access public")
62
63
  end
63
64
 
64
65
  desc "Makes sure all official locales are complete and clean."
@@ -79,7 +80,31 @@ task :bundle do
79
80
  [".", "decidim-generators", "decidim_app-design"].each do |dir|
80
81
  Bundler.with_original_env do
81
82
  puts "Updating #{dir}...\n"
82
- Dir.chdir(dir) { sh "bundle install" }
83
+ system!("bundle install", dir)
83
84
  end
84
85
  end
85
86
  end
87
+
88
+ desc "Synchronize npm packages files on the whole repo"
89
+ task :webpack do
90
+ FileUtils.rm_rf(decidim_app_design_path.join("package-lock.json"))
91
+ FileUtils.rm_rf(decidim_app_design_path.join("packages"))
92
+ FileUtils.cp_r(root_folder.join("package.json"), decidim_app_design_path)
93
+ FileUtils.cp_r(root_folder.join("package-lock.json"), decidim_app_design_path)
94
+ FileUtils.cp_r(root_folder.join("packages"), decidim_app_design_path)
95
+
96
+ system!("npm install", root_folder)
97
+ system!("npm install", decidim_app_design_path)
98
+ end
99
+
100
+ def root_folder
101
+ @root_folder ||= Pathname.new(__dir__)
102
+ end
103
+
104
+ def decidim_app_design_path
105
+ @decidim_app_design_path ||= Pathname.new(root_folder.join("decidim_app-design"))
106
+ end
107
+
108
+ def system!(command, path)
109
+ system("cd #{path} && #{command}") || abort("\n== Command #{command} failed ==")
110
+ end
@@ -29,29 +29,26 @@ development:
29
29
  # Notice that we use a different port (to prevent blocking the default one) as
30
30
  # there will be at least two webpack servers running
31
31
  port: 3035
32
- public: localhost:3035
33
- # Inject browserside javascript that required by both HMR and Live(full) reload
34
- inject_client: true
35
32
  # Hot Module Replacement updates modules while the application is running without a full reload
36
33
  hmr: false
37
- # Inline should be set to true if using HMR; it inserts a script to take care of live reloading
38
- inline: true
39
- # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
40
- overlay: true
34
+ client:
35
+ # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
36
+ overlay: true
37
+ # May also be a string
38
+ # webSocketURL:
39
+ # hostname: "0.0.0.0"
40
+ # pathname: "/ws"
41
+ # port: 8080
41
42
  # Should we use gzip compression?
42
43
  compress: true
43
44
  # Note that apps that do not check the host are vulnerable to DNS rebinding attacks
44
- disable_host_check: true
45
- # This option lets the browser open with your local IP
46
- use_local_ip: false
47
- # When enabled, nothing except the initial startup information will be written to the console.
48
- # This also means that errors or warnings from webpack are not visible.
49
- quiet: false
50
- pretty: false
45
+ allowed_hosts: "all"
46
+ pretty: true
51
47
  headers:
52
48
  'Access-Control-Allow-Origin': '*'
53
- watch_options:
54
- ignored: '**/node_modules/**'
49
+ static:
50
+ watch:
51
+ ignored: '**/node_modules/**'
55
52
 
56
53
  test:
57
54
  <<: *default
@@ -15,8 +15,8 @@ It's recommended to understand how Webpacker works. More information:
15
15
 
16
16
  Before starting the migration, please check you have the following dependencies installed:
17
17
 
18
- - Node.js version 15.14.0 (this version is mandatory)
19
- - Npm version 7.7.0 (it works with other versions, but this is the recommended)
18
+ - Node.js version 16.9.x (this version is mandatory)
19
+ - Npm version 7.21.x (it works with other versions, but this is the recommended)
20
20
 
21
21
  == Add Webpacker to the application
22
22
 
@@ -5,8 +5,8 @@ In order to develop on decidim, you'll need:
5
5
  * *Git* 2.15+
6
6
  * *PostgreSQL* 12.7+
7
7
  * *Ruby* 2.7.1
8
- * *NodeJS* 15.14.x
9
- * *Npm* 7.7.x
8
+ * *NodeJS* 16.9.x
9
+ * *Npm* 7.21.x
10
10
  * *ImageMagick*
11
11
  * *Chrome* browser and https://sites.google.com/a/chromium.org/chromedriver/[chromedriver].
12
12
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/module/delegation"
3
4
  require "open3"
4
5
 
5
6
  module Decidim
@@ -53,9 +54,9 @@ module Decidim
53
54
  end
54
55
  end
55
56
 
56
- def replace_version
57
+ def replace_gem_version
57
58
  Dir.chdir(@dir) do
58
- self.class.replace_file(
59
+ replace_file(
59
60
  "lib/#{name.tr("-", "/")}/version.rb",
60
61
  /def self\.version(\s*)"[^"]*"/,
61
62
  "def self.version\\1\"#{version}\""
@@ -63,6 +64,16 @@ module Decidim
63
64
  end
64
65
  end
65
66
 
67
+ def replace_package_version
68
+ Dir.chdir(@dir) do
69
+ replace_file(
70
+ "package.json",
71
+ /^ "version": "[^"]*"/,
72
+ " \"version\": \"#{semver_friendly_version(version)}\""
73
+ )
74
+ end
75
+ end
76
+
66
77
  def short_name
67
78
  name.gsub(/decidim-/, "")
68
79
  end
@@ -85,14 +96,12 @@ module Decidim
85
96
  end
86
97
 
87
98
  def replace_versions
88
- replace_file(
89
- "package.json",
90
- /^ "version": "[^"]*"/,
91
- " \"version\": \"#{semver_friendly_version}\""
92
- )
93
-
94
99
  all_dirs do |dir|
95
- new(dir).replace_version
100
+ new(dir).replace_gem_version
101
+ end
102
+
103
+ package_dirs do |dir|
104
+ new(dir).replace_package_version
96
105
  end
97
106
  end
98
107
 
@@ -129,6 +138,14 @@ module Decidim
129
138
  end
130
139
  end
131
140
 
141
+ def run_packages(command, out: $stdout)
142
+ package_dirs do |dir|
143
+ status = new(dir).run(command, out: out)
144
+
145
+ break unless status || ENV["FAIL_FAST"] == "false"
146
+ end
147
+ end
148
+
132
149
  def version
133
150
  @version ||= File.read(version_file).strip
134
151
  end
@@ -146,20 +163,26 @@ module Decidim
146
163
  dirs.each { |dir| yield(dir) }
147
164
  end
148
165
 
166
+ def package_dirs
167
+ dirs = Dir.glob("#{root}/packages/*")
168
+
169
+ dirs.each { |dir| yield(dir) }
170
+ end
171
+
149
172
  def plugins
150
173
  Dir.glob("#{root}/decidim-*/")
151
174
  end
152
175
 
176
+ def semver_friendly_version(a_version)
177
+ a_version.gsub(/\.pre/, "-pre").gsub(/\.dev/, "-dev").gsub(/.rc(\d*)/, "-rc\\1")
178
+ end
179
+
153
180
  private
154
181
 
155
182
  def root
156
183
  File.expand_path(File.join("..", ".."), __dir__)
157
184
  end
158
185
 
159
- def semver_friendly_version
160
- version.gsub(/\.pre/, "-pre").gsub(/\.dev/, "-dev").gsub(/.rc(\d*)/, "-rc\\1")
161
- end
162
-
163
186
  def version_file
164
187
  File.join(root, ".decidim-version")
165
188
  end
@@ -167,6 +190,8 @@ module Decidim
167
190
 
168
191
  private
169
192
 
193
+ delegate :plugins, :replace_file, :semver_friendly_version, :version, to: :class
194
+
170
195
  def interpolated_in_folder(command)
171
196
  Dir.chdir(@dir) do
172
197
  yield command.gsub("%version", version).gsub("%name", name)
@@ -178,11 +203,7 @@ module Decidim
178
203
  end
179
204
 
180
205
  def name
181
- self.class.plugins.map { |name| File.expand_path(name) }.include?(@dir) ? folder_name : "decidim"
182
- end
183
-
184
- def version
185
- self.class.version
206
+ plugins.map { |name| File.expand_path(name) }.include?(@dir) ? folder_name : "decidim"
186
207
  end
187
208
  end
188
209
  end
@@ -3,6 +3,6 @@
3
3
  # This holds the decidim version and the faker version it uses.
4
4
  module Decidim
5
5
  def self.version
6
- "0.25.0.rc1"
6
+ "0.25.0"
7
7
  end
8
8
  end