Skip to content
Permalink
Browse files

Extract a component manager class (#2427)

* Remove unused .dockerignore

* Extract Rake utils to a module

* Refactor Rakefile

* Make test_all more similar to Circle CI setup

* Remove docker_development_app generator

This generator was not working as expected since it would use th
decidim's code inside codegram's image, so development changes would not
be picked app by the development application.

* Move common logic to a component manager class

* Switch folder back after dummy app generation

Otherwise running things like `rake test_app test_all` fails.

* Rename decidim-design

This is not an engine/component, so component manager tasks fail on it.
Renaming also helps clarifying this.

* Add docs for `ComponentManager` class
  • Loading branch information...
deivid-rodriguez authored and josepjaume committed Jan 12, 2018
1 parent eae6367 commit 0a61d0355512a5d6e01fa27d58c5797953c8b90f
Showing with 131 additions and 145 deletions.
  1. +1 −2 .codeclimate.yml
  2. +0 −5 .dockerignore
  3. +0 −1 .eslintignore
  4. +0 −1 .gitignore
  5. +0 −1 .rubocop.yml
  6. +22 −70 Rakefile
  7. +4 −0 decidim-dev/Rakefile
  8. 0 {decidim-design → decidim_app-design}/.gitignore
  9. 0 {decidim-design → decidim_app-design}/Gemfile
  10. +3 −3 {decidim-design → decidim_app-design}/README.md
  11. 0 {decidim-design → decidim_app-design}/Rakefile
  12. 0 {decidim-design → decidim_app-design}/app/assets/config/manifest.js
  13. 0 {decidim-design → decidim_app-design}/app/assets/images/.keep
  14. BIN {decidim-design → decidim_app-design}/app/assets/images/background.png
  15. BIN {decidim-design → decidim_app-design}/app/assets/images/badge-ajuntament-footer.png
  16. 0 {decidim-design → decidim_app-design}/app/assets/images/badge-ajuntament-header.svg
  17. BIN {decidim-design → decidim_app-design}/app/assets/images/barcelona-hero.jpg
  18. 0 {decidim-design → decidim_app-design}/app/assets/images/barcelona/heading-icon.svg
  19. 0 {decidim-design → decidim_app-design}/app/assets/images/barcelona/pattern-big.svg
  20. 0 {decidim-design → decidim_app-design}/app/assets/images/barcelona/pattern.svg
  21. BIN {decidim-design → decidim_app-design}/app/assets/images/bg.jpg
  22. BIN {decidim-design → decidim_app-design}/app/assets/images/cc-badge.png
  23. BIN {decidim-design → decidim_app-design}/app/assets/images/debateAMA.jpg
  24. 0 {decidim-design → decidim_app-design}/app/assets/images/decidim-logo.svg
  25. BIN {decidim-design → decidim_app-design}/app/assets/images/demo-avatar-big.jpg
  26. BIN {decidim-design → decidim_app-design}/app/assets/images/demo-avatar.jpg
  27. BIN {decidim-design → decidim_app-design}/app/assets/images/demo-debate.jpg
  28. BIN {decidim-design → decidim_app-design}/app/assets/images/demo-info-page.jpg
  29. BIN {decidim-design → decidim_app-design}/app/assets/images/favicon.png
  30. BIN {decidim-design → decidim_app-design}/app/assets/images/gracia.jpg
  31. BIN {decidim-design → decidim_app-design}/app/assets/images/hero-home.jpg
  32. 0 {decidim-design → decidim_app-design}/app/assets/images/icons.svg
  33. 0 {decidim-design → decidim_app-design}/app/assets/images/logo.svg
  34. BIN {decidim-design → decidim_app-design}/app/assets/images/meeting-map.jpg
  35. BIN {decidim-design → decidim_app-design}/app/assets/images/meeting1.jpg
  36. BIN {decidim-design → decidim_app-design}/app/assets/images/meeting2.jpg
  37. BIN {decidim-design → decidim_app-design}/app/assets/images/meeting3.jpg
  38. BIN {decidim-design → decidim_app-design}/app/assets/images/middleman.png
  39. BIN {decidim-design → decidim_app-design}/app/assets/images/process-demo-banner.jpg
  40. BIN {decidim-design → decidim_app-design}/app/assets/images/process-demo.jpg
  41. BIN {decidim-design → decidim_app-design}/app/assets/images/process-empty-image.jpg
  42. BIN {decidim-design → decidim_app-design}/app/assets/images/process2.jpg
  43. BIN {decidim-design → decidim_app-design}/app/assets/images/puntverd.jpg
  44. BIN {decidim-design → decidim_app-design}/app/assets/images/superilles.jpg
  45. 0 {decidim-design → decidim_app-design}/app/assets/javascripts/admin.js
  46. 0 {decidim-design → decidim_app-design}/app/assets/javascripts/channels/.keep
  47. 0 {decidim-design → decidim_app-design}/app/assets/javascripts/public.js
  48. 0 {decidim-design → decidim_app-design}/app/assets/stylesheets/admin.scss
  49. 0 {decidim-design → decidim_app-design}/app/assets/stylesheets/public.scss
  50. 0 {decidim-design → decidim_app-design}/app/controllers/application_controller.rb
  51. 0 {decidim-design → decidim_app-design}/app/controllers/pages_controller.rb
  52. 0 {decidim-design → decidim_app-design}/app/helpers/application_helper.rb
  53. 0 {decidim-design → decidim_app-design}/app/views/admin/component-budgets.html.erb
  54. 0 {decidim-design → decidim_app-design}/app/views/admin/component-debates.html.erb
  55. 0 {decidim-design → decidim_app-design}/app/views/admin/component-meetings.html.erb
  56. 0 {decidim-design → decidim_app-design}/app/views/admin/component-proposals.html.erb
  57. 0 {decidim-design → decidim_app-design}/app/views/admin/component-results.html.erb
  58. 0 {decidim-design → decidim_app-design}/app/views/admin/content/terms.md
  59. 0 {decidim-design → decidim_app-design}/app/views/admin/form-with-datepicker.html.erb
  60. 0 {decidim-design → decidim_app-design}/app/views/admin/form-with-validation.html.erb
  61. 0 {decidim-design → decidim_app-design}/app/views/admin/home.html.erb
  62. 0 {decidim-design → decidim_app-design}/app/views/admin/index.html.erb
  63. 0 {decidim-design → decidim_app-design}/app/views/admin/pages.html.erb
  64. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_callouts_full.html.erb
  65. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_home_nav.html.erb
  66. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_main_nav.html.erb
  67. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_pages_nav.html.erb
  68. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_pagination.html.erb
  69. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_process_header.html.erb
  70. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_process_nav.html.erb
  71. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_process_sub_nav.html.erb
  72. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_process_title.html.erb
  73. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_settings_nav.html.erb
  74. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_template_bottom.html.erb
  75. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_template_top.html.erb
  76. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_title_bar.html.erb
  77. 0 {decidim-design → decidim_app-design}/app/views/admin/partials/_users_nav.html.erb
  78. 0 {decidim-design → decidim_app-design}/app/views/admin/process-admin.html.erb
  79. 0 {decidim-design → decidim_app-design}/app/views/admin/process-categories.html.erb
  80. 0 {decidim-design → decidim_app-design}/app/views/admin/process-components.html.erb
  81. 0 {decidim-design → decidim_app-design}/app/views/admin/process-docs.html.erb
  82. 0 {decidim-design → decidim_app-design}/app/views/admin/process-info.html.erb
  83. 0 {decidim-design → decidim_app-design}/app/views/admin/process-moderations.html.erb
  84. 0 {decidim-design → decidim_app-design}/app/views/admin/process-pages.html.erb
  85. 0 {decidim-design → decidim_app-design}/app/views/admin/process-steps-new.html.erb
  86. 0 {decidim-design → decidim_app-design}/app/views/admin/process-steps.html.erb
  87. 0 {decidim-design → decidim_app-design}/app/views/admin/processes-new-2.html.erb
  88. 0 {decidim-design → decidim_app-design}/app/views/admin/processes-new-3-add.html.erb
  89. 0 {decidim-design → decidim_app-design}/app/views/admin/processes-new-3.html.erb
  90. 0 {decidim-design → decidim_app-design}/app/views/admin/processes-new.html.erb
  91. 0 {decidim-design → decidim_app-design}/app/views/admin/processes.html.erb
  92. 0 {decidim-design → decidim_app-design}/app/views/admin/scope-browse.html.erb
  93. 0 {decidim-design → decidim_app-design}/app/views/admin/scope-edit.html.erb
  94. 0 {decidim-design → decidim_app-design}/app/views/admin/scope-sub-browse.html.erb
  95. 0 {decidim-design → decidim_app-design}/app/views/admin/settings-scope-types.html.erb
  96. 0 {decidim-design → decidim_app-design}/app/views/admin/settings-scopes.html.erb
  97. 0 {decidim-design → decidim_app-design}/app/views/admin/settings.html.erb
  98. 0 {decidim-design → decidim_app-design}/app/views/admin/users-groups.html.erb
  99. 0 {decidim-design → decidim_app-design}/app/views/admin/users.html.erb
  100. 0 {decidim-design → decidim_app-design}/app/views/index.html.erb
  101. 0 {decidim-design → decidim_app-design}/app/views/layouts/admin.html.erb
  102. 0 {decidim-design → decidim_app-design}/app/views/layouts/application.html.erb
  103. 0 {decidim-design → decidim_app-design}/app/views/layouts/public.html.erb
  104. 0 {decidim-design → decidim_app-design}/app/views/public/404.html.erb
  105. 0 {decidim-design → decidim_app-design}/app/views/public/500.html.erb
  106. 0 {decidim-design → decidim_app-design}/app/views/public/action-view.html.erb
  107. 0 {decidim-design → decidim_app-design}/app/views/public/content/terms.md
  108. 0 {decidim-design → decidim_app-design}/app/views/public/cookie-bar.html.erb
  109. 0 {decidim-design → decidim_app-design}/app/views/public/debate-view-AMA.html.erb
  110. 0 {decidim-design → decidim_app-design}/app/views/public/debate-view-login.html.erb
  111. 0 {decidim-design → decidim_app-design}/app/views/public/debate-view.html.erb
  112. 0 {decidim-design → decidim_app-design}/app/views/public/debates.html.erb
  113. BIN {decidim-design → decidim_app-design}/app/views/public/docs/icons.pdf
  114. 0 {decidim-design → decidim_app-design}/app/views/public/docs/icons.svg
  115. 0 {decidim-design → decidim_app-design}/app/views/public/docs/logo-decidim.svg
  116. BIN {decidim-design → decidim_app-design}/app/views/public/docs/logo-easter-egg.png
  117. BIN {decidim-design → decidim_app-design}/app/views/public/docs/manual-style-paper.pdf
  118. BIN {decidim-design → decidim_app-design}/app/views/public/docs/manual-style-web.pdf
  119. BIN {decidim-design → decidim_app-design}/app/views/public/docs/proposal-logos-01.pdf
  120. BIN {decidim-design → decidim_app-design}/app/views/public/docs/proposal-logos-02.pdf
  121. BIN {decidim-design → decidim_app-design}/app/views/public/docs/proposal-logos-03.pdf
  122. BIN {decidim-design → decidim_app-design}/app/views/public/docs/proposal-web.pdf
  123. BIN {decidim-design → decidim_app-design}/app/views/public/docs/timeline-steps.pdf
  124. 0 {decidim-design → decidim_app-design}/app/views/public/docs/timeline-steps.svg
  125. 0 {decidim-design → decidim_app-design}/app/views/public/email-inline.html.erb
  126. 0 {decidim-design → decidim_app-design}/app/views/public/form-datepicker.html.erb
  127. 0 {decidim-design → decidim_app-design}/app/views/public/form-validation.html.erb
  128. 0 {decidim-design → decidim_app-design}/app/views/public/home.html.erb
  129. 0 {decidim-design → decidim_app-design}/app/views/public/index.html.erb
  130. 0 {decidim-design → decidim_app-design}/app/views/public/info.html.erb
  131. 0 {decidim-design → decidim_app-design}/app/views/public/meeting-view.html.erb
  132. 0 {decidim-design → decidim_app-design}/app/views/public/meetings-callout.html.erb
  133. 0 {decidim-design → decidim_app-design}/app/views/public/meetings.html.erb
  134. 0 {decidim-design → decidim_app-design}/app/views/public/more-information.html.erb
  135. 0 {decidim-design → decidim_app-design}/app/views/public/new-proposal.html.erb
  136. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_budget_confirm.html.erb
  137. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_budget_excess.html.erb
  138. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_budget_finished.html.erb
  139. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_budget_summary.html.erb
  140. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_budget_summary_mini.html.erb
  141. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_comments.html.erb
  142. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_component_icons.html.erb
  143. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_cookie_bar.html.erb
  144. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_doc_item.html.erb
  145. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_filter_tags.erb
  146. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_filters.html.erb
  147. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_filters_notifications.html.erb
  148. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_filters_small_view.html.erb
  149. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_flag.html.erb
  150. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_flag_empty.html.erb
  151. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_gallery.html.erb
  152. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_help.html.erb
  153. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_main_footer.html.erb
  154. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_main_nav.html.erb
  155. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_meetings_highlights.html.erb
  156. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_meetings_map.html.erb
  157. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_mini_footer.html.erb
  158. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_order_by.html.erb
  159. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_order_by_comments.html.erb
  160. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_order_by_processes.html.erb
  161. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_pagination.html.erb
  162. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_process_header.html.erb
  163. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_process_header_home.html.erb
  164. 0 ...idim-design → decidim_app-design}/app/views/public/partials/_process_header_new_proposal.html.erb
  165. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_process_nav.html.erb
  166. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_process_phase.html.erb
  167. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_process_phase_home.html.erb
  168. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_proposals_highlights.html.erb
  169. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_related_actions.html.erb
  170. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_related_meetings.html.erb
  171. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_related_proposals.html.erb
  172. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_share.html.erb
  173. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_template_bottom.html.erb
  174. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_template_top.html.erb
  175. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_timeline.html.erb
  176. 0 {decidim-design → decidim_app-design}/app/views/public/partials/_topbar.html.erb
  177. 0 {decidim-design → decidim_app-design}/app/views/public/pattern-library.html.erb
  178. 0 {decidim-design → decidim_app-design}/app/views/public/phases.html.erb
  179. 0 {decidim-design → decidim_app-design}/app/views/public/processes.html.erb
  180. 0 {decidim-design → decidim_app-design}/app/views/public/project-budget-view.html.erb
  181. 0 {decidim-design → decidim_app-design}/app/views/public/projects-budget-confirm.html.erb
  182. 0 {decidim-design → decidim_app-design}/app/views/public/projects-budget-excess.html.erb
  183. 0 {decidim-design → decidim_app-design}/app/views/public/projects-budget-finish.html.erb
  184. 0 {decidim-design → decidim_app-design}/app/views/public/projects-budget.html.erb
  185. 0 {decidim-design → decidim_app-design}/app/views/public/proposal-view-login.html.erb
  186. 0 {decidim-design → decidim_app-design}/app/views/public/proposal-view-rejected.html.erb
  187. 0 {decidim-design → decidim_app-design}/app/views/public/proposal-view-voted.html.erb
  188. 0 {decidim-design → decidim_app-design}/app/views/public/proposal-view.html.erb
  189. 0 {decidim-design → decidim_app-design}/app/views/public/proposals-no-vote.html.erb
  190. 0 {decidim-design → decidim_app-design}/app/views/public/proposals-with-filters.html.erb
  191. 0 {decidim-design → decidim_app-design}/app/views/public/proposals.html.erb
  192. 0 {decidim-design → decidim_app-design}/app/views/public/proposals_2.html.erb
  193. 0 {decidim-design → decidim_app-design}/app/views/public/results.html.erb
  194. 0 {decidim-design → decidim_app-design}/app/views/public/static-with-nav.html.erb
  195. 0 {decidim-design → decidim_app-design}/app/views/public/static.html.erb
  196. 0 {decidim-design → decidim_app-design}/app/views/public/style-manual.html.erb
  197. 0 {decidim-design → decidim_app-design}/app/views/public/user-confirm.html.erb
  198. 0 {decidim-design → decidim_app-design}/app/views/public/user-login.html.erb
  199. 0 {decidim-design → decidim_app-design}/app/views/public/user-new-password.html.erb
  200. 0 {decidim-design → decidim_app-design}/app/views/public/user-notifications.html.erb
  201. 0 {decidim-design → decidim_app-design}/app/views/public/user-profile.html.erb
  202. 0 {decidim-design → decidim_app-design}/app/views/public/user-register-success.html.erb
  203. 0 {decidim-design → decidim_app-design}/app/views/public/user-register.html.erb
  204. 0 {decidim-design → decidim_app-design}/app/views/public/user-settings.html.erb
  205. 0 {decidim-design → decidim_app-design}/app/views/public/user-stories.html.erb
  206. 0 {decidim-design → decidim_app-design}/app/views/public/user-verification.html.erb
  207. 0 {decidim-design → decidim_app-design}/app/views/public/user-welcome.html.erb
  208. 0 {decidim-design → decidim_app-design}/bin/bundle
  209. 0 {decidim-design → decidim_app-design}/bin/rails
  210. 0 {decidim-design → decidim_app-design}/bin/rake
  211. 0 {decidim-design → decidim_app-design}/bin/setup
  212. 0 {decidim-design → decidim_app-design}/bin/spring
  213. 0 {decidim-design → decidim_app-design}/bin/update
  214. 0 {decidim-design → decidim_app-design}/bin/yarn
  215. 0 {decidim-design → decidim_app-design}/config.ru
  216. 0 {decidim-design → decidim_app-design}/config/application.rb
  217. 0 {decidim-design → decidim_app-design}/config/boot.rb
  218. +1 −1 {decidim-design → decidim_app-design}/config/cable.yml
  219. 0 {decidim-design → decidim_app-design}/config/environment.rb
  220. 0 {decidim-design → decidim_app-design}/config/environments/development.rb
  221. +1 −1 {decidim-design → decidim_app-design}/config/environments/production.rb
  222. 0 {decidim-design → decidim_app-design}/config/environments/test.rb
  223. 0 {decidim-design → decidim_app-design}/config/initializers/application_controller_renderer.rb
  224. 0 {decidim-design → decidim_app-design}/config/initializers/assets.rb
  225. 0 {decidim-design → decidim_app-design}/config/initializers/backtrace_silencers.rb
  226. 0 {decidim-design → decidim_app-design}/config/initializers/cookies_serializer.rb
  227. 0 {decidim-design → decidim_app-design}/config/initializers/decidim_patches.rb
  228. 0 {decidim-design → decidim_app-design}/config/initializers/filter_parameter_logging.rb
  229. 0 {decidim-design → decidim_app-design}/config/initializers/inflections.rb
  230. 0 {decidim-design → decidim_app-design}/config/initializers/mime_types.rb
  231. 0 {decidim-design → decidim_app-design}/config/initializers/wrap_parameters.rb
  232. 0 {decidim-design → decidim_app-design}/config/puma.rb
  233. 0 {decidim-design → decidim_app-design}/config/routes.rb
  234. 0 {decidim-design → decidim_app-design}/config/secrets.yml
  235. 0 {decidim-design → decidim_app-design}/config/spring.rb
  236. 0 {decidim-design → decidim_app-design}/lib/assets/.keep
  237. 0 {decidim-design → decidim_app-design}/lib/tasks/.keep
  238. 0 {decidim-design → decidim_app-design}/log/.keep
  239. +1 −1 {decidim-design → decidim_app-design}/package.json
  240. 0 {decidim-design → decidim_app-design}/tmp/.keep
  241. +98 −0 lib/decidim/component_manager.rb
  242. +0 −59 lib/generators/decidim/docker_generator.rb
