Files
team/webapp/platform/CLAUDE.OPTIONAL.md
zeekay c671872b0b The packages this repo publishes carry our scope
webapp/platform publishes six packages and the channels app carries a seventh
in-tree, and every one of them went out under @mattermost — types, client,
components, shared, eslint-plugin, compass-icons and mattermost-redux — while
the plugin that consumes them already asks for @hanzoteam/types and
@hanzoteam/client by name. It could not build: it was asking a registry for a
package nobody publishes.

They are @hanzoteam/* now, and mattermost-redux is @hanzoteam/redux, moved to
src/packages/@hanzoteam/redux so the directory matches the alias that always
pointed there.

@mattermost/calls-common and @mattermost/desktop-api stay. Those are published
by someone else and resolved from npm; renaming a package we merely consume
would name a thing that does not exist.

The jest moduleNameMapper entries needed doing by hand — they spell the scope
inside a regex, so a sweep over the plain name walks straight past them, and a
missed one fails at require time rather than at build.
2026-08-28 23:44:39 -07:00

1.8 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
@hanzoteam/types types/ TypeScript type definitions
@hanzoteam/client client/ REST and WebSocket API client
@hanzoteam/components components/ Shared React components
@hanzoteam/shared shared/ Cross-product components and utilities for the web app and plugins (e.g. Button, WithTooltip). Prefer these over rolling your own
@hanzoteam/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., @hanzoteam/client).
  • Versioning follows the monorepo; publishable artifacts come from CI pipelines.

Import Convention

Always import using the full package name:

// CORRECT
import {Client4} from '@hanzoteam/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=@hanzoteam/client

Expectations

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