From 35f85aeec15ec70d4598ae30a35942c812047913 Mon Sep 17 00:00:00 2001 From: Jordan Wamser Date: Fri, 5 Jul 2024 01:13:16 -0500 Subject: [PATCH] [SensioLabs/Storybook-Bundle] create 0.1 recipe (#1623) * [SensioLabs/Storybook-Bundle] create 0.1 recipe * fix newline file requirements * fix yaml standards * fix yaml standards for bundle config * recipe only for Symfony 7 and up * add gitignore setup * update conflict statement --- .../0.1/config/packages/storybook.yaml | 5 ++++ .../0.1/config/routes/storybook.yaml | 2 ++ sensiolabs/storybook-bundle/0.1/manifest.json | 16 +++++++++++++ .../storybook-bundle/0.1/post-install.txt | 8 +++++++ .../0.1/stories/Components.stories.js | 24 +++++++++++++++++++ .../bundles/StorybookBundle/Preview.html.twig | 1 + 6 files changed, 56 insertions(+) create mode 100644 sensiolabs/storybook-bundle/0.1/config/packages/storybook.yaml create mode 100644 sensiolabs/storybook-bundle/0.1/config/routes/storybook.yaml create mode 100644 sensiolabs/storybook-bundle/0.1/manifest.json create mode 100644 sensiolabs/storybook-bundle/0.1/post-install.txt create mode 100644 sensiolabs/storybook-bundle/0.1/stories/Components.stories.js create mode 100644 sensiolabs/storybook-bundle/0.1/templates/bundles/StorybookBundle/Preview.html.twig diff --git a/sensiolabs/storybook-bundle/0.1/config/packages/storybook.yaml b/sensiolabs/storybook-bundle/0.1/config/packages/storybook.yaml new file mode 100644 index 00000000..d2c301d0 --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/config/packages/storybook.yaml @@ -0,0 +1,5 @@ +when@dev: + storybook: + sandbox: + allowedFunctions: + - 'dump' diff --git a/sensiolabs/storybook-bundle/0.1/config/routes/storybook.yaml b/sensiolabs/storybook-bundle/0.1/config/routes/storybook.yaml new file mode 100644 index 00000000..ecb526b1 --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/config/routes/storybook.yaml @@ -0,0 +1,2 @@ +storybook: + resource: '@StorybookBundle/config/routes.php' diff --git a/sensiolabs/storybook-bundle/0.1/manifest.json b/sensiolabs/storybook-bundle/0.1/manifest.json new file mode 100644 index 00000000..e5adb45d --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/manifest.json @@ -0,0 +1,16 @@ +{ + "bundles": { + "Storybook\\StorybookBundle": ["all"] + }, + "gitignore": [ + "/node_modules" + ], + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "stories/": "stories/", + "templates/": "templates/" + }, + "conflict": { + "symfony/framework-bundle": "<6.4" + } +} diff --git a/sensiolabs/storybook-bundle/0.1/post-install.txt b/sensiolabs/storybook-bundle/0.1/post-install.txt new file mode 100644 index 00000000..df1e4830 --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/post-install.txt @@ -0,0 +1,8 @@ + + What's next? + + + * Run your application: + 1. Initialize Storybook in your project: bin/console storybook:init command; + - This will create basic configuration files and add required dependencies to your package.json. + 2. Follow the instructions provided by the storybook:init command diff --git a/sensiolabs/storybook-bundle/0.1/stories/Components.stories.js b/sensiolabs/storybook-bundle/0.1/stories/Components.stories.js new file mode 100644 index 00000000..2721a961 --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/stories/Components.stories.js @@ -0,0 +1,24 @@ +import {twig} from "@sensiolabs/storybook-symfony-webpack5"; + +export default { + component: twig` +
Hello {{ name }}!
+ `, + args: { + name: 'World' + } +} + +export const Default = {}; + +export const John = { + args: { + name: 'John' + } +}; + +export const Jane = { + args: { + name: 'Jane' + } +}; diff --git a/sensiolabs/storybook-bundle/0.1/templates/bundles/StorybookBundle/Preview.html.twig b/sensiolabs/storybook-bundle/0.1/templates/bundles/StorybookBundle/Preview.html.twig new file mode 100644 index 00000000..b61728e9 --- /dev/null +++ b/sensiolabs/storybook-bundle/0.1/templates/bundles/StorybookBundle/Preview.html.twig @@ -0,0 +1 @@ +{% extends '@!Storybook/preview.html.twig' %}