diff --git a/Project.toml b/Project.toml index da231199e..5f8b29688 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Genie" uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e" authors = ["Adrian Salceanu "] -version = "3.0.0" +version = "3.0.1" [deps] ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" diff --git a/src/Generator.jl b/src/Generator.jl index 990321638..9825e5dbe 100755 --- a/src/Generator.jl +++ b/src/Generator.jl @@ -232,37 +232,6 @@ function write_secrets_file(app_path::String = ".") :: Nothing nothing end -""" - migrate_secrets_file(app_path=".") - -Replace the previous content of `config/secrets.jl` with the new syntax but the same token. - -Specifically, the previous syntax of the file is the following, which is now deprecated: - - const SECRET_TOKEN = "token" - -This syntax is replaced by the new syntax: - - Genie.secret_token!("token") -""" -function migrate_secrets_file(app_path::String = ".") :: Nothing - secrets_path = joinpath(app_path, Genie.config.path_config, Genie.SECRETS_FILE_NAME) - if isfile(secrets_path) - match_deprecated = match(r"SECRET_TOKEN\s*=\s*\"(.*)\"", readline(secrets_path)) - if match_deprecated != nothing # does the file use the deprecated syntax? - open(secrets_path, "w") do f - write(f, """Genie.secret_token!("$(match_deprecated.captures[1])") """) - end # replace the previous content of the file - @info "Successfully migrated $(secrets_path) to a valid syntax." - else - error("No migration possible; $(secrets_path) is not using a migrate-able syntax.") - end - else - error("No migration possible; $(secrets_path) is not a file.") - end - return nothing -end - """ fullstack_app(app_path::String = ".") :: Nothing @@ -398,6 +367,7 @@ function write_app_custom_files(path::String, app_path::String) :: Nothing pwd() == joinpath(@__DIR__, "bin") && cd(@__DIR__) # allow starting app from bin/ dir using $(moduleinfo[1]) + push!(Base.modules_warned_for, Base.PkgId($(moduleinfo[1]))) $(moduleinfo[1]).main() """) end diff --git a/src/WebChannels.jl b/src/WebChannels.jl index 520452f8d..a226dfa9d 100755 --- a/src/WebChannels.jl +++ b/src/WebChannels.jl @@ -3,7 +3,7 @@ Handles WebSockets communication logic. """ module WebChannels -import HTTP, Distributed, Logging +import HTTP, Distributed, Logging, JSON3 import Genie, Genie.Renderer const ClientId = UInt # web socket hash @@ -29,6 +29,10 @@ mutable struct ChannelMessage payload::MessagePayload end +function JSON3.StructTypes.StructType(::Type{T}) where {T<:ChannelMessage} + JSON3.StructTypes.Struct() +end + const CLIENTS = ChannelClientsCollection() const SUBSCRIPTIONS = ChannelSubscriptionsCollection() diff --git a/src/genie_module.jl b/src/genie_module.jl index acf576352..39dc16d6a 100644 --- a/src/genie_module.jl +++ b/src/genie_module.jl @@ -34,9 +34,7 @@ function newresource(resource_name::Union{String,Symbol}; path::String = ".", pl try Core.eval(context, :(SearchLight.Generator.newresource(uppercasefirst($resource_name)))) - catch ex - # @error ex - @warn "Skipping SearchLight" + catch end load_resources()