Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itemconsulting/xp-storybook
Storybook integration with XP
https://github.com/itemconsulting/xp-storybook
Last synced: about 2 months ago
JSON representation
Storybook integration with XP
- Host: GitHub
- URL: https://github.com/itemconsulting/xp-storybook
- Owner: ItemConsulting
- License: mit
- Created: 2023-02-02T10:01:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T07:07:07.000Z (5 months ago)
- Last Synced: 2024-07-31T08:33:38.844Z (5 months ago)
- Language: Java
- Homepage:
- Size: 400 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Storybook Server integration for Enonic XP
This application integrates with [Storybook Server renderer](https://www.npmjs.com/package/@storybook/server) and can
render [Freemarker templates](https://github.com/tineikt/xp-lib-freemarker/) or [Thymeleaf templates](https://github.com/enonic/lib-thymeleaf) with the args from Storybook.[![](https://jitpack.io/v/no.item/xp-storybook.svg)](https://jitpack.io/#no.item/xp-storybook)
> [!CAUTION]
> This application should **never** be deployed in production! An attacker can use this application to render any content on your domain.## Configuration
You need to create a configuration file: **XP_HOME/config/no.item.storybook.cfg** with the following content:
```ini
iAmNotFoolishEnoughToDeployThisInProduction=true
xpResourcesDirPath=/home/ubuntu/code/my-xp-project/src/main/resources
renderMode=freemarker
```| Config key | Value |
|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `iAmNotFoolishEnoughToDeployThisInProduction` | You will set this to `true` to indicate that you understand that this must **never be deployed** on a server open to the internet. |
| `xpResourcesDirPath` | The resources directory in your XP-project. This can also be a comma separated string with multiple resource directories (Freemarker only). |
| `renderMode` (optional) | If the template language can not be determined by the file extension or `renderMode` query parameter, this fallback value will be used. Legal options are: `freemarker` or `thymeleaf` |## Getting started
You will find information on how to set up your project in the [xp-storybook-utils documentation](https://github.com/ItemConsulting/xp-storybook-utils).
## Deploying
### Building
To build he project run the following code
```bash
enonic project build
```### Deploy locally
Deploy locally for testing purposes:
```bash
enonic project deploy
```## Deploy to Jitpack
Go to the [Jitpack page for xp-storybook](https://jitpack.io/#no.item/xp-storybook) to deploy from Github (after
[creating a new versioned release](https://github.com/ItemConsulting/xp-storybook/releases/new)).