@maccesar/titools 3.3.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.
- package/README.md +27 -61
- package/lib/cleanup.js +29 -0
- package/lib/commands/agents.js +8 -7
- package/lib/commands/skills.js +118 -23
- package/lib/config.js +13 -15
- package/lib/installer.js +5 -3
- package/lib/utils.js +36 -0
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +188 -0
- package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
- package/skills/alloy-guides/references/CONCEPTS.md +171 -0
- package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
- package/skills/alloy-guides/references/MODELS.md +742 -0
- package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
- package/skills/alloy-guides/references/PURGETSS.md +57 -0
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
- package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
- package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
- package/skills/alloy-guides/references/WIDGETS.md +160 -0
- package/skills/alloy-howtos/SKILL.md +179 -0
- package/skills/alloy-howtos/references/best_practices.md +121 -0
- package/skills/alloy-howtos/references/cli_reference.md +230 -0
- package/skills/alloy-howtos/references/config_files.md +158 -0
- package/skills/alloy-howtos/references/custom_tags.md +148 -0
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
- package/skills/alloy-howtos/references/samples.md +156 -0
- package/skills/purgetss/SKILL.md +6 -3
- package/skills/purgetss/references/EXAMPLES.md +8 -6
- package/skills/purgetss/references/app-branding.md +5 -0
- package/skills/purgetss/references/apply-directive.md +1 -1
- package/skills/purgetss/references/class-categories.md +1 -1
- package/skills/purgetss/references/class-index-properties.md +618 -0
- package/skills/purgetss/references/class-index.md +4 -610
- package/skills/purgetss/references/cli-commands.md +15 -0
- package/skills/purgetss/references/custom-fonts.md +39 -36
- package/skills/purgetss/references/custom-rules.md +1 -1
- package/skills/purgetss/references/customization-deep-dive.md +64 -1
- package/skills/purgetss/references/icon-fonts.md +2 -0
- package/skills/purgetss/references/migration-guide.md +53 -1
- package/skills/purgetss/references/multi-density-images.md +53 -2
- package/skills/purgetss/references/svg-pipeline.md +249 -0
- package/skills/purgetss/references/tikit-components.md +2 -2
- package/skills/purgetss/references/titanium-resets.md +2 -2
- package/skills/purgetss/references/ui-ux-design.md +7 -5
- package/skills/purgetss/references/version-history.md +12 -0
- package/skills/ti-api/SKILL.md +128 -0
- package/skills/ti-api/references/api-android.md +675 -0
- package/skills/ti-api/references/api-app-platform.md +636 -0
- package/skills/ti-api/references/api-core.md +764 -0
- package/skills/ti-api/references/api-data-network.md +641 -0
- package/skills/ti-api/references/api-media.md +655 -0
- package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
- package/skills/ti-api/references/api-modules-map.md +632 -0
- package/skills/ti-api/references/api-modules-nfc.md +725 -0
- package/skills/ti-api/references/api-modules-social-misc.md +526 -0
- package/skills/ti-api/references/api-services.md +700 -0
- package/skills/ti-api/references/api-ui-android.md +499 -0
- package/skills/ti-api/references/api-ui-extras.md +702 -0
- package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
- package/skills/ti-api/references/api-ui-ios.md +756 -0
- package/skills/ti-api/references/api-ui-lists.md +581 -0
- package/skills/ti-api/references/api-ui-text-input.md +607 -0
- package/skills/ti-api/references/api-ui-views.md +572 -0
- package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
- package/skills/ti-api/references/api-xml-global.md +743 -0
- package/skills/ti-guides/SKILL.md +82 -0
- package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
- package/skills/ti-guides/references/android-manifest.md +97 -0
- package/skills/ti-guides/references/app-distribution.md +373 -0
- package/skills/ti-guides/references/application-frameworks.md +366 -0
- package/skills/ti-guides/references/cli-reference.md +700 -0
- package/skills/ti-guides/references/coding-best-practices.md +150 -0
- package/skills/ti-guides/references/commonjs-advanced.md +279 -0
- package/skills/ti-guides/references/hello-world.md +99 -0
- package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
- package/skills/ti-guides/references/javascript-primer.md +402 -0
- package/skills/ti-guides/references/reserved-words.md +36 -0
- package/skills/ti-guides/references/resources.md +172 -0
- package/skills/ti-guides/references/style-and-conventions.md +104 -0
- package/skills/ti-guides/references/tiapp-config.md +655 -0
- package/skills/ti-howtos/SKILL.md +131 -0
- package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
- package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
- package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
- package/skills/ti-howtos/references/cross-platform-development.md +358 -0
- package/skills/ti-howtos/references/debugging-profiling.md +473 -0
- package/skills/ti-howtos/references/extending-titanium.md +684 -0
- package/skills/ti-howtos/references/google-maps-v2.md +172 -0
- package/skills/ti-howtos/references/ios-map-kit.md +149 -0
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
- package/skills/ti-howtos/references/local-data-sources.md +310 -0
- package/skills/ti-howtos/references/location-and-maps.md +267 -0
- package/skills/ti-howtos/references/media-apis.md +268 -0
- package/skills/ti-howtos/references/notification-services.md +539 -0
- package/skills/ti-howtos/references/remote-data-sources.md +339 -0
- package/skills/ti-howtos/references/tutorials.md +552 -0
- package/skills/ti-howtos/references/using-modules.md +182 -0
- package/skills/ti-howtos/references/web-content-integration.md +288 -0
- package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
|
@@ -116,6 +116,7 @@ The `create` command generates a new Alloy project with PurgeTSS already set up.
|
|
|
116
116
|
|
|
117
117
|
- `-f, --force` to overwrite an existing project.
|
|
118
118
|
- `-d, --dependencies` to install ESLint and Tailwind CSS.
|
|
119
|
+
- `-m, --module` to install the `purgetss.ui.js` module in the project's `./app/lib/` folder.
|
|
119
120
|
- `-v, --vendor [fa,mi,ms,f7]` to copy the selected fonts into your project and add the CommonJS module in `./app/lib/`. See the `icon-library` command for available fonts.
|
|
120
121
|
|
|
121
122
|
If a project with the same name already exists, the command will prompt you to confirm whether you want to overwrite it.
|
|
@@ -559,6 +560,7 @@ purgetss s [hexcode] [name]
|
|
|
559
560
|
- `-n, --name`: Specifies the name of the color.
|
|
560
561
|
- `-q, --quotes`: Retains double quotes in the `config.cjs` file.
|
|
561
562
|
- `-r, --random`: Generates shades from a random color.
|
|
563
|
+
- `-o, --override`: Places the new shades in `theme.colors` (instead of `theme.extend.colors`) to override default colors.
|
|
562
564
|
- `-s, --single`: Generates a single color definition.
|
|
563
565
|
- `-t, --tailwind`: Logs the generated shades with a `tailwind.config.js` compatible structure.
|
|
564
566
|
- `-l, --log`: Logs the generated shades instead of saving them.
|
|
@@ -685,6 +687,10 @@ purgetss b
|
|
|
685
687
|
|
|
686
688
|
When `purgetss` runs (manually or via `watch`), it checks for changes in `config.cjs` and regenerates `utilities.tss` when needed.
|
|
687
689
|
|
|
690
|
+
### Options
|
|
691
|
+
|
|
692
|
+
- `--glossary`: Creates a glossary folder with all generated classes.
|
|
693
|
+
|
|
688
694
|
## `watch` Command
|
|
689
695
|
|
|
690
696
|
The `watch` command runs PurgeTSS on each project compile. You do not need to run `build` manually after each change.
|
|
@@ -718,6 +724,15 @@ purgetss watch --off
|
|
|
718
724
|
purgetss w -o
|
|
719
725
|
```
|
|
720
726
|
|
|
727
|
+
To completely remove the Auto-Purging hook from `alloy.jmk`, use `-d, --delete`.
|
|
728
|
+
|
|
729
|
+
```bash
|
|
730
|
+
purgetss watch --delete
|
|
731
|
+
|
|
732
|
+
# alias:
|
|
733
|
+
purgetss w -d
|
|
734
|
+
```
|
|
735
|
+
|
|
721
736
|
## `module` Command
|
|
722
737
|
|
|
723
738
|
The `module` command installs `purgetss.ui.js` in the `lib` folder.
|
|
@@ -54,6 +54,9 @@ What it does:
|
|
|
54
54
|
1. Creates `./purgetss/styles/fonts.tss` with one `fontFamily` class per file.
|
|
55
55
|
2. Copies the font files into `./app/assets/fonts/`, renamed to their PostScript names so they work on both iOS and Android.
|
|
56
56
|
|
|
57
|
+
> ℹ️ **INFO — How this differs from the official icon fonts**
|
|
58
|
+
> Unlike the [official icon fonts](./icon-fonts.md), which PurgeTSS resolves automatically from its own bundled files and need no `.tss` in your project, custom fonts **do** generate `./purgetss/styles/fonts.tss`. That file is then folded into the generated `app/styles/app.tss` when you run `purgetss` (or compile your app) — that is where the final classes used by Alloy live.
|
|
59
|
+
|
|
57
60
|
After running `purgetss build-fonts` with the Bevan and Dancing Script example above:
|
|
58
61
|
|
|
59
62
|
`./purgetss/styles/fonts.tss`
|
|
@@ -133,19 +136,19 @@ After `purgetss build-fonts`, the generated `fonts.tss` includes the family clas
|
|
|
133
136
|
/* To use your Icon Fonts in Buttons AND Labels each class sets 'text' and 'title' properties */
|
|
134
137
|
|
|
135
138
|
/* map-icons/map-icons.css */
|
|
136
|
-
'.map-icon-abseiling': { text: '
|
|
137
|
-
'.map-icon-accounting': { text: '
|
|
138
|
-
'.map-icon-airport': { text: '
|
|
139
|
-
'.map-icon-amusement-park': { text: '
|
|
140
|
-
'.map-icon-aquarium': { text: '
|
|
139
|
+
'.map-icon-abseiling': { text: '\ue800', title: '\ue800' }
|
|
140
|
+
'.map-icon-accounting': { text: '\ue801', title: '\ue801' }
|
|
141
|
+
'.map-icon-airport': { text: '\ue802', title: '\ue802' }
|
|
142
|
+
'.map-icon-amusement-park': { text: '\ue803', title: '\ue803' }
|
|
143
|
+
'.map-icon-aquarium': { text: '\ue804', title: '\ue804' }
|
|
141
144
|
/* ... */
|
|
142
145
|
|
|
143
146
|
/* microns/microns.css */
|
|
144
|
-
'.mu-arrow-left': { text: '
|
|
145
|
-
'.mu-arrow-right': { text: '
|
|
146
|
-
'.mu-arrow-up': { text: '
|
|
147
|
-
'.mu-arrow-down': { text: '
|
|
148
|
-
'.mu-left': { text: '
|
|
147
|
+
'.mu-arrow-left': { text: '\ue700', title: '\ue700' }
|
|
148
|
+
'.mu-arrow-right': { text: '\ue701', title: '\ue701' }
|
|
149
|
+
'.mu-arrow-up': { text: '\ue702', title: '\ue702' }
|
|
150
|
+
'.mu-arrow-down': { text: '\ue703', title: '\ue703' }
|
|
151
|
+
'.mu-left': { text: '\ue704', title: '\ue704' }
|
|
149
152
|
/* ... */
|
|
150
153
|
```
|
|
151
154
|
|
|
@@ -172,18 +175,18 @@ To avoid prefix conflicts between libraries, each icon keeps its prefix as a nes
|
|
|
172
175
|
const icons = {
|
|
173
176
|
// map-icons/map-icons.css
|
|
174
177
|
'mapIcon': {
|
|
175
|
-
'abseiling': '
|
|
176
|
-
'accounting': '
|
|
177
|
-
'airport': '
|
|
178
|
-
'amusementPark': '
|
|
178
|
+
'abseiling': '\ue800',
|
|
179
|
+
'accounting': '\ue801',
|
|
180
|
+
'airport': '\ue802',
|
|
181
|
+
'amusementPark': '\ue803',
|
|
179
182
|
// ...
|
|
180
183
|
},
|
|
181
184
|
// microns/microns.css
|
|
182
185
|
'mu': {
|
|
183
|
-
'arrowLeft': '
|
|
184
|
-
'arrowRight': '
|
|
185
|
-
'arrowUp': '
|
|
186
|
-
'arrowDown': '
|
|
186
|
+
'arrowLeft': '\ue700',
|
|
187
|
+
'arrowRight': '\ue701',
|
|
188
|
+
'arrowUp': '\ue702',
|
|
189
|
+
'arrowDown': '\ue703',
|
|
187
190
|
// ...
|
|
188
191
|
}
|
|
189
192
|
};
|
|
@@ -221,19 +224,19 @@ purgetss
|
|
|
221
224
|
'.mic': { font: { fontFamily: 'microns' } }
|
|
222
225
|
|
|
223
226
|
/* map-icons/mp.css */
|
|
224
|
-
'.mp-abseiling': { text: '
|
|
225
|
-
'.mp-accounting': { text: '
|
|
226
|
-
'.mp-airport': { text: '
|
|
227
|
-
'.mp-amusement-park': { text: '
|
|
228
|
-
'.mp-aquarium': { text: '
|
|
227
|
+
'.mp-abseiling': { text: '\ue800', title: '\ue800' }
|
|
228
|
+
'.mp-accounting': { text: '\ue801', title: '\ue801' }
|
|
229
|
+
'.mp-airport': { text: '\ue802', title: '\ue802' }
|
|
230
|
+
'.mp-amusement-park': { text: '\ue803', title: '\ue803' }
|
|
231
|
+
'.mp-aquarium': { text: '\ue804', title: '\ue804' }
|
|
229
232
|
/* ... */
|
|
230
233
|
|
|
231
234
|
/* microns/mc.css */
|
|
232
|
-
'.mc-arrow-left': { text: '
|
|
233
|
-
'.mc-arrow-right': { text: '
|
|
234
|
-
'.mc-arrow-up': { text: '
|
|
235
|
-
'.mc-arrow-down': { text: '
|
|
236
|
-
'.mc-left': { text: '
|
|
235
|
+
'.mc-arrow-left': { text: '\ue700', title: '\ue700' }
|
|
236
|
+
'.mc-arrow-right': { text: '\ue701', title: '\ue701' }
|
|
237
|
+
'.mc-arrow-up': { text: '\ue702', title: '\ue702' }
|
|
238
|
+
'.mc-arrow-down': { text: '\ue703', title: '\ue703' }
|
|
239
|
+
'.mc-left': { text: '\ue704', title: '\ue704' }
|
|
237
240
|
/* ... */
|
|
238
241
|
```
|
|
239
242
|
|
|
@@ -242,18 +245,18 @@ purgetss
|
|
|
242
245
|
const icons = {
|
|
243
246
|
// map-icons/mp.css
|
|
244
247
|
'mp': {
|
|
245
|
-
'abseiling': '
|
|
246
|
-
'accounting': '
|
|
247
|
-
'airport': '
|
|
248
|
-
'amusementPark': '
|
|
248
|
+
'abseiling': '\ue800',
|
|
249
|
+
'accounting': '\ue801',
|
|
250
|
+
'airport': '\ue802',
|
|
251
|
+
'amusementPark': '\ue803',
|
|
249
252
|
// ...
|
|
250
253
|
},
|
|
251
254
|
// microns/mc.css
|
|
252
255
|
'mc': {
|
|
253
|
-
'arrowLeft': '
|
|
254
|
-
'arrowRight': '
|
|
255
|
-
'arrowUp': '
|
|
256
|
-
'arrowDown': '
|
|
256
|
+
'arrowLeft': '\ue700',
|
|
257
|
+
'arrowRight': '\ue701',
|
|
258
|
+
'arrowUp': '\ue702',
|
|
259
|
+
'arrowDown': '\ue703',
|
|
257
260
|
// ...
|
|
258
261
|
}
|
|
259
262
|
};
|
|
@@ -16,7 +16,7 @@ Whether you want to style a Ti Element (a markup element such as `Label`), a cus
|
|
|
16
16
|
|
|
17
17
|
> **CAUTION — Migrating from PurgeTSS v4 or v5 to v7+**
|
|
18
18
|
>
|
|
19
|
-
> If your project started on PurgeTSS v5 or earlier and you are now on 7.x.x or later, the class-naming convention changed (`camelCase` -> `kebab-case`) and the config moved to
|
|
19
|
+
> If your project started on PurgeTSS v5 or earlier and you are now on 7.x.x or later, the class-naming convention changed (`camelCase` -> `kebab-case`) and the config moved to CommonJS-style `config.cjs`. The recommended upgrade path is:
|
|
20
20
|
>
|
|
21
21
|
> 1. **Audit current usage.** Set `purge.options.missing` to `true` in `config.cjs`. PurgeTSS will append a list of missing classes at the end of `app.tss` after the next compile — every entry is a class name you still need to migrate.
|
|
22
22
|
> 2. **Rename selectors.** Convert every `.myCustomClassName` to `.my-custom-class-name` in both XML markup and `config.cjs`. The old camelCase names will not match anymore.
|
|
@@ -57,9 +57,11 @@ module.exports = {
|
|
|
57
57
|
confirmOverwrites: true // prompt before overwriting files (set false to skip)
|
|
58
58
|
},
|
|
59
59
|
images: {
|
|
60
|
+
autoSync: true, // false = SVG pipeline computes dims but doesn't write to images.files (v7.11.0)
|
|
60
61
|
quality: 85, // JPEG/WebP/AVIF quality (0-100)
|
|
61
62
|
format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
|
|
62
|
-
confirmOverwrites: true
|
|
63
|
+
confirmOverwrites: true, // prompt before overwriting files (set false to skip)
|
|
64
|
+
files: [] // per-file overrides: [{ filename, width, height? }] (v7.11.0)
|
|
63
65
|
// Note: --width (v7.8.0) and --opacity / --padding / --output (v7.10.0) are CLI-only
|
|
64
66
|
// by design — those decisions are per-asset, not project-wide.
|
|
65
67
|
},
|
|
@@ -270,6 +272,37 @@ module.exports = {
|
|
|
270
272
|
};
|
|
271
273
|
```
|
|
272
274
|
|
|
275
|
+
### Config Syntax Validation (v7.11.0)
|
|
276
|
+
|
|
277
|
+
Since v7.11.0, PurgeTSS validates known fields in `config.cjs` at load time. On a type mismatch it prints a formatted `Config Syntax Error` block — file, JSON path, context, issue, and a fix snippet — instead of crashing downstream with a cryptic message like `rule.startsWith is not a function`.
|
|
278
|
+
|
|
279
|
+
The validator runs on every config load and covers the case that trips up developers coming from Tailwind: `fontFamily` values must be a **string**, not a Tailwind-style array. It currently validates:
|
|
280
|
+
|
|
281
|
+
- `theme.fontFamily.*` — expected a string.
|
|
282
|
+
- `theme.extend.fontFamily.*` — expected a string.
|
|
283
|
+
|
|
284
|
+
```javascript
|
|
285
|
+
// ✗ Tailwind-style array — triggers a Config Syntax Error
|
|
286
|
+
theme: {
|
|
287
|
+
extend: {
|
|
288
|
+
fontFamily: {
|
|
289
|
+
sans: ['Inter', 'sans-serif']
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ✓ Single font family per element (Titanium accepts one)
|
|
295
|
+
theme: {
|
|
296
|
+
extend: {
|
|
297
|
+
fontFamily: {
|
|
298
|
+
sans: 'Inter-Regular'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
The scope is defined by the `FIELD_RULES` array in `src/shared/validation/config-validator.js`; additional fields can be added there. Today only the two `fontFamily` paths are validated.
|
|
305
|
+
|
|
273
306
|
## Overriding and Extending Properties
|
|
274
307
|
|
|
275
308
|
By default, your project inherits values from the default theme. You have two options depending on your goal.
|
|
@@ -396,6 +429,36 @@ module.exports = {
|
|
|
396
429
|
|
|
397
430
|
The nested keys are combined with the parent key to form class names like `bg-tahiti-400` or `text-tahiti-400`.
|
|
398
431
|
|
|
432
|
+
### Nesting beyond one level
|
|
433
|
+
|
|
434
|
+
Since v7.10.0, `theme` and `theme.extend` values are walked recursively, so you can group categories more than one level deep. Each level flattens into a kebab-case suffix on the generated class names:
|
|
435
|
+
|
|
436
|
+
```javascript
|
|
437
|
+
module.exports = {
|
|
438
|
+
theme: {
|
|
439
|
+
extend: {
|
|
440
|
+
colors: {
|
|
441
|
+
brand: {
|
|
442
|
+
primary: {
|
|
443
|
+
500: '#0ea5e9',
|
|
444
|
+
900: '#0c4a6e'
|
|
445
|
+
},
|
|
446
|
+
accent: '#f97316'
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
```tss
|
|
455
|
+
'.bg-brand-primary-500': { backgroundColor: '#0ea5e9' }
|
|
456
|
+
'.bg-brand-primary-900': { backgroundColor: '#0c4a6e' }
|
|
457
|
+
'.bg-brand-accent': { backgroundColor: '#f97316' }
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
Default modifier keys (`default`, `global`, `DEFAULT`) collapse without contributing to the suffix. The same flattening applies to other property categories that accept nested objects, including `backgroundGradient` and `backgroundSelectedGradient`. One-level configs behave exactly as before.
|
|
461
|
+
|
|
399
462
|
### Override a Default Color
|
|
400
463
|
|
|
401
464
|
If you want to override one of the default colors but keep the rest, provide the new values in `theme.extend.colors`.
|
|
@@ -55,6 +55,8 @@ $ purgetss il -v=fa,mi,ms,f7
|
|
|
55
55
|
|
|
56
56
|
> ℹ️ **INFO — You do not need the `.tss` files in `./purgetss/styles/`**
|
|
57
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`.
|
|
58
60
|
|
|
59
61
|
### Optional flags
|
|
60
62
|
|
|
@@ -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.
|
|
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
|
|
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.
|