Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)).