@@ -62,7 +62,7 @@ plugins:
categories: Style

exclude_paths:
- "decidim-design/**/*"
- "decidim_app-design/**/*"

markdownlint:
enabled: true
@@ -86,7 +86,6 @@ exclude_patterns:
- "decidim-comments/app/assets/javascripts/decidim/comments/bundle.js"
- "node_modules/"
- "development_app/"
- "docker_development_app/"
- "spec/decidim_dummy_app/"
- "coverage/"
- "webpack.report.html"

This file was deleted.

@@ -1,7 +1,6 @@
**/*{.,-}min.js
decidim-*/vendor/**/*.js
spec/decidim_dummy_app/**/*.js
docker_development_app
development_app
**/node_modules/**
bundle.js
@@ -7,7 +7,6 @@ node_modules/
.vscode
development_app/
.projectile
docker_development_app/
npm-debug.log
karma-*
yarn-error.log
@@ -5,7 +5,6 @@ AllCops:
Exclude:
- '**/vendor/**/*'
- 'development_app/**/*'
- 'docker_development_app/**/*'
- 'spec/decidim_dummy_app/**/*'
# Default formatter will be used if no -f/--format option is given.
DefaultFormatter: progress
@@ -3,88 +3,49 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "generators/decidim/app_generator"
require "generators/decidim/docker_generator"

