fxpio / composer-asset-plugin Goto Github PK
View Code? Open in Web Editor NEWNPM/Bower Dependency Manager for Composer
License: MIT License
NPM/Bower Dependency Manager for Composer
License: MIT License
testeg in v1.0.0 Beta 3
NPM/Bower range dependencies conversion:
"{name}": "1.2.3"
to "{name}": "1.2.3"
(28b3952)"{name}": "1.2.3 - 2.0"
to "{name}": ">=1.2.3,<=2.0"
(caaa50e)"{name-1.2.3}": "{name}#1.2.3"
to "{name}[1.2.3]": "1.2.3"
(882e5fe)"{name}": "{URL}"
to "{name}": "dev-default"
with VCS creation (9ed8661)"{name}": "{URL}#1.2.3"
to "{name}": "1.2.3"
with VCS creation (9ed8661)"{name}": "{URL}#{sha}"
to "{name}": "dev-default#{sha}"
with VCS creation (9ed8661)"{name}": "{URL}#branch"
to "{name}": "dev-branch"
with VCS creation (9ed8661)With this configuration, an exception is thrown by the Solver at the end of the installation of the packages.
{
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
}
}
To avoid the problem, we must add:
{
"require": {
"bower-asset/jquery": "@stable",
"bower-asset/jquery.inputmask": "@stable",
"bower-asset/punycode": "@stable",
"bower-asset/bootstrap": "@stable"
}
}
It should not be necessary to do so. And the problem comes from the alias package for the root branch.
What is strange is that the exception is thrown after the packages installation, and not before. But also, that dependencies resolution is functional, and especially, with the correct versions.
On update package, the cleaning directory for bower (ignore section) is not executed.
The Fxp\Composer\AssetPlugin\Installer\BowerIgnoreManager
class is not used correctly.
Im try to compare marionette js install via composer and bower.
Marionette has bower.json with such JQuery dependency:
"jquery": "^1.8.0 || ^2.0.0"
And bower install jquery 2.1.1 - its the latest vesion of jquery
But composer-asset-plugin install too old version: 2.0.3
If Im set last jquery version manualy in deps in composer json, composer insatll veeeery old marionettejs(wich has not any jquery dependence)
(in this test case, composer and bower json file contain only one package: "marionette")
bower output:
bower install
bower backbone#* cached git://github.com/jashkenas/backbone.git#1.1.2
bower backbone#* validate 1.1.2 against git://github.com/jashkenas/backbone.git#*
bower marionette#* cached git://github.com/marionettejs/backbone.marionette.git#2.2.1
bower marionette#* validate 2.2.1 against git://github.com/marionettejs/backbone.marionette.git#*
bower underscore#>=1.5.0 cached git://github.com/jashkenas/underscore.git#1.7.0
bower underscore#>=1.5.0 validate 1.7.0 against git://github.com/jashkenas/underscore.git#>=1.5.0
bower backbone#1.0.0 - 1.1.2 cached git://github.com/jashkenas/backbone.git#1.1.2
bower backbone#1.0.0 - 1.1.2 validate 1.1.2 against git://github.com/jashkenas/backbone.git#1.0.0 - 1.1.2
bower underscore#1.4.4 - 1.6.0 cached git://github.com/jashkenas/underscore.git#1.6.0
bower underscore#1.4.4 - 1.6.0 validate 1.6.0 against git://github.com/jashkenas/underscore.git#1.4.4 - 1.6.0
bower backbone.babysitter#^0.1.0 cached git://github.com/marionettejs/backbone.babysitter.git#0.1.5
bower backbone.babysitter#^0.1.0 validate 0.1.5 against git://github.com/marionettejs/backbone.babysitter.git#^0.1.0
bower backbone.wreqr#^1.0.0 cached git://github.com/marionettejs/backbone.wreqr.git#1.3.1
bower backbone.wreqr#^1.0.0 validate 1.3.1 against git://github.com/marionettejs/backbone.wreqr.git#^1.0.0
bower jquery#^1.8.0 || ^2.0.0 cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#^1.8.0 || ^2.0.0 validate 2.1.1 against git://github.com/jquery/jquery.git#^1.8.0 || ^2.0.0
bower backbone#1.0.0 - 1.1.2 install backbone#1.1.2
bower underscore#1.4.4 - 1.6.0 install underscore#1.6.0
bower marionette#* install marionette#2.2.1
bower backbone.wreqr#^1.0.0 install backbone.wreqr#1.3.1
bower backbone.babysitter#^0.1.0 install backbone.babysitter#0.1.5
bower jquery#^1.8.0 || ^2.0.0 install jquery#2.1.1
composer output:
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing bower-asset/jquery (2.0.3)
Downloading: 100%
- Installing bower-asset/backbone.wreqr (v1.0.1)
Loading from cache
- Installing bower-asset/underscore (1.6.0)
Loading from cache
- Installing bower-asset/backbone (1.1.2)
Downloading: 100%
- Installing bower-asset/backbone.babysitter (v0.1.5)
Downloading: 100%
- Installing bower-asset/marionette (dev-master 35374c5)
Cloning 35374c5701a66a2d3b50a3088e5032598acde224
composer with manual set latest jquery:
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing bower-asset/backbone.wreqr (v1.0.1)
- Installing bower-asset/backbone.wreqr (v0.2.0)
Loading from cache
- Removing bower-asset/backbone.babysitter (v0.1.5)
- Installing bower-asset/backbone.babysitter (v0.0.6)
Downloading: 100%
- Removing bower-asset/underscore (1.6.0)
- Installing bower-asset/underscore (1.5.2)
Loading from cache
- Updating bower-asset/marionette (dev-master 35374c5 => v1.6.2)
Checking out 77755a8fd6dd759a4b2c750db1cc70a9187a9652
- Removing bower-asset/jquery (2.0.3)
- Installing bower-asset/jquery (2.1.1)
Loading from cache
This is actually an issue when using Yii2 but I believe it is directly related to this plugin so thought I'd post here first...
I'm trying to use a bower package in my composer.json but just keep getting fatal PHP memory exhaustion errors.
As a quick isolated test I created a new Yii2 Advanced App project using php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced advanced
and ran composer update
.
That worked fine.
I then added "bower-asset/angular-bootstrap": "dev-master"
to the require section of composer.json and ran composer update
again.
PHP very quickly started eating up memory after composer ran through all the different versions and eventually died with the Fatal memory exhaustion error.
I can temporarily get around this by upping the memory limit, but as soon as I add other packages into the mix the memory requirements keep going up and up.
I tried using a specific version number (rather than dev-master) but that didn't help either.
Is there something I'm doing wrong?
Is there a workaround?
Is there a problem with that specific bower package?
Or does the asset plugin/composer simply need some memory performance improvements?
I'm fairly new to package management, especially Bower, so apologies if the answer is an obvious one.
When Im add keno-ui bower package in my composer.json:
...
"bower-asset/kendo-ui-core": "*",
...
Im see this exception:
[UnexpectedValueException]
Invalid version string "2014.2.716"
But, 2014.2.716 - is valid version of the last kendo-ui distr
The redirection of VCS Repositories does not work correctly.
Example:
Constant requesting token access for renamed public repos (while trying to get repo info for the previous address). For example:
Old address - https://github.com/ask11/storage, new address - https://github.com/alekseykulikov/storage
I'm getting an error:
Your GitHub credentials are required to fetch private repository metadata (git://github.com/ask11/storage.git)
The credentials will be swapped for an OAuth token stored in <file>, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Is there a way to fix this?
(Another example is https://github.com/NickQiZhu/dc.js => https://github.com/dc-js/dc.js)
Thanks.
I wanted to try your plugin but I can't get it running.
Somehow the plugin classes aren't autoloaded - I don't know how the plugin autoloading is supposed to work - maybe you have an idea?
This is what I did:
$ cd composer
$ git pull [email protected]:francoispluchino/composer plugin-install-order
$ cd ../composertest
$ cat composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/francoispluchino/composer-asset-plugin"
}
],
"require": {
"fxp/composer-asset-plugin": "dev-master",
"bower-asset/jquery": "1.11.1"
}
}
$ composer update
$ ../composer/bin/composer update -v
Loading composer repositories with package information
Reading composer.json of fxp/composer-asset-plugin (master)
Importing branch master (dev-master)
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (dev-master 4c022eb)
Cloning 4c022eb9dd4acafbcf8b235d983577e3e9d8c8a7
PHP Fatal error: Class 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitHubDriver' not found in /home/niko/www/composer/src/Composer/Repository/VcsRepository.php on line 84
Fatal error: Class 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitHubDriver' not found in /home/niko/www/composer/src/Composer/Repository/VcsRepository.php on line 84
Hi,
I'm trying to install some packages with the composer-asset-plugin. My composer.json looks like
{
"require": {
"fxp/composer-asset-plugin": "dev-master",
"bower-asset/jquery": "dev-master",
"bower-asset/bootstrap": "dev-master",
"bower-asset/jquery.ui": "dev-master",
"bower-asset/angular": "dev-master",
"bower-asset/angular-resource": "dev-master",
"bower-asset/angular-route": "dev-master",
"bower-asset/angular-sanitize": "dev-master",
"bower-asset/danialfarid-angular-file-upload": "dev-master",
"bower-asset/angular-ui-date": "dev-master",
"bower-asset/angularjs-nvd3-directives": "dev-master",
"bower-asset/ng-infinite-scroller-origin": "dev-master",
"bower-asset/chartjs": "dev-master",
"bower-asset/d3": "3.4.11",
"bower-asset/highlight": "dev-master",
"bower-asset/html5shiv": "dev-master",
"bower-asset/marked": "dev-master",
"bower-asset/moment": "dev-master",
"bower-asset/nvd3": "dev-master",
"bower-asset/respond": "dev-master",
"bower-asset/underscore": "dev-master"
},
"extra": {
"asset-installer-paths": {
"bower-asset-library": "assets/vendor"
}
}
}
But if I try to install I get the error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for bower-asset/angular-resource dev-master -> satisf
iable by bower-asset/angular-resource[dev-master].
- bower-asset/angular-resource dev-master requires bower-asset/angular 1.3.0
-patch3024 -> no matching package found.
Problem 2
- Installation request for bower-asset/angular-route dev-master -> satisfiab
le by bower-asset/angular-route[dev-master].
- bower-asset/angular-route dev-master requires bower-asset/angular 1.3.0-pa
tch3024 -> no matching package found.
Problem 3
- Installation request for bower-asset/angular-sanitize dev-master -> satisf
iable by bower-asset/angular-sanitize[dev-master].
- bower-asset/angular-sanitize dev-master requires bower-asset/angular 1.3.0
-patch3024 -> no matching package found.
Problem 4
- Installation request for bower-asset/angularjs-nvd3-directives dev-master
-> satisfiable by bower-asset/angularjs-nvd3-directives[dev-master].
- bower-asset/angularjs-nvd3-directives dev-master requires bower-asset/angu
lar >=1.2.4,<1.3 -> no matching package found.
Problem 5
- Installation request for bower-asset/nvd3 dev-master -> satisfiable by bow
er-asset/nvd3[dev-master].
- bower-asset/nvd3 dev-master requires bower-asset/d3 >=3.3.13,<3.4 -> no ma
tching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your min
imum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
problems.
Directly from bower there is no problem. Here my bower.json
{
"name": "bower",
"dependencies": {
"jquery": "latest",
"bootstrap": "latest",
"jquery.ui": "latest",
"angular": "latest",
"angular-resource": "latest",
"angular-route": "latest",
"angular-sanitize": "latest",
"danialfarid-angular-file-upload": "latest",
"angular-ui-date": "latest",
"angularjs-nvd3-directives": "latest",
"ng-infinite-scroller-origin": "latest",
"chartjs": "latest",
"d3": "3.4.11",
"highlight": "latest",
"html5shiv": "latest",
"marked": "latest",
"moment": "latest",
"nvd3": "latest",
"respond": "latest",
"underscore": "latest"
}
}
Do you know where the problem is?
Thanks
It would be great to be able to set the vendor path for bower packages and npm packages, eg. similar to https://github.com/composer/installers:
{
"extra": {
"installer-paths": {
"web/assets/vendor": ["type:bower-asset-library"]
}
}
Custom installer should respect bower-asset-ignore
configuration.
Hi , i am flow the yii2 install step , but when i use the composer to install composer-asset-plugin is display the error message on the screen
PHP fatal error Class 'Composer\Installer\InstallerEvents' not found in /Users/duncan/.composer/vendor/fxp/composer-asset-plugin/FxpAssetPlugin.php on line 65
and my install cmd is composer global require fxp/composer-asset-plugin:@beta
how can i install it , thank you
p.s my composer version 1.0.0-alpha8
As title says, after updating your plugin (composer.phar global update
- because of #55) I get this error when I try to install mkdirp
(npm package) with composer.phar update -vvv
:
[...]
Downloading https://api.github.com/repos/substack/node-mkdirp
Downloading https://api.github.com/repos/substack/node-mkdirp/contents/package.json?ref=master
Downloading https://api.github.com/repos/substack/node-mkdirp/commits/master
Downloading https://api.github.com/repos/substack/node-mkdirp/tags?per_page=100
Downloading https://api.github.com/repos/substack/node-mkdirp/git/refs/heads?per_page=100
[UnexpectedValueException]
Package npm-asset/mkdirp's bin key should be an array, string given.
Here the package.json
of this package.
I post also the exception trace if it can help.
Exception trace:
() at phar:///usr/bin/composer.phar/src/Composer/Package/Loader/ArrayLoader.php:67
Composer\Package\Loader\ArrayLoader->load() at /home/me/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:169
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->preInitBranchPackage() at /home/me/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:133
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->initBranches() at /home/me/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:43
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->initialize() at phar:///usr/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:170
Composer\Repository\ArrayRepository->getPackages() at phar:///usr/bin/composer.phar/src/Composer/DependencyResolver/Pool.php:170
Composer\DependencyResolver\Pool->addRepository() at phar:///usr/bin/composer.phar/src/Composer/Installer.php:361
Composer\Installer->doInstall() at phar:///usr/bin/composer.phar/src/Composer/Installer.php:218
Composer\Installer->run() at phar:///usr/bin/composer.phar/src/Composer/Command/UpdateCommand.php:130
Composer\Command\UpdateCommand->execute() at phar:///usr/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:889
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer.phar/src/Composer/Console/Application.php:137
Composer\Console\Application->doRun() at phar:///usr/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:124
Symfony\Component\Console\Application->run() at phar:///usr/bin/composer.phar/src/Composer/Console/Application.php:83
Composer\Console\Application->run() at phar:///usr/bin/composer.phar/bin/composer:43
require() at /usr/bin/composer.phar:15
[InvalidArgumentException]
Package <name> must have a source or dist specified
Add a driver for SVN.
We need to extend the class Composer\Repository\Vcs\SvnDriver
.
Within "composer update" I've got that error today:
Downloading https://bower.herokuapp.com/packages/ckeditor
Writing /Users/UserName/.composer/cache/repo/https---bower.herokuapp.com-packages/ckeditor-fc850db809cb414eb90c4925baa7aa265ef384bc-package.json into cache
Downloading https://api.github.com/repos/ckeditor/ckeditor-releases
Downloading https://api.github.com/repos/ckeditor/ckeditor-releases/contents/bower.json?ref=master
Downloading https://api.github.com/repos/ckeditor/ckeditor-releases/commits/master
Downloading https://api.github.com/repos/ckeditor/ckeditor-releases/tags?per_page=100
Downloading https://api.github.com/repos/ckeditor/ckeditor-releases/git/refs/heads?per_page=100
[UnexpectedValueException]
Invalid version string "standard/4.4.5"
Trace:
Exception trace:
() at phar:///opt/user-bin/composer/src/Composer/Package/Version/VersionParser.php:163
Composer\Package\Version\VersionParser->normalize() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php:75
Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->skip() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:81
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->initTag() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:63
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->initTags() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php:42
Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository->initialize() at phar:///opt/user-bin/composer/src/Composer/Repository/ArrayRepository.php:170
Composer\Repository\ArrayRepository->getPackages() at phar:///opt/user-bin/composer/src/Composer/DependencyResolver/Pool.php:170
Composer\DependencyResolver\Pool->addRepository() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/Util.php:40
Fxp\Composer\AssetPlugin\Repository\Util::addRepository() at /Users/UserName/.composer/vendor/fxp/composer-asset-plugin/Repository/AbstractAssetsRepository.php:139
Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository->whatProvides() at phar:///opt/user-bin/composer/src/Composer/DependencyResolver/Pool.php:255
Composer\DependencyResolver\Pool->computeWhatProvides() at phar:///opt/user-bin/composer/src/Composer/DependencyResolver/Pool.php:244
Composer\DependencyResolver\Pool->whatProvides() at phar:///opt/user-bin/composer/src/Composer/Installer.php:767
Composer\Installer->processDevPackages() at phar:///opt/user-bin/composer/src/Composer/Installer.php:467
Composer\Installer->doInstall() at phar:///opt/user-bin/composer/src/Composer/Installer.php:217
Composer\Installer->run() at phar:///opt/user-bin/composer/src/Composer/Command/UpdateCommand.php:128
Composer\Command\UpdateCommand->execute() at phar:///opt/user-bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
Symfony\Component\Console\Command\Command->run() at phar:///opt/user-bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:889
Symfony\Component\Console\Application->doRunCommand() at phar:///opt/user-bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at phar:///opt/user-bin/composer/src/Composer/Console/Application.php:135
Composer\Console\Application->doRun() at phar:///opt/user-bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:124
Symfony\Component\Console\Application->run() at phar:///opt/user-bin/composer/src/Composer/Console/Application.php:84
Composer\Console\Application->run() at phar:///opt/user-bin/composer/bin/composer:43
require() at /opt/user-bin/composer:14
In composer.json I use:
"bower-asset/ckeditor": "4.4.* | ~4.4"
NPM and Bower use Semver for normalize her versions.
Semver version: http://semver.org/
Composer version: https://getcomposer.org/doc/04-schema.md#version
And split the version conversion and version selection (see #2 ).
I would like to install admin-lte
in version, that works for bower: bower install admin-lte#bower
.
composer.json:
"bower-asset/admin-lte": "#bower"
result:
[UnexpectedValueException]
Could not parse version constraint #bower: Invalid version string "#bower"
composer.json:
"bower-asset/admin-lte": "dev-bower"
result:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package bower-asset/admin-lte could not be found in any version, there may be a typo in the package name.
Problem 2
- <package> requires bower-asset/admin-lte dev-bower -> no matching package found.
When I try to install any version of qs
(npm package), for example dev-master
:
{
"require": {
"npm-asset/qs": "dev-master"
}
}
I always get this error running composer.phar update -vvv
(both with or without --no-dev
):
[...]
Downloading https://registry.npmjs.org/qs
Downloading https://api.github.com/repos/hapijs/qs
Downloading https://api.github.com/repos/hapijs/qs/contents/package.json?ref=master
Downloading https://api.github.com/repos/hapijs/qs/commits/master
Downloading https://api.github.com/repos/hapijs/qs/tags?per_page=100
Downloading https://api.github.com/repos/hapijs/qs/git/refs/heads?per_page=100
[UnexpectedValueException]
Could not parse version constraint 4.x.x: Invalid version string "4.x.x"
Looking into package.json
of the package (here), I see this:
{
"devDependencies": {
"lab": "4.x.x"
},
}
How can I solve this?
Thanks
When installing packages i get this:
No driver found to handle Asset VCS repository http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.min.js
as i understand bower may handle with urls as dependency
http://stackoverflow.com/questions/19348076/installing-a-dependency-with-bower-from-url-and-specify-version
On the install, or especially during the update, an VCS repository containing many versions can become extremely slow.
For example, 2 slow packages:
The solution would be to add in the configuration of root Composer package, a constraint version for each package. In this way the Solver will search only in packages really imported, and therefore, it would limit the number of import of the informations of each package.
Example of configuration:
{
"extra": {
"asset-package-filters": {
"bower-asset/jquery": ">=2.1@stable"
}
}
}
With this example, Composer will import only 2 versions of jquery
(2.1.0 and 2.1.1) for the update.
Of course, if your project requires a dependency with a non-imported version, an exception will thrown, but this exception may not indicate that this is caused by the filter of asset package version. It is also for this reason that the configuration is only found in the root Composer package.
This solution doesn't add any configuration, but uses the dependencies in the root Composer package. It complements the lazy loading system (already implemented).
At the plugin initialization,the plugin retrieves the list of dependencies added to the root Composer package. If the asset packages are defined, then the plugin will add only the branches and tags accepted by the constraint version defined in the root Composer package.
In this way, we will keep the same experience that currently, tout en but also keeping the native behavior of dependency analysis, while dramatically optimizing the number of requests for getting the informations of packages.
Example:
{
"name": "acme/root-project",
"minimum-stability": "dev",
"require": {
"bower-asset/jquery": "2.1.*",
"bower-asset/boostrap": "3.2.*"
}
}
With this example, Composer will import only 2 versions of jquery
(2.1.0 and 2.1.1) for the update, even if bower-asset/bootstrap
has a dependency for jquery
>=1.9
.
"require": {
...
"bower-asset/isotope": "~2.0.0",
...
},
Exception
[InvalidArgumentException]
Package bower-asset/isotope-2.0.1.0 must have a source or dist specified
The documentation states that two versions of the same bower package can be installed at the same time, but it doesn't really say how. Can you please explain?
Thanks!
Adding "bower-asset/angular": "1.2.25" starts to read bower.json of of bower-asset/angular (v1.3.0-patch3008)����, then bower-asset/angular (v1.3.0-patch3007)���� and so on down by patches and versions.
And finally:
This finishes with Fatal error: Out of memory (allocated 1380712448) (tried to allocate 134217728 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 173
Currently, the search is not available for the NPM Repository, because there is no API to do a search. The NPM CLI client retrieves all registered packages (currently +83000 packages for a file with a size of 40.5 MB) and analyze this file.
There was a URL (https://registry.npmjs.org/-/short) to retrieve only the list of packages, but it was recently depreciated. However, there is a mirror server for retrieve the complete list of packages but with minimal information (7.8 MB).
In 2 cases, we should download the file and put the file in cache. But in the short version of the mirror server, there are no descriptions, whereas in the official registry, the descriptions are presents.
Official all packages: https://registry.npmjs.org/-/all
Miroir all short packages: https://skimdb.npmjs.com/registry/_all_docs
Add a driver for Git Bitbucket.
We need to extend the class Composer\Repository\Vcs\GitBitbucketDriver
.
Loading bower.json for all versions is:
While caching helps a lot it does not nor the very first run.
In the BowerRepository I wrote in composer/composer#3078 I managed that by lazy creating package objects.
whatProvides returns an array containing name + version (plus other stuff required internally), loadPackage is then only called to create full blown packages.
a small change to src/Composer/DependencyResolver/Pool.php is required, see nsams/composer@53fc1cb for the whole commit
Is it necessary to fetch the bower.json from every tag of the github repositories? Composer does that for custom VCS and that is fine I guess since that is only supported by root project. Can the assets be added to packagist package cache or similar instead?
The practical implications currently are that composer update takes ages. Requiring jquery without any version constraint will trigger 122 fetches of bower.json since there are 122 releases of jquery https://github.com/jquery/jquery/releases. Using a version constraint it will only fetch the relevant bower.json files but it still takes 1-10 minutes to run composer update, depending on one's internet connection.
When the asset package has a version
section in the root package of the repository, no alias package is created.
Add a driver for Mercurial Bitbucket.
We need to extend the class Composer\Repository\Vcs\HgBitbucketDriver
.
The VCS Repositories added during the analysing by the Solver
are not added in Pool
, but only in RepositoryManager
.
Todo:
Of course, a solution is already developed, but I must waiting the merge of the PR composer/composer#3171
There is probably a valid reason for that, but I wanted to discuss why you can't use the standard repositories config for configuring asset repositories.
Instead of
{
"extra": {
"asset-repositories": [
{
"type": "bower-vcs",
"url": "https://github.com/vendor/exemple-asset-name.git"
}
]
}
}
why not use:
{
"repositories": [
{
"type": "bower-vcs",
"url": "https://github.com/vendor/exemple-asset-name.git"
}
]
}
same with disabling default repositories:
{
"extra": {
"asset-registry-options": {
"bower-searchable": false
}
}
}
could be:
{
"repositories": [
{
"bower-asset": false
}
]
}
Hi!
I have problem with package bower-asset/clockpicker (https://github.com/weareoutman/clockpicker)
In it bower.json I see:
"ignore": [
"*",
"!dist/*",
"!bower.json",
"!LICENSE",
"!README.md"
],
And in vendor/bower/clockpicker folder I don't see the folder "dist",
there is only files:
.gitignore
.travis.yml
bower.json
LICENSE
README.md
Also, how to update only one package via composer?
I've tried
composer update bower-asset/clockpicker -vvv
but seems it checked all of bower-asset/* packages. It takes a lot of time.
Add a driver for Perforce.
We need to extend the class Composer\Repository\Vcs\PerforceDriver
.
For example: v1.2.3-1
must be converted to v1.2.3-patch1
Add a driver for Mercurial, because it is used by some NPM packages.
We need to extend the class Composer\Repository\Vcs\HgDriver
.
Example:
{
"require": {
"npm-asset/pagedown": "*"
}
}
This is a continuation of the yiisoft/yii2#5083 (comment).
this code in composer.json :
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
will change the bower-asset default directory to 'vendor/bower', and it work and success in my local PC (windows), and composer.lock resulting from the process should be the same. but why Heroku (ubuntu) always install the library to "vendor/bower-asset" not to "vendor/bower" like in my local pc, whether Heroku wrong in translating?
hi, i m running a server at 1und1 and they don t allow me to enter user and password for oauth... it fails then / is their a way to put credentials into a config file, so this can be bypassed / thanks
Currently, for the install
, the plugin recovers only package definitions accepted by the range version. However, for the update
, the plugin retrieves all definitions of packages, if there is no constraint in the root Composer package.
I did a proof of concept to drastically reduce the number of import of package definitions for the update:
Filter the tags that are greater than or equal to the installed, or defined by the range version in the root Composer package. In this way, the update
only fetches the latest version for each dependency (or greater than the installed version).
However, there is a problem that can happen when a dependency uses a new version lower than the installed version: instead of removing the installed version and install the old version, Composer will throw an exception stating that the version does not exist.
Of course, 3 solutions can work around the problem:
vendor
directory, do the update
update
, and remove the dependency in the root Composer packageIn view of the small ergonomic problem, I wonder if I can add this feature by default. I can also add an option (disabled by default) to enable / disable this feature.
What do you think?
There is a problem, when the bower name does not match the package name.
For example the package jQuery UI in the bower repository has the name jquery.ui (https://bower.herokuapp.com/packages/jquery.ui), but in the bower.json and package.json the name is jquery-ui. There is a huge number of packages with the same problem, for example chartjs (https://bower.herokuapp.com/packages/chartjs).
Other packages like highlightJS (https://bower.herokuapp.com/packages/highlight) coudn't be found at all, because the package.json is not in the root folder but in the src folder of the GitHub project (https://github.com/isagalaev/highlight.js).
Currently composer queries bower.json for versions that it is never going to install because of version constraints. Is it somehow possible to avoid these requests?
Having the latest version of composer and the composer-asset-plugin and run the following command:
composer create-project --prefer-dist --stability=rc yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (2.0.0-rc)
- Installing yiisoft/yii2-app-basic (2.0.0-rc)
Loading from cache
Created project in basic
Loading composer repositories with package information
Installing dependencies (including require-dev)
Could not fetch https://api.github.com/repos/jquery/jquery, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /home/cebe/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: cebe
Password:
Token successfully created
Reading bower.json of bower-asset/jquery (1.8.3)^C
As you can see it is trying to get bower.json for jquery 1.8.3 which is not installable anyway because of the version constraint "2.1.*@stable | 1.11.*@stable"
. Is it possible to avoid these requests somehow?
To reproduce: make fresh install of yiisoft/yii2-app-advanced
.
Go to vendor\bower
folder of the project and check "ignore" section of bower.json
of packages:
bootstrap
- everything in "ignore"
section was not installed
jquery.inputmask
- nuget
and qunit
folders remained
yii2-pjax
- test
folder remained
Currently the plugin only works in "global" mode, and to run the plugin in "project" mode, a enhancement must be made in Composer.
See the PR composer/composer#3082.
When update occured this error:
PHP Fatal error: Call to undefined method Composer\Package\CompletePackage::getTransportOptions() in /my-project/vendor/fxp/composer-asset-plugin/Package/LazyCompletePackage.php on line 394
PHP Fatal error: Call to undefined method Composer\Package\CompletePackage::getTransportOptions() in /Users/diwaker/.composer/vendor/fxp/composer-asset-plugin/Package/LazyCompletePackage.php on line 394
I have added details on #12 comment, as this is same
Like with bower
packages - but for any non-bower packages - executed on post-install
, post-update
.
Something like adding the following to composer.json
file in the project root:
...
"scripts": {
...
"post-update-cmd": [
"Fxp\\Composer\\AssetPlugin::removeIgnoredFiles"
]
...
},
"extra": {
...
"ignore": {
"swiftmailer/swiftmailer": [
"/.*",
"phpunit.xml.dist",
"doc",
"tests",
"notes"
]
}
...
}
...
When trying to add "bower-asset/jquery-sticky" : "~1.0"
as a requirement I get an UnexpectedValueException: Could not parse version constraint : Invalid version string "".
jquery-sticky itself has a dependency on "jquery": null
, so I suspect that the null could be the issue.
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.