electrify-web 1.0.0

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 (129) hide show
  1. package/LICENSE.md +10 -0
  2. package/README.md +351 -0
  3. package/app/inject/_placeholder +0 -0
  4. package/app/lib/main.js +11772 -0
  5. package/app/lib/main.js.map +1 -0
  6. package/app/lib/preload.js +338 -0
  7. package/app/lib/preload.js.map +1 -0
  8. package/app/lib/static/login.css +57 -0
  9. package/app/lib/static/login.html +24 -0
  10. package/app/lib/static/login.js +10 -0
  11. package/app/nativefier.json +8 -0
  12. package/app/npm-shrinkwrap.json +1170 -0
  13. package/app/package.json +25 -0
  14. package/icon-scripts/convertToIcns +56 -0
  15. package/icon-scripts/convertToIco +39 -0
  16. package/icon-scripts/convertToIconset +68 -0
  17. package/icon-scripts/convertToPng +76 -0
  18. package/icon-scripts/convertToTrayIcon +32 -0
  19. package/lib/autologin/index.d.ts +25 -0
  20. package/lib/autologin/index.js +189 -0
  21. package/lib/autologin/index.js.map +1 -0
  22. package/lib/build/buildIcon.d.ts +6 -0
  23. package/lib/build/buildIcon.js +110 -0
  24. package/lib/build/buildIcon.js.map +1 -0
  25. package/lib/build/buildNativefierApp.d.ts +2 -0
  26. package/lib/build/buildNativefierApp.js +234 -0
  27. package/lib/build/buildNativefierApp.js.map +1 -0
  28. package/lib/build/prepareElectronApp.d.ts +15 -0
  29. package/lib/build/prepareElectronApp.js +220 -0
  30. package/lib/build/prepareElectronApp.js.map +1 -0
  31. package/lib/cli.d.ts +6 -0
  32. package/lib/cli.js +783 -0
  33. package/lib/cli.js.map +1 -0
  34. package/lib/config/index.d.ts +87 -0
  35. package/lib/config/index.js +460 -0
  36. package/lib/config/index.js.map +1 -0
  37. package/lib/constants.d.ts +11 -0
  38. package/lib/constants.js +58 -0
  39. package/lib/constants.js.map +1 -0
  40. package/lib/helpers/fsHelpers.d.ts +2 -0
  41. package/lib/helpers/fsHelpers.js +57 -0
  42. package/lib/helpers/fsHelpers.js.map +1 -0
  43. package/lib/helpers/helpers.d.ts +29 -0
  44. package/lib/helpers/helpers.js +225 -0
  45. package/lib/helpers/helpers.js.map +1 -0
  46. package/lib/helpers/iconShellHelpers.d.ts +5 -0
  47. package/lib/helpers/iconShellHelpers.js +91 -0
  48. package/lib/helpers/iconShellHelpers.js.map +1 -0
  49. package/lib/helpers/upgrade/executableHelpers.d.ts +2 -0
  50. package/lib/helpers/upgrade/executableHelpers.js +173 -0
  51. package/lib/helpers/upgrade/executableHelpers.js.map +1 -0
  52. package/lib/helpers/upgrade/plistInfoXMLHelpers.d.ts +2 -0
  53. package/lib/helpers/upgrade/plistInfoXMLHelpers.js +29 -0
  54. package/lib/helpers/upgrade/plistInfoXMLHelpers.js.map +1 -0
  55. package/lib/helpers/upgrade/rceditGet.d.ts +1 -0
  56. package/lib/helpers/upgrade/rceditGet.js +65 -0
  57. package/lib/helpers/upgrade/rceditGet.js.map +1 -0
  58. package/lib/helpers/upgrade/upgrade.d.ts +8 -0
  59. package/lib/helpers/upgrade/upgrade.js +193 -0
  60. package/lib/helpers/upgrade/upgrade.js.map +1 -0
  61. package/lib/infer/browsers/inferChromeVersion.d.ts +1 -0
  62. package/lib/infer/browsers/inferChromeVersion.js +73 -0
  63. package/lib/infer/browsers/inferChromeVersion.js.map +1 -0
  64. package/lib/infer/browsers/inferFirefoxVersion.d.ts +1 -0
  65. package/lib/infer/browsers/inferFirefoxVersion.js +61 -0
  66. package/lib/infer/browsers/inferFirefoxVersion.js.map +1 -0
  67. package/lib/infer/browsers/inferSafariVersion.d.ts +6 -0
  68. package/lib/infer/browsers/inferSafariVersion.js +96 -0
  69. package/lib/infer/browsers/inferSafariVersion.js.map +1 -0
  70. package/lib/infer/inferDefaults.d.ts +33 -0
  71. package/lib/infer/inferDefaults.js +272 -0
  72. package/lib/infer/inferDefaults.js.map +1 -0
  73. package/lib/infer/inferIcon.d.ts +1 -0
  74. package/lib/infer/inferIcon.js +116 -0
  75. package/lib/infer/inferIcon.js.map +1 -0
  76. package/lib/infer/inferOs.d.ts +4 -0
  77. package/lib/infer/inferOs.js +69 -0
  78. package/lib/infer/inferOs.js.map +1 -0
  79. package/lib/infer/inferTitle.d.ts +1 -0
  80. package/lib/infer/inferTitle.js +56 -0
  81. package/lib/infer/inferTitle.js.map +1 -0
  82. package/lib/integration-test.d.ts +1 -0
  83. package/lib/main.d.ts +11 -0
  84. package/lib/main.js +18 -0
  85. package/lib/main.js.map +1 -0
  86. package/lib/options/asyncConfig.d.ts +5 -0
  87. package/lib/options/asyncConfig.js +46 -0
  88. package/lib/options/asyncConfig.js.map +1 -0
  89. package/lib/options/fields/fields.d.ts +2 -0
  90. package/lib/options/fields/fields.js +32 -0
  91. package/lib/options/fields/fields.js.map +1 -0
  92. package/lib/options/fields/icon.d.ts +9 -0
  93. package/lib/options/fields/icon.js +106 -0
  94. package/lib/options/fields/icon.js.map +1 -0
  95. package/lib/options/fields/name.d.ts +9 -0
  96. package/lib/options/fields/name.js +59 -0
  97. package/lib/options/fields/name.js.map +1 -0
  98. package/lib/options/fields/userAgent.d.ts +10 -0
  99. package/lib/options/fields/userAgent.js +81 -0
  100. package/lib/options/fields/userAgent.js.map +1 -0
  101. package/lib/options/normalizeUrl.d.ts +1 -0
  102. package/lib/options/normalizeUrl.js +62 -0
  103. package/lib/options/normalizeUrl.js.map +1 -0
  104. package/lib/options/optionsMain.d.ts +6 -0
  105. package/lib/options/optionsMain.js +305 -0
  106. package/lib/options/optionsMain.js.map +1 -0
  107. package/lib/presets/index.d.ts +27 -0
  108. package/lib/presets/index.js +162 -0
  109. package/lib/presets/index.js.map +1 -0
  110. package/lib/pwa/index.d.ts +57 -0
  111. package/lib/pwa/index.js +241 -0
  112. package/lib/pwa/index.js.map +1 -0
  113. package/lib/security/index.d.ts +27 -0
  114. package/lib/security/index.js +202 -0
  115. package/lib/security/index.js.map +1 -0
  116. package/lib/updater/index.d.ts +34 -0
  117. package/lib/updater/index.js +264 -0
  118. package/lib/updater/index.js.map +1 -0
  119. package/lib/utils/parseUtils.d.ts +3 -0
  120. package/lib/utils/parseUtils.js +95 -0
  121. package/lib/utils/parseUtils.js.map +1 -0
  122. package/lib/utils/sanitizeFilename.d.ts +1 -0
  123. package/lib/utils/sanitizeFilename.js +53 -0
  124. package/lib/utils/sanitizeFilename.js.map +1 -0
  125. package/lib/wizard/index.d.ts +13 -0
  126. package/lib/wizard/index.js +252 -0
  127. package/lib/wizard/index.js.map +1 -0
  128. package/npm-shrinkwrap.json +8144 -0
  129. package/package.json +148 -0