DECIDIM_GEMS = %w(core system admin api participatory_processes assemblies pages meetings proposals comments accountability budgets surveys verifications dev).freeze
require "decidim/component_manager"

RSpec::Core::RakeTask.new(:spec)

task default: :spec

desc "Runs all tests in all Decidim engines"
task :test_all do
tested_gems = DECIDIM_GEMS - ["dev"]

dirs = [__dir__] + tested_gems.map { |name| "#{__dir__}/decidim-#{name}" }
task test_all: [:test_main, :test_subgems]

dirs.each do |dir|
Dir.chdir(dir) do
puts "Running #{File.basename(dir)}'s tests..."
status = system "rake"
abort unless status || ENV["FAIL_FAST"] == "false"
end
end
desc "Runs all tests in decidim subgems"
task test_subgems: :test_app do
Decidim::ComponentManager.run_all("rake", include_root: false)
end

def replace_file(name, regexp, replacement)
new_content = File.read(name).gsub(regexp, replacement)

File.open(name, "w") { |f| f.write(new_content) }
end

def version
File.read("#{__dir__}/.decidim-version").strip
desc "Runs all tests in the main decidim gem"
task :test_main do
Decidim::ComponentManager.new(__dir__).run("rake")
end

desc "Update version in all gems to the one set in the `.decidim-version` file"
task :update_versions do
replace_file(
"#{__dir__}/package.json",
/^ "version": "[^"]*"/,
" \"version\": \"#{version.gsub(/\.pre/, "-pre")}\""
)

