@absolutejs/sync-pack-utils 0.1.1 → 0.1.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.
@@ -0,0 +1,36 @@
1
+ {
2
+ "contract": 2,
3
+ "identity": {
4
+ "accent": "#64748b",
5
+ "category": "sync",
6
+ "description": "Shared helpers extracted from the official `@absolutejs/sync` packs: `resolveActor` / `defaultGetActorId` (actor identity from ctx), `requireRowOwner` / `requireOwnerOrModerator` (mutation guards), and `createInMemoryStore` (the default keyed row store). Use them to build your own pack without restating the patterns.",
7
+ "docsUrl": "https://github.com/absolutejs/sync-packs/tree/main/utils",
8
+ "name": "@absolutejs/sync-pack-utils",
9
+ "tagline": "Building blocks for writing your own sync packs."
10
+ },
11
+ "settings": {
12
+ "type": "object",
13
+ "properties": {}
14
+ },
15
+ "wiring": [
16
+ {
17
+ "description": "The helpers the official packs are built from — actor resolution, ownership guards, and the default in-memory row store.",
18
+ "id": "default",
19
+ "server": {
20
+ "code": "// A custom pack usually starts with a keyed store and an actor guard:\nconst rows = createInMemoryStore<{ id: string; actorId: string }>();\n// const actorId = resolveActor(getActorId, ctx); // throws when unauthenticated\n// requireRowOwner(row, actorId); // gate updates/deletes",
21
+ "imports": [
22
+ {
23
+ "from": "@absolutejs/sync-pack-utils",
24
+ "names": [
25
+ "createInMemoryStore",
26
+ "requireRowOwner",
27
+ "resolveActor"
28
+ ]
29
+ }
30
+ ],
31
+ "placement": "module-scope"
32
+ },
33
+ "title": "Helpers for a hand-rolled sync pack"
34
+ }
35
+ ]
36
+ }
package/package.json CHANGED
@@ -1,50 +1,82 @@
1
1
  {
2
- "name": "@absolutejs/sync-pack-utils",
3
- "version": "0.1.1",
4
- "description": "Shared helpers for @absolutejs/sync packs — resolveActor, requireRowOwner/Moderator, createInMemoryStore, and other patterns extracted from the official packs",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/absolutejs/sync-packs.git",
8
- "directory": "utils"
9
- },
10
- "main": "./dist/index.js",
11
- "module": "./dist/index.js",
12
- "types": "./dist/index.d.ts",
13
- "type": "module",
14
- "license": "Apache-2.0",
15
- "author": "Alex Kahn",
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "keywords": [
20
- "absolutejs",
21
- "sync",
22
- "sync-pack",
23
- "utils",
24
- "helpers"
25
- ],
26
- "scripts": {
27
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json",
28
- "test": "bun test",
29
- "typecheck": "tsc --noEmit",
30
- "format": "prettier --write \"./**/*.{ts,json,md}\"",
31
- "release": "bun run format && bun run typecheck && bun run test && bun run build && bun publish"
32
- },
33
- "peerDependencies": {
34
- "@absolutejs/sync": ">= 1.9.2"
35
- },
36
- "devDependencies": {
37
- "@absolutejs/sync": "^1.9.2",
38
- "@types/bun": "1.3.14",
39
- "prettier": "3.5.3",
40
- "typescript": "5.8.3"
41
- },
42
- "exports": {
43
- ".": {
44
- "types": "./dist/index.d.ts",
45
- "import": "./dist/index.js",
46
- "default": "./dist/index.js"
47
- }
48
- },
49
- "files": ["dist", "README.md"]
2
+ "name": "@absolutejs/sync-pack-utils",
3
+ "version": "0.1.3",
4
+ "description": "Shared helpers for @absolutejs/sync packs — resolveActor, requireRowOwner/Moderator, createInMemoryStore, and other patterns extracted from the official packs",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/absolutejs/sync-packs.git",
8
+ "directory": "utils"
9
+ },
10
+ "homepage": "https://github.com/absolutejs/sync-packs/tree/main/utils",
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
+ "utils",
28
+ "helpers"
29
+ ],
30
+ "scripts": {
31
+ "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",
32
+ "test": "bun test",
33
+ "typecheck": "tsc --noEmit",
34
+ "format": "prettier --write \"./**/*.{ts,json,md}\"",
35
+ "release": "bun run format && bun run typecheck && bun run test && bun run build && bun publish"
36
+ },
37
+ "peerDependencies": {
38
+ "@absolutejs/sync": ">=2.11.0 <3"
39
+ },
40
+ "devDependencies": {
41
+ "@absolutejs/sync": "2.11.0",
42
+ "@types/bun": "1.3.14",
43
+ "prettier": "3.5.3",
44
+ "typescript": "5.8.3"
45
+ },
46
+ "exports": {
47
+ ".": {
48
+ "types": "./dist/index.d.ts",
49
+ "import": "./dist/index.js",
50
+ "default": "./dist/index.js"
51
+ },
52
+ "./manifest": {
53
+ "types": "./dist/manifest.d.ts",
54
+ "import": "./dist/manifest.js",
55
+ "default": "./dist/manifest.js"
56
+ },
57
+ "./manifest.json": "./dist/manifest.json"
58
+ },
59
+ "files": [
60
+ "dist",
61
+ "README.md"
62
+ ],
63
+ "absolutejs": {
64
+ "manifestContract": 2,
65
+ "runtimePeers": {
66
+ "@absolutejs/sync": {
67
+ "artifactImports": [
68
+ "@absolutejs/sync/engine"
69
+ ],
70
+ "buildExternals": [
71
+ "@absolutejs/sync"
72
+ ],
73
+ "range": ">=2.11.0 <3",
74
+ "tested": "2.11.0"
75
+ }
76
+ }
77
+ },
78
+ "dependencies": {
79
+ "@absolutejs/manifest": "^0.7.1",
80
+ "@sinclair/typebox": "^0.34.0"
81
+ }
50
82
  }