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

Add parameter, loader and decorator stories to lib/store #19105

Merged
merged 15 commits into from
Sep 7, 2022

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Sep 5, 2022

Issue:

https://linear.app/chromaui/issue/SB-586/core-features-loaders-parameters-decorators

What I did

  • Set some patterns for lib/store stories
  • Added basic parameter/loader/decorator stories

What I didn't do

  • Pull renderer specific decorators stories into renderers/X. That can happen as part of removing the examples they are defined in.
  • Created stories for other lib/store features (e.g. args, export order, titles, etc) , will do in a second PR.

@tmeasday tmeasday added the maintenance User-facing maintenance tasks label Sep 5, 2022
@tmeasday
Copy link
Member Author

tmeasday commented Sep 5, 2022

@IanVS what is the "cwd" in a vite build? In this PR I add:

  config: ["../../code/lib/store/template/stories/preview.ts"],

To the react-vite sandbox's main.cjs. That file exists. It looks like maybe other references in this file are absolute, should we use an absolute path instead (it works, but we would prefer not to, I think)?

image

@IanVS
Copy link
Member

IanVS commented Sep 5, 2022

I think I'm missing a little context because I can't access linear. What is the reason for this PR? I'll take a look and see if I can figure out what's going on with vite. CWD should not be anything special in Vite, it's just where the command is run.

@tmeasday
Copy link
Member Author

tmeasday commented Sep 5, 2022

@IanVS we are in the process of converting all stories from the existing examples (e.g. offical-storybook) into these "generalized examples" that run inside sandboxes, so we can delete the examples.

In these examples that test core stuff, we'd like to add project-level annotations (parameters, etc) to test the inheritance works properly. So we wanted to add the ability to define a "config" file for any package (the store, or an addon) that defines stories for a sandbox (in a template/stories folder).

  • We add the stories via adding a directory like "../../../code/lib/store/template/stories" to main.js:stories.
  • I was trying to add the preview.ts (config) file via something similar: "../../code/lib/store/template/stories/preview.ts" in main.js:config.

That works in the WP sandboxes, but in the Vite ones, it throws the above error. If I replace with an absolute path, it works fine.

@shilman shilman self-assigned this Sep 7, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Not 100% sure I'm understanding all the path magic here, but the stories look great!!

@shilman shilman merged commit 4122627 into next Sep 7, 2022
@shilman shilman deleted the tom/sb-586-core-features-loaders-parameters branch September 7, 2022 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants