@jskit-ai/crud-core 0.1.246 → 0.1.248
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/crud-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.248",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"./server/routeContracts": "./src/server/routeContracts.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
30
|
-
"@jskit-ai/json-rest-api-core": "0.1.
|
|
31
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
29
|
+
"@jskit-ai/database-runtime": "0.1.237",
|
|
30
|
+
"@jskit-ai/json-rest-api-core": "0.1.181",
|
|
31
|
+
"@jskit-ai/resource-crud-core": "0.1.179",
|
|
32
32
|
"json-rest-schema": "^1.0.17",
|
|
33
33
|
"json-rest-api": "2.0.0"
|
|
34
34
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
53
|
-
"@jskit-ai/kernel": "0.1.
|
|
52
|
+
"@jskit-ai/http-runtime": "0.1.235",
|
|
53
|
+
"@jskit-ai/kernel": "0.1.237"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -49,9 +49,42 @@ contracts, access policy, and HTTP routes.
|
|
|
49
49
|
## Example files
|
|
50
50
|
|
|
51
51
|
`example/` contains a complete books package plus a source-controlled migration.
|
|
52
|
+
Paths below are relative to this pattern directory:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
example/migrations/20260815000000_books.cjs
|
|
56
|
+
example/packages/books/package.json
|
|
57
|
+
example/packages/books/src/server/BooksFeature.js
|
|
58
|
+
example/packages/books/src/shared/bookResource.js
|
|
59
|
+
example/packages/books/src/shared/index.js
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The example's migration belongs to the application root (`example/migrations/`)
|
|
63
|
+
and is a `.cjs` file. The books package does not declare a migration directory.
|
|
64
|
+
For a package-owned migration instead, declare its actual directory in
|
|
65
|
+
`package.json#jskit.migrations.directories`, as described in the database-layer
|
|
66
|
+
guide.
|
|
67
|
+
|
|
52
68
|
`BooksFeature.js` is deliberately tiny: it binds the readable resource contract
|
|
53
69
|
to the framework module and exports the resulting provider.
|
|
54
70
|
|
|
71
|
+
## List search is part of the initial composition
|
|
72
|
+
|
|
73
|
+
The shared `useCrudListScreen()` enables a query-backed Search box. Its server
|
|
74
|
+
mapping belongs in `bookResource.searchSchema.q`, as the example demonstrates.
|
|
75
|
+
When narrowing the resource, retain that mapping and update `oneOf` to the
|
|
76
|
+
fields that remain; a title-only resource searches `["title"]`. Do this before
|
|
77
|
+
the first list test, alongside the fields and validation.
|
|
78
|
+
|
|
79
|
+
Keep the query layers distinct: the page route and internal CRUD query use
|
|
80
|
+
`q`, while JSON:API HTTP requests use `filter[q]`. Shared CRUD clients handle
|
|
81
|
+
that transport automatically. A raw API test uses, for example,
|
|
82
|
+
`request.get("/api/books", { params: { "filter[q]": "Kindred" } })` with
|
|
83
|
+
JSON:API Accept headers and the application's actual API base/scope. Do not use
|
|
84
|
+
`/api/books?q=Kindred` to test the JSON:API search contract. Assert a matching
|
|
85
|
+
result, a nonmatching query returning no rows, and clearing the UI query;
|
|
86
|
+
an unfiltered collection can satisfy a matching-row-only assertion.
|
|
87
|
+
|
|
55
88
|
## Variation points
|
|
56
89
|
|
|
57
90
|
Change the package name, resource fields, table, surface, ownership filter,
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"./shared": "./src/shared/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@jskit-ai/crud-core": "0.1.
|
|
12
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
11
|
+
"@jskit-ai/crud-core": "0.1.248",
|
|
12
|
+
"@jskit-ai/resource-crud-core": "0.1.179"
|
|
13
13
|
},
|
|
14
14
|
"jskit": {
|
|
15
15
|
"kind": "runtime",
|