Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F41988814
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/_utils/templates/generate-compose-json.php b/_utils/templates/generate-compose-json.php
index f2d33ff..6f8d54b 100755
--- a/_utils/templates/generate-compose-json.php
+++ b/_utils/templates/generate-compose-json.php
@@ -1,95 +1,95 @@
#!/usr/bin/env php
<?php
# -------------------------------------------------------------
# Generate composer.json from packages metadata
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Keruald
# License: BSD-2-Clause
# Dependencies: symfony/yaml, keruald/omnitools
# -------------------------------------------------------------
use Symfony\Component\Yaml\Parser as YamlParser;
use Keruald\OmniTools\Collections\HashMap;
require_once __DIR__ . "/../../vendor/autoload.php";
# -------------------------------------------------------------
# Helper methods to build elements from metadata
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function getAutoload(array $packages_namespaces) : array {
return [
"psr-4" => HashMap::from($packages_namespaces)
->flatMap(fn($package, $ns) => [
$ns . '\\' => $package . "/src/",
$ns . '\\Tests\\' => $package . "/tests/",
])
->toArray()
];
}
function getReplace(array $packages) : array {
return HashMap::from($packages)
->mapValuesAndKeys(fn($v) => ["keruald/$v", "self.version"])
->toArray();
}
# -------------------------------------------------------------
# Template
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function run() : never {
$metadata = (new YamlParser())->parseFile("metadata.yml");
$flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
echo json_encode(getTemplate($metadata), $flags), "\n";
exit(0);
}
function getTemplate(array $metadata) : array {
return [
"name" => "keruald/keruald",
"type" => "library",
"description" => "Modular libraries to build frameworks and applications",
"keywords" => [
"framework",
"keruald",
],
"license" => "BSD-2-Clause",
"homepage" => "https://keruald.nasqueron.org",
"authors" => [
[
"name" => "Sébastien Santoro",
"email" => "dereckson@espace-win.org",
],
[
"name" => "Keruald contributors",
],
],
"require" => [
"ext-intl" => "*",
],
"require-dev" => [
"ext-mbstring" => "*",
"ext-mysqli" => "*",
"ext-xmlwriter" => "*",
"nasqueron/codestyle" => "^0.0.1",
"phan/phan" => "^5.3.1",
- "phpunit/phpunit" => "^9.5",
+ "phpunit/phpunit" => "^10.2",
"symfony/yaml" => "^6.0.3",
"squizlabs/php_codesniffer" => "^3.6",
],
"replace" => getReplace($metadata["packages"]),
"autoload" => getAutoload($metadata["packages_namespaces"]),
"scripts" => [
"lint-src" => "find */src -type f -name '*.php' | xargs -n1 php -l",
"lint-tests" => "find */tests -type f -name '*.php' | xargs -n1 php -l",
"test" => "vendor/bin/phpunit",
],
"minimum-stability" => "dev",
];
}
run();
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Aug 8, 09:00 (15 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3975882
Default Alt Text
(3 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment