Skip to content

Commit 4d90f22

Browse files
chore: enhance library skeleton readme with some library instructions (#9128)
* chore: enhance library skeleton readme with some library instructions * tweak * Update packages/create-svelte/shared/+skeletonlib/README.md Co-authored-by: gtmnayan <[email protected]> --------- Co-authored-by: gtmnayan <[email protected]>
1 parent e004a0c commit 4d90f22

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

Diff for: .changeset/curvy-lobsters-hug.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
chore: enhance library skeleton readme with some library instructions

Diff for: packages/create-svelte/shared/+skeletonlib/README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
6+
7+
## Creating a project
8+
9+
If you're seeing this, you've probably already done this step. Congrats!
10+
11+
```bash
12+
# create a new project in the current directory
13+
npm create svelte@latest
14+
15+
# create a new project in my-app
16+
npm create svelte@latest my-app
17+
```
18+
19+
## Developing
20+
21+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22+
23+
```bash
24+
npm run dev
25+
26+
# or start the server and open the app in a new browser tab
27+
npm run dev -- --open
28+
```
29+
30+
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31+
32+
## Building
33+
34+
To build your library:
35+
36+
```bash
37+
npm run package
38+
```
39+
40+
To create a production version of your showcase app:
41+
42+
```bash
43+
npm run build
44+
```
45+
46+
You can preview the production build with `npm run preview`.
47+
48+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
49+
50+
## Publishing
51+
52+
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53+
54+
To publish your library to [npm](https://www.npmjs.com):
55+
56+
```bash
57+
npm publish
58+
```

0 commit comments

Comments
 (0)