geekish / crap Goto Github PK
View Code? Open in Web Editor NEWComposer Require Aliased Packages: define aliases for your favorite Composer packages.
License: MIT License
Composer Require Aliased Packages: define aliases for your favorite Composer packages.
License: MIT License
Just ran a crap require
with quite a few packages, and the process timed out, even though every single package was available from cache. Looks like the default from symfony/process
is 60 seconds.
For reference, the command run was:
crap require dotenv monolog slimbox symfony/console zendconfig twig/twig
Error was:
The process "'composer' 'require' '--ansi' 'josegonzalez/dotenv:^2.0' 'monolog/monolog' 'geekish/slimbox' 'symfony/console' 'zendframework/zend-config' 'twig/twig'" exceeded the timeout of 60 seconds.
I would like to drop PHP 5.x support for 2.x, and maintain 1.x for 5.x. Since I would be maintaining both versions, I want 1.x to be as feature-complete as possible.
There exists a utility to 'convert' PHP 7 code to 5; see spatie/7to5. See latitude/latitude for an example of a project that uses this library to create releases targeting each PHP version.
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.
Currently using webmozart/key-value-store and webmozart/json to manage reads/writes to crap.json
.
We are currently locked to an older version of composer/composer because webmozart/json
requires a much older version of justinrainbow/json-schema (see webmozart/json#37).
So we need to either fork webmozart/json and provide our own JsonFileStore class, or come up with a new solution altogether. This could be a good time to make some changes as mentioned in #9.
This would be great, but not super important.
InvalidAliasException, InvalidPackageException, etc.
alias
has define
aliases
has list-aliases
For simplicity's sake.
update
and remove
?The library used for writing to crap.json
uses file_put_contents
without the LOCK_EX
flag; see webmozart/json#29. I don't foresee issues unless someone purposefully tries to run multiple crap
commands simultaneously, or edits the file manually while a command is running.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.