Git Product home page Git Product logo

svelte-component-template's Introduction

svelte-component

๐Ÿ“‘ Template for a ready-to-publish Svelte component.


A template for a ready-to-publish Svelte component. Makes use of Sveltekit's packaging feature.

Get started

You can use GitHub's handy "Use this template" feature, which opens a new repo based on this template. You could do this manually as well:

# Clone the repo
git clone https://github.com/himynameisdave/svelte-component-template

# Rename it
mv ./svelte-component-template ./svelte-my-component

# Change into that dir
cd ./svelte-my-component

# Remove the git history for this template
rm -rf ./.git/

# Start a new git history
git init

# Add the changes
git add .

# Commit them
git commit -m "โœจ Initial commit"

Developing

For building your component/library, you can mostly just follow the guidelines outlined in Sveltekit's packaging documentation.

The best part about this approach is that you get a "playground" to test your component: everything in lib/routes/ operates like a typical Sveltekit app, and you can pull in your component to test here in the browser.

Testing

This is set up to use vitest for unit testing and playwright for integration testing. Playwright tests will run against the lib/routes/ project.

Linting is handled by eslint-config-himynameisdave.

Publishing

You can publish your component/library to NPM via the release command:

# Should use npm instead of yarn for this
npm run release

This will first build your package and test that everything is ready to publish. You will be prompted for info about the release, including your NPM 2FA password.


โœŒ๏ธ Built by Dave Lunny.

svelte-component-template's People

Contributors

himynameisdave avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.