forked from trent_larson/crowd-funder-for-time-pwa
- Replace manual ImageMagick scripts with official capacitor-assets toolchain - Consolidate duplicate asset sources to single resources/ directory - Implement comprehensive asset configuration schema and validation - Add CI safeguards for asset validation and platform asset detection - Convert capacitor.config.json to TypeScript format - Pin Node.js version for deterministic builds - Remove legacy manual asset generation scripts: * generate-icons.sh, generate-ios-assets.sh, generate-android-icons.sh * check-android-resources.sh, check-ios-resources.sh * purge-generated-assets.sh - Add new asset management commands: * assets:config - generate/update configurations * assets:validate - validate configurations * assets:clean - clean generated assets (dev only) * build:native - build with asset generation - Create GitHub Actions workflow for asset validation - Update documentation with new asset management workflow This standardization eliminates asset duplication, improves build reliability, and provides a maintainable asset management system using Capacitor defaults. Breaking Changes: Manual asset generation scripts removed Migration: Assets now sourced from resources/ directory only CI: Automated validation prevents committed platform assets
120 lines
3.5 KiB
JSON
120 lines
3.5 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Capacitor Assets Configuration Schema",
|
|
"description": "Schema for validating capacitor-assets configuration files",
|
|
"type": "object",
|
|
"properties": {
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"source": {
|
|
"type": "string",
|
|
"pattern": "^resources/.*\\.(png|svg)$",
|
|
"description": "Source icon file path relative to project root"
|
|
},
|
|
"android": {
|
|
"type": "object",
|
|
"properties": {
|
|
"adaptive": {
|
|
"type": "object",
|
|
"properties": {
|
|
"foreground": {
|
|
"type": "string",
|
|
"pattern": "^resources/.*\\.(png|svg)$",
|
|
"description": "Foreground icon for Android adaptive icons"
|
|
},
|
|
"background": {
|
|
"type": ["string", "object"],
|
|
"description": "Background color or image for adaptive icons"
|
|
},
|
|
"monochrome": {
|
|
"type": "string",
|
|
"pattern": "^resources/.*\\.(png|svg)$",
|
|
"description": "Monochrome icon for Android 13+"
|
|
}
|
|
},
|
|
"required": ["foreground", "background"]
|
|
},
|
|
"target": {
|
|
"type": "string",
|
|
"description": "Android target directory for generated icons"
|
|
}
|
|
}
|
|
},
|
|
"ios": {
|
|
"type": "object",
|
|
"properties": {
|
|
"padding": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1,
|
|
"description": "Padding ratio for iOS icons"
|
|
},
|
|
"target": {
|
|
"type": "string",
|
|
"description": "iOS target directory for generated icons"
|
|
}
|
|
}
|
|
},
|
|
"web": {
|
|
"type": "object",
|
|
"properties": {
|
|
"target": {
|
|
"type": "string",
|
|
"description": "Web target directory for generated icons"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": ["source"],
|
|
"additionalProperties": false
|
|
},
|
|
"splash": {
|
|
"type": "object",
|
|
"properties": {
|
|
"source": {
|
|
"type": "string",
|
|
"pattern": "^resources/.*\\.(png|svg)$",
|
|
"description": "Source splash screen file"
|
|
},
|
|
"darkSource": {
|
|
"type": "string",
|
|
"pattern": "^resources/.*\\.(png|svg)$",
|
|
"description": "Dark mode splash screen file"
|
|
},
|
|
"android": {
|
|
"type": "object",
|
|
"properties": {
|
|
"scale": {
|
|
"type": "string",
|
|
"enum": ["cover", "contain", "fill"],
|
|
"description": "Android splash screen scaling mode"
|
|
},
|
|
"target": {
|
|
"type": "string",
|
|
"description": "Android target directory for splash screens"
|
|
}
|
|
}
|
|
},
|
|
"ios": {
|
|
"type": "object",
|
|
"properties": {
|
|
"useStoryBoard": {
|
|
"type": "boolean",
|
|
"description": "Use LaunchScreen storyboard instead of splash assets"
|
|
},
|
|
"target": {
|
|
"type": "string",
|
|
"description": "iOS target directory for splash screens"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": ["source"],
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"required": ["icon", "splash"],
|
|
"additionalProperties": false
|
|
}
|