Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethinking crap.json #9

Open
geekish opened this issue Jul 26, 2017 · 0 comments
Open

Rethinking crap.json #9

geekish opened this issue Jul 26, 2017 · 0 comments

Comments

@geekish
Copy link
Owner

geekish commented Jul 26, 2017

When I wrote this tool, I wanted the resulting .json file to be editable by the user without breaking functionality. My reasoning for this was both for ease of use and to be able to use it in, say, a dotfiles repository for easy setup.

Currently with crap an alias may be written to an alias, but the new alias is simply added with the value of the original alias, so if the original value is changed the two aliases no longer match. Example: if I add an alias inputfilter to zendframework/input-filter:^2.7 and then I add an alias input-filter to inputfilter, I now have a crap.json that looks like:

{
  "inputfilter": "zendframework/input-filter:^2.7",
  "input-filter": "zendframework/input-filter:^2.7"
}

Continuing with the example scenario, if I change inputfilter to alias to zendframework/input-filter:^2.6, the value for input-filter is still "zendframework/input-filter:^2.7".

When I added this feature (alias to alias) I was mostly using it to prevent typos, especially in the case of packages with hyphens, as in the example above. Ideally, aliases to other aliases would link somehow and edits to one would edit another, but this would require a change in the json file structure to one not easily edited by hand.

So, I must decide if I value editing the json file easily, or better alias-package mapping more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant