- Monorepo managed by
pnpmand Turborepo. - Packages live under
sdk/*(e.g.,sdk/web-pubsub/web-pubsub). - Shared tools in
common/tools/*(eslint plugin, dev-tool). - Infra/cache in
eng/*, docs indocumentation/*, samples insamples/*.
- Use Azure SDK MCP tools where available
pnpm install— install workspace deps (Node current LTS, pnpm v10).- Building packages: Due to workspace linking,
npm run clean && npm run buildunder a package directory will NOT work if dependencies aren't built. Always use:pnpm turbo build --filter=<package name>... --token 1(the trailing...builds the package and all its dependencies;--token 1enables remote cache read). - Full build:
pnpm build— builds all packages via Turborepo (avoid). - Tests: use the Azure SDK MCP tool
azsdk_package_run_tests. - Lint/format: use the Azure SDK MCP tool
azsdk_package_run_check, specifying lint or format. - Filter examples:
pnpm turbo build --filter sdk/web-pubsub/web-pubsub....
- TypeScript; 2-space indent; semicolons; printWidth 100; double quotes (see
.prettierrc.json). - Run
pnpm formatbefore PRs. - ESLint via
@azure/eslint-plugin-azure-sdk(do not disable rules). If the plugin isn’t built:pnpm build --filter @azure/eslint-plugin-azure-sdk.... - Naming: PascalCase classes; camelCase functions/vars; UPPER_SNAKE_CASE constants.
- Framework:
vitest; tests intest/**/*.spec.ts. - Node test config excludes browser/snippets; browser tests via
test:browser. - Coverage with Istanbul; reports in
coverage/(seevitest.shared.config.ts). - Important:
snippets.spec.tsfiles undersdk/**/*/test/are NOT real test files. They contain source code for snippets used in markdown documentation and documentation comments. Exclude these files from operations that update normal test files (e.g., refactoring tests, fixing test failures, updating test patterns).
preinstallenforcespnpm; Turborepo remote cache configured inturbo.json.- Do not log or commit secrets; the custom vitest reporter suppresses serialized errors.