Files
team/webapp/platform/CLAUDE.OPTIONAL.md
Nick MisasiandGitHub 2bc425abfe Add optional Claude.md orchestration for Webapp folder (#34668)
* Add CLAUDE.md documentation files for webapp directories

- Add root webapp CLAUDE.md with overview and build commands
- Add channels CLAUDE.md with architecture and testing info
- Add documentation for actions, components, selectors, utils
- Add documentation for sass, tests, and mattermost-redux
- Add platform documentation for client and types
- Update .gitignore

* Add CLAUDE docs and allow tracking

* Clarify CLAUDE instructions for i18n workflow

* Refactor webapp/CLAUDE.md into a nested hierarchy

Decomposed the monolithic webapp/CLAUDE.md into focused, context-aware
files distributed across the directory structure:
- webapp/CLAUDE.md (Root overview)
- webapp/channels/CLAUDE.md (Channels workspace)
- webapp/channels/src/components/CLAUDE.md
- webapp/channels/src/actions/CLAUDE.md
- webapp/channels/src/selectors/CLAUDE.md
- webapp/channels/src/packages/mattermost-redux/CLAUDE.md
- webapp/platform/CLAUDE.md (Platform workspace)
- webapp/platform/client/CLAUDE.md

* Move files to optional, then add script to move them to proper claud.md
2026-01-14 13:04:20 -05:00

1.7 KiB

CLAUDE: webapp/platform/

Purpose

  • Shared packages consumed by every Mattermost web experience (Channels, Boards, Playbooks, plugins).
  • Changes here affect multiple products—coordinate across teams before merging.

Packages

Package Directory Purpose
@mattermost/types types/ TypeScript type definitions
@mattermost/client client/ REST and WebSocket API client
@mattermost/components components/ Shared React components
@mattermost/eslint-plugin eslint-plugin/ Custom ESLint rules

Workspace Basics

  • Each subpackage is its own npm workspace with independent package.json, tests, and build scripts.
  • Run commands with npm run <script> --workspace=@mattermost/<pkg> (e.g., @mattermost/client).
  • Versioning follows the monorepo; publishable artifacts come from CI pipelines.

Import Convention

Always import using the full package name:

// CORRECT
import {Client4} from '@mattermost/client';
// INCORRECT - never use relative paths
import Client4 from '../platform/client/src/client4';

Build Relationship

Platform packages are automatically built on npm install via postinstall hook. Build order: types → client/components.

Note: When developing in channels, changes in platform packages may need a rebuild if not using a watcher that supports them.

Adding Dependencies

When adding dependencies to platform packages:

npm add package-name --workspace=@mattermost/client

Expectations

  • Follow webapp/STYLE_GUIDE.md.
  • Maintain 100% TypeScript coverage; no any.
  • Update downstream consumers when making breaking changes.