Skip to content

Commit f411adc

Browse files
i'm overwhelmed
1 parent 4a331b3 commit f411adc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+900
-294
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ node_modules
55
.vercel
66
.netlify
77
.wrangler
8-
/.svelte-kit
9-
/build
10-
/dist
8+
.svelte-kit
9+
build
10+
dist
1111

1212
# OS
1313
.DS_Store

.prettierrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"plugins": [
7-
"prettier-plugin-svelte"
8-
],
6+
"plugins": ["prettier-plugin-svelte"],
97
"overrides": [
108
{
119
"files": "*.svelte",

eslint.config.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ export default ts.config(
2020
languageOptions: {
2121
globals: { ...globals.browser, ...globals.node }
2222
},
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' }
23+
rules: {
24+
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
25+
// 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
26+
'no-undef': 'off'
27+
}
2628
},
2729
{
28-
files: [
29-
'**/*.svelte',
30-
'**/*.svelte.ts',
31-
'**/*.svelte.js'
32-
],
30+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
3331
languageOptions: {
3432
parserOptions: {
3533
projectService: true,

package.json

Lines changed: 17 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,13 @@
11
{
2-
"name": "mark-sveltedown",
2+
"name": "root",
3+
"private": true,
34
"version": "0.0.1",
5+
"type": "module",
46
"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",
7+
"check": "pnpm -r check",
128
"format": "prettier --write .",
139
"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.5.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-
"remark-toc": "^9.0.0",
58-
"svelte": "^5.5.0",
59-
"svelte-check": "^4.0.0",
60-
"typescript": "^5.0.0",
61-
"typescript-eslint": "^8.20.0",
62-
"vite": "^7.0.4",
63-
"vite-plugin-devtools-json": "^1.0.0",
64-
"vitest": "^3.2.3",
65-
"vitest-browser-svelte": "^0.1.0"
10+
"test": "pnpm -r test"
6611
},
6712
"keywords": [
6813
"svelte"
@@ -73,16 +18,17 @@
7318
]
7419
},
7520
"packageManager": "[email protected]+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b",
76-
"dependencies": {
77-
"esm-env": "^1.2.2",
78-
"hast": "^1.0.0",
79-
"html-url-attributes": "^3.0.1",
80-
"property-information": "^7.1.0",
81-
"remark-parse": "^11.0.0",
82-
"remark-rehype": "^11.1.2",
83-
"style-to-object": "^1.0.9",
84-
"unified": "^11.0.5",
85-
"unist-util-visit": "^5.0.0",
86-
"vfile": "^6.0.3"
21+
"devDependencies": {
22+
"@eslint/compat": "catalog:",
23+
"@eslint/js": "catalog:",
24+
"@sveltejs/adapter-vercel": "catalog:",
25+
"@sveltejs/vite-plugin-svelte": "catalog:",
26+
"eslint": "catalog:",
27+
"eslint-config-prettier": "catalog:",
28+
"eslint-plugin-svelte": "catalog:",
29+
"globals": "catalog:",
30+
"prettier": "catalog:",
31+
"prettier-plugin-svelte": "catalog:",
32+
"typescript-eslint": "catalog:"
8733
}
8834
}
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+
```
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "@sejohnson/hardened-svelte-markdown",
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+
"test:unit": "vitest",
13+
"test": "npm run test:unit -- --run"
14+
},
15+
"files": [
16+
"dist",
17+
"!dist/**/*.test.*",
18+
"!dist/**/*.spec.*"
19+
],
20+
"sideEffects": [
21+
"**/*.css"
22+
],
23+
"svelte": "./dist/index.js",
24+
"types": "./dist/index.d.ts",
25+
"type": "module",
26+
"exports": {
27+
".": {
28+
"types": "./dist/index.d.ts",
29+
"svelte": "./dist/index.js"
30+
}
31+
},
32+
"peerDependencies": {
33+
"svelte": "catalog:"
34+
},
35+
"devDependencies": {
36+
"@sejohnson/svelte-markdown": "workspace:*",
37+
"@sveltejs/adapter-vercel": "catalog:",
38+
"@sveltejs/kit": "catalog:",
39+
"@sveltejs/package": "catalog:",
40+
"@sveltejs/vite-plugin-svelte": "catalog:",
41+
"@types/hast": "catalog:",
42+
"@types/node": "catalog:",
43+
"@vitest/browser": "catalog:",
44+
"playwright": "catalog:",
45+
"publint": "catalog:",
46+
"svelte": "catalog:",
47+
"svelte-check": "catalog:",
48+
"typescript": "catalog:",
49+
"vite": "catalog:",
50+
"vitest": "catalog:",
51+
"vitest-browser-svelte": "catalog:"
52+
},
53+
"keywords": [
54+
"svelte"
55+
],
56+
"dependencies": {
57+
"unist-util-visit": "catalog:"
58+
}
59+
}
File renamed without changes.
File renamed without changes.

src/lib/HardenedMarkdown.svelte renamed to packages/hardened-svelte-markdown/src/lib/HardenedMarkdown.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<script lang="ts">
2-
import type { HardenedOptions } from './types.js';
3-
import Markdown from './Markdown.svelte';
2+
import type { Options } from './types.js';
3+
import { Markdown } from '@sejohnson/svelte-markdown';
44
import { harden } from './harden.js';
55
66
let {
77
defaultOrigin = '',
88
allowedLinkPrefixes = [],
99
allowedImagePrefixes = [],
10-
rehypePlugins = [],
10+
rehypePlugins,
1111
...options
12-
}: HardenedOptions = $props();
12+
}: Options = $props();
1313
</script>
1414

1515
<Markdown
1616
{...options}
1717
rehypePlugins={[
18-
...rehypePlugins,
18+
...(rehypePlugins ?? []),
1919
[
2020
harden,
2121
{
File renamed without changes.

0 commit comments

Comments
 (0)