From 1370b54695c41a836a2d9547341156252edddbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 20 Nov 2024 18:55:13 +0100 Subject: [PATCH] Fix some issue with public website --- .github/workflows/ghpages.yaml | 2 - website/castor.php | 31 +++++++++++----- website/composer.json | 9 +---- website/composer.lock | 68 ++++++++++++++++------------------ 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ghpages.yaml b/.github/workflows/ghpages.yaml index a5f484d..7873a1d 100644 --- a/.github/workflows/ghpages.yaml +++ b/.github/workflows/ghpages.yaml @@ -34,8 +34,6 @@ jobs: castor website:install castor website:wasm:export --pack --build working-directory: ./website - env: - BASE_URL: "/${{ github.event.repository.name }}" - name: Upload Artifact uses: actions/upload-pages-artifact@v3 diff --git a/website/castor.php b/website/castor.php index d52ca96..7b70f42 100644 --- a/website/castor.php +++ b/website/castor.php @@ -12,6 +12,7 @@ use Castor\Attribute\AsTask; use Symfony\Component\Process\Process; +use function Castor\context; use function Castor\fs; use function Castor\io; use function Castor\run as do_run; @@ -19,15 +20,23 @@ #[AsTask(description: 'Install dependencies')] function install() { - io()->note('Installing dependencies'); + io()->title('Installing dependencies'); run(['composer', 'install', '--no-dev', '--optimize-autoloader']); } +#[AsTask(description: 'Update dependencies')] +function update() +{ + io()->title('Installing dependencies'); + + run(['composer', 'update', '--no-dev', '--optimize-autoloader']); +} + #[AsTask('wasm:build', description: 'Build the wasm-php binary')] function wasm_build() { - io()->note('Building wasm-php binary'); + io()->title('Building wasm-php binary'); $phpWasmDir = __DIR__ . '/vendor/soyuka/php-wasm'; run(['docker', 'buildx', 'bake'], path: $phpWasmDir); @@ -37,7 +46,7 @@ function wasm_build() #[AsTask('wasm:pack', description: 'Pack custom code')] function wasm_pack() { - io()->note('Packing custom code'); + io()->title('Packing custom code'); run(['docker', 'run', '-v', __DIR__ . ':/app', @@ -85,7 +94,7 @@ function wasm_export(bool $pack = false, bool $build = false) wasm_pack(); } - io()->note('Exporting wasm-php'); + io()->title('Exporting wasm-php'); fs()->remove(__DIR__ . '/public/build'); @@ -104,14 +113,18 @@ function wasm_export(bool $pack = false, bool $build = false) #[AsTask(description: 'Run the server')] function serve(string $address = 'localhost:9999') { - io()->note("Serving on http://{$address}"); + io()->title("Serving on http://{$address}"); run(['php', '-S', $address, '-t', 'public']); } -function run(array $command, ?string $path = __DIR__): Process +function run(array $command, string $path = __DIR__): Process { - return do_run($command, path: $path, timeout: 0, environment: [ - 'BUILDKIT_PROGRESS' => 'plain', - ]); + $context = context() + ->withWorkingDirectory($path) + ->withEnvironment([ + 'BUILDKIT_PROGRESS' => 'plain', + ]); + ; + return do_run($command, context: $context); } diff --git a/website/composer.json b/website/composer.json index a43a7fd..fa98eee 100644 --- a/website/composer.json +++ b/website/composer.json @@ -25,17 +25,10 @@ "reference": "main" } } - }, - { - "type": "path", - "url": "../", - "options": { - "symlink": false - } } ], "require": { - "jolicode/jolitypo": "*@dev", + "jolicode/jolitypo": "dev-main@dev", "soyuka/php-wasm": "dev-main@dev" }, "config": { diff --git a/website/composer.lock b/website/composer.lock index 05de9ef..77cb101 100644 --- a/website/composer.lock +++ b/website/composer.lock @@ -4,51 +4,46 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bd83b121bec50af7a6251777902ac045", + "content-hash": "ad472d050332e71b0836150ce6eea275", "packages": [ { "name": "jolicode/jolitypo", - "version": "dev-gh-pages", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/jolicode/JoliTypo.git", + "reference": "39ae0e3742371f33abce9601967b4f45818cbae0" + }, "dist": { - "type": "path", - "url": "..", - "reference": "ee29720c25dc76c7a7c899028252e4b4ea4474c3" + "type": "zip", + "url": "https://api.github.com/repos/jolicode/JoliTypo/zipball/39ae0e3742371f33abce9601967b4f45818cbae0", + "reference": "39ae0e3742371f33abce9601967b4f45818cbae0", + "shasum": "" }, "require": { "ext-mbstring": "*", "lib-libxml": "*", "org_heigl/hyphenator": "^2.6 || ^3.0", - "php": ">=7.4" + "php": ">=8.1" }, "conflict": { "ext-apc": "3.1.11" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.3.2", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.4.8 || ^6.0", - "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/yaml": "^4.4 || ^5.0 || ^6.0" + "friendsofphp/php-cs-fixer": "^3.49.0", + "symfony/framework-bundle": "^5.4 || ^6.4 || 7.0", + "symfony/phpunit-bridge": "^6.4.3", + "symfony/twig-bundle": "^5.4 || ^6.4 || 7.0", + "symfony/yaml": "^5.4 || ^6.4 || 7.0" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { "JoliTypo\\": "src/JoliTypo" } }, - "autoload-dev": { - "psr-4": { - "JoliTypo\\Tests\\": "tests/JoliTypo/Tests" - } - }, - "scripts": { - "test": [ - "vendor/bin/simple-phpunit" - ], - "cs": [ - "vendor/bin/php-cs-fixer fix" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -68,23 +63,24 @@ "smartquote", "typography" ], - "transport-options": { - "symlink": false, - "relative": true - } + "support": { + "issues": "https://github.com/jolicode/JoliTypo/issues", + "source": "https://github.com/jolicode/JoliTypo/tree/main" + }, + "time": "2024-03-18T09:34:00+00:00" }, { "name": "org_heigl/hyphenator", - "version": "v3.0.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/heiglandreas/Org_Heigl_Hyphenator.git", - "reference": "d8bcb8cefff21c9de3a77ec4de1750f0230a6494" + "reference": "a9b8d2524cbed19d507ef8bc780b8122689c02bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heiglandreas/Org_Heigl_Hyphenator/zipball/d8bcb8cefff21c9de3a77ec4de1750f0230a6494", - "reference": "d8bcb8cefff21c9de3a77ec4de1750f0230a6494", + "url": "https://api.github.com/repos/heiglandreas/Org_Heigl_Hyphenator/zipball/a9b8d2524cbed19d507ef8bc780b8122689c02bc", + "reference": "a9b8d2524cbed19d507ef8bc780b8122689c02bc", "shasum": "" }, "require": { @@ -121,9 +117,9 @@ ], "support": { "issues": "https://github.com/heiglandreas/Org_Heigl_Hyphenator/issues", - "source": "https://github.com/heiglandreas/Org_Heigl_Hyphenator/tree/v3.0.0" + "source": "https://github.com/heiglandreas/Org_Heigl_Hyphenator/tree/v3.1.0" }, - "time": "2022-05-21T08:58:29+00:00" + "time": "2024-02-12T14:32:13+00:00" }, { "name": "soyuka/php-wasm", @@ -145,7 +141,7 @@ }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" }