@llun/activities.schema 0.2.33 → 0.2.34
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/.yarn/install-state.gz +0 -0
- package/CLAUDE.md +46 -0
- package/package.json +3 -3
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
This is a TypeScript library that provides Zod schemas for validating ActivityPub and Mastodon data. It exports validation schemas for social media activities and objects like notes, actors, follows, likes, and various Mastodon-specific entities.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
### Build
|
|
12
|
+
```bash
|
|
13
|
+
npm run build
|
|
14
|
+
```
|
|
15
|
+
Builds the project in three module formats:
|
|
16
|
+
- CommonJS to `dist/cjs/`
|
|
17
|
+
- ES Modules to `dist/esm/`
|
|
18
|
+
- TypeScript declarations to `dist/types/`
|
|
19
|
+
|
|
20
|
+
### Release
|
|
21
|
+
```bash
|
|
22
|
+
npm run release
|
|
23
|
+
```
|
|
24
|
+
Cleans dist directory, builds, and publishes to npm with public access.
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
### Core Structure
|
|
29
|
+
- **Root exports** (`src/index.ts`): ActivityPub entities (Actor, Note, Follow, Like, etc.)
|
|
30
|
+
- **Mastodon namespace** (`src/mastodon/`): Mastodon-specific schemas exported as `Mastodon.*`
|
|
31
|
+
- **Nested schemas**: Complex types like Note use composition with shared base schemas
|
|
32
|
+
|
|
33
|
+
### Key Patterns
|
|
34
|
+
- All schemas use Zod for validation and TypeScript type generation
|
|
35
|
+
- Exports follow the pattern: `export const Schema = z.object(...)` and `export type Schema = z.infer<typeof Schema>`
|
|
36
|
+
- ActivityPub entities extend base content schemas for common properties
|
|
37
|
+
- Mastodon schemas are organized by entity type (account, status, media, etc.)
|
|
38
|
+
|
|
39
|
+
### Module System
|
|
40
|
+
- Uses ES modules (`"type": "module"` in package.json)
|
|
41
|
+
- Import paths use `.js` extensions for compatibility
|
|
42
|
+
- Triple build output supports both CommonJS and ES module consumers
|
|
43
|
+
|
|
44
|
+
## Key Dependencies
|
|
45
|
+
- **zod**: Core validation library - all schemas are built with Zod
|
|
46
|
+
- **typescript**: Development dependency for type checking and compilation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llun/activities.schema",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "Validate ActivityPub and Mastodon with Zod",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"author": "Maythee Anegboonlap <null@llun.dev>",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"zod": "^3.
|
|
16
|
+
"zod": "^3.25.71"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"typescript": "^5.8.3"
|
|
20
20
|
},
|
|
21
|
-
"packageManager": "yarn@4.
|
|
21
|
+
"packageManager": "yarn@4.9.2"
|
|
22
22
|
}
|