Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit $type property in code gen #2956

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .changeset/brown-flies-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@atproto/ozone": patch
"@atproto/bsky": patch
"@atproto/api": patch
"@atproto/pds": patch
---

Update generated code to better reflect actual entity structure

5 changes: 5 additions & 0 deletions .changeset/eleven-knives-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---

Improve typing of isX and validateX return values
5 changes: 5 additions & 0 deletions .changeset/fast-points-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/syntax": patch
---

Improve performance of isValidTid
5 changes: 5 additions & 0 deletions .changeset/fast-waves-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---

Strongly type result of generated validation helpers
5 changes: 5 additions & 0 deletions .changeset/funny-buses-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/api": patch
---

Small reduction in bundle size
5 changes: 5 additions & 0 deletions .changeset/green-cherries-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/pds": patch
---

Minor typing fixes
5 changes: 5 additions & 0 deletions .changeset/green-forks-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/api": minor
---

Exposed type utilities (e.g. isRecord) no longer cast the output value. Use the new "isValid" helper for that purpose.
5 changes: 5 additions & 0 deletions .changeset/itchy-rockets-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---

Add isValidX helper to check $type and validate schema
5 changes: 5 additions & 0 deletions .changeset/lazy-moles-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/api": minor
---

Add a `$type` property to record and custom user type interfaces
5 changes: 5 additions & 0 deletions .changeset/popular-shirts-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lexicon": patch
---

Various performance improvements
5 changes: 5 additions & 0 deletions .changeset/shiny-suns-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---

Strongly type client "ids" const
5 changes: 5 additions & 0 deletions .changeset/silly-starfishes-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lexicon": patch
---

Add generic parameter to ValidationResult
5 changes: 5 additions & 0 deletions .changeset/small-pumas-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lexicon": patch
---

Add "value" parameter in ValidationResult
5 changes: 5 additions & 0 deletions .changeset/spotty-bottles-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": minor
---

Remove string index signature from custom objects, input and output schemas.
5 changes: 5 additions & 0 deletions .changeset/tall-laws-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---

Fully type validation result of generated "validate" helpers
5 changes: 5 additions & 0 deletions .changeset/yellow-gorillas-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": minor
---

isX utility no longer type casts input
5 changes: 5 additions & 0 deletions .changeset/young-lamps-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/lex-cli": minor
---

Add "$type" property to record and custom user types.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ run-dev-env-logged: ## Run a "development environment" shell (with logging)

.PHONY: codegen
codegen: ## Re-generate packages from lexicon/ files
cd packages/api; pnpm run codegen
cd packages/pds; pnpm run codegen
cd packages/bsky; pnpm run codegen
cd packages/ozone; pnpm run codegen
# clean up codegen output
pnpm format
pnpm codegen

.PHONY: lint
lint: ## Run style checks and verify syntax
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"verify:lint": "pnpm lint",
"verify:types": "tsc --build tsconfig.json",
"format": "pnpm lint:fix && pnpm style:fix",
"codegen": "pnpm run --recursive --stream --filter '@atproto/lex-cli...' build --force && pnpm run --recursive --stream --parallel codegen && pnpm run lint:fix",
"build": "pnpm --recursive --stream build",
"dev": "NODE_ENV=development pnpm --stream '/^dev:.+$/'",
"dev:tsc": "tsc --build tsconfig.json --watch",
Expand Down
Loading
Loading