chore: consume Bird from Gitea Packages

This commit is contained in:
2026-07-14 03:00:09 +09:00
parent d8827b6513
commit 6a4f7ca068
7 changed files with 58 additions and 48 deletions
@@ -6,11 +6,11 @@
**Architecture:** Keep Bird unchanged and compose its existing `getTweet()` and `getThreadPaged()` methods behind one new TanStack Start GET server function. The first web page resolves the focal post to its conversation root and performs two Bird reads; continuation pages carry the root ID with the opaque cursor and perform one Bird read. Reuse the established TanStack Query pagination and PostCard rendering while keeping the focal post distinct and removing duplicates from the conversation list.
**Tech Stack:** Node.js 22, pnpm 11.9.0, TanStack Start/Router/Query, React 19, Zod 4, linked `@yuta/bird`, Vitest, Testing Library, Playwright, Nix Chromium, hand-written CSS.
**Tech Stack:** Node.js 22, pnpm 11.9.0, TanStack Start/Router/Query, React 19, Zod 4, published `@yuta/bird@0.10.0`, Vitest, Testing Library, Playwright, Nix Chromium, hand-written CSS.
## Global Constraints
- Bird remains clean at `81921226f099e7f7a2107be15fc9783218a6f400`; do not edit, commit, push, or publish it.
- Use the published `@yuta/[email protected]` interface; do not modify Bird as part of this feature.
- Use only Bird's existing `getTweet()` and `getThreadPaged()` methods and the existing `TweetDetail` relay operation.
- Preserve the current Bird ordering: chronological within each fetched page, with cursor pages appended in retrieval order.
- Do not add a dependency, database, cookie, history, recommendation, related-post feed, mutation control, generic Bird dispatcher, or generic relay proxy.
@@ -1668,24 +1668,23 @@ export const searchPosts = createServerFn({ method: 'GET' })
export const loadThreadPosts = createServerFn({ method: 'GET' })
```
- [ ] **Step 5: Verify Bird stayed unchanged and local**
- [ ] **Step 5: Verify the published Bird dependency is self-contained**
Run from `../bird`:
Run from Twitter Lite:
```bash
git rev-parse HEAD
git status --short --branch
git rev-list --count origin/main..HEAD
git log --oneline origin/main..HEAD
rg -n '"@yuta/bird": "0.10.0"' package.json
rg -n '@yuta/[email protected]' pnpm-lock.yaml
rg -n 'link:../bird' package.json pnpm-lock.yaml
readlink -f node_modules/@yuta/bird
```
Expected:
```text
81921226f099e7f7a2107be15fc9783218a6f400
## main...origin/main [ahead 1]
1
8192122 feat: support ranked tweet search
package.json and pnpm-lock.yaml pin 0.10.0
the local-link scan has zero matches
node_modules resolves inside the pnpm virtual store
```
- [ ] **Step 6: Perform the pre-commit documentation check**
@@ -23,7 +23,7 @@
- Load 20 posts per cursor page and continue automatically without a fixed page limit.
- Use Mist Instrument tokens and no remote fonts; respect keyboard focus and `prefers-reduced-motion`.
- Work test-first for every behavior change and run the pre-commit documentation check in both repositories.
- Do not push Bird or publish `@yuta/bird` without separate user authorization.
- Consume the separately authorized and published `@yuta/bird@0.10.0`; do not modify Bird from the app repository.
## File Map
@@ -385,7 +385,7 @@ git commit -m "feat: support ranked tweet search"
- Create: `tests/setup.ts`
**Interfaces:**
- Consumes: local `@yuta/bird` through `link:../bird`.
- Consumes: published `@yuta/bird@0.10.0` through Gitea Packages.
- Produces: `getRouter()` with an SSR-aware QueryClient.
- Produces: a buildable TanStack Start/Nitro application at `http://127.0.0.1:3000`.
@@ -422,6 +422,12 @@ Run `nix flake lock` to generate `flake.lock`.
- [ ] **Step 2: Add pinned package and tool configuration**
Create `.npmrc`:
```ini
@yuta:registry=https://git.yutakobayashi.com/api/packages/yuta/npm/
```
Create `package.json`:
```json
@@ -451,7 +457,7 @@ Create `package.json`:
"@tanstack/react-router": "1.170.17",
"@tanstack/react-router-ssr-query": "1.167.1",
"@tanstack/react-start": "1.168.27",
"@yuta/bird": "link:../bird",
"@yuta/bird": "0.10.0",
"nitro": "3.0.260610-beta",
"react": "19.2.7",
"react-dom": "19.2.7",
@@ -2855,7 +2861,7 @@ git commit -m "feat: apply mist instrument interface"
- Verify: `docs/superpowers/specs/2026-07-13-twitter-lite-design.md`
**Interfaces:**
- Consumes: the complete app and local Bird build.
- Consumes: the complete app and published Bird package.
- Produces: deterministic desktop/mobile browser coverage and an opt-in read-only live smoke test.
- [ ] **Step 1: Add the browser configuration**
@@ -3137,17 +3143,11 @@ handle, profile URL, or search query.
## Setup
Use Nix, or Node.js `>=22.12.0` with pnpm `11.9.0`. Obtain the supplied local
Bird checkout beside this repository at unpublished commit
`81921226f099e7f7a2107be15fc9783218a6f400`. A fresh remote clone alone does
not contain that Top/Latest commit yet.
Use Nix, or Node.js `>=22.12.0` with pnpm `11.9.0`. The committed `.npmrc`
routes `@yuta` packages to Gitea Packages, and `@yuta/bird@0.10.0` contains
the required Top/Latest interface.
```bash
cd ../bird
git rev-parse HEAD
nix develop -c pnpm install --frozen-lockfile
nix develop -c pnpm run build:dist
cd ../twitter-lite
nix develop -c pnpm install --frozen-lockfile
```
@@ -55,14 +55,12 @@ The product reduces ambient discovery rather than limiting how far a deliberate
## Repositories and Delivery Sequence
Work occurs in two repositories:
Work spans two repositories and the Gitea package registry:
1. Clone Bird from `https://git.yutakobayashi.com/yuta/bird` into the sibling path `../bird`.
2. Extend Bird's public search interface and commit the change locally.
3. Consume the local Bird checkout from Twitter Lite with the pnpm dependency `link:../bird`.
4. Build and verify Twitter Lite against the linked Bird package.
The Bird commit is not pushed and no package is published without separate user authorization. Once a compatible Bird version is published, replacing the local link with that version is a separate maintenance task.
1. Extend Bird's public search interface in `https://git.yutakobayashi.com/yuta/bird`.
2. Release the compatible interface as `@yuta/[email protected]` in Gitea Packages.
3. Route the `@yuta` scope through the committed `.npmrc` and pin Twitter Lite to `@yuta/[email protected]`.
4. Build and verify Twitter Lite against the published package without a sibling Bird checkout.
## Bird Library Change