potassium 6.0.0 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +103 -38
- data/.circleci/setup-rubygems.sh +3 -0
- data/.gitignore +2 -1
- data/.rubocop.yml +530 -0
- data/CHANGELOG.md +57 -0
- data/README.md +51 -45
- data/lib/potassium/assets/.circleci/config.yml.erb +83 -34
- data/lib/potassium/assets/.eslintrc.json +13 -4
- data/lib/potassium/assets/.github/pull_request_template.md +9 -0
- data/lib/potassium/assets/.rubocop.yml +13 -0
- data/lib/potassium/assets/README.yml +7 -7
- data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
- data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
- data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
- data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
- data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
- data/lib/potassium/assets/app/javascript/app.spec.js +1 -1
- data/lib/potassium/assets/app/uploaders/base_uploader.rb +1 -3
- data/lib/potassium/assets/app/views/shared/_gtm_body.html.erb +4 -0
- data/lib/potassium/assets/app/views/shared/_gtm_head.html.erb +7 -0
- data/lib/potassium/assets/config/graphql_playground.rb +20 -0
- data/lib/potassium/assets/config/puma.rb +1 -1
- data/lib/potassium/assets/config/shrine.rb +4 -1
- data/lib/potassium/assets/redis.yml +1 -2
- data/lib/potassium/assets/testing/rails_helper.rb +2 -0
- data/lib/potassium/cli/commands/create.rb +11 -19
- data/lib/potassium/cli_options.rb +70 -10
- data/lib/potassium/helpers/template-helpers.rb +4 -0
- data/lib/potassium/newest_version_ensurer.rb +19 -36
- data/lib/potassium/node_version_ensurer.rb +30 -0
- data/lib/potassium/recipes/admin.rb +26 -16
- data/lib/potassium/recipes/api.rb +92 -27
- data/lib/potassium/recipes/background_processor.rb +62 -18
- data/lib/potassium/recipes/ci.rb +9 -39
- data/lib/potassium/recipes/database.rb +4 -0
- data/lib/potassium/recipes/draper.rb +0 -9
- data/lib/potassium/recipes/file_storage.rb +2 -1
- data/lib/potassium/recipes/front_end.rb +84 -9
- data/lib/potassium/recipes/github.rb +93 -15
- data/lib/potassium/recipes/google_tag_manager.rb +94 -0
- data/lib/potassium/recipes/heroku.rb +42 -29
- data/lib/potassium/recipes/mailer.rb +18 -5
- data/lib/potassium/recipes/monitoring.rb +5 -0
- data/lib/potassium/recipes/schedule.rb +16 -1
- data/lib/potassium/recipes/style.rb +2 -2
- data/lib/potassium/templates/application.rb +5 -2
- data/lib/potassium/version.rb +5 -2
- data/potassium.gemspec +5 -2
- data/spec/features/api_spec.rb +25 -0
- data/spec/features/background_processor_spec.rb +19 -6
- data/spec/features/ci_spec.rb +7 -4
- data/spec/features/draper_spec.rb +1 -6
- data/spec/features/file_storage_spec.rb +5 -0
- data/spec/features/front_end_spec.rb +32 -1
- data/spec/features/github_spec.rb +53 -8
- data/spec/features/google_tag_manager_spec.rb +36 -0
- data/spec/features/graphql_spec.rb +71 -0
- data/spec/features/mailer_spec.rb +16 -0
- data/spec/features/schedule_spec.rb +11 -4
- data/spec/spec_helper.rb +1 -0
- data/spec/support/fake_octokit.rb +31 -0
- data/spec/support/potassium_test_helpers.rb +0 -1
- data/tmp/.keep +0 -0
- metadata +80 -15
- data/lib/potassium/assets/Dockerfile.ci +0 -6
- data/lib/potassium/assets/api/api_error_concern.rb +0 -32
- data/lib/potassium/assets/api/base_controller.rb +0 -7
- data/lib/potassium/assets/api/draper_responder.rb +0 -62
- data/lib/potassium/assets/api/responder.rb +0 -41
- data/lib/potassium/assets/bin/cibuild.erb +0 -117
- data/lib/potassium/assets/docker-compose.ci.yml +0 -12
- data/lib/potassium/assets/sidekiq_scheduler.yml +0 -9
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,63 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 6.4.0
|
6
|
+
|
7
|
+
Features
|
8
|
+
- Include `run_test` as a valid example group [#379](https://github.com/platanus/potassium/pull/379)
|
9
|
+
- Updates ActiveAdmin installation to use webpacker [#350](https://github.com/platanus/potassium/pull/350)
|
10
|
+
- Replaces Active Skin with Arctic Admin [#350](https://github.com/platanus/potassium/pull/350)
|
11
|
+
|
12
|
+
Fixes
|
13
|
+
- Forces `vue-loader` version to 15, as 16 requires `@vue/compiler-sfc`, which is a part of Vue 3 [#375](https://github.com/platanus/potassium/pull/375)
|
14
|
+
- Changes Content Security Policy added by GTM recipe to: [#375](https://github.com/platanus/potassium/pull/375)
|
15
|
+
- Include the same config regardless of environment
|
16
|
+
- Include `unsafe_eval` in `script_src`, as it is required for Vue's compiler build
|
17
|
+
- Changes the front-end test to avoid using the deprecated method `isVueInstance` [#376](https://github.com/platanus/potassium/pull/376)
|
18
|
+
|
19
|
+
## 6.3.0
|
20
|
+
|
21
|
+
Features:
|
22
|
+
- Add `monitoring` recipe with scout gem [#353](https://github.com/platanus/potassium/pull/353)
|
23
|
+
- Change CircleCI config to use cache in tests, and remove old cibuild flow [#366](https://github.com/platanus/potassium/pull/366)
|
24
|
+
|
25
|
+
Fixes:
|
26
|
+
- Explicitly install project specified node version in CircleCI build [#352](https://github.com/platanus/potassium/pull/352)
|
27
|
+
- Fixes `tailwindCSS@^2` incompatibility with `postcss@^7` [#356](https://github.com/platanus/potassium/pull/356)
|
28
|
+
- Update marcel gem (shrine's mime type analyzer) to avoid mimemagic dependency [#357](https://github.com/platanus/potassium/pull/357)
|
29
|
+
- Explicitly set the frontend test environment to `jsdom` [#367](https://github.com/platanus/potassium/pull/367)
|
30
|
+
|
31
|
+
## 6.2.0
|
32
|
+
|
33
|
+
Features:
|
34
|
+
- Add Google Tag Manager [#326](https://github.com/platanus/potassium/pull/326)
|
35
|
+
- Update rubocop and rubocop-rspec for potassium and generated projects [#337](https://github.com/platanus/potassium/pull/337)
|
36
|
+
- Adds `mailers` queue to `sidekiq.yml` when installing or creating mailer recipe [#341](https://github.com/platanus/potassium/pull/341)
|
37
|
+
|
38
|
+
Fixes:
|
39
|
+
- Change `backgroud_processor` cli option to a switch. As of [#137](https://github.com/platanus/potassium/pull/137) we no longer have `delayed_jobs` as an option, it's only `sidekiq` now [#340](https://github.com/platanus/potassium/pull/340)
|
40
|
+
- Fixes mailer recipe install when background_processor wasn't installed [#341](https://github.com/platanus/potassium/pull/341)
|
41
|
+
- Update `heroku` recipe to check if an app or pipeline name is valid before creating it on Heroku [#344](https://github.com/platanus/potassium/pull/344)
|
42
|
+
|
43
|
+
## 6.1.0
|
44
|
+
|
45
|
+
Features:
|
46
|
+
- Check node version before project creation [#305](https://github.com/platanus/potassium/pull/305)
|
47
|
+
- Disable observers in test environment [#319](https://github.com/platanus/potassium/pull/319)
|
48
|
+
- Allow user to select custom Github repository [#318](https://github.com/platanus/potassium/pull/318)
|
49
|
+
- Add pull request template to github enabled projects [#320](https://github.com/platanus/potassium/pull/320)
|
50
|
+
- Use a Ruby gem instead of hub to create Github repositories [#323](https://github.com/platanus/potassium/pull/323)
|
51
|
+
- Add dockerized redis configuration when using background processor [#329](https://github.com/platanus/potassium/pull/329)
|
52
|
+
- Add beta support for GraphQL. [#330](https://github.com/platanus/potassium/pull/330)
|
53
|
+
- Add power_api [#301](https://github.com/platanus/potassium/pull/301)
|
54
|
+
|
55
|
+
|
56
|
+
Fix:
|
57
|
+
- Fix shrine issues related to configuration and uploader validation [#302](https://github.com/platanus/potassium/pull/302)
|
58
|
+
- Fix database recipe not running recommended generator for strong_migrations gem [#310](https://github.com/platanus/potassium/pull/310)
|
59
|
+
- Fix puma config that was causing it to crash on server start while on development [#313](https://github.com/platanus/potassium/pull/313)
|
60
|
+
- Fix purge css being enabled in development [#327](https://github.com/platanus/potassium/pull/327)
|
61
|
+
|
5
62
|
## 6.0.0
|
6
63
|
|
7
64
|
Features:
|
data/README.md
CHANGED
@@ -16,7 +16,10 @@ Use the `potassium create` command to create a new project:
|
|
16
16
|
|
17
17
|
$ potassium create <project-name>
|
18
18
|
|
19
|
-
>
|
19
|
+
> Please note:
|
20
|
+
> 1. Potassium will perform a version check before running to ensure that you are using the latest potassium.
|
21
|
+
> 2. If you feel that it's too slow, you may need to update rubygems: `gem update --system`.
|
22
|
+
> 3. Potassium uses node under the hood, so a check will also be performed to ensure you are running the supported version.
|
20
23
|
|
21
24
|
### Adding recipes to an existing project
|
22
25
|
|
@@ -36,41 +39,41 @@ You can run the command on its own to view all the available recipes and select
|
|
36
39
|
|
37
40
|
Potassium Rails apps includes the following gems and technologies:
|
38
41
|
|
39
|
-
- [
|
40
|
-
- [
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
44
|
-
- [
|
45
|
-
- [
|
46
|
-
- [
|
47
|
-
- [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS.
|
42
|
+
- [dotenv](https://github.com/bkeepers/dotenv) for loading environmental variables in development
|
43
|
+
- [Yarn](https://yarnpkg.com) for frontend assets packages
|
44
|
+
- [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same
|
45
|
+
- [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience
|
46
|
+
- [RSpec](http://rspec.info) for unit and integration testing
|
47
|
+
- [FactoryBot](https://github.com/thoughtbot/factory_bot) for test factories
|
48
|
+
- [Guard](http://guardgem.org) for continuous testing and other watch-related tasks
|
49
|
+
- [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS
|
48
50
|
- [Puma](https://github.com/puma/puma) to serve HTTP requests
|
49
51
|
- [Rack Timeout](https://github.com/heroku/rack-timeout) to abort requests that are
|
50
52
|
taking too long
|
51
|
-
- [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for
|
52
|
-
- [Faker](https://github.com/stympy/faker) for
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
- [
|
58
|
-
- [
|
59
|
-
- [
|
60
|
-
- [
|
61
|
-
- [
|
62
|
-
- [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby
|
53
|
+
- [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for updating timezone information
|
54
|
+
- [Faker](https://github.com/stympy/faker) for creating development data
|
55
|
+
- [Scout](https://github.com/scoutapp/scout_apm_ruby) for monitoring performance
|
56
|
+
|
57
|
+
The following optional integrations are also added:
|
58
|
+
|
59
|
+
- [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database
|
60
|
+
- [Devise](https://github.com/plataformatec/devise) for authentication
|
61
|
+
- [ActiveAdmin](http://activeadmin.info) for admin interfaces
|
62
|
+
- [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin
|
63
|
+
- [Pundit](https://github.com/elabs/pundit) for role-based authorization
|
64
|
+
- [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby
|
63
65
|
- [Sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) to run scheduled processes
|
64
66
|
- Mailing configuration for [AWS SES](https://github.com/aws/aws-sdk-rails)
|
65
67
|
and [Sendgrid](https://github.com/platanus/send_grid_mailer) with recipient interceptor support
|
66
68
|
- [Sentry](https://sentry.io) to monitor exceptions and errors
|
67
69
|
- [Vue.js](https://vuejs.org) or [Angular 2](https://angular.io/) for frontend development
|
70
|
+
- [Google Tag Manager](https://tagmanager.google.com/) for analytics
|
71
|
+
- Creates the Github repository of your choice for the project. A local git repository will always be created.
|
68
72
|
|
69
73
|
A few more things are added to the project:
|
70
74
|
|
71
75
|
- A [low database connection pool limit][pool]
|
72
|
-
- Setup continuous integration in [CircleCI](circle-ci) to run tests
|
73
|
-
- Create the github repository for the project (it used `hub` under the hood)
|
76
|
+
- Setup continuous integration in [CircleCI](circle-ci) to run tests
|
74
77
|
- A `bin/setup` script to setup things on a newly cloned project
|
75
78
|
- A `bin/cibuild` script to run continuous integration build on CI
|
76
79
|
- A `db:fake_data:load` rake task to load fake data for development
|
@@ -81,24 +84,20 @@ A few more things are added to the project:
|
|
81
84
|
|
82
85
|
The optional API support includes:
|
83
86
|
|
84
|
-
- [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
|
85
|
-
- [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
|
86
|
-
- [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
|
87
|
-
- [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
|
87
|
+
- [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
|
88
|
+
- [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
|
89
|
+
- [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
|
90
|
+
- [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
|
88
91
|
|
89
92
|
### Heroku
|
90
93
|
|
91
94
|
When you choose to deploy to heroku a few extra things are added for the project.
|
92
95
|
|
93
|
-
- Adds the [Rails Stdout Logging][logging-gem] gem
|
94
|
-
to configure the app to log to standard out,
|
95
|
-
which is how [Heroku's logging][heroku-logging] works.
|
96
|
+
- Adds the [Rails Stdout Logging][logging-gem] gem to configure the app to log to standard out, which is how [Heroku's logging][heroku-logging] works
|
96
97
|
- Adds a [Procfile][procfile] to define the processes to run in heroku
|
97
|
-
- Setup continuous integration using docker and herokuish to maintain better
|
98
|
-
|
99
|
-
- Adds a `.buildpacks` file with the default buildpacks to use. It use the
|
100
|
-
following buildpacks:
|
101
|
-
- Adds a `bin/release` file with the release phase script to run specific tasks before the app is deployed completely, for example `rails db:migrate:with_data`.
|
98
|
+
- Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
|
99
|
+
- Adds a `bin/release` file with the release phase script to run specific tasks before the app is deployed completely, for example `rails db:migrate:with_data`
|
100
|
+
- Adds a `.buildpacks` file with the default buildpacks to use. It use the following buildpacks:
|
102
101
|
|
103
102
|
| index | buildpack | description |
|
104
103
|
|-------|-----------|-------------|
|
@@ -110,7 +109,7 @@ Also the heroku applications are created
|
|
110
109
|
|
111
110
|
- Creates a `staging` and `production` applications
|
112
111
|
- Creates a pipeline and assign the above application to the `staging`
|
113
|
-
and `production` stages
|
112
|
+
and `production` stages
|
114
113
|
- Setup initial configuration variables
|
115
114
|
- Set the application buildpack to the [multi-buildpack][heroku-buildpack-multi]
|
116
115
|
|
@@ -126,11 +125,9 @@ In order to CicleCI start building the project on each push you need tell circle
|
|
126
125
|
Go to https://circleci.com/add-projects, choose the repository from the list and hit
|
127
126
|
**Build Project**
|
128
127
|
|
129
|
-
|
128
|
+
#### ReviewDog
|
130
129
|
|
131
|
-
In order to
|
132
|
-
Go to https://monkeyci.platan.us, choose the repository from the list and hit
|
133
|
-
**Activate**
|
130
|
+
In order to enable code linting via CircleCI and ReviewDog, you need to activate the **Only build pull requests** option under the `Advanced settings` section for your project.
|
134
131
|
|
135
132
|
[logging-gem]: https://github.com/heroku/rails_stdout_logging
|
136
133
|
[heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
|
@@ -149,15 +146,24 @@ This is useful when you are adding new recipes to Potassium, and you want to use
|
|
149
146
|
To achieve this you need to run, **In the Potassium's root path**, the `bin/potassium_test create` instead of `potassium create` command.
|
150
147
|
This command, will do the same as `potassium create` but first:
|
151
148
|
|
152
|
-
- Will drop any existent database of the test app
|
153
|
-
- Will remove the directory containing a previous version of the test app
|
149
|
+
- Will drop any existent database of the test app
|
150
|
+
- Will remove the directory containing a previous version of the test app
|
154
151
|
|
155
152
|
It's important to remember that `bin/potassium_test create`:
|
156
153
|
|
157
154
|
- Does not receive an `app_path` param. It always creates the test project inside `/tmp/dummy_app`
|
158
|
-
- Can receive the same options as `potassium create
|
155
|
+
- Can receive the same options as `potassium create`
|
159
156
|
- Runs with options with a default value. This is to avoid the "asking part" of the creation process. You need to enable what you want to test like this: `$ bin/potassium_test create --clockwork`
|
160
157
|
|
158
|
+
## Publishing
|
159
|
+
On master branch.
|
160
|
+
|
161
|
+
1. Change `VERSION` in `lib/potassium/version.rb`
|
162
|
+
2. Change `Unreleased` title to current version in `CHANGELOG.md`
|
163
|
+
3. Commit new release. For example: `Releasing v6.3.0`
|
164
|
+
4. Create tag. For example: `git tag v6.3.0`
|
165
|
+
5. Push tag: `git push origin v6.3.0`
|
166
|
+
|
161
167
|
## Contributing
|
162
168
|
|
163
169
|
If you want to add functionality please go to
|
@@ -173,4 +179,4 @@ potassium is maintained by [platanus](http://platan.us).
|
|
173
179
|
|
174
180
|
## License
|
175
181
|
|
176
|
-
Potassium is © 2014
|
182
|
+
Potassium is © 2014 Platanus, SPA. It is free software and may be redistributed under the terms specified in the LICENSE file.
|
@@ -1,34 +1,37 @@
|
|
1
|
-
version: 2
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
ruby-image: &ruby-image circleci/ruby:<%= ruby_version %>
|
4
|
+
<%- if selected?(:database, :postgresql) -%>
|
5
|
+
postgres-image: &postgres-image postgres:<%= Potassium::POSTGRES_VERSION %>
|
6
|
+
<%- end -%>
|
7
|
+
<%- if selected?(:background_processor) -%>
|
8
|
+
redis-image: &redis-image redis
|
9
|
+
<%- end -%>
|
10
|
+
env-vars: &env-vars
|
11
|
+
BUNDLE_JOBS: 4
|
12
|
+
BUNDLE_PATH: vendor/bundle
|
13
|
+
RAILS_ENV: test
|
14
|
+
|
15
|
+
executors:
|
16
|
+
test-executor:
|
6
17
|
docker:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
- run: bin/cibuild deps
|
18
|
-
|
19
|
-
- run: bin/cibuild db
|
20
|
-
- run: bin/cibuild tests
|
21
|
-
<% if selected?(:front_end, :vue) %>
|
22
|
-
- run: bin/cibuild js_tests
|
23
|
-
<% end %>
|
24
|
-
|
25
|
-
lint:
|
18
|
+
- image: *ruby-image
|
19
|
+
environment: *env-vars
|
20
|
+
<%- if selected?(:database, :postgresql) -%>
|
21
|
+
- image: *postgres-image
|
22
|
+
<%- end -%>
|
23
|
+
<%- if selected?(:background_processor) -%>
|
24
|
+
- image: *redis-image
|
25
|
+
<%- end -%>
|
26
|
+
|
27
|
+
lint-executor:
|
26
28
|
docker:
|
27
|
-
- image:
|
28
|
-
environment:
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
- image: *ruby-image
|
30
|
+
environment: *env-vars
|
31
|
+
|
32
|
+
commands:
|
33
|
+
setup:
|
34
|
+
description: checkout code, restore cache, install dependencies, save cache
|
32
35
|
steps:
|
33
36
|
- checkout
|
34
37
|
|
@@ -49,20 +52,67 @@ jobs:
|
|
49
52
|
gem install bundler:$BUNDLER_VERSION
|
50
53
|
bundle _$(echo $BUNDLER_VERSION)_ install
|
51
54
|
|
55
|
+
- run:
|
56
|
+
name: Install yarn dependencies
|
57
|
+
command: |
|
58
|
+
curl -sL https://deb.nodesource.com/setup_$(cat .node-version).x | sudo -E bash -
|
59
|
+
sudo apt-get install -y nodejs
|
60
|
+
curl -o- -sL https://yarnpkg.com/install.sh | bash
|
61
|
+
sudo ln -s $HOME/.yarn/bin/yarn /usr/local/bin/yarn
|
62
|
+
yarn install --frozen-lockfile
|
63
|
+
|
52
64
|
- save_cache:
|
53
65
|
key: bundle-dependencies-{{ checksum "Gemfile.lock" }}
|
54
66
|
paths:
|
55
67
|
- vendor/bundle
|
56
68
|
|
57
|
-
- run:
|
58
|
-
name: Install yarn dependencies
|
59
|
-
command: yarn install --frozen-lockfile
|
60
|
-
|
61
69
|
- save_cache:
|
62
70
|
key: yarn-dependencies-{{ checksum "yarn.lock" }}
|
63
71
|
paths:
|
64
72
|
- node_modules
|
65
73
|
|
74
|
+
jobs:
|
75
|
+
test:
|
76
|
+
executor: test-executor
|
77
|
+
steps:
|
78
|
+
- setup
|
79
|
+
|
80
|
+
<%- if selected?(:background_processor) -%>
|
81
|
+
- run:
|
82
|
+
name: Wait for redis service
|
83
|
+
command: dockerize -wait tcp://localhost:6379 -timeout 1m
|
84
|
+
<%- end -%>
|
85
|
+
<%- if selected?(:database, :postgresql) -%>
|
86
|
+
- run:
|
87
|
+
name: Wait for postgres service
|
88
|
+
command: dockerize -wait tcp://localhost:5432 -timeout 1m
|
89
|
+
|
90
|
+
- run:
|
91
|
+
name: Setup database
|
92
|
+
command: bundle exec rails db:create db:schema:load
|
93
|
+
<%- end -%>
|
94
|
+
|
95
|
+
- run:
|
96
|
+
name: Run rspec
|
97
|
+
command: |
|
98
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
|
99
|
+
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
|
100
|
+
bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
101
|
+
|
102
|
+
<%- if selected?(:front_end, :vue) -%>
|
103
|
+
- run:
|
104
|
+
name: Run jest
|
105
|
+
command: yarn run test
|
106
|
+
<%- end -%>
|
107
|
+
|
108
|
+
- store_test_results:
|
109
|
+
path: test_results
|
110
|
+
|
111
|
+
lint:
|
112
|
+
executor: lint-executor
|
113
|
+
steps:
|
114
|
+
- setup
|
115
|
+
|
66
116
|
- run:
|
67
117
|
name: Install reviewdog
|
68
118
|
command: |
|
@@ -94,7 +144,6 @@ jobs:
|
|
94
144
|
| ./bin/reviewdog -reporter=github-pr-review -f=stylelint
|
95
145
|
|
96
146
|
workflows:
|
97
|
-
version: 2
|
98
147
|
test_and_lint:
|
99
148
|
jobs:
|
100
149
|
- test
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"array-callback-return": 2,
|
23
23
|
"block-scoped-var": 2,
|
24
24
|
"complexity": [1, {
|
25
|
-
"max":
|
25
|
+
"max": 6
|
26
26
|
}],
|
27
27
|
"consistent-return": 2,
|
28
28
|
"curly": [2, "multi-line"],
|
@@ -100,8 +100,8 @@
|
|
100
100
|
"yoda": 2,
|
101
101
|
"comma-dangle": [2, "always-multiline"],
|
102
102
|
"no-cond-assign": [2, "always"],
|
103
|
-
"no-console":
|
104
|
-
"no-debugger":
|
103
|
+
"no-console": 1,
|
104
|
+
"no-debugger": 1,
|
105
105
|
"no-constant-condition": 2,
|
106
106
|
"no-control-regex": 2,
|
107
107
|
"no-dupe-args": 2,
|
@@ -339,5 +339,14 @@
|
|
339
339
|
"code": 120,
|
340
340
|
"ignoreHTMLAttributeValues": true
|
341
341
|
}]
|
342
|
-
}
|
342
|
+
},
|
343
|
+
"overrides": [
|
344
|
+
{
|
345
|
+
"files": ["**/*.js"],
|
346
|
+
"excludedFiles": "app/**/*.js",
|
347
|
+
"env": {
|
348
|
+
"node": true
|
349
|
+
}
|
350
|
+
}
|
351
|
+
]
|
343
352
|
}
|
@@ -502,6 +502,19 @@ Performance/RedundantBlockCall:
|
|
502
502
|
Description: Use `yield` instead of `block.call`.
|
503
503
|
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
|
504
504
|
Enabled: false
|
505
|
+
Style/OptionalBooleanParameter:
|
506
|
+
Description: 'Use keyword arguments when defining method with boolean argument.'
|
507
|
+
Enabled: false
|
508
|
+
Lint/MissingSuper:
|
509
|
+
Description: >-
|
510
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
511
|
+
without calls to `super`'.
|
512
|
+
Enabled: false
|
513
|
+
Style/RedundantFileExtensionInRequire:
|
514
|
+
Description: >-
|
515
|
+
Checks for the presence of superfluous `.rb` extension in
|
516
|
+
the filename provided to `require` and `require_relative`.
|
517
|
+
Enabled: false
|
505
518
|
RSpec/MultipleExpectations:
|
506
519
|
Max: 5
|
507
520
|
RSpec/NestedGroups:
|
@@ -42,10 +42,7 @@ readme:
|
|
42
42
|
The project is setup to run tests
|
43
43
|
in [CircleCI](https://circleci.com/gh/platanus/<%= get(:dasherized_app_name) %>/tree/master)
|
44
44
|
|
45
|
-
You can also run the test locally simulating the production environment using
|
46
|
-
Just make sure you have docker installed and run:
|
47
|
-
|
48
|
-
bin/cibuild
|
45
|
+
You can also run the test locally simulating the production environment using [CircleCI's method](https://circleci.com/docs/2.0/local-cli/).
|
49
46
|
deployment:
|
50
47
|
title: "Deployment"
|
51
48
|
body: |
|
@@ -112,9 +109,6 @@ readme:
|
|
112
109
|
pundit:
|
113
110
|
title: "Authorization"
|
114
111
|
body: "For defining which parts of the system each user has access to, we have chosen to include the [Pundit](https://github.com/elabs/pundit) gem, by [Elabs](http://elabs.se/)."
|
115
|
-
delayed_job:
|
116
|
-
title: "Queue System"
|
117
|
-
body: "For managing tasks in the background, this project uses [DelayedJob](https://github.com/collectiveidea/delayed_job)"
|
118
112
|
sidekiq:
|
119
113
|
title: "Queue System"
|
120
114
|
body: "For managing tasks in the background, this project uses [Sidekiq](https://github.com/mperham/sidekiq)"
|
@@ -130,6 +124,12 @@ readme:
|
|
130
124
|
power_types:
|
131
125
|
title: "Rails pattern enforcing types"
|
132
126
|
body: "This projects uses [Power-Types](https://github.com/platanus/power-types) to generate Services, Commands, Utils and Values."
|
127
|
+
power_api:
|
128
|
+
title: "API Support"
|
129
|
+
body: "This projects uses [Power API](https://github.com/platanus/power_api). It's a Rails engine that gathers a set of gems and configurations designed to build incredible REST APIs."
|
130
|
+
graphql:
|
131
|
+
title: "API Support"
|
132
|
+
body: "This projects uses [graphql-ruby](https://graphql-ruby.org/) to generate a GraphQL API."
|
133
133
|
active_admin:
|
134
134
|
title: "Administration"
|
135
135
|
body: |
|