@julien-lin/universal-pwa-cli 1.2.2 → 1.2.3

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.
Files changed (3) hide show
  1. package/README.fr.md +166 -0
  2. package/README.md +92 -35
  3. package/package.json +6 -4
package/README.fr.md ADDED
@@ -0,0 +1,166 @@
1
+ # @julien-lin/universal-pwa-cli
2
+
3
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/julien-lin?logo=github&style=flat-square&label=Sponsors)](https://github.com/sponsors/julien-lin)
4
+ [![npm version](https://img.shields.io/npm/v/@julien-lin/universal-pwa-cli?logo=npm&style=flat-square)](https://www.npmjs.com/package/@julien-lin/universal-pwa-cli)
5
+
6
+ Interface en ligne de commande pour UniversalPWA - Transformez n'importe quel projet web en Progressive Web App (PWA) en un clic.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install -g @julien-lin/universal-pwa-cli
12
+ ```
13
+
14
+ Ou avec pnpm :
15
+
16
+ ```bash
17
+ pnpm add -g @julien-lin/universal-pwa-cli
18
+ ```
19
+
20
+ ## Utilisation
21
+
22
+ ### Commande `init`
23
+
24
+ Initialise une PWA dans votre projet.
25
+
26
+ #### Mode Interactif (Recommandé)
27
+
28
+ Exécutez simplement sans arguments pour lancer les prompts interactifs :
29
+
30
+ ```bash
31
+ universal-pwa init
32
+ ```
33
+
34
+ Le CLI vous guidera à travers :
35
+ - Nom de l'application (détecté automatiquement depuis `package.json`)
36
+ - Nom court (max 12 caractères)
37
+ - Chemin vers l'image source (détecté automatiquement dans les emplacements courants)
38
+ - Couleurs du thème et de fond
39
+ - Options de génération d'icônes
40
+
41
+ #### Mode Ligne de Commande
42
+
43
+ ```bash
44
+ universal-pwa init [options]
45
+ ```
46
+
47
+ **Options :**
48
+
49
+ - `-p, --project-path <path>` : Chemin du projet (défaut : répertoire courant)
50
+ - `-n, --name <name>` : Nom de l'application
51
+ - `-s, --short-name <shortName>` : Nom court (max 12 caractères)
52
+ - `-i, --icon-source <path>` : Image source pour les icônes
53
+ - `-t, --theme-color <color>` : Couleur du thème (hex, ex: `#2c3e50`)
54
+ - `-b, --background-color <color>` : Couleur de fond (hex)
55
+ - `--skip-icons` : Ignorer la génération d'icônes
56
+ - `--skip-service-worker` : Ignorer la génération du service worker
57
+ - `--skip-injection` : Ignorer l'injection des meta-tags
58
+ - `-o, --output-dir <dir>` : Répertoire de sortie (défaut : `public`)
59
+
60
+ **Exemple :**
61
+
62
+ ```bash
63
+ universal-pwa init \
64
+ --name "Mon Application" \
65
+ --short-name "MonApp" \
66
+ --icon-source ./logo.png \
67
+ --theme-color "#2c3e50"
68
+ ```
69
+
70
+ ### Commande `scan`
71
+
72
+ Scanne un projet et détecte le framework, l'architecture et les assets.
73
+
74
+ ```bash
75
+ universal-pwa scan [options]
76
+ ```
77
+
78
+ **Options :**
79
+
80
+ - `-p, --project-path <path>` : Chemin du projet (défaut : répertoire courant)
81
+
82
+ **Exemple :**
83
+
84
+ ```bash
85
+ universal-pwa scan
86
+ ```
87
+
88
+ Affiche :
89
+ - Framework détecté (React, Vue, WordPress, etc.)
90
+ - Architecture (SPA, SSR, statique)
91
+ - Outil de build
92
+ - Assets trouvés (JS, CSS, images, polices)
93
+
94
+ ### Commande `preview`
95
+
96
+ Prévisualise la configuration PWA d'un projet.
97
+
98
+ ```bash
99
+ universal-pwa preview [options]
100
+ ```
101
+
102
+ **Options :**
103
+
104
+ - `-p, --project-path <path>` : Chemin du projet (défaut : répertoire courant)
105
+ - `--port <port>` : Port du serveur (défaut : `3000`)
106
+ - `--open` : Ouvrir dans le navigateur
107
+
108
+ **Exemple :**
109
+
110
+ ```bash
111
+ universal-pwa preview --port 8080
112
+ ```
113
+
114
+ ## Fichiers Générés
115
+
116
+ Après avoir exécuté `universal-pwa init`, les fichiers suivants sont générés :
117
+
118
+ - `manifest.json` - Fichier manifest PWA
119
+ - `sw.js` - Service Worker (Workbox)
120
+ - `sw-src.js` - Source du Service Worker (pour personnalisation)
121
+ - `icon-*.png` - Icônes PWA en multiples tailles (72x72 à 512x512)
122
+ - `apple-touch-icon.png` - Apple Touch Icon (180x180)
123
+ - `splash-*.png` - Splash screens pour iOS
124
+
125
+ Les meta tags sont automatiquement injectés dans vos fichiers HTML.
126
+
127
+ ## API Programmatique
128
+
129
+ Vous pouvez également utiliser le CLI comme module :
130
+
131
+ ```typescript
132
+ import { initCommand } from '@julien-lin/universal-pwa-cli'
133
+
134
+ const result = await initCommand({
135
+ projectPath: './my-project',
136
+ name: 'My App',
137
+ iconSource: './icon.png',
138
+ })
139
+ ```
140
+
141
+ ## 💝 Sponsoring
142
+
143
+ Si UniversalPWA vous est utile, envisagez de [sponsoriser le projet](https://github.com/sponsors/julien-lin) pour aider à le maintenir et l'améliorer.
144
+
145
+ ## Développement
146
+
147
+ ```bash
148
+ # Installer les dépendances
149
+ pnpm install
150
+
151
+ # Build
152
+ pnpm build
153
+
154
+ # Tests
155
+ pnpm test
156
+
157
+ # Lint
158
+ pnpm lint
159
+ ```
160
+
161
+ ## Liens
162
+
163
+ - **Page d'accueil** : https://github.com/julien-lin/UniversalPWA
164
+ - **Support** : Pour les problèmes et questions, utilisez [GitHub Discussions](https://github.com/julien-lin/UniversalPWA/discussions)
165
+ - **Sponsor** : https://github.com/sponsors/julien-lin
166
+
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # @julien-lin/universal-pwa-cli
2
2
 
3
- Interface en ligne de commande pour UniversalPWA.
3
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/julien-lin?logo=github&style=flat-square&label=Sponsors)](https://github.com/sponsors/julien-lin)
4
+ [![npm version](https://img.shields.io/npm/v/@julien-lin/universal-pwa-cli?logo=npm&style=flat-square)](https://www.npmjs.com/package/@julien-lin/universal-pwa-cli)
5
+
6
+ Command-line interface for UniversalPWA - Transform any web project into a Progressive Web App (PWA) with one click.
7
+
8
+ **🇫🇷 [Documentation en français](./README.fr.md)**
4
9
 
5
10
  ## Installation
6
11
 
@@ -8,83 +13,125 @@ Interface en ligne de commande pour UniversalPWA.
8
13
  npm install -g @julien-lin/universal-pwa-cli
9
14
  ```
10
15
 
11
- ## Utilisation
16
+ Or with pnpm:
17
+
18
+ ```bash
19
+ pnpm add -g @julien-lin/universal-pwa-cli
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ### `init` Command
25
+
26
+ Initialize a PWA in your project.
27
+
28
+ #### Interactive Mode (Recommended)
29
+
30
+ Simply run without arguments to launch interactive prompts:
31
+
32
+ ```bash
33
+ universal-pwa init
34
+ ```
12
35
 
13
- ### Commande `init`
36
+ The CLI will guide you through:
37
+ - App name (auto-detected from `package.json`)
38
+ - Short name (max 12 characters)
39
+ - Icon source path (auto-detected from common locations)
40
+ - Theme and background colors
41
+ - Icon generation options
14
42
 
15
- Initialise une PWA dans votre projet.
43
+ #### Command Line Mode
16
44
 
17
45
  ```bash
18
46
  universal-pwa init [options]
19
47
  ```
20
48
 
21
- **Options :**
49
+ **Options:**
22
50
 
23
- - `-p, --project-path <path>` : Chemin du projet (défaut: répertoire courant)
24
- - `-n, --name <name>` : Nom de l'application
25
- - `-s, --short-name <shortName>` : Nom court (max 12 caractères)
26
- - `-i, --icon-source <path>` : Image source pour les icônes
27
- - `-t, --theme-color <color>` : Couleur du thème (hex, ex: `#2c3e50`)
28
- - `-b, --background-color <color>` : Couleur de fond (hex)
29
- - `--skip-icons` : Ignorer la génération d'icônes
30
- - `--skip-service-worker` : Ignorer la génération du service worker
31
- - `--skip-injection` : Ignorer l'injection des meta-tags
32
- - `-o, --output-dir <dir>` : Répertoire de sortie (défaut: `public`)
51
+ - `-p, --project-path <path>` : Project path (default: current directory)
52
+ - `-n, --name <name>` : Application name
53
+ - `-s, --short-name <shortName>` : Short name (max 12 characters)
54
+ - `-i, --icon-source <path>` : Source image for icons
55
+ - `-t, --theme-color <color>` : Theme color (hex, e.g., `#2c3e50`)
56
+ - `-b, --background-color <color>` : Background color (hex)
57
+ - `--skip-icons` : Skip icon generation
58
+ - `--skip-service-worker` : Skip service worker generation
59
+ - `--skip-injection` : Skip meta-tags injection
60
+ - `-o, --output-dir <dir>` : Output directory (default: `public`)
33
61
 
34
- **Exemple :**
62
+ **Example:**
35
63
 
36
64
  ```bash
37
65
  universal-pwa init \
38
- --name "Mon Application" \
39
- --short-name "MonApp" \
66
+ --name "My Application" \
67
+ --short-name "MyApp" \
40
68
  --icon-source ./logo.png \
41
69
  --theme-color "#2c3e50"
42
70
  ```
43
71
 
44
- ### Commande `scan`
72
+ ### `scan` Command
45
73
 
46
- Scanne un projet et détecte le framework, l'architecture et les assets.
74
+ Scan a project and detect framework, architecture, and assets.
47
75
 
48
76
  ```bash
49
77
  universal-pwa scan [options]
50
78
  ```
51
79
 
52
- **Options :**
80
+ **Options:**
53
81
 
54
- - `-p, --project-path <path>` : Chemin du projet (défaut: répertoire courant)
82
+ - `-p, --project-path <path>` : Project path (default: current directory)
55
83
 
56
- **Exemple :**
84
+ **Example:**
57
85
 
58
86
  ```bash
59
87
  universal-pwa scan
60
88
  ```
61
89
 
62
- ### Commande `preview`
90
+ Output:
91
+ - Detected framework (React, Vue, WordPress, etc.)
92
+ - Architecture (SPA, SSR, static)
93
+ - Build tool
94
+ - Assets found (JS, CSS, images, fonts)
95
+
96
+ ### `preview` Command
63
97
 
64
- Prévisualise la configuration PWA d'un projet.
98
+ Preview the PWA configuration of a project.
65
99
 
66
100
  ```bash
67
101
  universal-pwa preview [options]
68
102
  ```
69
103
 
70
- **Options :**
104
+ **Options:**
71
105
 
72
- - `-p, --project-path <path>` : Chemin du projet (défaut: répertoire courant)
73
- - `--port <port>` : Port du serveur (défaut: `3000`)
74
- - `--open` : Ouvrir dans le navigateur
106
+ - `-p, --project-path <path>` : Project path (default: current directory)
107
+ - `--port <port>` : Server port (default: `3000`)
108
+ - `--open` : Open in browser
75
109
 
76
- **Exemple :**
110
+ **Example:**
77
111
 
78
112
  ```bash
79
113
  universal-pwa preview --port 8080
80
114
  ```
81
115
 
82
- ## API Programmatique
116
+ ## Generated Files
117
+
118
+ After running `universal-pwa init`, the following files are generated:
119
+
120
+ - `manifest.json` - PWA manifest file
121
+ - `sw.js` - Service Worker (Workbox)
122
+ - `sw-src.js` - Service Worker source (for customization)
123
+ - `icon-*.png` - PWA icons in multiple sizes (72x72 to 512x512)
124
+ - `apple-touch-icon.png` - Apple Touch Icon (180x180)
125
+ - `splash-*.png` - Splash screens for iOS
126
+
127
+ Meta tags are automatically injected into your HTML files.
83
128
 
84
- Vous pouvez également utiliser le CLI comme module :
129
+ ## Programmatic API
130
+
131
+ You can also use the CLI as a module:
85
132
 
86
133
  ```typescript
87
- import { initCommand } from '@universal-pwa/cli'
134
+ import { initCommand } from '@julien-lin/universal-pwa-cli'
88
135
 
89
136
  const result = await initCommand({
90
137
  projectPath: './my-project',
@@ -93,10 +140,14 @@ const result = await initCommand({
93
140
  })
94
141
  ```
95
142
 
96
- ## Développement
143
+ ## 💝 Sponsoring
144
+
145
+ If UniversalPWA is useful to you, please consider [sponsoring the project](https://github.com/sponsors/julien-lin) to help maintain and improve it.
146
+
147
+ ## Development
97
148
 
98
149
  ```bash
99
- # Installer les dépendances
150
+ # Install dependencies
100
151
  pnpm install
101
152
 
102
153
  # Build
@@ -108,3 +159,9 @@ pnpm test
108
159
  # Lint
109
160
  pnpm lint
110
161
  ```
162
+
163
+ ## Links
164
+
165
+ - **Homepage**: https://github.com/julien-lin/UniversalPWA
166
+ - **Support**: For issues and questions, please use [GitHub Discussions](https://github.com/julien-lin/UniversalPWA/discussions)
167
+ - **Sponsor**: https://github.com/sponsors/julien-lin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julien-lin/universal-pwa-cli",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "CLI pour transformer n'importe quel projet web en PWA",
5
5
  "keywords": [
6
6
  "pwa",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/julien-lin/UniversalPWA#readme",
20
20
  "bugs": {
21
- "url": "https://github.com/julien-lin/UniversalPWA/issues"
21
+ "url": "https://github.com/julien-lin/UniversalPWA/discussions"
22
22
  },
23
23
  "type": "module",
24
24
  "bin": {
@@ -35,7 +35,9 @@
35
35
  }
36
36
  },
37
37
  "files": [
38
- "dist"
38
+ "dist",
39
+ "README.md",
40
+ "README.fr.md"
39
41
  ],
40
42
  "dependencies": {
41
43
  "chalk": "^5.6.2",
@@ -45,7 +47,7 @@
45
47
  "inquirer": "^12.0.0",
46
48
  "pino": "^9.14.0",
47
49
  "zod": "^4.2.1",
48
- "@julien-lin/universal-pwa-core": "^1.2.2"
50
+ "@julien-lin/universal-pwa-core": "^1.2.3"
49
51
  },
50
52
  "devDependencies": {
51
53
  "@vitest/coverage-v8": "^2.1.4",