@absolutejs/sync-pack-counters 0.1.2 → 0.1.4
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 +13 -0
- package/dist/manifest.js +8610 -0
- package/dist/manifest.js.map +123 -0
- package/dist/manifest.json +63 -0
- package/package.json +69 -49
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": 2,
|
|
3
|
+
"identity": {
|
|
4
|
+
"accent": "#06b6d4",
|
|
5
|
+
"category": "sync",
|
|
6
|
+
"description": "Read-set-tracked live counters for `@absolutejs/sync` — one `engine.registerPack(createCountersPack(...))` turns each compute function into a reactive query that re-runs only when the rows it actually read change. No manual invalidation, no polling: subscribe to `counter:<name>` and the number stays current.",
|
|
7
|
+
"docsUrl": "https://github.com/absolutejs/sync-packs/tree/main/counters",
|
|
8
|
+
"name": "@absolutejs/sync-pack-counters",
|
|
9
|
+
"tagline": "Live counts and badges that update themselves."
|
|
10
|
+
},
|
|
11
|
+
"settings": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"prefix": {
|
|
15
|
+
"description": "Name prefix for the pack’s counter queries.",
|
|
16
|
+
"title": "Name prefix",
|
|
17
|
+
"type": "string"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"wiring": [
|
|
22
|
+
{
|
|
23
|
+
"description": "Rides @absolutejs/sync’s engine recipe: `engine` is its module-scope binding. Each counter becomes the reactive query counter:<name>.",
|
|
24
|
+
"id": "default",
|
|
25
|
+
"server": {
|
|
26
|
+
"code": "engine.registerPack(createCountersPack({\n\tcounters: {\n\t\t// TODO: a counter is a compute over tracked ctx.db reads, e.g.\n\t\t// openTasks: async ({ ctx, db }) => (await db.where('tasks', { status: 'open' })).length\n\t},\n\t...${settings}\n}));",
|
|
27
|
+
"imports": [
|
|
28
|
+
{
|
|
29
|
+
"from": "@absolutejs/sync-pack-counters",
|
|
30
|
+
"names": [
|
|
31
|
+
"createCountersPack"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"placement": "module-scope"
|
|
36
|
+
},
|
|
37
|
+
"title": "Register live counters on the sync engine"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"tools": {
|
|
41
|
+
"pack_surface": {
|
|
42
|
+
"annotations": {
|
|
43
|
+
"readOnlyHint": true
|
|
44
|
+
},
|
|
45
|
+
"authorization": {
|
|
46
|
+
"approval": "never",
|
|
47
|
+
"audience": "owner",
|
|
48
|
+
"effects": [
|
|
49
|
+
"read"
|
|
50
|
+
],
|
|
51
|
+
"requiredScopes": [
|
|
52
|
+
"sync:packs:read"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"description": "List the live counters this pack registers on the sync engine.",
|
|
56
|
+
"input": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {}
|
|
59
|
+
},
|
|
60
|
+
"kind": "runtime"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,51 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
"name": "@absolutejs/sync-pack-counters",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Read-set-tracked live counters for @absolutejs/sync — define a compute function, get a reactive count derived from host tables",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/absolutejs/sync-packs.git",
|
|
8
|
+
"directory": "counters"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/absolutejs/sync-packs/tree/main/counters",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/absolutejs/sync-packs/issues"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"author": "Alex Kahn",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"absolutejs",
|
|
25
|
+
"sync",
|
|
26
|
+
"sync-pack",
|
|
27
|
+
"counters",
|
|
28
|
+
"stats",
|
|
29
|
+
"reactive"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
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",
|
|
33
|
+
"test": "bun test",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
36
|
+
"release": "bun run format && bun run typecheck && bun run test && bun run build && bun publish"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@absolutejs/sync": ">= 1.9.2"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@absolutejs/sync": "^1.9.2",
|
|
43
|
+
"@types/bun": "1.3.14",
|
|
44
|
+
"prettier": "3.5.3",
|
|
45
|
+
"typescript": "5.8.3"
|
|
46
|
+
},
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/index.d.ts",
|
|
50
|
+
"import": "./dist/index.js",
|
|
51
|
+
"default": "./dist/index.js"
|
|
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": 2
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@absolutejs/manifest": "^0.4.0",
|
|
69
|
+
"@sinclair/typebox": "^0.34.0"
|
|
70
|
+
}
|
|
51
71
|
}
|