create-pwa-sv 1.0.3 → 1.0.4
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 +34 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ A CLI tool that streamlines the creation of typesafe Progressive Web App (PWA) p
|
|
|
20
20
|
- Dexie IndexedDB Wrapper (with `--dexie` or `-d` flag)
|
|
21
21
|
- Playwright Browser Testing (with `--playwright` or `-p` flag)
|
|
22
22
|
|
|
23
|
+
> **Note**: `pwa-asset-generator` is automatically included in all projects created by pwa-sv as a devDependency for generating PWA icons and assets.
|
|
24
|
+
|
|
23
25
|
## Installation & Usage
|
|
24
26
|
|
|
25
27
|
### Creating a New Project
|
|
@@ -72,6 +74,38 @@ After project creation, these scripts are available in your `package.json`:
|
|
|
72
74
|
- `pnpm i18n:extract`: Extract translation keys (if i18n enabled)
|
|
73
75
|
- `pnpm i18n:check`: Check for missing translations (if i18n enabled)
|
|
74
76
|
|
|
77
|
+
## How to Use pwa-asset-generator
|
|
78
|
+
|
|
79
|
+
The pwa-asset-generator tool is included in your project to automatically generate PWA icons and assets from a single source image.
|
|
80
|
+
|
|
81
|
+
### Setup
|
|
82
|
+
|
|
83
|
+
1. **Prepare your source icon**: Place a high-quality PNG image at `src/lib/assets/pwa-icon.png` (recommended size: 1024x1024px with transparency support)
|
|
84
|
+
|
|
85
|
+
2. **Generate assets**: Run the following command:
|
|
86
|
+
```bash
|
|
87
|
+
pnpm build-pwa-assets
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. **Generated assets**: The tool will create various icon sizes and formats automatically:
|
|
91
|
+
- Transparent icons (64px, 192px, 512px)
|
|
92
|
+
- Favicons (48px, .ico format)
|
|
93
|
+
- Maskable icons (512px)
|
|
94
|
+
- Web manifest icons and link tags
|
|
95
|
+
|
|
96
|
+
### Configuration
|
|
97
|
+
|
|
98
|
+
The generator is configured via `pwa-assets.config.ts` in your project root. The default configuration:
|
|
99
|
+
|
|
100
|
+
- Generates Android and web assets only (iOS assets are excluded)
|
|
101
|
+
- Uses the 2023 preset for modern PWA standards
|
|
102
|
+
- Automatically updates your manifest and HTML head links
|
|
103
|
+
|
|
104
|
+
### Notes
|
|
105
|
+
|
|
106
|
+
- Run `pnpm build-pwa-assets` again after updating `src/lib/assets/pwa-icon.png` to regenerate all assets
|
|
107
|
+
- The configuration is pre-configured and typically doesn't require modification
|
|
108
|
+
|
|
75
109
|
## Project Structure
|
|
76
110
|
|
|
77
111
|
The generated project follows SvelteKit conventions with additional PWA-specific configurations:
|