Skip to content

Commit 4cec2f8

Browse files
Warn against editing generated story files directly in docs
1 parent baaf462 commit 4cec2f8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

v2/site/docs/installation.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,18 @@ When the AgnosticUI CLI is updated (for example, when a new Storybook major is s
529529
530530
### Customizing Generated Stories
531531
532-
Generated story files are intentionally simple starting points. To customize a story without losing your changes on the next `--force` regeneration, copy the file and rename it:
532+
::: danger Do not edit generated story files directly
533+
Every `.stories.tsx` / `.stories.ts` file written by the CLI starts with an `AUTO-GENERATED` header. Editing these files directly will cause your changes to be silently overwritten the next time you run `npx agnosticui-cli storybook --force` or re-add a component with `--force`. There is no merge step — the file is replaced wholesale.
534+
:::
535+
536+
If you want to write custom stories, copy the file and give it a different name:
533537
534538
```
535-
Button/react/Button.stories.tsx # auto-generated, safe to overwrite
539+
Button/react/Button.stories.tsx # auto-generated, will be overwritten
536540
Button/react/Button.stories.custom.tsx # your customizations, never touched by CLI
537541
```
538542
539-
Storybook picks up both files automatically.
543+
Storybook picks up both files automatically, so your custom stories appear alongside the generated ones.
540544
541545
## TypeScript Configuration
542546

0 commit comments

Comments
 (0)