[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [REF] Enable multi-repository support with Packagist.org, Asset-Packagist.org, ...
"SoftStart Code \(@softstartcode\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <689e70fd166ab_2c81ba28907fb@gitlab-sidekiq-low-urgency-cpu-bound-v2-56796cf4dc-n49g4.mail> |
SoftStart Code pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
2bd5701c by Sandeep D at 2025-08-14T23:21:42+00:00
[REF] Enable multi-repository support with Packagist.org, Asset-Packagist.org,...
---
* [REF] Enable multi-repository support with Packagist.org, Asset-Packagist.org, and composer.tiki.org
See merge request tikiwiki/tiki!8207
- - - - -
6 changed files:
- .gitlab-ci.yml
- composer.json.dist
- − doc/devtools/check_composer_dist_urls.php
- doc/devtools/update_vendor_bundled.php
- vendor_bundled/composer.json
- vendor_bundled/composer.lock
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -327,7 +327,6 @@ composer-validates:
script:
- composer -V | grep "version 2" || composer self-update --2
- composer validate -d vendor_bundled --no-check-all
- - php doc/devtools/check_composer_dist_urls.php
#This tests if composer COULD update the current composer.lock (it is coherent and installable). This is important because a developer wanting to update or add a dependency wouldn't be able to do so without figuring out why a composer.lock cannot be generated even before his changes.
#What we want to know is if a developer could successfully generate a new composer.lock file to update minor versions, or when adding dependencies. Not if he could generate a minimal-impact composer.lock file with composer update --lock on stable branches, which is much harder, and not necessary for the master branch.
=====================================
composer.json.dist
=====================================
@@ -17,6 +17,10 @@
}
},
"repositories": [
+ {
+ "type": "composer",
+ "url": "https://packagist.org"
+ },
{
"type": "composer",
"url": "https://composer.tiki.org"
=====================================
doc/devtools/check_composer_dist_urls.php deleted
=====================================
@@ -1,40 +0,0 @@
-<?php
-
-// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
-//
-// All Rights Reserved. See copyright.txt for details and a complete list of authors.
-// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-
-$composerLockPath = __DIR__ . '/../../vendor_bundled/composer.lock';
-
-if (! file_exists($composerLockPath)) {
- echo "composer.lock not found" . PHP_EOL;
- exit(1);
-}
-
-$composerLock = json_decode(file_get_contents($composerLockPath));
-$packages = array_merge($composerLock->packages ?? [], $composerLock->{'packages-dev'} ?? []);
-$invalidPackages = [];
-
-foreach ($packages as $package) {
- $isValid = empty($package->dist->url) || strtolower($package->type) === 'metapackage' || strncmp('https://composer.tiki.org', $package->dist->url, 25) === 0;
-
- if (! $isValid) {
- $invalidPackages[] = [
- 'name' => $package->name,
- 'url' => $package->dist->url ?? 'N/A'
- ];
- }
-}
-
-if (empty($invalidPackages)) {
- echo "Success: All packages dist.url in vendor_bundled/composer.lock points to https://composer.tiki.org." . PHP_EOL;
- exit(0);
-} else {
- echo "Fail: Some packages in vendor_bundled/composer.lock are using urls that do not point to https://composer.tiki.org" . PHP_EOL;
- foreach ($invalidPackages as $package) {
- echo "Package: {$package['name']}, dist.url: {$package['url']}" . PHP_EOL;
- }
- echo "You will need to first add the packages to doc/devtools/satis.json so they are available in https://composer.tiki.org" . PHP_EOL;
- exit(1);
-}
=====================================
doc/devtools/update_vendor_bundled.php
=====================================
@@ -43,28 +43,6 @@ $final_md5 = md5_file($composerLock);
printf('Getting md5 from %s after composer update...' . PHP_EOL . 'result: %s' . PHP_EOL, $composerLock, $final_md5);
if ($initial_md5 !== $final_md5) {
- $jsonContent = json_decode(file_get_contents($composerLock));
-
- if (! empty($jsonContent->packages)) {
- $errors = [];
- foreach ($jsonContent->packages as $package) {
- if (! empty($package->type) && $package->type === "metapackage") {
- continue; // metapackage is a empty package and does not have dist.url
- }
- if (strrpos($package->dist->url, 'https://composer.tiki.org') !== 0) {
- $errors[] = "Package: " . $package->name . ", dist.url: " . $package->dist->url;
- }
- }
- if (count($errors)) {
- echo PHP_EOL;
- foreach ($errors as $error) {
- echo $error . PHP_EOL;
- }
- echo PHP_EOL . "Error: composer.lock might contain packages from unverified sources. Aborting." . PHP_EOL . PHP_EOL;
- exit(1);
- }
- }
-
printf("Vendor bundled dependencies updated");
} else {
printf("Nothing to be done...");
=====================================
vendor_bundled/composer.json
=====================================
@@ -304,7 +304,7 @@
"mikey179/vfsstream": "^1",
"overtrue/phplint": "^9.0.4",
"phpcompatibility/php-compatibility": "^10.x-dev",
- "phpcsstandards/phpcsutils": "^1.0.0-alpha3",
+ "phpcsstandards/phpcsutils": "^1.1.0",
"phpstan/phpstan": "^1.10.57",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpunit/phpunit": "10.5.26",
@@ -449,14 +449,57 @@
"test": "php ../lib/test/phpunit.php -c phpunit.xml.dist --colors=always"
},
"repositories": {
- "tiki.org": {
+ "packagist.org": {
"type": "composer",
- "url": "https://composer.tiki.org",
- "canonical": true
+ "url": "https://packagist.org",
+ "exclude": [
+ "pear/text_wiki_mediawiki",
+ "itsjavi/bootstrap-colorpicker",
+ "league/commonmark"
+ ]
},
"asset-packagist.org": {
"type": "composer",
"url": "https://asset-packagist.org"
+ },
+ "tiki.org": {
+ "type": "composer",
+ "url": "https://composer.tiki.org",
+ "canonical": false,
+ "only": [
+ "simile_timeline/simile_timeline",
+ "openannotation/annotator",
+ "jquery-plugins/reflection-jquery",
+ "jquery/jquery-sheet",
+ "umakantp/smartylint",
+ "bower-asset/wodo.texteditor",
+ "pear/text_wiki_mediawiki",
+ "avianey/jqdoublescroll",
+ "codemirror/codemirror",
+ "css-tricks/anythingslider-themes",
+ "jquery-plugins/anythingslider",
+ "jquery-plugins/async",
+ "jquery-plugins/colorbox",
+ "jquery-plugins/fitvidjs",
+ "jquery-plugins/galleriffic",
+ "jquery-plugins/infinitecarousel",
+ "jquery-plugins/jquery-json",
+ "jquery-plugins/nestedsortable",
+ "jquery-plugins/tagcanvas",
+ "jquery-plugins/treetable",
+ "jquery-plugins/zoom",
+ "jquery/jquery-timepicker-addon",
+ "jquery/minicart",
+ "jquery/photoswipe",
+ "mrrio/jspdf",
+ "openlayers/openlayers",
+ "rangy/rangy",
+ "sam152/javascript-equal-height-responsive-rows",
+ "svg-edit/svg-edit",
+ "walkermatt/ol-layerswitcher",
+ "itsjavi/bootstrap-colorpicker",
+ "league/commonmark"
+ ]
}
}
}
=====================================
vendor_bundled/composer.lock
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2bd5701c3aadc99c513c2eaf66177bdfd1a7a1b7
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2bd5701c3aadc99c513c2eaf66177bdfd1a7a1b7
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs