- NEVER use
anywithout asking the user first. If you think you needany, you probably don't understand the problem - Projects are ESM/TypeScript - look for
.ts/.tsxfiles, not.js
- NEVER use
pnpm --dir /path turboorcd /path && pnpm turbo. The--dirflag breaks turbo (pnpm misinterprets the path as the command to spawn). - Use turbo's
--filterflag to target packages:pnpm turbo typecheck --filter=@osdk/react - To typecheck a specific package:
pnpm turbo typecheck --filter=@osdk/the-package - To run tests in a package:
pnpm turbo test --filter=@osdk/the-package - For vitest directly:
pnpm --dir packages/the-package vitest run
- Every PR that changes published package code needs exactly ONE changeset per branch
- Create manually: add
.changeset/<descriptive-name>.mdwith YAML front matter listing"@osdk/package-name": patch|minor|majorand a one-line summary - Check
.changeset/before creating - do NOT create duplicate changesets on the same branch - Changeset summaries should be specific ("add drag-and-drop reordering to filter list" not "update filter list")
- CI will fail if a changeset is missing for changed packages
- Format only your changed files before committing — never run bare
npx dprint fmt, which reformats the entire repo:git ls-files --modified --others --exclude-standard | xargs npx dprint fmt - The pre-commit hook runs
dprint checkand will reject unformatted code - To check without fixing:
npx dprint check
- Always put new components in their own file and create separate components instead of inline functions
- NEVER conditionally call React hooks
- ALWAYS keep components rendering during loading/error states. Don't use early returns like
if (isLoading) return <LoadingMessage />. Show loading/error indicators while rendering existing data to prevent UI flashing - @osdk/react hooks may have data while loading (reloading invalidated data). Incorporate loading state comprehensively, not as shortcuts
- Call actions:
const { applyAction } = useOsdkAction(modifyEmployee)thenapplyAction({ employee, primary_office_id }) - Direct client:
$(modifyEmployee).applyAction({ employee, primary_office_id }) - Read docs/react/getting-started.md when working with @osdk/react
- This project uses pnpm. DO NOT use npm
- NEVER disable gpg signing unless explicitly requested
- Monorepo: run tests from individual packages, not root
- When making changes to a package's public API (exports, types, function signatures), run API extractor:
pnpm turbo check-api --filter=@osdk/the-package - This updates the API report in
etc/<package>.report.api.md— commit the updated report - API extractor requires transpiled types, so
transpileTypesruns automatically as a dependency
@osdk/apihas a quickinfo snapshot harness atpackages/api/src/__quickinfo_snapshot__/that pins the hover-tooltip type strings for high-traffic SDK surfaces (ObjectSet methods, Osdk.Instance, AggregationsResults, Actions, Queries, …)- If a snapshot test fails after a type-graph refactor: run
pnpm updateSnapshots --filter=@osdk/api, inspect the resulting__snapshots__/*.snapdiff, and confirm the change is intentional before committing - Read
packages/api/src/__quickinfo_snapshot__/README.mdbefore adding new probes — the "Philosophy" section spells out the load-bearing rule (probes must render the same string TS shows on hover; noExpand<T>/Force<T>-style helpers)
- Before pushing to a PR, run
pnpm turbo transpileglobally to ensure all packages compile - This catches cross-package build issues that per-package checks may miss
- Do not fix diagnostic warnings in old code
@osdk/foundry.*and@osdk/internal.foundry.*versions are pinned in thefoundry-platform-typescriptcatalog inpnpm-workspace.yaml- To bump: update the catalog versions, run
pnpm install, then fix type errors iteratively withpnpm turbo typecheckuntil all packages pass - Common breakages: new variants in
QueryDataTypediscriminated unions (find exhaustive switches viaconst _: never), new required fields on types likeQueryTypeV2in test stubs, and fields becoming optional - After fixing types, update snapshots with
pnpm vitest run --updatein affected packages - Validate with
pnpm checkbefore finalizing the PR