Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the first stepping stone for CLI-driven package management for DragonRuby.
The tool will allow developers to pull in code from GitHub (and likely other git repository hosts later once the need arises) to their local code.
As of now, I don't see any need for
drenv
to enforce any kind of conventions on the libraries themselves, no need for a localdrenv.json
or specific file structure.The CLI will pull in the repository's code to
lib/<repo>
.I plan to introduce
drenv.json
and generateddrenv.lock
files for managing dependencies.New commands
The CLI should support the following commands:
drenv add ...<user/repo>[@<branch|tag|SHA>]
Adds a dependency to your DR project - Will download the code from the remote into your source code.
e.g.
Add multiple libraries:
Add a specific version of a library:
drenv remove ...<user/repo>
Removes a dependency from your DR project - Will also remove the code.
e.g.
$ drenv remove danhealy/dragonruby-zif # project path is not required for removal.
drenv outdated
Output the list of dependencies that have been updated since installation.
e.g.
The
drenv.json
file should look like this:A lock file should be used to ensure changing the dependencies doesn't overwrite anything unintentionally.
Technical implementation notes
Get information about a commit.
https://api.github.com/repos/<user>/<repo>/commits/<SHA>
Find out how many commits behind a commit is
https://api.github.com/repos/<user>/<repo>/compare/<SHA>...<SHA>
The SHA is saved to the lock file upon calling
drenv install
.Considerations
mygame
?dragonruby_modules
, mirroringnode_modules
? Should it just bevendor
?