Sign in
Log inSign up
Piyush Sinha

97 likes

·

7.5K reads

11 comments

Braydon Coyer
Braydon Coyer
Dec 3, 2020

Excellent article. Thanks for sharing! Storybook FTW!

1
·
·1 reply
Piyush Sinha
Piyush Sinha
Author
·Dec 4, 2020

Thank you!

·
Kutlwano Tjabane
Kutlwano Tjabane
May 25, 2021

Dude, you're a life saver. Been through couple tutorials and yours gave me the Aha...moment. Excellent! Great job mate and thank you!!

1
·
·1 reply
Piyush Sinha
Piyush Sinha
Author
·May 25, 2021

Thanks Kutlwano. Glad you liked it!

·
Savio Martin
Savio Martin
May 26, 2021

Great blog!

1
·
·1 reply
Piyush Sinha
Piyush Sinha
Author
·May 26, 2021

Thanks Savio 😊

·
kwame porter robinson
kwame porter robinson
Jan 31, 2022

Love your tutorial, quick question: What is the difference between npm init @open-wc and npx sb init -t web_components?

1
·
·1 reply
Piyush Sinha
Piyush Sinha
Author
·Feb 8, 2022

As per my knowledge, npx sb init can't be used in an empty project. @open-wc is used to bootstrap an app just like create-react-app for Reactjs. You can either add demoing storybook or once @open-wc has generated an app, you can run npx sb init inside it.

·
kwame porter robinson
kwame porter robinson
Jan 29, 2022

Can you explain how you can create an empty project such that npm init @open-wc will write into it and the rest of your tutorial can be followed?

·
·2 replies
Piyush Sinha
Piyush Sinha
Author
·Jan 29, 2022

Create an empty directory and just run npm init @open-wc inside it.

·
kwame porter robinson
kwame porter robinson
Jan 31, 2022

Piyush Sinha Thanks!

For any other js newbs, I had to do:

mkdir my-button && cd my-button
npm init @open-wc

And answer with (question 6 begins with this tutorial)

* What would you like to do today? › Scaffold a new project
* What would you like to scaffold? › Web Component
* What would you like to add? ›  Demoing (storybook)
* Would you like to use typescript? › No
* What is the tag name of your web component? › my-button
* Do you want to write this file structure to disk? › Yes
* Do you want to install dependencies? › Yes, with npm
1
·