@ewanc26/svelte-standard-site 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -98
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -1,108 +1,13 @@
|
|
|
1
1
|
# @ewanc26/svelte-standard-site
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
A SvelteKit library for reading and writing AT Protocol longform content via `site.standard.*` records. Includes a complete design system, publishing tools, federated Bluesky comments, content verification helpers, and pre-built components.
|
|
6
|
-
|
|
7
|
-
Part of the [`@ewanc26/pkgs`](https://github.com/ewanc26/pkgs) monorepo.
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
3
|
+
SvelteKit library for reading and writing AT Protocol longform content via `site.standard.*` records. Includes a design system, publishing tools, federated Bluesky comments, and pre-built components.
|
|
10
4
|
|
|
11
5
|
```bash
|
|
12
6
|
pnpm add @ewanc26/svelte-standard-site zod
|
|
13
7
|
```
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Features
|
|
18
|
-
|
|
19
|
-
- **Reading** — Fetch `site.standard.document` and `site.standard.publication` records from AT Protocol
|
|
20
|
-
- **Writing** — Publish and manage documents via `StandardSitePublisher`
|
|
21
|
-
- **Comments** — Federated Bluesky replies as comments via the `<Comments />` component
|
|
22
|
-
- **Verification** — `.well-known` endpoint helpers to prove content ownership
|
|
23
|
-
- **Design system** — Semantic colour tokens (ink, canvas, primary, secondary, accent) with automatic light/dark mode via Tailwind CSS 4
|
|
24
|
-
- **Type-safe** — Full TypeScript with Zod validation
|
|
25
|
-
- **SSR-ready** — Works with SvelteKit's `fetch` for prerendering
|
|
26
|
-
- **Caching** — In-memory cache with configurable TTL
|
|
27
|
-
|
|
28
|
-
## Quick Start
|
|
29
|
-
|
|
30
|
-
### Reading
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// src/routes/+page.server.ts
|
|
34
|
-
import { createClient } from '@ewanc26/svelte-standard-site';
|
|
35
|
-
|
|
36
|
-
export const load = async ({ fetch }) => {
|
|
37
|
-
const client = createClient({ did: 'did:plc:your-did' });
|
|
38
|
-
const documents = await client.fetchAllDocuments(fetch);
|
|
39
|
-
return { documents };
|
|
40
|
-
};
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Publishing
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
import { StandardSitePublisher } from '@ewanc26/svelte-standard-site/publisher';
|
|
47
|
-
|
|
48
|
-
const publisher = new StandardSitePublisher({
|
|
49
|
-
identifier: 'you.bsky.social',
|
|
50
|
-
password: process.env.ATPROTO_APP_PASSWORD
|
|
51
|
-
});
|
|
52
|
-
await publisher.login();
|
|
53
|
-
await publisher.publishDocument({ site, title, content, publishedAt });
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Comments
|
|
57
|
-
|
|
58
|
-
```svelte
|
|
59
|
-
<script>
|
|
60
|
-
import { Comments } from '@ewanc26/svelte-standard-site';
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<Comments
|
|
64
|
-
bskyPostUri="at://did:plc:xxx/app.bsky.feed.post/abc"
|
|
65
|
-
canonicalUrl="https://yourblog.com/posts/my-post"
|
|
66
|
-
/>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Entry Points
|
|
70
|
-
|
|
71
|
-
| Import | Description |
|
|
72
|
-
|--------|-------------|
|
|
73
|
-
| `@ewanc26/svelte-standard-site` | Components, client, stores, types, utilities |
|
|
74
|
-
| `@ewanc26/svelte-standard-site/publisher` | `StandardSitePublisher` for writing records |
|
|
75
|
-
| `@ewanc26/svelte-standard-site/content` | Markdown transformation utilities |
|
|
76
|
-
| `@ewanc26/svelte-standard-site/comments` | Comment fetching utilities |
|
|
77
|
-
| `@ewanc26/svelte-standard-site/verification` | `.well-known` and ownership verification |
|
|
78
|
-
| `@ewanc26/svelte-standard-site/schemas` | Zod schemas and `COLLECTIONS` constant |
|
|
79
|
-
| `@ewanc26/svelte-standard-site/config/env` | `getConfigFromEnv()` SvelteKit helper |
|
|
80
|
-
| `@ewanc26/svelte-standard-site/styles/base.css` | Base CSS |
|
|
81
|
-
| `@ewanc26/svelte-standard-site/styles/themes.css` | Theme CSS |
|
|
82
|
-
|
|
83
|
-
## Development
|
|
84
|
-
|
|
85
|
-
Development happens in the [`@ewanc26/pkgs`](https://github.com/ewanc26/pkgs) monorepo. Local commands (from `packages/svelte-standard-site`):
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
pnpm build # svelte-package → dist/
|
|
89
|
-
pnpm dev # svelte-package --watch
|
|
90
|
-
pnpm dev:app # vite dev (demo routes)
|
|
91
|
-
pnpm check # svelte-check
|
|
92
|
-
pnpm test # vitest run
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Environment Variables
|
|
96
|
-
|
|
97
|
-
```env
|
|
98
|
-
PUBLIC_ATPROTO_DID=did:plc:your-did-here
|
|
99
|
-
PUBLIC_PUBLICATION_RKEY=3abc123xyz
|
|
100
|
-
|
|
101
|
-
# For publishing (never commit)
|
|
102
|
-
ATPROTO_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
|
103
|
-
ATPROTO_HANDLE=you.bsky.social
|
|
104
|
-
```
|
|
9
|
+
Full documentation at **[docs.ewancroft.uk](https://docs.ewancroft.uk/projects/svelte-standard-site)**.
|
|
105
10
|
|
|
106
11
|
## Licence
|
|
107
12
|
|
|
108
|
-
AGPL-3.0-only — see the [pkgs monorepo licence](
|
|
13
|
+
AGPL-3.0-only — see the [pkgs monorepo licence](../../LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewanc26/svelte-standard-site",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "SvelteKit library for reading and writing AT Protocol longform content via site.standard.* records — with a complete design system, federated comments, publishing tools, and content verification.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"author": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"svelte": "^5.0.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@atproto/api": "^0.
|
|
67
|
-
"@lucide/svelte": "^0.
|
|
68
|
-
"katex": "^0.16.
|
|
66
|
+
"@atproto/api": "^0.19.3",
|
|
67
|
+
"@lucide/svelte": "^0.577.0",
|
|
68
|
+
"katex": "^0.16.38",
|
|
69
69
|
"rehype-slug": "^6.0.0",
|
|
70
70
|
"rehype-stringify": "^10.0.1",
|
|
71
71
|
"remark-gfm": "^4.0.1",
|
|
@@ -74,28 +74,28 @@
|
|
|
74
74
|
"shiki": "^3.21.0",
|
|
75
75
|
"unified": "^11.0.5",
|
|
76
76
|
"zod": "^3.24.0",
|
|
77
|
-
"@ewanc26/atproto": "0.2.
|
|
78
|
-
"@ewanc26/tid": "1.1.
|
|
79
|
-
"@ewanc26/utils": "0.1.
|
|
77
|
+
"@ewanc26/atproto": "0.2.4",
|
|
78
|
+
"@ewanc26/tid": "1.1.2",
|
|
79
|
+
"@ewanc26/utils": "0.1.4"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@sveltejs/adapter-auto": "^7.0.
|
|
83
|
-
"@sveltejs/kit": "^2.
|
|
82
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
83
|
+
"@sveltejs/kit": "^2.55.0",
|
|
84
84
|
"@sveltejs/package": "^2.5.7",
|
|
85
85
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
86
86
|
"@tailwindcss/typography": "^0.5.19",
|
|
87
|
-
"@tailwindcss/vite": "^4.1
|
|
88
|
-
"@types/node": "^
|
|
87
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
88
|
+
"@types/node": "^25.5.0",
|
|
89
89
|
"prettier": "^3.7.4",
|
|
90
|
-
"prettier-plugin-svelte": "^3.
|
|
90
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
91
91
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
92
|
-
"publint": "^0.3.
|
|
93
|
-
"svelte": "^5.
|
|
94
|
-
"svelte-check": "^4.
|
|
95
|
-
"tailwindcss": "^4.1
|
|
92
|
+
"publint": "^0.3.18",
|
|
93
|
+
"svelte": "^5.53.11",
|
|
94
|
+
"svelte-check": "^4.4.5",
|
|
95
|
+
"tailwindcss": "^4.2.1",
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
97
|
"vite": "^7.2.6",
|
|
98
|
-
"vitest": "^4.0
|
|
98
|
+
"vitest": "^4.1.0"
|
|
99
99
|
},
|
|
100
100
|
"keywords": [
|
|
101
101
|
"svelte",
|