package/LICENSE.md ADDED
@@ -0,0 +1,10 @@
1
+ The MIT License (MIT)
2
+ =====================
3
+
4
+ Copyright © `2016` `Goh Jia Hao`
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,351 @@
1
+ <div align="center">
2
+
3
+ # ⚡ Electrify Web
4
+
5
+ **Transform any website into a native desktop app with one command**
6
+
7
+ [English](README.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md)
8
+
9
+ [![npm version](https://img.shields.io/npm/v/electrify-web.svg)](https://www.npmjs.com/package/electrify-web)
10
+ [![npm downloads](https://img.shields.io/npm/dm/electrify-web.svg)](https://www.npmjs.com/package/electrify-web)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
+ [![Node.js Version](https://img.shields.io/node/v/electrify-web.svg)](https://nodejs.org)
13
+
14
+ <img src=".github/demo.gif" alt="Demo" width="600">
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## 🎯 Why Electrify Web?
21
+
22
+ **Electrify Web** is a modern revival of the abandoned [Nativefier](https://github.com/nativefier/nativefier) project. The original project was unmaintained since 2023, leaving thousands of users without updates or security patches.
23
+
24
+ ### What We Fixed & Improved
25
+
26
+ | Issue | Original Nativefier | Electrify Web |
27
+ |-------|---------------------|---------------|
28
+ | 🔒 Security | Annoying 90-day warnings | Smart CVE detection |
29
+ | 🎨 Icons | Local files only | URL support with auto-download |
30
+ | ⚙️ Config | 60+ CLI flags | YAML/JSON config files |
31
+ | 🧙 UX | Complex commands | Interactive wizard |
32
+ | 📱 PWA | Not supported | Full manifest detection |
33
+ | 🔄 Updates | None | Built-in auto-update |
34
+ | 📦 Presets | None | 8 optimized presets |
35
+
36
+ ---
37
+
38
+ ## ✨ Features
39
+
40
+ - 🚀 **One Command Build** - `electrify https://example.com`
41
+ - 🧙 **Interactive Wizard** - Guided setup for beginners
42
+ - 📄 **Config Files** - YAML/JSON with inheritance support
43
+ - 🎯 **Smart Presets** - Optimized for social, productivity, media apps
44
+ - 💡 **Auto Detection** - Suggests best settings based on URL
45
+ - 🌐 **Network Icons** - Use icon URLs directly
46
+ - 📱 **PWA Support** - Auto-detect web app manifest
47
+ - 🔄 **Auto-Update** - Built-in update system
48
+ - 🩺 **Doctor Command** - Environment diagnostics
49
+ - 🔐 **CVE Checking** - Warns about vulnerable Electron versions
50
+ - 🖥️ **Cross-Platform** - Windows, macOS, Linux
51
+
52
+ ---
53
+
54
+ ## 📦 Installation
55
+
56
+ ```bash
57
+ # Install globally via npm
58
+ npm install -g electrify-web
59
+
60
+ # Or use npx (no install needed)
61
+ npx electrify-web https://example.com
62
+
63
+ # Verify installation
64
+ electrify --version
65
+ ```
66
+
67
+ ### Requirements
68
+
69
+ - Node.js >= 16.16.0
70
+ - npm >= 8.11.0
71
+ - macOS 10.13+ / Windows 10+ / Linux
72
+
73
+ ---
74
+
75
+ ## 🚀 Quick Start
76
+
77
+ ### Method 1: Interactive Wizard (Recommended)
78
+
79
+ ```bash
80
+ electrify wizard
81
+ ```
82
+
83
+ ### Method 2: One-Line Build
84
+
85
+ ```bash
86
+ electrify https://web.whatsapp.com
87
+ ```
88
+
89
+ ### Method 3: With Preset
90
+
91
+ ```bash
92
+ electrify https://web.whatsapp.com --preset social
93
+ ```
94
+
95
+ ### Method 4: Config File
96
+
97
+ ```bash
98
+ # Generate config template
99
+ electrify init
100
+
101
+ # Edit electrify.config.yaml, then build
102
+ electrify build
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 🎯 Presets
108
+
109
+ | Preset | Best For | Features |
110
+ |--------|----------|----------|
111
+ | `social` | WhatsApp, Discord, Telegram | Single instance, tray, notifications |
112
+ | `productivity` | Notion, Trello, Slack | Optimized window, tray |
113
+ | `media` | YouTube, Netflix, Spotify | Honest user-agent, video-optimized |
114
+ | `email` | Gmail, Outlook | Notifications, badge counter |
115
+ | `developer` | GitHub, GitLab, Jira | Dev tools enabled |
116
+ | `minimal` | Basic apps | Minimal configuration |
117
+ | `secure` | Banking, sensitive apps | Strict security |
118
+ | `kiosk` | Public displays | Full-screen, locked |
119
+
120
+ ```bash
121
+ # List all presets
122
+ electrify presets
123
+ ```
124
+
125
+ ---
126
+
127
+ ## ⚙️ Configuration
128
+
129
+ ### Config File (electrify.config.yaml)
130
+
131
+ ```yaml
132
+ app:
133
+ name: "My App"
134
+ url: "https://example.com"
135
+ icon: "./icon.png" # or URL: "https://..."
136
+
137
+ window:
138
+ width: 1280
139
+ height: 800
140
+
141
+ behavior:
142
+ singleInstance: true
143
+ tray: true
144
+
145
+ # Use a preset as base
146
+ preset: "social"
147
+
148
+ # Inherit from another config
149
+ extends: "./base.yaml"
150
+ ```
151
+
152
+ ### CLI Options
153
+
154
+ ```bash
155
+ electrify <url> [options]
156
+
157
+ Options:
158
+ -n, --name App name
159
+ -i, --icon Icon path or URL
160
+ --preset Use preset (social, productivity, etc.)
161
+ --config Config file path
162
+ --pwa Auto-detect PWA manifest
163
+ --auto-update Enable auto-update (github:owner/repo or URL)
164
+ -p, --platform Target platform (windows, mac, linux)
165
+ -a, --arch CPU architecture (x64, arm64)
166
+ --single-instance Allow only one instance
167
+ --tray Enable system tray
168
+ ```
169
+
170
+ See [API.md](API.md) for full documentation.
171
+
172
+ ---
173
+
174
+ ## 📱 PWA Support
175
+
176
+ Automatically detect and use PWA manifest settings:
177
+
178
+ ```bash
179
+ electrify https://web.whatsapp.com --pwa
180
+ ```
181
+
182
+ This will:
183
+ - Extract app name from manifest
184
+ - Download the best icon
185
+ - Apply theme colors
186
+ - Configure display mode
187
+
188
+ ---
189
+
190
+ ## 🔄 Auto-Update
191
+
192
+ Enable automatic updates for your app:
193
+
194
+ ```bash
195
+ # GitHub releases
196
+ electrify https://example.com --auto-update github:myorg/myrepo
197
+
198
+ # Custom update server
199
+ electrify https://example.com --auto-update https://updates.example.com
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 🩺 Diagnostics
205
+
206
+ Check your environment:
207
+
208
+ ```bash
209
+ electrify doctor
210
+ ```
211
+
212
+ Output:
213
+ ```
214
+ 🩺 Electrify Web Doctor - Environment Check
215
+
216
+ ✅ Node.js v20.10.0 ✓
217
+ ✅ npm 10.2.0 ✓
218
+ ✅ Platform linux (x64)
219
+ ✅ Disk Space 50G available
220
+ ✅ Network npm registry reachable ✓
221
+ ✅ Electron Cache 3 versions cached
222
+
223
+ ✅ All checks passed! Ready to build.
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 🛠️ Commands
229
+
230
+ | Command | Description |
231
+ |---------|-------------|
232
+ | `electrify <url>` | Build app from URL |
233
+ | `electrify wizard` | Interactive setup |
234
+ | `electrify init` | Generate config template |
235
+ | `electrify build` | Build from config file |
236
+ | `electrify presets` | List available presets |
237
+ | `electrify doctor` | Check environment |
238
+ | `electrify --help` | Show all options |
239
+
240
+ ---
241
+
242
+ ## 📁 Project Structure
243
+
244
+ ```
245
+ electrify-web/
246
+ ├── src/ # CLI source code
247
+ │ ├── cli.ts # Command-line interface
248
+ │ ├── build/ # Build logic
249
+ │ ├── options/ # Option processing
250
+ │ ├── presets/ # Preset configurations
251
+ │ ├── config/ # Config file handling
252
+ │ ├── wizard/ # Interactive wizard
253
+ │ ├── pwa/ # PWA detection
254
+ │ ├── security/ # CVE checking
255
+ │ └── updater/ # Auto-update system
256
+ ├── app/ # Electron app template
257
+ │ └── src/
258
+ │ ├── main.ts # Main process
259
+ │ └── preload.ts # Preload script
260
+ ├── shared/ # Shared types
261
+ └── docs/ # Documentation
262
+ ```
263
+
264
+ ---
265
+
266
+ ## 🔧 Tech Stack
267
+
268
+ - **TypeScript** - Type-safe development
269
+ - **Electron** - Desktop app framework
270
+ - **electron-packager** - App packaging
271
+ - **yargs** - CLI argument parsing
272
+ - **axios** - HTTP requests
273
+
274
+ ---
275
+
276
+ ## 🤝 Contributing
277
+
278
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.
279
+
280
+ ```bash
281
+ # Clone the repo
282
+ git clone https://github.com/neosun100/electrify-web.git
283
+ cd electrify-web
284
+
285
+ # Install dependencies
286
+ npm install
287
+
288
+ # Build
289
+ npm run build
290
+
291
+ # Link for local testing
292
+ npm link
293
+
294
+ # Run tests
295
+ npm test
296
+ ```
297
+
298
+ ---
299
+
300
+ ## 📋 Changelog
301
+
302
+ ### v1.0.0 (2024-12)
303
+
304
+ **🎉 Initial Release - Revival of Nativefier**
305
+
306
+ - ✅ Interactive wizard (`electrify wizard`)
307
+ - ✅ Config file support (YAML/JSON)
308
+ - ✅ 8 smart presets
309
+ - ✅ Network icon URL support
310
+ - ✅ PWA manifest detection
311
+ - ✅ Auto-update system
312
+ - ✅ CVE security checking
313
+ - ✅ Doctor command
314
+ - ✅ Removed 90-day warning
315
+ - ✅ Smart URL-based suggestions
316
+
317
+ Based on Nativefier v52.0.0, with 2000+ lines of new code.
318
+
319
+ ---
320
+
321
+ ## 📄 License
322
+
323
+ [MIT](LICENSE.md) © Electrify Web Contributors
324
+
325
+ This project is a fork of [Nativefier](https://github.com/nativefier/nativefier), originally created by Goh Jia Hao.
326
+
327
+ ---
328
+
329
+ ## ⭐ Star History
330
+
331
+ [![Star History Chart](https://api.star-history.com/svg?repos=neosun100/electrify-web&type=Date)](https://star-history.com/#neosun100/electrify-web)
332
+
333
+ ---
334
+
335
+ ## 📱 Follow Us
336
+
337
+ <div align="center">
338
+
339
+ ![WeChat](https://img.aws.xin/uPic/扫码_搜索联合传播样式-标准色版.png)
340
+
341
+ </div>
342
+
343
+ ---
344
+
345
+ <div align="center">
346
+
347
+ **If this project helps you, please give it a ⭐!**
348
+
349
+ Made with ❤️ by the Electrify Web community
350
+
351
+ </div>
File without changes