Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
340cab5
feat(data): @alchemy/data MVP — viem actions over shared REST/RPC cha…
blakecduncan Jun 9, 2026
4d1b9a9
chore(data-apis): rename @alchemy/data to @alchemy/data-apis
blakecduncan Jun 9, 2026
fa4818b
chore(data-apis): add smoke-test script for live API validation
blakecduncan Jun 9, 2026
cc00aba
refactor(data-apis): rename createAlchemyDataClient to createDataClient
blakecduncan Jun 9, 2026
b5d7840
feat(data-apis): generate type internals from docs OpenAPI/OpenRPC specs
blakecduncan Jun 10, 2026
9098985
chore(data-apis): re-snapshot specs from docs main; add prices + toke…
blakecduncan Jun 10, 2026
c117d02
feat(common): harden AlchemyRestClient (query, retries, timeout, requ…
blakecduncan Jun 10, 2026
82622c4
feat(api-codegen): emit Query channel, validate pagination, guard dep…
blakecduncan Jun 10, 2026
bdc4064
feat(data-apis): full v1 method surface (31 methods across 5 namespaces)
blakecduncan Jun 10, 2026
45d136e
feat(data-apis): pagination iterators and normalized errors
blakecduncan Jun 10, 2026
4fc0591
feat(data-apis): publish readiness — alpha versioning, typedoc, README
blakecduncan Jun 10, 2026
90c0eee
ci: codegen drift gate + spec-bump workflow
blakecduncan Jun 10, 2026
66c0b88
test(data-apis): type tests, export boundary, expanded live smoke suite
blakecduncan Jun 10, 2026
00aca02
feat(common): viem-free error root + typed JSON-RPC client over the R…
blakecduncan Jun 12, 2026
928ac4d
feat(data-apis)!: dependency-free core — viem inverted out of the fou…
blakecduncan Jun 12, 2026
8940ab5
chore(api-codegen): relocate to repo root per private-package convention
blakecduncan Jun 12, 2026
4683bd7
docs(data-apis): core-first README + regenerated reference docs
blakecduncan Jun 12, 2026
2959380
feat(common): viem-free /core entry point; data-apis imports it exclu…
blakecduncan Jun 12, 2026
b782cdd
Merge remote-tracking branch 'origin/main' into blake/data-sdk-standa…
blakecduncan Jun 12, 2026
2949fdf
docs: regenerate sdk reference after v5.0.4 merge from main
blakecduncan Jun 12, 2026
acb9499
test(common): deflake profiled-function timing assertion
blakecduncan Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ site/.vitepress/cache/**/*
**/test-results/*
**/playwright-report/*
pnpm-lock.yaml

# codegen: committed spec snapshots (generated .ts files instead carry a
# file-level eslint-disable banner so lint-staged can pass them explicitly)
api-codegen/specs/**
63 changes: 63 additions & 0 deletions .github/workflows/bump-api-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Bump API spec snapshots

# Re-snapshots the bundled OpenAPI/OpenRPC specs from alchemyplatform/docs
# (public) at its current main, regenerates SDK internals, and opens a PR if
# anything changed. The manifest validation inside `pnpm generate` hard-fails
# the run if an operation the SDK depends on was renamed or removed — that
# failure is the drift alarm and needs a human decision, not a merge.
#
# Manual for now; switch `workflow_dispatch` to a schedule (or a
# repository_dispatch from the docs repo's publish workflow) once the cadence
# is settled.

on:
workflow_dispatch:

jobs:
bump-specs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Checkout docs repo
uses: actions/checkout@v4
with:
repository: alchemyplatform/docs
path: .docs-checkout

- name: Setup
uses: ./.github/actions/setup

- name: Install docs dependencies
run: pnpm install --ignore-scripts
working-directory: .docs-checkout

- name: Snapshot specs from docs main
run: pnpm tsx api-codegen/src/cli.ts snapshot --docs "$GITHUB_WORKSPACE/.docs-checkout"

- name: Regenerate SDK internals
run: |
pnpm run build:libs
pnpm run generate

- name: Remove docs checkout before PR
run: rm -rf .docs-checkout

- name: Open PR if anything changed
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore(api-codegen): bump spec snapshots from docs main"
title: "chore(api-codegen): bump API spec snapshots"
body: |
Automated re-snapshot of the bundled OpenAPI/OpenRPC specs from
`alchemyplatform/docs` main, plus regenerated SDK internals.

Review the `api-codegen/specs/` diff for what moved
upstream and the `src/generated/` diff for the type impact.
Public types in `packages/data-apis/src/types.ts` are aliases —
check whether any public-surface change warrants a semver note.
branch: chore/bump-api-specs
delete-branch: true
6 changes: 6 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ jobs:
- name: Typecheck Test
run: pnpm run test:typecheck

- name: Check generated API code is up to date
run: |
pnpm run generate
git diff --exit-code packages/*/src/generated api-codegen/specs || \
(echo "::error::Generated API code is out of date or spec snapshots were hand-edited. Run 'pnpm generate' and commit the changes." && exit 1)

- name: Check SDK reference docs are up to date
run: |
pnpm run docs:sdk
Expand Down
42 changes: 42 additions & 0 deletions api-codegen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# @alchemy/api-codegen

Internal (unpublished) codegen tool that generates SDK type internals from the
docs repo's bundled OpenAPI/OpenRPC specs. Design doc: `data-sdk-codegen-plan.md`
(alchemy-cli repo, alongside the data SDK scope plan).

## Two-stage pipeline

```
alchemyplatform/docs (hand-authored YAML)
│ pnpm snapshot ← network/local-checkout stage, run rarely
specs/*.json + specs.lock.json ← committed snapshots, pinned by docs SHA + sha256
│ pnpm generate ← offline + deterministic, run on every change
packages/<target>/src/generated/ ← committed TypeScript (prettier-formatted)
```

- **`pnpm --filter @alchemy/api-codegen snapshot`** — bundles specs from a local
docs checkout (`--docs <dir>`, `ALCHEMY_DOCS_DIR`, or `../docs` relative to the
repo root) using the docs repo's own tooling (redocly for OpenAPI, its
`generate:rpc` script for OpenRPC), copies the bundled JSON into `specs/`, and
writes `specs.lock.json` (docs commit SHA, branch, sha256 per file). The docs
working tree must be clean (`--allow-dirty` to override).
- **`pnpm generate`** (root, or `pnpm --filter @alchemy/data-apis generate`) —
reads only the committed snapshots, verifies checksums against the lockfile,
and emits TypeScript into the target package. Never touches the network.

## Updating specs

1. Pull/checkout the desired commit in your local docs clone.
2. `pnpm --filter @alchemy/api-codegen snapshot`
3. `pnpm generate`
4. Review the `specs/` + `src/generated/` diff and commit.

## Targets

Each consuming package declares a `codegen.manifest.ts` at its package root
(operationIds / RPC methods → export names, path normalization rules) and a
`generate` script invoking `src/cli.ts --target <name>`. Targets are registered
in `src/targets/`. The generator hard-errors if a manifest references a spec
operation that no longer exists in the snapshot — that's the drift alarm.
25 changes: 25 additions & 0 deletions api-codegen/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@alchemy/api-codegen",
"version": "0.0.0",
"description": "Internal codegen tool: generates SDK type internals from the docs repo's bundled OpenAPI/OpenRPC specs",
"author": "Alchemy",
"license": "MIT",
"private": true,
"type": "module",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"snapshot": "tsx src/cli.ts snapshot",
"test": "vitest",
"test:run": "vitest run"
},
"devDependencies": {
"json-schema-to-typescript": "15.0.4",
"openapi-typescript": "7.13.0",
"prettier": "3.3.3",
"typescript-template": "workspace:*"
}
}
Loading
Loading