/vue-dummy-published-component

Dummy repo for a sample Vue component published to npm

Primary LanguageJavaScriptMIT LicenseMIT

vue-dummy-published-component

This is a sample boilerplate repo for a Vue component that you intend to publish to the NPM registry. It is based on the Packaging Vue Components for npm entry in the Vue Cookbook, and the associated vue-sfc-rollup GitHub repo.

What's Different About this Boilerplate?

This adds a few new features that you mind useful when creating a robust open-source Vue component (all of which you are welcome to change once you fork for your own purposes):

Getting Started

To get started with your own publishable component, I would start by copying it to your own new repo and then there's a few changes to make as well as some things to add that have been intentionally left out.

Things to Change

  • Update all relevant package.json fields (name, author, repository, etc.)
  • Modify the exported component name in rollup.config.js
  • Write your component, Unit tests, Stories, and E2E Tests!
  • Update the LICENSE.md file with the proper license and attribution

Things to Add

  • Add some docs for how users can file issues and contribute back to your open-source components. Check out the Mozilla Science Lab Post for ideas and examples
  • Don't forget to host your Storybook somewhere so users can access it. GitHub Pages is one potential solution.

Usage

# Build the component into dist/
npm run build

# Run unit tests
npm run test:unit

# Run Storybook
npm run storybook

# Build storybook into storybook-static/
npm run storybook:build

# Run E2E Tests against built Storybook
npm run test:e2e

Publishing to NPM

Please refer to the NPM documentation