@localness/contract 0.1.0 → 0.1.1
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 +25 -25
- package/package.json +39 -39
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# @localness/contract
|
|
2
|
-
|
|
3
|
-
Response contracts of the Localness public `/api/v1`: [zod](https://zod.dev) schemas and the TypeScript types inferred from them. Meant for callers outside the Localness repo, such as a design-tool plugin or build tooling.
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import { deliveryMetaSchema, type DeliveryMeta } from '@localness/contract'
|
|
7
|
-
|
|
8
|
-
const meta: DeliveryMeta = deliveryMetaSchema.parse(await res.json())
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
`zod` ^4 is a peer dependency.
|
|
12
|
-
|
|
13
|
-
## Versioning
|
|
14
|
-
|
|
15
|
-
Independent of the Localness server version.
|
|
16
|
-
|
|
17
|
-
- A new optional field: minor.
|
|
18
|
-
- A removed, renamed, or retyped field, or a field that stops being optional: major.
|
|
19
|
-
- While the version is `0.x`, breaking changes bump the minor.
|
|
20
|
-
|
|
21
|
-
The schemas are not strict: an unknown field from a newer server is stripped rather than rejected, so an older client keeps working.
|
|
22
|
-
|
|
23
|
-
## Release
|
|
24
|
-
|
|
25
|
-
Push a tag `contract-v<semver>`. The `contract-release` workflow type-checks, tests, and publishes with npm provenance.
|
|
1
|
+
# @localness/contract
|
|
2
|
+
|
|
3
|
+
Response contracts of the Localness public `/api/v1`: [zod](https://zod.dev) schemas and the TypeScript types inferred from them. Meant for callers outside the Localness repo, such as a design-tool plugin or build tooling.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { deliveryMetaSchema, type DeliveryMeta } from '@localness/contract'
|
|
7
|
+
|
|
8
|
+
const meta: DeliveryMeta = deliveryMetaSchema.parse(await res.json())
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`zod` ^4 is a peer dependency.
|
|
12
|
+
|
|
13
|
+
## Versioning
|
|
14
|
+
|
|
15
|
+
Independent of the Localness server version.
|
|
16
|
+
|
|
17
|
+
- A new optional field: minor.
|
|
18
|
+
- A removed, renamed, or retyped field, or a field that stops being optional: major.
|
|
19
|
+
- While the version is `0.x`, breaking changes bump the minor.
|
|
20
|
+
|
|
21
|
+
The schemas are not strict: an unknown field from a newer server is stripped rather than rejected, so an older client keeps working.
|
|
22
|
+
|
|
23
|
+
## Release
|
|
24
|
+
|
|
25
|
+
Push a tag `contract-v<semver>`. The `contract-release` workflow type-checks, tests, and publishes with npm provenance.
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@localness/contract",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Response contracts of the Localness public /api/v1: zod schemas and the types inferred from them.",
|
|
5
|
-
"license": "Elastic-2.0",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Hwacc/localness.git",
|
|
10
|
-
"directory": "packages/contract"
|
|
11
|
-
},
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"main": "./dist/index.mjs",
|
|
17
|
-
"types": "./dist/index.d.mts",
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./dist/index.d.mts",
|
|
21
|
-
"default": "./dist/index.mjs"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"access": "public",
|
|
26
|
-
"provenance": true
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tsdown"
|
|
30
|
-
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"zod": "^4.0.0"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"tsdown": "^0.23.2",
|
|
36
|
-
"typescript": "^5.9.3",
|
|
37
|
-
"zod": "^4.5.4"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@localness/contract",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Response contracts of the Localness public /api/v1: zod schemas and the types inferred from them.",
|
|
5
|
+
"license": "Elastic-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Hwacc/localness.git",
|
|
10
|
+
"directory": "packages/contract"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"main": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.mts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.mts",
|
|
21
|
+
"default": "./dist/index.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"provenance": true
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsdown"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"zod": "^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"tsdown": "^0.23.2",
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"zod": "^4.5.4"
|
|
38
|
+
}
|
|
39
|
+
}
|