Skip to content

Latest commit

 

History

History
288 lines (206 loc) · 12.3 KB

CONTRIBUTING.md

File metadata and controls

288 lines (206 loc) · 12.3 KB

Contributing to Siemens Industrial Experience Docs

Thank you for your interest in contributing! This documentation site supports the Siemens Industrial Experience (IX) design system. We welcome improvements to docs, blog posts, scripts, and plugins.


📋 Table of Contents

  1. Prerequisites
  2. How to Contribute
  3. Getting Started
  4. Development Workflows
  5. Design Token References
  6. Pull Request Process
  7. Code of Conduct
  8. Additional Resources

Prerequisites

Before contributing, ensure you have the required tokens and permissions:

GitHub Token

A valid GITHUB_TOKEN is required to build or start the documentation site (pnpm start / pnpm build). This token accesses artifacts from the siemens/ix repository, which contains the source code and example implementations that are downloaded during the build process to provide live code examples and previews in the documentation.

Important for Contributors:

  • Examples (code and preview) are automatically provided via artifacts from the siemens/ix repository during the start and build process
  • By default, examples are taken from the siemens/ix release set in .env.production (e.g. IX_REPO_BRANCH='@siemens/ix@5.3.0')
  • If your contribution depends on new or updated examples from an open siemens/ix pull request, point the build at that pull request's artifacts (see Using Examples from an Open siemens/ix Pull Request).
  • This applies to all contributors, including non-maintainers. While the siemens/ix pull request is still in progress, docs PRs can be open, but they can't be merged until the examples are included in a siemens/ix release.

Figma API Token (Optional)

For updating Figma design assets, you'll need a FIGMA_API_TOKEN with appropriate permissions.

Environment Setup

Create a .env file in the project root with the required tokens:

GITHUB_TOKEN=your-github-token-here
FIGMA_API_TOKEN=your-figma-api-token-here  # Optional, only for Figma updates

How to Contribute

There are several ways to contribute to this project:

  • 🐛 Report Issues: Use GitHub Issues for bugs, suggestions, or feature requests.
  • 📝 Improve Documentation: Spot errors or outdated info? Please update and submit corrections.
  • 📖 Add Blog Posts: Share insights, tutorials, or announcements via blog posts.
  • 🔧 Enhance Scripts/Plugins: Improve tooling in scripts/ or plugins/ directories.
  • 💡 Share Examples: Add use cases or demos to help others.

Getting Started

  1. Fork the repository on GitHub.
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/ix-docs.git
    cd ix-docs
  3. Install dependencies:
    pnpm install
  4. Set up environment (see Prerequisites for token setup).
  5. Create a branch for your changes:
    git checkout -b my-feature-branch
  6. Make your changes following the patterns below.

Development Workflows

Documentation Changes

  • Edit or add Markdown files in docs/
  • Component docs follow this structure:
    • docs/components/[component-name]/index.md - Basic headline information
    • docs/components/[component-name]/guide.md - Design system usage and guidelines
    • docs/components/[component-name]/code.mdx - Development examples and APIs
  • Test locally: pnpm start

Header Tags

Set component header tags in the front matter of the component's index.mdx, not in its tab pages:

formReady: true
deprecated:
  - /docs/legacy/input # link to the deprecated version
since: 6.0.0 # for new components
breaking-changes:
  - version: 6.0.0
    breaking:
      - description: 'Status variants renamed'
        link: /docs/home/migration/6_0_0#blind # migration guide or any external page
  • Property and event tags of the API tables come from the siemens/ix JSDoc: @since 6.0.0 and @breaking-change 6.0.0 <summary>.
  • All since and breaking change tags are managed manually: remove outdated component-level since and breaking-changes frontmatter entries when starting a new major. Outdated property and event tags should be removed in siemens/ix.
  • Each breaking-changes version renders one tag: it links to the first link and lists all descriptions with their links. The build fails on broken internal links and anchors (onBrokenLinks, onBrokenAnchors).

Using Examples from an Open siemens/ix Pull Request

If your docs import new examples that only exist in an open siemens/ix pull request (e.g. @site/docs/autogenerated/playground/<example>.mdx), the build fails with Module not found: Error: Can't resolve '@site/docs/autogenerated/playground/...'. The released artifacts referenced by .env.production don't contain these examples yet.

To build against the pull request's artifacts instead, add a .env.pullrequest file to the project root and commit it inside your PR:

IX_REPO_BRANCH='main'
IX_REPO_TYPE='pull request'
IX_REPO_PR='1234' # Number of the siemens/ix pull request
  • Both IX_REPO_TYPE='pull request' and IX_REPO_PR are required. Setting the PR number alone has no effect.
  • Values in .env.pullrequest override .env.production, both locally and in the PR build. Don't edit .env.production for this.
  • The siemens/ix pull request's build workflow (continuous integration, CI) must have completed successfully so its artifacts are available for download.
  • The deploy workflows delete .env.pullrequest before building, so deployments always use the release in .env.production.

