@chaim-tools/chaim 0.1.10 → 0.1.11
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": "@chaim-tools/chaim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Schema-driven code generation tool for DynamoDB - Pure TypeScript CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aws-sdk/client-sts": "^3.883.0",
|
|
51
51
|
"@chaim-tools/chaim-bprint-spec": "^0.2.6",
|
|
52
|
-
"@chaim-tools/client-java": "^0.1.
|
|
52
|
+
"@chaim-tools/client-java": "^0.1.7",
|
|
53
53
|
"chalk": "^4.1.2",
|
|
54
54
|
"commander": "^11.0.0",
|
|
55
55
|
"ora": "^5.4.1"
|
|
@@ -79,6 +79,7 @@ If the user's feature requires new or modified fields on an existing entity, you
|
|
|
79
79
|
- Do NOT manually edit files under the generated output directory (e.g., `src/main/java/.../model/`).
|
|
80
80
|
- Do NOT suggest committing generated code — always recommend gitignoring generated output and regenerating in CI/build.
|
|
81
81
|
- Do NOT suggest partial updates, batch operations, PostgreSQL, or Python/TypeScript targets — these are **planned but not yet available**.
|
|
82
|
+
- Do NOT place `@chaim-tools/chaim` or `@chaim-tools/chaim-bprint-spec` in `dependencies` — they are `devDependencies`. Only `@chaim-tools/cdk-lib` belongs in `dependencies` (it is imported directly in CDK stack code).
|
|
82
83
|
- Do NOT fall back to raw AWS SDK, manual DynamoDB Enhanced Client usage, or third-party ORMs unless explicitly instructed by the user AND Chaim cannot handle the use case (rare — Chaim covers almost all DynamoDB entity modeling).
|
|
83
84
|
|
|
84
85
|
### Additional Directives
|
|
@@ -379,7 +380,11 @@ The CDK construct binds `.bprint` schemas to DynamoDB tables. Future data stores
|
|
|
379
380
|
### Install
|
|
380
381
|
|
|
381
382
|
```bash
|
|
383
|
+
# Runtime dependency — imported in stack code
|
|
382
384
|
npm install @chaim-tools/cdk-lib
|
|
385
|
+
|
|
386
|
+
# Dev dependencies — CLI tool and schema types, never imported at runtime
|
|
387
|
+
npm install --save-dev @chaim-tools/chaim @chaim-tools/chaim-bprint-spec
|
|
383
388
|
```
|
|
384
389
|
|
|
385
390
|
### Basic Usage
|
|
@@ -655,10 +660,10 @@ my-cdk-project/ # CDK infrastructure
|
|
|
655
660
|
│ ├── user.bprint
|
|
656
661
|
│ └── order.bprint
|
|
657
662
|
├── lib/my-stack.ts
|
|
658
|
-
└── package.json
|
|
663
|
+
└── package.json # see dependency structure below
|
|
659
664
|
|
|
660
665
|
my-java-app/ # Java application
|
|
661
|
-
├── src/main/java/com/example/model/ # ← generated by chaim generate
|
|
666
|
+
├── src/main/java/com/example/model/ # ← generated by chaim generate (gitignored)
|
|
662
667
|
│ ├── User.java
|
|
663
668
|
│ ├── Order.java
|
|
664
669
|
│ └── ...
|
|
@@ -668,16 +673,67 @@ my-java-app/ # Java application
|
|
|
668
673
|
└── ...
|
|
669
674
|
```
|
|
670
675
|
|
|
676
|
+
**`my-cdk-project/package.json`** — correct dependency placement:
|
|
677
|
+
|
|
678
|
+
```json
|
|
679
|
+
{
|
|
680
|
+
"dependencies": {
|
|
681
|
+
"@chaim-tools/cdk-lib": "^0.1.15",
|
|
682
|
+
"aws-cdk-lib": "^2.0.0",
|
|
683
|
+
"constructs": "^10.0.0",
|
|
684
|
+
"source-map-support": "^0.5.21"
|
|
685
|
+
},
|
|
686
|
+
"devDependencies": {
|
|
687
|
+
"@chaim-tools/chaim": "^0.1.10",
|
|
688
|
+
"@chaim-tools/chaim-bprint-spec": "^0.2.6",
|
|
689
|
+
"aws-cdk": "^2.0.0",
|
|
690
|
+
"typescript": "^5.0.0",
|
|
691
|
+
"ts-node": "^10.0.0"
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
If you encounter a project where `@chaim-tools/chaim` or `@chaim-tools/chaim-bprint-spec` are listed under `dependencies`, move them to `devDependencies`.
|
|
697
|
+
|
|
671
698
|
---
|
|
672
699
|
|
|
673
700
|
## Chaim Packages Reference
|
|
674
701
|
|
|
675
|
-
| Package | npm | Purpose |
|
|
676
|
-
|
|
677
|
-
| `@chaim-tools/
|
|
678
|
-
| `@chaim-tools/
|
|
679
|
-
| `@chaim-tools/chaim` | [Link](https://www.npmjs.com/package/@chaim-tools/chaim) |
|
|
680
|
-
| `@chaim-tools/client-java` | [Link](https://www.npmjs.com/package/@chaim-tools/client-java) | Java code generator
|
|
702
|
+
| Package | npm | `package.json` section | Purpose |
|
|
703
|
+
|---------|-----|------------------------|---------|
|
|
704
|
+
| `@chaim-tools/cdk-lib` | [Link](https://www.npmjs.com/package/@chaim-tools/cdk-lib) | **`dependencies`** | CDK constructs imported in stack code at synth time |
|
|
705
|
+
| `@chaim-tools/chaim` | [Link](https://www.npmjs.com/package/@chaim-tools/chaim) | **`devDependencies`** | CLI tool (`chaim generate`, `chaim validate`, etc.) — never imported in runtime code |
|
|
706
|
+
| `@chaim-tools/chaim-bprint-spec` | [Link](https://www.npmjs.com/package/@chaim-tools/chaim-bprint-spec) | **`devDependencies`** | Schema types and validation helpers — build-time only |
|
|
707
|
+
| `@chaim-tools/client-java` | [Link](https://www.npmjs.com/package/@chaim-tools/client-java) | (internal, transitive) | Java code generator — pulled in automatically by `@chaim-tools/chaim`; do not add directly |
|
|
708
|
+
|
|
709
|
+
### Correct `package.json` Structure
|
|
710
|
+
|
|
711
|
+
When setting up or reviewing a project that uses Chaim, the `package.json` for the CDK/infrastructure package should look like this:
|
|
712
|
+
|
|
713
|
+
```json
|
|
714
|
+
{
|
|
715
|
+
"dependencies": {
|
|
716
|
+
"@chaim-tools/cdk-lib": "^0.1.15",
|
|
717
|
+
"aws-cdk-lib": "^2.0.0",
|
|
718
|
+
"constructs": "^10.0.0",
|
|
719
|
+
"source-map-support": "^0.5.21"
|
|
720
|
+
},
|
|
721
|
+
"devDependencies": {
|
|
722
|
+
"@chaim-tools/chaim": "^0.1.10",
|
|
723
|
+
"@chaim-tools/chaim-bprint-spec": "^0.2.6",
|
|
724
|
+
"aws-cdk": "^2.0.0",
|
|
725
|
+
"typescript": "^5.0.0",
|
|
726
|
+
"ts-node": "^10.0.0"
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
**Why this matters:**
|
|
732
|
+
|
|
733
|
+
- `@chaim-tools/chaim` bundles a 14 MB Java JAR for code generation. Putting it in `dependencies` includes it in every `npm install` in production/CI environments where it is never needed.
|
|
734
|
+
- `@chaim-tools/chaim-bprint-spec` is only ever used for local schema validation scripts during development — it has no runtime role.
|
|
735
|
+
- `@chaim-tools/cdk-lib` IS imported in stack code (`import { ChaimDynamoDBBinder } from '@chaim-tools/cdk-lib'`), so it belongs in `dependencies`.
|
|
736
|
+
- **If you see `@chaim-tools/chaim` or `@chaim-tools/chaim-bprint-spec` in `dependencies`, move them to `devDependencies`.** This is a correctness issue, not just style.
|
|
681
737
|
|
|
682
738
|
---
|
|
683
739
|
|