diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dc19b64d4..7df1a37d83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,6 +118,9 @@ commands: - run: name: "Run Legacy Promotion Tests" command: ./bin/build-ci legacy_promotions + - run: + name: "Run Friendly Promotion Tests" + command: ./bin/build-ci promotions - store_artifacts: path: /tmp/test-artifacts diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1ff5c6787e..b4ef66b182 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -295,6 +295,7 @@ Rails/ApplicationController: Rails/ApplicationJob: Exclude: - "legacy_promotions/app/jobs/spree/promotion_code_batch_job.rb" + - "promotions/app/jobs/solidus_promotions/promotion_code_batch_job.rb" # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -458,6 +459,8 @@ Rails/ReflectionClassName: - "core/app/models/spree/user_address.rb" - "core/app/models/spree/user_stock_location.rb" - "core/app/models/spree/wallet_payment_source.rb" + - "promotions/app/models/solidus_promotions/condition_user.rb" + - "promotions/app/models/solidus_promotions/conditions/user.rb" # Offense count: 23 # This cop supports safe autocorrection (--autocorrect). diff --git a/Gemfile b/Gemfile index 9b125f062a..7da89b8cd9 100644 --- a/Gemfile +++ b/Gemfile @@ -57,7 +57,7 @@ end group :admin do gem 'solidus_admin', path: 'admin', require: false - gem 'tailwindcss-rails', '~> 3.0', require: false + gem 'tailwindcss-rails', '~> 2.0', require: false gem 'axe-core-rspec', '~> 4.8', require: false gem 'axe-core-capybara', '~> 4.8', require: false end @@ -70,6 +70,15 @@ group :legacy_promotions do gem 'axe-core-capybara', '~> 4.8', require: false end +group :promotions do + gem 'solidus_promotions', path: 'promotions', require: false + gem 'solidus_admin', path: 'admin', require: false + gem 'solidus_backend', path: 'backend', require: false + gem 'axe-core-rspec', '~> 4.8', require: false + gem 'axe-core-capybara', '~> 4.8', require: false + gem 'shoulda-matchers', '~> 5.0', require: false +end + group :lint do gem 'erb-formatter', '~> 0.7', require: false gem 'rubocop', '~> 1', require: false diff --git a/bin/build-ci b/bin/build-ci index 0569fac041..5a168248ae 100755 --- a/bin/build-ci +++ b/bin/build-ci @@ -27,7 +27,8 @@ class Project new('backend', test_type: :teaspoon, title: "backend JS", weight: 18), new('core', weight: 266), new('sample', weight: 28), - new('legacy_promotions', weight: 63) + new('legacy_promotions', weight: 63), + new('promotions', weight: 63) ] end @@ -114,7 +115,6 @@ class Project end end - if ENV['CIRCLE_NODE_INDEX'] # Run projects on a CI node projects = Project.weighted_projects( node_total: Integer(ENV.fetch('CIRCLE_NODE_TOTAL', 1)), diff --git a/promotions/.circleci/config.yml b/promotions/.circleci/config.yml deleted file mode 100644 index d753afaf24..0000000000 --- a/promotions/.circleci/config.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: '2.1' -orbs: - browser-tools: circleci/browser-tools@1.1 - solidusio_extensions: solidusio/extensions@volatile -jobs: - lint: - executor: - name: solidusio_extensions/sqlite-memory - ruby_version: '3.1' - steps: - - checkout - - solidusio_extensions/test-branch: - command: bundle exec standardrb - command_verb: Check code style - run-specs-with-mysql: - executor: - name: solidusio_extensions/mysql - ruby_version: '3.2' - steps: - - browser-tools/install-chrome - - checkout - - solidusio_extensions/dependencies - - solidusio_extensions/run-tests-solidus-main - run-specs-with-postgres: - executor: - name: solidusio_extensions/postgres - ruby_version: '3.3.2' - steps: - - browser-tools/install-chrome - - checkout - - solidusio_extensions/dependencies - - solidusio_extensions/run-tests-solidus-main - run-specs-with-sqlite: - executor: - name: solidusio_extensions/sqlite - ruby_version: '3.1' - steps: - - browser-tools/install-chrome - - checkout - - solidusio_extensions/dependencies - - solidusio_extensions/run-tests-solidus-main -workflows: - Run specs on supported Solidus versions: - jobs: - - lint - - run-specs-with-postgres - - run-specs-with-mysql - - run-specs-with-sqlite - Weekly run specs against main: - jobs: - - run-specs-with-sqlite - triggers: - - schedule: - cron: 0 0 * * 4 - filters: - branches: - only: - - main diff --git a/promotions/.gem_release.yml b/promotions/.gem_release.yml deleted file mode 100644 index 8c2591b0db..0000000000 --- a/promotions/.gem_release.yml +++ /dev/null @@ -1,5 +0,0 @@ -bump: - recurse: false - file: 'lib/solidus_friendly_promotions/version.rb' - message: Bump SolidusFriendlyPromotions to %{version} - tag: true diff --git a/promotions/.github_changelog_generator b/promotions/.github_changelog_generator deleted file mode 100644 index eac0962107..0000000000 --- a/promotions/.github_changelog_generator +++ /dev/null @@ -1,2 +0,0 @@ -issues=false -exclude-labels=infrastructure diff --git a/promotions/.gitignore b/promotions/.gitignore deleted file mode 100644 index 1ba2096654..0000000000 --- a/promotions/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.gem -\#* -*~ -.#* -.DS_Store -.idea -.project -.sass-cache -coverage -Gemfile.lock -Gemfile-local -tmp -nbproject -pkg -*.swp -spec/dummy -spec/examples.txt -/sandbox -.rvmrc -.ruby-version -.ruby-gemset diff --git a/promotions/.rspec b/promotions/.rspec deleted file mode 100644 index 83e16f8044..0000000000 --- a/promotions/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/promotions/.rubocop.yml b/promotions/.rubocop.yml deleted file mode 100644 index efca29831b..0000000000 --- a/promotions/.rubocop.yml +++ /dev/null @@ -1,29 +0,0 @@ -inherit_from: .rubocop_todo.yml - -require: - - solidus_dev_support/rubocop - -AllCops: - NewCops: disable - - -RSpec/MultipleExpectations: - Max: 10 - -RSpec/MultipleMemoizedHelpers: - Max: 12 - -RSpec/NamedSubject: - Enabled: false - -RSpec/MessageSpies: - Enabled: false - -RSpec/ContextWording: - Enabled: false - -RSpec/NestedGroups: - Max: 5 - -RSpec/LetSetup: - Enabled: false diff --git a/promotions/.standard.yml b/promotions/.standard.yml deleted file mode 100644 index 8a60962ff4..0000000000 --- a/promotions/.standard.yml +++ /dev/null @@ -1,4 +0,0 @@ -ruby_version: 3.0 -ignore: - - 'sandbox/**/*' - - 'spec/dummy/**/*' diff --git a/promotions/CHANGELOG.md b/promotions/CHANGELOG.md deleted file mode 100644 index 313e9fa553..0000000000 --- a/promotions/CHANGELOG.md +++ /dev/null @@ -1,171 +0,0 @@ -# Changelog - -## [v1.0.1](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.1) (2024-05-07) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/v1.0.0...v1.0.1) - -**Closed issues:** - -- Ransack scope missing [\#105](https://github.com/friendlycart/solidus_friendly_promotions/issues/105) - -**Merged pull requests:** - -- Fix selenium path [\#108](https://github.com/friendlycart/solidus_friendly_promotions/pull/108) ([mamhoff](https://github.com/mamhoff)) -- Restrict SQLite to "~\> 1.3" [\#107](https://github.com/friendlycart/solidus_friendly_promotions/pull/107) ([mamhoff](https://github.com/mamhoff)) -- Fix ShippingRateDiscount\#promotion\_action [\#106](https://github.com/friendlycart/solidus_friendly_promotions/pull/106) ([mamhoff](https://github.com/mamhoff)) -- Fix specs [\#104](https://github.com/friendlycart/solidus_friendly_promotions/pull/104) ([mamhoff](https://github.com/mamhoff)) -- Fix Promotion Rule Unique per promotion validation [\#103](https://github.com/friendlycart/solidus_friendly_promotions/pull/103) ([mamhoff](https://github.com/mamhoff)) - -## [v1.0.0](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.0) (2024-01-25) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/v1.0.0.rc.3...v1.0.0) - -**Implemented enhancements:** - -- Implement better soft-delete [\#30](https://github.com/friendlycart/solidus_friendly_promotions/issues/30) - -**Closed issues:** - -- Cannot delete promotion with promotion code [\#94](https://github.com/friendlycart/solidus_friendly_promotions/issues/94) -- Missing action for button: Promotion code batch [\#93](https://github.com/friendlycart/solidus_friendly_promotions/issues/93) - -**Merged pull requests:** - -- Improve soft-deletion faculty [\#102](https://github.com/friendlycart/solidus_friendly_promotions/pull/102) ([mamhoff](https://github.com/mamhoff)) -- Add missing association between promo codes and order promotions [\#101](https://github.com/friendlycart/solidus_friendly_promotions/pull/101) ([mamhoff](https://github.com/mamhoff)) -- Revert "Temporarily disable running specs for Solidus main" [\#100](https://github.com/friendlycart/solidus_friendly_promotions/pull/100) ([mamhoff](https://github.com/mamhoff)) -- Add admin UI for promotion code batches [\#99](https://github.com/friendlycart/solidus_friendly_promotions/pull/99) ([mamhoff](https://github.com/mamhoff)) -- Define SolidusFriendlyPromotions.table\_name\_prefix early [\#98](https://github.com/friendlycart/solidus_friendly_promotions/pull/98) ([mamhoff](https://github.com/mamhoff)) - -## [v1.0.0.rc.3](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.0.rc.3) (2024-01-16) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/v1.0.0.rc.2...v1.0.0.rc.3) - -**Closed issues:** - -- Provide Integration Instructions for Starter Frontend [\#90](https://github.com/friendlycart/solidus_friendly_promotions/issues/90) - -**Merged pull requests:** - -- Add configuration option: `recalculate_complete_orders` [\#97](https://github.com/friendlycart/solidus_friendly_promotions/pull/97) ([mamhoff](https://github.com/mamhoff)) -- Fix standardrb violations [\#96](https://github.com/friendlycart/solidus_friendly_promotions/pull/96) ([mamhoff](https://github.com/mamhoff)) -- Fix admin sub menu entry visibility condition [\#92](https://github.com/friendlycart/solidus_friendly_promotions/pull/92) ([mickenorlen](https://github.com/mickenorlen)) -- Documentation fixes [\#91](https://github.com/friendlycart/solidus_friendly_promotions/pull/91) ([mamhoff](https://github.com/mamhoff)) -- Fix typo [\#89](https://github.com/friendlycart/solidus_friendly_promotions/pull/89) ([jarednorman](https://github.com/jarednorman)) -- Pass untranslated strings through i18n [\#88](https://github.com/friendlycart/solidus_friendly_promotions/pull/88) ([mamhoff](https://github.com/mamhoff)) - -## [v1.0.0.rc.2](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.0.rc.2) (2023-11-11) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/v1.0.0.rc.1...v1.0.0.rc.2) - -**Merged pull requests:** - -- Refactor: Extract `Promotion#applicable_line_items` [\#86](https://github.com/friendlycart/solidus_friendly_promotions/pull/86) ([mamhoff](https://github.com/mamhoff)) -- Coupon Promo Handler: Fix flaky spec [\#84](https://github.com/friendlycart/solidus_friendly_promotions/pull/84) ([mamhoff](https://github.com/mamhoff)) -- Use Remix icons if Solidus' admin\_updated\_navbar is enabled [\#83](https://github.com/friendlycart/solidus_friendly_promotions/pull/83) ([tvdeyen](https://github.com/tvdeyen)) -- Tiered calculators [\#82](https://github.com/friendlycart/solidus_friendly_promotions/pull/82) ([mamhoff](https://github.com/mamhoff)) -- Allow changing quantity for automatic line items [\#81](https://github.com/friendlycart/solidus_friendly_promotions/pull/81) ([mamhoff](https://github.com/mamhoff)) -- Update MIGRATING.md [\#80](https://github.com/friendlycart/solidus_friendly_promotions/pull/80) ([tvdeyen](https://github.com/tvdeyen)) -- Promotions index improvements [\#79](https://github.com/friendlycart/solidus_friendly_promotions/pull/79) ([mamhoff](https://github.com/mamhoff)) -- Lint: Fix standardrb error [\#78](https://github.com/friendlycart/solidus_friendly_promotions/pull/78) ([mamhoff](https://github.com/mamhoff)) - -## [v1.0.0.rc.1](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.0.rc.1) (2023-11-07) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/v1.0.0.pre...v1.0.0.rc.1) - -**Implemented enhancements:** - -- Implement Free items [\#31](https://github.com/friendlycart/solidus_friendly_promotions/issues/31) - -**Merged pull requests:** - -- Goodies! [\#75](https://github.com/friendlycart/solidus_friendly_promotions/pull/75) ([mamhoff](https://github.com/mamhoff)) -- Add a null promotion handler [\#71](https://github.com/friendlycart/solidus_friendly_promotions/pull/71) ([mamhoff](https://github.com/mamhoff)) - -## [v1.0.0.pre](https://github.com/friendlycart/solidus_friendly_promotions/tree/v1.0.0.pre) (2023-11-07) - -[Full Changelog](https://github.com/friendlycart/solidus_friendly_promotions/compare/e14802957fdb55d7f4e2730341e4cbb118ebf993...v1.0.0.pre) - -**Implemented enhancements:** - -- Migrator: Copy promotion codes [\#34](https://github.com/friendlycart/solidus_friendly_promotions/issues/34) -- Add original\_promotion\_{action\_}id on promotions and promotion actions [\#33](https://github.com/friendlycart/solidus_friendly_promotions/issues/33) - -**Fixed bugs:** - -- Migrator: Add support for promotion categories [\#37](https://github.com/friendlycart/solidus_friendly_promotions/issues/37) - -**Closed issues:** - -- Document DB tables [\#35](https://github.com/friendlycart/solidus_friendly_promotions/issues/35) - -**Merged pull requests:** - -- Use new NestedClassSet for configuring calculators [\#77](https://github.com/friendlycart/solidus_friendly_promotions/pull/77) ([mamhoff](https://github.com/mamhoff)) -- Refactor to FriendlyPromotion::FriendlyPromotionAdjuster [\#76](https://github.com/friendlycart/solidus_friendly_promotions/pull/76) ([mamhoff](https://github.com/mamhoff)) -- Add bundler/gem\_tasks [\#74](https://github.com/friendlycart/solidus_friendly_promotions/pull/74) ([mamhoff](https://github.com/mamhoff)) -- Fix order discounter spec [\#73](https://github.com/friendlycart/solidus_friendly_promotions/pull/73) ([mamhoff](https://github.com/mamhoff)) -- Quantity tiered calculator [\#72](https://github.com/friendlycart/solidus_friendly_promotions/pull/72) ([mamhoff](https://github.com/mamhoff)) -- Add PromotionHandler::Page [\#70](https://github.com/friendlycart/solidus_friendly_promotions/pull/70) ([mamhoff](https://github.com/mamhoff)) -- Never create adjustments with a zero amount [\#69](https://github.com/friendlycart/solidus_friendly_promotions/pull/69) ([mamhoff](https://github.com/mamhoff)) -- Ignore shipping rates that have no cost [\#68](https://github.com/friendlycart/solidus_friendly_promotions/pull/68) ([davecandlescience](https://github.com/davecandlescience)) -- Refactor promotions eligibility [\#67](https://github.com/friendlycart/solidus_friendly_promotions/pull/67) ([mamhoff](https://github.com/mamhoff)) -- Refactor order promotions migrator [\#66](https://github.com/friendlycart/solidus_friendly_promotions/pull/66) ([mamhoff](https://github.com/mamhoff)) -- Add migrate order promotions rake task [\#65](https://github.com/friendlycart/solidus_friendly_promotions/pull/65) ([davecandlescience](https://github.com/davecandlescience)) -- Add missing relation: SolidusFriendlyPromotions\#order\_promotions [\#64](https://github.com/friendlycart/solidus_friendly_promotions/pull/64) ([mamhoff](https://github.com/mamhoff)) -- Promo Migrator: Ignore missing rules and actions [\#63](https://github.com/friendlycart/solidus_friendly_promotions/pull/63) ([mamhoff](https://github.com/mamhoff)) -- Improve spec for product rule [\#62](https://github.com/friendlycart/solidus_friendly_promotions/pull/62) ([mamhoff](https://github.com/mamhoff)) -- Do not call Spree::PromotionHandler::Shipping when SFP is active [\#61](https://github.com/friendlycart/solidus_friendly_promotions/pull/61) ([mamhoff](https://github.com/mamhoff)) -- Add a migration guide [\#60](https://github.com/friendlycart/solidus_friendly_promotions/pull/60) ([mamhoff](https://github.com/mamhoff)) -- Add a PromotionHandler::Coupon [\#59](https://github.com/friendlycart/solidus_friendly_promotions/pull/59) ([mamhoff](https://github.com/mamhoff)) -- Backports minimum quantity promotion rule from Solidus [\#58](https://github.com/friendlycart/solidus_friendly_promotions/pull/58) ([mamhoff](https://github.com/mamhoff)) -- Backport promotion code batch fix from Solidus [\#57](https://github.com/friendlycart/solidus_friendly_promotions/pull/57) ([mamhoff](https://github.com/mamhoff)) -- Add a rake task to migrate adjustments from legacy promotions [\#56](https://github.com/friendlycart/solidus_friendly_promotions/pull/56) ([mamhoff](https://github.com/mamhoff)) -- Add missing shipping\_rate translation [\#55](https://github.com/friendlycart/solidus_friendly_promotions/pull/55) ([davecandlescience](https://github.com/davecandlescience)) -- Fix shipping rate discount factory [\#54](https://github.com/friendlycart/solidus_friendly_promotions/pull/54) ([mamhoff](https://github.com/mamhoff)) -- Order Discounter: Create valid shipping rate discounts [\#53](https://github.com/friendlycart/solidus_friendly_promotions/pull/53) ([mamhoff](https://github.com/mamhoff)) -- FriendlyPromotionDiscounter: Always return @order [\#52](https://github.com/friendlycart/solidus_friendly_promotions/pull/52) ([mamhoff](https://github.com/mamhoff)) -- Line Item Product Rule: Add error messaging [\#50](https://github.com/friendlycart/solidus_friendly_promotions/pull/50) ([mamhoff](https://github.com/mamhoff)) -- Fix: SolidusFriendlyPromotions, not Shipping [\#49](https://github.com/friendlycart/solidus_friendly_promotions/pull/49) ([mamhoff](https://github.com/mamhoff)) -- Import eligiblity error messages from Solidus [\#48](https://github.com/friendlycart/solidus_friendly_promotions/pull/48) ([mamhoff](https://github.com/mamhoff)) -- Faster promotion code migration [\#47](https://github.com/friendlycart/solidus_friendly_promotions/pull/47) ([mamhoff](https://github.com/mamhoff)) -- Migrator: Store original promotion and promotion action [\#46](https://github.com/friendlycart/solidus_friendly_promotions/pull/46) ([mamhoff](https://github.com/mamhoff)) -- Lint with standardrb in CI [\#45](https://github.com/friendlycart/solidus_friendly_promotions/pull/45) ([mamhoff](https://github.com/mamhoff)) -- Migrator: Migrate promotion codes and promotion code batches [\#44](https://github.com/friendlycart/solidus_friendly_promotions/pull/44) ([mamhoff](https://github.com/mamhoff)) -- Migrate promotion categories and association [\#43](https://github.com/friendlycart/solidus_friendly_promotions/pull/43) ([davecandlescience](https://github.com/davecandlescience)) -- On the fly order promotions [\#42](https://github.com/friendlycart/solidus_friendly_promotions/pull/42) ([mamhoff](https://github.com/mamhoff)) -- Add back references to promotions and actions [\#41](https://github.com/friendlycart/solidus_friendly_promotions/pull/41) ([davecandlescience](https://github.com/davecandlescience)) -- Fix spec warning in promotion rules spec [\#40](https://github.com/friendlycart/solidus_friendly_promotions/pull/40) ([mamhoff](https://github.com/mamhoff)) -- Transparently replace promotion adjustments [\#39](https://github.com/friendlycart/solidus_friendly_promotions/pull/39) ([mamhoff](https://github.com/mamhoff)) -- Add DB comments to tables [\#38](https://github.com/friendlycart/solidus_friendly_promotions/pull/38) ([mamhoff](https://github.com/mamhoff)) -- Fix Promotion Map [\#36](https://github.com/friendlycart/solidus_friendly_promotions/pull/36) ([mamhoff](https://github.com/mamhoff)) -- Fix specs [\#29](https://github.com/friendlycart/solidus_friendly_promotions/pull/29) ([mamhoff](https://github.com/mamhoff)) -- Add Promotion Migrator [\#28](https://github.com/friendlycart/solidus_friendly_promotions/pull/28) ([mamhoff](https://github.com/mamhoff)) -- Polyvalent rules [\#27](https://github.com/friendlycart/solidus_friendly_promotions/pull/27) ([mamhoff](https://github.com/mamhoff)) -- Fix Turbo frame tags for Turbo 1.5 [\#26](https://github.com/friendlycart/solidus_friendly_promotions/pull/26) ([mamhoff](https://github.com/mamhoff)) -- Allow destroying promotions [\#25](https://github.com/friendlycart/solidus_friendly_promotions/pull/25) ([mamhoff](https://github.com/mamhoff)) -- Fix class name option in line item taxon association [\#24](https://github.com/friendlycart/solidus_friendly_promotions/pull/24) ([mamhoff](https://github.com/mamhoff)) -- Move factories to factories folder [\#23](https://github.com/friendlycart/solidus_friendly_promotions/pull/23) ([mamhoff](https://github.com/mamhoff)) -- Add links to legacy promotions in Solidus 4.1 [\#22](https://github.com/friendlycart/solidus_friendly_promotions/pull/22) ([mamhoff](https://github.com/mamhoff)) -- Make lanes configurable [\#21](https://github.com/friendlycart/solidus_friendly_promotions/pull/21) ([mamhoff](https://github.com/mamhoff)) -- Allow order rules per lane [\#20](https://github.com/friendlycart/solidus_friendly_promotions/pull/20) ([mamhoff](https://github.com/mamhoff)) -- Add PermissionSet for Friendly Promotions [\#19](https://github.com/friendlycart/solidus_friendly_promotions/pull/19) ([mamhoff](https://github.com/mamhoff)) -- Add "only" match policy to product rule [\#18](https://github.com/friendlycart/solidus_friendly_promotions/pull/18) ([mamhoff](https://github.com/mamhoff)) -- Require solidus [\#17](https://github.com/friendlycart/solidus_friendly_promotions/pull/17) ([mamhoff](https://github.com/mamhoff)) -- Customer label [\#16](https://github.com/friendlycart/solidus_friendly_promotions/pull/16) ([mamhoff](https://github.com/mamhoff)) -- System specs with turbo [\#15](https://github.com/friendlycart/solidus_friendly_promotions/pull/15) ([mamhoff](https://github.com/mamhoff)) -- Reference our own I18n namespace in views [\#14](https://github.com/friendlycart/solidus_friendly_promotions/pull/14) ([mamhoff](https://github.com/mamhoff)) -- Use different path for friendly promotions [\#13](https://github.com/friendlycart/solidus_friendly_promotions/pull/13) ([mamhoff](https://github.com/mamhoff)) -- Add dependent: :destroy to Spree::Order\#friendly\_promotions [\#12](https://github.com/friendlycart/solidus_friendly_promotions/pull/12) ([mamhoff](https://github.com/mamhoff)) -- Extract promotion loading from promo discounter [\#11](https://github.com/friendlycart/solidus_friendly_promotions/pull/11) ([mamhoff](https://github.com/mamhoff)) -- Remove delegators [\#10](https://github.com/friendlycart/solidus_friendly_promotions/pull/10) ([mamhoff](https://github.com/mamhoff)) -- Fix standardrb error in promotion rule spec [\#8](https://github.com/friendlycart/solidus_friendly_promotions/pull/8) ([mamhoff](https://github.com/mamhoff)) -- Stacking Promotions [\#7](https://github.com/friendlycart/solidus_friendly_promotions/pull/7) ([mamhoff](https://github.com/mamhoff)) -- Add "Lane" enum to Promotion [\#6](https://github.com/friendlycart/solidus_friendly_promotions/pull/6) ([mamhoff](https://github.com/mamhoff)) -- Lint using standardrb gem [\#5](https://github.com/friendlycart/solidus_friendly_promotions/pull/5) ([mamhoff](https://github.com/mamhoff)) -- Promotion Actions: Implement "edit" action [\#4](https://github.com/friendlycart/solidus_friendly_promotions/pull/4) ([mamhoff](https://github.com/mamhoff)) -- Initializer: Use new MenuItem API from Solidus 4.2 onwards [\#3](https://github.com/friendlycart/solidus_friendly_promotions/pull/3) ([mamhoff](https://github.com/mamhoff)) - - - -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/promotions/Gemfile b/promotions/Gemfile deleted file mode 100644 index ed692466e0..0000000000 --- a/promotions/Gemfile +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -branch = ENV.fetch("SOLIDUS_BRANCH", "main") -gem "solidus", github: "solidusio/solidus", branch: branch - -# The solidus_frontend gem has been pulled out since v3.2 -gem "solidus_frontend", github: "solidusio/solidus_frontend" if branch == "master" -gem "solidus_frontend" if branch >= "v3.2" # rubocop:disable Bundler/DuplicatedGem - -# Needed to help Bundler figure out how to resolve dependencies, -# otherwise it takes forever to resolve them. -# See https://github.com/bundler/bundler/issues/6677 -gem "rails", ">0.a" - -# Provides basic authentication functionality for testing parts of your engine -gem "solidus_auth_devise" - -gem "solidus_admin", github: "solidusio/solidus", branch: branch -gem "axe-core-rspec", "~> 4.8", require: false -gem "axe-core-capybara", "~> 4.8", require: false - -case ENV.fetch("DB", nil) -when "mysql" - gem "mysql2" -when "postgresql" - gem "pg" -else - gem "sqlite3", "~> 1.3" -end - -gemspec - -# Use a local Gemfile to include development dependencies that might not be -# relevant for the project or for other contributors, e.g. pry-byebug. -# -# We use `send` instead of calling `eval_gemfile` to work around an issue with -# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658. -send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local" diff --git a/promotions/LICENSE b/promotions/LICENSE deleted file mode 100644 index 375c0dd192..0000000000 --- a/promotions/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2023 Martin Meyerhoff -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name Solidus nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/promotions/bin/console b/promotions/bin/console deleted file mode 100755 index 5170bfc2da..0000000000 --- a/promotions/bin/console +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -# frozen_string_literal: true - -require "bundler/setup" -require "solidus_friendly_promotions" - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. -$LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"]) - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - -require "irb" -IRB.start(__FILE__) diff --git a/promotions/bin/rails-sandbox b/promotions/bin/rails-sandbox deleted file mode 100755 index ad2df04d0e..0000000000 --- a/promotions/bin/rails-sandbox +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby - -app_root = 'sandbox' - -unless File.exist? "#{app_root}/bin/rails" - warn 'Creating the sandbox app...' - Dir.chdir "#{__dir__}/.." do - system "#{__dir__}/sandbox" or begin - warn 'Automatic creation of the sandbox app failed' - exit 1 - end - end -end - -Dir.chdir app_root -exec 'bin/rails', *ARGV diff --git a/promotions/bin/rake b/promotions/bin/rake deleted file mode 100755 index 1e6eacd34e..0000000000 --- a/promotions/bin/rake +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rake", "rake") diff --git a/promotions/bin/sandbox b/promotions/bin/sandbox deleted file mode 100755 index 13d9faa8a7..0000000000 --- a/promotions/bin/sandbox +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -set -e -test -z "${DEBUG+empty_string}" || set -x - -test "$DB" = "sqlite" && export DB="sqlite3" - -if [ -z "$PAYMENT_METHOD" ] -then - PAYMENT_METHOD="none" -fi - -if [ -z "$SOLIDUS_BRANCH" ] -then - echo "~~> Use 'export SOLIDUS_BRANCH=[main|v4.0|...]' to control the Solidus branch" - SOLIDUS_BRANCH="main" -fi -echo "~~> Using branch $SOLIDUS_BRANCH of solidus" - -extension_name="solidus_friendly_promotions" - -# Stay away from the bundler env of the containing extension. -function unbundled { - ruby -rbundler -e' - Bundler.with_unbundled_env {system *ARGV}' -- \ - env BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES=true $@ -} - -echo "~~~> Removing the old sandbox" -rm -rf ./sandbox - -echo "~~~> Creating a pristine Rails app" -rails new sandbox \ - --database="${DB:-sqlite3}" \ - --skip-git \ - --skip-keeps \ - --skip-rc \ - --skip-bootsnap \ - --skip-test - -if [ ! -d "sandbox" ]; then - echo 'sandbox rails application failed' - exit 1 -fi - -echo "~~~> Adding solidus (with i18n) to the Gemfile" -cd ./sandbox -cat <> Gemfile -gem 'solidus', github: 'solidusio/solidus', branch: '$SOLIDUS_BRANCH' -gem 'rails-i18n' -gem 'solidus_i18n' -gem 'solidus_auth_devise' - -gem '$extension_name', path: '..' - -group :test, :development do - platforms :mri do - gem 'pry-byebug' - end -end -RUBY - -unbundled bundle install --gemfile Gemfile - -unbundled bundle exec rake db:drop db:create - -unbundled bundle exec rails generate solidus:install \ - --auto-accept \ - $@ - -unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations -unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations - -echo -echo "๐Ÿš€ Sandbox app successfully created for $extension_name!" -echo "๐Ÿงช This app is intended for test purposes." diff --git a/promotions/bin/setup b/promotions/bin/setup deleted file mode 100755 index 67d919320a..0000000000 --- a/promotions/bin/setup +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -set -vx - -gem install bundler --conservative -bundle update -bin/rake clobber diff --git a/promotions/solidus_promotions.gemspec b/promotions/solidus_promotions.gemspec index 118c1575d7..7f67644ee3 100644 --- a/promotions/solidus_promotions.gemspec +++ b/promotions/solidus_promotions.gemspec @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../core/lib/spree/core/version.rb' +require_relative "../core/lib/spree/core/version" Gem::Specification.new do |spec| spec.platform = Gem::Platform::RUBY @@ -24,23 +24,10 @@ Gem::Specification.new do |spec| files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") } spec.files = files.grep_v(%r{^(test|spec|features)/}) + spec.add_dependency "importmap-rails", "~> 1.2" + spec.add_dependency "ransack-enum", "~> 1.0" spec.add_dependency "solidus_core", [">= 4.0.0", "< 5"] spec.add_dependency "solidus_support", "~> 0.5" - spec.add_dependency "turbo-rails", ">= 1.4" spec.add_dependency "stimulus-rails", "~> 1.2" - spec.add_dependency "importmap-rails", "~> 1.2" - spec.add_dependency "ransack-enum", "~> 1.0" - - spec.add_development_dependency "capybara", "~> 3.29" - spec.add_development_dependency "database_cleaner", [">= 1.7", "< 3"] - spec.add_development_dependency "factory_bot", ">= 4.8" - spec.add_development_dependency "factory_bot_rails" - spec.add_development_dependency "rspec-activemodel-mocks", "~> 1.0" - spec.add_development_dependency "rspec-retry" - spec.add_development_dependency "rspec-rails", ">= 5.0", "< 7.0" - spec.add_development_dependency "selenium-webdriver", "~> 4.11" - spec.add_development_dependency "shoulda-matchers", "~> 5.3" - spec.add_development_dependency "standard", "~> 1.31" - spec.add_development_dependency "tailwindcss-rails", "~> 2.2" - spec.add_development_dependency "puma", ">= 4.3", "< 7.0" + spec.add_dependency "turbo-rails", ">= 1.4" end