Skip to content

About

Disassemble XML files into smaller, version-control friendly pieces and reassemble them on demand.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

config-disassembler

Crates.io Docs.rs CI codecov Mutation score CodSpeed Badge

Split large XML files into smaller, version-control–friendly pieces and reassemble them back into the original file.

Built for deeply nested XML such as Salesforce metadata (permission sets, profiles, flows, bots), where a single file can run to tens of thousands of lines and every change produces a noisy diff.

Breaking change in 0.12.0: support for JSON, JSON5, JSONC, YAML, TOON, TOML, and INI input files was removed. Those formats are far simpler to split and merge than XML, and the project now focuses on XML. The json, json5, jsonc, yaml, toon, toml, and ini subcommands and the disassemble, reassemble, format, and meta library modules no longer exist. If you need them, pin config-disassembler = "0.11". XML can still be split into JSON, JSON5, or YAML files with --format.

Installation

cargo install config-disassembler

Quick start

Split an XML file:

config-disassembler xml disassemble flow.xml   --unique-id-elements name,id

Result:

flow/
├── assignments/
├── decisions/
├── screens/
└── flow-meta.xml

Rebuild it:

config-disassembler xml reassemble flow

The output matches the original flow.xml.

CLI overview

config-disassembler xml <command> [options]

Commands:
  disassemble <path>   Split an XML file, or every XML file under a directory
  reassemble  <path>   Rebuild the original XML file from a disassembled directory

Run config-disassembler xml --help for every option.

Common options

Option Description
--unique-id-elements <list> Fields used to name split files
--strategy <name> unique-id (default) or grouped-by-tag
--format <fmt> Split-file format: xml (default), json, json5, yaml
--ignore-path <path> Ignore file path (default .cdignore)
--prepurge Remove existing output before writing
--postpurge Remove input after success

XML can be split into XML, JSON, JSON5, or YAML files and is always reassembled back into XML.

See docs/xml.md for every option, plus:

  • unique-id and grouped-by-tag strategies
  • split tags
  • multi-level disassembly
  • sidecar elements
  • round-trip verification

Ignore files

Directory disassembly supports .gitignore-style filtering using .cdignore.

Example:

**/generated/
**/Legacy_*.permissionset-meta.xml

Usage:

config-disassembler xml disassemble force-app/main/default/permissionsets

Library usage

use config_disassembler::xml::{
    DisassembleXmlFileHandler, ReassembleXmlFileHandler,
    verify_roundtrip, RoundtripStatus, VerifyOptions,
};

See docs/xml.md for round-trip verification.

Node.js bindings

Node.js support is available via napi-rs bindings: config-disassembler-node

Documentation

License

MIT

Contributing

See CONTRIBUTING.md.

About

Disassemble XML files into smaller, version-control friendly pieces and reassemble them on demand.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages