@techsup/tsui
v0.0.8
Published
Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
Readme
Svelte library
Everything you need to build a Svelte library, powered by sv.
Read more about creating a library in the docs.
Creating a project
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-appTo recreate this project with the same configuration:
# recreate this project
pnpm dlx [email protected] create --template library --types ts --add prettier tailwindcss="plugins:none" storybook --install pnpm tsupDeveloping
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --openEverything inside src/lib is part of your library, everything inside src/routes can be used as a showcase or preview app.
Building
To build your library:
npm packTo create a production version of your showcase app:
npm run buildYou can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.
Publishing NPM
Generate token
- bypass 2FA ✅
npm config set //registry.npmjs.org/:_authToken=Component setup
Create src/lib/component.svelte
Export at src/lib/index.ts => export { default as Component } from './component.svelte';
(first run npm publish --access public)
Publishing steps
pnpm buildnpm version minornpm loginnpm publish
