diff --git a/blog/2026-03-20-storyblok-adapters.mdx b/blog/2026-03-20-storyblok-adapters.mdx index 225a354..6dacba4 100644 --- a/blog/2026-03-20-storyblok-adapters.mdx +++ b/blog/2026-03-20-storyblok-adapters.mdx @@ -32,6 +32,6 @@ The Storyblok docs now include a complete guide for the adapter-based setup. [7]: /docs/php/symfony/storyblok/more-features/id-slug-mapper [8]: /docs/php/symfony/storyblok/more-features/request-validator [9]: /docs/php/symfony/storyblok/more-features/backend-edit-url-helper -[10]: /docs/php/symfony/storyblok/definitions-synced-event +[10]: /docs/php/symfony/storyblok/component-sync#definitions-synced-event [12]: /docs/php/symfony/storyblok/asset-proxy [13]: /docs/php/symfony/storyblok/more-features diff --git a/blog/2026-08-18-hosting-storyblok.mdx b/blog/2026-08-18-hosting-storyblok.mdx new file mode 100644 index 0000000..1b30813 --- /dev/null +++ b/blog/2026-08-18-hosting-storyblok.mdx @@ -0,0 +1,14 @@ +--- +title: "Storyblok & Hosting Bundle Updates" +authors: [jannik] +tags: [symfony, storyblok, hosting] +--- + +The hosting bundle now has `deploy-container` and `deploy-app` hooks. [Read the docs to understand the difference][1]. + +The first usage of `deploy-app` hooks is in the Storyblok bundle: it now has [automatic component sync][2]. + + + +[1]: /docs/php/symfony/hosting/#deploy-app-vs-container +[2]: /docs/php/symfony/storyblok/component-sync#automatic-sync diff --git a/docs/php/library/html-builder/index.mdx b/docs/php/library/html-builder/index.mdx index a6c8e29..6c8f04c 100644 --- a/docs/php/library/html-builder/index.mdx +++ b/docs/php/library/html-builder/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # HTML Builder diff --git a/docs/php/library/lenient-front-matter/index.mdx b/docs/php/library/lenient-front-matter/index.mdx index 110d8d2..1cbb372 100644 --- a/docs/php/library/lenient-front-matter/index.mdx +++ b/docs/php/library/lenient-front-matter/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Lenient Front Matter diff --git a/docs/php/symfony/bundle-helpers/index.mdx b/docs/php/symfony/bundle-helpers/index.mdx index 9888413..81f8a8c 100644 --- a/docs/php/symfony/bundle-helpers/index.mdx +++ b/docs/php/symfony/bundle-helpers/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Bundle Helpers diff --git a/docs/php/symfony/cli/index.mdx b/docs/php/symfony/cli/index.mdx index e8ff73b..bbff506 100644 --- a/docs/php/symfony/cli/index.mdx +++ b/docs/php/symfony/cli/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # CLI diff --git a/docs/php/symfony/embed-helpers/index.mdx b/docs/php/symfony/embed-helpers/index.mdx index 16ea1d1..e9a0e89 100644 --- a/docs/php/symfony/embed-helpers/index.mdx +++ b/docs/php/symfony/embed-helpers/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Embed Helpers diff --git a/docs/php/symfony/feature-flags/index.mdx b/docs/php/symfony/feature-flags/index.mdx index 7487c56..ce29dc0 100644 --- a/docs/php/symfony/feature-flags/index.mdx +++ b/docs/php/symfony/feature-flags/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Feature Flags diff --git a/docs/php/symfony/hosting/index.mdx b/docs/php/symfony/hosting/index.mdx index f1d13a2..8b49d2a 100644 --- a/docs/php/symfony/hosting/index.mdx +++ b/docs/php/symfony/hosting/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Hosting @@ -126,10 +126,11 @@ These are called using the console commands: ```shell bin/console hosting:hook:build -bin/console hosting:hook:deploy +bin/console hosting:hook:deploy-container +bin/console hosting:hook:deploy-app ``` -You can integrate into them by implementing the `BuildHookInterface` or `DeployHookInterface` interfaces respectively. Use autoconfiguration, then everything works out-of-the-box. +You can integrate into them by implementing the `BuildHookInterface`, `DeployContainerHookInterface` or `DeployAppHookInterface` interfaces respectively. Use autoconfiguration, then everything works out-of-the-box. Every task has basically a label and a callback that can perform certain tasks: @@ -154,6 +155,13 @@ class MyBuildTask implements BuildHookInterface } ``` +#### Deploy App vs Container + +The `deploy-container` hook is for deploying a single container. An application can consist of multiple containers (like hub and worker) and this deploy task should run in every container on every start. + +The `deploy-app` hook however is for the init container in Kubernetes. It should run exactly once on every app deployment (and not per container). + + ### App Validation App validation is a CLI command intended to be used in your CI, where your app can verify that the app is internally configured correctly. diff --git a/docs/php/symfony/rad/index.mdx b/docs/php/symfony/rad/index.mdx index c7772e4..f54077c 100644 --- a/docs/php/symfony/rad/index.mdx +++ b/docs/php/symfony/rad/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # RAD Bundle diff --git a/docs/php/symfony/simple-normalizer/index.mdx b/docs/php/symfony/simple-normalizer/index.mdx index 3fb9bd6..5028624 100644 --- a/docs/php/symfony/simple-normalizer/index.mdx +++ b/docs/php/symfony/simple-normalizer/index.mdx @@ -1,5 +1,5 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; -import {AddedBadge} from "../../../../src/components/AddedBadge"; +import {LinkList} from "@components/Link/LinkList"; +import {AddedBadge} from "@components/AddedBadge"; # Simple Normalizer diff --git a/docs/php/symfony/snail/index.mdx b/docs/php/symfony/snail/index.mdx index fb76517..779f9bd 100644 --- a/docs/php/symfony/snail/index.mdx +++ b/docs/php/symfony/snail/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Snail diff --git a/docs/php/symfony/storyblok/cli.mdx b/docs/php/symfony/storyblok/cli.mdx index db0054e..cc9ead5 100644 --- a/docs/php/symfony/storyblok/cli.mdx +++ b/docs/php/symfony/storyblok/cli.mdx @@ -55,4 +55,4 @@ You can pass `--force` to automatically confirm the command. This can be used to ::: On successful sync, the bundle dispatches `StoryblokDefinitionsSyncedEvent`. -See [Definitions Synced Event](./definitions-synced-event) for listener setup. +See [Definitions Synced Event](./component-sync#definitions-synced-event) for listener setup. diff --git a/docs/php/symfony/storyblok/component-sync.mdx b/docs/php/symfony/storyblok/component-sync.mdx new file mode 100644 index 0000000..a9534b3 --- /dev/null +++ b/docs/php/symfony/storyblok/component-sync.mdx @@ -0,0 +1,67 @@ +import {AddedBadge} from "@components/AddedBadge"; + +# Component Sync + +## Automatic Sync + + + +The Storyblok bundle integrates natively with the [hosting bundle] and offers an automatic sync when doing an app deployment: + +```shell +bin/console hosting:hook:deploy-app +``` + +Before it actually syncs the components to Storyblok however, you need to enable the environments where the automatic sync is enabled: + +```yaml title="conf/packages/storyblok.yaml" +storyblok: + sync_definitions_on_app_deploy: + staging: false + production: true +``` + +With this config the automatic sync is only enabled when deploying the app on production.[^1] + + +## Manual Sync + +You can also manually sync the components using the CLI: + +```shell +bin/console storyblok:definitions:sync +``` + + +## Definitions Synced Event + +After a successful `storyblok:definitions:sync`, the bundle dispatches `StoryblokDefinitionsSyncedEvent`. + +### Event Data + +The event provides: + +- `io`: `TorrStyle` instance used by the sync command. +- `adapter`: the adapter that was synced. + +### Listener Example + +```php +use Symfony\Component\EventDispatcher\Attribute\AsEventListener; +use Torr\Storyblok\Event\StoryblokDefinitionsSyncedEvent; + +#[AsEventListener] +public function onDefinitionsSynced (StoryblokDefinitionsSyncedEvent $event) : void +{ + $event->io->writeln("Run post-sync work..."); + $event->adapter->managementApi; +} +``` + +### Notes + +- If multiple adapters are synced in one command run, one event is dispatched per adapter. +- The event is only dispatched on successful sync. + +[hosting bundle]: /docs/php/symfony/hosting/ +[^1]: There is also a shortcut form `sync_definitions_on_app_deploy: false|true` that sets both settings at the same time. diff --git a/docs/php/symfony/storyblok/definitions-synced-event.mdx b/docs/php/symfony/storyblok/definitions-synced-event.mdx deleted file mode 100644 index 70fa956..0000000 --- a/docs/php/symfony/storyblok/definitions-synced-event.mdx +++ /dev/null @@ -1,29 +0,0 @@ -# Definitions Synced Event - -After a successful `storyblok:definitions:sync`, the bundle dispatches `StoryblokDefinitionsSyncedEvent`. - -## Event Data - -The event provides: - -- `io`: `TorrStyle` instance used by the sync command. -- `adapter`: the adapter that was synced. - -## Listener Example - -```php -use Symfony\Component\EventDispatcher\Attribute\AsEventListener; -use Torr\Storyblok\Event\StoryblokDefinitionsSyncedEvent; - -#[AsEventListener] -public function onDefinitionsSynced (StoryblokDefinitionsSyncedEvent $event) : void -{ - $event->io->writeln("Run post-sync work..."); - $event->adapter->managementApi; -} -``` - -## Notes - -- If multiple adapters are synced in one command run, one event is dispatched per adapter. -- The event is only dispatched on successful sync. diff --git a/docs/php/symfony/storyblok/index.mdx b/docs/php/symfony/storyblok/index.mdx index 3220ab2..0e582ea 100644 --- a/docs/php/symfony/storyblok/index.mdx +++ b/docs/php/symfony/storyblok/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Storyblok @@ -53,4 +53,4 @@ Continue with the [adapter guide](./adapters) for setup, usage and configuration The Storyblok bundle dispatches these events: - `StoryblokWebhookEvent` for incoming Storyblok webhooks ([Webhook docs](./webhook)). -- `StoryblokDefinitionsSyncedEvent` after successful component sync ([Definitions Synced Event](./definitions-synced-event)). +- `StoryblokDefinitionsSyncedEvent` after successful component sync ([Definitions Synced Event](./component-sync#definitions-synced-event)). diff --git a/docs/php/symfony/task-manager/index.mdx b/docs/php/symfony/task-manager/index.mdx index 1e10457..4717662 100644 --- a/docs/php/symfony/task-manager/index.mdx +++ b/docs/php/symfony/task-manager/index.mdx @@ -1,5 +1,5 @@ -import {LinkList} from "../../../../src/components/Link/LinkList"; -import {AddedBadge} from "../../../../src/components/AddedBadge"; +import {LinkList} from "@components/Link/LinkList"; +import {AddedBadge} from "@components/AddedBadge"; # Task Manager diff --git a/docs/php/tooling/janus-php.mdx b/docs/php/tooling/janus-php.mdx index ac4b39c..1b15be2 100644 --- a/docs/php/tooling/janus-php.mdx +++ b/docs/php/tooling/janus-php.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Janus PHP diff --git a/docs/php/tooling/php-cs-fixer.mdx b/docs/php/tooling/php-cs-fixer.mdx index e85b971..0cbe303 100644 --- a/docs/php/tooling/php-cs-fixer.mdx +++ b/docs/php/tooling/php-cs-fixer.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # PHP-CS-Fixer diff --git a/docs/ts-scss/atlantis/index.mdx b/docs/ts-scss/atlantis/index.mdx index 3032e1f..45bd709 100644 --- a/docs/ts-scss/atlantis/index.mdx +++ b/docs/ts-scss/atlantis/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Atlantis diff --git a/docs/ts-scss/dune/index.mdx b/docs/ts-scss/dune/index.mdx index 2372c85..231f23b 100644 --- a/docs/ts-scss/dune/index.mdx +++ b/docs/ts-scss/dune/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Dune diff --git a/docs/ts-scss/janus-ts/index.mdx b/docs/ts-scss/janus-ts/index.mdx index a42d0de..bdf4e7d 100644 --- a/docs/ts-scss/janus-ts/index.mdx +++ b/docs/ts-scss/janus-ts/index.mdx @@ -1,4 +1,4 @@ -import {LinkList} from "../../../src/components/Link/LinkList"; +import {LinkList} from "@components/Link/LinkList"; # Janus TS diff --git a/docusaurus.config.js b/docusaurus.config.js index 9b9b372..878a8eb 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -14,6 +14,22 @@ const config = { plugins: [ 'docusaurus-plugin-sass', + function () + { + return { + name: "tsconfig-paths", + configureWebpack () + { + return { + resolve: { + tsConfig: { + configFile: require.resolve("./tsconfig.json"), + }, + }, + }; + }, + }; + }, ], markdown: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3610e3..01c0272 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7369,7 +7369,7 @@ snapshots: react: 19.1.0 react-dom: 19.1.0(react@19.1.0) schema-dts: 1.1.5 - tslib: 2.6.3 + tslib: 2.8.1 utility-types: 3.11.0 webpack: 5.98.0(@swc/core@1.10.17) transitivePeerDependencies: @@ -7723,7 +7723,7 @@ snapshots: prism-react-renderer: 2.4.1(react@19.1.0) react: 19.1.0 react-dom: 19.1.0(react@19.1.0) - tslib: 2.6.3 + tslib: 2.8.1 utility-types: 3.11.0 transitivePeerDependencies: - '@swc/core' @@ -7867,17 +7867,17 @@ snapshots: '@emnapi/core@1.10.0': dependencies: '@emnapi/wasi-threads': 1.2.1 - tslib: 2.6.3 + tslib: 2.8.1 optional: true '@emnapi/runtime@1.10.0': dependencies: - tslib: 2.6.3 + tslib: 2.8.1 optional: true '@emnapi/wasi-threads@1.2.1': dependencies: - tslib: 2.6.3 + tslib: 2.8.1 optional: true '@hapi/hoek@9.3.0': {} @@ -8597,7 +8597,7 @@ snapshots: '@tybys/wasm-util@0.10.2': dependencies: - tslib: 2.6.3 + tslib: 2.8.1 optional: true '@types/acorn@4.0.6': diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 7f3c60d..f3c129b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -6,7 +6,7 @@ import React from 'react'; import clsx from 'clsx'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Layout from '@theme/Layout'; -import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import HomepageFeatures from '@components/HomepageFeatures'; function HomepageHeader () diff --git a/tsconfig.json b/tsconfig.json index 5153f2d..73668b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,11 @@ "extends": "@tsconfig/docusaurus/tsconfig.json", "compilerOptions": { "baseUrl": ".", + "paths": { + "@components/*": [ + "./src/components/*" + ] + }, "plugins": [ { "name": "typescript-plugin-css-modules"