Skip to content

Commit b378909

Browse files
initial commit
0 parents  commit b378909

23 files changed

+5041
-0
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
/dist
11+
12+
# OS
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Env
17+
.env
18+
.env.*
19+
!.env.example
20+
!.env.test
21+
22+
# Vite
23+
vite.config.js.timestamp-*
24+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/

.prettierrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": [
7+
"prettier-plugin-svelte"
8+
],
9+
"overrides": [
10+
{
11+
"files": "*.svelte",
12+
"options": {
13+
"parser": "svelte"
14+
}
15+
}
16+
]
17+
}

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Svelte library
2+
3+
Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4+
5+
Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6+
7+
## Creating a project
8+
9+
If you're seeing this, you've probably already done this step. Congrats!
10+
11+
```sh
12+
# create a new project in the current directory
13+
npx sv create
14+
15+
# create a new project in my-app
16+
npx sv create 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+
```sh
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+
```sh
37+
npm pack
38+
```
39+
40+
To create a production version of your showcase app:
41+
42+
```sh
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://svelte.dev/docs/kit/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+
```sh
57+
npm publish
58+
```

eslint.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import prettier from 'eslint-config-prettier';
2+
import { includeIgnoreFile } from '@eslint/compat';
3+
import js from '@eslint/js';
4+
import svelte from 'eslint-plugin-svelte';
5+
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import ts from 'typescript-eslint';
8+
import svelteConfig from './svelte.config.js';
9+
10+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
11+
12+
export default ts.config(
13+
includeIgnoreFile(gitignorePath),
14+
js.configs.recommended,
15+
...ts.configs.recommended,
16+
...svelte.configs.recommended,
17+
prettier,
18+
...svelte.configs.prettier,
19+
{
20+
languageOptions: {
21+
globals: { ...globals.browser, ...globals.node }
22+
},
23+
rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
24+
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
25+
"no-undef": 'off' }
26+
},
27+
{
28+
files: [
29+
'**/*.svelte',
30+
'**/*.svelte.ts',
31+
'**/*.svelte.js'
32+
],
33+
languageOptions: {
34+
parserOptions: {
35+
projectService: true,
36+
extraFileExtensions: ['.svelte'],
37+
parser: ts.parser,
38+
svelteConfig
39+
}
40+
}
41+
}
42+
);

package.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "mark-sveltedown",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build && npm run prepack",
7+
"preview": "vite preview",
8+
"prepare": "svelte-kit sync || echo ''",
9+
"prepack": "svelte-kit sync && svelte-package && publint",
10+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12+
"format": "prettier --write .",
13+
"lint": "prettier --check . && eslint .",
14+
"test:unit": "vitest",
15+
"test": "npm run test:unit -- --run"
16+
},
17+
"files": [
18+
"dist",
19+
"!dist/**/*.test.*",
20+
"!dist/**/*.spec.*"
21+
],
22+
"sideEffects": [
23+
"**/*.css"
24+
],
25+
"svelte": "./dist/index.js",
26+
"types": "./dist/index.d.ts",
27+
"type": "module",
28+
"exports": {
29+
".": {
30+
"types": "./dist/index.d.ts",
31+
"svelte": "./dist/index.js"
32+
}
33+
},
34+
"peerDependencies": {
35+
"svelte": "^5.0.0"
36+
},
37+
"devDependencies": {
38+
"@eslint/compat": "^1.2.5",
39+
"@eslint/js": "^9.18.0",
40+
"@sveltejs/adapter-vercel": "^5.6.3",
41+
"@sveltejs/kit": "^2.22.0",
42+
"@sveltejs/package": "^2.0.0",
43+
"@sveltejs/vite-plugin-svelte": "^6.0.0",
44+
"@types/hast": "^3.0.4",
45+
"@types/mdast": "^4.0.4",
46+
"@vitest/browser": "^3.2.3",
47+
"eslint": "^9.18.0",
48+
"eslint-config-prettier": "^10.0.1",
49+
"eslint-plugin-svelte": "^3.0.0",
50+
"globals": "^16.0.0",
51+
"playwright": "^1.53.0",
52+
"prettier": "^3.4.2",
53+
"prettier-plugin-svelte": "^3.3.3",
54+
"publint": "^0.3.2",
55+
"rehype-raw": "^7.0.0",
56+
"remark-gfm": "^4.0.1",
57+
"svelte": "^5.0.0",
58+
"svelte-check": "^4.0.0",
59+
"typescript": "^5.0.0",
60+
"typescript-eslint": "^8.20.0",
61+
"vite": "^7.0.4",
62+
"vite-plugin-devtools-json": "^1.0.0",
63+
"vitest": "^3.2.3",
64+
"vitest-browser-svelte": "^0.1.0"
65+
},
66+
"keywords": [
67+
"svelte"
68+
],
69+
"pnpm": {
70+
"onlyBuiltDependencies": [
71+
"esbuild"
72+
]
73+
},
74+
"packageManager": "[email protected]+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b",
75+
"dependencies": {
76+
"esm-env": "^1.2.2",
77+
"hast": "^1.0.0",
78+
"html-url-attributes": "^3.0.1",
79+
"remark-parse": "^11.0.0",
80+
"remark-rehype": "^11.1.2",
81+
"unified": "^11.0.5",
82+
"unist-util-visit": "^5.0.0",
83+
"vfile": "^6.0.3"
84+
}
85+
}

0 commit comments

Comments
 (0)