Files
Felix ZhangandGitHub d54e237815 chore: automate release process with release-please (#269)
* chore: automate release process with release-please

Replace the manual 3-step release process (version bump PR, trigger
workflow, write release notes) with release-please automation that
reduces it to a single step: merge the auto-generated Release PR.

Made-with: Cursor

* chore: add AGENTS.md/CLAUDE.md and align account-ui publish auth

- Add agent guideline files for Cursor and Claude Code with repo-specific
  conventions (Yarn 4, Preact, path aliases, generated files, etc.)
- Align account-ui publish job to use OIDC auth instead of NPM_TOKEN,
  matching the account-sdk publish pattern

Made-with: Cursor

* chore: make CLAUDE.md a symlink to AGENTS.md

Single source of truth for agent guidelines.

Made-with: Cursor

* chore: align canary publish to use OIDC auth

Match the pattern in release-please.yml: use OIDC via id-token instead
of explicit NPM_TOKEN, and add npm update step.

Made-with: Cursor

* chore: align deprecated release-ui-manual to use OIDC auth

Consistent with all other publish workflows.

Made-with: Cursor
2026-04-15 15:06:30 -07:00

2.6 KiB

Agent Guidelines

Package manager

Use Yarn 4 (Berry). Never use npm install or npx -- use yarn and yarn dlx instead. The lockfile is yarn.lock, not package-lock.json.

Monorepo structure

  • packages/account-sdk (@base-org/account) -- the core SDK
  • packages/account-ui (@base-org/account-ui) -- framework-specific UI components
  • packages/account-cli (@base-org/account-cli) -- CLI tool
  • examples/testapp -- playground app (not published)

Build order matters: @base-org/account must build before @base-org/account-ui (it depends on it via workspace:*). Use yarn build:packages from root to build in the correct order.

Path aliases

Imports use a : prefix convention, not @/ or ~/:

  • ':core/*', ':util/*', ':store/*', ':sign/*', ':ui/*', ':interface/*' in account-sdk
  • ':types/*' in account-ui

These are defined in each package's tsconfig.base.json and resolved at build time by tsc-alias.

JSX runtime

Both packages use Preact, not React. jsxImportSource is set to "preact" in tsconfig. Import from preact and preact/hooks, not react.

The account-ui package has thin React adapters that use createElement from react -- these are the exception, not the rule.

Browser vs Node entry points

The SDK has dual entry points using a *.node.ts suffix convention:

  • index.ts / index.js -- browser build
  • index.node.ts / index.node.js -- Node build (e.g., CDP SDK integration)

The package.json exports map uses conditional browser and node fields to resolve the correct entry.

Generated files -- do not edit

  • **/*-css.ts -- generated from SCSS by compile-assets.cjs. Edit the .scss source instead.
  • **/*-svg.ts -- generated SVG assets.
  • src/core/telemetry/telemetry-content.ts in account-sdk -- generated from vendor JS.

Run node compile-assets.cjs (or yarn pretest / yarn build) to regenerate.

Linting and formatting

Uses Biome, not ESLint or Prettier. Config is at the repo root biome.json.

  • console.log is an error -- use console.warn, console.error, or console.info
  • Line width is 100 characters
  • Run yarn format before committing

Testing

Uses Vitest with jsdom environment. Tests are co-located as *.test.ts / *.test.tsx next to source files. Node-specific tests use *.node.test.ts.

Always run tests in non-interactive mode: yarn test --run (not yarn test).

Versioning

Do not manually edit version numbers in package.json. Versions are managed by release-please. PR titles must follow Conventional Commits format (feat:, fix:, chore:, etc.) -- this is enforced in CI and drives automated versioning.