Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-eyes-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor/assets': patch
---

Update dependencies and raise Node engine requirement to >=16.0.0 for compatibility with modern toolchain (Prettier 3, Sharp 0.32, TypeScript 4.9). Also fix subprocess error handling for TypeScript strictness.
5 changes: 5 additions & 0 deletions .changeset/warm-results-like.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor/assets': patch
---

Improve documentation in README.md to reflect current features: CLI flags like --dark, --platform, --icon-only, support for easy and custom modes, manifest handling, background color options, and dark mode logo behavior. Matches real implementation.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ Where the provided flags are:
- `--splashBackgroundColorDark` - the background color (hex value) used when generating splash screens for dark mode (where supported) (default `#111111`)
- `--logoSplashTargetWidth` - A specific width to set the logo to when generating splash screens from a single logo file (not used by default, logo is scaled as percentage of splash instead, see `--logoSplashScale`)
- `--logoSplashScale` - the scale multiplier to apply to the logo when generating splash screens from a single logo file (default: `0.2`)
- `--ios` - explicitly run iOS asset generation. Using a platform flag makes the platform list exclusive.
- `--android` - explicitly run Android asset generation. Using a platform flag makes the platform list exclusive.
- `--pwa` - explicitly run PWA asset generation. Using a platform flag makes the platform list exclusive.
- `--platform <platform>` - Only generate assets for a specific platform (ios, android, pwa)
- `--ios`, `--android`, `--pwa` - explicitly run a single platform. Using any of these makes the platform list exclusive.
- `--icon-only` - Only generate icons
- `--splash-only` - Only generate splash screens
- `--dark` - Enable dark mode assets (e.g. logo-dark.png)
- `--androidFlavor` - Specify the Android product flavor where generated assets will be created (default: `main`)

### Usage - Custom Mode

Expand All @@ -72,10 +75,10 @@ To generate resources with all the default options, just run:
npx @capacitor/assets generate
```

`@capacitor/assets` accepts a platform for the first argument (`ios`, `android`, or `pwa` currently). If specified, resources are generated only for that platform:
You may also pass a platform with --platform to restrict generation:

```shell
npx @capacitor/assets generate --ios
npx @capacitor/assets generate --platform ios
```

Otherwise `@capacitor/assets` will use all detected Capacitor platforms.
Expand All @@ -88,6 +91,33 @@ This tool will create and/or update the web app manifest used in your project, a

By default, the tool will look for the manifest file in `public`, `src`, and `www` in that order. Use the flag `--pwaManifestPath` to specify the exact path to your web app manifest.

## Directory Structure

This tool expects and generates the following directory structure:

```
ios/
└── App/App/Assets.xcassets/
├── AppIcon.appiconset/
└── Splash.imageset/
```

```
android/
└── app/src/main/res/
├── mipmap-*/ic_launcher.png
└── drawable/ic_launcher_background.xml
```

```
public/
└── manifest.webmanifest
└── assets/
├── icon-192.png
├── icon-512.png
└── splash-640x1136.png
```

### Help

See the help instructions on the command line with the `--help` flag.
Expand Down
Loading