@maccesar/titools 3.2.0 → 4.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 (102) hide show
  1. package/README.md +27 -61
  2. package/lib/cleanup.js +29 -0
  3. package/lib/commands/agents.js +8 -7
  4. package/lib/commands/skills.js +118 -23
  5. package/lib/config.js +13 -15
  6. package/lib/installer.js +5 -3
  7. package/lib/utils.js +36 -0
  8. package/package.json +1 -1
  9. package/skills/alloy-guides/SKILL.md +188 -0
  10. package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
  11. package/skills/alloy-guides/references/CONCEPTS.md +171 -0
  12. package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
  13. package/skills/alloy-guides/references/MODELS.md +742 -0
  14. package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
  15. package/skills/alloy-guides/references/PURGETSS.md +57 -0
  16. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
  17. package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
  18. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
  20. package/skills/alloy-guides/references/WIDGETS.md +160 -0
  21. package/skills/alloy-howtos/SKILL.md +179 -0
  22. package/skills/alloy-howtos/references/best_practices.md +121 -0
  23. package/skills/alloy-howtos/references/cli_reference.md +230 -0
  24. package/skills/alloy-howtos/references/config_files.md +158 -0
  25. package/skills/alloy-howtos/references/custom_tags.md +148 -0
  26. package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
  27. package/skills/alloy-howtos/references/samples.md +156 -0
  28. package/skills/purgetss/SKILL.md +184 -181
  29. package/skills/purgetss/references/EXAMPLES.md +8 -6
  30. package/skills/purgetss/references/app-branding.md +5 -0
  31. package/skills/purgetss/references/apply-directive.md +1 -1
  32. package/skills/purgetss/references/class-categories.md +1 -1
  33. package/skills/purgetss/references/class-index-properties.md +618 -0
  34. package/skills/purgetss/references/class-index.md +4 -610
  35. package/skills/purgetss/references/cli-commands.md +41 -410
  36. package/skills/purgetss/references/custom-fonts.md +292 -0
  37. package/skills/purgetss/references/custom-rules.md +1 -1
  38. package/skills/purgetss/references/customization-deep-dive.md +64 -1
  39. package/skills/purgetss/references/icon-fonts.md +208 -118
  40. package/skills/purgetss/references/installation-setup.md +4 -4
  41. package/skills/purgetss/references/migration-guide.md +53 -1
  42. package/skills/purgetss/references/multi-density-images.md +53 -2
  43. package/skills/purgetss/references/svg-pipeline.md +249 -0
  44. package/skills/purgetss/references/tikit-components.md +2 -2
  45. package/skills/purgetss/references/titanium-resets.md +2 -2
  46. package/skills/purgetss/references/ui-ux-design.md +7 -5
  47. package/skills/purgetss/references/version-history.md +71 -82
  48. package/skills/ti-api/SKILL.md +128 -0
  49. package/skills/ti-api/references/api-android.md +675 -0
  50. package/skills/ti-api/references/api-app-platform.md +636 -0
  51. package/skills/ti-api/references/api-core.md +764 -0
  52. package/skills/ti-api/references/api-data-network.md +641 -0
  53. package/skills/ti-api/references/api-media.md +655 -0
  54. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  55. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  56. package/skills/ti-api/references/api-modules-map.md +632 -0
  57. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  58. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  59. package/skills/ti-api/references/api-services.md +700 -0
  60. package/skills/ti-api/references/api-ui-android.md +499 -0
  61. package/skills/ti-api/references/api-ui-extras.md +702 -0
  62. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  63. package/skills/ti-api/references/api-ui-ios.md +756 -0
  64. package/skills/ti-api/references/api-ui-lists.md +581 -0
  65. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  66. package/skills/ti-api/references/api-ui-views.md +572 -0
  67. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  68. package/skills/ti-api/references/api-xml-global.md +743 -0
  69. package/skills/ti-guides/SKILL.md +82 -0
  70. package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
  71. package/skills/ti-guides/references/android-manifest.md +97 -0
  72. package/skills/ti-guides/references/app-distribution.md +373 -0
  73. package/skills/ti-guides/references/application-frameworks.md +366 -0
  74. package/skills/ti-guides/references/cli-reference.md +700 -0
  75. package/skills/ti-guides/references/coding-best-practices.md +150 -0
  76. package/skills/ti-guides/references/commonjs-advanced.md +279 -0
  77. package/skills/ti-guides/references/hello-world.md +99 -0
  78. package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
  79. package/skills/ti-guides/references/javascript-primer.md +402 -0
  80. package/skills/ti-guides/references/reserved-words.md +36 -0
  81. package/skills/ti-guides/references/resources.md +172 -0
  82. package/skills/ti-guides/references/style-and-conventions.md +104 -0
  83. package/skills/ti-guides/references/tiapp-config.md +655 -0
  84. package/skills/ti-howtos/SKILL.md +131 -0
  85. package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
  86. package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
  87. package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
  88. package/skills/ti-howtos/references/cross-platform-development.md +358 -0
  89. package/skills/ti-howtos/references/debugging-profiling.md +473 -0
  90. package/skills/ti-howtos/references/extending-titanium.md +684 -0
  91. package/skills/ti-howtos/references/google-maps-v2.md +172 -0
  92. package/skills/ti-howtos/references/ios-map-kit.md +149 -0
  93. package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
  94. package/skills/ti-howtos/references/local-data-sources.md +310 -0
  95. package/skills/ti-howtos/references/location-and-maps.md +267 -0
  96. package/skills/ti-howtos/references/media-apis.md +268 -0
  97. package/skills/ti-howtos/references/notification-services.md +539 -0
  98. package/skills/ti-howtos/references/remote-data-sources.md +339 -0
  99. package/skills/ti-howtos/references/tutorials.md +552 -0
  100. package/skills/ti-howtos/references/using-modules.md +182 -0
  101. package/skills/ti-howtos/references/web-content-integration.md +288 -0
  102. package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
