Skip to content

Document project structure; split Archive and SerializedFile into their own libraries#88

Merged
SkowronskiAndrew merged 4 commits into
mainfrom
doc-improvements
Jul 6, 2026
Merged

Document project structure; split Archive and SerializedFile into their own libraries#88
SkowronskiAndrew merged 4 commits into
mainfrom
doc-improvements

Conversation

@SkowronskiAndrew

Copy link
Copy Markdown
Collaborator

Summary

This is a documentation and refactoring change for the v2.0 release; there is no
associated issue.

The README.md "Repository content" section was reworked to actually explain the
solution's design, with a Mermaid diagram of how the projects layer (base libraries →
feature libraries → CLI) and prose describing each. While documenting this it became
clear that the archive and serialized-file commands were implemented directly inside
the UnityDataTool CLI assembly, whereas every other feature (analyze, dump,
find-refs) lives in its own class library. That inconsistency was awkward to document
and out of step with the rest of the repo, so those commands were extracted into their
own libraries to match the established one-library-per-feature pattern.

Changes

Documentation

  • Rewrote the "Repository content" section of README.md: added a Mermaid dependency
    diagram, grouped the projects into command-line tool / feature libraries / base
    libraries, and added a short "Tests and test data" subsection.
  • Updated the Component Hierarchy in AGENTS.md to match.

Restructure

  • Extracted the archive command into a new Archive library (ArchiveTool +
    WebBundleHelper) and the serialized-file command into a new SerializedFile
    library (SerializedFileTool). Both are peers of TextDumper, depending only on
    UnityBinaryFormat and UnityFileSystem.
  • Each new library follows the existing conventions: an <Name>Tool class, a nested
    OutputFormat enum (mirroring TextDumperTool.DumpFormat), and a small folder
    README.md pointing at the corresponding Documentation/command-*.md.
  • Program.cs is now purely CLI wiring; the OutputFormat enum and the
    System.IO.Packaging / UnityBinaryFormat references that only existed for those
    commands moved out of the CLI project accordingly.

API naming

  • Renamed the tool methods to be self-documenting about what they emit: List* for
    console listings of a collection, Print* for a single record/summary, Extract* for
    writing files (e.g. HandleListListContent, HandleHeaderPrintHeader,
    HandleExtractExtractContent). No behavior change.

Testing

dotnet test — full suite green (725 passed, 10 skipped, 0 failed) and a clean Release
build with no warnings. The command tests exercise archive and serialized-file
end-to-end through Program.Main, so they cover the moved code and renamed API; no test
logic changed.

For consistency with the other command implementations - it didn't make much sense that some commands were implemented directly inside UnityDataTool and others as separate libraries.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates repository documentation for the v2.0 release and refactors the CLI so the archive and serialized-file commands follow the repo’s established “one feature = one library” pattern (matching Analyzer, TextDumper, etc.). The CLI (UnityDataTool) becomes primarily command wiring, with the moved implementations living in new Archive and SerializedFile class libraries.

Changes:

  • Reworked README.md and updated AGENTS.md to document the layered project structure and dependencies (including a Mermaid diagram).
  • Extracted archive into a new Archive library and serialized-file into a new SerializedFile library; updated the CLI to call into these tools.
  • Renamed command handler methods to more explicit verbs (List*, Print*, Extract*) without intended behavior changes.

Reviewed changes

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

Show a summary per file
File Description
UnityDataTools.sln Adds the new Archive and SerializedFile projects to the solution.
UnityDataTool/UnityDataTool.csproj Moves dependencies from the CLI into feature libraries via new project references.
UnityDataTool/Program.cs Updates CLI wiring to call ArchiveTool / SerializedFileTool and removes the CLI-level OutputFormat.
UnityDataTool.Tests/WebBundleSupportTests.cs Updates test compilation by importing the new UnityDataTools.Archive namespace.
Archive/Archive.csproj Introduces the new Archive library project (including System.IO.Packaging).
Archive/ArchiveTool.cs Hosts the extracted archive command implementation and output format enum.
Archive/WebBundleHelper.cs Updates namespace and ties listing output formatting to ArchiveTool.OutputFormat.
Archive/README.md Adds library README pointing to the command documentation.
SerializedFile/SerializedFile.csproj Introduces the new SerializedFile library project.
SerializedFile/SerializedFileTool.cs Hosts the extracted serialized-file command implementation and output format enum.
SerializedFile/README.md Adds library README pointing to the command documentation.
README.md Rewrites the “Repository content” section with a layered overview and dependency diagram.
AGENTS.md Updates the component hierarchy to reflect the new feature libraries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
* UnityFileSystem: a .NET class library, with source and binaries, that wraps the native
`UnityFileSystemApi` to mount Unity Archives and read SerializedFiles.
* UnityBinaryFormat: C# parsers and helpers for reading data out of Unity Archives and SerializedFiles.
* UnityDataModels: shared C# models for the reading JSON format files produced by the build (Addressables BuildLayout.json, Content Directory ContentLayout.json).
Comment thread README.md Outdated
Comment thread Archive/Archive.csproj
Comment on lines +3 to +9
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<LangVersion>latest</LangVersion>
</PropertyGroup>
Comment on lines +3 to +9
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<LangVersion>latest</LangVersion>
</PropertyGroup>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@SkowronskiAndrew SkowronskiAndrew marked this pull request as ready for review July 6, 2026 19:49
@SkowronskiAndrew SkowronskiAndrew merged commit 74bf384 into main Jul 6, 2026
5 checks 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.

2 participants