@absolutejs/sync-pack-comments 0.4.1 → 0.4.3
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/dist/index.js +16 -1
- package/dist/index.js.map +2 -2
- package/dist/manifest.d.ts +3 -0
- package/dist/manifest.js +8589 -0
- package/dist/manifest.js.map +123 -0
- package/dist/manifest.json +100 -0
- package/package.json +24 -4
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": 1,
|
|
3
|
+
"identity": {
|
|
4
|
+
"accent": "#f59e0b",
|
|
5
|
+
"category": "sync",
|
|
6
|
+
"description": "Threaded comments pack for `@absolutejs/sync` — one `engine.registerPack(createCommentsPack(...))` adds per-resource comment threads with author/moderator delete gates, the host’s own ACL injected via `canReadResource`, optional emoji reactions, optional live full-text search over bodies, an optional author-join collection, and optional CRDT comment bodies (concurrent edits merge instead of clobbering).",
|
|
7
|
+
"docsUrl": "https://github.com/absolutejs/sync-packs/tree/main/comments",
|
|
8
|
+
"name": "@absolutejs/sync-pack-comments",
|
|
9
|
+
"tagline": "Let people comment on anything — threads, live."
|
|
10
|
+
},
|
|
11
|
+
"settings": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"maxDepth": {
|
|
15
|
+
"description": "How deep reply threads can nest (top level is 0). Default 8.",
|
|
16
|
+
"minimum": 0,
|
|
17
|
+
"title": "Reply depth limit",
|
|
18
|
+
"type": "integer"
|
|
19
|
+
},
|
|
20
|
+
"prefix": {
|
|
21
|
+
"description": "Name prefix for the pack’s tables, collections, and mutations — set one when running several comments packs on the same engine.",
|
|
22
|
+
"title": "Name prefix",
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"reactions": {
|
|
26
|
+
"description": "Turn on emoji reactions: one tap per person per emoji per comment, live counts.",
|
|
27
|
+
"title": "Reactions",
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"allowedEmojis": {
|
|
31
|
+
"description": "Which emojis people can react with. Leave empty to allow any.",
|
|
32
|
+
"title": "Allowed emojis",
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"search": {
|
|
41
|
+
"description": "Turn on live full-text search over comment bodies — results re-rank as comments change.",
|
|
42
|
+
"title": "Comment search",
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"topK": {
|
|
46
|
+
"description": "How many best-matching comments a search returns.",
|
|
47
|
+
"minimum": 1,
|
|
48
|
+
"title": "Results per search",
|
|
49
|
+
"type": "integer"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"slots": {
|
|
56
|
+
"bodyCrdt": {
|
|
57
|
+
"configPath": "bodyCrdt",
|
|
58
|
+
"contract": "sync/crdt-adapter",
|
|
59
|
+
"description": "Optional: merge simultaneous edits to a comment body instead of overwriting",
|
|
60
|
+
"known": [
|
|
61
|
+
"@absolutejs/sync#rga-text",
|
|
62
|
+
"@absolutejs/sync-yjs",
|
|
63
|
+
"@absolutejs/sync-automerge",
|
|
64
|
+
"@absolutejs/sync-loro"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"wiring": [
|
|
69
|
+
{
|
|
70
|
+
"description": "Rides @absolutejs/sync’s engine recipe: `engine` is its module-scope binding. The host’s ACL gates every read — the pack never duplicates it.",
|
|
71
|
+
"id": "default",
|
|
72
|
+
"server": {
|
|
73
|
+
"code": "engine.registerPack(createCommentsPack({\n\tbodyCrdt: ${slot.bodyCrdt},\n\t// TODO: your ACL — who can read comments on this resource?\n\tcanReadResource: (resourceId, ctx) => true,\n\t// getActorId defaults to (ctx) => ctx.userId; add canModerate for\n\t// admin deletes and joinUsers for a comments-with-author collection.\n\t...${settings}\n}));",
|
|
74
|
+
"imports": [
|
|
75
|
+
{
|
|
76
|
+
"from": "@absolutejs/sync-pack-comments",
|
|
77
|
+
"names": [
|
|
78
|
+
"createCommentsPack"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"placement": "module-scope"
|
|
83
|
+
},
|
|
84
|
+
"title": "Register threaded comments on the sync engine"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"tools": {
|
|
88
|
+
"pack_surface": {
|
|
89
|
+
"annotations": {
|
|
90
|
+
"readOnlyHint": true
|
|
91
|
+
},
|
|
92
|
+
"description": "What this comments pack adds to the sync engine: owned tables, read tables (author join), collections (including search/join), and mutations.",
|
|
93
|
+
"input": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"properties": {}
|
|
96
|
+
},
|
|
97
|
+
"kind": "runtime"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/sync-pack-comments",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Threaded comments pack for @absolutejs/sync — per-resource ACL-scoped, author/moderator gates, optional CRDT bodies",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/absolutejs/sync-packs.git",
|
|
8
8
|
"directory": "comments"
|
|
9
9
|
},
|
|
10
|
+
"homepage": "https://github.com/absolutejs/sync-packs/tree/main/comments",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/absolutejs/sync-packs/issues"
|
|
13
|
+
},
|
|
10
14
|
"main": "./dist/index.js",
|
|
11
15
|
"module": "./dist/index.js",
|
|
12
16
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +29,7 @@
|
|
|
25
29
|
"collaboration"
|
|
26
30
|
],
|
|
27
31
|
"scripts": {
|
|
28
|
-
"build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json",
|
|
32
|
+
"build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json && absolute-manifest emit",
|
|
29
33
|
"test": "bun test",
|
|
30
34
|
"typecheck": "tsc --noEmit",
|
|
31
35
|
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
@@ -45,7 +49,23 @@
|
|
|
45
49
|
"types": "./dist/index.d.ts",
|
|
46
50
|
"import": "./dist/index.js",
|
|
47
51
|
"default": "./dist/index.js"
|
|
48
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"./manifest": {
|
|
54
|
+
"types": "./dist/manifest.d.ts",
|
|
55
|
+
"import": "./dist/manifest.js",
|
|
56
|
+
"default": "./dist/manifest.js"
|
|
57
|
+
},
|
|
58
|
+
"./manifest.json": "./dist/manifest.json"
|
|
59
|
+
},
|
|
60
|
+
"files": [
|
|
61
|
+
"dist",
|
|
62
|
+
"README.md"
|
|
63
|
+
],
|
|
64
|
+
"absolutejs": {
|
|
65
|
+
"manifestContract": 1
|
|
49
66
|
},
|
|
50
|
-
"
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@absolutejs/manifest": "^0.1.0",
|
|
69
|
+
"@sinclair/typebox": "^0.34.0"
|
|
70
|
+
}
|
|
51
71
|
}
|