-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
CLI: Add init support for qwik projects #20411
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @literalpie ! Happy new year!
Thanks so much for this PR. A bunch of of us have been off for the holidays, so we haven't had a chance to discuss this yet.
At first glance, your approach seems fine to me. Main question is what are the criteria to add something to the CLI & that's what we'll discuss this week & get back to you on. If we do accept this, there's probably some cleanup we should do on the base generator before merging.
@literalpie Do you think we could have short meeting about this PR some day this or next week? Reason being: We're worried that the storybook team will be on the hook for supporting qwik, when no-one on the team really knows how it works (yet). I'd like to gauge if you have interest in assisting with that support. Alternatively we discussed at the triage meeting last Monday that we might modify the storybook CLI to accept a CLI-flag to pass an extension package. Here's 1 unpolished idea: Meaning the storybook CLI doesn't need to know about qwik at all, what it knows instead it to call another package a certain way, that does the proper setup. Like I said, we're worried about over-extending ourselves and declaring support on things we know too little about, and have too few maintainers for. Changing gears to make the storybook init command extendable this way would remedy this risk for us. Would love to hear your thoughts on this, either here in text, but I'm also very open to discussing this in a face-to-face meeting: |
@ndelangen thanks for the response. I'll pick a time in your calendar for us to meet. |
Awesome! Note that we could still test the Qwik framework in the monorepo even if it was located in its own repo/package namespace/etc. We're not quite set up for that yet, but we could make that happen if it makes sense. Obviously not as nice as just having it in the monorepo, but I think we're pretty firm on the idea that new frameworks should start somewhere else (exactly where is TBD) and then graduate to the monorepo. (We'll probably even be applying that policy to our own packages once we figure out the exact policy & build a little infrastructure to support it) |
@literalpie do you think you could get this PR green. We've spoken amonst the team, and have agreed to let PRs adding templates to Do know that we plan to do a refactor of the storybook CLI after 7.0 has been released, and so this code will likely eventually be moved out again, when that makes sense. But right now, this can be moved forward! Let's get it green! (please merge in |
Yes, I'll try to get this green in the next few days! |
5ae7917
to
17ecf3a
Compare
@ndelangen it's green now! A couple catches to be aware of though:
I can try to address the second one, either in this PR or a followup, but I don't know what to do about the first. This might also throw of the CI process if it tries to test the framework integration. |
c13b04f
to
caa522f
Compare
adding I'm still having problems with the sandbox. I think I was wrong when I said the problem only happens once. This issue also affects the e2e tests for this sandbox. I believe the issue is that |
@literalpie shall we plan a pairing session to work on this? Seems we're close. I don't have solution in mind for the |
@ndelangen I think pairing on this would be helpful. I'll schedule a time with your calendar link above |
@ndelangen and I met, and getting e2e tests will require some changes that are out of scope of this PR. I'll add some code to exclude this sandbox from e2e tests and other parts of the sandbox setup that currently assume framework/renderer packages are inside the sb monorepo. Once that's done, the build should pass and we should be ready to merge! |
Works with this change in the storybook-framework-qwik project: literalpie/storybook-framework-qwik@3dca5b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job getting this working @literalpie @ndelangen !!! ❤️
One question before I merge. What's the plan for the sandbox. I was able to run it on my dev machine, and the CLI-generated stories work great.
However, I see errors like this with the sandbox template stories:
Is the plan to leave this inDevelopment
for the foreseeable future? Or do we plan to add this to our test suite soon? If so, do we have a plan for how we're going to deal with "external" frameworks in our Ecosystem CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this
@@ -364,6 +364,17 @@ const baseTemplates = { | |||
builder: '@storybook/builder-vite', | |||
}, | |||
}, | |||
'qwik-vite/default-ts': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to add this to export const daily
below? It's not currently getting run in CI.
@shilman the |
@shilman I understand your concern, but here's my reasoning: This is an internal maintenance issue, and not something the actual users of the CLI would ever run into. I mentioned to @literalpie that we should simply disable the extra stories for now; we'd be adding them back and enable e2e tests then. Let me know if you have any concerns with that. My goal was unblock the PR. |
@shilman I "filtered" out the storeis coming from addons and core (because they don't work) for now. I think we want to enable chromatic on this new sandbox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
What I did
I added a generator for the qwik framework. It points to my library outside of the storybook mono repo
storybook-framework-qwik
.How to test
If your answer is yes to any of these, please make sure to include it in your PR.
Open questions:
baseGenerator
to support the external framework?The Qwik SB framework currently fails if there are any MDX stories set. I need to find a way to remove the mdx stories from the generated main.js filefixedGenerating the repro template fails to launch storybook when it tries "storybook not found", but runningyarn storybook
manually afterwards works. I don't know why this is, and need to look into it more.