Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I03df3787081bde6ebf0366a24320307a6a6a6964
6.9 KiB
Export Profiles Configuration
Pakker supports profile-specific export configurations, allowing you to customize export behavior for different platforms and use cases.
Overview
Export profiles enable you to:
- Use different override directories per profile
- Filter projects by platform availability
- Control non-redistributable mod inclusion
- Customize client-only mod filtering
- Override settings per project
Configuration
Add an exportProfiles section to your pakku.json file:
{
"name": "My Modpack",
"version": "1.0.0",
"overrides": ["overrides"],
"exportProfiles": {
"curseforge": {
"filterPlatform": "curseforge",
"includeNonRedistributable": false,
"overrides": ["overrides", "curseforge-overrides"]
},
"modrinth": {
"filterPlatform": "modrinth",
"includeNonRedistributable": true
},
"serverpack": {
"includeClientOnly": false,
"serverOverrides": ["server-config"]
}
}
}
Profile Configuration Options
filterPlatform (string, optional)
Filter projects to only include those available on the specified platform.
Supported values: "curseforge", "modrinth", "github"
Example:
{
"filterPlatform": "modrinth"
}
Projects without a Modrinth version will be excluded from the export.
includeNonRedistributable (boolean, optional)
Control whether non-redistributable mods are included in the export.
Default: false for CurseForge, true for others
Example:
{
"includeNonRedistributable": false
}
includeClientOnly (boolean, optional)
Control whether client-only mods are included in server pack exports.
Default: false for serverpack profile, true for others
Example:
{
"includeClientOnly": false
}
overrides (array of strings, optional)
Override directories to include in the export. Replaces global overrides setting.
Example:
{
"overrides": ["overrides", "platform-specific-overrides"]
}
serverOverrides (array of strings, optional)
Server-specific override directories. Replaces global serverOverrides setting.
Example:
{
"serverOverrides": ["server-config", "server-scripts"]
}
clientOverrides (array of strings, optional)
Client-specific override directories. Replaces global clientOverrides setting.
Example:
{
"clientOverrides": ["client-config", "shaderpacks"]
}
projectOverrides (object, optional)
Per-project configuration within this profile. Not yet implemented.
Future feature:
{
"projectOverrides": {
"sodium": {
"export": false
},
"optifine": {
"export": true,
"subpath": "mods/performance/"
}
}
}
Default Profiles
Pakker provides sensible defaults for common profiles:
CurseForge Default
{
"filterPlatform": "curseforge",
"includeNonRedistributable": false
}
Modrinth Default
{
"filterPlatform": "modrinth",
"includeNonRedistributable": true
}
ServerPack Default
{
"includeClientOnly": false
}
These defaults are used automatically when exporting with pakker export --profile <name> if no custom configuration is specified.
Usage Examples
Example 1: Multi-Platform Modpack
{
"name": "Multi-Platform Pack",
"version": "1.0.0",
"overrides": ["overrides"],
"exportProfiles": {
"curseforge": {
"filterPlatform": "curseforge",
"includeNonRedistributable": false,
"overrides": ["overrides", "curseforge-overrides"]
},
"modrinth": {
"filterPlatform": "modrinth",
"includeNonRedistributable": true,
"overrides": ["overrides", "modrinth-overrides"]
}
}
}
Usage:
pakker export --profile curseforge
pakker export --profile modrinth
Example 2: Server Pack with Custom Config
{
"name": "Survival Server",
"version": "2.0.0",
"overrides": ["overrides"],
"serverOverrides": ["server-base"],
"exportProfiles": {
"serverpack": {
"includeClientOnly": false,
"serverOverrides": ["server-base", "server-production"]
}
}
}
Usage:
pakker export --profile serverpack
Example 3: Development vs Production
{
"name": "Dev Pack",
"version": "1.0.0-dev",
"overrides": ["overrides"],
"exportProfiles": {
"dev": {
"includeNonRedistributable": true,
"overrides": ["overrides", "dev-config"]
},
"production": {
"filterPlatform": "curseforge",
"includeNonRedistributable": false,
"overrides": ["overrides", "prod-config"]
}
}
}
Usage:
pakker export --profile dev # For testing
pakker export --profile production # For release
How Profile Configuration Works
Priority Order
- Profile-specific settings from
exportProfiles.<profile> - Profile defaults (curseforge/modrinth/serverpack)
- Global settings from root
pakku.json
Example Resolution
Given this configuration:
{
"overrides": ["overrides"],
"serverOverrides": ["server-global"],
"exportProfiles": {
"myprofile": {
"overrides": ["custom-overrides"]
}
}
}
When exporting with --profile myprofile:
overrides: Uses["custom-overrides"](from profile)serverOverrides: Uses["server-global"](from global, no profile override)
Filter Execution Order
Export rules are executed in this order:
- Copy project files - Download and copy mod files
- Filter by platform - Remove mods not available on target platform
- Copy overrides - Copy override directories
- Generate manifest - Create platform-specific manifest
- Filter non-redistributable - Remove non-redistributable mods (if configured)
- Filter client-only - Remove client-only mods (for server packs)
Migration from Pakku
If you're migrating from Pakku, export profiles work the same way. The configuration format is compatible.
Pakku Configuration
{
"exportProfiles": {
"curseforge": {
"filterPlatform": "curseforge"
}
}
}
This works identically in Pakker.
Troubleshooting
Mods Missing from Export
Problem: Some mods are missing after export.
Solution: Check if filterPlatform is excluding them. Use pakker inspect <project> to see platform availability.
Override Files Not Copied
Problem: Override files aren't appearing in the export.
Solution: Verify the override path in your profile config matches the actual directory structure.
Non-Redistributable Mods Included
Problem: Non-redistributable mods are in the export when they shouldn't be.
Solution: Set includeNonRedistributable: false in your profile configuration.