Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

Extends the manifest generation system to include MDX documentation files alongside component manifests.

Implementation

  • code/addons/docs/src/manifest.ts: New experimental_manifests preset function that filters MDX entries tagged with manifest + (attached-mdx | unattached-mdx) and generates structured manifest entries
  • code/addons/docs/src/preset.ts: Exports the new manifest function
  • code/addons/docs/src/manifest.test.ts: Test coverage for MDX entry filtering, manifest structure, and edge cases

Manifest Structure

MDX manifests are accessible at /manifests/mdx.json:

interface MdxManifestEntry {
  id: string;
  name: string;
  path: Path;
  title: string;
  tags: string[];
  storiesImports: Path[];
}

interface MdxManifest {
  v: number;
  entries: Record<string, MdxManifestEntry>;
}

Example output:

{
  "v": 0,
  "entries": {
    "example--docs": {
      "id": "example--docs",
      "name": "docs",
      "path": "./Example.mdx",
      "title": "Example",
      "tags": ["manifest", "attached-mdx"],
      "storiesImports": ["./Example.stories.tsx"]
    }
  }
}

The implementation preserves existing manifests (e.g., components) and follows the established preset pattern.

Original prompt

Start implementation

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md
[Chronological Review: The conversation began with the user requesting enhancements to the manifest generation for the React renderer in Storybook. The user specified that addon-docs should include MDX files in the generated manifests, with specific tagging and structure requirements. The user then clarified that instead of modifying the existing generator.ts, a new manifest.ts should be created in addon-docs to extend the existing manifests. The user further refined the content structure for the MDX files to include meta properties similar to the existing component manifest. Finally, the user requested to start the implementation.]

[Intent Mapping:

  1. "We need to enhance our manifest generation..." - User wants to include MDX files in the component manifests.
  2. "no, do not extend generator.ts..." - User specifies to create a new manifest.ts file in addon-docs.
  3. "my original content proposal was too simplistic..." - User refines the structure of the MDX entries to include meta properties.
  4. "Start implementation" - User requests to begin coding the solution.]

[Technical Inventory:

  • Technologies: Storybook, React
  • Concepts: Manifest generation, MDX files, component manifests, addon-docs
  • Decisions: Create a new manifest.ts file instead of modifying existing generator.ts, follow existing patterns for structure.]

[Code Archaeology:

  • File discussed: /Users/jeppe/dev/work/storybook/storybook/code/core/src/core-server/utils/StoryIndexGenerator.test.ts
  • Proposed new file: /Users/jeppe/dev/work/storybook/storybook/code/core/src/core-server/utils/addon-docs/manifest.ts (not yet created)
  • Key changes: Structure of MDX entries to include meta properties.]

[Progress Assessment:

  • Completed: User has outlined the requirements for the new manifest generation.
  • Pending: Implementation of the new manifest.ts file and the logic to handle MDX files.]

[Context Validation: All necessary details for continuing the implementation of the new manifest generation are captured, including structure and tagging requirements.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested to "Start implementation."
  • Tool Results Summary: No specific tool results were generated as the request was for implementation initiation.
  • Pre-Summary State: The agent was preparing to begin coding the new manifest generation logic based on the user's specifications.
  • Operation Context: The commands were executed to initiate the coding process for the new functionality in addon-docs, aligning with the user's goal of enhancing the manifest generation.]
1. Conversation Overview: - Primary Objectives: - "We need to enhance our manifest generation..." - Include MDX files in the component manifests. - "no, do not extend generator.ts..." - Create a new manifest.ts file in addon-docs. - "my original content proposal was too simplistic..." - Refine the structure of MDX entries to include meta properties. - "Start implementation" - Begin coding the solution. - Session Context: The conversation flowed from outlining requirements to refining the structure and finally requesting implementation. - User Intent Evolution: The user initially proposed a simple mapping for MDX files but later refined it to include more complex meta properties.
  1. Technical Foundation:
  • Storybook: A framework for building UI components in isolation.
  • React: The library used for building user interfaces.
  • Manifest Generation: The process of creating a structured representation of components and their associated documentation.
  1. Codebase Status:
  • File Name: StoryIndexGenerator.test.ts
  • Purpose: Testing the story index generation functionality.
  • Current State: User is preparing to implement a new manifest generation logic.
  • Key Code Segments: Not specified yet as implementation has not started.
  • Dependencies: Will relate to the existing component manifest structure.
  1. Problem Resolution:
  • Issues Encountered: Initial proposal for MDX structure was too simplistic.
  • Solutions Implemented: User refined the structure to include meta properties.
  • Debugging Context: No ongoing issues reported; focus is on new implementation.
  • Lessons Learned: Importance of detailed structure in manifest generation.
  1. Progress Tracking:
  • Completed Tasks: User has outlined the requirements for the new manifest generation.
  • Partially Complete Work: Implementation of the new manifest.ts file is pending.
  • Validated Outcomes: No features confirmed working yet as implementation has not started.
  1. Active Work State:
  • Current Focus: Preparing to implement the new manifest generation logic in addon-docs.
  • Recent Context: User has clarified requirements and is ready to start coding.
  • Working Code: No specific code snippets discussed recently.
  • Immediate Context: User requested to "Start implementat...

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 22, 2025
Copilot AI and others added 3 commits December 22, 2025 10:49
- Create manifest.ts to generate manifests for MDX files
- Filter MDX entries with 'attached-mdx' or 'unattached-mdx' tags
- Export experimental_manifests from preset.ts
- Add comprehensive tests for MDX manifest generation

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for MDX files in manifest generation feat(addon-docs): add MDX manifest generation Dec 22, 2025
Copilot AI requested a review from JReinhold December 22, 2025 10:55
Base automatically changed from jeppe/support-manifest-tag-in-preview to next December 22, 2025 22:04
@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]

🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫 PR title must be in the format of "Area: Summary", With both Area and Summary starting with a capital letter Good examples: - "Docs: Describe Canvas Doc Block" - "Svelte: Support Svelte v4" Bad examples: - "add new api docs" - "fix: Svelte 4 support" - "Vue: improve docs"
🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against 8417c4e

@nx-cloud
Copy link

nx-cloud bot commented Dec 22, 2025

View your CI Pipeline Execution ↗ for commit b011a73

Command Status Duration Result
nx run-many --targets compile ✅ Succeeded 34s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-22 22:06:48 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants