@contractspec/example.wealth-snapshot 3.7.6 → 3.7.10

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 CHANGED
@@ -1,14 +1,73 @@
1
1
  # @contractspec/example.wealth-snapshot
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Wealth Snapshot mini-app for accounts, assets, liabilities, and goals.**
5
6
 
6
- Wealth Snapshot mini-app for accounts, assets, liabilities, and goals.
7
+ ## What This Demonstrates
7
8
 
8
- Highlights:
9
+ - Financial entity modeling (accounts, assets, liabilities, goals).
10
+ - Capability and feature definition patterns.
11
+ - Presentation layer and event-driven architecture.
12
+ - RBAC, audit trail, and notification module integration.
13
+ - `src/docs/` contains docblocks and documentation-facing exports.
14
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
9
15
 
10
- - Personal/household accounts with balances and currencies
11
- - Assets & liabilities with categories and valuations
12
- - Net worth and indicators (runway, savings rate) derived from events
13
- - Goals tracking with progress and target dates
14
- - Notifications for threshold crossings and overdue goals
16
+ ## Running Locally
17
+
18
+ From `packages/examples/wealth-snapshot`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run typecheck`
22
+
23
+ ## Usage
24
+
25
+ Use `@contractspec/example.wealth-snapshot` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
26
+
27
+ ## Architecture
28
+
29
+ - `src/docs/` contains docblocks and documentation-facing exports.
30
+ - `src/entities/` contains domain entities and value objects.
31
+ - `src/events.ts` is package-level event definitions.
32
+ - `src/example.ts` is the runnable example entrypoint.
33
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
34
+ - `src/index.ts` is the root public barrel and package entrypoint.
35
+ - `src/operations` is part of the package's public or composition surface.
36
+
37
+ ## Public Entry Points
38
+
39
+ - Export `.` resolves through `./src/index.ts`.
40
+ - Export `./docs` resolves through `./src/docs/index.ts`.
41
+ - Export `./docs/wealth-snapshot.docblock` resolves through `./src/docs/wealth-snapshot.docblock.ts`.
42
+ - Export `./entities` resolves through `./src/entities/index.ts`.
43
+ - Export `./events` resolves through `./src/events.ts`.
44
+ - Export `./example` resolves through `./src/example.ts`.
45
+ - Export `./handlers` resolves through `./src/handlers/index.ts`.
46
+ - Export `./operations` resolves through `./src/operations/index.ts`.
47
+ - Export `./presentations` resolves through `./src/presentations.ts`.
48
+ - Export `./wealth-snapshot.capability` resolves through `./src/wealth-snapshot.capability.ts`.
49
+ - The package publishes 11 total export subpaths; keep docs aligned with `package.json`.
50
+
51
+ ## Local Commands
52
+
53
+ - `bun run dev` — contractspec-bun-build dev
54
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
55
+ - `bun run lint` — bun lint:fix
56
+ - `bun run lint:check` — biome check .
57
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
58
+ - `bun run typecheck` — tsc --noEmit
59
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
60
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
61
+ - `bun run clean` — rimraf dist .turbo
62
+ - `bun run build:bundle` — contractspec-bun-build transpile
63
+ - `bun run build:types` — contractspec-bun-build types
64
+ - `bun run prebuild` — contractspec-bun-build prebuild
65
+
66
+ ## Recent Updates
67
+
68
+ - Replace eslint+prettier by biomejs to optimize speed.
69
+ - Missing contract layers.
70
+
71
+ ## Notes
72
+
73
+ - Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.schema`, `@contractspec/module.audit-trail`, `@contractspec/module.notifications`, ...
@@ -1,6 +1,6 @@
1
1
  // src/events.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var AssetEventPayload = defineSchemaModel({
5
5
  name: "AssetEventPayload",
6
6
  description: "Payload for asset events",
@@ -271,8 +271,8 @@ var wealthSnapshotSchemaContribution = {
271
271
  };
272
272
 
273
273
  // src/events.ts
