Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Extract spree_cli into separate spree_extension gem (#13565)

Damian Legawiec5f87b5701358
diff --git a/CLAUDE.md b/CLAUDE.md
index 5d89fccf47..cd021e9685 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -8,7 +8,7 @@
- All Spree code must be namespaced under `Spree::` module
- Spree is distributed as Rails engines with separate packages:
- **Core packages (required):** `spree_core` (models, services, business logic), `spree_api` (Storefront API, Platform API, Webhooks)
- - **Optional packages:** `spree_admin` (admin dashboard), `spree_cli` (CLI tool), `spree_storefront` (Rails storefront), `spree_emails` (transactional emails), `spree_page_builder` (visual page builder), `spree_sample` (sample data), `spree_dev_tools` (development/testing utilities)
+ - **Optional packages:** `spree_admin` (admin dashboard), `spree_storefront` (Rails storefront), `spree_emails` (transactional emails), `spree_page_builder` (visual page builder), `spree_sample` (sample data), `spree_dev_tools` (development/testing utilities)
- Most users run Spree in headless mode with custom frontends using the Storefront API
- Follow Rails conventions and the Rails Security Guide
- Prefer Rails idioms and standard patterns over custom solutions
diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock
index 476520f974..df1e4570e3 100644
--- a/backend/Gemfile.lock
+++ b/backend/Gemfile.lock
@@ -37,7 +37,6 @@ PATH
specs:
spree (5.4.0.alpha)
spree_api (= 5.4.0.alpha)
- spree_cli (= 5.4.0.alpha)
spree_core (= 5.4.0.alpha)
spree_api (5.4.0.alpha)
alba (~> 3.0)
@@ -45,8 +44,6 @@ PATH
pagy (~> 43.0)
spree_core (= 5.4.0.alpha)
typelizer (~> 0.7)
- spree_cli (5.4.0.alpha)
- thor (~> 1.0)
spree_core (5.4.0.alpha)
active_storage_validations (= 1.3.0)
activemerchant (~> 1.67)
@@ -583,7 +580,7 @@ GEM
rbs (3.10.3)
logger
tsort
- rdoc (7.1.0)
+ rdoc (7.2.0)
erb
psych (>= 4.0.0)
tsort
@@ -1043,7 +1040,7 @@ CHECKSUMS
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
rbs (3.10.3) sha256=70627f3919016134d554e6c99195552ae3ef6020fe034c8e983facc9c192daa6
- rdoc (7.1.0) sha256=494899df0706c178596ca6e1d50f1b7eb285a9b2aae715be5abd742734f17363
+ rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
request_store (1.7.0) sha256=e1b75d5346a315f452242a68c937ef8e48b215b9453a77a6c0acdca2934c88cb
@@ -1081,7 +1078,6 @@ CHECKSUMS
spree (5.4.0.alpha)
spree_admin (5.4.0.alpha)
spree_api (5.4.0.alpha)
- spree_cli (5.4.0.alpha)
spree_core (5.4.0.alpha)
spree_dev_tools (0.5.3) sha256=64ae7b215ac5d5c5f5890f6fc0dbcb12882b9af305a860f36f95f564ec240a75
spree_emails (5.4.0.alpha)
diff --git a/backend/bin/licenses.sh b/backend/bin/licenses.sh
index e6e7986e13..c7180c6272 100755
--- a/backend/bin/licenses.sh
+++ b/backend/bin/licenses.sh
@@ -10,6 +10,5 @@ license_finder ignored_dependencies add spree_api
license_finder ignored_dependencies add spree_core
license_finder ignored_dependencies add spree_emails
license_finder ignored_dependencies add spree_sample
-license_finder ignored_dependencies add spree_cli
license_finder report --use-spdx-id --format json --aggregate-paths='admin' 'api' 'core' 'emails' --save=licenses.json
diff --git a/backend/bin/spree b/backend/bin/spree
deleted file mode 100755
index 26bcb1a7c4..0000000000
--- a/backend/bin/spree
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by the `bin/rails g spree_cli:install` command.
-# It loads your application's bundled version of spree_cli.
-#
-
-require 'bundler/setup'
-require 'spree_cli'
diff --git a/backend/engines/cli/LICENSE.md b/backend/engines/cli/LICENSE.md
deleted file mode 100644
index ad3ddf47ca..0000000000
--- a/backend/engines/cli/LICENSE.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# License
-
-Copyright © 2024-present, Vendo Connect Inc.
-
-Copyright © 2015-2024, Spark Solutions Sp. z o.o.
-
-Copyright © 2007-2015, Spree Commerce Inc.
-
-Spree Commerce is a free, open-source eCommerce framework giving you full control and customizability.
-
-For **Spree Commerce versions 4.10** and later in the [spree/spree](https://github.com/spree/spree) repository two licenses apply simultaneously and users are required to comply with the terms of these two licenses at the same time:
-
-* [AGPL-3.0](https://opensource.org/license/agpl-v3) - for all contributions from version 4.10 onwards
-
-* [BSD-3-Clause](https://opensource.org/license/bsd-3-clause) - for all other contributions predating version 4.10
-Effectively, for versions 4.10 and upwards **AGPL-3.0** license applies.
-
-**Spree Commerce versions 4.9** and earlier in the [spree/spree](https://github.com/spree/spree) repository are available under the **BSD-3-Clause** license and users are required to comply with its terms.
-
-If you’d like to use Spree Commerce without the AGPL-3.0 restrictions e.g. for a **SaaS** business, please talk to us about obtaining a [Commercial License](#commercial-license).
-
-All third party components incorporated into this software are licensed under the original license provided by the owner of the applicable component.
-
-Please refer to our [Licensing FAQ](https://spreecommerce.org/why-spree-is-changing-its-open-source-license-to-agpl-3-0-and-introducing-a-commercial-license/) in case of questions.
-
-## AGPL-3.0 License - Spree 4.10 upwards
-
-If you decide to accept the AGPL-3.0 license by using Spree Commerce version 4.10 or later, you must comply with the following terms:
-
-This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
-
-## BSD 3-Clause License
-
-If you decide to accept the BSD-3-Clause license by using Spree Commerce, you must comply with the following terms:
-
-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 of Spree Commerce Inc. 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.
-
-## Commercial License
-
-Should you decide to use Spree Commerce version 4.10 or later for commercial redistribution (eg. SaaS) - also known as Commercial Distribution - you must do so in accordance with the terms and conditions contained in a separate written agreement between you and [Vendo Connect Inc.](https://www.getvendo.com/).
-
-For more information about the Commercial License (CL) please contact [[email protected]](mailto:[email protected]).
-
-Please refer to our [Licensing FAQ](https://spreecommerce.org/why-spree-is-changing-its-open-source-license-to-agpl-3-0-and-introducing-a-commercial-license/) in case of questions.
diff --git a/backend/engines/cli/README.md b/backend/engines/cli/README.md
deleted file mode 100644
index 9da67f0a47..0000000000
--- a/backend/engines/cli/README.md
+++ /dev/null
@@ -1,182 +0,0 @@
-# Spree CLI
-
-[![Gem Version](https://badge.fury.io/rb/spree_cli.svg)](https://badge.fury.io/rb/spree_cli)
-
-Spree CLI is a command-line tool for Spree Commerce developers, providing generators and utilities for creating Spree extensions and managing Spree projects.
-
-## Installation
-
-This gem is included in every Spree installation.
-
-For global installation (to generate extensions outside of a Spree project):
-
-```bash
-gem install spree_cli
-```
-
-## Commands
-
-### Create New Extension
-
-Generate a new Spree extension with all the necessary boilerplate:
-
-```bash
-spree extension my_extension
-```
-
-This creates a new directory `spree_my_extension` with:
-
-```
-spree_my_extension/
-├── app/
-│ ├── models/
-│ ├── controllers/
-│ └── views/
-├── lib/
-│ ├── spree_my_extension.rb
-│ ├── spree_my_extension/
-│ │ └── engine.rb
-│ └── generators/
-├── config/
-│ ├── routes.rb
-│ └── locales/
-├── db/
-│ └── migrate/
-├── spec/
-├── Gemfile
-├── spree_my_extension.gemspec
-├── README.md
-└── LICENSE
-```
-
-### Extension Options
-
-```bash
-# Create extension with specific options
-spree extension my_extension --path=/custom/path
-
-# View help
-spree help extension
-```
-
-## Extension Development
-
-After creating an extension:
-
-```bash
-cd spree_my_extension
-
-# Install dependencies
-bundle install
-
-# Create test application
-bundle exec rake test_app
-
-# Run tests
-bundle exec rspec
-
-# Build gem
-gem build spree_my_extension.gemspec
-```
-
-### Extension Structure
-
-Generated extensions follow Spree conventions:
-
-```ruby
-# lib/spree_my_extension/engine.rb
-module SpreeMyExtension
- class Engine < Rails::Engine
- require 'spree/core'
- isolate_namespace Spree
- engine_name 'spree_my_extension'
-
- config.autoload_paths += %W(#{config.root}/lib)
-
- initializer 'spree_my_extension.environment', before: :load_config_initializers do |_app|
- SpreeMyExtension::Config = SpreeMyExtension::Configuration.new
- end
-
- def self.activate
- Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
- Rails.configuration.cache_classes ? require(c) : load(c)
- end
- end
-
- config.to_prepare(&method(:activate).to_proc)
- end
-end
-```
-
-### Adding Models
-
-```ruby
-# app/models/spree/my_model.rb
-module Spree
- class MyModel < Spree.base_class
- # Model implementation
- end
-end
-```
-
-### Adding Controllers
-
-```ruby
-# app/controllers/spree/admin/my_models_controller.rb
-module Spree
- module Admin
- class MyModelsController < ResourceController
- # Controller implementation
- end
- end
-end
-```
-
-### Adding Migrations
-
-```bash
-cd spree_my_extension
-bin/rails g migration CreateSpreeMyModels
-```
-
-## Publishing Extensions
-
-1. Update version in `lib/spree_my_extension/version.rb`
-2. Update `CHANGELOG.md`
-3. Build and publish:
-
-```bash
-gem build spree_my_extension.gemspec
-gem push spree_my_extension-1.0.0.gem
-```
-
-## Usage
-
-### In a Spree Application
-
-Add your extension to the application's Gemfile:
-
-```ruby
-gem 'spree_my_extension', '~> 1.0'
-```
-
-Run installation:
-
-```bash
-bundle install
-bin/rails g spree_my_extension:install
-```
-
-## Documentation
-
-- [Extension Development Guide](https://docs.spreecommerce.org/developer/extending-spree/extensions)
-- [Creating Extensions Tutorial](https://docs.spreecommerce.org/developer/tutorials/extensions)
-- [Spree Extensions Directory](https://spreecommerce.org/extensions)
-
-## Contributing
-
-1. Fork the repository
-2. Create a feature branch
-3. Make your changes
-4. Run tests
-5. Submit a pull request
\ No newline at end of file
diff --git a/backend/engines/cli/Rakefile b/backend/engines/cli/Rakefile
deleted file mode 100644
index ffd6abf8b7..0000000000
--- a/backend/engines/cli/Rakefile
+++ /dev/null
@@ -1,9 +0,0 @@
-require "bundler/gem_tasks"
-
-desc 'alias for :build to work with other spree gems'
-task gem: :build do
-end
-
-desc 'alias for :test_app to work with other spree gems'
-task :test_app do
-end
\ No newline at end of file
diff --git a/backend/engines/cli/bin/spree b/backend/engines/cli/bin/spree
deleted file mode 100755
index a1e27d512f..0000000000
--- a/backend/engines/cli/bin/spree
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env ruby
-require 'spree_cli'
diff --git a/backend/engines/cli/bin/spree_cli b/backend/engines/cli/bin/spree_cli
deleted file mode 100755
index a1e27d512f..0000000000
--- a/backend/engines/cli/bin/spree_cli
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env ruby
-require 'spree_cli'
diff --git a/backend/engines/cli/lib/generators/spree_cli/install/install_generator.rb b/backend/engines/cli/lib/generators/spree_cli/install/install_generator.rb
deleted file mode 100644
index 0bfa417def..0000000000
--- a/backend/engines/cli/lib/generators/spree_cli/install/install_generator.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'rails/generators'
-
-module SpreeCli
- module Generators
- class InstallGenerator < Rails::Generators::Base
- source_root File.expand_path('templates', __dir__)
-
- desc 'Installs Spree CLI binstub into your application'
-
- def create_binstub
- template 'bin/spree', 'bin/spree'
- chmod 'bin/spree', 0o755
- end
-
- def show_post_install_message
- say_status :installed, 'bin/spree'
- say ''
- say 'You can now run Spree CLI commands using:'
- say ' bin/spree version'
- say ' bin/spree extension my_extension'
- say ''
- end
- end
- end
-end
diff --git a/backend/engines/cli/lib/generators/spree_cli/install/templates/bin/spree b/backend/engines/cli/lib/generators/spree_cli/install/templates/bin/spree
deleted file mode 100644
index 26bcb1a7c4..0000000000
--- a/backend/engines/cli/lib/generators/spree_cli/install/templates/bin/spree
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by the `bin/rails g spree_cli:install` command.
-# It loads your application's bundled version of spree_cli.
-#
-
-require 'bundler/setup'
-require 'spree_cli'
diff --git a/backend/engines/cli/lib/spree_cli.rb b/backend/engines/cli/lib/spree_cli.rb
deleted file mode 100644
index a8a5681ca9..0000000000
--- a/backend/engines/cli/lib/spree_cli.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'thor'
-require 'thor/group'
-
-case ARGV.first
-when 'version', '-v', '--version'
- puts Gem.loaded_specs['spree_cli'].version
-when 'extension'
- ARGV.shift
- require 'spree_cli/extension'
- SpreeCli::Extension.start
-end
diff --git a/backend/engines/cli/lib/spree_cli/extension.rb b/backend/engines/cli/lib/spree_cli/extension.rb
deleted file mode 100644
index a556d601ac..0000000000
--- a/backend/engines/cli/lib/spree_cli/extension.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'active_support/core_ext/string/inflections'
-
-module SpreeCli
- class Extension < Thor::Group
- include Thor::Actions
-
- desc 'builds a spree extension'
- argument :file_name, type: :string, desc: 'rails app_path', default: 'sample_extension'
-
- source_root File.expand_path('templates/extension', __dir__)
-
- def generate
- use_prefix 'spree_'
-
- empty_directory file_name
-
- directory 'app', "#{file_name}/app"
- directory 'lib', "#{file_name}/lib"
- directory 'bin', "#{file_name}/bin"
- directory 'spec', "#{file_name}/spec"
-
- empty_directory "#{file_name}/app/models/#{file_name}"
- empty_directory "#{file_name}/app/views/spree"
- empty_directory "#{file_name}/app/controllers/spree/admin"
- empty_directory "#{file_name}/app/controllers/#{file_name}"
- empty_directory "#{file_name}/app/services/#{file_name}"
- empty_directory "#{file_name}/app/serializers/spree/api/v3"
- empty_directory "#{file_name}/app/serializers/spree/api/v3/admin"
- empty_directory "#{file_name}/vendor/javascript"
- empty_directory "#{file_name}/vendor/stylesheets"
-
- chmod "#{file_name}/bin/rails", 0o755
- chmod "#{file_name}/bin/importmap", 0o755
-
- template 'extension.gemspec', "#{file_name}/#{file_name}.gemspec"
- template 'Gemfile', "#{file_name}/Gemfile"
- template 'gitignore', "#{file_name}/.gitignore"
- template 'LICENSE.md', "#{file_name}/LICENSE.md"
- template 'Rakefile', "#{file_name}/Rakefile"
- template 'README.md', "#{file_name}/README.md"
- template 'config/routes.rb', "#{file_name}/config/routes.rb"
- template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
- template 'config/initializers/spree.rb', "#{file_name}/config/initializers/spree.rb"
- template 'config/importmap.rb', "#{file_name}/config/importmap.rb"
-
- template 'rspec', "#{file_name}/.rspec"
- template '.github/workflows/tests.yml', "#{file_name}/.github/workflows/tests.yml"
- template '.github/.dependabot.yml', "#{file_name}/.github/.dependabot.yml"
- template '.rubocop.yml', "#{file_name}/.rubocop.yml"
- template '.gem_release.yml', "#{file_name}/.gem_release.yml"
- end
-
- def final_banner
- say %{
- #{'*' * 80}
-
- Congrats, Your Spree #{human_name} extension has been generated 🚀
-
- Next steps:
- * Read Spree Developer Documentation at: https://docs.spreecommerce.org/developer
-
- #{'*' * 80}
- }
- end
-
- no_tasks do
- def class_name
- Thor::Util.camel_case file_name
- end
-
- def human_name
- file_name.to_s.gsub('spree_', '').humanize
- end
-
- def use_prefix(prefix)
- @file_name = prefix + Thor::Util.snake_case(file_name) unless file_name =~ /^#{prefix}/
- end
- end
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/.gem_release.yml b/backend/engines/cli/lib/spree_cli/templates/extension/.gem_release.yml
deleted file mode 100644
index 5bf0937fff..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/.gem_release.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-bump:
- file: "lib/<%= file_name %>/version.rb"
-
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/.github/.dependabot.yml b/backend/engines/cli/lib/spree_cli/templates/extension/.github/.dependabot.yml
deleted file mode 100644
index c496bc7ad0..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/.github/.dependabot.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# To get started with Dependabot version updates, you'll need to specify which
-# package ecosystems to update and where the package manifests are located.
-# Please see the documentation for all configuration options:
-# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
-
-version: 2
-updates:
- - package-ecosystem: "bundler" # See documentation for possible values
- directory: "/" # Location of package manifests
- schedule:
- interval: "weekly"
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/.github/workflows/tests.yml b/backend/engines/cli/lib/spree_cli/templates/extension/.github/workflows/tests.yml
deleted file mode 100644
index bc6430d237..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/.github/workflows/tests.yml
+++ /dev/null
@@ -1,107 +0,0 @@
-name: Tests
-
-on:
- push:
- branches: [main]
- pull_request:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-permissions:
- contents: read
-
-jobs:
- test-postgres:
- name: "PostgreSQL"
- runs-on: ubuntu-latest
- services:
- postgres:
- image: postgres:16
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- ports:
- - 5432:5432
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- env:
- DB: postgres
- DB_HOST: localhost
- DB_USERNAME: postgres
- DB_PASSWORD: postgres
- BUNDLE_JOBS: 4
- BUNDLE_RETRY: 3
- steps:
- - uses: actions/checkout@v4
-
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: '4.0'
- bundler-cache: true
-
- - name: Install libvips
- run: sudo apt-get update && sudo apt-get install -y libvips-dev
-
- - name: Create test app
- run: bundle exec rake test_app
-
- - name: Run tests
- run: bundle exec rspec --format documentation
-
- test-mysql:
- name: "MySQL"
- runs-on: ubuntu-latest
- services:
- mysql:
- image: mysql:8.0
- env:
- MYSQL_ROOT_PASSWORD: password
- ports:
- - 3306:3306
- options: >-
- --health-cmd="mysqladmin ping"
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- env:
- DB: mysql
- DB_HOST: 127.0.0.1
- DB_USERNAME: root
- DB_PASSWORD: password
- BUNDLE_JOBS: 4
- BUNDLE_RETRY: 3
- steps:
- - uses: actions/checkout@v4
-
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: '4.0'
- bundler-cache: true
-
- - name: Install libvips
- run: sudo apt-get update && sudo apt-get install -y libvips-dev
-
- - name: Create test app
- run: bundle exec rake test_app
-
- - name: Run tests
- run: bundle exec rspec --format documentation
-
- brakeman:
- name: Brakeman
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: '4.0'
- bundler-cache: true
-
- - name: Run Brakeman
- run: bundle exec brakeman --exit-on-warn --exit-on-error
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/.rubocop.yml b/backend/engines/cli/lib/spree_cli/templates/extension/.rubocop.yml
deleted file mode 100644
index 51320aa362..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/.rubocop.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-plugins:
- - rubocop-rails
-
-AllCops:
- DisplayCopNames: true
- TargetRubyVersion: 3.3
- Include:
- - '**/Gemfile'
- - '**/Rakefile'
- - '**/Appraisals'
- Exclude:
- - 'spec/dummy/**/*'
- - 'lib/generators/**/*'
-
-Layout/LineLength:
- Max: 150
-
-# DISABLED
-
-Style/Documentation:
- Enabled: false
-
-Style/FrozenStringLiteralComment:
- Enabled: false
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/CONTRIBUTING.md b/backend/engines/cli/lib/spree_cli/templates/extension/CONTRIBUTING.md
deleted file mode 100644
index d2a4581713..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/CONTRIBUTING.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# How to contribute
-
-Third-party patches are essential to any great open source project. We want
-to keep it as easy as possible to contribute changes that get things working
-in your environment. There are a few guidelines that we need contributors to
-follow so that we can have a chance of keeping on top of things.
-
-## Getting Started
-
-* Make sure you have a [GitHub account](https://github.com/signup/free)
-* Submit a ticket for your issue, assuming one does not already exist.
- * Clearly describe the issue including steps to reproduce when it is a bug.
- * Make sure you fill in the earliest version that you know has the issue.
-* Fork the repository on GitHub
-
-## Making Changes
-
-* Create a topic branch from where you want to base your work.
- * This is usually the master branch.
- * Only target release branches if you are certain your fix must be on that
- branch.
- * To quickly create a topic branch based on master; `git branch
- fix/master/my_contribution master` then checkout the new branch with `git
- checkout fix/master/my_contribution`. Please avoid working directly on the
- `master` branch.
-* Make commits of logical units.
-* Check for unnecessary whitespace with `git diff --check` before committing.
-* Make sure your commit messages are in the proper format.
-
-````
- (#99999) Make the example in CONTRIBUTING imperative and concrete
-
- Without this patch applied the example commit message in the CONTRIBUTING
- document is not a concrete example. This is a problem because the
- contributor is left to imagine what the commit message should look like
- based on a description rather than an example. This patch fixes the
- problem by making the example concrete and imperative.
-
- The first line is a real life imperative statement with a ticket number
- from our issue tracker. The body describes the behavior without the patch,
- why this is a problem, and how the patch fixes the problem when applied.
-````
-
-* Make sure you have added the necessary tests for your changes.
-* Run _all_ the tests to assure nothing else was accidentally broken.
-
-## Submitting Changes
-
-* Push your changes to a topic branch in your fork of the repository.
-* Submit a pull request to the extensions repository.
-* Update any Github issues to mark that you have submitted code and are ready for it to be reviewed.
- * Include a link to the pull request in the ticket
-
-# Additional Resources
-
-* [General GitHub documentation](http://help.github.com/)
-* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/Gemfile b/backend/engines/cli/lib/spree_cli/templates/extension/Gemfile
deleted file mode 100644
index 7fbf77c825..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/Gemfile
+++ /dev/null
@@ -1,21 +0,0 @@
-source 'https://rubygems.org'
-
-git_source(:github) do |repo_name|
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
- "https://github.com/#{repo_name}.git"
-end
-
-gem 'rails-controller-testing'
-
-spree_opts = { github: 'spree/spree', branch: 'main' }
-gem 'spree', spree_opts
-gem 'spree_admin', spree_opts
-
-gem 'mysql2' if ENV['DB'] == 'mysql' || ENV['CI']
-gem 'pg' if ENV['DB'] == 'postgres' || ENV['CI']
-
-gem 'sqlite3', '>= 2.0'
-
-gem 'propshaft'
-
-gemspec
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/LICENSE.md b/backend/engines/cli/lib/spree_cli/templates/extension/LICENSE.md
deleted file mode 100644
index ca89c24241..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/LICENSE.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# LICENSE
-
-Copyright (c) <%= Time.now.year %> [name of plugin creator]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/README.md b/backend/engines/cli/lib/spree_cli/templates/extension/README.md
deleted file mode 100644
index 2e1fdc0ac9..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Spree <%= human_name %>
-
-This is a <%= human_name %> extension for [Spree Commerce](https://spreecommerce.org), an open source e-commerce platform built with Ruby on Rails.
-
-## Installation
-
-1. Add this extension to your Gemfile with this line:
-
- ```ruby
- bundle add <%= file_name %>
- ```
-
-2. Run the install generator
-
- ```ruby
- bundle exec rails g <%= file_name %>:install
- ```
-
-3. Restart your server
-
- If your server was running, restart it so that it can find the assets properly.
-
-## Developing
-
-1. Create a dummy app
-
- ```bash
- bundle update
- bundle exec rake test_app
- ```
-
-2. Add your new code
-3. Run tests
-
- ```bash
- bundle exec rspec
- ```
-
-When testing your applications integration with this extension you may use it's factories.
-Simply add this require statement to your spec_helper:
-
-```ruby
-require '<%= file_name %>/factories'
-```
-
-## Releasing a new version
-
-```shell
-bundle exec gem bump -p -t
-bundle exec gem release
-```
-
-For more options please see [gem-release README](https://github.com/svenfuchs/gem-release)
-
-## Contributing
-
-If you'd like to contribute, please take a look at the
-[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
-pull request.
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/Rakefile b/backend/engines/cli/lib/spree_cli/templates/extension/Rakefile
deleted file mode 100644
index cdfaf7b490..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/Rakefile
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'bundler'
-Bundler::GemHelper.install_tasks
-
-require 'rspec/core/rake_task'
-require 'spree/testing_support/extension_rake'
-
-RSpec::Core::RakeTask.new
-
-task :default do
- if Dir['spec/dummy'].empty?
- Rake::Task[:test_app].invoke
- Dir.chdir('../../')
- end
- Rake::Task[:spec].invoke
-end
-
-desc 'Generates a dummy app for testing'
-task :test_app do
- ENV['LIB_NAME'] = '<%=file_name%>'
- Rake::Task['extension:test_app'].invoke
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/.gitkeep b/backend/engines/cli/lib/spree_cli/templates/extension/app/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/assets/config/%file_name%_manifest.js.tt b/backend/engines/cli/lib/spree_cli/templates/extension/app/assets/config/%file_name%_manifest.js.tt
deleted file mode 100644
index 8dd79f8646..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/app/assets/config/%file_name%_manifest.js.tt
+++ /dev/null
@@ -1,5 +0,0 @@
-//= link_tree ../images
-//= link <%= file_name %>/application.js
-//= link_tree ../../javascript/<%= file_name %>/controllers .js
-//= link_tree ../../../vendor/javascript .js
-//= link_tree ../../../vendor/stylesheets .css
\ No newline at end of file
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/assets/images/.keep b/backend/engines/cli/lib/spree_cli/templates/extension/app/assets/images/.keep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/application.js.tt b/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/application.js.tt
deleted file mode 100644
index cd0cd2a8e8..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/application.js.tt
+++ /dev/null
@@ -1,16 +0,0 @@
-import '@hotwired/turbo-rails'
-import { Application } from '@hotwired/stimulus'
-
-let application
-
-if (typeof window.Stimulus === "undefined") {
- application = Application.start()
- application.debug = false
- window.Stimulus = application
-} else {
- application = window.Stimulus
-}
-
-import <%= class_name %>Controller from '<%= file_name %>/controllers/<%= file_name %>_controller'
-
-application.register('<%= file_name %>', <%= class_name %>Controller)
\ No newline at end of file
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/controllers/%file_name%_controller.js.tt b/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/controllers/%file_name%_controller.js.tt
deleted file mode 100644
index 3c0d96fcad..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/app/javascript/%file_name%/controllers/%file_name%_controller.js.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Controller } from '@hotwired/stimulus'
-
-export default class extends Controller {
- connect() {
- console.log('Hello, <%= class_name %>!')
- }
-}
\ No newline at end of file
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/app/jobs/%file_name%/base_job.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/app/jobs/%file_name%/base_job.rb.tt
deleted file mode 100644
index 0d8a067950..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/app/jobs/%file_name%/base_job.rb.tt
+++ /dev/null
@@ -1,5 +0,0 @@
-module <%= class_name %>
- class BaseJob < Spree::BaseJob
- queue_as <%= class_name %>.queue
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/bin/importmap b/backend/engines/cli/lib/spree_cli/templates/extension/bin/importmap
deleted file mode 100644
index bf720be9dc..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/bin/importmap
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
-require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
-
-require 'rails'
-
-require 'importmap-rails'
-require 'importmap/commands'
\ No newline at end of file
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/bin/rails.tt b/backend/engines/cli/lib/spree_cli/templates/extension/bin/rails.tt
deleted file mode 100644
index 5b84d953dd..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/bin/rails.tt
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-# This command will automatically be run when you run "rails" from the root of your extension
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/<%= file_name -%>/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/config/i18n-tasks.yml b/backend/engines/cli/lib/spree_cli/templates/extension/config/i18n-tasks.yml
deleted file mode 100644
index 84d4510d18..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/config/i18n-tasks.yml
+++ /dev/null
@@ -1,172 +0,0 @@
-# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
-
-# The "main" locale.
-base_locale: en
-## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
-# locales: [es, fr]
-## Reporting locale, default: en. Available: en, ru.
-# internal_locale: en
-
-# Read and write translations.
-data:
- ## Translations are read from the file system. Supported format: YAML, JSON.
- ## Provide a custom adapter:
- # adapter: I18n::Tasks::Data::FileSystem
-
- # Locale files or `Dir.glob` patterns where translations are read from:
- read:
- ## Default:
- - config/locales/%{locale}.yml
- ## More files:
- # - config/locales/**/*.%{locale}.yml
-
- # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
- # `i18n-tasks normalize -p` will force move the keys according to these rules
- write:
- ## For example, write devise and simple form keys to their respective files:
- # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
- ## Catch-all default:
- # - config/locales/%{locale}.yml
-
- # External locale data (e.g. gems).
- # This data is not considered unused and is never written to.
- external:
- ## Example (replace %#= with %=):
- # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
- - "<%= %x[bundle info spree_core --path].chomp %>/config/locales/%{locale}.yml"
- ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
- # router: conservative_router
-
- yaml:
- write:
- # do not wrap lines at 80 characters
- line_width: -1
-
- ## Pretty-print JSON:
- # json:
- # write:
- # indent: ' '
- # space: ' '
- # object_nl: "\n"
- # array_nl: "\n"
-
-# Find translate calls
-search:
- ## Paths or `Find.find` patterns to search in:
- # paths:
- # - app/
-
- ## Root directories for relative keys resolution.
- # relative_roots:
- # - app/controllers
- # - app/helpers
- # - app/mailers
- # - app/presenters
- # - app/views
-
- ## Directories where method names which should not be part of a relative key resolution.
- # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
- # Directories listed here will not consider the name of the method part of the resolved key
- #
- # relative_exclude_method_name_paths:
- # -
-
- ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
- ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
- ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
- exclude:
- - app/assets/images
- - app/assets/fonts
- - app/assets/videos
- - app/assets/builds
-
- ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
- ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
- # only: ["*.rb", "*.html.slim"]
-
- ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
- strict: false
-
- ## Allows adding ast_matchers for finding translations using the AST-scanners
- ## The available matchers are:
- ## - RailsModelMatcher
- ## Matches ActiveRecord translations like
- ## User.human_attribute_name(:email) and User.model_name.human
- ## - DefaultI18nSubjectMatcher
- ## Matches ActionMailer's default_i18n_subject method
- ##
- ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
- # ast_matchers:
- # - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
- # - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
-
- ## Multiple scanners can be used. Their results are merged.
- ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
- ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
-
-## Translation Services
-# translation:
-# # Google Translate
-# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
-# google_translate_api_key: "AbC-dEf5"
-# # DeepL Pro Translate
-# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
-# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
-# # deepl_host: "https://api.deepl.com"
-# # deepl_version: "v2"
-# # deepl_glossary_ids:
-# # - f28106eb-0e06-489e-82c6-8215d6f95089
-# # - 2c6415be-1852-4f54-9e1b-d800463496b4
-# # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
-# deepl_options:
-# formality: prefer_less
-# # OpenAI
-# openai_api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
-# # openai_model: "gpt-3.5-turbo" # see https://platform.openai.com/docs/models
-# # may contain `%{from}` and `%{to}`, which will be replaced by source and target locale codes, respectively (using `Kernel.format`)
-# # openai_system_prompt: >-
-# # You are a professional translator that translates content from the %{from} locale
-# # to the %{to} locale in an i18n locale array.
-# #
-# # The array has a structured format and contains multiple strings. Your task is to translate
-# # each of these strings and create a new array with the translated strings.
-# #
-# # HTML markups (enclosed in < and > characters) must not be changed under any circumstance.
-# # Variables (starting with %%{ and ending with }) must not be changed under any circumstance.
-# #
-# # Keep in mind the context of all the strings for a more accurate translation.
-
-## Do not consider these keys missing:
-# ignore_missing:
-# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
-# - '{devise,simple_form}.*'
-
-## Consider these keys used:
-# ignore_unused:
-
-## Exclude these keys from the `i18n-tasks eq-base' report:
-# ignore_eq_base:
-# all:
-# - common.ok
-# fr,es:
-# - common.brand
-
-## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
-# ignore_inconsistent_interpolations:
-# - 'activerecord.attributes.*'
-
-## Ignore these keys completely:
-# ignore:
-# - kaminari.*
-
-## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
-## e.g. in case of a relative key defined in a helper method.
-## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
-#
-# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
-# only: %w(*.html.haml *.html.slim),
-# patterns: [['= title\b', '.page_title']] %>
-#
-# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
-#
-<% I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
\ No newline at end of file
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/config/importmap.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/config/importmap.rb.tt
deleted file mode 100644
index 8472a6302c..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/config/importmap.rb.tt
+++ /dev/null
@@ -1,6 +0,0 @@
-pin 'application-<%= file_name.tr("_","-") %>', to: '<%= file_name %>/application.js', preload: false
-
-pin_all_from <%= class_name %>::Engine.root.join('app/javascript/<%= file_name %>/controllers'),
- under: '<%= file_name %>/controllers',
- to: '<%= file_name %>/controllers',
- preload: 'application-<%= file_name.tr("_","-") %>'
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/config/initializers/spree.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/config/initializers/spree.rb.tt
deleted file mode 100644
index 072acf4a42..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/config/initializers/spree.rb.tt
+++ /dev/null
@@ -1,23 +0,0 @@
-# Uncomment lines below to add your own custom business logic
-# such as promotions, shipping methods, etc.
-Rails.application.config.after_initialize do
- # Spree.shipping_methods << Spree::ShippingMethods::SuperExpensiveNotVeryFastShipping
- # Spree.payment_methods << Spree::PaymentMethods::VerySafeAndReliablePaymentMethod
-
- # Spree.calculators.tax_rates << Spree::TaxRates::FinanceTeamForcedMeToCodeThis
-
- # Spree.stock_splitters << Spree::Stock::Splitters::SecretLogicSplitter
-
- # Spree.adjusters << Spree::Adjustable::Adjuster::TaxTheRich
-
- # Custom promotions
- # Spree.calculators.promotion_actions_create_adjustments << Spree::Calculators::PromotionActions::CreateAdjustments::AddDiscountForFriends
- # Spree.calculators.promotion_actions_create_item_adjustments << Spree::Calculators::PromotionActions::CreateItemAdjustments::FinanceTeamForcedMeToCodeThis
- # Spree.promotions.rules << Spree::Promotions::Rules::OnlyForVIPCustomers
- # Spree.promotions.actions << Spree::Promotions::Actions::GiftWithPurchase
-
- # Spree.taxon_rules << Spree::TaxonRules::ProductsWithColor
-
- # Spree.exports << Spree::Exports::Payments
- # Spree.reports << Spree::Reports::MassivelyOvercomplexReportForCfo
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/config/locales/en.yml.tt b/backend/engines/cli/lib/spree_cli/templates/extension/config/locales/en.yml.tt
deleted file mode 100644
index 7caf9f7e5e..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/config/locales/en.yml.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- spree:
- <%= file_name.gsub('spree_', '') %>:
- hello: "Hello <%= class_name %>"
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/config/routes.rb b/backend/engines/cli/lib/spree_cli/templates/extension/config/routes.rb
deleted file mode 100644
index 03397175af..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/config/routes.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-Spree::Core::Engine.add_routes do
- # Add your extension routes here
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/extension.gemspec b/backend/engines/cli/lib/spree_cli/templates/extension/extension.gemspec
deleted file mode 100644
index b531fa898a..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/extension.gemspec
+++ /dev/null
@@ -1,26 +0,0 @@
-# encoding: UTF-8
-lib = File.expand_path('../lib/', __FILE__)
-$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
-
-require '<%= file_name %>/version'
-
-Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = '<%= file_name %>'
- s.version = <%= class_name %>::VERSION
- s.summary = "Spree Commerce <%= human_name %> Extension"
- s.required_ruby_version = '>= 3.2'
-
- s.author = 'You'
- s.email = '[email protected]'
- s.homepage = 'https://github.com/your-github-handle/<%= file_name %>'
- s.license = 'MIT'
-
- s.files = Dir["{app,config,db,lib,vendor}/**/*", "LICENSE.md", "Rakefile", "README.md"].reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
- s.require_path = 'lib'
- s.requirements << 'none'
-
- s.add_dependency 'spree', '>= <%= Gem.loaded_specs['spree_cli'].version %>'
- s.add_dependency 'spree_admin', '>= <%= Gem.loaded_specs['spree_cli'].version %>'
- s.add_development_dependency 'spree_dev_tools'
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/gitignore b/backend/engines/cli/lib/spree_cli/templates/extension/gitignore
deleted file mode 100644
index 59090efdd7..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-\#*
-*~
-.#*
-.DS_Store
-.idea
-.localeapp/locales
-.project
-.vscode
-coverage
-default
-Gemfile.lock
-tmp
-nbproject
-pkg
-*.sw?
-spec/dummy
-.rvmrc
-.sass-cache
-public/spree
-.ruby-version
-.ruby-gemset
-*.gem
-*/*.gem
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%.rb.tt
deleted file mode 100644
index 5b6eaeb4b0..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%.rb.tt
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'spree'
-require '<%=file_name%>/engine'
-require '<%=file_name%>/version'
-require '<%=file_name%>/configuration'
-
-module <%= class_name %>
- mattr_accessor :queue
-
- def self.queue
- @@queue ||= Spree.queues.default
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/configuration.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/configuration.rb.tt
deleted file mode 100644
index 1dd2b0069c..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/configuration.rb.tt
+++ /dev/null
@@ -1,13 +0,0 @@
-module <%= class_name %>
- class Configuration < Spree::Preferences::Configuration
-
- # Some example preferences are shown below, for more information visit:
- # https://docs.spreecommerce.org/developer/contributing/creating-an-extension
-
- # preference :enabled, :boolean, default: true
- # preference :dark_chocolate, :boolean, default: true
- # preference :color, :string, default: 'Red'
- # preference :favorite_number, :integer
- # preference :supported_locales, :array, default: [:en]
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
deleted file mode 100644
index 4464bd965e..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
+++ /dev/null
@@ -1,39 +0,0 @@
-module <%= class_name %>
- class Engine < Rails::Engine
- require 'spree/core'
- isolate_namespace Spree
- engine_name '<%= file_name %>'
-
- # use rspec for tests
- config.generators do |g|
- g.test_framework :rspec
- end
-
- initializer '<%= file_name %>.environment', before: :load_config_initializers do |_app|
- <%= class_name %>::Config = <%= class_name %>::Configuration.new
- end
-
- initializer '<%= file_name %>.assets' do |app|
- if app.config.respond_to?(:assets)
- app.config.assets.paths << root.join('app/javascript')
- app.config.assets.precompile += %w[<%= file_name %>_manifest]
- end
- end
-
- initializer '<%= file_name %>.importmap', before: 'importmap' do |app|
- if app.config.respond_to?(:importmap)
- app.config.importmap.paths << root.join('config/importmap.rb')
- # https://github.com/rails/importmap-rails?tab=readme-ov-file#sweeping-the-cache-in-development-and-test
- app.config.importmap.cache_sweepers << root.join('app/javascript')
- end
- end
-
- def self.activate
- Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
- Rails.configuration.cache_classes ? require(c) : load(c)
- end
- end
-
- config.to_prepare(&method(:activate).to_proc)
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/factories.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/factories.rb.tt
deleted file mode 100644
index a72b260737..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/factories.rb.tt
+++ /dev/null
@@ -1,6 +0,0 @@
-FactoryBot.define do
- # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
- #
- # Example adding this to your spec_helper will load these Factories for use:
- # require '<%= file_name %>/factories'
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt
deleted file mode 100644
index 4d271eea83..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-module <%= class_name %>
- VERSION = '0.0.1'.freeze
-
- def gem_version
- Gem::Version.new(VERSION)
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
deleted file mode 100644
index d7236d10d2..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
+++ /dev/null
@@ -1,20 +0,0 @@
-module <%= class_name %>
- module Generators
- class InstallGenerator < Rails::Generators::Base
- class_option :migrate, type: :boolean, default: true
-
- def add_migrations
- run 'bundle exec rake railties:install:migrations FROM=<%= file_name %>'
- end
-
- def run_migrations
- run_migrations = options[:migrate] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
- if run_migrations
- run 'bin/rails db:migrate'
- else
- puts 'Skipping rails db:migrate, don\'t forget to run it!'
- end
- end
- end
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/rspec b/backend/engines/cli/lib/spree_cli/templates/extension/rspec
deleted file mode 100644
index d72f9515c5..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---color
--r spec_helper
--f documentation
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/spec/.rubocop.yml b/backend/engines/cli/lib/spree_cli/templates/extension/spec/.rubocop.yml
deleted file mode 100644
index fb81f09652..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/spec/.rubocop.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-require: rubocop-rspec
-
-inherit_from: ../.rubocop.yml
-
-Metrics/BlockLength:
- Enabled: false
-
-Style/BlockDelimiters:
- Enabled: false
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/spec/i18n_spec.rb b/backend/engines/cli/lib/spree_cli/templates/extension/spec/i18n_spec.rb
deleted file mode 100644
index eacd60d02f..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/spec/i18n_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-require 'i18n/tasks'
-
-RSpec.describe I18n do
- let(:i18n) { I18n::Tasks::BaseTask.new }
- let(:missing_keys) { i18n.missing_keys }
- let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }
-
- it 'does not have missing keys' do
- expect(missing_keys).to be_empty,
- "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
- end
-
- it 'files are normalized' do
- non_normalized = i18n.non_normalized_paths
- error_message = "The following files need to be normalized:\n" \
- "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
- "Please run `i18n-tasks normalize' to fix"
- expect(non_normalized).to be_empty, error_message
- end
-
- it 'does not have inconsistent interpolations' do
- error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \
- "Run `i18n-tasks check-consistent-interpolations' to show them"
- expect(inconsistent_interpolations).to be_empty, error_message
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/spec/spec_helper.rb.tt b/backend/engines/cli/lib/spree_cli/templates/extension/spec/spec_helper.rb.tt
deleted file mode 100644
index 7b743dda1c..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/spec/spec_helper.rb.tt
+++ /dev/null
@@ -1,22 +0,0 @@
-# Configure Rails Environment
-ENV['RAILS_ENV'] = 'test'
-
-require 'dotenv/load'
-
-require File.expand_path('../dummy/config/environment.rb', __FILE__)
-
-require 'spree_dev_tools/rspec/spec_helper'
-require '<%= file_name %>/factories'
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].sort.each { |f| require f }
-
-def json_response
- case body = JSON.parse(response.body)
- when Hash
- body.with_indifferent_access
- when Array
- body
- end
-end
diff --git a/backend/engines/cli/lib/spree_cli/templates/extension/spec/zeitwerk_spec.rb b/backend/engines/cli/lib/spree_cli/templates/extension/spec/zeitwerk_spec.rb
deleted file mode 100644
index 59b6c709b0..0000000000
--- a/backend/engines/cli/lib/spree_cli/templates/extension/spec/zeitwerk_spec.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'spec_helper'
-
-describe 'Zeitwerk' do
- it 'eager loads all files' do
- expect do
- Zeitwerk::Loader.eager_load_all
- end.not_to raise_error
- end
-end
diff --git a/backend/engines/cli/spree_cli.gemspec b/backend/engines/cli/spree_cli.gemspec
deleted file mode 100644
index 6f400965f1..0000000000
--- a/backend/engines/cli/spree_cli.gemspec
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- encoding: utf-8 -*-
-$:.push File.expand_path("../lib", __FILE__)
-require_relative '../core/lib/spree/core/version.rb'
-
-Gem::Specification.new do |s|
- s.name = "spree_cli"
- s.version = Spree.version
- s.authors = ['Chris Mar', 'Spark Solutions Sp. z o.o.', 'Vendo Connect Inc.']
- s.email = ['[email protected]']
- s.summary = 'Spree Commerce CLI'
- s.description = 'Spree Commerce command line interface'
- s.homepage = 'https://spreecommerce.org'
- s.licenses = ['AGPL-3.0-or-later', 'BSD-3-Clause']
-
- s.metadata = {
- "bug_tracker_uri" => "https://github.com/spree/spree/issues",
- "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
- "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
- }
-
- s.files = Dir.glob(["{app,config,db,lib,vendor}/**/*", "LICENSE.md", "Rakefile", "README.md"], File::FNM_DOTMATCH).reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
- s.bindir = 'bin'
- s.executables = Dir['bin/*'].map { |f| File.basename(f) }
- s.require_paths = ['lib']
-
- s.add_dependency 'thor', '~> 1.0'
-end
diff --git a/backend/engines/lib/generators/spree/install/install_generator.rb b/backend/engines/lib/generators/spree/install/install_generator.rb
index d7e089894b..6b55d5d240 100644
--- a/backend/engines/lib/generators/spree/install/install_generator.rb
+++ b/backend/engines/lib/generators/spree/install/install_generator.rb
@@ -40,10 +40,6 @@ module Spree
template 'config/initializers/spree.rb', 'config/initializers/spree.rb'
end
- def install_spree_cli
- generate 'spree_cli:install'
- end
-
def install_authentication
if @authentication == 'devise'
generate 'spree:authentication:devise'
diff --git a/backend/engines/lib/spree.rb b/backend/engines/lib/spree.rb
index ba39dc2c26..034f861b11 100644
--- a/backend/engines/lib/spree.rb
+++ b/backend/engines/lib/spree.rb
@@ -1,3 +1,2 @@
require 'spree_core'
require 'spree_api'
-require 'spree_cli'
diff --git a/backend/engines/spree.gemspec b/backend/engines/spree.gemspec
index 424ffbaecf..13c232e56f 100644
--- a/backend/engines/spree.gemspec
+++ b/backend/engines/spree.gemspec
@@ -27,5 +27,4 @@ Gem::Specification.new do |s|
s.add_dependency 'spree_core', s.version
s.add_dependency 'spree_api', s.version
- s.add_dependency 'spree_cli', s.version
end
diff --git a/docs/developer/core-concepts/architecture.mdx b/docs/developer/core-concepts/architecture.mdx
index e11c2ce3c4..043c67795f 100644
--- a/docs/developer/core-concepts/architecture.mdx
+++ b/docs/developer/core-concepts/architecture.mdx
@@ -157,7 +157,6 @@ Spree is distributed as a set of Ruby gems (packages). Most users run Spree in *
| Package | Purpose |
|---------|---------|
| `spree_admin` | Admin dashboard for managing your store |
-| `spree_cli` | CLI tool to interact with your Spree installation |
| `spree_storefront` | Pre-built Rails storefront (not needed for headless setups) |
| `spree_emails` | Transactional email templates (order confirmation, shipping, etc.) |
| `spree_page_builder` | Visual page builder for the Rails storefront |