@sudobility/entity_service 1.0.20 → 1.0.22

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.
Files changed (2) hide show
  1. package/CLAUDE.md +47 -0
  2. package/package.json +3 -3
package/CLAUDE.md CHANGED
@@ -167,3 +167,50 @@ sudojo_api (backend)
167
167
  import type { Entity, EntityMember, EntityRole } from '@sudobility/entity_service';
168
168
  import { EntityRole, hasPermission } from '@sudobility/entity_service';
169
169
  ```
170
+
171
+ ## Workspace Context
172
+
173
+ This project is part of the **ShapeShyft** multi-project workspace at the parent directory. See `../CLAUDE.md` for the full architecture, dependency graph, and build order.
174
+
175
+ ## Downstream Impact
176
+
177
+ | Downstream Consumer | Relationship |
178
+ |---------------------|-------------|
179
+ | `shapeshyft_api` | Direct dependency - uses entity middleware, helpers, and schema factories |
180
+
181
+ After making changes:
182
+ 1. `bun run verify` in this project
183
+ 2. `npm publish`
184
+ 3. In `shapeshyft_api`: `bun update @sudobility/entity_service` then rebuild
185
+
186
+ Note: `entity_pages` does NOT depend on this package. It uses `@sudobility/entity_client` (a separate repo).
187
+
188
+ ## Local Dev Workflow
189
+
190
+ ```bash
191
+ # In this project:
192
+ bun link
193
+
194
+ # In shapeshyft_api:
195
+ bun link @sudobility/entity_service
196
+
197
+ # Rebuild after changes:
198
+ bun run build
199
+
200
+ # When done, unlink:
201
+ bun unlink @sudobility/entity_service && bun install
202
+ ```
203
+
204
+ ## Pre-Commit Checklist
205
+
206
+ ```bash
207
+ bun run verify # Runs: typecheck -> lint -> build (does NOT include tests)
208
+ bun test # Run tests separately
209
+ ```
210
+
211
+ ## Gotchas
212
+
213
+ - **Schema factory functions require a schema name argument** -- `createEntitiesTable(mySchema, 'my_app')`. Forgetting the prefix causes table name collisions.
214
+ - **Peer dependencies (drizzle-orm, hono) must be installed by consumers** -- do not add to `dependencies`.
215
+ - **Personal entities use userId as entitySlug** -- this is a convention other code relies on. Do not change slug generation for personal entities.
216
+ - **Role permissions are hardcoded** in `permissions.ts`. Changing them affects all consumers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/entity_service",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Shared entity/organization management library for multi-tenant workspaces",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -48,13 +48,13 @@
48
48
  "author": "Sudobility",
49
49
  "license": "BUSL-1.1",
50
50
  "peerDependencies": {
51
- "@sudobility/types": "^1.9.50",
51
+ "@sudobility/types": "^1.9.52",
52
52
  "drizzle-orm": "^0.45.0",
53
53
  "hono": "^4.0.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "vitest": "^4.0.4",
57
- "@sudobility/types": "^1.9.50",
57
+ "@sudobility/types": "^1.9.52",
58
58
  "@types/bun": "latest",
59
59
  "@types/node": "^24.0.0",
60
60
  "@typescript-eslint/eslint-plugin": "^8.50.0",