All Projects → ItinerisLtd → Composify

ItinerisLtd / Composify

Licence: mit
Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Composify

Wordup Cli
Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
Stars: ✭ 116 (+222.22%)
Mutual labels:  cli, wordpress, wordpress-development
Tj
Create local WordPress dev sites, manage existing sites, and deploy them, all from the command line.
Stars: ✭ 88 (+144.44%)
Mutual labels:  cli, wordpress, wordpress-development
Wpstarter
Easily bootstrap whole site Composer packages for WordPress.
Stars: ✭ 182 (+405.56%)
Mutual labels:  wordpress, wordpress-development, composer
Acf Pro Installer
A composer install helper for Advanced Custom Fields PRO
Stars: ✭ 265 (+636.11%)
Mutual labels:  wordpress, wordpress-development, composer
Docker Wordpress
Wordpress Docker container using SSL Certificates with LetsEncrypt
Stars: ✭ 391 (+986.11%)
Mutual labels:  wordpress, wordpress-development
Awesome Wp Developer Tools
A collection of plugins, starter themes and tools to make WordPress development easier.
Stars: ✭ 388 (+977.78%)
Mutual labels:  wordpress, wordpress-development
Wordpress Gear
A bunch of gear for WP developers
Stars: ✭ 438 (+1116.67%)
Mutual labels:  wordpress, wordpress-development
Wordpress
A fork of WordPress with Composer support added. Branches, tags, and trunk synced from upstream every 15 minutes.
Stars: ✭ 546 (+1416.67%)
Mutual labels:  wordpress, composer
Wp Webpack Script
💥🔥📦👩‍💻 An easy to use, pre configured, hackable webpack setup & development server for WordPress themes and plugins.
Stars: ✭ 314 (+772.22%)
Mutual labels:  wordpress, wordpress-development
Intervention
WordPress plugin to configure wp-admin and application state using a single config file.
Stars: ✭ 481 (+1236.11%)
Mutual labels:  wordpress, wordpress-development
Wpackagist
WordPress Packagist — manage your plugins with Composer
Stars: ✭ 558 (+1450%)
Mutual labels:  wordpress, composer
Action Scheduler
A scalable, traceable job queue for background processing large queues of tasks in WordPress. Specifically designed for distribution in WordPress plugins (and themes) - no server access required.
Stars: ✭ 386 (+972.22%)
Mutual labels:  wordpress, wordpress-development
Typerocket
TypeRocket is a highly integrated MVC WordPress framework with beautiful UI components for the modern developer.
Stars: ✭ 378 (+950%)
Mutual labels:  wordpress, wordpress-development
Headless Wp Starter
🔪 WordPress + React Starter Kit: Spin up a WordPress-powered React app in one step
Stars: ✭ 4,144 (+11411.11%)
Mutual labels:  wordpress, wordpress-development
Awps
A Modern WordPress Starter Theme for savvy Developers
Stars: ✭ 319 (+786.11%)
Mutual labels:  wordpress, composer
Acf Builder
An Advanced Custom Field Configuration Builder
Stars: ✭ 492 (+1266.67%)
Mutual labels:  wordpress, composer
Raccoon Plugin
With Raccoon, use a JSON or YAML file to manage WordPress theme features
Stars: ✭ 18 (-50%)
Mutual labels:  wordpress, wordpress-development
Wordops
Install and manage a high performance WordPress stack with a few keystrokes
Stars: ✭ 649 (+1702.78%)
Mutual labels:  cli, wordpress
Wp Multitenancy Boilerplate
WordPress multitenancy boilerplate configured and managed with Composer and PHP dotenv.
Stars: ✭ 24 (-33.33%)
Mutual labels:  wordpress, composer
Heroku Wp
WordPress on Heroku
Stars: ✭ 865 (+2302.78%)
Mutual labels:  wordpress, composer

composify

Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly.

oclif Version Downloads/week License Hire Itineris

Goal

Since plugin authors do not usually provide custom composer repositories (e.g: Private Packagist, satis), installing premium WordPress plugins via composer is not easy.

Lots of tutorials teach you: open composer.json and add the following within the repositories array:

// https://kinsta.com/blog/bedrock-trellis/
{
  "type": "package",
  "package": {
    "name": "kinsta/kinsta-mu-plugins",
    "type": "wordpress-muplugin",
    "version": "2.0.15",
    "dist": {
      "url": "https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip",
      "type": "zip"
    }
  }
}

The problems:

  • if package.dist.url is version-locked, the repositories array has to be updated whenever a new plugin version is released
  • if package.dist.url is not version-locked,$ composer install is not deterministic (even with composer.lock)
    • package.dist.url always points to the latest version
    • package.version becomes meaningless because the downloaded zip could be a newer version
    • running $ composer install (without changing anything) could break the site because a newer plugin version is installed
    • when composer caching invoked, there is no way to know which plugin version will be installed

The solution / what composify does:

  1. download the plugin zip file
  2. unzip it
  3. generate composer.json
  4. commit plugins files and composer.json
  5. $ git tag
  6. $ git push --follow-tags

Requirements

  • NodeJS v10.0.0 or later

Installation

$ npx @itinerisltd/composify just works! No installation required.

Usage

$ npx @itinerisltd/composify --help
Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly

