webapp/platform/CLAUDE.OPTIONAL.md
webapp/platform/| 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 |
package.json, tests, and build scripts.npm run <script> --workspace=@mattermost/<pkg> (e.g., @mattermost/client).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';
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.
When adding dependencies to platform packages:
npm add package-name --workspace=@mattermost/client
webapp/STYLE_GUIDE.md.any.