spree_cli 4.7.3 → 4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/spree_cli/extension.rb +20 -4
- data/lib/spree_cli/templates/extension/.circleci/config.yml +115 -0
- data/lib/spree_cli/templates/extension/.gem_release.yml +3 -0
- data/lib/spree_cli/templates/extension/.github/.dependabot.yml +11 -0
- data/lib/spree_cli/templates/extension/Gemfile +15 -2
- data/lib/spree_cli/templates/extension/README.md +19 -18
- data/lib/spree_cli/templates/extension/extension.gemspec +2 -3
- data/lib/spree_cli/templates/extension/lib/%file_name%/configuration.rb.tt +2 -2
- data/lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt +2 -6
- data/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +1 -1
- data/spree_cli.gemspec +1 -1
- metadata +8 -6
- data/lib/spree_cli/templates/extension/travis.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18fb886a96dc4546bf239aacc6db85066316b9dfa812f81277d19c1d92c93bc1
|
4
|
+
data.tar.gz: 9cd24b274c6a89779889253500b6b30e6e6e72c2c061f41edbfe3c609d9b9899
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4860fb9857945bc5cdc4e0f779021ae90143fb03d3010f7f6cd49108870119587fd9bc6ba53dd704df14b775f2da20a3983dc74d532656bbbdae5a1e572456a
|
7
|
+
data.tar.gz: 1e408fff5fa42e74f09ed8dd3c4c05bd99a020b951424353c313a1d897c70c3d48f09ed1acfa7c484bd0183760df399a632a4dcdff0f8f8fedf39ed8fd97d899
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007-
|
1
|
+
Copyright (c) 2007-2024, Spree Commerce, Inc., Spark Solutuons Sp. z o.o. and other contributors
|
2
2
|
All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification,
|
data/lib/spree_cli/extension.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'active_support/core_ext/string/inflections'
|
2
|
+
|
1
3
|
module SpreeCli
|
2
4
|
class Extension < Thor::Group
|
3
5
|
include Thor::Actions
|
@@ -17,6 +19,15 @@ module SpreeCli
|
|
17
19
|
directory 'bin', "#{file_name}/bin"
|
18
20
|
directory 'spec', "#{file_name}/spec"
|
19
21
|
|
22
|
+
empty_directory "#{file_name}/app/models/spree"
|
23
|
+
empty_directory "#{file_name}/app/models/#{file_name}"
|
24
|
+
empty_directory "#{file_name}/app/views/spree"
|
25
|
+
empty_directory "#{file_name}/app/views/#{file_name}"
|
26
|
+
empty_directory "#{file_name}/app/controllers/spree"
|
27
|
+
empty_directory "#{file_name}/app/controllers/#{file_name}"
|
28
|
+
empty_directory "#{file_name}/app/services/spree"
|
29
|
+
empty_directory "#{file_name}/app/services/#{file_name}"
|
30
|
+
|
20
31
|
chmod "#{file_name}/bin/rails", 0o755
|
21
32
|
|
22
33
|
template 'extension.gemspec', "#{file_name}/#{file_name}.gemspec"
|
@@ -28,19 +39,20 @@ module SpreeCli
|
|
28
39
|
template 'config/routes.rb', "#{file_name}/config/routes.rb"
|
29
40
|
template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
|
30
41
|
template 'rspec', "#{file_name}/.rspec"
|
31
|
-
template '
|
42
|
+
template '.circleci/config.yml', "#{file_name}/.circleci/config.yml"
|
43
|
+
template '.github/.dependabot.yml', "#{file_name}/.github/.dependabot.yml"
|
32
44
|
template '.rubocop.yml', "#{file_name}/.rubocop.yml"
|
45
|
+
template '.gem_release.yml', "#{file_name}/.gem_release.yml"
|
33
46
|
end
|
34
47
|
|
35
48
|
def final_banner
|
36
49
|
say %{
|
37
50
|
#{'*' * 80}
|
38
51
|
|
39
|
-
Congrats, Your extension has been generated
|
52
|
+
Congrats, Your Spree #{human_name} extension has been generated 🚀
|
40
53
|
|
41
54
|
Next steps:
|
42
|
-
* Read Spree Developer Documentation at: https://
|
43
|
-
* Start your extension at: https://dev-docs.spreecommerce.org/extensions/extensions
|
55
|
+
* Read Spree Developer Documentation at: https://docs.spreecommerce.org/developer
|
44
56
|
|
45
57
|
#{'*' * 80}
|
46
58
|
}
|
@@ -51,6 +63,10 @@ module SpreeCli
|
|
51
63
|
Thor::Util.camel_case file_name
|
52
64
|
end
|
53
65
|
|
66
|
+
def human_name
|
67
|
+
file_name.to_s.gsub('spree_', '').humanize
|
68
|
+
end
|
69
|
+
|
54
70
|
def use_prefix(prefix)
|
55
71
|
@file_name = prefix + Thor::Util.snake_case(file_name) unless file_name =~ /^#{prefix}/
|
56
72
|
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
defaults: &defaults
|
4
|
+
environment: &environment
|
5
|
+
CIRCLE_TEST_REPORTS: /tmp/test-results
|
6
|
+
CIRCLE_ARTIFACTS: /tmp/test-artifacts
|
7
|
+
BUNDLE_JOBS: 4
|
8
|
+
BUNDLE_RETRY: 3
|
9
|
+
BUNDLE_PATH: ~/spree/vendor/bundle
|
10
|
+
working_directory: ~/spree
|
11
|
+
docker:
|
12
|
+
- image: &ruby_image cimg/ruby:3.3-browsers
|
13
|
+
|
14
|
+
run_tests: &run_tests
|
15
|
+
<<: *defaults
|
16
|
+
steps:
|
17
|
+
- checkout
|
18
|
+
- restore_cache:
|
19
|
+
keys:
|
20
|
+
- spree-bundle-{{ .Branch }}
|
21
|
+
- spree-bundle
|
22
|
+
- run:
|
23
|
+
name: Add keyserver
|
24
|
+
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
|
25
|
+
- run:
|
26
|
+
name: Install libvips
|
27
|
+
command: sudo apt-get update && sudo apt-get install libvips
|
28
|
+
- run:
|
29
|
+
name: Set bundle path
|
30
|
+
command: bundle config --local path vendor/bundle
|
31
|
+
- run:
|
32
|
+
name: Ensure bundle Install
|
33
|
+
command: |
|
34
|
+
bundle check || bundle install
|
35
|
+
- run:
|
36
|
+
name: Create test app
|
37
|
+
command: |
|
38
|
+
bundle exec rake test_app
|
39
|
+
- run:
|
40
|
+
name: Run Rspec
|
41
|
+
command: |
|
42
|
+
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
43
|
+
bundle exec rspec --format documentation \
|
44
|
+
--format RspecJunitFormatter \
|
45
|
+
-o ~/rspec/rspec.xml \
|
46
|
+
-- ${TESTFILES}
|
47
|
+
- store_test_results:
|
48
|
+
path: ~/rspec
|
49
|
+
- store_artifacts:
|
50
|
+
path: tmp/capybara
|
51
|
+
|
52
|
+
jobs:
|
53
|
+
bundle:
|
54
|
+
<<: *defaults
|
55
|
+
steps:
|
56
|
+
- checkout
|
57
|
+
- restore_cache:
|
58
|
+
keys:
|
59
|
+
- spree-bundle-{{ .Branch }}
|
60
|
+
- spree-bundle
|
61
|
+
- run:
|
62
|
+
name: Add keyserver
|
63
|
+
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
|
64
|
+
- run:
|
65
|
+
name: Install libvips
|
66
|
+
command: sudo apt-get update && sudo apt-get install libvips
|
67
|
+
- run:
|
68
|
+
name: Set bundle path
|
69
|
+
command: bundle config --local path vendor/bundle
|
70
|
+
- run:
|
71
|
+
name: Bundle Install
|
72
|
+
command: |
|
73
|
+
bundle check || bundle install
|
74
|
+
- save_cache:
|
75
|
+
paths:
|
76
|
+
- vendor/bundle
|
77
|
+
key: spree-bundle-{{ checksum "Gemfile.lock" }}
|
78
|
+
|
79
|
+
tests_postgres: &tests_postgres
|
80
|
+
<<: *run_tests
|
81
|
+
environment: &postgres_environment
|
82
|
+
<<: *environment
|
83
|
+
DB: postgres
|
84
|
+
DB_HOST: localhost
|
85
|
+
DB_USERNAME: postgres
|
86
|
+
docker:
|
87
|
+
- image: *ruby_image
|
88
|
+
- image: &postgres_image cimg/postgres:16.2
|
89
|
+
environment:
|
90
|
+
POSTGRES_USER: postgres
|
91
|
+
|
92
|
+
tests_mysql: &tests_mysql
|
93
|
+
<<: *run_tests
|
94
|
+
environment: &mysql_environment
|
95
|
+
<<: *environment
|
96
|
+
DB: mysql
|
97
|
+
DB_HOST: 127.0.0.1
|
98
|
+
DB_USERNAME: root
|
99
|
+
COVERAGE: true
|
100
|
+
COVERAGE_DIR: /tmp/workspace/simplecov
|
101
|
+
docker:
|
102
|
+
- image: *ruby_image
|
103
|
+
- image: &mysql_image cimg/mysql:8.0
|
104
|
+
|
105
|
+
workflows:
|
106
|
+
version: 2
|
107
|
+
main:
|
108
|
+
jobs:
|
109
|
+
- bundle
|
110
|
+
- tests_postgres:
|
111
|
+
requires:
|
112
|
+
- bundle
|
113
|
+
- tests_mysql:
|
114
|
+
requires:
|
115
|
+
- bundle
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
@@ -5,8 +5,21 @@ git_source(:github) do |repo_name|
|
|
5
5
|
"https://github.com/#{repo_name}.git"
|
6
6
|
end
|
7
7
|
|
8
|
-
gem 'spree', github: 'spree/spree', branch: 'main'
|
9
|
-
# gem 'spree_backend', github: 'spree/spree', branch: 'main'
|
10
8
|
gem 'rails-controller-testing'
|
11
9
|
|
10
|
+
spree_opts = { github: 'spree/spree', branch: 'main' }
|
11
|
+
gem 'spree', spree_opts
|
12
|
+
gem 'spree_emails', spree_opts
|
13
|
+
|
14
|
+
gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
|
15
|
+
gem 'spree_frontend', github: 'spree/spree_rails_frontend', branch: 'main'
|
16
|
+
|
17
|
+
if ENV['DB'] == 'mysql'
|
18
|
+
gem 'mysql2'
|
19
|
+
elsif ENV['DB'] == 'postgres'
|
20
|
+
gem 'pg'
|
21
|
+
else
|
22
|
+
gem 'sqlite3', '~> 1.4'
|
23
|
+
end
|
24
|
+
|
12
25
|
gemspec
|
@@ -1,39 +1,40 @@
|
|
1
|
-
# <%=
|
1
|
+
# Spree <%= human_name %>
|
2
2
|
|
3
|
-
|
3
|
+
This is a <%= human_name %> extension for [Spree Commerce](https://spreecommerce.org), an open source e-commerce platform built with Ruby on Rails.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
1. Add this extension to your Gemfile with this line:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
|
10
|
+
bundle add <%= file_name %>
|
11
11
|
```
|
12
12
|
|
13
|
-
2.
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
bundle install
|
17
|
-
```
|
18
|
-
|
19
|
-
3. Copy & run migrations
|
13
|
+
2. Copy & run migrations
|
20
14
|
|
21
15
|
```ruby
|
22
16
|
bundle exec rails g <%= file_name %>:install
|
23
17
|
```
|
24
18
|
|
25
|
-
|
19
|
+
3. Restart your server
|
26
20
|
|
27
21
|
If your server was running, restart it so that it can find the assets properly.
|
28
22
|
|
29
|
-
##
|
23
|
+
## Developing
|
30
24
|
|
31
|
-
|
25
|
+
1. Create a dummy app
|
32
26
|
|
33
|
-
```
|
34
|
-
bundle update
|
35
|
-
bundle exec rake
|
36
|
-
```
|
27
|
+
```bash
|
28
|
+
bundle update
|
29
|
+
bundle exec rake test_app
|
30
|
+
```
|
31
|
+
|
32
|
+
2. Add your new code
|
33
|
+
3. Run tests
|
34
|
+
|
35
|
+
```bash
|
36
|
+
bundle exec rspec
|
37
|
+
```
|
37
38
|
|
38
39
|
When testing your applications integration with this extension you may use it's factories.
|
39
40
|
Simply add this require statement to your spec_helper:
|
@@ -42,7 +43,7 @@ Simply add this require statement to your spec_helper:
|
|
42
43
|
require '<%= file_name %>/factories'
|
43
44
|
```
|
44
45
|
|
45
|
-
## Releasing
|
46
|
+
## Releasing a new version
|
46
47
|
|
47
48
|
```shell
|
48
49
|
bundle exec gem bump -p -t
|
@@ -7,9 +7,8 @@ require '<%= file_name %>/version'
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.name = '<%= file_name %>'
|
10
|
-
s.version = <%= class_name
|
11
|
-
s.summary =
|
12
|
-
s.description = 'Add (optional) extension description here'
|
10
|
+
s.version = <%= class_name %>::VERSION
|
11
|
+
s.summary = "Spree Commerce <%= human_name %> Extension"
|
13
12
|
s.required_ruby_version = '>= 3.0'
|
14
13
|
|
15
14
|
s.author = 'You'
|
@@ -2,9 +2,9 @@ module <%= class_name %>
|
|
2
2
|
class Configuration < Spree::Preferences::Configuration
|
3
3
|
|
4
4
|
# Some example preferences are shown below, for more information visit:
|
5
|
-
# https://
|
5
|
+
# https://docs.spreecommerce.org/developer/contributing/creating-an-extension
|
6
6
|
|
7
|
-
preference :enabled, :boolean, default: true
|
7
|
+
# preference :enabled, :boolean, default: true
|
8
8
|
# preference :dark_chocolate, :boolean, default: true
|
9
9
|
# preference :color, :string, default: 'Red'
|
10
10
|
# preference :favorite_number, :integer
|
@@ -1,11 +1,7 @@
|
|
1
1
|
module <%= class_name %>
|
2
2
|
VERSION = '0.0.1'.freeze
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
# Returns the version of the currently loaded <%= class_name %> as a
|
7
|
-
# <tt>Gem::Version</tt>.
|
8
|
-
def version
|
9
|
-
Gem::Version.new VERSION
|
4
|
+
def gem_version
|
5
|
+
Gem::Version.new(VERSION)
|
10
6
|
end
|
11
7
|
end
|
data/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
CHANGED
@@ -10,7 +10,7 @@ module <%= class_name %>
|
|
10
10
|
def run_migrations
|
11
11
|
run_migrations = options[:migrate] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
|
12
12
|
if run_migrations
|
13
|
-
run '
|
13
|
+
run 'bin/rails db:migrate'
|
14
14
|
else
|
15
15
|
puts 'Skipping rails db:migrate, don\'t forget to run it!'
|
16
16
|
end
|
data/spree_cli.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.metadata = {
|
16
16
|
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
|
17
17
|
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
|
18
|
-
"documentation_uri" => "https://
|
18
|
+
"documentation_uri" => "https://docs.spreecommerce.org/",
|
19
19
|
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
|
20
20
|
}
|
21
21
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Mar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -41,6 +41,9 @@ files:
|
|
41
41
|
- bin/spree_cli
|
42
42
|
- lib/spree_cli.rb
|
43
43
|
- lib/spree_cli/extension.rb
|
44
|
+
- lib/spree_cli/templates/extension/.circleci/config.yml
|
45
|
+
- lib/spree_cli/templates/extension/.gem_release.yml
|
46
|
+
- lib/spree_cli/templates/extension/.github/.dependabot.yml
|
44
47
|
- lib/spree_cli/templates/extension/.rubocop.yml
|
45
48
|
- lib/spree_cli/templates/extension/CONTRIBUTING.md
|
46
49
|
- lib/spree_cli/templates/extension/Gemfile
|
@@ -66,16 +69,15 @@ files:
|
|
66
69
|
- lib/spree_cli/templates/extension/rspec
|
67
70
|
- lib/spree_cli/templates/extension/spec/.rubocop.yml
|
68
71
|
- lib/spree_cli/templates/extension/spec/spec_helper.rb
|
69
|
-
- lib/spree_cli/templates/extension/travis.yml
|
70
72
|
- spree_cli.gemspec
|
71
73
|
homepage: https://spreecommerce.org
|
72
74
|
licenses:
|
73
75
|
- BSD-3-Clause
|
74
76
|
metadata:
|
75
77
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
76
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.
|
77
|
-
documentation_uri: https://
|
78
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.
|
78
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.0
|
79
|
+
documentation_uri: https://docs.spreecommerce.org/
|
80
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.8.0
|
79
81
|
post_install_message:
|
80
82
|
rdoc_options: []
|
81
83
|
require_paths:
|
@@ -1,37 +0,0 @@
|
|
1
|
-
os: linux
|
2
|
-
dist: bionic
|
3
|
-
|
4
|
-
addons:
|
5
|
-
apt:
|
6
|
-
sources:
|
7
|
-
- google-chrome
|
8
|
-
packages:
|
9
|
-
- google-chrome-stable
|
10
|
-
|
11
|
-
services:
|
12
|
-
- mysql
|
13
|
-
- postgresql
|
14
|
-
|
15
|
-
language: ruby
|
16
|
-
|
17
|
-
rvm:
|
18
|
-
- 2.7
|
19
|
-
- 3.0
|
20
|
-
|
21
|
-
env:
|
22
|
-
- DB=mysql
|
23
|
-
- DB=postgres
|
24
|
-
|
25
|
-
before_install:
|
26
|
-
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
|
27
|
-
|
28
|
-
before_script:
|
29
|
-
- CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
|
30
|
-
- CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
|
31
|
-
- curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
|
32
|
-
- unzip chromedriver_linux64.zip -d ~/bin
|
33
|
-
- nvm install 16
|
34
|
-
|
35
|
-
script:
|
36
|
-
- bundle exec rake test_app
|
37
|
-
- bundle exec rspec
|