@oimdb/cli 1.0.0 → 1.1.0
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/README.md +4 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,24 +55,22 @@ if (typeof window !== 'undefined') {
|
|
|
55
55
|
### A model module, no browser
|
|
56
56
|
|
|
57
57
|
The module builds the model in Node and exports an `oimDevRegistry` (or a default export, or a zero-arg factory
|
|
58
|
-
that returns one).
|
|
58
|
+
that returns one). Its services are built with `defaults: oimDevDefaults`:
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
61
|
// oimdb-model.js (built JS, or run the server under a TS loader)
|
|
62
62
|
import { OIMDB, type TOIMEntitySlot, createOIMSlotContentEntityService, createOIMSlotCollectionService, OIMSlotContentPositionalArrayBucketService, OIMBucketCommands } from '@oimdb/core';
|
|
63
|
-
import { OIMDevRegistry,
|
|
64
|
-
|
|
65
|
-
oimInitDevtools();
|
|
63
|
+
import { OIMDevRegistry, oimDevDefaults } from '@oimdb/devtools';
|
|
66
64
|
|
|
67
65
|
type TUser = { id: string; name: string; role: string };
|
|
68
66
|
|
|
69
67
|
const db = new OIMDB();
|
|
70
|
-
const usersService = createOIMSlotCollectionService(
|
|
68
|
+
const usersService = createOIMSlotCollectionService({ defaults: oimDevDefaults, slotContentService: createOIMSlotContentEntityService<TUser>() });
|
|
71
69
|
const users = usersService.createStoreSlot(db);
|
|
72
70
|
// A bucket's slots are the caller's — a write to a user moves the value and
|
|
73
71
|
// files nothing, so whoever writes the user also calls
|
|
74
72
|
// `usersByRoleService.slotContentService.writeSlotContent(bucketSlot, entitySlots)`.
|
|
75
|
-
const usersByRoleService = createOIMSlotCollectionService(
|
|
73
|
+
const usersByRoleService = createOIMSlotCollectionService({ slotContentService: new OIMSlotContentPositionalArrayBucketService<TOIMEntitySlot<TUser>>({ bucketCommands: new OIMBucketCommands({ maxCommandsPerSlot: undefined }) }) });
|
|
76
74
|
const usersByRole = usersByRoleService.createStoreSlot(db);
|
|
77
75
|
|
|
78
76
|
export const oimDevRegistry = new OIMDevRegistry();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oimdb/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "OIMDB command line: inspect, dump, collection and computed of a live page, a model module or Chrome over CDP; the DevTools bridge and UI; the MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|