diff --git a/Gemfile b/Gemfile index ceb730e..973297a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" ruby RUBY_VERSION -# DECIDIM_VERSION = { github: "decidim/decidim", branch: "release/0.29-stable" } -DECIDIM_VERSION = "0.29.0" +DECIDIM_VERSION = { github: "decidim/decidim", branch: "release/0.29-stable" } +# DECIDIM_VERSION = "0.29.0" gem "decidim", DECIDIM_VERSION gem "decidim-initiatives", DECIDIM_VERSION diff --git a/Gemfile.lock b/Gemfile.lock index bc15fd3..1b04eeb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,192 @@ +GIT + remote: https://github.com/decidim/decidim.git + revision: 46bef17e56e686b55471047d01484f73ee2b8a93 + branch: release/0.29-stable + specs: + decidim (0.29.1) + decidim-accountability (= 0.29.1) + decidim-admin (= 0.29.1) + decidim-api (= 0.29.1) + decidim-assemblies (= 0.29.1) + decidim-blogs (= 0.29.1) + decidim-budgets (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-debates (= 0.29.1) + decidim-forms (= 0.29.1) + decidim-generators (= 0.29.1) + decidim-meetings (= 0.29.1) + decidim-pages (= 0.29.1) + decidim-participatory_processes (= 0.29.1) + decidim-proposals (= 0.29.1) + decidim-sortitions (= 0.29.1) + decidim-surveys (= 0.29.1) + decidim-system (= 0.29.1) + decidim-verifications (= 0.29.1) + decidim-accountability (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-admin (0.29.1) + active_link_to (~> 1.0) + decidim-core (= 0.29.1) + devise (~> 4.7) + devise-i18n (~> 1.2) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-api (0.29.1) + decidim-core (= 0.29.1) + graphql (~> 2.2.6) + graphql-docs (~> 4.0) + rack-cors (~> 1.0) + decidim-assemblies (0.29.1) + decidim-core (= 0.29.1) + decidim-blogs (0.29.1) + decidim-admin (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-budgets (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-comments (0.29.1) + decidim-core (= 0.29.1) + redcarpet (~> 3.5, >= 3.5.1) + decidim-conferences (0.29.1) + decidim-core (= 0.29.1) + decidim-meetings (= 0.29.1) + wicked_pdf (~> 2.7) + wkhtmltopdf-binary (= 0.12.6.6) + decidim-core (0.29.1) + active_link_to (~> 1.0) + acts_as_list (~> 1.0) + batch-loader (~> 1.2) + browser (~> 2.7) + cells-erb (~> 0.1.0) + cells-rails (~> 0.1.3) + charlock_holmes (~> 0.7) + date_validator (~> 0.12.0) + devise (~> 4.7) + devise-i18n (~> 1.2, < 1.11.1) + diffy (~> 3.3) + doorkeeper (~> 5.6, >= 5.6.6) + doorkeeper-i18n (~> 4.0) + file_validators (~> 3.0) + fog-local (~> 0.6) + foundation_rails_helper (~> 4.0) + geocoder (~> 1.8) + hashdiff (>= 0.4.0, < 2.0.0) + image_processing (~> 1.2) + invisible_captcha (~> 0.12) + kaminari (~> 1.2, >= 1.2.1) + loofah (~> 2.19, >= 2.19.1) + mime-types (>= 1.16, < 4.0) + mini_magick (~> 4.9) + net-smtp (~> 0.3.1) + nokogiri (~> 1.16, >= 1.16.2) + omniauth (~> 2.0) + omniauth-facebook (~> 5.0) + omniauth-google-oauth2 (~> 1.0) + omniauth-rails_csrf_protection (~> 1.0) + omniauth-twitter (~> 1.4) + paper_trail (~> 12.0) + pg (~> 1.4.0, < 2) + pg_search (~> 2.2) + premailer-rails (~> 1.10) + psych (~> 4.0) + rack (~> 2.2, >= 2.2.8.1) + rack-attack (~> 6.0) + rails (~> 7.0.8) + rails-i18n (~> 7.0) + ransack (~> 3.2.1) + redis (~> 4.1) + request_store (~> 1.5.0) + rubyXL (~> 3.4) + rubyzip (~> 2.0) + shakapacker (~> 7.1.0) + valid_email2 (~> 4.0) + web-push (~> 3.0) + wisper (~> 2.0) + decidim-debates (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-dev (0.29.1) + bullet (~> 7.1.6) + byebug (~> 11.0) + capybara (~> 3.39) + decidim (= 0.29.1) + erb_lint (~> 0.4.0) + factory_bot_rails (~> 6.2) + faker (~> 3.2) + i18n-tasks (~> 1.0) + nokogiri (~> 1.16, >= 1.16.2) + parallel_tests (~> 4.2) + puma (~> 6.2, >= 6.3.1) + rails-controller-testing (~> 1.0) + rspec (~> 3.12) + rspec-cells (~> 0.3.7) + rspec-html-matchers (~> 0.10) + rspec-rails (~> 6.0) + rspec-retry (~> 0.6.2) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.65.0) + rubocop-capybara (~> 2.21) + rubocop-factory_bot (~> 2.26) + rubocop-faker (~> 1.1) + rubocop-performance (~> 1.21) + rubocop-rails (~> 2.25) + rubocop-rspec (~> 3.0) + rubocop-rspec_rails (~> 2.30) + rubocop-rubycw (~> 0.1) + selenium-webdriver (~> 4.9) + simplecov (~> 0.22.0) + simplecov-cobertura (~> 2.1.0) + spring (~> 4.0) + spring-watcher-listen (~> 2.0) + w3c_rspec_validators (~> 0.3.0) + webmock (~> 3.18) + wisper-rspec (~> 1.0) + decidim-forms (0.29.1) + decidim-core (= 0.29.1) + wicked_pdf (~> 2.1) + wkhtmltopdf-binary (= 0.12.6.6) + decidim-generators (0.29.1) + decidim-core (= 0.29.1) + decidim-initiatives (0.29.1) + decidim-admin (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-verifications (= 0.29.1) + hexapdf (~> 0.32.0) + wicked_pdf (~> 2.1) + wkhtmltopdf-binary (= 0.12.6.6) + decidim-meetings (0.29.1) + decidim-core (= 0.29.1) + decidim-forms (= 0.29.1) + icalendar (~> 2.5) + decidim-pages (0.29.1) + decidim-core (= 0.29.1) + decidim-participatory_processes (0.29.1) + decidim-core (= 0.29.1) + decidim-proposals (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + doc2text (~> 0.4.7) + redcarpet (~> 3.5, >= 3.5.1) + decidim-sortitions (0.29.1) + decidim-admin (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-proposals (= 0.29.1) + decidim-surveys (0.29.1) + decidim-core (= 0.29.1) + decidim-forms (= 0.29.1) + decidim-system (0.29.1) + active_link_to (~> 1.0) + decidim-core (= 0.29.1) + devise (~> 4.7) + devise-i18n (~> 1.2) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-verifications (0.29.1) + decidim-core (= 0.29.1) + GEM remote: https://rubygems.org/ specs: @@ -69,7 +258,7 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - acts_as_list (1.2.2) + acts_as_list (1.2.3) activerecord (>= 6.1) activesupport (>= 6.1) addressable (2.8.7) @@ -143,7 +332,7 @@ GEM bigdecimal rexml crass (1.0.6) - css_parser (1.19.0) + css_parser (1.19.1) addressable csv (3.3.0) dalli (3.2.8) @@ -152,189 +341,6 @@ GEM date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - decidim (0.29.0) - decidim-accountability (= 0.29.0) - decidim-admin (= 0.29.0) - decidim-api (= 0.29.0) - decidim-assemblies (= 0.29.0) - decidim-blogs (= 0.29.0) - decidim-budgets (= 0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-debates (= 0.29.0) - decidim-forms (= 0.29.0) - decidim-generators (= 0.29.0) - decidim-meetings (= 0.29.0) - decidim-pages (= 0.29.0) - decidim-participatory_processes (= 0.29.0) - decidim-proposals (= 0.29.0) - decidim-sortitions (= 0.29.0) - decidim-surveys (= 0.29.0) - decidim-system (= 0.29.0) - decidim-verifications (= 0.29.0) - decidim-accountability (0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-admin (0.29.0) - active_link_to (~> 1.0) - decidim-core (= 0.29.0) - devise (~> 4.7) - devise-i18n (~> 1.2) - devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.29.0) - decidim-core (= 0.29.0) - graphql (~> 2.2.6) - graphql-docs (~> 4.0) - rack-cors (~> 1.0) - decidim-assemblies (0.29.0) - decidim-core (= 0.29.0) - decidim-blogs (0.29.0) - decidim-admin (= 0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-budgets (0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-comments (0.29.0) - decidim-core (= 0.29.0) - redcarpet (~> 3.5, >= 3.5.1) - decidim-conferences (0.29.0) - decidim-core (= 0.29.0) - decidim-meetings (= 0.29.0) - wicked_pdf (~> 2.7) - wkhtmltopdf-binary (= 0.12.6.6) - decidim-core (0.29.0) - active_link_to (~> 1.0) - acts_as_list (~> 1.0) - batch-loader (~> 1.2) - browser (~> 2.7) - cells-erb (~> 0.1.0) - cells-rails (~> 0.1.3) - charlock_holmes (~> 0.7) - date_validator (~> 0.12.0) - devise (~> 4.7) - devise-i18n (~> 1.2, < 1.11.1) - diffy (~> 3.3) - doorkeeper (~> 5.6, >= 5.6.6) - doorkeeper-i18n (~> 4.0) - file_validators (~> 3.0) - fog-local (~> 0.6) - foundation_rails_helper (~> 4.0) - geocoder (~> 1.8) - hashdiff (>= 0.4.0, < 2.0.0) - image_processing (~> 1.2) - invisible_captcha (~> 0.12) - kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.19, >= 2.19.1) - mime-types (>= 1.16, < 4.0) - mini_magick (~> 4.9) - net-smtp (~> 0.3.1) - nokogiri (~> 1.16, >= 1.16.2) - omniauth (~> 2.0) - omniauth-facebook (~> 5.0) - omniauth-google-oauth2 (~> 1.0) - omniauth-rails_csrf_protection (~> 1.0) - omniauth-twitter (~> 1.4) - paper_trail (~> 12.0) - pg (~> 1.4.0, < 2) - pg_search (~> 2.2) - premailer-rails (~> 1.10) - psych (~> 4.0) - rack (~> 2.2, >= 2.2.8.1) - rack-attack (~> 6.0) - rails (~> 7.0.8) - rails-i18n (~> 7.0) - ransack (~> 3.2.1) - redis (~> 4.1) - request_store (~> 1.5.0) - rubyXL (~> 3.4) - rubyzip (~> 2.0) - shakapacker (~> 7.1.0) - valid_email2 (~> 4.0) - web-push (~> 3.0) - wisper (~> 2.0) - decidim-debates (0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-dev (0.29.0) - bullet (~> 7.1.6) - byebug (~> 11.0) - capybara (~> 3.39) - decidim (= 0.29.0) - erb_lint (~> 0.4.0) - factory_bot_rails (~> 6.2) - faker (~> 3.2) - i18n-tasks (~> 1.0) - nokogiri (~> 1.16, >= 1.16.2) - parallel_tests (~> 4.2) - puma (~> 6.2, >= 6.3.1) - rails-controller-testing (~> 1.0) - rspec (~> 3.12) - rspec-cells (~> 0.3.7) - rspec-html-matchers (~> 0.10) - rspec-rails (~> 6.0) - rspec-retry (~> 0.6.2) - rspec_junit_formatter (~> 0.6.0) - rubocop (~> 1.65.0) - rubocop-capybara (~> 2.21) - rubocop-factory_bot (~> 2.26) - rubocop-faker (~> 1.1) - rubocop-performance (~> 1.21) - rubocop-rails (~> 2.25) - rubocop-rspec (~> 3.0) - rubocop-rspec_rails (~> 2.30) - rubocop-rubycw (~> 0.1) - selenium-webdriver (~> 4.9) - simplecov (~> 0.22.0) - simplecov-cobertura (~> 2.1.0) - spring (~> 4.0) - spring-watcher-listen (~> 2.0) - w3c_rspec_validators (~> 0.3.0) - webmock (~> 3.18) - wisper-rspec (~> 1.0) - decidim-forms (0.29.0) - decidim-core (= 0.29.0) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (= 0.12.6.6) - decidim-generators (0.29.0) - decidim-core (= 0.29.0) - decidim-initiatives (0.29.0) - decidim-admin (= 0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-verifications (= 0.29.0) - hexapdf (~> 0.32.0) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (= 0.12.6.6) - decidim-meetings (0.29.0) - decidim-core (= 0.29.0) - decidim-forms (= 0.29.0) - icalendar (~> 2.5) - decidim-pages (0.29.0) - decidim-core (= 0.29.0) - decidim-participatory_processes (0.29.0) - decidim-core (= 0.29.0) - decidim-proposals (0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - doc2text (~> 0.4.7) - redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.29.0) - decidim-admin (= 0.29.0) - decidim-comments (= 0.29.0) - decidim-core (= 0.29.0) - decidim-proposals (= 0.29.0) - decidim-surveys (0.29.0) - decidim-core (= 0.29.0) - decidim-forms (= 0.29.0) - decidim-system (0.29.0) - active_link_to (~> 1.0) - decidim-core (= 0.29.0) - devise (~> 4.7) - devise-i18n (~> 1.2) - devise_invitable (~> 2.0, >= 2.0.9) - decidim-verifications (0.29.0) - decidim-core (= 0.29.0) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -462,8 +468,9 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.2) + icalendar (2.10.3) ice_cube (~> 0.16) + ostruct ice_cube (0.17.0) image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) @@ -593,6 +600,7 @@ GEM rack openssl (3.2.0) orm_adapter (0.5.0) + ostruct (0.6.0) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) @@ -741,15 +749,15 @@ GEM rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-performance (1.21.1) + rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.26.1) + rubocop-rails (2.26.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.0.5) + rubocop-rspec (3.1.0) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) @@ -767,7 +775,7 @@ GEM rubyzip (2.3.2) scout_apm (5.3.8) parser - selenium-webdriver (4.24.0) + selenium-webdriver (4.25.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -817,7 +825,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) uniform_notifier (1.16.0) uri (0.13.1) valid_email2 (4.0.6) @@ -842,7 +850,7 @@ GEM web-push (3.0.1) jwt (~> 2.0) openssl (~> 3.0) - webmock (3.23.1) + webmock (3.24.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -879,10 +887,10 @@ DEPENDENCIES barnes byebug dalli - decidim (= 0.29.0) - decidim-conferences (= 0.29.0) - decidim-dev (= 0.29.0) - decidim-initiatives (= 0.29.0) + decidim! + decidim-conferences! + decidim-dev! + decidim-initiatives! excon (>= 0.71.0) faker fog-aws diff --git a/package-lock.json b/package-lock.json index 1cf28a9..62a257e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,16 +8,16 @@ "name": "metadecidim", "version": "0.1.0", "dependencies": { - "@decidim/browserslist-config": "^0.29.0", - "@decidim/core": "^0.29.0", - "@decidim/webpacker": "^0.29.0", + "@decidim/browserslist-config": "file:packages/browserslist-config", + "@decidim/core": "file:packages/core", + "@decidim/webpacker": "file:packages/webpacker", "tailwindcss": "3.4.1" }, "devDependencies": { - "@decidim/dev": "^0.29.0", - "@decidim/eslint-config": "^0.29.0", - "@decidim/prettier-config": "^0.29.0", - "@decidim/stylelint-config": "^0.29.0" + "@decidim/dev": "file:packages/dev", + "@decidim/eslint-config": "file:packages/eslint-config", + "@decidim/prettier-config": "file:packages/prettier-config", + "@decidim/stylelint-config": "file:packages/stylelint-config" }, "engines": { "node": "18.17.1", @@ -2702,168 +2702,32 @@ } }, "node_modules/@decidim/browserslist-config": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/browserslist-config/-/browserslist-config-0.29.0.tgz", - "integrity": "sha512-8qL+9sYRXEdbTRA1ZIaF3ZUKSQjxwwul5pG1T4iQXQaxC3jbX0RdIgt8wrSDQ8CFUUyAI9r9hscUGIrnHmLUAw==" + "resolved": "packages/browserslist-config", + "link": true }, "node_modules/@decidim/core": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/core/-/core-0.29.0.tgz", - "integrity": "sha512-rpo6coWmoAP1LDYeXt8mobn1fq8WnphGmhOWq5TKFWutl5HB67UT0tVE7CKUvpyhM5kOC1Vd1VnXOb3lQe0UJw==", - "dependencies": { - "@emoji-mart/data": "^1.1.2", - "@rails/activestorage": "^7.0.8", - "@tarekraafat/autocomplete.js": "^10.2.6", - "@tiptap/core": "2.1.13", - "@tiptap/extension-blockquote": "2.1.13", - "@tiptap/extension-bold": "2.1.13", - "@tiptap/extension-bullet-list": "2.1.13", - "@tiptap/extension-character-count": "2.1.13", - "@tiptap/extension-code": "2.1.13", - "@tiptap/extension-code-block": "2.1.13", - "@tiptap/extension-document": "2.1.13", - "@tiptap/extension-dropcursor": "2.1.13", - "@tiptap/extension-gapcursor": "2.1.13", - "@tiptap/extension-hard-break": "2.1.13", - "@tiptap/extension-heading": "2.1.13", - "@tiptap/extension-history": "2.1.13", - "@tiptap/extension-horizontal-rule": "2.1.13", - "@tiptap/extension-image": "2.1.13", - "@tiptap/extension-italic": "2.1.13", - "@tiptap/extension-link": "2.1.13", - "@tiptap/extension-list-item": "2.1.13", - "@tiptap/extension-mention": "2.1.13", - "@tiptap/extension-ordered-list": "2.1.13", - "@tiptap/extension-paragraph": "2.1.13", - "@tiptap/extension-strike": "2.1.13", - "@tiptap/extension-text": "2.1.13", - "@tiptap/extension-underline": "2.1.13", - "@tiptap/pm": "2.1.13", - "@tiptap/starter-kit": "2.1.13", - "@tiptap/suggestion": "2.1.13", - "@zeitiger/appendaround": "^1.0.0", - "a11y-accordion-component": "^1.2.6", - "a11y-dialog-component": "^5.5.1", - "a11y-dropdown-component": "^1.2.0", - "classnames": "^2.2.5", - "d3": "^7.8.5", - "dayjs": "^1.11.0", - "diff": "^5.0.0", - "drag-on-drop": "^3.6.1", - "emoji-mart": "^5.5.2", - "emojibase": "^6.1.0", - "foundation-sites": "^6.7.0", - "graphiql": "^3.0.10", - "graphql-ws": ">= 4.5.0", - "html5sortable": "0.10.0", - "identity-obj-proxy": "^3.0.0", - "jquery": "^3.2.1", - "jquery-serializejson": "2.9.0", - "js-cookie": "^3.0.5", - "leaflet": "^1.9.4", - "leaflet-tilelayer-here": "^2.0.1", - "leaflet.markercluster": "^1.5.3", - "morphdom": "2.6.1", - "prop-types": "^15.7.2", - "raf": "^3.4.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-i18nify": "^6.1.2", - "select": "^1.1.2", - "svg4everybody": "2.1.9", - "tom-select": "2.2.2", - "wc-datepicker": "^0.5.2" - } + "resolved": "packages/core", + "link": true }, "node_modules/@decidim/dev": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/dev/-/dev-0.29.0.tgz", - "integrity": "sha512-m85pXwVszqSxmp+TWWciumPqi32bkcfB/9AYUqz1kq5jsd5UkWUI9FMZSejm0iJW7paWtXS3fKuVq4yRpHEATg==", - "dev": true, - "dependencies": { - "@linthtml/linthtml": "^0.9.6", - "axe-core": "^4.7.2", - "markdownlint-cli": "^0.35.0" - } + "resolved": "packages/dev", + "link": true }, "node_modules/@decidim/eslint-config": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/eslint-config/-/eslint-config-0.29.0.tgz", - "integrity": "sha512-5LmAFubxdaV0By5INH9kP39gXVoY/l7T8njsRcszYIVQS6ywwzZVy9aw7naqiXK8x6dfHIKPp8Y2NdiLnRFBFg==", - "dev": true, - "peerDependencies": { - "eslint": "^8.7.0", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-prettier": "^8.8.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-no-relative-import-paths": "^1.5.3", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-react": "^7.32.2" - } + "resolved": "packages/eslint-config", + "link": true }, "node_modules/@decidim/prettier-config": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/prettier-config/-/prettier-config-0.29.0.tgz", - "integrity": "sha512-5ckaCXu0tQ3dh2a1XUzXwZz60eG12rH4Wd6Rr/vNRbnNORVMO6cEbQop6HzBf7eq7alN3HM2lRC8BeUwQHAYBQ==", - "dev": true, - "peerDependencies": { - "prettier": "^2.3.2" - } + "resolved": "packages/prettier-config", + "link": true }, "node_modules/@decidim/stylelint-config": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/stylelint-config/-/stylelint-config-0.29.0.tgz", - "integrity": "sha512-qXnrMRg3I1dcP05eFDJTXlW97/UBV5069yudNTtFktaCkA3i2ZPZ28ZXN87FxIEQKfFMY4K7DYkaTMLaImTotA==", - "dev": true, - "peerDependencies": { - "stylelint": "^15.3.0", - "stylelint-prettier": "^3.0.0" - } + "resolved": "packages/stylelint-config", + "link": true }, "node_modules/@decidim/webpacker": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@decidim/webpacker/-/webpacker-0.29.0.tgz", - "integrity": "sha512-5Wnm8CEDerNUkve1e06/ctLkBQozfPCo98NCCycjVGryaOqfRweMX4rgF5zFGQzU8G/UFxQwAP/g88rlJlyMiQ==", - "dependencies": { - "@rails/ujs": "^6.1.7", - "@tailwindcss/typography": "^0.5.2", - "autoprefixer": "^10.4.14", - "compression-webpack-plugin": "^10.0.0", - "core-js": "~3.33.1", - "css-loader": "^6.8.1", - "esbuild": "^0.19.10", - "esbuild-loader": "^4.0.2", - "esbuild-sass-plugin": "^2.16.1", - "expose-loader": "^4.1.0", - "glob": "^10.3.3", - "js-yaml": "^4.1.0", - "mini-css-extract-plugin": "^2.7.6", - "path-complete-extname": "^1.0.0", - "pnp-webpack-plugin": "^1.7.0", - "postcss": ">=8.4.31", - "postcss-flexbugs-fixes": "^5.0.2", - "postcss-import": "^15.1.0", - "postcss-loader": "^7.3.3", - "postcss-preset-env": "^9.0.0", - "postcss-scss": "^4.0.6", - "sass-embedded": "^1.63.6", - "shakapacker": "~7.1.0", - "source-map-loader": "^4.0.1", - "style-loader": "^3.3.3", - "tailwindcss": "^3.4.1", - "terser-webpack-plugin": "^5.3.9", - "webpack": "^5.88.1", - "webpack-assets-manifest": "^5.1.0", - "webpack-cli": "^5.1.4", - "webpack-dev-server": "^4.15.1", - "webpack-merge": "^5.9.0", - "webpack-sources": "^3.2.3", - "workbox-recipes": "^7.0.0", - "workbox-webpack-plugin": "^7.0.0" - } + "resolved": "packages/webpacker", + "link": true }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", @@ -18044,6 +17908,170 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "packages/browserslist-config": { + "name": "@decidim/browserslist-config", + "version": "0.29.1", + "license": "AGPL-3.0" + }, + "packages/core": { + "name": "@decidim/core", + "version": "0.29.1", + "license": "AGPL-3.0", + "dependencies": { + "@emoji-mart/data": "^1.1.2", + "@rails/activestorage": "^7.0.8", + "@tarekraafat/autocomplete.js": "^10.2.6", + "@tiptap/core": "2.1.13", + "@tiptap/extension-blockquote": "2.1.13", + "@tiptap/extension-bold": "2.1.13", + "@tiptap/extension-bullet-list": "2.1.13", + "@tiptap/extension-character-count": "2.1.13", + "@tiptap/extension-code": "2.1.13", + "@tiptap/extension-code-block": "2.1.13", + "@tiptap/extension-document": "2.1.13", + "@tiptap/extension-dropcursor": "2.1.13", + "@tiptap/extension-gapcursor": "2.1.13", + "@tiptap/extension-hard-break": "2.1.13", + "@tiptap/extension-heading": "2.1.13", + "@tiptap/extension-history": "2.1.13", + "@tiptap/extension-horizontal-rule": "2.1.13", + "@tiptap/extension-image": "2.1.13", + "@tiptap/extension-italic": "2.1.13", + "@tiptap/extension-link": "2.1.13", + "@tiptap/extension-list-item": "2.1.13", + "@tiptap/extension-mention": "2.1.13", + "@tiptap/extension-ordered-list": "2.1.13", + "@tiptap/extension-paragraph": "2.1.13", + "@tiptap/extension-strike": "2.1.13", + "@tiptap/extension-text": "2.1.13", + "@tiptap/extension-underline": "2.1.13", + "@tiptap/pm": "2.1.13", + "@tiptap/starter-kit": "2.1.13", + "@tiptap/suggestion": "2.1.13", + "@zeitiger/appendaround": "^1.0.0", + "a11y-accordion-component": "^1.2.6", + "a11y-dialog-component": "^5.5.1", + "a11y-dropdown-component": "^1.2.0", + "classnames": "^2.2.5", + "d3": "^7.8.5", + "dayjs": "^1.11.0", + "diff": "^5.0.0", + "drag-on-drop": "^3.6.1", + "emoji-mart": "^5.5.2", + "emojibase": "^6.1.0", + "foundation-sites": "^6.7.0", + "graphiql": "^3.0.10", + "graphql-ws": ">= 4.5.0", + "html5sortable": "0.10.0", + "identity-obj-proxy": "^3.0.0", + "jquery": "^3.2.1", + "jquery-serializejson": "2.9.0", + "js-cookie": "^3.0.5", + "leaflet": "^1.9.4", + "leaflet-tilelayer-here": "^2.0.1", + "leaflet.markercluster": "^1.5.3", + "morphdom": "2.6.1", + "prop-types": "^15.7.2", + "raf": "^3.4.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-i18nify": "^6.1.2", + "select": "^1.1.2", + "svg4everybody": "2.1.9", + "tom-select": "2.2.2", + "wc-datepicker": "^0.5.2" + } + }, + "packages/dev": { + "name": "@decidim/dev", + "version": "0.29.1", + "dev": true, + "license": "AGPL-3.0", + "dependencies": { + "@linthtml/linthtml": "^0.9.6", + "axe-core": "^4.7.2", + "markdownlint-cli": "^0.35.0" + } + }, + "packages/eslint-config": { + "name": "@decidim/eslint-config", + "version": "0.29.1", + "dev": true, + "license": "AGPL-3.0", + "peerDependencies": { + "eslint": "^8.7.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^8.8.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-no-relative-import-paths": "^1.5.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.32.2" + } + }, + "packages/prettier-config": { + "name": "@decidim/prettier-config", + "version": "0.29.1", + "dev": true, + "license": "AGPL-3.0", + "peerDependencies": { + "prettier": "^2.3.2" + } + }, + "packages/stylelint-config": { + "name": "@decidim/stylelint-config", + "version": "0.29.1", + "dev": true, + "license": "AGPL-3.0", + "peerDependencies": { + "stylelint": "^15.3.0", + "stylelint-prettier": "^3.0.0" + } + }, + "packages/webpacker": { + "name": "@decidim/webpacker", + "version": "0.29.1", + "license": "AGPL-3.0", + "dependencies": { + "@rails/ujs": "^6.1.7", + "@tailwindcss/typography": "^0.5.2", + "autoprefixer": "^10.4.14", + "compression-webpack-plugin": "^10.0.0", + "core-js": "~3.33.1", + "css-loader": "^6.8.1", + "esbuild": "^0.19.10", + "esbuild-loader": "^4.0.2", + "esbuild-sass-plugin": "^2.16.1", + "expose-loader": "^4.1.0", + "glob": "^10.3.3", + "js-yaml": "^4.1.0", + "mini-css-extract-plugin": "^2.7.6", + "path-complete-extname": "^1.0.0", + "pnp-webpack-plugin": "^1.7.0", + "postcss": ">=8.4.31", + "postcss-flexbugs-fixes": "^5.0.2", + "postcss-import": "^15.1.0", + "postcss-loader": "^7.3.3", + "postcss-preset-env": "^9.0.0", + "postcss-scss": "^4.0.6", + "sass-embedded": "^1.63.6", + "shakapacker": "~7.1.0", + "source-map-loader": "^4.0.1", + "style-loader": "^3.3.3", + "tailwindcss": "^3.4.1", + "terser-webpack-plugin": "^5.3.9", + "webpack": "^5.88.1", + "webpack-assets-manifest": "^5.1.0", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^4.15.1", + "webpack-merge": "^5.9.0", + "webpack-sources": "^3.2.3", + "workbox-recipes": "^7.0.0", + "workbox-webpack-plugin": "^7.0.0" + } } } } diff --git a/package.json b/package.json index 605c740..e82f74a 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,9 @@ "name": "metadecidim", "private": true, "dependencies": { - "@decidim/browserslist-config": "^0.29.0", - "@decidim/core": "^0.29.0", - "@decidim/webpacker": "^0.29.0", + "@decidim/browserslist-config": "file:packages/browserslist-config", + "@decidim/core": "file:packages/core", + "@decidim/webpacker": "file:packages/webpacker", "tailwindcss": "3.4.1" }, "version": "0.1.0", @@ -12,10 +12,10 @@ "extends @decidim/browserslist-config" ], "devDependencies": { - "@decidim/dev": "^0.29.0", - "@decidim/eslint-config": "^0.29.0", - "@decidim/prettier-config": "^0.29.0", - "@decidim/stylelint-config": "^0.29.0" + "@decidim/dev": "file:packages/dev", + "@decidim/eslint-config": "file:packages/eslint-config", + "@decidim/prettier-config": "file:packages/prettier-config", + "@decidim/stylelint-config": "file:packages/stylelint-config" }, "engines": { "node": "18.17.1", diff --git a/packages/browserslist-config/index.js b/packages/browserslist-config/index.js new file mode 100644 index 0000000..3b90dd3 --- /dev/null +++ b/packages/browserslist-config/index.js @@ -0,0 +1,7 @@ +module.exports = [ // eslint-disable-line + "> 0.5%", + "last 2 versions", + "Firefox ESR", + "IE 11", + "not dead" +] diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json new file mode 100644 index 0000000..006a45c --- /dev/null +++ b/packages/browserslist-config/package.json @@ -0,0 +1,13 @@ +{ + "name": "@decidim/browserslist-config", + "description": "The Browserslist configuration for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/browserslist-config" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "main": "index.js" +} \ No newline at end of file diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..9f2c938 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,76 @@ +{ + "name": "@decidim/core", + "description": "The core dependencies for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/core" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "dependencies": { + "emoji-mart": "^5.5.2", + "@emoji-mart/data": "^1.1.2", + "@rails/activestorage": "^7.0.8", + "@tarekraafat/autocomplete.js": "^10.2.6", + "@tiptap/core": "2.1.13", + "@tiptap/extension-blockquote": "2.1.13", + "@tiptap/extension-bold": "2.1.13", + "@tiptap/extension-bullet-list": "2.1.13", + "@tiptap/extension-character-count": "2.1.13", + "@tiptap/extension-code": "2.1.13", + "@tiptap/extension-code-block": "2.1.13", + "@tiptap/extension-document": "2.1.13", + "@tiptap/extension-dropcursor": "2.1.13", + "@tiptap/extension-gapcursor": "2.1.13", + "@tiptap/extension-hard-break": "2.1.13", + "@tiptap/extension-heading": "2.1.13", + "@tiptap/extension-history": "2.1.13", + "@tiptap/extension-horizontal-rule": "2.1.13", + "@tiptap/extension-image": "2.1.13", + "@tiptap/extension-italic": "2.1.13", + "@tiptap/extension-link": "2.1.13", + "@tiptap/extension-list-item": "2.1.13", + "@tiptap/extension-mention": "2.1.13", + "@tiptap/extension-ordered-list": "2.1.13", + "@tiptap/extension-paragraph": "2.1.13", + "@tiptap/extension-strike": "2.1.13", + "@tiptap/extension-text": "2.1.13", + "@tiptap/extension-underline": "2.1.13", + "@tiptap/pm": "2.1.13", + "@tiptap/starter-kit": "2.1.13", + "@tiptap/suggestion": "2.1.13", + "@zeitiger/appendaround": "^1.0.0", + "a11y-accordion-component": "^1.2.6", + "a11y-dialog-component": "^5.5.1", + "a11y-dropdown-component": "^1.2.0", + "classnames": "^2.2.5", + "d3": "^7.8.5", + "dayjs": "^1.11.0", + "diff": "^5.0.0", + "drag-on-drop": "^3.6.1", + "emojibase": "^6.1.0", + "foundation-sites": "^6.7.0", + "graphiql": "^3.0.10", + "graphql-ws": ">= 4.5.0", + "html5sortable": "0.10.0", + "identity-obj-proxy": "^3.0.0", + "jquery": "^3.2.1", + "jquery-serializejson": "2.9.0", + "js-cookie": "^3.0.5", + "leaflet": "^1.9.4", + "leaflet-tilelayer-here": "^2.0.1", + "leaflet.markercluster": "^1.5.3", + "morphdom": "2.6.1", + "prop-types": "^15.7.2", + "raf": "^3.4.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-i18nify": "^6.1.2", + "select": "^1.1.2", + "svg4everybody": "2.1.9", + "tom-select": "2.2.2", + "wc-datepicker": "^0.5.2" + } +} diff --git a/packages/dev/package.json b/packages/dev/package.json new file mode 100644 index 0000000..85cb2bd --- /dev/null +++ b/packages/dev/package.json @@ -0,0 +1,17 @@ +{ + "name": "@decidim/dev", + "description": "The dev dependencies for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/dev" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "dependencies": { + "@linthtml/linthtml": "^0.9.6", + "axe-core": "^4.7.2", + "markdownlint-cli": "^0.35.0" + } +} diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js new file mode 100644 index 0000000..0224b22 --- /dev/null +++ b/packages/eslint-config/index.js @@ -0,0 +1,258 @@ +module.exports = { + // eslint-disable-line + env: { + browser: true, + es6: true, + es2021: true + }, + extends: ["eslint:recommended", "plugin:react/recommended", "prettier"], + parserOptions: { + ecmaFeatures: { + experimentalObjectRestSpread: true, + jsx: true + }, + sourceType: "module" + }, + plugins: ["react", + "no-relative-import-paths" + ], + globals: { + $: false, + jQuery: false, + React: false, + ReactDOM: false, + describe: false, + it: false, + expect: false, + beforeEach: false, + afterEach: false, + sinon: false, + GraphQLDocs: false, + SVGInjector: false, + require: false, + DecidimAdmin: false, + L: false, + decidimBulletinBoard: false, + Rails: false + }, + rules: { + "accessor-pairs": "error", + "array-bracket-spacing": "error", + "array-callback-return": "error", + "arrow-body-style": "off", + "arrow-parens": ["error", "always"], + "arrow-spacing": [ + "error", + { + after: true, + before: true + } + ], + "block-scoped-var": "error", + "block-spacing": "off", + "callback-return": "error", + camelcase: "error", + "class-methods-use-this": "off", + "comma-dangle": ["error", "never"], + "comma-spacing": [ + "error", + { + after: true, + before: false + } + ], + "comma-style": ["error", "last"], + complexity: "error", + "computed-property-spacing": ["error", "never"], + "consistent-return": "error", + "consistent-this": "error", + curly: "error", + "default-case": "error", + "dot-location": "error", + "dot-notation": "error", + "eol-last": "error", + eqeqeq: "error", + "func-call-spacing": "error", + "func-name-matching": "error", + "func-names": ["error", "never"], + "func-style": "error", + "generator-star-spacing": "error", + "global-require": "error", + "guard-for-in": "error", + "handle-callback-err": "error", + "id-blacklist": "error", + "id-length": "error", + "id-match": "error", + indent: ["error", 2, { VariableDeclarator: 2 }], + "init-declarations": "error", + "jsx-quotes": "error", + "key-spacing": "error", + "keyword-spacing": [ + "error", + { + after: true, + before: true + } + ], + "line-comment-position": "error", + "linebreak-style": ["error", "unix"], + "lines-around-comment": "error", + "lines-around-directive": "error", + "max-depth": "error", + "max-len": "off", + "max-lines": "error", + "max-nested-callbacks": "error", + "max-params": "error", + "max-statements": "off", + "max-statements-per-line": "error", + "multiline-ternary": "error", + "new-cap": "error", + "new-parens": "error", + "newline-after-var": "off", + "newline-before-return": "off", + "newline-per-chained-call": "off", + "no-alert": "error", + "no-array-constructor": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-catch-shadow": "error", + "no-confusing-arrow": "error", + "no-continue": "error", + "no-div-regex": "error", + "no-duplicate-imports": "error", + "no-else-return": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-extra-parens": "off", + "no-floating-decimal": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-inline-comments": "error", + "no-invalid-this": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-loop-func": "error", + "no-magic-numbers": "off", + "no-mixed-requires": "error", + "no-multi-spaces": "off", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-native-reassign": "error", + "no-negated-condition": "error", + "no-negated-in-lhs": "error", + "no-nested-ternary": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-wrappers": "error", + "no-octal-escape": "error", + "no-param-reassign": "error", + "no-path-concat": "error", + "no-plusplus": "error", + "no-process-env": "error", + "no-process-exit": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-relative-import-paths/no-relative-import-paths": [ + "warn", + { "allowSameFolder": false, "rootDir": "decidim-core/app/packs/" } + ], + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-modules": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-script-url": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-spaced-func": "error", + "no-sync": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-ternary": "off", + "no-throw-literal": "error", + "no-trailing-spaces": "off", + "no-undef-init": "error", + "no-undefined": "error", + "no-underscore-dangle": "off", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unused-expressions": "error", + "no-use-before-define": "error", + "no-useless-call": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-var": "error", + "no-void": "error", + "no-warning-comments": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-newline": "off", + "object-curly-spacing": "off", + "object-property-newline": [ + "error", + { + allowMultiplePropertiesPerLine: true + } + ], + "object-shorthand": "off", + "one-var": "off", + "one-var-declaration-per-line": "error", + "operator-assignment": "error", + "operator-linebreak": "error", + "padded-blocks": "off", + "prefer-arrow-callback": "off", + "prefer-const": "off", + "prefer-numeric-literals": "error", + "prefer-reflect": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "quote-props": "off", + quotes: ["error", "double", { avoidEscape: true }], + radix: "error", + "require-jsdoc": "error", + "rest-spread-spacing": "error", + semi: "off", + "semi-spacing": "error", + "sort-imports": "off", + "sort-keys": "off", + "sort-vars": "error", + "space-before-blocks": "error", + "space-before-function-paren": "off", + "space-in-parens": ["error", "never"], + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": ["error", "always"], + strict: "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "unicode-bom": ["error", "never"], + "valid-jsdoc": "error", + "vars-on-top": "error", + "wrap-iife": "error", + "wrap-regex": "error", + "yield-star-spacing": "error", + yoda: "error", + "import/no-named-as-default": "off", + "import/no-extraneous-dependencies": "off", + "react/prefer-stateless-function": "off", + "react/jsx-filename-extension": "off", + "react/no-multi-comp": "off", + "react/sort-comp": "off" + } +}; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json new file mode 100644 index 0000000..572de13 --- /dev/null +++ b/packages/eslint-config/package.json @@ -0,0 +1,25 @@ +{ + "name": "@decidim/eslint-config", + "description": "The eslint configuration for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/eslint-config" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "main": "index.js", + "peerDependencies": { + "eslint": "^8.7.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^8.8.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-no-relative-import-paths": "^1.5.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.32.2" + } +} diff --git a/packages/prettier-config/index.js b/packages/prettier-config/index.js new file mode 100644 index 0000000..4326492 --- /dev/null +++ b/packages/prettier-config/index.js @@ -0,0 +1,15 @@ +module.exports = { + useTabs: false, + trailingComma: "none", + tabWidth: 2, + overrides: [ + { + files: '*.scss', + options: { + parser: 'scss', + singleQuote: false + + } + } + ] +} diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json new file mode 100644 index 0000000..38601ee --- /dev/null +++ b/packages/prettier-config/package.json @@ -0,0 +1,16 @@ +{ + "name": "@decidim/prettier-config", + "description": "The prettier configuration for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/prettier-config" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "main": "index.js", + "peerDependencies": { + "prettier": "^2.3.2" + } +} diff --git a/packages/stylelint-config/index.js b/packages/stylelint-config/index.js new file mode 100644 index 0000000..10c73ac --- /dev/null +++ b/packages/stylelint-config/index.js @@ -0,0 +1,107 @@ +module.exports = { // eslint-disable-line + "extends": ["stylelint-prettier/recommended"], + "rules": { + "at-rule-empty-line-before": [ + "always", + { + "except": [ + "blockless-after-same-name-blockless", + "first-nested" + ], + "ignore": [ + "after-comment" + ], + "ignoreAtRules": [ + "else" + ] + } + ], + "block-no-empty": true, + "color-hex-length": "short", + "color-no-invalid-hex": true, + "comment-empty-line-before": [ + "always", + { + "except": [ + "first-nested" + ], + "ignore": [ + "stylelint-commands" + ] + } + ], + "comment-no-empty": true, + "comment-whitespace-inside": "always", + "custom-property-empty-line-before": [ + "always", + { + "except": [ + "after-custom-property", + "first-nested" + ], + "ignore": [ + "after-comment", + "inside-single-line-block" + ] + } + ], + "declaration-block-no-duplicate-properties": [ + true, + { + "ignore": [ + "consecutive-duplicates-with-different-values" + ] + } + ], + "declaration-block-no-redundant-longhand-properties": true, + "declaration-block-no-shorthand-property-overrides": true, + "declaration-block-single-line-max-declarations": 1, + "declaration-empty-line-before": [ + "always", + { + "except": [ + "after-declaration", + "first-nested" + ], + "ignore": [ + "after-comment", + "inside-single-line-block" + ] + } + ], + "function-calc-no-unspaced-operator": true, + "function-linear-gradient-no-nonstandard-direction": true, + "function-name-case": "lower", + "keyframe-declaration-no-important": true, + "length-zero-no-unit": true, + "media-feature-name-no-unknown": true, + "no-empty-source": true, + "no-invalid-double-slash-comments": true, + "property-no-unknown": true, + "rule-empty-line-before": [ + "always-multi-line", + { + "except": [ + "first-nested" + ], + "ignore": [ + "after-comment" + ] + } + ], + "selector-pseudo-class-no-unknown": true, + "selector-pseudo-element-colon-notation": "double", + "selector-pseudo-element-no-unknown": true, + "selector-type-case": "lower", + "selector-type-no-unknown": true, + "shorthand-property-no-redundant-values": true, + "string-no-newline": true, + "unit-no-unknown": true + }, + "overrides": [ + { + "files": ["**/*.scss"], + "customSyntax": "postcss-scss" + } + ] +} diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json new file mode 100644 index 0000000..935d785 --- /dev/null +++ b/packages/stylelint-config/package.json @@ -0,0 +1,17 @@ +{ + "name": "@decidim/stylelint-config", + "description": "The stylelint configuration for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/stylelint-config" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "main": "index.js", + "peerDependencies": { + "stylelint": "^15.3.0", + "stylelint-prettier": "^3.0.0" + } +} diff --git a/packages/webpacker/index.js b/packages/webpacker/index.js new file mode 100644 index 0000000..4754f5c --- /dev/null +++ b/packages/webpacker/index.js @@ -0,0 +1,10 @@ +const { generateWebpackConfig, ...restOpts } = require("shakapacker"); + +const webpackConfig = generateWebpackConfig(); +const overrideConfig = require("./src/override-config"); + +// eslint-disable-next-line no-undef +module.exports = { + webpackConfig: overrideConfig(webpackConfig), + ...restOpts +}; diff --git a/packages/webpacker/package.json b/packages/webpacker/package.json new file mode 100644 index 0000000..9420b19 --- /dev/null +++ b/packages/webpacker/package.json @@ -0,0 +1,50 @@ +{ + "name": "@decidim/webpacker", + "description": "The webpacker dependencies for Decidim", + "version": "0.29.1", + "repository": { + "url": "git@github.com:decidim/decidim.git", + "type": "git", + "directory": "packages/webpacker" + }, + "author": "Decidim Contributors", + "license": "AGPL-3.0", + "main": "index.js", + "dependencies": { + "@rails/ujs": "^6.1.7", + "@tailwindcss/typography": "^0.5.2", + "autoprefixer": "^10.4.14", + "compression-webpack-plugin": "^10.0.0", + "core-js": "~3.33.1", + "css-loader": "^6.8.1", + "expose-loader": "^4.1.0", + "esbuild": "^0.19.10", + "esbuild-loader": "^4.0.2", + "esbuild-sass-plugin": "^2.16.1", + "glob": "^10.3.3", + "js-yaml": "^4.1.0", + "mini-css-extract-plugin": "^2.7.6", + "path-complete-extname": "^1.0.0", + "pnp-webpack-plugin": "^1.7.0", + "postcss": ">=8.4.31", + "postcss-flexbugs-fixes": "^5.0.2", + "postcss-import": "^15.1.0", + "postcss-loader": "^7.3.3", + "postcss-preset-env": "^9.0.0", + "postcss-scss": "^4.0.6", + "sass-embedded": "^1.63.6", + "shakapacker": "~7.1.0", + "source-map-loader": "^4.0.1", + "style-loader": "^3.3.3", + "tailwindcss": "^3.4.1", + "terser-webpack-plugin": "^5.3.9", + "webpack": "^5.88.1", + "webpack-assets-manifest": "^5.1.0", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^4.15.1", + "webpack-merge": "^5.9.0", + "webpack-sources": "^3.2.3", + "workbox-recipes": "^7.0.0", + "workbox-webpack-plugin": "^7.0.0" + } +} diff --git a/packages/webpacker/src/loaders/decidim-sass-loader.js b/packages/webpacker/src/loaders/decidim-sass-loader.js new file mode 100644 index 0000000..e51cb91 --- /dev/null +++ b/packages/webpacker/src/loaders/decidim-sass-loader.js @@ -0,0 +1,88 @@ +const sass = require("sass-embedded"); +const url = require("url"); +const path = require("path"); +const { config: { additional_paths: loadPaths, stylesheet_imports: stylesheetImports } } = require("shakapacker"); + +const decidimImporter = { + canonicalize(importUrl, options) { + if (!options.fromImport) { + return null; + } + if (!importUrl.startsWith("!decidim-style-")) { + return null; + } + return new URL(`decidim:${importUrl}`); + }, + load(canonicalUrl) { + const matches = decodeURI(canonicalUrl.toString()).match(/^decidim:!decidim-style-([^[]+)\[([^\]]+)\]$/); + if (!matches) { + return { contents: "", syntax: "scss" }; + } + + if (!stylesheetImports) { + return { contents: "", syntax: "scss" }; + } + + const type = matches[1]; + const group = matches[2]; + if (!stylesheetImports[type] || !stylesheetImports[type][group]) { + // If the group is not defined, return an empty configuration because + // otherwise the importer would continue finding the asset through + // paths which obviously fails. + return { contents: "", syntax: "scss" }; + } + + const statements = stylesheetImports[type][group].map((style) => `@import "${style}";`); + + return { contents: statements.join("\n"), syntax: "scss" }; + } +}; + +/** + * Custom loader for compiling Sass. + * + * @param {String} content The content to compile + * @returns {void} + */ +module.exports = function(content) { // eslint-disable-line no-undef + const callback = this.async(); + + let result = null; + + try { + result = sass.compileString( + content, + { + loadPaths, + importers: [decidimImporter], + sourceMap: true, + sourceMapIncludeSources: true, + style: "expanded" + }, + ); + } catch (error) { + if (error.span && typeof error.span.url !== "undefined") { + this.addDependency(url.fileURLToPath(error.span.url)); + } + + callback(error); + + return; + } + + if (typeof result.loadedUrls !== "undefined") { + result.loadedUrls.forEach((includedFile) => { + if (includedFile.protocol !== "file:") { + return; + } + const normalizedIncludedFile = url.fileURLToPath(includedFile); + + // Custom `importer` can return only `contents` so includedFile will be relative + if (path.isAbsolute(normalizedIncludedFile)) { + this.addDependency(normalizedIncludedFile); + } + }); + } + + callback(null, result.css.toString(), result.sourceMap); +}; diff --git a/packages/webpacker/src/override-config.js b/packages/webpacker/src/override-config.js new file mode 100644 index 0000000..151d61f --- /dev/null +++ b/packages/webpacker/src/override-config.js @@ -0,0 +1,65 @@ +const path = require("path"); +const miniCssExtractPlugin = require("mini-css-extract-plugin"); +const { inliningCss } = require("shakapacker"); + +const overrideSassRule = (modifyConfig) => { + const sassLoaderPath = path.resolve(__dirname, "loaders/decidim-sass-loader") // eslint-disable-line no-undef + + const sassRule = modifyConfig.module.rules.find( + (rule) => rule.test.toString() === "/\\.(scss|sass)(\\.erb)?$/i" + ); + if (sassRule) { + const existingLoader = sassRule.use.find((use) => { + return (typeof use === "object") && use.loader.match(/sass-loader/); + }); + if (existingLoader) { + existingLoader.loader = sassLoaderPath; + } else { + sassRule.use.push({ loader: sassLoaderPath }); + } + } else { + // Add the sass rule + let baseLoader = "style-loader"; + if (!inliningCss) { + baseLoader = miniCssExtractPlugin.loader; + } + + // eslint-disable-next-line no-undef + let postCssConfig = path.resolve(__dirname, "../../../postcss.config.js"); + if (postCssConfig.includes("node_modules")) { + // eslint-disable-next-line no-undef + postCssConfig = path.resolve(__dirname, "../../../../postcss.config.js"); + } + + modifyConfig.module.rules.push({ + test: /\.(scss|sass)(\.erb)?$/i, + use: [ + baseLoader, + { + loader: require.resolve("css-loader"), + options: { + sourceMap: true, + importLoaders: 2 + } + }, + { + loader: "postcss-loader", + options: { + sourceMap: true, + postcssOptions: { + config: postCssConfig + } + } + }, + { + loader: sassLoaderPath + } + ] + }); + } + + return modifyConfig; +} + +// Since all modifiers are functions, we can use a reduce clause to apply all them +module.exports = (originalConfig) => [overrideSassRule].reduce((acc, modifier) => modifier(acc), originalConfig)