@contentrain/query 5.1.4 → 5.1.5
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 +14 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -341,24 +341,31 @@ const client = await clientModule.init()
|
|
|
341
341
|
const hero = client.singleton('hero').get()
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
## 🛠
|
|
344
|
+
## 🛠 Generation Commands
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
**Via the `contentrain` CLI (recommended for most users):**
|
|
347
347
|
|
|
348
348
|
```bash
|
|
349
|
-
|
|
349
|
+
contentrain generate # Generate once
|
|
350
|
+
contentrain generate --watch # Regenerate on model/content changes
|
|
351
|
+
contentrain generate --json # Machine-readable JSON for CI
|
|
350
352
|
```
|
|
351
353
|
|
|
352
|
-
|
|
354
|
+
**Via `contentrain-query` (programmatic / build tool flows):**
|
|
353
355
|
|
|
354
356
|
```bash
|
|
357
|
+
npx contentrain-query generate
|
|
355
358
|
npx contentrain-query generate --watch
|
|
359
|
+
npx contentrain-query generate --root /path/to/project
|
|
356
360
|
```
|
|
357
361
|
|
|
358
|
-
|
|
362
|
+
Or from TypeScript:
|
|
359
363
|
|
|
360
|
-
```
|
|
361
|
-
|
|
364
|
+
```ts
|
|
365
|
+
import { generate } from '@contentrain/query/generate'
|
|
366
|
+
|
|
367
|
+
const result = await generate({ projectRoot: process.cwd() })
|
|
368
|
+
console.log(result.generatedFiles.length)
|
|
362
369
|
```
|
|
363
370
|
|
|
364
371
|
## 📤 Package Exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/query",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Optional type-safe query SDK for Contentrain — generated TypeScript client for platform-independent JSON content",
|
|
6
6
|
"type": "module",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"skills"
|
|
66
66
|
],
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@contentrain/types": "0.
|
|
68
|
+
"@contentrain/types": "0.5.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^22.0.0",
|