DECIDIM_GEMS.each do |name|
replace_file(
"#{__dir__}/decidim-#{name}/lib/decidim/#{name}/version.rb",
/def self\.version(\s*)"[^"]*"/,
"def self.version\\1\"#{version}\""
)
end

replace_file(
"#{__dir__}/lib/decidim/version.rb",
/def self\.version(\s*)"[^"]*"/,
"def self.version\\1\"#{version}\""
)
Decidim::ComponentManager.replace_versions
end

desc "Installs all gems locally."
task :install_all do
system "rake install:local"
DECIDIM_GEMS.each do |name|
Dir.chdir("#{__dir__}/decidim-#{name}") do
system "rake install:local"
end
end
Decidim::ComponentManager.run_all(
"rake install:local",
out: File::NULL
)
end

desc "Uninstalls all gems locally."
task :uninstall_all do
system("gem uninstall decidim -v #{version} --executables --force")
DECIDIM_GEMS.each do |name|
system("gem uninstall decidim-#{name} -v #{version} --executables --force")
end
Decidim::ComponentManager.run_all(
"gem uninstall %name -v %version --executables --force",
out: File::NULL
)
end

desc "Pushes a new build for each gem."
task release_all: [:update_versions, :check_locale_completeness, :webpack] do
sh "rake release"
DECIDIM_GEMS.each do |name|
Dir.chdir("#{__dir__}/decidim-#{name}") do
sh "rake release"
end
end
Decidim::ComponentManager.run_all("rake release")
end