Before merging your PR:

  1. Wait until the siemens/ix changes are merged and released.
  2. Update IX_REPO_BRANCH in .env.production to the new release (e.g. '@siemens/ix@5.4.0').
  3. Delete .env.pullrequest. If it's merged to main/development, later local and PR builds use outdated pull request artifacts.

The deploy workflows always build against the release in .env.production. If it doesn't contain the new examples yet, the deployment from main fails with the same Module not found error.

Blog Posts

  • Create blog/YYYY-MM-DD-title/index.md with images in the same folder
  • Follow existing post structure and frontmatter

Scripts and Plugins

  • Update files in scripts/ or plugins/ as needed
  • Test changes with pnpm build and pnpm start

Testing Your Changes

Updating Figma Images

If you need to refresh Figma design assets:

  1. Ensure you have a valid FIGMA_API_TOKEN in your .env file (see Prerequisites).

  2. Update all Figma images in Markdown files:

    pnpm update-figma '**/*.md?(x)'
  3. Or update specific files:

    pnpm update-figma 'docs/components/button/guide.md'
  4. Commit the updated images and references as part of your PR.

The script downloads new images and replaces outdated ones in the static/figma/ directory based on Figma asset references in your docs.

Design Token References

The token reference chain is authoritative from source to published package: @siemens-ux/design-tokens supplies canonical names, paths, types, and descriptions; the generator emits the source manifest and validates Community (previously Classic) as a value and structure delta; and IX publishes that manifest as @siemens/ix/tokens/manifest.json. The docs validate its schema, contract, provenance, coverage, and entries. The manifest contains metadata only: Community values come from the installed IX CSS, and Brand values come from the installed @siemens-ix/corporate-theme CSS.

To update a reference, publish the system-token, IX, and corporate-theme changes; update @siemens/ix, BRAND_VERSION, and the lockfile to matching releases; then run pnpm install and the documentation checks (pnpm test plus pnpm start and/or pnpm build).

To verify an unpublished IX change locally without publishing:

  1. From the IX checkout, build the package:
    pnpm --filter @siemens/ix build.scss
    pnpm --filter @siemens/ix test.manifest
  2. From the ix-docs checkout, link the local package and run the documentation checks. Use the .docs scripts to bypass the IX artifact download performed by prepare.docs; a local package version does not have a matching CI artifact:
    pnpm link <ix-repo>/packages/core
    pnpm test
    pnpm start.docs
    # or, instead of pnpm start.docs:
    pnpm build.docs
  3. Unlink the package, restore package.json and pnpm-lock.yaml to their pre-link contents, and reinstall:
    pnpm unlink @siemens/ix
    pnpm install --frozen-lockfile

With pnpm 10, pnpm link <path> can add a local override to package.json and rewrite pnpm-lock.yaml. Treat those changes as temporary and verify that neither file contains the local worktree path before committing. Do not work around validation failures with a committed local path dependency, a copied manifest, or a hardcoded fallback.

Placing token groups on a page

Each token table renders exactly one manifest group, selected with the section prop. Write the heading, and any text or images, in Markdown before the table. Use the heading levels to express the group hierarchy, and keep the explicit token-group-* heading ID so existing links still work:

## Background {#token-group-color-background}

Optional guidance, images, or examples.

<ColorTable section="color.background" />

## Data {#token-group-color-data}

### Sequential {#token-group-color-data-sequential}

#### Yellow {#token-group-color-data-sequential-yellow}

<ColorTable section="color.data.sequential.yellow" />
Component Allowed section values
ColorTable Every color group except color.border
BorderTable color.border
ShadowTable shadow groups, e.g. color.effects.shadow
TypographyTable typography groups, e.g. typography

pnpm start and pnpm build fail if a table has no section, a section does not match an allowed manifest group, a group is placed twice, or a manifest group is not placed on any page under docs/. When IX adds a group, add a heading and a matching table where it belongs.

Pull Request Process

  1. Prepare your changes:

  2. Commit and push:

    git add .
    git commit -m "Clear description of your changes"
    git push origin my-feature-branch
  3. Open a Pull Request on GitHub:

    • Clearly describe your changes in the PR description
    • Reference related issues (e.g., Closes #123)
    • For major changes, discuss via an issue first
  4. Review process:

    • Respond to review feedback promptly
    • Make requested changes and push updates
    • Your PR will be merged once approved. If it depends on an open siemens/ix pull request, it's merged only after those examples are released (see Using Examples from an Open siemens/ix Pull Request)

Code of Conduct

Please read and follow our Code of Conduct to ensure a welcoming environment for all contributors.

Additional Resources

For troubleshooting Figma integration or advanced usage, see the comments in plugins/figma-pictures/figma.ts and related scripts.