@contractspec/lib.utils-typescript 3.7.6 → 3.7.8
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 +46 -57
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,80 +1,69 @@
|
|
|
1
1
|
# @contractspec/lib.utils-typescript
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
+
**TypeScript utility types and helpers.**
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## What It Provides
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
- **Layer**: lib.
|
|
10
|
+
- **Consumers**: many libs and bundles (wide blast radius).
|
|
11
|
+
- Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
12
|
+
- Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
11
13
|
|
|
12
14
|
## Installation
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
npm install @contractspec/lib.utils-typescript
|
|
16
|
-
# or
|
|
17
|
-
bun add @contractspec/lib.utils-typescript
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Key Concepts
|
|
16
|
+
`npm install @contractspec/lib.utils-typescript`
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
- **Zero Dependencies**: Pure TS/JS helpers.
|
|
18
|
+
or
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `DeepPartial`, `DeepRequired`
|
|
28
|
-
- `Maybe`, `Nullable`
|
|
29
|
-
- `AwaitedResult`
|
|
30
|
-
- `Json`, `JsonObject`
|
|
20
|
+
`bun add @contractspec/lib.utils-typescript`
|
|
31
21
|
|
|
32
22
|
## Usage
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
import type { DeepPartial } from '@contractspec/lib.utils-typescript';
|
|
36
|
-
|
|
37
|
-
type User = {
|
|
38
|
-
profile: {
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const update: DeepPartial<User> = {
|
|
44
|
-
profile: { name: 'Alice' }, // Valid
|
|
45
|
-
};
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
24
|
+
Import the root entrypoint from `@contractspec/lib.utils-typescript`, or choose a documented subpath when you only need one part of the package surface.
|
|
71
25
|
|
|
26
|
+
## Architecture
|
|
72
27
|
|
|
28
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
29
|
+
- `src/lib/` contains package-local helper utilities and adapters.
|
|
30
|
+
- `src/staticShouldNotHappen.ts` is part of the package's public or composition surface.
|
|
73
31
|
|
|
32
|
+
## Public Entry Points
|
|
74
33
|
|
|
34
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
35
|
+
- Export `./lib/AwaitedResult` resolves through `./src/lib/AwaitedResult.ts`.
|
|
36
|
+
- Export `./lib/BrowserNativeObject` resolves through `./src/lib/BrowserNativeObject.ts`.
|
|
37
|
+
- Export `./lib/DeepInfiniteArray` resolves through `./src/lib/DeepInfiniteArray.ts`.
|
|
38
|
+
- Export `./lib/DeepKeepOnly` resolves through `./src/lib/DeepKeepOnly.ts`.
|
|
39
|
+
- Export `./lib/DeepKey` resolves through `./src/lib/DeepKey.ts`.
|
|
40
|
+
- Export `./lib/DeepMap` resolves through `./src/lib/DeepMap.ts`.
|
|
41
|
+
- Export `./lib/DeepNullable` resolves through `./src/lib/DeepNullable.ts`.
|
|
42
|
+
- Export `./lib/DeepOr` resolves through `./src/lib/DeepOr.ts`.
|
|
43
|
+
- Export `./lib/DeepPartial` resolves through `./src/lib/DeepPartial.ts`.
|
|
44
|
+
- The package publishes 31 total export subpaths; keep docs aligned with `package.json`.
|
|
75
45
|
|
|
46
|
+
## Local Commands
|
|
76
47
|
|
|
48
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
49
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
50
|
+
- `bun run lint` — bun run lint:fix
|
|
51
|
+
- `bun run lint:check` — biome check .
|
|
52
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
53
|
+
- `bun run typecheck` — tsc --noEmit
|
|
54
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
55
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
56
|
+
- `bun run clean` — rm -rf dist
|
|
57
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
58
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
59
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
77
60
|
|
|
61
|
+
## Recent Updates
|
|
78
62
|
|
|
63
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
79
64
|
|
|
65
|
+
## Notes
|
|
80
66
|
|
|
67
|
+
- Utility types are used across the entire monorepo — changes can break many packages.
|
|
68
|
+
- Must stay zero-dependency (no runtime deps).
|
|
69
|
+
- Test any signature change against downstream consumers before merging.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.utils-typescript",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.8",
|
|
4
4
|
"description": "TypeScript utility types and helpers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"lint": "bun run lint:fix",
|
|
15
|
-
"lint:fix": "
|
|
16
|
-
"lint:check": "
|
|
15
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
16
|
+
"lint:check": "biome check .",
|
|
17
17
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
18
18
|
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
19
19
|
"build": "bun run prebuild && bun run build:bundle && bun run build:types",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"typecheck": "tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@contractspec/tool.typescript": "3.7.
|
|
27
|
+
"@contractspec/tool.typescript": "3.7.8",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
|
-
"@contractspec/tool.bun": "3.7.
|
|
29
|
+
"@contractspec/tool.bun": "3.7.8"
|
|
30
30
|
},
|
|
31
31
|
"type": "module",
|
|
32
32
|
"types": "./dist/index.d.ts",
|