USAGE
  $ composify

OPTIONS
  -d, --directory=directory
      directory name after unzip [example: kinsta-mu-plugins]

  -f, --file=file
      main plugin file which containing the plugin header comment [example:
      kinsta-mu-plugins.php]

  -h, --help
      show CLI help

  -n, --name=name
      (required) package name [example: kinsta-mu-plugins]

  -o, --vendor=vendor
      (required) vendor / organization name [example: itinerisltd]

  -r, --repo=repo
      remote url or local path to the gti repository [example:
      https://github.com/ItinerisLtd/kinsta-mu-plugins.git]

  -t, --type=wordpress-plugin|wordpress-muplugin
      (required) [default: wordpress-plugin] package type

  -u, --[no-]unzip-subdir
      unzip file into a sub-directory, only use when default options are breaking

  -v, --version
      show CLI version

  -z, --zip=zip
      (required) remote url or local path to the latest zip file [example:
      https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip OR
      /User/me/kinsta-mu-plugins.zip]

Examples

Gravity Forms

$ npx @itinerisltd/composify --vendor=itinerisltd --name=gravityforms --zip=<the-signed-s3-url>

Note the flags:

$ wget <the-signed-s3-url>
$ tree .
.
└── gravityforms_x.y.z.zip

$ unzip -o ./gravityforms_2.4.5.zip
$ tree .
.
├── gravityforms              <-- `--directory`
│   ├── gravityforms.php      <-- `--file`
│   ├── xxx
│   └── yyy.php
└── gravityforms_x.y.z.zip
  • --directory is omitted because it defaults to ${name}, i.e: gravityforms
  • --file is omitted because it defaults to ${name}.php, i.e: gravityforms.php
  • --repo is omitted because it defaults to https://github.com/${vendor}/${name}.git
  • --unzipDir is omitted because main plugin file is inside --directory

Advanced Custom Fields Pro

$ npx @itinerisltd/composify --vendor=itinerisltd --name=advanced-custom-fields-pro --file=acf.php --zip=https://connect.advancedcustomfields.com/xxx

Note the flags:

$ wget https://connect.advancedcustomfields.com/xxx
$ tree .
.
└── advanced-custom-fields-pro.zip

$ unzip -o ./advanced-custom-fields-pro.zip
$ tree .
.
├── advanced-custom-fields-pro        <-- `--directory`
│   ├── acf.php                       <-- `--file`
│   ├── readme.txt
│   └── xxx
└── advanced-custom-fields-pro.zip
  • --file is set to acf.php

Kinsta MU Plugins

$ npx @itinerisltd/composify --vendor=itinerisltd --name=kinsta-mu-plugins --zip=https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip --unzip-subdir --type=wordpress-muplugin

Note the flags:

$ wget https://kinsta.com/kinsta-tools/kinsta-mu-plugins.zip
$ tree .
.
└── kinsta-mu-plugins.zip
$ unzip -o ./kinsta-mu-plugins.zip
$ tree .
.
├── kinsta-mu-plugins
│   ├── xxx
│   └── yyy
├── kinsta-mu-plugins.php    <-- `--file`
└── kinsta-mu-plugins.zip
  • --unzip-subdir is set because the unzipped content is not contained inside a --directory

FAQ

How to install the composify-ed plugin via composer?

Open composer.json and add your git remote into repositories:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/<vendor>/<name>"
    }
  ]
}
$ composer require <vendor>/<name>

See: https://getcomposer.org/doc/05-repositories.md#vcs

How to composify plugin zip URLs which are password-protected?

  1. Download the zip files to your computer first
  2. $ composify/bin/run -z /path/to/the-plugin.zip -o itinerisltd -n the-plugin

Note: This is a v0.3 feature.

Can I change default flag values via environment variables?

Yes.

These 2 commands are equivalent:

$ COMPOSIFY_VENDOR=itinerisltd COMPOSIFY_NAME=gravityforms COMPOSIFY_ZIP=<the-signed-s3-url> npx @itinerisltd/composify
$ npx @itinerisltd/composify --vendor=itinerisltd --name=gravityforms --zip=<the-signed-s3-url>

Can I install composify instead of using $ npx?

Yes. However, you are responsible for updating it.

# yarn or npm doesn't matter
$ yarn global add @itinerisltd/composify
$ composify --vendor=itinerisltd --name=gravityforms --zip=<the-signed-s3-url>

How about plugins on wordpress.org?

Use WordPress Packagist instead.

What to do when fatal: Could not read from remote repository?

ERROR: Repository not found.
fatal: Could not read from remote repository.

Make sure you have:

Is it a must to use composify with Bedrock?

No.

Although we prefer and sponsor Bedrock at Itineris, you can composify any plugin zip files into git repositories, and install them via composer.

Bedrock alternatives:

Any Alternatives?

It looks awesome. Where can I find some more goodies like this?

This isn't on wp.org. Where can I give a ⭐️⭐️⭐️⭐️⭐️ review?

Thanks! Glad you like it. It's important to make my boss know somebody is using this project. Instead of giving reviews on wp.org, consider:

Feedback

Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Change log

Please see CHANGELOG for more information on what has changed recently.

Credits

composify is a Itineris Limited project created by Tang Rufus.

Full list of contributors can be found here.

License

composify is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].