Skip to content

Commit 21cce03

Browse files
committed
Update: Agents.dm
1 parent b6dcb57 commit 21cce03

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

AGENTS.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
## Workspace shape
1010
- The authoritative workspace list is `pnpm-workspace.yaml`; it includes `backend`, `frontend`, `frontend-embed`, `frontend-worker`, `frontend-shared`, `frontend-builder`, `i18n`, `icons-subsetter`, `sw`, `misskey-js`, `misskey-js/generator`, `misskey-reversi`, and `misskey-bubble-game`.
11+
- Root `package.json` has a stale/incomplete `workspaces` list; do not use it as the source of truth.
1112
- `packages/shared` exists but is not a pnpm workspace package.
12-
- Use workspace filters (`pnpm --filter <pkg> ...` / `pnpm -F <pkg> ...`) instead of ad hoc `cd` commands when possible.
13+
- Use workspace filters (`pnpm --filter <pkg> ...` / `pnpm -F <pkg> ...`) for targeted work; `pnpm -r` is for intentionally running every workspace script.
1314

1415
## Type4ny fork context
1516
- This repo redevelops Type4ny features on top of newer Misskey code; when a Type4ny feature is reported missing, compare against `https://github.com/type4ny-project/type4ny` (or `~/Coding/Type4ny` if that checkout exists locally).
@@ -19,25 +20,27 @@
1920
- Full build: `pnpm build` (`build-pre` -> recursive package builds -> `build-assets`).
2021
- Dev server: `pnpm dev`; backend proxies Vite at `/vite` and `/embed_vite`, so Vite-only behavior can differ from production.
2122
- Lint all workspaces: `pnpm lint`; root tests: `pnpm test`, but backend tests need services/config below.
22-
- Focused frontend/SDK checks: `pnpm --filter frontend test`, `pnpm --filter misskey-js test`, `pnpm --filter i18n verify`.
23+
- Focused checks: `pnpm --filter frontend test`, `pnpm --filter frontend typecheck`, `pnpm --filter misskey-js test`, `pnpm --filter i18n verify`.
2324
- Backend unit/e2e tests: copy `.github/misskey/test.yml` into `.config/`, start `docker compose -f packages/backend/test/compose.yml up`, then run `pnpm --filter backend test` or `pnpm --filter backend test:e2e`.
2425
- Run a single backend test with the path after `--`, e.g. `pnpm --filter backend test -- packages/backend/test/unit/activitypub.ts` or `pnpm --filter backend test:e2e -- packages/backend/test/e2e/nodeinfo.ts`.
2526
- Migration checks in CI use `MISSKEY_CONFIG_YML=test.yml pnpm --filter backend migrate` and `MISSKEY_CONFIG_YML=test.yml pnpm --filter backend check-migrations`.
27+
- Federation tests use `packages/backend/test-federation/`; its README hardcodes `NODE_VERSION=22`, but CI derives the exact version from `.node-version` or `.github/min.node-version`.
2628

2729
## Generated files and codegen
28-
- Do not hand-edit generated outputs: `built/`, `packages/*/built/`, `packages/frontend-shared/js-built/`, `packages/i18n/src/autogen/locale.ts`, `packages/misskey-js/src/autogen/`, `packages/misskey-js/generator/built/autogen/`, `packages/misskey-js/etc/misskey-js.api.md`, `packages/frontend/storybook-static/`, `cypress/screenshots/`, and `cypress/videos/`.
30+
- Do not hand-edit generated outputs: `built/`, `packages/*/built/`, `packages/frontend-shared/js-built/`, `packages/i18n/src/autogen/locale.ts`, `packages/misskey-js/src/autogen/`, `packages/misskey-js/generator/built/autogen/`, `packages/misskey-js/etc/misskey-js.api.md`, `packages/frontend/storybook-static/`, `built/cloudflare-worker/assets/`, `cypress/screenshots/`, and `cypress/videos/`.
2931
- Backend config is generated by `packages/backend/scripts/compile_config.js` into repo-root `built/.config.json`; backend start/migrate commands run `compile-config` first.
3032
- Backend OpenAPI JSON comes from `pnpm --filter backend generate-api-json`; `packages/backend/src/server/api/openapi/OpenApiServerService.ts` serves `/api-doc` and `/api.json`.
31-
- To refresh misskey-js types, use root `pnpm build-misskey-js-with-types`; it builds backend deps, generates `api.json`, copies it into `packages/misskey-js/generator/api.json`, runs autogen, builds SDK, then runs API Extractor.
32-
- Storybook files are generated by `packages/frontend/.storybook/generate.tsx`; after adding/editing/removing `.stories.impl.ts`, `.stories.meta.ts`, or `.stories.msw.ts`, rerun the Storybook prebuild (`pnpm --filter frontend build-storybook-pre`).
33+
- Misskey-JS types are generated from backend OpenAPI. Never hand-edit `packages/misskey-js/src/autogen/`; use root `pnpm build-misskey-js-with-types` so backend `api.json`, generator output, SDK build, and API Extractor report stay in sync.
34+
- CI has `check-misskey-js-autogen.yml`; backend API changes that drift from generated SDK types will be rejected until the generated Misskey-JS files are refreshed.
35+
- Storybook `.stories.ts` files are generated by `packages/frontend/.storybook/generate.tsx`; after adding/editing/removing `.stories.impl.ts`, `.stories.meta.ts`, or `.stories.msw.ts`, rerun `pnpm --filter frontend build-storybook-pre`.
3336
- `packages/icons-subsetter/src/generator.ts` scans literal Tabler icon class names; do not build dynamic classes like ``ti-${name}`` without a literal fallback.
3437

3538
## Architecture gotchas
3639
- Backend build uses Rolldown (`packages/backend/rolldown.config.ts`), not plain `tsc`; backend typecheck uses `tsgo` for app, test, and federation configs.
3740
- Frontend build uses `packages/frontend/build.ts` around Vite; frontend routing is the custom `nirax` router, and route order matters.
3841
- Frontend code must call Misskey API endpoints through `misskeyApi`/`misskeyApiGet` from `@/utility/misskey-api.js`, not ad hoc `window.fetch` calls or manual `apiUrl` wrappers. Use direct fetch only for non-Misskey endpoints such as file upload transports or explicitly documented exceptions.
3942
- New Vue components should use Composition API with setup syntax; existing Options API components are legacy.
40-
- The Worker package is a broad frontend/static/SSR layer, not an `/api` proxy. Before `pnpm deploy:cloudflare-worker`, configure the no-worker backend overrides in `packages/frontend-worker/CLOUDFLARE_SINGLE_ORIGIN_ROUTES.md` (`/api/*`, `/streaming*`, auth, ActivityPub, etc.).
43+
- The Worker package is a broad frontend/static/SSR layer, not an `/api` proxy. Before `pnpm deploy:cloudflare-worker`, configure the no-worker backend overrides in `packages/frontend-worker/CLOUDFLARE_SINGLE_ORIGIN_ROUTES.md` (`/api/*`, `/streaming*`, auth, ActivityPub, `/api.json`, `/api-doc`, etc.).
4144
- Worker build/deploy commands are root wrappers: `pnpm build:cloudflare-worker` and `pnpm deploy:cloudflare-worker`; package-local scripts are `pnpm --filter frontend-worker cf:build`, `dev`, `deploy`, and `check`.
4245
- Do not edit `en-US.yml`; `.github/copilot-instructions.md` explicitly forbids it.
4346

0 commit comments

Comments
 (0)