Opened 10 years ago

Last modified 10 years ago

#11279 closed Task

Package managers integration — at Version 7

Reported by: Piotrek Koszuliński Owned by: Marek Lewandowski
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description (last modified by Piotrek Koszuliński)

There are plenty package managers out there, but let's focus first on two of them:

  • Bower (JS)
  • Composer (PHP)

Steps:

  • Make all necessary steps to make CKEditor easily installable with those PMes. The package that should be installed by default is stable/standard (which equals master) from https://github.com/ckeditor/ckeditor-releases. If PM allows to have alternative, we can also make other (basic and full) presets installable.
  • The above will perhaps require: #10882. We already tagged CKEditor 4.3 as 4.3.0. To close #10882 we should also add missing tags for historic releases (4.3.0-beta, 4.2.0, 4.1.0, 4.1.0-rc, etc). Additionally, to conform ckeditor-releases with SemVer we may need to create tags without "/standard|basic|full" suffix - e.g. 4.3.0 === 4.3.0/standard.
  • Readmes in ckeditor-dev and ckeditor-releases have to be updated. The ckeditor-dev's mentions the 4.0 tag and ckeditor-releases has to contain information about installing CKEditor with Bower and Composer.
  • Installing through package managers has to be mentioned in our guides. Please contact Ania to choose the best place.
  • The PM integration should be mentioned in release blog post.

Final decisions for this ticket. We agreed that we can start with the really basic solution, so only one available preset (standard). Having 4 different presets would require having 4 different repositories (a lot of work to do) or otherwise we would be able to support only Composer and not Bower, so it's also making situation more complicated.

Change History (8)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:2 Changed 10 years ago by Marek Lewandowski

Owner: set to Marek Lewandowski
Status: newassigned

comment:3 Changed 10 years ago by Marek Lewandowski

Ok I've took a look into Composer and Bower.

Composer:

a) We are not able to publish our ckeditor-releases to work with composer. That's because it requires format: X.Y.Z or vX.Y.Z optionally followed by one of -dev, -patch, -alpha, -beta, -RC. Any other suffix will be recognized as invalid, so our -full, -standard suffixes would break it.

What we need to do to bring Composer support?

  1. resolve issue with tag naming
  2. create composer.json file in ckeditor-releases repository ( we don't need to do it in ckeditor-dev though )
  3. fill form in order to register ckeditor in packagist

b) Alternative approach: we can handle it at our new server.

All we need to do is to generate packages.json file, and make a script which would re-generate it's content upon each release (as it would be bad idea to do it manually).

As a result CKEditor would be accessible with phrases like: "cksource/ckeditor", "cksource/ckeditor-full", "cksource/ckeditor-basic", "cksource/ckeditor-standard".

End-user could use then config like:

{
	"require": {
		"cksource/ckeditor-full": "4.*"
	}
}

We dont even need to host zip archives, since we may hotlink github archives.


Bower:

Currently we are able only to fetch ckeditor only by typing exact tag name, like following:

Bower install ckeditor#4.3.0/full

Any other method will not fetch CKEditor. In order to be able work with Bower we must change tag format to meet semver. Then we need to register it with bower register command.

I'll try to do some extra research if the Bower allows us to specify explicitly in the same fashion as Composer does in point b.

Last edited 10 years ago by Marek Lewandowski (previous) (diff)

comment:4 Changed 10 years ago by Marek Lewandowski

Unfortunately Bower does not give us so much options as Composer does.

comment:5 Changed 10 years ago by Marek Lewandowski

Status: assignedreview

Ok, I've created a script which will generate automatically json file for Composer, based on our tags in ckeditor-releases repository. Here is a sample output saved as packages.json.

To play around by yourself:

  1. download Composer
  2. download attached packages.json file
  3. place it somewhere, where it will be accessible using http:// protocol, lets assume that its address will be http://localhost/composer/packages.json
  4. create a new directory at some other directory (there you will download CKEditor via Composer)
  5. create composer.json file with following content:
    {
      "repositories": [
        {
          "type": "composer",
          "url": "http://localhost/composer/"
        }
      ],
      "require": {
        "cksource/ckeditor": "<4.1.3,>=4.1"
      }
    }
    
  6. go to that directory with your command prompt and type
    composer update
    

As a resoult you should have following output

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing cksource/ckeditor (4.1.2)
    Downloading: 100%

If you will take closer look to require property in composer.json, you can use also cksource/ckeditor-full and others there. In case cksource/ckeditor it will point to standard preset.

Note: for simplicity sake, currently json hotlinks to github, we may use our own cdn there.

Last edited 10 years ago by Marek Lewandowski (previous) (diff)

Changed 10 years ago by Marek Lewandowski

Attachment: packages.json added

packages.json

comment:6 Changed 10 years ago by Marek Lewandowski

Mentioned script added to tools repository in branch t/11279.

comment:7 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy