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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: main

- package-ecosystem: npm
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: main
versioning-strategy: increase
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Install shards
run: shards install
- name: Setup Lucky
run: script/setup
run: crystal ./script/setup.cr
- name: Run tests
run: crystal spec
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.7.3
FROM crystallang/crystal:1.16.3
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
Expand All @@ -9,7 +9,7 @@ EXPOSE 5000
RUN apt-get update && \
apt-get install -y libnss3 libgconf-2-4 chromium-browser curl libreadline-dev golang-go postgresql postgresql-contrib locales && \
# Set up node and yarn
curl --silent --location https://deb.nodesource.com/setup_11.x | bash - && \
curl --silent --location https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
npm install -g yarn && \
# Lucky cli
Expand Down
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
system_check: script/system_check && sleep 100000
system_check: crystal ./script/system_check.cr
web: lucky watch -r
assets: yarn watch
67 changes: 0 additions & 67 deletions script/helpers/function_helpers

This file was deleted.

32 changes: 32 additions & 0 deletions script/helpers/function_helpers.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require "colorize"

# These are helper methods provided to help keep your code
# clean. Add new methods, or alter these as needed.

def notice(message : String) : Nil
puts "\n▸ #{message}"
end

def print_done : Nil
puts "✔ Done"
end

def print_error(message : String) : Nil
puts "There is a problem with your system setup:\n".colorize.red.bold
puts "#{message}\n".colorize.red.bold
Process.exit(1)
end

def command_not_found(command : String) : Bool
Process.find_executable(command).nil?
end

def command_not_running(command : String, *args) : Bool
output = IO::Memory.new
code = Process.run(command, args, output: output).exit_code
code > 0
end

def run_command(command : String, *args) : Nil
Process.run(command, args, output: STDOUT, error: STDERR, input: STDIN)
end
32 changes: 0 additions & 32 deletions script/helpers/text_helpers

This file was deleted.

32 changes: 0 additions & 32 deletions script/setup

This file was deleted.

36 changes: 36 additions & 0 deletions script/setup.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require "./helpers/*"

notice "Running System Check"

require "./system_check"

print_done

notice "Installing node dependencies"
run_command "yarn", "install", "--no-progress"

notice "Compiling assets"
run_command "yarn", "dev"

print_done

notice "Installing shards"
run_command "shards", "install"

if !File.exists?(".env")
notice "No .env found. Creating one."
File.touch ".env"
print_done
end

# The Lucky Website does not use a database
# notice "Setting up the database"

# run_command "lucky", "db.setup"

# notice "Seeding the database with required and sample records"
# run_command "lucky", "db.seed.required_data"
# run_command "lucky", "db.seed.sample_data"

print_done
notice "Run 'lucky dev' to start the app"
19 changes: 8 additions & 11 deletions script/system_check → script/system_check.cr
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#!/usr/bin/env bash

source script/helpers/text_helpers
source script/helpers/function_helpers
require "./helpers/*"

# Use this script to check the system for required tools and process that your app needs.
# A few helper functions are provided to make writing bash a little easier. See the
# script/helpers/function_helpers file for more examples.
# A few helper functions are provided to keep the code simple. See the
# script/helpers/function_helpers.cr file for more examples.
#
# A few examples you might use here:
# * 'lucky db.verify_connection' to test postgres can be connected
# * Checking that elasticsearch, redis, or postgres is installed and/or booted
# * Note: Booting additional processes for things like mail, background jobs, etc...
# should go in your Procfile.dev.

if command_not_found "yarn"; then
if command_not_found "yarn"
print_error "Yarn is not installed\n See https://yarnpkg.com/lang/en/docs/install/ for install instructions."
fi
end

## CUSTOM PRE-BOOT CHECKS ##
# CUSTOM PRE-BOOT CHECKS
# example:
# if command_not_running "redis-cli ping"; then
# if command_not_running "redis-cli", "ping"
# print_error "Redis is not running."
# fi
# end
25 changes: 16 additions & 9 deletions shard.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# NOTICE: This lockfile contains some overrides from shard.override.yml
version: 2.0
shards:
ameba:
Expand All @@ -15,23 +14,23 @@ shards:

backtracer:
git: https://github.com/sija/backtracer.cr.git
version: 1.2.2
version: 1.2.4

cadmium_transliterator:
git: https://github.com/cadmiumcr/transliterator.git
version: 0.1.0+git.commit.46c4c14594057dbcfaf27e7e7c8c164d3f0ce3f1

carbon:
git: https://github.com/luckyframework/carbon.git
version: 0.6.0
version: 0.6.1

carbon_sendgrid_adapter:
git: https://github.com/luckyframework/carbon_sendgrid_adapter.git
version: 0.6.0

cmark:
git: https://github.com/amauryt/cr-cmark-gfm.git
version: 0.1.3+git.commit.9e6b023c72a077142d03e1c1fd2c3cedb4a93e56
version: 0.1.3+git.commit.f73c9a23b4d29c27bbb5c83da40edca41c0c5f09

cry:
git: https://github.com/luckyframework/cry.git
Expand All @@ -53,7 +52,7 @@ shards:
git: https://github.com/naqvis/crystal-fnv.git
version: 0.1.3

habitat: # Overridden
habitat:
git: https://github.com/luckyframework/habitat.git
version: 0.4.9

Expand All @@ -67,11 +66,15 @@ shards:

lucky:
git: https://github.com/luckyframework/lucky.git
version: 1.3.0
version: 1.4.0

lucky_cache:
git: https://github.com/luckyframework/lucky_cache.git
version: 0.1.1

lucky_env:
git: https://github.com/luckyframework/lucky_env.git
version: 0.2.0
version: 0.3.0

lucky_flow:
git: https://github.com/luckyframework/lucky_flow.git
Expand Down Expand Up @@ -105,17 +108,21 @@ shards:
git: https://github.com/jwoertink/sitemapper.git
version: 0.9.0

splay_tree_map:
git: https://github.com/wyhaines/splay_tree_map.cr.git
version: 0.3.0

webdrivers:
git: https://github.com/crystal-loot/webdrivers.cr.git
version: 0.4.3
version: 0.4.4

webless:
git: https://github.com/crystal-loot/webless.git
version: 0.1.0

wordsmith:
git: https://github.com/luckyframework/wordsmith.git
version: 0.4.0
version: 0.5.0

xpath2:
git: https://github.com/naqvis/crystal-xpath2.git
Expand Down
8 changes: 4 additions & 4 deletions shard.override.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies:
habitat:
github: luckyframework/habitat
version: ~> 0.4.9
# dependencies:
# habitat:
# github: luckyframework/habitat
# version: ~> 0.4.9
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crystal: ">= 1.10.0"
dependencies:
lucky:
github: luckyframework/lucky
version: ~> 1.3.0
version: ~> 1.4.0
carbon:
github: luckyframework/carbon
version: ~> 0.6.0
Expand All @@ -22,7 +22,7 @@ dependencies:
version: ~> 0.6.0
lucky_env:
github: luckyframework/lucky_env
version: ~> 0.2.0
version: ~> 0.3.0
cmark:
github: amauryt/cr-cmark-gfm
branch: master
Expand Down
Loading