Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
Dependency manager for the Crystal language.
The idea is for Crystal applications and libraries to have a
at their root looking like this:
name: shards version: 0.1.0 sources: - https://shards.crystal-lang.org/ - https://shards.example.com/ dependencies: pg: >= 1.2.3 memcached: * minitest: git: https://github.com/ysbaddaden/minitest.cr.git version: ~> 1.0.0 openssl: github: datanoise/openssl.cr branch: master
Repositories are expected to have version tags, using the
v1.2.3 format, this
example matching version 1.2.3 of a library.
Dependencies are then resolved, downloaded and installed into the
ready to be required.
step 1: install/update dependencies
step 2: resolve dependencies (dumb)
step 3: smarter resolver
step 4: central registry
Why not using a Crystal file (like Ruby's Bundler or crystal deps)?
That would be nice, since YAML (or JSON or TOML) don't play nicely with statically typed languages, but it would require compiling the Crystal source file for each and every dependency + version pairs... that would certainly end up ugly.
Why YAML and not JSON or TOML?
JSON is too noisy. TOML's spec is unstable. YAML did the job.
Why eventually have a central registry?
Remembering package names is simpler than remembering their package names and their repository URL. Also it would speed things up drastically —no more need to clone all repositories to resolve dependencies for example.
Licensed under the Apache License, Version 2.0. See LICENSE for details.