[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <688c7700e385b_2d1f2087c476f6@gitlab-sidekiq-low-urgency-cpu-bound-v2-78ddbdb4c5-mhkv7.mail>

SoftStart Code pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
16f428f6 by Sandeep D at 2025-08-01T08:05:08+00:00
[REF] Enable multi-repository support with Packagist.org, Asset-Packagist.org, and composer.tiki.org
---
* [UPD] Update content-hash in composer.lock

* [UPD] Revert package versions and references in composer.lock

* [FIX] Update content-hash in composer.lock to match the latest state

* [REF] Enable multi-repository support with Packagist, Asset Packagist, and composer.tiki.org

This MR is part of the investigation and transition process to evaluate and reduce reliance on composer.tiki.org and use packagist.org as the default package source.

See merge request tikiwiki/tiki!8045

- - - - -


5 changed files:

- 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:

=====================================
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
=====================================
@@ -430,9 +430,30 @@
         "test": "php ../lib/test/phpunit.php -c phpunit.xml.dist --colors=always"
     },
     "repositories": {
+        "packagist.org": {
+            "type": "composer",
+            "url": "https://packagist.org",
+            "exclude": [
+                "pear/text_wiki_mediawiki"
+            ]
+        },
         "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"
+            ]
         }
     }
 }


=====================================
vendor_bundled/composer.lock
=====================================
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "dcdc78a641dd32cd0991ec023c487be8",
+    "content-hash": "e969f13b27db7776b20eb762a8c493cb",
     "packages": [
         {
             "name": "amphp/amp",



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/16f428f6ea4f205b80e4feb2dfcb202d981559d6

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/16f428f6ea4f205b80e4feb2dfcb202d981559d6
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.