GithubHelp home page GithubHelp logo

composerextrafiles's People

Contributors

rbayliss avatar

Watchers

 avatar  avatar  avatar

Forkers

civicrm

composerextrafiles's Issues

Downloading extra files fails on older composer versions (1.2.0)

When trying to install https://github.com/LastCallMedia/drupal-scaffold I hit an error when trying to install mannequin-core, which uses this plugin. This was with composer version 1.2.0

Running composer self-update brought me to 1.5.2, and the error went away.

Ideally, it'd be great for this to work with older versions of composer as well. If for some reason that's not possible, a helpful error would be useful.


Relevant console output from composer install -vvv:

  - Installing lastcall/mannequin-core (1.0.1)
Reading /Users/jeff/.composer/cache/files/lastcall/mannequin-core/483adefd8097744846687dfc7453883b11d6bad7.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip '/Users/jeff/Desktop/Drupal-Scaffold/vendor/lastcall/mannequin-core/36b2536b49948572a3e65034cb9f6200' -d '/Users/jeff/Desktop/Drupal-Scaffold/vendor/composer/2331bf6b' && chmod -R u+w '/Users/jeff/Desktop/Drupal-Scaffold/vendor/composer/2331bf6b'

    Skipped installation of bin bin/mannequin for package lastcall/mannequin-core: name conflicts with an existing file
    REASON: Required by the root package: Install command rule (install lastcall/mannequin-core 1.0.1)

  - Installing lastcall/mannequin-core:ui (1.0.1)

Failed: [ErrorException] 0: array_replace_recursive(): Argument #3 is not an array

                                                          
  [ErrorException]                                        
  array_replace_recursive(): Argument #3 is not an array  
                                                          

Exception trace:
 () at phar:///Users/jeff/bin/composer/src/Composer/Util/RemoteFilesystem.php:697
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 array_replace_recursive() at phar:///Users/jeff/bin/composer/src/Composer/Util/RemoteFilesystem.php:697
 Composer\Util\RemoteFilesystem->getOptionsForUrl() at phar:///Users/jeff/bin/composer/src/Composer/Util/RemoteFilesystem.php:229
 Composer\Util\RemoteFilesystem->get() at phar:///Users/jeff/bin/composer/src/Composer/Util/RemoteFilesystem.php:86
 Composer\Util\RemoteFilesystem->copy() at phar:///Users/jeff/bin/composer/src/Composer/Downloader/FileDownloader.php:139
 Composer\Downloader\FileDownloader->doDownload() at phar:///Users/jeff/bin/composer/src/Composer/Downloader/FileDownloader.php:91
 Composer\Downloader\FileDownloader->download() at phar:///Users/jeff/bin/composer/src/Composer/Downloader/ArchiveDownloader.php:36
 Composer\Downloader\ArchiveDownloader->download() at phar:///Users/jeff/bin/composer/src/Composer/Downloader/DownloadManager.php:213
 Composer\Downloader\DownloadManager->download() at /Users/jeff/Desktop/Drupal-Scaffold/vendor/lastcall/composer-extra-files/src/Plugin.php:53
 LastCall\ExtraFiles\Plugin->installExtraFiles() at n/a:n/a
 call_user_func() at phar:///Users/jeff/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:170
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///Users/jeff/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:115
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///Users/jeff/bin/composer/src/Composer/Installer.php:563
 Composer\Installer->doInstall() at phar:///Users/jeff/bin/composer/src/Composer/Installer.php:216
 Composer\Installer->run() at phar:///Users/jeff/bin/composer/src/Composer/Command/InstallCommand.php:135
 Composer\Command\InstallCommand->execute() at phar:///Users/jeff/bin/composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///Users/jeff/bin/composer/vendor/symfony/console/Application.php:844
 Symfony\Component\Console\Application->doRunCommand() at phar:///Users/jeff/bin/composer/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///Users/jeff/bin/composer/src/Composer/Console/Application.php:231
 Composer\Console\Application->doRun() at phar:///Users/jeff/bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///Users/jeff/bin/composer/src/Composer/Console/Application.php:104
 Composer\Console\Application->run() at phar:///Users/jeff/bin/composer/bin/composer:43
 require() at /Users/jeff/bin/composer:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

 jeff:Drupal-Scaffold $ (master) composer self-update
Updating to version 1.5.2 (stable channel).
    Downloading: 100%         

(Meta) Multiple updates in fork?

This is a meta question. I work on a project that's been looking for a bower off-ramp and which gets used in several different file-structures. The approach in this plugin seems clever and like a pretty good fit. I've got some some usability improvements in a fork, but I also see the repo hasn't been updated in 2 years, so I'm not quite sure how to pursue publication -- e.g. whether to pursue a series of PRs or just keep the fork going.

Patch Queue

First, here's a preview of the changes:

  • Root project support: I tried the plugin like so: create a new folder with a new composer.json, copy the example snippet, run composer install, and.... nothing. I figured it wasn't working. After poking/testing/reading more carefully, I found it does work... but only for dependencies. If the extra-files are in the root project (which is one of the cases that I do need to use), then it doesn't work. It's easier to learn/test/develop/iterate when one has root-project support.
  • Tracking file: Suppose you locally edit the url of a file and re-run composer install. It doesn't do anything. The patch now uses a tracking file (.composer-extra-files.json) and re-downloads after any changes . I suppose it's not a big concern if you strictly consume packages (composer probably destroys the stale content in tandem with dependency-upgrade?), but it helps with learning/testing/developing/iterating.
  • Ignore lists: Several of the upstream zip/tar files that my project pulls include dev/test/doc/experimental bits that shouldn't appear in the final build.
  • Defaults (path, ignore): All the downloads in my intended project go under bower_components. It's handy to set the path with a default formula ("path": "bower_components/{$id}").

Details: https://github.com/totten/ComposerExtraFiles/commits/master

Approaches

I guess there are loosely two ways to go about this:

  • Aim to publish a v1.1 or v2.0 of this plugin. Split out my patches into separate PRs for more discussion/review. The upshot is probably a higher-quality outcome (more insight/eyes/perspectives). However, it's more admin-work and regression-risk.
  • Publish the fork under a different name. The upshot is less admin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.