Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ commands:

jobs:
solidus-master:
executor: solidusio_extensions/sqlite
executor:
name: solidusio_extensions/sqlite
ruby_version: '3.1'
steps: ['setup', 'solidusio_extensions/run-tests-solidus-master', 'notify']
solidus-current:
executor: solidusio_extensions/sqlite
executor:
name: solidusio_extensions/sqlite
ruby_version: '3.0'
steps: ['setup', 'solidusio_extensions/run-tests-solidus-current', 'notify']
solidus-older:
executor: solidusio_extensions/sqlite
executor:
name: solidusio_extensions/sqlite
ruby_version: '2.7'
steps: ['setup', 'solidusio_extensions/run-tests-solidus-older', 'notify']
lint-code:
executor: solidusio_extensions/sqlite
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ in solidus_dev_support.

#### Updating existing extensions

If you have an existing extension and want to update it to use the latest standards from this gem,
you can run the following in the extension's directory:
If you have an existing extension generated with `solidus_dev_support` and want to update it to use
the latest standards from this gem, you can run the following in the extension's directory:

```console
$ solidus extension .
$ bundle exec solidus extension .
```

In case of conflicting files, you will be prompted for an action. You can overwrite the files with
Expand Down
12 changes: 9 additions & 3 deletions lib/solidus_dev_support/templates/extension/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ orbs:
solidusio_extensions: solidusio/extensions@volatile

jobs:
run-specs-with-sqlite:
executor: solidusio_extensions/sqlite
steps:
- browser-tools/install-chrome
- solidusio_extensions/run-tests
run-specs-with-postgres:
executor: solidusio_extensions/postgres
steps:
- browser-tools/install-browser-tools
- browser-tools/install-chrome
- solidusio_extensions/run-tests
run-specs-with-mysql:
executor: solidusio_extensions/mysql
steps:
- browser-tools/install-browser-tools
- browser-tools/install-chrome
- solidusio_extensions/run-tests
lint-code:
executor: solidusio_extensions/sqlite-memory
steps:
- browser-tools/install-browser-tools
- solidusio_extensions/lint-code

workflows:
"Run specs on supported Solidus versions":
jobs:
- run-specs-with-sqlite
- run-specs-with-postgres
- run-specs-with-mysql
- lint-code
Expand All @@ -43,5 +48,6 @@ workflows:
only:
- master
jobs:
- run-specs-with-sqlite
- run-specs-with-postgres
- run-specs-with-mysql
18 changes: 1 addition & 17 deletions lib/solidus_dev_support/templates/extension/.github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: false
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It might be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
_extends: .github
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ gem 'solidus_frontend' if branch >= 'v3.2' # rubocop:disable Bundler/DuplicatedG
# See https://github.com/bundler/bundler/issues/6677
gem 'rails', '>0.a'

<% if file_name != 'solidus_auth_devise' %>
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

<% end %>
case ENV.fetch('DB', nil)
when 'mysql'
gem 'mysql2'
Expand Down
2 changes: 1 addition & 1 deletion lib/solidus_dev_support/templates/extension/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) <%= Time.now.year %> [name of plugin creator]
Copyright (c) <%= Time.now.year %> <%= gemspec.authors.join ', ' %>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
15 changes: 2 additions & 13 deletions lib/solidus_dev_support/templates/extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,10 @@ $ bin/rails server
Use Ctrl-C to stop
```

### Updating the changelog

Before and after releases the changelog should be updated to reflect the up-to-date status of
the project:

```shell
bin/rake changelog
git add CHANGELOG.md
git commit -m "Update the changelog"
```

### Releasing new versions

Please refer to the dedicated [page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) on Solidus wiki.
Please refer to the [dedicated page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) in the Solidus wiki.

## License

Copyright (c) <%= Time.now.year %> [name of extension author], released under the New BSD License.
Copyright (c) <%= Time.now.year %> <%= gemspec.authors.join ', ' %>, released under the New BSD License.
30 changes: 4 additions & 26 deletions lib/solidus_dev_support/templates/extension/bin/sandbox.tt
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
#!/usr/bin/env bash

set -e
if [ -n "$DEBUG" ]
then
set -x
fi
test -z "${DEBUG+empty_string}" || set -x

case "$DB" in
postgres|postgresql)
RAILSDB="postgresql"
;;
mysql)
RAILSDB="mysql"
;;
sqlite3|sqlite)
RAILSDB="sqlite3"
;;
'')
echo "~~> Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
RAILSDB="sqlite3"
;;
*)
echo "Invalid value specified for the Solidus sandbox: DB=\"$DB\"."
echo "Please use 'postgres', 'mysql', or 'sqlite' instead."
exit 1
;;
esac
echo "~~> Using $RAILSDB as the database engine"
test "$DB" = "sqlite" && export DB="sqlite3"

if [ -z "$SOLIDUS_BRANCH" ]
then
Expand All @@ -50,7 +27,8 @@ function unbundled {
}

rm -rf ./sandbox
unbundled bundle exec rails new sandbox --database="$RAILSDB" \
unbundled bundle exec rails new sandbox \
--database="${DB:-sqlite3}" \
--skip-bundle \
--skip-git \
--skip-keeps \
Expand Down
1 change: 1 addition & 0 deletions lib/solidus_dev_support/templates/extension/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.sass-cache
coverage
Gemfile.lock
Gemfile-local
tmp
nbproject
pkg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ module <%= class_name %>
class_option :auto_run_migrations, type: :boolean, default: false
source_root File.expand_path('templates', __dir__)

def self.exit_on_failure?
true
end

def copy_initializer
template 'initializer.rb', 'config/initializers/<%= file_name %>.rb'
end
Expand Down