-
Notifications
You must be signed in to change notification settings - Fork 208
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
docs: add documentation about using @open-wc #2906
Conversation
Branch Preview |
Tachometer resultsCurrently, no packages are changed by this PR... |
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.
Couple of small notes.
npm init @open-wc | ||
``` | ||
|
||
Once you do that, `@open-wc` will give you a few configuration options. You'll want to set up your project as a Web Component and allow it to use typescript. When it asks you what features to add, say "yes" to all of them--we'll explain how to set them up to be more compatible with SWC in this guide. SWC uses `yarn` to manage its package dependencies, so you can go ahead and choose that one, as well. |
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.
Once you do that, `@open-wc` will give you a few configuration options. You'll want to set up your project as a Web Component and allow it to use typescript. When it asks you what features to add, say "yes" to all of them--we'll explain how to set them up to be more compatible with SWC in this guide. SWC uses `yarn` to manage its package dependencies, so you can go ahead and choose that one, as well. | |
Once you do that, `@open-wc` will give you a few configuration options. You'll want to set up your project as a Web Component and allow it to use typescript. When it asks you what features to add, say "yes" (with the Space Bar, not the Enter key) to all of them--we'll explain how to set them up to be more compatible with SWC in this guide. SWC uses `yarn` to manage its package dependencies, so you can go ahead and choose that one, as well. |
This is a common mistake with that generator, not sure if it's worth bringing up here, but it could be helpful.
Also create a file in your root called `.prettierignore`, and in it, put: | ||
|
||
``` | ||
node_modules |
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.
This seems like it's the default... https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore should we leave this out?
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.
There wasn't a prettierignore in the generated project, so I assumed I should go all the way with it and add one. Good to see the default though. I can take it out.
@@ -0,0 +1,108 @@ | |||
--- |
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.
This content begs the question of whether we should contribute back to the generator and/or build/extend our own, but it's great for now, as that's more work than we want to pick up right now. However, the second question in this issue aligns really closely with goals or our project if we ever decide to go down that path.
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.
Ooh, great catch. I like the way you think!
beb4ca5
to
ead988b
Compare
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!
Description
I added some documentation about open-wc. Mainly just a line in the getting started that links to the more expository stuff about what to add to the project. This is pretty verbose but I wrote it in a way that would hopefully be understandable to anyone and a little hand-holdy, which I prefer lol. Let me know if I need to add more or less or if i said something incorrect!
Related issue(s)
Motivation and context
Improving the user experience
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.