Skip to content

Conversation

@myk93
Copy link
Contributor

@myk93 myk93 commented Aug 17, 2025

This pull request introduces support for adding custom XML parts to generated Excel workbooks, specifically for registering Connected Workbooks metadata. The changes include new utilities for managing custom XML items, updating content types and relationships, and integrating these steps into the workbook generation process. Additionally, several constants and error messages were added to support these features.

Custom XML support for Connected Workbooks:

  • Added new utility functions in xmlInnerPartsUtils.ts to:

    • Determine the next available custom XML item number,
    • Check for the existence of a Connected Workbook custom XML item,
    • Add content type overrides for custom XML items,
    • Add relationships for custom XML items in the workbook relationships file.
  • Introduced a new function addCustomXMLToWorkbook in xmlPartsUtils.ts that orchestrates the creation and registration of custom XML items when generating a workbook.

  • Integrated the custom XML addition step into the main workbook generation pipeline in workbookManager.ts.

Constants and error handling enhancements:

  • Added new constants to constants.ts for custom XML paths, folder names, XML element/attribute names, error messages, and custom XML content templates.
  • Updated imports and usages to leverage new constants for improved maintainability and clarity.

Other minor improvements:

  • Updated the package version in package.json to 3.4.0-beta.
  • Improved error handling and folder path management for table file lookups.

These changes ensure that every generated workbook includes the necessary custom XML data and registrations for Connected Workbooks, improving interoperability and metadata support.

@myk93 myk93 requested a review from Copilot August 18, 2025 09:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for custom XML parts to Excel workbooks, specifically for registering Connected Workbooks metadata. The implementation includes utility functions for managing custom XML items, updating content types and relationships, and integrating custom XML generation into the workbook creation pipeline.

  • Introduces comprehensive custom XML support with proper workbook registration
  • Adds utility functions for determining item numbers, checking existence, and managing relationships
  • Integrates custom XML addition into the main workbook generation workflow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/xmlInnerPartsUtils.test.ts Adds test cases for custom XML addition functionality
src/workbookManager.ts Minor type casting improvements for template file handling
src/utils/xmlPartsUtils.ts Adds main orchestration function for custom XML workbook integration
src/utils/xmlInnerPartsUtils.ts Implements core utility functions for custom XML management
src/utils/constants.ts Defines constants, templates, and configuration for custom XML support
package.json Updates version to 3.3.3-beta

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@myk93 myk93 merged commit b2010d2 into microsoft:main Sep 4, 2025
1 check passed
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.

3 participants