Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#126): add tool to generate stories #283

Closed
wants to merge 2 commits into from

Conversation

yoannfleurydev
Copy link
Member

@yoannfleurydev yoannfleurydev commented Sep 8, 2022

This PR is a start for the #126 discussion.

Kapture.2022-09-08.at.23.39.34.mp4

@yoannfleurydev yoannfleurydev added the enhancement New feature or request label Sep 8, 2022
@yoannfleurydev yoannfleurydev self-assigned this Sep 8, 2022
@vercel
Copy link

vercel bot commented Sep 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
start-ui ✅ Ready (Inspect) Visit Preview Sep 13, 2022 at 0:27AM (UTC)

@yoannfleurydev yoannfleurydev force-pushed the feat/plop-script-for-stories branch from 1282133 to 23ceacf Compare September 13, 2022 12:21
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Jessy-BAER
Copy link
Contributor

if i select a component without a index.tsx filename

$ plop story
? Component name for story src/app/auth/PageLogin.tsx
✔  ++ /src/app/auth/docs.stories.tsx
Done in 26.97s.

the result is not correct

import React from 'react';
import { ComponentMeta } from '@storybook/react';

import { Auth } from '@/app/auth';

export default {
  title: 'App/Auth',
} as ComponentMeta<typeof Auth>;

export const Default = () => (
  <Auth />
)

@@ -26,6 +26,7 @@
"static:serve": "yarn static:build && npx servor out app.html 5000",
"theme:generate-typing": "chakra-cli tokens ./src/theme/theme.ts",
"theme:generate-icons": "svgr --config-file src/components/Icons/svgr.config.js src/components/Icons/svg-sources",
"new:story": "plop story",
Copy link
Contributor

@DecampsRenan DecampsRenan Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have done something like this:

Suggested change
"new:story": "plop story",
"generate": "plop",

Here we create an alias of plop, so we can do the following commands without to define new scripts in package.json:

yarn generate component
yarn generate page

We could have use plop, but I personally don't like yarn plop component because it doesn't mean anything ^^

@yoannfleurydev
Copy link
Member Author

Just a thought: I have to be honest, I'm not a huge fan anymore of that PR.

  1. We already have a lot to maintain, I'm not sure adding new feature like that is that useful to everyone.
  2. This could be done through Start UI documentation by documenting how to add useful snippets in IDEs
  3. Generators is what we want to avoid providing Start UI
  4. Mixing JS (plopfile config) with TS (all the rest) is not that great even if they are not related.

@DecampsRenan
Copy link
Contributor

Closed for all the reasons above

@yoannfleurydev yoannfleurydev deleted the feat/plop-script-for-stories branch June 9, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants