app-asset-generator 2026.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +273 -0
- package/dist/cli.js +117479 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/package.json +80 -0
package/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# App Asset Generator
|
|
2
|
+
|
|
3
|
+
Generate all required app assets (icons, splash screens, adaptive icons, favicons) for iOS, Android, and Web platforms from a single configuration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Complete Asset Coverage**: Generate 100+ assets for all platforms
|
|
8
|
+
- iOS: App icons (20px - 1024px), Splash screens (iPhone, iPad)
|
|
9
|
+
- Android: Icons, Adaptive icons (foreground + background), Splash screens
|
|
10
|
+
- Web: Favicons, Apple touch icons, PWA icons
|
|
11
|
+
|
|
12
|
+
- **Flexible Backgrounds**:
|
|
13
|
+
- Solid colors (hex)
|
|
14
|
+
- Linear gradients (with angle control)
|
|
15
|
+
- Radial gradients
|
|
16
|
+
- Custom images
|
|
17
|
+
|
|
18
|
+
- **Flexible Foregrounds**:
|
|
19
|
+
- Text/Characters with Google Fonts (any font from fonts.google.com)
|
|
20
|
+
- System fonts (Arial, Times New Roman, etc.)
|
|
21
|
+
- SVG icons with color override
|
|
22
|
+
- PNG/JPG images
|
|
23
|
+
|
|
24
|
+
- **Interactive TUI**: OpenTUI-based terminal interface with image preview and font autocomplete
|
|
25
|
+
- **CLI Mode**: Command-line interface for automation and AI agents with shell completion
|
|
26
|
+
- **JSON Output**: Machine-readable output for programmatic usage
|
|
27
|
+
- **Smart Validation**: Typo detection with suggestions for Google Font names
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Clone the repository
|
|
33
|
+
git clone https://github.com/guillempuche/app-asset-generator.git
|
|
34
|
+
cd app-asset-generator
|
|
35
|
+
|
|
36
|
+
# Enter Nix environment (recommended)
|
|
37
|
+
nix develop
|
|
38
|
+
|
|
39
|
+
# Install dependencies
|
|
40
|
+
bun install
|
|
41
|
+
|
|
42
|
+
# Run the TUI
|
|
43
|
+
bun run tui
|
|
44
|
+
|
|
45
|
+
# Or run CLI mode
|
|
46
|
+
bun run dev --help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Interactive Mode (Recommended)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bun run tui
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The TUI will guide you through:
|
|
58
|
+
1. App name
|
|
59
|
+
2. Target platforms (iOS, Android, Web)
|
|
60
|
+
3. Asset types (icons, splash, adaptive, favicons)
|
|
61
|
+
4. Background configuration (color, gradient, image)
|
|
62
|
+
5. Foreground configuration (text with Google Fonts, SVG, image)
|
|
63
|
+
|
|
64
|
+
### Command-Line Mode
|
|
65
|
+
|
|
66
|
+
#### Available Commands
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
app-asset-generator [command] [options]
|
|
70
|
+
|
|
71
|
+
Commands:
|
|
72
|
+
(no command) Launch interactive OpenTUI interface (default)
|
|
73
|
+
generate Generate assets from command-line options
|
|
74
|
+
validate Validate configuration without generating
|
|
75
|
+
list-fonts List available Google Fonts
|
|
76
|
+
list-platforms Show platform specifications
|
|
77
|
+
instructions Show integration instructions
|
|
78
|
+
completion Output shell completion script
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### Generate Command
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Simple generation with defaults
|
|
85
|
+
bun run dev generate
|
|
86
|
+
|
|
87
|
+
# Customize text and color
|
|
88
|
+
bun run dev generate \
|
|
89
|
+
--fg-text "X" \
|
|
90
|
+
--fg-color "#004C6E" \
|
|
91
|
+
--bg-color "#FFFFFF"
|
|
92
|
+
|
|
93
|
+
# Full configuration with Google Font
|
|
94
|
+
bun run dev generate \
|
|
95
|
+
--name "MyApp" \
|
|
96
|
+
--fg-text "M" \
|
|
97
|
+
--fg-font "Inter" \
|
|
98
|
+
--fg-font-source google \
|
|
99
|
+
--fg-color "#000000" \
|
|
100
|
+
--bg-color "#FFFFFF" \
|
|
101
|
+
--platforms "ios,android,web"
|
|
102
|
+
|
|
103
|
+
# Gradient background
|
|
104
|
+
bun run dev generate \
|
|
105
|
+
--bg-type gradient \
|
|
106
|
+
--bg-gradient-colors "#667eea,#764ba2" \
|
|
107
|
+
--bg-gradient-angle 135 \
|
|
108
|
+
--fg-text "●" \
|
|
109
|
+
--fg-color "#FFFFFF"
|
|
110
|
+
|
|
111
|
+
# SVG icon
|
|
112
|
+
bun run dev generate \
|
|
113
|
+
--bg-color "#FFFFFF" \
|
|
114
|
+
--fg-type svg \
|
|
115
|
+
--fg-svg ./logo.svg \
|
|
116
|
+
--fg-svg-color "#000000"
|
|
117
|
+
|
|
118
|
+
# Dry-run (validate without generating)
|
|
119
|
+
bun run dev generate --dry-run
|
|
120
|
+
|
|
121
|
+
# JSON output for AI agents
|
|
122
|
+
bun run dev generate --format json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Other Commands
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# List available Google Fonts
|
|
129
|
+
bun run dev list-fonts
|
|
130
|
+
|
|
131
|
+
# Show platform specifications
|
|
132
|
+
bun run dev list-platforms
|
|
133
|
+
|
|
134
|
+
# Validate configuration
|
|
135
|
+
bun run dev validate --fg-font "Inter" --fg-font-source google
|
|
136
|
+
|
|
137
|
+
# Show integration instructions
|
|
138
|
+
bun run dev instructions --platforms ios,android
|
|
139
|
+
|
|
140
|
+
# Generate shell completion script
|
|
141
|
+
bun run dev completion >> ~/.bashrc # bash
|
|
142
|
+
bun run dev completion >> ~/.zshrc # zsh
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Output Structure
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
assets/generated-YYYYMMDD-HHMMSS/
|
|
149
|
+
├── ios/
|
|
150
|
+
│ ├── icon-20.png
|
|
151
|
+
│ ├── icon-20@2x.png
|
|
152
|
+
│ ├── icon-60@3x.png
|
|
153
|
+
│ ├── icon-1024.png
|
|
154
|
+
│ ├── splash-1170x2532.png
|
|
155
|
+
│ └── ...
|
|
156
|
+
├── android/
|
|
157
|
+
│ ├── mipmap-mdpi/
|
|
158
|
+
│ │ ├── ic_launcher.png
|
|
159
|
+
│ │ ├── ic_launcher_foreground.png
|
|
160
|
+
│ │ └── ic_launcher_background.png
|
|
161
|
+
│ ├── mipmap-hdpi/
|
|
162
|
+
│ ├── drawable-xhdpi/
|
|
163
|
+
│ │ └── splash.png
|
|
164
|
+
│ └── ...
|
|
165
|
+
├── web/
|
|
166
|
+
│ ├── favicon-16x16.png
|
|
167
|
+
│ ├── favicon-32x32.png
|
|
168
|
+
│ ├── apple-touch-icon-180x180.png
|
|
169
|
+
│ ├── android-chrome-512x512.png
|
|
170
|
+
│ └── ...
|
|
171
|
+
└── INSTRUCTIONS.md ← Integration guide
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Platform Specifications
|
|
175
|
+
|
|
176
|
+
### iOS
|
|
177
|
+
|
|
178
|
+
- **Icons**: 13 sizes from 20px to 1024px (including @2x, @3x variants)
|
|
179
|
+
- **Splash Screens**: 13 sizes covering all iPhone and iPad models
|
|
180
|
+
- **Format**: PNG (no transparency for app icons)
|
|
181
|
+
|
|
182
|
+
### Android
|
|
183
|
+
|
|
184
|
+
- **Icons**: 5 density buckets (mdpi through xxxhdpi)
|
|
185
|
+
- **Adaptive Icons**: Separate foreground and background layers
|
|
186
|
+
- Foreground: Transparent PNG with icon centered in safe zone
|
|
187
|
+
- Background: Color or image covering full canvas
|
|
188
|
+
- **Splash Screens**: 5 density buckets
|
|
189
|
+
- **Format**: PNG
|
|
190
|
+
|
|
191
|
+
### Web
|
|
192
|
+
|
|
193
|
+
- **Favicons**: Standard sizes (16x16, 32x32, 48x48)
|
|
194
|
+
- **Apple Touch Icons**: iOS home screen icons (57px - 180px)
|
|
195
|
+
- **PWA Icons**: Android Chrome icons (192x192, 512x512)
|
|
196
|
+
- **Format**: PNG
|
|
197
|
+
|
|
198
|
+
## Tips
|
|
199
|
+
|
|
200
|
+
1. **Icon Design**: Keep your foreground simple and centered. Test at small sizes (20px) to ensure visibility.
|
|
201
|
+
|
|
202
|
+
2. **Adaptive Icons**: Android crops icons to various shapes (circle, square, rounded square). The safe zone is the inner 66×66 dp (about 60% of canvas).
|
|
203
|
+
|
|
204
|
+
3. **Splash Screens**: The foreground is automatically sized to 25% of screen width/height for visibility.
|
|
205
|
+
|
|
206
|
+
4. **Color Contrast**: Ensure sufficient contrast between foreground and background (WCAG AA minimum: 4.5:1).
|
|
207
|
+
|
|
208
|
+
5. **Font Selection**:
|
|
209
|
+
- **Serif fonts** (Playfair Display, Merriweather, Lora): Editorial style
|
|
210
|
+
- **Sans-serif fonts** (Roboto, Montserrat, Inter): Modern, clean
|
|
211
|
+
- **Display fonts** (Bebas Neue, Anton, Oswald): Bold, attention-grabbing
|
|
212
|
+
|
|
213
|
+
6. **Google Fonts**: All fonts are loaded from Google Fonts API. Any font from fonts.google.com can be used.
|
|
214
|
+
|
|
215
|
+
## Development
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# Enter Nix environment
|
|
219
|
+
nix develop
|
|
220
|
+
|
|
221
|
+
# Install dependencies
|
|
222
|
+
bun install
|
|
223
|
+
|
|
224
|
+
# Run TUI in development
|
|
225
|
+
bun run tui
|
|
226
|
+
|
|
227
|
+
# Run CLI in development
|
|
228
|
+
bun run dev
|
|
229
|
+
|
|
230
|
+
# Type checking
|
|
231
|
+
bun run typecheck
|
|
232
|
+
|
|
233
|
+
# Lint and format
|
|
234
|
+
bun run lint
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Releasing
|
|
238
|
+
|
|
239
|
+
Uses [release-it](https://github.com/release-it/release-it) with [CalVer](https://calver.org/) (`yyyy.mm.minor`).
|
|
240
|
+
|
|
241
|
+
### Setup (one-time)
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# NPM login
|
|
245
|
+
npm login
|
|
246
|
+
|
|
247
|
+
# Set NPM automation token (bypasses 2FA)
|
|
248
|
+
npm config set //registry.npmjs.org/:_authToken YOUR_AUTOMATION_TOKEN
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Release
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
GITHUB_TOKEN=$(gh auth token) bun run release
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
This will:
|
|
258
|
+
1. Run typecheck and lint
|
|
259
|
+
2. Build the project
|
|
260
|
+
3. Bump version (e.g., `2026.1.0` → `2026.1.1`)
|
|
261
|
+
4. Create git tag and commit
|
|
262
|
+
5. Publish to NPM
|
|
263
|
+
6. Create GitHub release
|
|
264
|
+
|
|
265
|
+
## Related
|
|
266
|
+
|
|
267
|
+
- [iOS Human Interface Guidelines - App Icons](https://developer.apple.com/design/human-interface-guidelines/app-icons)
|
|
268
|
+
- [Android Adaptive Icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive)
|
|
269
|
+
- [Google Fonts](https://fonts.google.com/)
|
|
270
|
+
|
|
271
|
+
## License
|
|
272
|
+
|
|
273
|
+
MIT
|