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

docs: add documentation about using @open-wc #2906

Merged
merged 4 commits into from
Feb 7, 2023

Conversation

najikahalsema
Copy link
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

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.

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Branch Preview

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Tachometer results

Currently, no packages are changed by this PR...

Copy link
Contributor

@Westbrook Westbrook left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

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?

Copy link
Collaborator Author

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 @@
---
Copy link
Contributor

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.

Copy link
Collaborator Author

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!

Copy link
Contributor

@Westbrook Westbrook left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@najikahalsema najikahalsema merged commit 67e8807 into main Feb 7, 2023
@najikahalsema najikahalsema deleted the halsema/open-wc-docs branch February 7, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants