antigravity-rtl-patcher 2.3.4 ā 3.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.
- package/CHANGELOG.md +121 -0
- package/README.md +160 -29
- package/bin/cli.js +73 -14
- package/package.json +9 -4
- package/payload/utils-inject.js +683 -0
- package/src/patcher.js +93 -98
- package/src/paths.js +51 -0
- package/payload/preload-inject.js +0 -526
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [3.0.0] - 2024-09-06
|
|
6
|
+
|
|
7
|
+
### š Major Rewrite - Utils.js Injection Approach
|
|
8
|
+
|
|
9
|
+
This is a **breaking change** that completely rewrites the injection strategy for better control and features.
|
|
10
|
+
|
|
11
|
+
### ⨠Added
|
|
12
|
+
|
|
13
|
+
- **Advanced UI Panel** - Rich hover-activated widget with comprehensive customization
|
|
14
|
+
- **Custom Font Support** - Set separate fonts for Persian/Arabic, English, and code
|
|
15
|
+
- **Typography Controls** - Real-time line height (1.2-2.5) and font size (11-22px) adjustment
|
|
16
|
+
- **Persistent Configuration** - Settings saved to `~/.antigravity-rtl-v3.json`
|
|
17
|
+
- **Force RTL Mode** - Override auto-detection for consistent RTL layout
|
|
18
|
+
- **Enhanced Keyboard Shortcuts** - `Alt + R` to toggle RTL
|
|
19
|
+
- **@ Sign Fix** - Type `@` with `Shift+2` on Persian keyboard
|
|
20
|
+
- **DevTools Enabled** - Automatically enable DevTools for debugging
|
|
21
|
+
- **Colorful CLI Banner** - Beautiful gradient ASCII art banner
|
|
22
|
+
- **Update Command** - `agy-rtl update` to check for new versions
|
|
23
|
+
|
|
24
|
+
### š§ Changed
|
|
25
|
+
|
|
26
|
+
- **Injection Point**: Changed from `preload.js` to `dist/utils.js` for better lifecycle control
|
|
27
|
+
- **Config Storage**: Moved from localStorage to filesystem (`~/.antigravity-rtl-v3.json`)
|
|
28
|
+
- **Detection Algorithm**: Improved RTL text detection with smarter first-character analysis
|
|
29
|
+
- **UI Architecture**: Complete redesign with Tailwind-inspired styling
|
|
30
|
+
- **Dependencies**: Added `figlet`, `picocolors`, and `prompts` for better CLI experience
|
|
31
|
+
|
|
32
|
+
### šļø Removed
|
|
33
|
+
|
|
34
|
+
- Old `preload-inject.js` payload (replaced with `utils-inject.js`)
|
|
35
|
+
- localStorage-based configuration (replaced with file-based config)
|
|
36
|
+
|
|
37
|
+
### š Fixed
|
|
38
|
+
|
|
39
|
+
- Better handling of mixed RTL/LTR content
|
|
40
|
+
- Improved code block preservation in RTL contexts
|
|
41
|
+
- More reliable font loading mechanism
|
|
42
|
+
- Enhanced list padding in RTL mode
|
|
43
|
+
|
|
44
|
+
### š Documentation
|
|
45
|
+
|
|
46
|
+
- Completely rewritten README with v3.0 features
|
|
47
|
+
- Added troubleshooting section
|
|
48
|
+
- Added keyboard shortcuts reference
|
|
49
|
+
- Added configuration file documentation
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## [2.3.4] - 2024-09-06
|
|
54
|
+
|
|
55
|
+
### ⨠Added
|
|
56
|
+
|
|
57
|
+
- Auto-update checker before patching
|
|
58
|
+
- `update` command to manually check for updates
|
|
59
|
+
- Update notification system
|
|
60
|
+
|
|
61
|
+
### š Documentation
|
|
62
|
+
|
|
63
|
+
- Added update instructions to README
|
|
64
|
+
- Emphasized `@latest` usage in documentation
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## [2.3.3] - 2024-09-06
|
|
69
|
+
|
|
70
|
+
### š Fixed
|
|
71
|
+
|
|
72
|
+
- Improved RTL text detection logic
|
|
73
|
+
- Better layout rendering for mixed content
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## [2.3.1] - 2024-09-06
|
|
78
|
+
|
|
79
|
+
### š Fixed
|
|
80
|
+
|
|
81
|
+
- Bug fixes for layout issues
|
|
82
|
+
- Added IDE detection to skip patching IDE versions
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Earlier Versions
|
|
87
|
+
|
|
88
|
+
See [GitHub Releases](https://github.com/VaFa1726/antigravity-rtl-patcher/releases) for details on versions before 2.3.1.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Migration Guide: v2.x ā v3.0
|
|
93
|
+
|
|
94
|
+
### What Changed
|
|
95
|
+
|
|
96
|
+
1. **Configuration Location**: Your old settings in localStorage will not carry over. You'll need to reconfigure the RTL settings using the new UI panel.
|
|
97
|
+
|
|
98
|
+
2. **UI Location**: The old status icon is replaced with a hover-activated globe icon in the bottom-right corner.
|
|
99
|
+
|
|
100
|
+
3. **New Features**: Take advantage of custom fonts, typography controls, and Force RTL mode.
|
|
101
|
+
|
|
102
|
+
### How to Upgrade
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Restore old version
|
|
106
|
+
npx antigravity-rtl-patcher restore
|
|
107
|
+
|
|
108
|
+
# Install new version
|
|
109
|
+
npx antigravity-rtl-patcher@latest patch
|
|
110
|
+
|
|
111
|
+
# Restart Antigravity
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Your old backup will work fine. The new patch is completely independent.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
[3.0.0]: https://github.com/VaFa1726/antigravity-rtl-patcher/releases/tag/v3.0.0
|
|
119
|
+
[2.3.4]: https://github.com/VaFa1726/antigravity-rtl-patcher/releases/tag/v2.3.4
|
|
120
|
+
[2.3.3]: https://github.com/VaFa1726/antigravity-rtl-patcher/releases/tag/v2.3.3
|
|
121
|
+
[2.3.1]: https://github.com/VaFa1726/antigravity-rtl-patcher/releases/tag/v2.3.1
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Antigravity RTL Patcher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Advanced RTL and Persian/Arabic typography support for the [Antigravity](https://antigravity.dev) desktop app. Patches the Electron runtime to detect right-to-left text and apply proper styling with a rich, customizable UI.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/antigravity-rtl-patcher)
|
|
6
6
|
[](https://www.npmjs.com/package/antigravity-rtl-patcher)
|
|
@@ -8,6 +8,19 @@ Smart RTL and Persian/Arabic typography support for the [Antigravity](https://an
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## ⨠What's New in v3.0
|
|
12
|
+
|
|
13
|
+
- šØ **Advanced UI Panel** - Hover widget with comprehensive customization options
|
|
14
|
+
- š¤ **Custom Font Support** - Set separate fonts for Persian, English, and code
|
|
15
|
+
- š **Typography Controls** - Adjust line height and font size in real-time
|
|
16
|
+
- š¾ **Persistent Config** - Settings saved to `~/.antigravity-rtl-v3.json`
|
|
17
|
+
- ā” **Keyboard Shortcuts** - `Alt + R` to toggle RTL, `Shift + 2` for @ symbol
|
|
18
|
+
- š§ **Force RTL Mode** - Override auto-detection for consistent RTL layout
|
|
19
|
+
- šÆ **Enhanced Detection** - Smarter RTL text recognition algorithm
|
|
20
|
+
- š **DevTools Enabled** - Built-in developer tools for debugging
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
11
24
|
## ā” Quick Install
|
|
12
25
|
|
|
13
26
|
Always use `@latest` to ensure you get the newest version:
|
|
@@ -22,11 +35,13 @@ If Antigravity is installed in a system directory, use `sudo`:
|
|
|
22
35
|
sudo npx antigravity-rtl-patcher@latest patch
|
|
23
36
|
```
|
|
24
37
|
|
|
25
|
-
Restart Antigravity after patching
|
|
38
|
+
Restart Antigravity after patching to see the RTL widget appear in the bottom-right corner!
|
|
39
|
+
|
|
40
|
+
---
|
|
26
41
|
|
|
27
42
|
## š Update to Latest Version
|
|
28
43
|
|
|
29
|
-
To ensure you're always using the latest version
|
|
44
|
+
To ensure you're always using the latest version:
|
|
30
45
|
|
|
31
46
|
```bash
|
|
32
47
|
npx antigravity-rtl-patcher@latest patch
|
|
@@ -40,63 +55,179 @@ npx antigravity-rtl-patcher@latest update
|
|
|
40
55
|
|
|
41
56
|
The patcher will automatically notify you when a new version is available.
|
|
42
57
|
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## šØ Features
|
|
61
|
+
|
|
62
|
+
### Smart RTL Detection
|
|
63
|
+
- Automatically detects Persian, Arabic, and Hebrew text
|
|
64
|
+
- Applies proper text direction without breaking layout
|
|
65
|
+
- Preserves LTR for code blocks and English text
|
|
66
|
+
|
|
67
|
+
### Rich UI Panel
|
|
68
|
+
Hover over the globe icon in the bottom-right corner to access:
|
|
69
|
+
|
|
70
|
+
- **RTL Toggle** - Enable/disable RTL support on the fly
|
|
71
|
+
- **Force RTL Mode** - Force RTL layout even when text starts with English
|
|
72
|
+
- **Custom Fonts**:
|
|
73
|
+
- Persian/Arabic font (fallback: Vazirmatn)
|
|
74
|
+
- English font (fallback: system font)
|
|
75
|
+
- Code font (fallback: monospace)
|
|
76
|
+
- **Typography Controls**:
|
|
77
|
+
- Line height slider (1.2 - 2.5)
|
|
78
|
+
- Font size slider (11px - 22px)
|
|
79
|
+
- **@ Sign Fix** - Type `@` with `Shift+2` on Persian keyboard
|
|
80
|
+
- **Keyboard Shortcut** - `Alt + R` to toggle RTL
|
|
81
|
+
|
|
82
|
+
### Persistent Configuration
|
|
83
|
+
All your settings are automatically saved to `~/.antigravity-rtl-v3.json` and restored on restart.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
43
87
|
## šļø Uninstall
|
|
44
88
|
|
|
89
|
+
Remove the RTL patch and restore original Antigravity:
|
|
90
|
+
|
|
45
91
|
```bash
|
|
46
92
|
npx antigravity-rtl-patcher restore
|
|
47
93
|
```
|
|
48
94
|
|
|
49
|
-
|
|
95
|
+
Or with sudo if needed:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
sudo npx antigravity-rtl-patcher restore
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
50
102
|
|
|
51
103
|
## š Commands
|
|
52
104
|
|
|
53
105
|
| Command | Description |
|
|
54
|
-
|
|
55
|
-
| `agy-rtl patch` | Apply RTL patch |
|
|
56
|
-
| `agy-rtl restore` | Remove patch
|
|
106
|
+
|---------|-------------|
|
|
107
|
+
| `agy-rtl patch` | Apply RTL patch with advanced UI |
|
|
108
|
+
| `agy-rtl restore` | Remove patch and restore original |
|
|
57
109
|
| `agy-rtl status` | Show current patch status |
|
|
58
|
-
| `agy-rtl update` | Check for updates |
|
|
59
|
-
| `agy-rtl patch --path /custom/path` | Patch
|
|
110
|
+
| `agy-rtl update` | Check for patcher updates |
|
|
111
|
+
| `agy-rtl patch --path /custom/path` | Patch custom installation |
|
|
60
112
|
| `agy-rtl patch --skip-update-check` | Skip update check during patching |
|
|
61
113
|
|
|
62
|
-
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## š§ How It Works
|
|
117
|
+
|
|
118
|
+
Antigravity is built on Electron. The patcher:
|
|
63
119
|
|
|
64
|
-
|
|
120
|
+
1. **Extracts** `app.asar` (the packaged application)
|
|
121
|
+
2. **Locates** `dist/utils.js` (window creation module)
|
|
122
|
+
3. **Injects** RTL engine at the window lifecycle hook
|
|
123
|
+
4. **Repacks** the modified application
|
|
65
124
|
|
|
66
|
-
|
|
125
|
+
The RTL engine uses:
|
|
126
|
+
- `MutationObserver` for real-time DOM monitoring
|
|
127
|
+
- Unicode range analysis for RTL detection
|
|
128
|
+
- Dynamic CSS generation for typography control
|
|
129
|
+
- Electron IPC for config persistence
|
|
67
130
|
|
|
68
|
-
|
|
131
|
+
After patching, a hover-activated widget appears in the bottom-right corner with all customization options.
|
|
69
132
|
|
|
70
|
-
|
|
71
|
-
- Applies directional styling only to elements that contain RTL text
|
|
72
|
-
- Injects the Vazirmatn font for improved Persian/Arabic readability
|
|
73
|
-
- Preserves LTR direction for code blocks inside RTL text
|
|
74
|
-
- Provides a toggle UI to enable/disable at any time
|
|
133
|
+
---
|
|
75
134
|
|
|
76
|
-
## š After Antigravity
|
|
135
|
+
## š After Antigravity Updates
|
|
77
136
|
|
|
78
|
-
|
|
137
|
+
Antigravity updates may overwrite the patch. Simply run:
|
|
79
138
|
|
|
80
139
|
```bash
|
|
81
140
|
npx antigravity-rtl-patcher@latest patch
|
|
82
141
|
```
|
|
83
142
|
|
|
84
|
-
**Pro tip:** Always use `@latest`
|
|
143
|
+
**Pro tip:** Always use `@latest` to ensure you're using the newest patcher version.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## š» Supported Platforms
|
|
148
|
+
|
|
149
|
+
| Platform | Typical Install Locations |
|
|
150
|
+
|----------|---------------------------|
|
|
151
|
+
| **Linux** | `/opt/Antigravity`<br>`~/Downloads/Antigravity-x64`<br>`~/.local/share/antigravity` |
|
|
152
|
+
| **macOS** | `/Applications/Antigravity.app`<br>`~/Applications/Antigravity.app` |
|
|
153
|
+
| **Windows** | `%LOCALAPPDATA%\Programs\Antigravity`<br>`%PROGRAMFILES%\Antigravity` |
|
|
154
|
+
|
|
155
|
+
Custom paths are supported via `--path` option.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## āØļø Keyboard Shortcuts
|
|
160
|
+
|
|
161
|
+
- **Alt + R** - Toggle RTL support on/off
|
|
162
|
+
- **Shift + 2** - Type `@` symbol (when @ fix is enabled)
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## šÆ Configuration File
|
|
167
|
+
|
|
168
|
+
Settings are stored in `~/.antigravity-rtl-v3.json`:
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"faFont": "",
|
|
173
|
+
"enFont": "",
|
|
174
|
+
"codeFont": "",
|
|
175
|
+
"lineHeight": "1.6",
|
|
176
|
+
"fontSize": "16",
|
|
177
|
+
"rtlEnabled": true,
|
|
178
|
+
"forceRTL": false,
|
|
179
|
+
"fixAtSign": true
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
You can manually edit this file or use the UI panel.
|
|
184
|
+
|
|
185
|
+
---
|
|
85
186
|
|
|
86
|
-
##
|
|
187
|
+
## š Troubleshooting
|
|
87
188
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
189
|
+
### Patch not working?
|
|
190
|
+
1. Make sure you restarted Antigravity after patching
|
|
191
|
+
2. Check patch status: `agy-rtl status`
|
|
192
|
+
3. Try restoring and re-patching:
|
|
193
|
+
```bash
|
|
194
|
+
npx antigravity-rtl-patcher restore
|
|
195
|
+
npx antigravity-rtl-patcher@latest patch
|
|
196
|
+
```
|
|
93
197
|
|
|
94
|
-
|
|
198
|
+
### Widget not appearing?
|
|
199
|
+
1. Open DevTools (now enabled by default)
|
|
200
|
+
2. Check console for any RTL engine errors
|
|
201
|
+
3. Make sure RTL is enabled in the widget
|
|
202
|
+
|
|
203
|
+
### Permission denied?
|
|
204
|
+
- **Linux/macOS**: Use `sudo` for system-wide installations
|
|
205
|
+
- **Windows**: Run terminal as Administrator
|
|
206
|
+
|
|
207
|
+
---
|
|
95
208
|
|
|
96
209
|
## š¤ Contributing
|
|
97
210
|
|
|
98
211
|
Issues and pull requests are welcome at [github.com/VaFa1726/antigravity-rtl-patcher](https://github.com/VaFa1726/antigravity-rtl-patcher).
|
|
99
212
|
|
|
213
|
+
---
|
|
214
|
+
|
|
100
215
|
## š License
|
|
101
216
|
|
|
102
|
-
MIT
|
|
217
|
+
MIT Ā© VaFa1726
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## š Credits
|
|
222
|
+
|
|
223
|
+
- Built with ā¤ļø for the Persian/Arabic developer community
|
|
224
|
+
- Vazirmatn font by [Saber Rastikerdar](https://github.com/rastikerdar/vazirmatn)
|
|
225
|
+
- Powered by Electron ASAR tools
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## š Links
|
|
230
|
+
|
|
231
|
+
- [GitHub Repository](https://github.com/VaFa1726/antigravity-rtl-patcher)
|
|
232
|
+
- [NPM Package](https://www.npmjs.com/package/antigravity-rtl-patcher)
|
|
233
|
+
- [Report Issues](https://github.com/VaFa1726/antigravity-rtl-patcher/issues)
|
package/bin/cli.js
CHANGED
|
@@ -2,43 +2,105 @@
|
|
|
2
2
|
|
|
3
3
|
const { program } = require('commander');
|
|
4
4
|
const chalk = require('chalk');
|
|
5
|
+
const figlet = require('figlet');
|
|
5
6
|
const { patch, restore, status } = require('../src/patcher');
|
|
6
7
|
const { checkForUpdates, showUpdateInstructions, currentVersion } = require('../src/version-checker');
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Display colorful banner with gradient effect
|
|
11
|
+
*/
|
|
12
|
+
function showBanner() {
|
|
13
|
+
try {
|
|
14
|
+
const bannerText = figlet.textSync('Antigravity RTL', {
|
|
15
|
+
font: 'Standard',
|
|
16
|
+
horizontalLayout: 'default',
|
|
17
|
+
verticalLayout: 'default'
|
|
18
|
+
});
|
|
11
19
|
|
|
20
|
+
// Gradient colors
|
|
21
|
+
const colors = [
|
|
22
|
+
{ r: 51, g: 135, b: 255 }, // Blue
|
|
23
|
+
{ r: 242, g: 80, b: 65 }, // Red
|
|
24
|
+
{ r: 223, g: 172, b: 42 }, // Yellow
|
|
25
|
+
{ r: 145, g: 196, b: 91 } // Green
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const lines = bannerText.split('\n');
|
|
29
|
+
console.log('');
|
|
30
|
+
|
|
31
|
+
lines.forEach((line, lineIndex) => {
|
|
32
|
+
if (!line.trim()) return;
|
|
33
|
+
|
|
34
|
+
let coloredLine = '';
|
|
35
|
+
const chars = line.split('');
|
|
36
|
+
const totalChars = chars.filter(c => c !== ' ').length;
|
|
37
|
+
let charIndex = 0;
|
|
38
|
+
|
|
39
|
+
chars.forEach(char => {
|
|
40
|
+
if (char === ' ') {
|
|
41
|
+
coloredLine += ' ';
|
|
42
|
+
} else {
|
|
43
|
+
const progress = totalChars > 1 ? charIndex / (totalChars - 1) : 0;
|
|
44
|
+
const segmentCount = colors.length - 1;
|
|
45
|
+
const segmentFloat = progress * segmentCount;
|
|
46
|
+
const segmentIndex = Math.min(Math.floor(segmentFloat), segmentCount - 1);
|
|
47
|
+
const segmentProgress = segmentFloat - segmentIndex;
|
|
48
|
+
|
|
49
|
+
const c1 = colors[segmentIndex];
|
|
50
|
+
const c2 = colors[segmentIndex + 1];
|
|
51
|
+
|
|
52
|
+
const r = Math.round(c1.r + segmentProgress * (c2.r - c1.r));
|
|
53
|
+
const g = Math.round(c1.g + segmentProgress * (c2.g - c1.g));
|
|
54
|
+
const b = Math.round(c1.b + segmentProgress * (c2.b - c1.b));
|
|
55
|
+
|
|
56
|
+
coloredLine += `\x1b[38;2;${r};${g};${b}m${char}\x1b[0m`;
|
|
57
|
+
charIndex++;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
console.log(coloredLine);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
console.log('');
|
|
65
|
+
console.log(chalk.gray(` Advanced RTL & Typography Control | v${currentVersion}\n`));
|
|
66
|
+
} catch (err) {
|
|
67
|
+
// Fallback banner
|
|
68
|
+
console.log(chalk.cyan.bold(`\n⨠Antigravity Smart RTL Patcher v${currentVersion}\n`));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Show banner
|
|
73
|
+
showBanner();
|
|
74
|
+
|
|
75
|
+
// CLI setup
|
|
12
76
|
program
|
|
13
77
|
.name('agy-rtl')
|
|
14
|
-
.description('RTL patcher for Antigravity')
|
|
78
|
+
.description('Advanced RTL patcher for Antigravity')
|
|
15
79
|
.version(currentVersion);
|
|
16
80
|
|
|
17
81
|
program
|
|
18
82
|
.command('patch')
|
|
19
|
-
.description('Inject RTL support into Antigravity')
|
|
83
|
+
.description('Inject advanced RTL support into Antigravity')
|
|
20
84
|
.option('-p, --path <path>', 'Custom path to Antigravity installation')
|
|
21
85
|
.option('--skip-update-check', 'Skip checking for updates')
|
|
22
86
|
.action(async (options) => {
|
|
23
|
-
console.log(BANNER);
|
|
24
87
|
try {
|
|
25
88
|
await patch(options.path, options.skipUpdateCheck);
|
|
26
89
|
} catch (err) {
|
|
27
|
-
console.error(chalk.red('\
|
|
90
|
+
console.error(chalk.red('\nā Patch failed:'), err.message);
|
|
28
91
|
process.exit(1);
|
|
29
92
|
}
|
|
30
93
|
});
|
|
31
94
|
|
|
32
95
|
program
|
|
33
96
|
.command('restore')
|
|
34
|
-
.description('Remove RTL patch and restore Antigravity')
|
|
97
|
+
.description('Remove RTL patch and restore original Antigravity')
|
|
35
98
|
.option('-p, --path <path>', 'Custom path to Antigravity installation')
|
|
36
99
|
.action(async (options) => {
|
|
37
|
-
console.log(BANNER);
|
|
38
100
|
try {
|
|
39
101
|
await restore(options.path);
|
|
40
102
|
} catch (err) {
|
|
41
|
-
console.error(chalk.red('\
|
|
103
|
+
console.error(chalk.red('\nā Restore failed:'), err.message);
|
|
42
104
|
process.exit(1);
|
|
43
105
|
}
|
|
44
106
|
});
|
|
@@ -48,11 +110,10 @@ program
|
|
|
48
110
|
.description('Check current patch status')
|
|
49
111
|
.option('-p, --path <path>', 'Custom path to Antigravity installation')
|
|
50
112
|
.action(async (options) => {
|
|
51
|
-
console.log(BANNER);
|
|
52
113
|
try {
|
|
53
114
|
await status(options.path);
|
|
54
115
|
} catch (err) {
|
|
55
|
-
console.error(chalk.red('\
|
|
116
|
+
console.error(chalk.red('\nā Status check failed:'), err.message);
|
|
56
117
|
process.exit(1);
|
|
57
118
|
}
|
|
58
119
|
});
|
|
@@ -61,7 +122,6 @@ program
|
|
|
61
122
|
.command('update')
|
|
62
123
|
.description('Check for updates and show installation instructions')
|
|
63
124
|
.action(async () => {
|
|
64
|
-
console.log(BANNER);
|
|
65
125
|
console.log(chalk.cyan('Checking for updates...\n'));
|
|
66
126
|
const hasUpdate = await checkForUpdates(false);
|
|
67
127
|
if (!hasUpdate) {
|
|
@@ -70,4 +130,3 @@ program
|
|
|
70
130
|
});
|
|
71
131
|
|
|
72
132
|
program.parse(process.argv);
|
|
73
|
-
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antigravity-rtl-patcher",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Advanced RTL and Persian/Arabic typography patcher for Antigravity with customizable UI",
|
|
5
5
|
"main": "src/patcher.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"antigravity-rtl-patcher": "./bin/cli.js",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"electron",
|
|
24
24
|
"asar",
|
|
25
25
|
"right-to-left",
|
|
26
|
-
"bidirectional"
|
|
26
|
+
"bidirectional",
|
|
27
|
+
"ui-customization",
|
|
28
|
+
"font-control"
|
|
27
29
|
],
|
|
28
30
|
"author": "VaFa1726",
|
|
29
31
|
"license": "MIT",
|
|
@@ -42,7 +44,10 @@
|
|
|
42
44
|
"@electron/asar": "^3.2.14",
|
|
43
45
|
"chalk": "^4.1.2",
|
|
44
46
|
"commander": "^11.1.0",
|
|
47
|
+
"figlet": "^1.7.0",
|
|
45
48
|
"fs-extra": "^11.2.0",
|
|
46
|
-
"ora": "^5.4.1"
|
|
49
|
+
"ora": "^5.4.1",
|
|
50
|
+
"picocolors": "^1.0.0",
|
|
51
|
+
"prompts": "^2.4.2"
|
|
47
52
|
}
|
|
48
53
|
}
|