@atproto/lex 0.0.20 → 0.0.21

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +29 -1
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atproto/lex
2
2
 
3
+ ## 0.0.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5a2f884`](https://github.com/bluesky-social/atproto/commit/5a2f8847efd91252971fa243d21bd52ada7aa8f4), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe), [`112b159`](https://github.com/bluesky-social/atproto/commit/112b159ec293a5c3fff41237474a3788fc47f9ca), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe), [`3dc3791`](https://github.com/bluesky-social/atproto/commit/3dc37915436dec7e18c7dc9dcf01b72cad53fdbe)]:
8
+ - @atproto/lex-client@0.0.16
9
+ - @atproto/lex-schema@0.0.15
10
+ - @atproto/lex-builder@0.0.18
11
+ - @atproto/lex-installer@0.0.21
12
+
3
13
  ## 0.0.20
4
14
 
5
15
  ### Patch Changes
package/README.md CHANGED
@@ -20,7 +20,7 @@ const newPost = app.bsky.feed.post.$build({
20
20
  app.bsky.actor.profile.$validate({
21
21
  $type: 'app.bsky.actor.profile',
22
22
  displayName: 'Ha'.repeat(32) + '!',
23
- }) // Error: grapheme too big (maximum 64) at $.displayName (got 65)
23
+ }) // Error: grapheme too big (maximum 64, got 65) at $.displayName
24
24
  ```
25
25
 
26
26
  ```typescript
@@ -75,6 +75,7 @@ const posts = await client.list(app.bsky.feed.post, { limit: 10 })
75
75
  - [Actions](#actions)
76
76
  - [Creating a Client from Another Client](#creating-a-client-from-another-client)
77
77
  - [Building Library-Style APIs with Actions](#building-library-style-apis-with-actions)
78
+ - [Standard Schema Compatibility](#standard-schema-compatibility)
78
79
  - [License](#license)
79
80
 
80
81
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -1423,6 +1424,33 @@ await client.call(actions.post, { text: 'Hello!' })
1423
1424
  5. **Retries**: Implement retry logic for operations with optimistic concurrency control
1424
1425
  6. **Tree-shaking**: Export actions individually to allow tree-shaking (instead of bundling them in a single class)
1425
1426
 
1427
+ ### Standard Schema Compatibility
1428
+
1429
+ All generated schemas implement the [Standard Schema](https://standardschema.dev/) interface (`StandardSchemaV1`), which means they can be used with any library or framework that supports Standard Schema, such as form validation libraries, API frameworks, and more.
1430
+
1431
+ Every `Schema` instance exposes a `~standard` property conforming to the spec:
1432
+
1433
+ ```typescript
1434
+ import * as app from './lexicons/app.js'
1435
+
1436
+ // Use with any Standard Schema-compatible library
1437
+ const schema = app.bsky.feed.post
1438
+
1439
+ schema['~standard'].version // 1
1440
+ schema['~standard'].vendor // '@atproto/lex-schema'
1441
+
1442
+ // Validate using the Standard Schema interface
1443
+ const result = schema['~standard'].validate(someData)
1444
+
1445
+ if ('value' in result) {
1446
+ console.log(result.value) // Parsed and validated data
1447
+ } else {
1448
+ console.error(result.issues)
1449
+ }
1450
+ ```
1451
+
1452
+ When validated through the Standard Schema interface, schemas operate in "parse" mode, meaning transformations like defaults and coercions are applied to the output.
1453
+
1426
1454
  ## License
1427
1455
 
1428
1456
  MIT or Apache2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/lex",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "license": "MIT",
5
5
  "description": "Lexicon tooling for AT",
6
6
  "keywords": [
@@ -38,12 +38,12 @@
38
38
  "dependencies": {
39
39
  "tslib": "^2.8.1",
40
40
  "yargs": "^17.0.0",
41
- "@atproto/lex-builder": "^0.0.17",
42
- "@atproto/lex-client": "^0.0.15",
41
+ "@atproto/lex-builder": "^0.0.18",
42
+ "@atproto/lex-client": "^0.0.16",
43
43
  "@atproto/lex-data": "^0.0.13",
44
44
  "@atproto/lex-json": "^0.0.13",
45
- "@atproto/lex-installer": "^0.0.20",
46
- "@atproto/lex-schema": "^0.0.14"
45
+ "@atproto/lex-installer": "^0.0.21",
46
+ "@atproto/lex-schema": "^0.0.15"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/yargs": "^17.0.33",