274
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
275
274
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
275
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
276
276
  var AssetEventPayload = defineSchemaModel({
277
277
  name: "AssetEventPayload",
278
278
  description: "Payload for asset events",
@@ -419,8 +419,8 @@ var example_default = example;
419
419
  function registerWealthSnapshotHandlers() {}
420
420
 
421
421
  // src/operations/index.ts
422
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
423
422
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
423
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
424
424
  var OWNERS = ["examples.wealth-snapshot"];
425
425
  var AccountModel = defineSchemaModel2({
426
426
  name: "Account",
@@ -1,6 +1,6 @@
1
1
  // src/operations/index.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var OWNERS = ["examples.wealth-snapshot"];
5
5
  var AccountModel = defineSchemaModel({
6
6
  name: "Account",
package/dist/events.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/events.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
3
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var AssetEventPayload = defineSchemaModel({
6
6
  name: "AssetEventPayload",
7
7
  description: "Payload for asset events",
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from './entities';
2
- export * from './operations';
3
2
  export * from './events';
3
+ export { default as example } from './example';
4
+ export * from './handlers';
5
+ export * from './operations';
4
6
  export * from './presentations';
5
7
  export * from './wealth-snapshot.feature';
6
- export * from './handlers';
7
- export { default as example } from './example';
8
8
  import './docs';
9
9
  export declare const schemaComposition: {
10
10
  modules: import("@contractspec/lib.schema").ModuleSchemaContribution[];
package/dist/index.js CHANGED
@@ -272,8 +272,8 @@ var wealthSnapshotSchemaContribution = {
272
272
  };
273
273
 
274
274
  // src/events.ts
275
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
276
275
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
276
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
277
277
  var AssetEventPayload = defineSchemaModel({
278
278
  name: "AssetEventPayload",
279
279
  description: "Payload for asset events",
@@ -420,8 +420,8 @@ var example_default = example;
420
420
  function registerWealthSnapshotHandlers() {}
421
421
 
422
422
  // src/operations/index.ts
423
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
424
423
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
424
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
425
425
  var OWNERS = ["examples.wealth-snapshot"];
426
426
  var AccountModel = defineSchemaModel2({
427
427
  name: "Account",
@@ -1,6 +1,6 @@
1
1
  // src/events.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var AssetEventPayload = defineSchemaModel({
5
5
  name: "AssetEventPayload",
6
6
  description: "Payload for asset events",
@@ -271,8 +271,8 @@ var wealthSnapshotSchemaContribution = {
271
271
  };
272
272
 
273
273
  // src/events.ts
274
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
275
274
  import { defineEvent, StabilityEnum } from "@contractspec/lib.contracts-spec";
275
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
276
276
  var AssetEventPayload = defineSchemaModel({
277
277
  name: "AssetEventPayload",
278
278
  description: "Payload for asset events",
@@ -419,8 +419,8 @@ var example_default = example;
419
419
  function registerWealthSnapshotHandlers() {}
420
420
 
421
421
  // src/operations/index.ts
422
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
423
422
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
423
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
424
424
  var OWNERS = ["examples.wealth-snapshot"];
425
425
  var AccountModel = defineSchemaModel2({
426
426
  name: "Account",
@@ -1,6 +1,6 @@
1
1
  // src/operations/index.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var OWNERS = ["examples.wealth-snapshot"];
5
5
  var AccountModel = defineSchemaModel({
6
6
  name: "Account",
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/operations/index.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
3
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var OWNERS = ["examples.wealth-snapshot"];
6
6
  var AccountModel = defineSchemaModel({
7
7
  name: "Account",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.wealth-snapshot",
3
- "version": "3.7.6",
3
+ "version": "3.7.10",
4
4
  "description": "Wealth Snapshot mini-app for accounts, assets, liabilities, and goals",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -13,22 +13,22 @@
13
13
  "dev": "contractspec-bun-build dev",
14
14
  "clean": "rimraf dist .turbo",
15
15
  "lint": "bun lint:fix",
16
- "lint:fix": "eslint src --fix",
17
- "lint:check": "eslint src",
16
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
17
+ "lint:check": "biome check .",
18
18
  "prebuild": "contractspec-bun-build prebuild",
19
19
  "typecheck": "tsc --noEmit"
20
20
  },
21
21
  "dependencies": {
22
- "@contractspec/lib.identity-rbac": "3.7.6",
23
- "@contractspec/lib.schema": "3.7.6",
24
- "@contractspec/lib.contracts-spec": "3.7.6",
25
- "@contractspec/module.audit-trail": "3.7.6",
26
- "@contractspec/module.notifications": "3.7.6"
22
+ "@contractspec/lib.identity-rbac": "3.7.10",
23
+ "@contractspec/lib.schema": "3.7.8",
24
+ "@contractspec/lib.contracts-spec": "4.1.2",
25
+ "@contractspec/module.audit-trail": "3.7.10",
26
+ "@contractspec/module.notifications": "3.7.10"
27
27
  },
28
28
  "devDependencies": {
29
- "@contractspec/tool.typescript": "3.7.6",
29
+ "@contractspec/tool.typescript": "3.7.8",
30
30
  "typescript": "^5.9.3",
31
- "@contractspec/tool.bun": "3.7.6"
31
+ "@contractspec/tool.bun": "3.7.8"
32
32
  },
33
33
  "exports": {
34
34
  ".": {