๐Ÿ”— stewbeet.plugins.merge_smithed_weld

๐Ÿ“„ Source Code: stewbeet/plugins/merge_smithed_weld/__init__.py ๐Ÿ”—
๐Ÿ“„ Source Code: stewbeet/plugins/merge_smithed_weld/weld.py ๐Ÿ”—

๐Ÿ”— Dependencies

  • โœ… Required: Generated base archives from archive plugin
  • โœ… Required: Configured output directory and project name
  • ๐Ÿ”ง Optional: Custom libraries in configured libs folder
  • ๐Ÿ”ง Optional: Official libraries (automatically detected from usage)
  • ๐Ÿ“ Position: Must run after archive plugin creates base zip files

๐Ÿ“‹ Overview

The merge_smithed_weld plugin merges generated datapacks and resource packs with their dependencies.
It uses Smithed Weld to combine project archives with library dependencies, official libraries,
and custom libraries into unified distribution packages with proper metadata handling,
consistent timestamps, and optimized compression for production deployment.

Some Features Showcase

Output directory will get both datapack and resource pack zipped

We can see inside the datapack all namespaces

๐ŸŽฏ Purpose

  • ๐Ÿ”— Merges project packs with library dependencies using Smithed Weld
  • ๐Ÿ“ฆ Combines custom libraries from configured libs folder
  • ๐Ÿ›๏ธ Integrates used official libraries automatically
  • ๐Ÿ› ๏ธ Handles proper pack.mcmeta and pack.png preservation
  • ๐Ÿ• Maintains consistent timestamps for reproducible builds
  • ๐Ÿ“‹ Creates distribution-ready merged archives

โš™๏ธ Configuration

๐ŸŽฏ Basic Example Configuration

# Requires output and project name configuration output: "build" name: "My Project" pipeline: - ... - stewbeet.plugins.merge_smithed_weld meta: stewbeet: libs_folder: "libs" # Optional: custom libraries folder

๐Ÿ“‹ Configuration Options

OptionTypeDefaultDescription
outputstringRequiredDirectory containing base archives and destination for merged archives
namestringRequiredProject name used for archive naming
libs_folderstring"libs"Folder containing custom library archives (datapack/.zip, resource_pack/.zip)
Archive Namingautomatic{project}_with_libs.zipNaming pattern for merged archive outputs

โœจ Features

๐Ÿ” Archive Detection System

Automatically detects and validates base archives for merging:

  • ๐Ÿ“ฆ Looks for project datapack and resource pack archives
  • โœ… Only processes packs when base archives exist
  • ๐Ÿท๏ธ Uses sanitized project names for consistent file naming
  • ๐Ÿ“ Ensures output directory structure is properly created

๐Ÿ”— Smithed Weld Integration

Uses Smithed Weld CLI for professional pack merging:

  • โšก Leverages Smithed's battle-tested merging algorithms
  • ๐Ÿ›ก๏ธ Handles conflict resolution and dependency management
  • ๐Ÿ”ง Configures error-only logging for clean output
  • ๐Ÿ“Š Creates temporary files for safe processing

๐Ÿ›๏ธ Official Library Integration

Automatically includes used official libraries in merged packs:

  • ๐Ÿ“š Reads from OFFICIAL_LIBS registry for available libraries
  • โœ… Only includes libraries marked as used in the project
  • ๐Ÿ“ Supports separate datapack and resource pack library paths
  • ๐Ÿ” Validates library existence before inclusion

๐Ÿ“ฆ Custom Library Support

Integrates custom libraries from configured folders:

  • ๐Ÿ“ Scans configured libs_folder for datapack and resource pack archives
  • ๐Ÿ” Uses glob patterns to find all zip files in respective folders
  • ๐ŸŽฏ Supports organized library structure with separate pack types
  • โœ… Gracefully handles missing or empty library folders

๐Ÿ› ๏ธ Metadata Preservation System

Ensures proper pack.mcmeta and pack.png handling:

  • ๐Ÿ”„ Excludes conflicting metadata from merged libraries
  • ๐Ÿ“ Uses project's original pack.mcmeta for final archive
  • ๐Ÿ–ผ๏ธ Preserves project's pack.png if available
  • โœ… Ensures proper metadata precedence and consistency

๐Ÿ• Timestamp and Compression Management

Maintains consistent timestamps and optimal compression:

  • โฐ Uses get_consistent_timestamp for reproducible builds
  • ๐Ÿ—œ๏ธ Applies ZIP_DEFLATED compression with level 6
  • ๐Ÿ“Š Creates proper ZipInfo objects for all entries
  • ๐Ÿงน Cleans up temporary files after processing