@absolutejs/sync-pack-mentions 0.1.1 → 0.1.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.
@@ -0,0 +1,59 @@
1
+ {
2
+ "contract": 1,
3
+ "identity": {
4
+ "accent": "#3b82f6",
5
+ "category": "sync",
6
+ "description": "@mention parser pack for `@absolutejs/sync` — one `engine.registerPack(createMentionsPack(...))` adds a record mutation that extracts @usernames from a posted body, writes one row per mentioned actor (with a context snippet), and fires an `onMention` hook that composes with the notifications pack. Owner-scoped live reads show each member their mentions.",
7
+ "docsUrl": "https://github.com/absolutejs/sync-packs/tree/main/mentions",
8
+ "name": "@absolutejs/sync-pack-mentions",
9
+ "tagline": "Turn @mentions into rows, alerts, and inbox items."
10
+ },
11
+ "settings": {
12
+ "type": "object",
13
+ "properties": {
14
+ "prefix": {
15
+ "description": "Name prefix for the pack’s table, collection, and mutations.",
16
+ "title": "Name prefix",
17
+ "type": "string"
18
+ },
19
+ "snippetRadius": {
20
+ "description": "How many characters of surrounding text are kept with each mention. Default 30 each side.",
21
+ "minimum": 0,
22
+ "title": "Context snippet size",
23
+ "type": "integer"
24
+ }
25
+ }
26
+ },
27
+ "wiring": [
28
+ {
29
+ "description": "Rides @absolutejs/sync’s engine recipe: `engine` is its module-scope binding. Compose with the notifications pack inside onMention.",
30
+ "id": "default",
31
+ "server": {
32
+ "code": "engine.registerPack(createMentionsPack({\n\t// TODO: map a matched @username to an actor id (undefined skips it).\n\tresolveActorId: (username, ctx) => username,\n\t// TODO: alert the mentioned member — e.g. run the notifications\n\t// pack's notify mutation from your app code.\n\tonMention: async (args, ctx, actions) => {},\n\t...${settings}\n}));",
33
+ "imports": [
34
+ {
35
+ "from": "@absolutejs/sync-pack-mentions",
36
+ "names": [
37
+ "createMentionsPack"
38
+ ]
39
+ }
40
+ ],
41
+ "placement": "module-scope"
42
+ },
43
+ "title": "Register @mention tracking on the sync engine"
44
+ }
45
+ ],
46
+ "tools": {
47
+ "pack_surface": {
48
+ "annotations": {
49
+ "readOnlyHint": true
50
+ },
51
+ "description": "What this mentions pack adds to the sync engine: the table it owns, its collection, and its mutations.",
52
+ "input": {
53
+ "type": "object",
54
+ "properties": {}
55
+ },
56
+ "kind": "runtime"
57
+ }
58
+ }
59
+ }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@absolutejs/sync-pack-mentions",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "@mention parser pack for @absolutejs/sync — extracts @usernames from a body, writes per-actor mention rows, fires an onMention hook that composes with the notifications pack",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/absolutejs/sync-packs.git",
8
8
  "directory": "mentions"
9
9
  },
10
+ "homepage": "https://github.com/absolutejs/sync-packs/tree/main/mentions",
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
  "composition"
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
- "files": ["dist", "README.md"]
67
+ "dependencies": {
68
+ "@absolutejs/manifest": "^0.1.0",
69
+ "@sinclair/typebox": "^0.34.0"
70
+ }
51
71
  }