desc "Makes sure all official locales are complete and clean."
@@ -98,11 +59,11 @@ task :test_app do

Dir.chdir(__dir__) do
sh "rm -fR #{dummy_app_path}", verbose: false
end

Decidim::Generators::AppGenerator.start(
[dummy_app_path, "--path", "../..", "--recreate_db", "--demo"]
)
Decidim::Generators::AppGenerator.start(
[dummy_app_path, "--path", "../..", "--recreate_db", "--demo"]
)
end
end

desc "Generates a development app."
@@ -116,15 +77,6 @@ task :development_app do
)
end

desc "Generates a development app based on Docker."
task :docker_development_app do
docker_app_path = __dir__ + "/docker_development_app"

Decidim::Generators::DockerGenerator.start(
["docker_development_app", "--docker_app_path", docker_app_path]
)
end

desc "Build webpack bundle files"
task :webpack do
sh "yarn install && yarn build:prod"
@@ -1,3 +1,7 @@
# frozen_string_literal: true

require "bundler/gem_tasks"

task :default do
puts "No default task defined yet."
end
File renamed without changes.
File renamed without changes.
@@ -1,12 +1,12 @@
# decidim-design
# decidim_app-design

`decidim-design` is a full-fledged *application* that mounts the assets from `decidim`, thus allowing rapid prototyping of functionalities. It mounts the `decidim` gem present on this same repository so you can safely modify its assets and see changes real-time.
`decidim_app-design` is a full-fledged *application* that mounts the assets from `decidim`, thus allowing rapid prototyping of functionalities. It mounts the `decidim` gem present on this same repository so you can safely modify its assets and see changes real-time.

This approach has several benefits:

* Tests will break if a style breaks an existing functionality, as the applications being tested use the same methods.

* `Decidim::LayoutHelper` and others can be reused in `decidim-design` for extra consistency.
* `Decidim::LayoutHelper` and others can be reused in `decidim_app-design` for extra consistency.

* Gems that provide extra assets can also be used, ensuring we're always consistent with the prototypes.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.