From 7e6eb3200485a65907b19f26acfad71731240b1b Mon Sep 17 00:00:00 2001 From: Dru Jensen Date: Sun, 21 Feb 2021 21:18:38 -0800 Subject: [PATCH] Crystal 0.36.0 (#1250) * support crystal 0.36.0 * update mysql and sqlite drivers * reformat code * fix formatting issues --- Dockerfile | 2 +- README.md | 14 ++++++++++++++ shard.yml | 8 ++++---- src/amber/cli/templates/app/config/routes.cr.ecr | 6 +++--- src/amber/cli/templates/app/shard.yml.ecr | 8 ++++---- .../cli/templates/app/spec/spec_helper.cr.ecr | 1 - src/amber/validators/params.cr | 8 ++++---- src/amber/websockets/channel.cr | 2 +- src/amber/websockets/client_socket.cr | 4 ++-- 9 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index b11a72b6e..af382dee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM crystallang/crystal:0.35.1 +FROM crystallang/crystal:0.36.1 # Install Dependencies ARG DEBIAN_FRONTEND=noninteractive diff --git a/README.md b/README.md index 11d145568..47af3b149 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,20 @@ Use Amber badge ```markdown [![Amber Framework](https://img.shields.io/badge/using-amber_framework-orange.svg)](https://amberframework.org/) ``` +## Release Checklist + +- Test and release all dependencies +- Test everything locally +- Run `crelease 0.36.0` +- repoint amber to master branch in `src/amber/cli/templates/app/shard.yml.ecr` template +- update release notes +- update homebrew version and sha +- update linux repositories +- build and deploy docker image: + - verify Dockerfile is using the latest crystal version + - `docker login` + - `docker build -t amberframework/amber:0.36.0` + - `docker push amberframework/amber:0.36.0` ## Contributing diff --git a/shard.yml b/shard.yml index 0bb9dd66c..9469e6e8c 100644 --- a/shard.yml +++ b/shard.yml @@ -36,19 +36,19 @@ dependencies: micrate: github: amberframework/micrate - version: ~> 0.9.0 + version: ~> 0.10.0 pg: github: will/crystal-pg - version: ~> 0.21.1 + version: ~> 0.23.0 mysql: github: crystal-lang/crystal-mysql - version: ~> 0.11.1 + version: ~> 0.13.0 sqlite3: github: crystal-lang/crystal-sqlite3 - version: ~> 0.16.0 + version: ~> 0.18.0 redis: github: stefanwille/crystal-redis diff --git a/src/amber/cli/templates/app/config/routes.cr.ecr b/src/amber/cli/templates/app/config/routes.cr.ecr index d26cd53a6..ad1783acb 100644 --- a/src/amber/cli/templates/app/config/routes.cr.ecr +++ b/src/amber/cli/templates/app/config/routes.cr.ecr @@ -28,9 +28,9 @@ Amber::Server.configure do end routes :web do - <% unless @minimal%> - get "/", HomeController, :index - <% end %> +<% unless @minimal -%> + get "/", HomeController, :index +<% end -%> end routes :api do diff --git a/src/amber/cli/templates/app/shard.yml.ecr b/src/amber/cli/templates/app/shard.yml.ecr index 662418222..5ec95a3fc 100644 --- a/src/amber/cli/templates/app/shard.yml.ecr +++ b/src/amber/cli/templates/app/shard.yml.ecr @@ -23,7 +23,7 @@ dependencies: granite: github: amberframework/granite - version: ~> 0.21.0 + version: ~> 0.22.1 quartz_mailer: github: amberframework/quartz-mailer @@ -36,15 +36,15 @@ dependencies: <% case @database when "pg" -%> pg: github: will/crystal-pg - version: ~> 0.21.1 + version: ~> 0.23.0 <% when "mysql" -%> mysql: github: crystal-lang/crystal-mysql - version: ~> 0.11.1 + version: ~> 0.13.0 <% when "sqlite" -%> sqlite3: github: crystal-lang/crystal-sqlite3 - version: ~> 0.16.0 + version: ~> 0.18.0 <% else -%> <% end -%> diff --git a/src/amber/cli/templates/app/spec/spec_helper.cr.ecr b/src/amber/cli/templates/app/spec/spec_helper.cr.ecr index b05d6dd12..ddf80c3ce 100644 --- a/src/amber/cli/templates/app/spec/spec_helper.cr.ecr +++ b/src/amber/cli/templates/app/spec/spec_helper.cr.ecr @@ -7,6 +7,5 @@ require "garnet_spec" require "../config/application" # Micrate::DB.connection_url = ENV["DATABASE_URL"]? || Amber.settings.database_url - # Automatically run migrations on the test database # Micrate::Cli.run_up diff --git a/src/amber/validators/params.cr b/src/amber/validators/params.cr index c3f393b62..bec5c5768 100644 --- a/src/amber/validators/params.cr +++ b/src/amber/validators/params.cr @@ -93,7 +93,7 @@ module Amber::Validators # Setups validation rules to be performed # - # ```crystal + # ``` # params.validation do # required(:email) { |p| p.url? } # required(:age, UInt32) @@ -108,7 +108,7 @@ module Amber::Validators # of validated params Otherwise raises a Validator::ValidationFailed error # messages contain errors. # - # ```crystal + # ``` # user = User.new params.validate! # ``` def validate! @@ -118,7 +118,7 @@ module Amber::Validators # Returns True or false whether the validation passed # - # ```crystal + # ``` # unless params.valid? # response.puts {errors: params.errors}.to_json # response.status_code 400 @@ -142,7 +142,7 @@ module Amber::Validators # Validates each field with a given set of predicates returns true if the # field is valid otherwise returns false # - # ```crystal + # ``` # required(:email) { |p| p.email? & p.size.between? 1..10 } # ``` def add_rule(rule : BaseRule) diff --git a/src/amber/websockets/channel.cr b/src/amber/websockets/channel.cr index 0e64db8e2..0e3092763 100644 --- a/src/amber/websockets/channel.cr +++ b/src/amber/websockets/channel.cr @@ -5,7 +5,7 @@ module Amber # # Example: # - # ```crystal + # ``` # class ChatChannel < Amber::Websockets::Channel # def handle_joined(client_socket) # # functionality when the user joins the channel, optional diff --git a/src/amber/websockets/client_socket.cr b/src/amber/websockets/client_socket.cr index 65af5b6dd..17fb0d818 100644 --- a/src/amber/websockets/client_socket.cr +++ b/src/amber/websockets/client_socket.cr @@ -6,7 +6,7 @@ module Amber # # Example: # - # ```crystal + # ``` # struct UserSocket < Amber::Websockets::ClientSocket # channel "user_channel:*", UserChannel # channel "room_channel:*", RoomChannel @@ -50,7 +50,7 @@ module Amber # Broadcast a message to all subscribers of the topic # - # ```crystal + # ``` # UserSocket.broadcast("message", "chats_room:1", "msg:new", {"message" => "test"}) # ``` def self.broadcast(event : String, topic : String, subject : String, payload : Hash)