potassium 5.2.1 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +84 -0
  3. data/.gitignore +2 -1
  4. data/.node-version +1 -0
  5. data/.rubocop.yml +530 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +91 -0
  8. data/README.md +41 -47
  9. data/docs/DSL.md +5 -5
  10. data/lib/potassium/assets/.buildpacks +0 -1
  11. data/lib/potassium/assets/.circleci/config.yml.erb +102 -0
  12. data/lib/potassium/assets/.eslintrc.json +352 -0
  13. data/lib/potassium/assets/.github/pull_request_template.md +9 -0
  14. data/lib/potassium/assets/.pryrc +1 -1
  15. data/lib/potassium/assets/.rubocop.yml +528 -0
  16. data/lib/potassium/assets/.stylelintrc.json +46 -0
  17. data/lib/potassium/assets/Dockerfile.ci +1 -1
  18. data/lib/potassium/assets/Makefile.erb +21 -32
  19. data/lib/potassium/assets/Procfile +1 -0
  20. data/lib/potassium/assets/README.yml +58 -11
  21. data/lib/potassium/assets/active_admin/admin-component.vue +35 -0
  22. data/lib/potassium/assets/active_admin/admin_application.js +14 -0
  23. data/lib/potassium/assets/active_admin/init_activeadmin_vue.rb +10 -0
  24. data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
  25. data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
  26. data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
  27. data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
  28. data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
  29. data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
  30. data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
  31. data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
  32. data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
  33. data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
  34. data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
  35. data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
  36. data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
  37. data/lib/potassium/assets/app/javascript/app.spec.js +14 -0
  38. data/lib/potassium/assets/app/uploaders/base_uploader.rb +11 -0
  39. data/lib/potassium/assets/app/uploaders/image_uploader.rb +5 -0
  40. data/lib/potassium/assets/app/views/shared/_gtm_body.html.erb +4 -0
  41. data/lib/potassium/assets/app/views/shared/_gtm_head.html.erb +7 -0
  42. data/lib/potassium/assets/bin/cibuild.erb +24 -7
  43. data/lib/potassium/assets/bin/release +9 -0
  44. data/lib/potassium/assets/bin/setup.erb +1 -1
  45. data/lib/potassium/assets/config/database_mysql.yml.erb +2 -2
  46. data/lib/potassium/assets/config/database_postgresql.yml.erb +2 -2
  47. data/lib/potassium/assets/config/graphql_playground.rb +20 -0
  48. data/lib/potassium/assets/config/puma.rb +1 -1
  49. data/lib/potassium/assets/config/shrine.rb +36 -0
  50. data/lib/potassium/assets/docker-compose.ci.yml +2 -1
  51. data/lib/potassium/assets/lib/tasks/auto_annotate_models.rake +34 -33
  52. data/lib/potassium/assets/package.json +4 -1
  53. data/lib/potassium/assets/redis.yml +1 -2
  54. data/lib/potassium/assets/testing/rails_helper.rb +4 -2
  55. data/lib/potassium/cli/commands/create.rb +12 -19
  56. data/lib/potassium/cli_options.rb +77 -26
  57. data/lib/potassium/helpers/gem-helpers.rb +1 -1
  58. data/lib/potassium/helpers/template-helpers.rb +4 -0
  59. data/lib/potassium/newest_version_ensurer.rb +19 -36
  60. data/lib/potassium/node_version_ensurer.rb +30 -0
  61. data/lib/potassium/recipes/admin.rb +3 -3
  62. data/lib/potassium/recipes/annotate.rb +1 -1
  63. data/lib/potassium/recipes/api.rb +93 -21
  64. data/lib/potassium/recipes/background_processor.rb +66 -19
  65. data/lib/potassium/recipes/ci.rb +6 -4
  66. data/lib/potassium/recipes/data_migrate.rb +44 -0
  67. data/lib/potassium/recipes/database.rb +4 -0
  68. data/lib/potassium/recipes/database_container.rb +7 -5
  69. data/lib/potassium/recipes/draper.rb +1 -10
  70. data/lib/potassium/recipes/file_storage.rb +66 -0
  71. data/lib/potassium/recipes/front_end.rb +219 -9
  72. data/lib/potassium/recipes/github.rb +93 -15
  73. data/lib/potassium/recipes/google_tag_manager.rb +90 -0
  74. data/lib/potassium/recipes/heroku.rb +44 -30
  75. data/lib/potassium/recipes/mailer.rb +27 -4
  76. data/lib/potassium/recipes/node.rb +21 -0
  77. data/lib/potassium/recipes/rack_cors.rb +18 -15
  78. data/lib/potassium/recipes/schedule.rb +17 -2
  79. data/lib/potassium/recipes/style.rb +21 -3
  80. data/lib/potassium/recipes/vue_admin.rb +124 -0
  81. data/lib/potassium/templates/application.rb +9 -7
  82. data/lib/potassium/version.rb +6 -4
  83. data/potassium.gemspec +11 -6
  84. data/spec/features/api_spec.rb +25 -0
  85. data/spec/features/background_processor_spec.rb +19 -6
  86. data/spec/features/data_migrate_spec.rb +14 -0
  87. data/spec/features/database_container_spec.rb +2 -5
  88. data/spec/features/draper_spec.rb +1 -6
  89. data/spec/features/file_storage_spec.rb +75 -0
  90. data/spec/features/front_end_spec.rb +88 -0
  91. data/spec/features/github_spec.rb +53 -8
  92. data/spec/features/google_tag_manager_spec.rb +59 -0
  93. data/spec/features/graphql_spec.rb +71 -0
  94. data/spec/features/heroku_spec.rb +8 -5
  95. data/spec/features/mailer_spec.rb +58 -0
  96. data/spec/features/new_project_spec.rb +6 -14
  97. data/spec/features/node_spec.rb +28 -0
  98. data/spec/features/power_types_spec.rb +5 -16
  99. data/spec/features/schedule_spec.rb +11 -4
  100. data/spec/features/vue_admin_spec.rb +47 -0
  101. data/spec/spec_helper.rb +5 -0
  102. data/spec/support/fake_octokit.rb +31 -0
  103. data/spec/support/potassium_test_helpers.rb +26 -9
  104. data/tmp/.keep +0 -0
  105. metadata +157 -48
  106. data/circle.yml +0 -12
  107. data/lib/potassium/assets/.circleci/config.yml +0 -20
  108. data/lib/potassium/assets/active_admin/active_admin.js.coffee +0 -4
  109. data/lib/potassium/assets/active_admin/init_activeadmin_angular.rb +0 -8
  110. data/lib/potassium/assets/api/api_error_concern.rb +0 -32
  111. data/lib/potassium/assets/api/base_controller.rb +0 -9
  112. data/lib/potassium/assets/api/draper_responder.rb +0 -62
  113. data/lib/potassium/assets/api/responder.rb +0 -41
  114. data/lib/potassium/assets/aws.rb +0 -1
  115. data/lib/potassium/assets/sidekiq_scheduler.yml +0 -9
  116. data/lib/potassium/assets/testing/paperclip.rb +0 -59
  117. data/lib/potassium/recipes/active_storage.rb +0 -40
  118. data/lib/potassium/recipes/angular_admin.rb +0 -56
  119. data/lib/potassium/recipes/aws_sdk.rb +0 -7
  120. data/lib/potassium/recipes/paperclip.rb +0 -47
  121. data/spec/features/active_storage_spec.rb +0 -30
  122. data/spec/features/front_end.rb +0 -30
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5
1
+ 2.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 6.2.0
6
+
7
+ Features:
8
+ - Add Google Tag Manager [#326](https://github.com/platanus/potassium/pull/326)
9
+ - Update rubocop and rubocop-rspec for potassium and generated projects [#337](https://github.com/platanus/potassium/pull/337)
10
+ - Adds `mailers` queue to `sidekiq.yml` when installing or creating mailer recipe [#341](https://github.com/platanus/potassium/pull/341)
11
+
12
+ Fixes:
13
+ - 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)
14
+ - Fixes mailer recipe install when background_processor wasn't installed [#341](https://github.com/platanus/potassium/pull/341)
15
+ - 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)
16
+
17
+ ## 6.1.0
18
+
19
+ Features:
20
+ - Check node version before project creation [#305](https://github.com/platanus/potassium/pull/305)
21
+ - Disable observers in test environment [#319](https://github.com/platanus/potassium/pull/319)
22
+ - Allow user to select custom Github repository [#318](https://github.com/platanus/potassium/pull/318)
23
+ - Add pull request template to github enabled projects [#320](https://github.com/platanus/potassium/pull/320)
24
+ - Use a Ruby gem instead of hub to create Github repositories [#323](https://github.com/platanus/potassium/pull/323)
25
+ - Add dockerized redis configuration when using background processor [#329](https://github.com/platanus/potassium/pull/329)
26
+ - Add beta support for GraphQL. [#330](https://github.com/platanus/potassium/pull/330)
27
+ - Add power_api [#301](https://github.com/platanus/potassium/pull/301)
28
+
29
+
30
+ Fix:
31
+ - Fix shrine issues related to configuration and uploader validation [#302](https://github.com/platanus/potassium/pull/302)
32
+ - Fix database recipe not running recommended generator for strong_migrations gem [#310](https://github.com/platanus/potassium/pull/310)
33
+ - Fix puma config that was causing it to crash on server start while on development [#313](https://github.com/platanus/potassium/pull/313)
34
+ - Fix purge css being enabled in development [#327](https://github.com/platanus/potassium/pull/327)
35
+
36
+ ## 6.0.0
37
+
38
+ Features:
39
+ - Update ActiveAdmin to 2.6 [#246](https://github.com/platanus/potassium/pull/246)
40
+ - Update bundler to 2.0 [#250](https://github.com/platanus/potassium/pull/250)
41
+ - Update Rails to 6.0.2 [#251](https://github.com/platanus/potassium/pull/251)
42
+ - Improve specs performance [#259](https://github.com/platanus/potassium/pull/259)
43
+ - Dasherize app name in docker compose related files [#261](https://github.com/platanus/potassium/pull/261)
44
+ - Split specs by timings in CircleCI [#263](https://github.com/platanus/potassium/pull/263)
45
+ - Update ruby to 2.7.0 [#264](https://github.com/platanus/potassium/pull/264)
46
+ - Add tailwindcss [#266](https://github.com/platanus/potassium/pull/266)
47
+ - Update rack-cors to 1.1 [#269](https://github.com/platanus/potassium/pull/269)
48
+ - Use safer CORS configuration exposing only API and public resources [#271](https://github.com/platanus/potassium/pull/271)
49
+ - Add option to support Vue in ActiveAdmin [#272](https://github.com/platanus/potassium/pull/272)
50
+ - Add tests for Vue [#273](https://github.com/platanus/potassium/pull/278)
51
+ - Remove simple commands and docker-compose args in Makefile [#279](https://github.com/platanus/potassium/pull/279)
52
+ - Remove Paperclip and add [Shrine](https://github.com/shrinerb/shrine) for file_storage recipe [#291](https://github.com/platanus/potassium/pull/291)
53
+ - Add linting job to CircleCI builds using [reviewdog](https://github.com/reviewdog/reviewdog) and per-project dependencies/configurations for linters [#292](https://github.com/platanus/potassium/pull/292)
54
+ - Remove angular_admin recipe [#297](https://github.com/platanus/potassium/pull/297)
55
+
56
+ Fix:
57
+ - Correctly use cache for bundle dependencies in CircleCI build [#244](https://github.com/platanus/potassium/pull/244) and [#258](https://github.com/platanus/potassium/pull/258)
58
+ - Fix model auto annotate [#260](https://github.com/platanus/potassium/pull/260)
59
+ - Fix sidekiq repeated installation on potassium create if selecting mailer [#262](https://github.com/platanus/potassium/pull/262)
60
+ - Include ApiErrorConcern in all environments [#270](https://github.com/platanus/potassium/pull/270)
61
+
62
+ ## 5.2.3
63
+
64
+ Features:
65
+ - Add restore-from commands for pg_restore in makefile [#237](https://github.com/platanus/potassium/pull/237)
66
+ - Allow usage of vue components in rails views out of the box [#231](https://github.com/platanus/potassium/pull/231)
67
+ - Add data migrate [#227](https://github.com/platanus/potassium/pull/227)
68
+ - Add raven capture in error handler if sentry enabled [#226](https://github.com/platanus/potassium/pull/226)
69
+ - Remove unnecesary aws-sdk gems in favor of specific ones [#221](https://github.com/platanus/potassium/pull/221)
70
+ - Unify storage options and deprecate paperclip [#211](https://github.com/platanus/potassium/pull/211)
71
+
72
+ Fix:
73
+ - Fix gather_gem issue when multiple versions passed as argument [#242](https://github.com/platanus/potassium/pull/242)
74
+ - Support "None" passed as CLI flag option in file storage [#240](https://github.com/platanus/potassium/pull/240)
75
+ - Add sidekiq worker to Procfile if installed after project setup (with heroku) [#234](https://github.com/platanus/potassium/pull/234)
76
+ - Include test_data volume to CI compose for bundler related data [#229](https://github.com/platanus/potassium/pull/229)
77
+ - Comment out schedule entry in sidekiq.yml [#225](https://github.com/platanus/potassium/pull/225)
78
+ - Use ruby image for potassium test build [#224](https://github.com/platanus/potassium/pull/224)
79
+ - Use webpacker from rubygems instead of repo master [#222](https://github.com/platanus/potassium/pull/222)
80
+ - Add rubocop-rspec for compatibility with updated linters in spec [#218](https://github.com/platanus/potassium/pull/218)
81
+ - Remove containers after spec run [#216](https://github.com/platanus/potassium/pull/216)
82
+ - Fix database container install [#214](https://github.com/platanus/potassium/pull/214)
83
+
84
+ ## 5.2.2
85
+
86
+ Features:
87
+ - Implement release phase on heroku
88
+ - Add sendgrid_dev support
89
+
90
+ Fix:
91
+ - Fix Circle CI
92
+ - Fix services containers env variables
93
+
3
94
  ## 5.2.1
4
95
 
5
96
  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
- > It's important to note that it will perform a version check before running to ensure that you're using the latest potassium. Also, if you feel that it's too slow, you may need to update rubygems: `gem update --system`.
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,40 @@ 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
- - [Ruby](https://www.ruby-lang.org) Set the project ruby version based on http://ruby.platan.us/latest
40
- - [dotenv](https://github.com/bkeepers/dotenv) load environmental variables in development
41
- - [Yarn](https://yarnpkg.com) for frontend assets packages.
42
- - [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same.
43
- - [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience.
44
- - [RSpec](http://rspec.info) for unit and integration testing.
45
- - [FactoryBot](https://github.com/thoughtbot/factory_bot) for test factories.
46
- - [Guard](http://guardgem.org) for continuous testing and other watch-related tasks.
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 update timezone information
52
- - [Faker](https://github.com/stympy/faker) for create development data
53
-
54
- The following optional integrations are added too:
55
-
56
- - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database.
57
- - [Devise](https://github.com/plataformatec/devise) for authentication.
58
- - [ActiveAdmin](http://activeadmin.info) for admin interfaces.
59
- - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin.
60
- - [Pundit](https://github.com/elabs/pundit) for role-based authorization.
61
- - [DelayedJob](https://github.com/collectiveidea/delayed_job) to execute longer tasks in the background.]
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
+
56
+ The following optional integrations are also added:
57
+
58
+ - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database
59
+ - [Devise](https://github.com/plataformatec/devise) for authentication
60
+ - [ActiveAdmin](http://activeadmin.info) for admin interfaces
61
+ - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin
62
+ - [Pundit](https://github.com/elabs/pundit) for role-based authorization
63
+ - [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby
63
64
  - [Sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) to run scheduled processes
64
65
  - Mailing configuration for [AWS SES](https://github.com/aws/aws-sdk-rails)
65
66
  and [Sendgrid](https://github.com/platanus/send_grid_mailer) with recipient interceptor support
66
67
  - [Sentry](https://sentry.io) to monitor exceptions and errors
67
68
  - [Vue.js](https://vuejs.org) or [Angular 2](https://angular.io/) for frontend development
69
+ - [Google Tag Manager](https://tagmanager.google.com/) for analytics
70
+ - Creates the Github repository of your choice for the project. A local git repository will always be created.
68
71
 
69
72
  A few more things are added to the project:
70
73
 
71
74
  - 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)
75
+ - Setup continuous integration in [CircleCI](circle-ci) to run tests
74
76
  - A `bin/setup` script to setup things on a newly cloned project
75
77
  - A `bin/cibuild` script to run continuous integration build on CI
76
78
  - A `db:fake_data:load` rake task to load fake data for development
@@ -81,39 +83,34 @@ A few more things are added to the project:
81
83
 
82
84
  The optional API support includes:
83
85
 
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.
86
+ - [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
87
+ - [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
88
+ - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
89
+ - [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
88
90
 
89
91
  ### Heroku
90
92
 
91
93
  When you choose to deploy to heroku a few extra things are added for the project.
92
94
 
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.
95
+ - 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
96
  - Adds a [Procfile][procfile] to define the processes to run in heroku
97
- - Setup continuous integration using docker and herokuish to maintain better
98
- parity between testing and production environments
99
- - Adds a `.buildpacks` file with the default buildpacks to use. It use the
100
- following buildpacks:
97
+ - Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
98
+ - 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`
99
+ - Adds a `.buildpacks` file with the default buildpacks to use. It use the following buildpacks:
101
100
 
102
101
  | index | buildpack | description |
103
102
  |-------|-----------|-------------|
104
103
  | 1. | [nodejs][heroku-buildpack-nodejs] | to support javascript package management with `yarn` and `webpack` based asset compiling |
105
104
  | 2. | [ruby-version][heroku-buildpack-ruby-version] | to support the use of `.ruby-version` file to instruct heroku which ruby version to use |
106
105
  | 3. | [ruby][heroku-buildpack-ruby] | the base buildpack to run ruby applications |
107
- | 4. | [ruby-deploy-tasks][buildpack-deploy-tasks] | to run rake task after the deployment is complete, for example `db:migrate` |
108
106
 
109
107
  Also the heroku applications are created
110
108
 
111
109
  - Creates a `staging` and `production` applications
112
110
  - Creates a pipeline and assign the above application to the `staging`
113
- and `production` stages.
111
+ and `production` stages
114
112
  - Setup initial configuration variables
115
113
  - Set the application buildpack to the [multi-buildpack][heroku-buildpack-multi]
116
- - Set **deploy-tasks** buildpack is setup to run `rake db:migrate` after each deploy
117
114
 
118
115
  You'll need to manually
119
116
 
@@ -127,11 +124,9 @@ In order to CicleCI start building the project on each push you need tell circle
127
124
  Go to https://circleci.com/add-projects, choose the repository from the list and hit
128
125
  **Build Project**
129
126
 
130
- ### Hound CI
127
+ #### ReviewDog
131
128
 
132
- In order to Hound start checking your project's PRs you need enable that repository.
133
- Go to https://monkeyci.platan.us, choose the repository from the list and hit
134
- **Activate**
129
+ 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.
135
130
 
136
131
  [logging-gem]: https://github.com/heroku/rails_stdout_logging
137
132
  [heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
@@ -140,7 +135,6 @@ Go to https://monkeyci.platan.us, choose the repository from the list and hit
140
135
  [heroku-buildpack-nodejs]: https://github.com/heroku/heroku-buildpack-nodejs
141
136
  [heroku-buildpack-ruby]: http://github.com/heroku/heroku-buildpack-ruby
142
137
  [heroku-buildpack-multi]: http://github.com/heroku/heroku-buildpack-multi
143
- [buildpack-deploy-tasks]: http://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks
144
138
  [circle-ci]: https://circleci.com
145
139
 
146
140
  ## Development Tools
@@ -151,13 +145,13 @@ This is useful when you are adding new recipes to Potassium, and you want to use
151
145
  To achieve this you need to run, **In the Potassium's root path**, the `bin/potassium_test create` instead of `potassium create` command.
152
146
  This command, will do the same as `potassium create` but first:
153
147
 
154
- - Will drop any existent database of the test app.
155
- - Will remove the directory containing a previous version of the test app.
148
+ - Will drop any existent database of the test app
149
+ - Will remove the directory containing a previous version of the test app
156
150
 
157
151
  It's important to remember that `bin/potassium_test create`:
158
152
 
159
153
  - Does not receive an `app_path` param. It always creates the test project inside `/tmp/dummy_app`
160
- - Can receive the same options as `potassium create`.
154
+ - Can receive the same options as `potassium create`
161
155
  - 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`
162
156
 
163
157
  ## Contributing
@@ -175,4 +169,4 @@ potassium is maintained by [platanus](http://platan.us).
175
169
 
176
170
  ## License
177
171
 
178
- Potassium is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
172
+ Potassium is © 2014 Platanus, SPA. It is free software and may be redistributed under the terms specified in the LICENSE file.
data/docs/DSL.md CHANGED
@@ -308,7 +308,7 @@ add_readme_header(:style_guide)
308
308
 
309
309
  ##### | `add_readme_section(header, section, iterpolation_values)`
310
310
 
311
- To add header's sections. Paperclip, for example:
311
+ To add header's sections. Devise, for example:
312
312
 
313
313
  ```yml
314
314
  readme:
@@ -316,11 +316,11 @@ readme:
316
316
  internal_dependencies:
317
317
  title: "Internal dependencies"
318
318
  sections:
319
- paperclip:
320
- title: "Uploads"
321
- body: "For managing uploads, this project uses..."
319
+ devise:
320
+ title: "Authentication"
321
+ body: "We are using the great..."
322
322
  ```
323
323
 
324
324
  ```ruby
325
- add_readme_section(:internal_dependencies, :paperclip)
325
+ add_readme_section(:internal_dependencies, :devise)
326
326
  ```
@@ -1,3 +1,2 @@
1
1
  https://github.com/platanus/heroku-buildpack-ruby-version.git
2
2
  https://github.com/heroku/heroku-buildpack-ruby.git
3
- https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks.git
@@ -0,0 +1,102 @@
1
+ version: 2
2
+ jobs:
3
+ test:
4
+ working_directory: ~/app
5
+
6
+ docker:
7
+ - image: platanus/compose:1.22.0
8
+
9
+ steps:
10
+ - checkout
11
+ - setup_remote_docker
12
+
13
+ - run: docker info
14
+ - run: docker-compose -f docker-compose.ci.yml pull
15
+ - run: docker-compose -f docker-compose.ci.yml build test
16
+ - run: bin/cibuild services
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:
26
+ docker:
27
+ - image: circleci/ruby:2.7-node
28
+ environment:
29
+ BUNDLE_JOBS: 4
30
+ BUNDLE_RETRY: 3
31
+ BUNDLE_PATH: vendor/bundle
32
+ steps:
33
+ - checkout
34
+
35
+ - restore_cache:
36
+ keys:
37
+ - bundle-dependencies-{{ checksum "Gemfile.lock" }}
38
+ - bundle-dependencies-
39
+
40
+ - restore_cache:
41
+ keys:
42
+ - yarn-dependencies-{{ checksum "yarn.lock" }}
43
+ - yarn-dependencies-
44
+
45
+ - run:
46
+ name: Install bundle dependencies
47
+ command: |
48
+ BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
49
+ gem install bundler:$BUNDLER_VERSION
50
+ bundle _$(echo $BUNDLER_VERSION)_ install
51
+
52
+ - save_cache:
53
+ key: bundle-dependencies-{{ checksum "Gemfile.lock" }}
54
+ paths:
55
+ - vendor/bundle
56
+
57
+ - run:
58
+ name: Install yarn dependencies
59
+ command: yarn install --frozen-lockfile
60
+
61
+ - save_cache:
62
+ key: yarn-dependencies-{{ checksum "yarn.lock" }}
63
+ paths:
64
+ - node_modules
65
+
66
+ - run:
67
+ name: Install reviewdog
68
+ command: |
69
+ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
70
+
71
+ - run:
72
+ name: Get files to lint
73
+ command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
74
+
75
+ - run:
76
+ name: Run rubocop
77
+ shell: /bin/bash
78
+ command: |
79
+ cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
80
+ | ./bin/reviewdog -reporter=github-pr-review -f=rubocop
81
+
82
+ - run:
83
+ name: Run eslint
84
+ shell: /bin/bash
85
+ command: |
86
+ cat tmp/files_to_lint | grep -E '.+\.(js|jsx|vue)$' | xargs yarn run eslint \
87
+ | ./bin/reviewdog -reporter=github-pr-review -f=eslint
88
+
89
+ - run:
90
+ name: Run stylelint
91
+ shell: /bin/bash
92
+ command: |
93
+ cat tmp/files_to_lint | grep -E '.+\.(scss|css|less)$' | xargs yarn run stylelint \
94
+ | ./bin/reviewdog -reporter=github-pr-review -f=stylelint
95
+
96
+ workflows:
97
+ version: 2
98
+ test_and_lint:
99
+ jobs:
100
+ - test
101
+ - lint:
102
+ context: org-global
@@ -0,0 +1,352 @@
1
+ {
2
+ "env": {
3
+ "es6": true
4
+ },
5
+ "parserOptions": {
6
+ "ecmaVersion": 2018,
7
+ "sourceType": "module"
8
+ },
9
+ "plugins": ["import"],
10
+ "settings": {
11
+ "import/resolver": {
12
+ "node": {
13
+ "extensions": [".js", ".json"]
14
+ }
15
+ }
16
+ },
17
+ "extends": [
18
+ "plugin:vue/strongly-recommended"
19
+ ],
20
+ "rules": {
21
+ "accessor-pairs": 0,
22
+ "array-callback-return": 2,
23
+ "block-scoped-var": 2,
24
+ "complexity": [1, {
25
+ "max": 6
26
+ }],
27
+ "consistent-return": 2,
28
+ "curly": [2, "multi-line"],
29
+ "default-case": [2, {
30
+ "commentPattern": "^no default$"
31
+ }],
32
+ "dot-notation": [1, {
33
+ "allowKeywords": true
34
+ }],
35
+ "dot-location": [2, "property"],
36
+ "eqeqeq": [2],
37
+ "guard-for-in": 2,
38
+ "no-alert": 1,
39
+ "no-case-declarations": 2,
40
+ "no-div-regex": 0,
41
+ "no-else-return": 2,
42
+ "no-empty-function": [2, {
43
+ "allow": ["arrowFunctions", "functions", "methods"]
44
+ }],
45
+ "no-empty-pattern": 2,
46
+ "no-eval": 2,
47
+ "no-extend-native": 2,
48
+ "no-extra-bind": 2,
49
+ "no-fallthrough": 2,
50
+ "no-floating-decimal": 2,
51
+ "no-implicit-coercion": 0,
52
+ "no-implicit-globals": 2,
53
+ "no-implied-eval": 2,
54
+ "no-invalid-this": 0,
55
+ "no-iterator": 2,
56
+ "no-extra-label": 2,
57
+ "no-labels": [2, {
58
+ "allowLoop": false,
59
+ "allowSwitch": false
60
+ }],
61
+ "no-lone-blocks": 2,
62
+ "no-loop-func": 2,
63
+ "no-magic-numbers": [2, {
64
+ "ignore": [0, 1, -1]
65
+ }],
66
+ "no-multi-spaces": 2,
67
+ "no-multi-str": 2,
68
+ "no-native-reassign": 2,
69
+ "no-new": 2,
70
+ "no-new-func": 2,
71
+ "no-new-wrappers": 2,
72
+ "no-octal": 2,
73
+ "no-octal-escape": 2,
74
+ "no-param-reassign": [2, {
75
+ "props": false
76
+ }],
77
+ "no-proto": 2,
78
+ "no-redeclare": 2,
79
+ "no-return-assign": 2,
80
+ "no-script-url": 2,
81
+ "no-self-assign": 2,
82
+ "no-self-compare": 2,
83
+ "no-sequences": 2,
84
+ "no-throw-literal": 2,
85
+ "no-unmodified-loop-condition": 0,
86
+ "no-unused-expressions": 2,
87
+ "no-unused-labels": 2,
88
+ "no-useless-call": 0,
89
+ "no-useless-concat": 2,
90
+ "no-useless-escape": 2,
91
+ "no-void": 0,
92
+ "no-warning-comments": [1, {
93
+ "terms": ["todo", "fixme", "xxx"],
94
+ "location": "start"
95
+ }],
96
+ "no-with": 2,
97
+ "radix": 2,
98
+ "vars-on-top": 2,
99
+ "wrap-iife": [2, "any"],
100
+ "yoda": 2,
101
+ "comma-dangle": [2, "always-multiline"],
102
+ "no-cond-assign": [2, "always"],
103
+ "no-console": 1,
104
+ "no-debugger": 1,
105
+ "no-constant-condition": 2,
106
+ "no-control-regex": 2,
107
+ "no-dupe-args": 2,
108
+ "no-dupe-keys": 2,
109
+ "no-duplicate-case": 2,
110
+ "no-empty": 2,
111
+ "no-empty-character-class": 2,
112
+ "no-ex-assign": 2,
113
+ "no-extra-boolean-cast": 0,
114
+ "no-extra-parens": [0, "all", {
115
+ "conditionalAssign": true,
116
+ "nestedBinaryExpressions": false,
117
+ "returnAssign": false
118
+ }],
119
+ "no-extra-semi": 2,
120
+ "no-func-assign": 2,
121
+ "no-inner-declarations": 2,
122
+ "no-invalid-regexp": 2,
123
+ "no-irregular-whitespace": 2,
124
+ "no-negated-in-lhs": 2,
125
+ "no-obj-calls": 2,
126
+ "no-regex-spaces": 2,
127
+ "no-sparse-arrays": 2,
128
+ "no-unexpected-multiline": 0,
129
+ "no-unreachable": 2,
130
+ "no-unsafe-finally": 2,
131
+ "use-isnan": 2,
132
+ "valid-jsdoc": 0,
133
+ "valid-typeof": 2,
134
+ "arrow-body-style": [2, "as-needed"],
135
+ "arrow-parens": 0,
136
+ "arrow-spacing": [2, {
137
+ "before": true,
138
+ "after": true
139
+ }],
140
+ "constructor-super": 0,
141
+ "generator-star-spacing": [2, {
142
+ "before": true,
143
+ "after": false
144
+ }],
145
+ "no-class-assign": 2,
146
+ "no-confusing-arrow": [2, {
147
+ "allowParens": true
148
+ }],
149
+ "no-const-assign": 2,
150
+ "no-dupe-class-members": 2,
151
+ "no-duplicate-imports": 2,
152
+ "no-new-symbol": 2,
153
+ "no-restricted-imports": 0,
154
+ "no-this-before-super": 0,
155
+ "no-useless-computed-key": 2,
156
+ "no-useless-constructor": 2,
157
+ "no-var": 2,
158
+ "object-shorthand": [2, "always", {
159
+ "ignoreConstructors": false,
160
+ "avoidQuotes": true
161
+ }],
162
+ "prefer-arrow-callback": [2, {
163
+ "allowNamedFunctions": false,
164
+ "allowUnboundThis": true
165
+ }],
166
+ "prefer-const": [2, {
167
+ "destructuring": "any",
168
+ "ignoreReadBeforeAssign": true
169
+ }],
170
+ "prefer-reflect": 0,
171
+ "no-caller": 2,
172
+ "prefer-rest-params": 2,
173
+ "prefer-spread": 2,
174
+ "prefer-template": 2,
175
+ "require-yield": 2,
176
+ "sort-imports": 0,
177
+ "template-curly-spacing": 2,
178
+ "yield-star-spacing": [2, "before"],
179
+ "import/no-unresolved": [0],
180
+ "import/named": 0,
181
+ "import/default": 0,
182
+ "import/namespace": 0,
183
+ "import/export": 2,
184
+ "import/no-named-as-default": 0,
185
+ "import/no-named-as-default-member": 0,
186
+ "import/no-deprecated": 0,
187
+ "import/no-extraneous-dependencies": [0, {
188
+ "devDependencies": false,
189
+ "optionalDependencies": false
190
+ }],
191
+ "import/no-mutable-exports": 2,
192
+ "import/no-commonjs": 0,
193
+ "import/no-amd": 2,
194
+ "import/no-nodejs-modules": 0,
195
+ "import/imports-first": [2, "absolute-first"],
196
+ "import/no-duplicates": 2,
197
+ "import/no-namespace": 0,
198
+ "import/extensions": [0, "never"],
199
+ "import/order": [0, {
200
+ "groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
201
+ "newlines-between": "never"
202
+ }],
203
+ "import/newline-after-import": 2,
204
+ "import/prefer-default-export": 2,
205
+ "array-bracket-spacing": [2, "never"],
206
+ "block-spacing": [2, "always"],
207
+ "brace-style": [2, "1tbs", {
208
+ "allowSingleLine": true
209
+ }],
210
+ "camelcase": [2, {
211
+ "properties": "always"
212
+ }],
213
+ "comma-spacing": [2, {
214
+ "before": false,
215
+ "after": true
216
+ }],
217
+ "comma-style": [2, "last"],
218
+ "computed-property-spacing": [2, "never"],
219
+ "consistent-this": [2, "self"],
220
+ "eol-last": 2,
221
+ "func-names": 0,
222
+ "func-style": [2, "declaration"],
223
+ "id-blacklist": 0,
224
+ "id-length": 0,
225
+ "id-match": 0,
226
+ "indent": [2, 2],
227
+ "key-spacing": [2, {
228
+ "beforeColon": false,
229
+ "afterColon": true
230
+ }],
231
+ "keyword-spacing": [2, {
232
+ "before": true,
233
+ "after": true,
234
+ "overrides": {
235
+ "return": {
236
+ "after": true
237
+ },
238
+ "throw": {
239
+ "after": true
240
+ },
241
+ "case": {
242
+ "after": true
243
+ }
244
+ }
245
+ }],
246
+ "linebreak-style": [2, "unix"],
247
+ "lines-around-comment": 0,
248
+ "max-depth": [2, 4],
249
+ "max-len": [2, 120, {
250
+ "ignorePattern": "^\\s.+class=\""
251
+ }],
252
+ "max-nested-callbacks": [2, 4],
253
+ "max-params": [1, 4],
254
+ "max-statements": [1, 10],
255
+ "max-statements-per-line": [2, {
256
+ "max": 1
257
+ }],
258
+ "new-cap": [2, {
259
+ "newIsCap": true
260
+ }],
261
+ "new-parens": 2,
262
+ "newline-after-var": 0,
263
+ "newline-before-return": 2,
264
+ "newline-per-chained-call": [2, {
265
+ "ignoreChainWithDepth": 3
266
+ }],
267
+ "no-array-constructor": 2,
268
+ "no-bitwise": 1,
269
+ "no-continue": 0,
270
+ "no-inline-comments": 0,
271
+ "no-lonely-if": 0,
272
+ "no-mixed-spaces-and-tabs": 2,
273
+ "no-multiple-empty-lines": [2, {
274
+ "max": 1,
275
+ "maxEOF": 1
276
+ }],
277
+ "no-negated-condition": 2,
278
+ "no-nested-ternary": 2,
279
+ "no-new-object": 2,
280
+ "no-plusplus": 0,
281
+ "no-restricted-syntax": [2, "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
282
+ "no-spaced-func": 2,
283
+ "no-ternary": 0,
284
+ "no-trailing-spaces": 2,
285
+ "no-underscore-dangle": [1],
286
+ "no-unneeded-ternary": [2, {
287
+ "defaultAssignment": false
288
+ }],
289
+ "no-whitespace-before-property": 2,
290
+ "object-curly-spacing": [2, "always"],
291
+ "object-property-newline": [0, {
292
+ "allowMultiplePropertiesPerLine": true
293
+ }],
294
+ "one-var": [2, "never"],
295
+ "one-var-declaration-per-line": [2, "always"],
296
+ "operator-assignment": 2,
297
+ "operator-linebreak": [2, "after"],
298
+ "padded-blocks": [2, "never"],
299
+ "quote-props": [2, "as-needed", {
300
+ "keywords": false,
301
+ "unnecessary": false,
302
+ "numbers": false
303
+ }],
304
+ "quotes": [2, "single", {
305
+ "avoidEscape": true
306
+ }],
307
+ "require-jsdoc": 0,
308
+ "semi": [2, "always"],
309
+ "semi-spacing": [2, {
310
+ "before": false,
311
+ "after": true
312
+ }],
313
+ "sort-vars": 0,
314
+ "space-before-blocks": 2,
315
+ "space-before-function-paren": [2, {
316
+ "anonymous": "always",
317
+ "named": "never"
318
+ }],
319
+ "space-in-parens": [2, "never"],
320
+ "space-infix-ops": 2,
321
+ "space-unary-ops": 0,
322
+ "spaced-comment": [2],
323
+ "wrap-regex": 0,
324
+ "init-declarations": 0,
325
+ "no-catch-shadow": 2,
326
+ "no-delete-var": 0,
327
+ "no-label-var": 2,
328
+ "no-restricted-globals": 0,
329
+ "no-shadow": 2,
330
+ "no-shadow-restricted-names": 2,
331
+ "no-undef": 2,
332
+ "no-undef-init": 2,
333
+ "no-unused-vars": [2, {
334
+ "vars": "local",
335
+ "args": "after-used"
336
+ }],
337
+ "no-use-before-define": 2,
338
+ "vue/max-len": ["error", {
339
+ "code": 120,
340
+ "ignoreHTMLAttributeValues": true
341
+ }]
342
+ },
343
+ "overrides": [
344
+ {
345
+ "files": ["**/*.js"],
346
+ "excludedFiles": "app/**/*.js",
347
+ "env": {
348
+ "node": true
349
+ }
350
+ }
351
+ ]
352
+ }