@@ -1,176 +1,266 @@
1
1
  # Icon Font Libraries
2
2
 
3
+ PurgeTSS ships with four official icon font families, each preconfigured with the TSS classes and `fontFamily` mappings you need to drop icons into Buttons, Labels, and TextFields.
4
+
5
+ For user-defined fonts (Google Fonts, brand typefaces, community icon libraries like map-icons or microns), see [Custom Fonts](./custom-fonts.md) — those use `build-fonts`, not `icon-library`.
6
+
3
7
  > ℹ️ **INFO — Official Icon Fonts for PurgeTSS**
4
- >
5
- > Older versions of PurgeTSS bundled additional icon font libraries — Bootstrap Icons, Boxicons, LineIcons, and Tabler Icons among them. **Those libraries have been deprecated and removed from the official distribution** to keep maintenance under control. They are still usable, but you must rebuild them yourself with `build-fonts` (see below).
6
- >
7
- > The icon fonts officially supported and shipped by PurgeTSS today are:
8
- >
9
8
  > - [Font Awesome 7 Free](https://fontawesome.com) (upgrade with `purgetss il -v=fa`)
10
- > - [Framework 7](https://framework7.io/icons/)
9
+ > - [Framework 7 Icons](https://framework7.io/icons/)
11
10
  > - [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons)
12
11
  > - [Material Symbols](https://fonts.google.com/icons?icon.set=Material+Symbols)
12
+ >
13
+ > Older versions of PurgeTSS bundled additional libraries (Bootstrap Icons, Boxicons, LineIcons, Tabler Icons). They were removed to keep maintenance under control, but you can [recreate them at the bottom of this page](#recreating-removed-icon-libraries).
13
14
 
14
- For the official install flow for the supported vendors, see [CLI Commands](./cli-commands.md#icon-library-command).
15
+ ## Icon families reference
15
16
 
16
- ## Recreate Removed Libraries
17
+ Each family ships one or more variant classes, each pointing to a specific font file. Combine a variant class with an icon class to render a glyph. For example, `msr ms-home` uses the Material Symbols Rounded font with the `home` icon.
17
18
 
18
- You can recreate any deprecated library using the `build-fonts` command.
19
+ | Family | Variant | Class | `fontFamily` |
20
+ |---|---|---|---|
21
+ | **Material Symbols** | Outlined (default) | `.ms` | `MaterialSymbolsOutlined-Regular` |
22
+ | Material Symbols | Outlined (alias) | `.mso` | `MaterialSymbolsOutlined-Regular` |
23
+ | Material Symbols | Rounded | `.msr` | `MaterialSymbolsRounded-Regular` |
24
+ | Material Symbols | Sharp | `.mss` | `MaterialSymbolsSharp-Regular` |
25
+ | **Font Awesome** | Solid (default) | `.fa` | `FontAwesome7Free-Solid` |
26
+ | Font Awesome | Solid (alias) | `.fas` | `FontAwesome7Free-Solid` |
27
+ | Font Awesome | Regular | `.far` | `FontAwesome7Free-Regular` |
28
+ | Font Awesome | Brands | `.fab` | `FontAwesome7Brands-Regular` |
29
+ | **Material Icons** | Regular | `.mi` | `MaterialIcons-Regular` |
30
+ | **Framework 7** | Regular | `.f7` | `Framework7-Icons` |
19
31
 
20
- ### 1. Download the Libraries
32
+ > 💡 **TIP Icon class names**
33
+ > Across a family, the icon class is shared by every variant. For Material Symbols, there is one `ms-home` class; pair it with `.ms`, `.mso`, `.msr`, or `.mss` to pick the shape (outlined, rounded, or sharp). FontAwesome works the same way: `fa-home` pairs with `.fa`/`.fas` (Solid) or `.far` (Regular), while brand icons like `fa-github` need `.fab`. **The variant class chooses the font file. The icon class chooses the glyph.**
21
34
 
22
- Start by downloading the libraries from their official websites:
35
+ ### Full class lists
23
36
 
24
- - [Bootstrap Icons](https://icons.getbootstrap.com)
25
- - [Boxicons](https://boxicons.com)
26
- - [LineIcons](https://lineicons.com/icons/?type=free)
27
- - [Tabler Icons](https://tabler-icons.io)
37
+ The complete class definitions live in the PurgeTSS `dist/` folder:
28
38
 
29
- ### 2. The `fonts` Folder
39
+ - [fontawesome.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/fontawesome.tss)
40
+ - [materialicons.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/materialicons.tss)
41
+ - [materialsymbols.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/materialsymbols.tss)
42
+ - [framework7icons.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/framework7icons.tss)
30
43
 
31
- Put the desired libraries in the `./purgetss/fonts` folder.
44
+ ## Installing the icon fonts
32
45
 
33
- > ℹ️ **INFO**
34
- > Copy the TrueType or OpenType font files and the `.css` file.
46
+ Run `icon-library` to copy the `.ttf` files into `./app/assets/fonts/`. That is the only step you need. Once the fonts are in place, the icon classes from the table above work out of the box.
35
47
 
36
48
  ```bash
37
- purgetss
38
- └─ fonts
39
- └─ boxicons
40
- ├─ boxicons.css
41
- └─ boxicons.ttf
42
- └─ lineicons
43
- ├─ lineicons.css
44
- └─ lineicons.ttf
49
+ # All four families
50
+ $ purgetss icon-library
51
+
52
+ # Selective install
53
+ $ purgetss il -v=fa,mi,ms,f7
45
54
  ```
46
55
 
47
- ### 3. The `build-fonts` Command
56
+ > ℹ️ **INFO — You do not need the `.tss` files in `./purgetss/styles/`**
57
+ > PurgeTSS already knows every official icon class and resolves them at compile time from its own bundled `dist/` files. You do not need `fontawesome.tss`, `materialsymbols.tss`, `materialicons.tss`, or `framework7icons.tss` inside `./purgetss/styles/` for `class="fas fa-home"` (or any other icon class) to work in your XML and controllers. Install the `.ttf` files with `icon-library` and the classes are ready.
58
+ >
59
+ > The resolved classes are written to the generated `app/styles/app.tss`, not to `purgetss/styles/utilities.tss`. If you go looking for a class like `.ms-home`, check `app.tss`.
60
+
61
+ ### Optional flags
48
62
 
49
- Run the `build-fonts` command to create a custom `fonts.tss` file.
63
+ Two optional flags adjust what `icon-library` copies into your project:
64
+
65
+ - `-s, --styles`: copies the official `.tss` source files into `./purgetss/styles/` for reference only. Useful if you want to grep the full class list, see how a class is defined, or override a specific class in your own project.
66
+ - `-m, --module`: copies the matching CommonJS module into `./app/lib/`, which exposes each icon's Unicode string to JavaScript. Handy when you set `label.text` from a controller and prefer a friendly name like `icons.fa.home` over a raw ``.
50
67
 
51
68
  ```bash
52
- purgetss build-fonts [--modules]
69
+ # Add either flag when you want them
70
+ $ purgetss il -s
71
+ $ purgetss il -m
72
+ $ purgetss il -m -s
73
+ ```
53
74
 
54
- # alias:
55
- purgetss bf [-m]
75
+ ### Vendor aliases
76
+
77
+ `--vendor` accepts the short or long forms:
78
+
79
+ - `fa`, `fontawesome` = Font Awesome Icons
80
+ - `mi`, `materialicons` = Material Icons
81
+ - `ms`, `materialsymbol` = Material Symbols
82
+ - `f7`, `framework7` = Framework7 Icons
83
+
84
+ ## Using icons in XML
85
+
86
+ The variant class sets the `fontFamily`. The icon class sets the glyph (`text` / `title`). Apply both together:
87
+
88
+ `index.xml`
89
+ ```xml
90
+ <Alloy>
91
+ <Window>
92
+ <View class="grid">
93
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
94
+ <!-- Material Symbols variants -->
95
+ <Label class="mt-2 text-gray-700" text="Material Symbols" />
96
+ <Button class="ms ms-home my-1 h-10 w-10 text-xl text-blue-500" />
97
+ <Button class="msr ms-home my-1 h-10 w-10 text-xl text-blue-500" />
98
+ <Button class="mss ms-home my-1 h-10 w-10 text-xl text-blue-500" />
99
+ </View>
100
+
101
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
102
+ <!-- FontAwesome variants -->
103
+ <Label class="mt-2 text-gray-700" text="Font Awesome" />
104
+ <Button class="fas fa-home my-1 h-10 w-10 text-xl text-blue-500" />
105
+ <Button class="far fa-bell my-1 h-10 w-10 text-xl text-blue-500" />
106
+ <Button class="fab fa-github my-1 h-10 w-10 text-xl text-blue-500" />
107
+ </View>
108
+ </View>
109
+ </Window>
110
+ </Alloy>
56
111
  ```
57
112
 
58
- ### The `fonts.tss` File
113
+ ## Complete example with all four families
114
+
115
+ A side-by-side example using all four official families.
116
+
117
+ To use this file:
118
+
119
+ - Copy the content of `index.xml` into a new Alloy project.
120
+ - Install the official icon font files using `purgetss icon-library` (without `--vendor`, PurgeTSS copies all official icon fonts).
121
+ - Run `purgetss` once to generate the required files.
122
+ - Compile your app as usual.
123
+ - Use `liveview` if you want faster testing.
124
+
125
+ `index.xml`
126
+ ```xml
127
+ <Alloy>
128
+ <Window>
129
+ <View class="grid">
130
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
131
+ <!-- FontAwesome -->
132
+ <Label class="mt-2 text-gray-700" text="FontAwesome" />
133
+ <Button class="fa fa-home my-1 h-10 w-10 text-xl text-blue-500" />
134
+ <Button class="fa fa-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
135
+ </View>
136
+
137
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
138
+ <!-- Material Icons -->
139
+ <Label class="mt-2 text-gray-700" text="Material Icons" />
140
+ <Button class="mi mi-home my-1 h-10 w-10 text-xl text-blue-500" />
141
+ <Button class="mi mi-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
142
+ </View>
143
+
144
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
145
+ <!-- Material Symbols -->
146
+ <Label class="mt-2 text-gray-700" text="Material Symbol" />
147
+ <Button class="ms ms-home my-1 h-10 w-10 text-xl text-blue-500" />
148
+ <Button class="ms ms-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
149
+ </View>
150
+
151
+ <View class="vertical mx-auto grid-cols-2 gap-y-2">
152
+ <!-- Framework7-Icons -->
153
+ <Label class="mt-2 text-gray-700" text="Framework7-Icons" />
154
+ <Button class="f7 f7-house my-1 h-10 w-10 text-xl text-blue-500" />
155
+ <Button class="f7 f7-house my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
156
+ </View>
157
+ </View>
158
+ </Window>
159
+ </Alloy>
160
+ ```
59
161
 
60
- The `build-fonts` command generates `./purgetss/styles/fonts.tss` with Unicode characters and style rules.
162
+ Generated `app.tss` excerpt:
163
+ ```css
164
+ // PurgeTSS v7.10.2
165
+ // Created by César Estrada
166
+ // https://purgetss.com
61
167
 
62
- `./purgetss/styles/fonts.tss`
63
- ```tss
64
- '.boxicons': { font: { fontFamily: 'boxicons' } }
65
- '.lineicons': { font: { fontFamily: 'LineIcons' } }
168
+ /* Ti Elements */
169
+ 'View': { width: Ti.UI.SIZE, height: Ti.UI.SIZE }
170
+ 'Window': { backgroundColor: '#FFFFFF' }
66
171
 
67
- /* Unicode Characters */
68
- /* To use your Icon Fonts in Buttons AND Labels each class sets 'text' and 'title' properties */
172
+ /* Default Font Awesome */
173
+ '.fa': { font: { fontFamily: 'FontAwesome7Free-Solid' } }
174
+ '.fa-home': { text: '', title: '' }
69
175
 
70
- /* boxicons.css */
71
- '.bxl-meta': { text: '', title: '' }
72
- '.bx-lemon': { text: '', title: '' }
73
- /* ... */
176
+ /* Material Icons */
177
+ '.mi': { font: { fontFamily: 'MaterialIcons-Regular' } }
178
+ '.mi-home': { text: '', title: '' }
74
179
 
75
- /* lineicons.css */
76
- '.lni-500px': { text: '', title: '' }
77
- '.lni-add-files': { text: '', title: '' }
78
- /* ... */
180
+ /* Material Symbols */
181
+ '.ms': { font: { fontFamily: 'MaterialSymbolsOutlined-Regular' } }
182
+ '.ms-home': { text: '', title: '' }
183
+
184
+ /* Framework7 */
185
+ '.f7': { font: { fontFamily: 'Framework7-Icons' } }
186
+ '.f7-house': { text: 'house', title: 'house' }
79
187
  ```
80
188
 
81
- ### Rename the Style Rule Name
189
+ ## Customizing Font Awesome
82
190
 
83
- PurgeTSS uses the font file name as the style rule name. You can change it by renaming the font file.
191
+ If you have a [Font Awesome Pro account](https://fontawesome.com/pro) or want to try the Beta, PurgeTSS can generate a custom `./purgetss/styles/fontawesome.tss` with the Pro or Beta classes.
84
192
 
85
- `./purgetss/fonts/`
86
- ```bash
87
- purgetss
88
- └─ fonts
89
- └─ boxicons
90
- └─ bx.ttf
91
- ```
193
+ ### Font Awesome Pro
92
194
 
93
- New style rule name: `'.bx'`
195
+ After setting the [@fortawesome scope](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers#installing-pro) with your token, install it in your project's root folder with `npm init` and `npm install --save-dev @fortawesome/fontawesome-pro` (current version 7.1.0).
94
196
 
95
- ```tss
96
- '.bx': { font: { fontFamily: 'boxicons' } }
97
- ```
197
+ To generate a new `purgetss/styles/fontawesome.tss`, run `purgetss build`. It also copies the Pro font files into `./app/assets/fonts` if needed.
98
198
 
99
- ### The `assets/fonts` Folder
199
+ Note: Titanium cannot use Font Awesome duotone icons because each icon uses two glyphs.
100
200
 
101
- The `build-fonts` command copies the font files to `./app/assets/fonts` and renames them to their PostScript names so they work on both iOS and Android.
201
+ ### Font Awesome 7 Beta
102
202
 
103
- ```bash
104
- app
105
- └─ assets
106
- └─ fonts
107
- ├─ boxicons.ttf
108
- └─ LineIcons.ttf
109
- ```
203
+ To generate a custom `fontawesome.tss` file from [Font Awesome 7 Beta](https://fontawesome.com/download):
110
204
 
111
- ### The `--modules` Option
112
-
113
- When you use the `--modules` option, it generates a `./app/lib/purgetss.fonts.js` CommonJS module file.
114
-
115
- `./app/lib/purgetss.fonts.js`
116
- ```javascript
117
- const icons = {
118
- /* boxicons */
119
- boxicons: {
120
- bxlMeta: '',
121
- bxLemon: ''
122
- /* ... */
123
- },
124
- /* lineicons */
125
- lni: {
126
- '500px': '',
127
- addFiles: ''
128
- /* ... */
129
- }
130
- };
131
- exports.icons = icons;
132
- ```
205
+ Move the `css` and `webfonts` folders from `fontawesome-pro-7.0.0-beta3-web/`:
133
206
 
134
- ### The `--prefix` Option
207
+ ```bash
208
+ fontawesome-pro-7.0.0-beta3-web
209
+ └─ css
210
+ └─ webfonts
211
+ ```
135
212
 
136
- PurgeTSS determines the group's prefix for each icon family and class name. Use `--prefix` to apply the style's filename as the prefix for class names in `fonts.tss` and property names in `purgetss.fonts.js`.
213
+ Into `./purgetss/fontawesome-beta`:
137
214
 
138
- `./purgetss/fonts/`
139
215
  ```bash
140
216
  purgetss
141
- └─ fonts
142
- └─ lineicons
143
- └─ li.css
217
+ └─ fontawesome-beta
218
+ ├─ css
219
+ └─ webfonts
144
220
  ```
145
221
 
146
- New group prefix: `li`
222
+ Then run `purgetss build` to generate your custom `fontawesome.tss` file and test the new icons.
223
+
224
+ ## Recreating removed icon libraries
225
+
226
+ Older versions of PurgeTSS bundled Bootstrap Icons, Boxicons, LineIcons, and Tabler Icons. The list was trimmed to make maintenance easier, but you can rebuild any of them:
227
+
228
+ 1. Download the library from its official site:
229
+ - [Bootstrap Icons](https://icons.getbootstrap.com)
230
+ - [Boxicons](https://boxicons.com)
231
+ - [LineIcons](https://lineicons.com/icons/?type=free)
232
+ - [Tabler Icons](https://tabler-icons.io)
233
+ 2. Place the `.ttf`/`.otf` and `.css` files into `./purgetss/fonts/<library>/`.
234
+ 3. Run `purgetss build-fonts`.
235
+
236
+ For the underlying mechanics (how `build-fonts` reads the `.css`, options like `-m` and `-f`), see [Custom Fonts](./custom-fonts.md).
237
+
238
+ ### `fonts.tss` example
239
+
240
+ ```css
241
+ '.boxicons': { font: { fontFamily: 'boxicons' } }
242
+ '.lineicons': { font: { fontFamily: 'LineIcons' } }
243
+
244
+ /* Unicode Characters */
245
+ /* To use your Icon Fonts in Buttons AND Labels each class sets 'text' and 'title' properties */
147
246
 
148
- `./purgetss/styles/fonts.tss`
149
- ```tss
150
- /* lineicons/li.css */
151
- '.li-zoom-out': { text: '', title: '' }
152
- '.li-zoom-in': { text: '', title: '' }
247
+ /* boxicons.css */
248
+ '.bxl-meta': { text: '', title: '' }
249
+ '.bx-lemon': { text: '', title: '' }
153
250
  /* ... */
154
- ```
155
251
 
156
- `./app/lib/purgetss.fonts.js`
157
- ```javascript
158
- const icons = {
159
- /* lineicons/li.css */
160
- li: {
161
- /* ... */
162
- }
163
- };
164
- exports.icons = icons;
252
+ /* lineicons.css */
253
+ '.lni-500px': { text: '', title: '' }
254
+ '.lni-add-files': { text: '', title: '' }
255
+ /* ... */
165
256
  ```
166
257
 
167
- > 🛑 **DANGER**
168
- >
169
- > Make sure the new prefix stays unique so it does not collide with other class prefixes. A duplicate prefix will silently overwrite earlier rules in the generated `fonts.tss`, leaving you with icons that render the wrong glyph at runtime.
170
-
171
258
  ## Community-Discovered Patterns
172
259
 
173
260
  The following note reflects community experience working with icon fonts that depend on multiple glyphs per icon.
174
261
 
175
262
  > 🛑 **DANGER — Font Awesome Duotone**
176
263
  > Titanium cannot render Font Awesome duotone icons correctly because each icon uses two glyphs. If you work with Font Awesome Pro, avoid documenting duotone as supported.
264
+
265
+ > 💡 **Mixing variant + icon in `class=`**
266
+ > A common mistake is omitting the variant class and writing just `class="fa-github"`. The icon class only sets `text`/`title` (the glyph) — without the variant class (`.fa`, `.fas`, `.fab`, etc.) the `fontFamily` is missing and the glyph renders as the system font's fallback character. Always include both: `class="fab fa-github"` or `class="msr ms-home"`.
@@ -88,7 +88,7 @@ purgetss
88
88
 
89
89
  - `fonts`
90
90
 
91
- Place icon, serif, sans-serif, or monospace font files here. See the [`build-fonts` command](./cli-commands.md#purgetss-build-fonts-alias-bf) for instructions.
91
+ Place icon, serif, sans-serif, or monospace font files here. See [Custom Fonts](./custom-fonts.md) for the full guide, or [`build-fonts` Command](./cli-commands.md#build-fonts-command) for the terse flag reference.
92
92
 
93
93
  > **CAUTION**
94
94
  > **PurgeTSS overwrites your existing `app.tss` file.**
@@ -152,9 +152,9 @@ To use the example files:
152
152
  > Every time `purgetss` runs, it copies the content of `_app.tss` to `app.tss`.
153
153
 
154
154
  ```tss
155
- /* PurgeTSS v7.2.7 */
156
- /* Created by César Estrada */
157
- /* https://github.com/macCesar/purgeTSS */
155
+ // PurgeTSS v7.10.2
156
+ // Created by César Estrada
157
+ // https://purgetss.com
158
158
 
159
159
  /* _app.tss styles */
160
160
  '.bg-primary': {
@@ -1,11 +1,62 @@
1
1
  # Migration Guide
2
2
 
3
- This guide mirrors the official PurgeTSS changelog (see the project `README.md` / `docs/index.md`). It walks through the upgrade-relevant changes from v7.2.6 through v7.10.x, flags breaking changes, and links each section to the reference files that cover the new surface area in depth.
3
+ This guide mirrors the official PurgeTSS changelog (see the project `README.md` / `docs/index.md`). It walks through the upgrade-relevant changes from v7.2.6 through v7.11.x, flags breaking changes, and links each section to the reference files that cover the new surface area in depth.
4
4
 
5
5
  Changelog source of truth: [https://github.com/macCesar/purgeTSS](https://github.com/macCesar/purgeTSS).
6
6
 
7
7
  ---
8
8
 
9
+ ## Upgrade to v7.11.x
10
+
11
+ v7.11.0 and v7.11.1 are additive — **no breaking changes**. The headline addition is a compile-time SVG image pipeline that runs automatically as a post-step of `purgetss`, plus a `config.cjs` syntax validator. Nothing new is required on upgrade; the new surface is opt-in. Full release notes in [`version-history.md`](./version-history.md).
12
+
13
+ ### Added in v7.11.0 — SVG compile-time image pipeline (opt-in)
14
+
15
+ Reference an `.svg` in a view or controller with `image="/images/<sub>/<name>.svg"` (or `backgroundImage="..."`) **alongside** utility classes that resolve to a numeric width/height (`w-32`, `w-(300)`, `h-auto`, …), and after the regular purge finishes PurgeTSS compiles that SVG into the 8 Titanium density variants (5 Android + 3 iPhone PNGs), sizing them from the dimensions resolved in `app.tss`. Titanium loads the generated `.png` automatically at runtime even though the source still references `.svg` — the SVG attribute is never rewritten.
16
+
17
+ - Cache lives at `purgetss/.cache/svg-images.json` — **add it to `.gitignore`**.
18
+ - Projects that never reference `.svg` images with sizing classes see no change. This is entirely opt-in by usage.
19
+
20
+ See [`multi-density-images.md`](./multi-density-images.md).
21
+
22
+ ### Added in v7.11.0 — `images.files` override array
23
+
24
+ `config.cjs` accepts an `images.files` array to pin width/height for individual files in `purgetss/images/`:
25
+
26
+ ```javascript
27
+ images: {
28
+ autoSync: true,
29
+ files: [
30
+ { filename: 'images/logos/logo.png', width: 128, height: 52 }
31
+ ]
32
+ }
33
+ ```
34
+
35
+ Entries override a source's natural dimensions when `purgetss images` runs; CLI `--width` still wins over both. SVGs detected by the purge pipeline populate entries automatically (subject to `images.autoSync`). Raster entries you add by hand survive subsequent runs untouched.
36
+
37
+ ### Added in v7.11.0 — `images.autoSync` opt-out
38
+
39
+ `images.autoSync` (boolean, default `true`). When `false`, purge still computes dimensions and generates the density PNGs, but never writes back to `config.cjs` — for devs who manage `images.files` by hand.
40
+
41
+ ### Added in v7.11.0 — `config.cjs` syntax validator
42
+
43
+ Type mismatches in known config fields now print a formatted `Config Syntax Error` block (file, JSON path, context, issue, and a fix snippet) instead of a cryptic downstream crash like `rule.startsWith is not a function`. Currently validated: `theme.fontFamily.*` and `theme.extend.fontFamily.*` — **each font-family value must be a string**. The validator runs at config load time.
44
+
45
+ ### Changed in v7.11.1 — symmetric cascade + current-run sync
46
+
47
+ - **Symmetric width/height cascade** — a class can pin width-only, height-only, or both. The unpinned side stays `null` in `images.files` and is re-derived from the SVG viewBox on every run, so no stale auto-derived dimension gets frozen into config.
48
+ - **`syncConfigImages` mirrors the current run** instead of taking `max()` across past runs. Shrinking a class (e.g. `h-52` → `h-16`) now propagates to `config.cjs` rather than freezing the entry at the larger past size. Pin manually with `images.autoSync: false`.
49
+ - **`purgetss images` respects `--yes`** for overwrite confirmations — the prompt no longer reappears when `--yes` is supplied.
50
+ - **SVGs listed in `images.files` always emit `.png`** regardless of `images.format`, because Titanium's `.svg → .png`-only runtime fallback means other formats wouldn't load. Raster files and SVGs not in `images.files` still honor `format`.
51
+
52
+ ### What to review
53
+
54
+ - Add `purgetss/.cache/` to `.gitignore` before your next commit if you reference `.svg` images with sizing classes.
55
+ - If your `config.cjs` sets `theme.fontFamily` or `theme.extend.fontFamily` to anything other than a string, fix it now — the validator will halt with a `Config Syntax Error` block.
56
+ - If you manage `images.files` by hand and don't want purge overwriting your sizes, set `images.autoSync: false`.
57
+
58
+ ---
59
+
9
60
  ## Upgrade to v7.10.x
10
61
 
11
62
  v7.10.0 through v7.10.2 are additive — **no breaking changes**. The notable shift is internal: configs written before v7.7.0 (the `brand:` regroup) now auto-migrate in memory on every run, so projects that never updated to the grouped `brand:` schema keep working without a `TypeError` crash. Full release notes in [`version-history.md`](./version-history.md).
@@ -372,3 +423,4 @@ If you previously worked around this by inlining the gradient directly in TSS, r
372
423
  - After v7.8.0: run the build once and address every `Class Syntax Error` it surfaces. Update CI to handle the new hard-fail on malformed class names. Migrate any `top-[10px]` style square brackets to `top-(10px)` parentheses.
373
424
  - After v7.9.0: search for any `purgetss/experimental/tailwind-classes/` references in tooling/CI and update to `purgetss/glossary/tailwind-classes/`. If a project used top-level `theme.Window` / `View` / `ImageView` and depended on framework defaults being merged in, decide between moving the config under `theme.extend.*` or adding the previously-implicit utilities to the `apply` string.
374
425
  - After v7.10.0: deeply nested color families (`theme.extend.colors.brand.primary.500`) now emit recursively — restructure by domain if it improves readability. `apply:` with bundled icon fonts (`fas`, `mi-*`, `ms-*`, `f7-*`) no longer requires `build-fonts` first. The Google Play Feature Graphic ships automatically with `purgetss brand`.
426
+ - After v7.11.0: reference `.svg` images with numeric `w-*`/`h-*` classes to opt into the compile-time SVG pipeline (add `purgetss/.cache/` to `.gitignore`). Ensure every `theme.fontFamily.*` value is a string, not a Tailwind-style array, or the new config validator hard-fails. Use `images.files` to pin per-file sizes and `images.autoSync: false` to stop the pipeline writing back to `config.cjs`.
@@ -163,19 +163,56 @@ On the first run, `purgetss images` injects an `images:` block into your existin
163
163
 
164
164
  ```javascript
165
165
  images: {
166
+ autoSync: true, // false = SVG pipeline computes dims but doesn't write to images.files
166
167
  quality: 85, // JPEG/WebP/AVIF quality (0-100)
167
168
  format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
168
- confirmOverwrites: true // prompt before overwriting files (set false to skip)
169
+ confirmOverwrites: true, // prompt before overwriting files (set false to skip)
170
+ files: [] // per-file overrides: [{ filename: 'images/<sub>/<name>.<ext>', width, height? }]
169
171
  }
170
172
  ```
171
173
 
172
174
  | Key | Default | Purpose |
173
175
  | --- | --- | --- |
176
+ | `autoSync` | `true` | When `false`, the SVG pipeline still computes dimensions and generates PNGs but never writes back to `images.files`. See [SVG-aware compile-time pipeline](./svg-pipeline.md). |
174
177
  | `quality` | `85` | Quality for lossy formats (JPEG, WebP, AVIF). Range `0–100`. |
175
178
  | `format` | `null` | `null` keeps each source's original format. Set `'webp'`, `'jpeg'`, or `'png'` to convert every output. |
176
179
  | `confirmOverwrites` | `true` | When `false`, the `[y/N/a]` prompt is skipped. |
180
+ | `files` | `[]` | Per-file dimension overrides. See [Per-file overrides](#per-file-overrides-with-imagesfiles). |
177
181
 
178
- Change whatever you want to override globally; CLI flags still win for one-off runs.
182
+ Change whatever you want to override globally; CLI flags still win for one-off runs. `autoSync` and `files` arrived in v7.11.0 to support the [SVG-aware compile-time pipeline](./svg-pipeline.md).
183
+
184
+ ## Per-file overrides with `images.files`
185
+
186
+ `images.files` (v7.11.0) is an array of per-file dimension pins. It does **not** filter which images get processed — `purgetss images` always walks every supported file under `purgetss/images/`. Entries in `files` only override the source and derived sizing for files whose `filename` matches.
187
+
188
+ ```javascript
189
+ images: {
190
+ // ...
191
+ files: [
192
+ { filename: 'images/logos/logo.svg', width: 256 }, // SVG: width pins @1x/mdpi
193
+ { filename: 'images/buttons/hero.svg', width: 512, height: 128 }, // both dims pinned
194
+ { filename: 'images/photos/banner.jpg', width: 800 } // raster: behaves like --width 800
195
+ ]
196
+ }
197
+ ```
198
+
199
+ Precedence is the same for every file processed:
200
+
201
+ 1. CLI `--width <n>` wins.
202
+ 2. Otherwise, the matching entry in `images.files` (if any).
203
+ 3. Otherwise, the source's natural size: `viewBox` for SVG, intrinsic pixel size for rasters (treated as 4× master).
204
+
205
+ | Source | In `files`? | Width source | Output format |
206
+ | --- | --- | --- | --- |
207
+ | `logos/logo.svg` | yes | 256 px @1x (from `files`) | `png` (forced; see below) |
208
+ | `buttons/hero.svg` | yes | 512×128 pinned | `png` (forced) |
209
+ | `photos/banner.jpg` | yes | 800 px @1x | jpg (or `format` if set) |
210
+ | `icons/cart.svg` (not listed) | no | from SVG viewBox | follows `format` |
211
+ | `backgrounds/sunset.png` (not listed) | no | source as 4× master | png (or `format`) |
212
+
213
+ **SVGs in `files` always emit `.png`.** PurgeTSS detects that the file is a vector source whose entry exists because the developer pinned it from a view/controller reference (`image="/.../foo.svg"`). Titanium's runtime only falls back from `.svg` references to `.png`, never `.webp`, `.jpeg`, or another format. Emitting anything else here would silently produce files Titanium cannot load.
214
+
215
+ Raster entries you add by hand survive subsequent runs untouched. For SVGs detected by the [post-purge pipeline](./svg-pipeline.md), entries populate automatically — set `autoSync: false` if you do not want the pipeline writing into this section.
179
216
 
180
217
  ## Output layouts
181
218
 
@@ -304,6 +341,19 @@ purgetss images --format webp --quality 85
304
341
 
305
342
  Keep the default `format: null` when you need to stay in the same format as the source — for example PNG with alpha that shouldn't be flattened.
306
343
 
344
+ > **WARNING — WebP and SVG references don't mix**
345
+ >
346
+ > Titanium's runtime fallback for `image="/.../foo.svg"` resolves to `.png` **only** (verified empirically). Other formats — `.webp`, `.jpeg`, `.avif` — are not picked up through the `.svg` reference.
347
+ >
348
+ > If both `.png` and `.webp` of the same basename live next to each other on disk, the `.svg` fallback **breaks entirely**. Titanium then shows nothing for that view.
349
+ >
350
+ > PurgeTSS protects you in two places:
351
+ >
352
+ > - SVGs listed in `images.files` always emit `.png`, even with `format: 'webp'`. The output line says `png (forced; ignores format: webp)`.
353
+ > - The post-purge [SVG pipeline](./svg-pipeline.md) always emits `.png` regardless of `format`.
354
+ >
355
+ > `format` only applies to raster sources and SVGs not listed in `files` — the ones you reference directly as `.webp` in XML instead of through `.svg`.
356
+
307
357
  ## Reducing alpha across every density with `--opacity` (v7.10.0)
308
358
 
309
359
  Since v7.10.0, `--opacity <n>` multiplies the alpha channel of every generated density by `n/100`. Useful for placeholder or default ImageView images that render at reduced opacity (loading states, watermarks behind content, "image is loading" overlays).
@@ -485,5 +535,6 @@ Shows every file that would be written, no side effects.
485
535
 
486
536
  ## See also
487
537
 
538
+ - [SVG-aware compile-time pipeline](./svg-pipeline.md) — the post-purge SVG pipeline that auto-generates density PNGs from `image="/.../foo.svg"` references sized by utility classes.
488
539
  - [`images` command reference](./cli-commands.md#images-command) — terse flag list.
489
540
  - [App Icons & Branding](./app-branding.md) — sibling `brand` command for launcher icons and marketplace artwork.