@turystack/entity 1.0.1 → 1.0.3

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 ADDED
@@ -0,0 +1,33 @@
1
+ # @turystack/entity
2
+
3
+ Type-safe domain entities with stable SuperJSON serialization identifiers.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @turystack/entity
9
+ ```
10
+
11
+ ### Peer dependencies
12
+
13
+ The host application provides these:
14
+
15
+ ```bash
16
+ pnpm add superjson
17
+ ```
18
+
19
+ ## Documentation
20
+
21
+ Options, API reference and examples:
22
+
23
+ **https://tury.dev/libs/entity**
24
+
25
+ ## Development
26
+
27
+ ```bash
28
+ pnpm install
29
+ pnpm typecheck
30
+ pnpm check
31
+ pnpm test
32
+ pnpm build
33
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/entity/entity.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAA;AAyBjC,MAAM,UAAU,MAAM,CAAC,UAAmB;IACzC,OAAO,CAAC,WAAkB,EAAE,EAAE;QAC7B,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IACjD,CAAC,CAAA;AACF,CAAC"}
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/entity/entity.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAA;AAyBjC,MAAM,UAAU,MAAM,CAAC,UAAmB;IACzC,OAAO,CAAC,WAAkB,EAAE,EAAE;QAC7B,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IACjD,CAAC,CAAA;AACF,CAAC","sourcesContent":["import superjson from 'superjson'\n\ntype Class = {\n\tnew (...args: never[]): object\n}\n\n/**\n * Class decorator that registers a class with superjson for serialization/deserialization.\n *\n * type preservation (e.g. `Date`, custom classes) across serialization boundaries.\n *\n * @example\n * ```ts\n * import { Entity } from '@turystack/entity'\n *\n * @Entity()\n * class Order {\n * id: string\n * createdAt: Date\n * }\n * ```\n *\n * @param identifier - Stable serialization identifier. Prefer a namespaced value\n * such as `orders.order` when class names may be minified or duplicated.\n */\nexport function Entity(identifier?: string) {\n\treturn (Constructor: Class) => {\n\t\tsuperjson.registerClass(Constructor, identifier)\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA","sourcesContent":["export * from './entity.js'\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA","sourcesContent":["export * from '@/entity/index.js'\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@turystack/entity",
3
3
  "description": "Type-safe domain entities with stable SuperJSON serialization identifiers.",
4
4
  "private": false,
5
- "version": "1.0.1",
5
+ "version": "1.0.3",
6
6
  "type": "module",
7
7
  "sideEffects": false,
8
8
  "main": "./dist/index.js",