@maccesar/titools 2.10.1 → 3.2.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/AGENTS-VERCEL-RESEARCH.md +23 -12
- package/README.md +81 -182
- package/agents/ti-pro.md +8 -14
- package/lib/cleanup.js +13 -0
- package/lib/commands/skills.js +2 -1
- package/lib/config.js +9 -11
- package/lib/platform.js +1 -1
- package/package.json +2 -3
- package/skills/purgetss/SKILL.md +44 -57
- package/skills/purgetss/references/EXAMPLES.md +8 -1
- package/skills/purgetss/references/app-branding.md +96 -16
- package/skills/purgetss/references/apply-directive.md +26 -1
- package/skills/purgetss/references/arbitrary-values.md +72 -2
- package/skills/purgetss/references/class-categories.md +1 -1
- package/skills/purgetss/references/cli-commands.md +37 -13
- package/skills/purgetss/references/customization-deep-dive.md +18 -11
- package/skills/purgetss/references/dynamic-component-creation.md +0 -1
- package/skills/purgetss/references/migration-guide.md +162 -1
- package/skills/purgetss/references/multi-density-images.md +69 -0
- package/skills/purgetss/references/version-history.md +82 -0
- package/skills/ti-expert/SKILL.md +1 -1
- package/skills/ti-ui/SKILL.md +1 -1
- package/skills/alloy-guides/SKILL.md +0 -190
- package/skills/alloy-guides/references/CLI_TASKS.md +0 -233
- package/skills/alloy-guides/references/CONCEPTS.md +0 -171
- package/skills/alloy-guides/references/CONTROLLERS.md +0 -279
- package/skills/alloy-guides/references/MODELS.md +0 -1214
- package/skills/alloy-guides/references/PURGETSS.md +0 -46
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +0 -235
- package/skills/alloy-guides/references/VIEWS_STYLES.md +0 -375
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
- package/skills/alloy-guides/references/VIEWS_XML.md +0 -581
- package/skills/alloy-guides/references/WIDGETS.md +0 -160
- package/skills/alloy-howtos/SKILL.md +0 -181
- package/skills/alloy-howtos/references/best_practices.md +0 -121
- package/skills/alloy-howtos/references/cli_reference.md +0 -230
- package/skills/alloy-howtos/references/config_files.md +0 -158
- package/skills/alloy-howtos/references/custom_tags.md +0 -148
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +0 -78
- package/skills/alloy-howtos/references/samples.md +0 -156
- package/skills/ti-api/SKILL.md +0 -109
- package/skills/ti-api/references/api-android.md +0 -675
- package/skills/ti-api/references/api-app-platform.md +0 -636
- package/skills/ti-api/references/api-core.md +0 -764
- package/skills/ti-api/references/api-data-network.md +0 -641
- package/skills/ti-api/references/api-media.md +0 -655
- package/skills/ti-api/references/api-modules-ble-bluetooth.md +0 -657
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +0 -411
- package/skills/ti-api/references/api-modules-map.md +0 -632
- package/skills/ti-api/references/api-modules-nfc.md +0 -725
- package/skills/ti-api/references/api-modules-social-misc.md +0 -526
- package/skills/ti-api/references/api-services.md +0 -700
- package/skills/ti-api/references/api-ui-android.md +0 -499
- package/skills/ti-api/references/api-ui-extras.md +0 -702
- package/skills/ti-api/references/api-ui-ios-animator.md +0 -378
- package/skills/ti-api/references/api-ui-ios.md +0 -756
- package/skills/ti-api/references/api-ui-lists.md +0 -581
- package/skills/ti-api/references/api-ui-text-input.md +0 -607
- package/skills/ti-api/references/api-ui-views.md +0 -572
- package/skills/ti-api/references/api-ui-windows-navigation.md +0 -676
- package/skills/ti-api/references/api-xml-global.md +0 -743
- package/skills/ti-guides/SKILL.md +0 -75
- package/skills/ti-guides/references/advanced-data-and-images.md +0 -155
- package/skills/ti-guides/references/android-manifest.md +0 -97
- package/skills/ti-guides/references/app-distribution.md +0 -373
- package/skills/ti-guides/references/application-frameworks.md +0 -366
- package/skills/ti-guides/references/cli-reference.md +0 -700
- package/skills/ti-guides/references/coding-best-practices.md +0 -150
- package/skills/ti-guides/references/commonjs-advanced.md +0 -279
- package/skills/ti-guides/references/hello-world.md +0 -99
- package/skills/ti-guides/references/hyperloop-native-access.md +0 -458
- package/skills/ti-guides/references/javascript-primer.md +0 -402
- package/skills/ti-guides/references/reserved-words.md +0 -36
- package/skills/ti-guides/references/resources.md +0 -172
- package/skills/ti-guides/references/style-and-conventions.md +0 -104
- package/skills/ti-guides/references/tiapp-config.md +0 -655
- package/skills/ti-howtos/SKILL.md +0 -143
- package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -609
- package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
- package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
- package/skills/ti-howtos/references/cross-platform-development.md +0 -358
- package/skills/ti-howtos/references/debugging-profiling.md +0 -473
- package/skills/ti-howtos/references/extending-titanium.md +0 -684
- package/skills/ti-howtos/references/google-maps-v2.md +0 -172
- package/skills/ti-howtos/references/ios-map-kit.md +0 -149
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -595
- package/skills/ti-howtos/references/local-data-sources.md +0 -310
- package/skills/ti-howtos/references/location-and-maps.md +0 -267
- package/skills/ti-howtos/references/media-apis.md +0 -268
- package/skills/ti-howtos/references/notification-services.md +0 -539
- package/skills/ti-howtos/references/remote-data-sources.md +0 -339
- package/skills/ti-howtos/references/tutorials.md +0 -552
- package/skills/ti-howtos/references/using-modules.md +0 -182
- package/skills/ti-howtos/references/web-content-integration.md +0 -288
- package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -125
|
@@ -37,9 +37,10 @@ module.exports = {
|
|
|
37
37
|
brand: {
|
|
38
38
|
logos: {}, // empty = auto-discovers from purgetss/brand/
|
|
39
39
|
padding: {
|
|
40
|
-
ios: '4%',
|
|
41
|
-
androidLegacy: '10%',
|
|
42
|
-
androidAdaptive: '19%' // adaptive icon safe-zone %. Spec floor 19.44%.
|
|
40
|
+
ios: '4%', // iOS aesthetic padding. Range 2-8%.
|
|
41
|
+
androidLegacy: '10%', // legacy ic_launcher.png padding %
|
|
42
|
+
androidAdaptive: '19%', // adaptive icon safe-zone %. Spec floor 19.44%.
|
|
43
|
+
featureGraphic: '12%' // MarketplaceArtworkFeature.png vertical padding (v7.10.0)
|
|
43
44
|
},
|
|
44
45
|
android: {
|
|
45
46
|
splash: false, // also generate splash_icon.png × 5
|
|
@@ -59,6 +60,8 @@ module.exports = {
|
|
|
59
60
|
quality: 85, // JPEG/WebP/AVIF quality (0-100)
|
|
60
61
|
format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
|
|
61
62
|
confirmOverwrites: true // prompt before overwriting files (set false to skip)
|
|
63
|
+
// Note: --width (v7.8.0) and --opacity / --padding / --output (v7.10.0) are CLI-only
|
|
64
|
+
// by design — those decisions are per-asset, not project-wide.
|
|
62
65
|
},
|
|
63
66
|
theme: {
|
|
64
67
|
extend: {}
|
|
@@ -78,12 +81,15 @@ The config file has four main sections: `purge`, `brand`, `images`, and `theme`.
|
|
|
78
81
|
|
|
79
82
|
For `brand`, the structure is grouped by purpose (introduced in v7.7.0, refined since):
|
|
80
83
|
|
|
81
|
-
- `logos`: optional path overrides when you do not want to rely on `purgetss/brand/` auto-discovery
|
|
82
|
-
- `padding`: visual sizing for iOS, Android legacy,
|
|
84
|
+
- `logos`: optional path overrides when you do not want to rely on `purgetss/brand/` auto-discovery — including `featureGraphic` for the Google Play 1024×500 banner (v7.10.0)
|
|
85
|
+
- `padding`: visual sizing for iOS, Android legacy, Android adaptive icons, and the Feature Graphic banner (v7.10.0)
|
|
83
86
|
- `android`: Android-only optional outputs such as `splash_icon.png` and notification icons
|
|
84
87
|
- `ios`: iOS-only variant toggles (`dark`, `tinted`) and the optional `darkBackground` color
|
|
85
88
|
- `colors`: shared color settings such as the adaptive background and iOS flatten color
|
|
86
89
|
|
|
90
|
+
> **INFO — Pre-7.7.0 flat configs auto-migrate**
|
|
91
|
+
> Since v7.10.2, projects on the flat `brand:` schema (`brand.padding: <number>`, `brand.iosPadding`, `brand.bgColor`, etc.) auto-migrate in memory on every run. The grouped key always wins when both forms coexist, and a one-time deprecation notice lists the migrated keys. Update `config.cjs` to the grouped schema to silence the notice. See [App Icons & Branding → Upgrading from pre-7.7.0 configs](./app-branding.md#upgrading-from-pre-7-7-0-configs).
|
|
92
|
+
|
|
87
93
|
For the property-by-property reference, see [Configurable Properties](./configurable-properties.md).
|
|
88
94
|
|
|
89
95
|
### Overriding logo paths
|
|
@@ -94,12 +100,13 @@ By default, PurgeTSS auto-discovers logo files from `purgetss/brand/`. If you wa
|
|
|
94
100
|
module.exports = {
|
|
95
101
|
brand: {
|
|
96
102
|
logos: {
|
|
97
|
-
primary: './my-logos/main.svg',
|
|
98
|
-
androidLauncher: './my-logos/icon.svg',
|
|
99
|
-
androidSplash: './my-logos/splash.svg',
|
|
100
|
-
monochrome: './my-logos/mono.svg',
|
|
101
|
-
iosDark: './my-logos/dark.svg',
|
|
102
|
-
iosTinted: './my-logos/tinted.svg' // overrides auto-discovered logo-tinted.svg
|
|
103
|
+
primary: './my-logos/main.svg', // overrides auto-discovered logo.svg
|
|
104
|
+
androidLauncher: './my-logos/icon.svg', // overrides auto-discovered logo-icon.svg
|
|
105
|
+
androidSplash: './my-logos/splash.svg', // overrides auto-discovered logo-splash.svg
|
|
106
|
+
monochrome: './my-logos/mono.svg', // overrides auto-discovered logo-mono.svg
|
|
107
|
+
iosDark: './my-logos/dark.svg', // overrides auto-discovered logo-dark.svg
|
|
108
|
+
iosTinted: './my-logos/tinted.svg', // overrides auto-discovered logo-tinted.svg
|
|
109
|
+
featureGraphic: './my-logos/feature.svg' // overrides auto-discovered logo-feature.svg (v7.10.0)
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
112
|
};
|
|
@@ -1,11 +1,168 @@
|
|
|
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.10.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.10.x
|
|
10
|
+
|
|
11
|
+
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).
|
|
12
|
+
|
|
13
|
+
### Added in v7.10.0
|
|
14
|
+
|
|
15
|
+
- **`purgetss images --opacity / --padding / --output`** — three CLI-only flags aimed at placeholder / default ImageView workflows. `--opacity` multiplies alpha; `--padding` shrinks the rendered image inside each density canvas; `--output` retargets the basename and subpath. See [`multi-density-images.md`](./multi-density-images.md).
|
|
16
|
+
- **Google Play Feature Graphic in `brand`** — `purgetss brand` now generates `MarketplaceArtworkFeature.png` (1024×500). Auto-discovers `purgetss/brand/logo-feature.{svg,png}` or reuses the master logo. Tune with `--feature-graphic-padding <n>` (range `0-40`, default `12%`), `brand.padding.featureGraphic`, or `--feature-logo <path>`. See [`app-branding.md`](./app-branding.md).
|
|
17
|
+
- **Arbitrary nesting depth in `theme` objects** — property emission walks nested values recursively instead of stopping at level 2. `theme.extend.colors.brand.primary.500` now flattens to `brand-primary-500` instead of being silently dropped. Default keys (`default`, `global`, `DEFAULT`) collapse without contributing to the suffix. See [`arbitrary-values.md`](./arbitrary-values.md).
|
|
18
|
+
- **`apply:` resolves bundled icon fonts from `dist/`** — `apply: 'fas fa-times-circle wh-12 ...'` now merges the FontAwesome family and glyph automatically. Same lookup runs for `mi-*` (Material Icons), `ms-*` (Material Symbols), and `f7-*` (Framework7). Project-level `purgetss/styles/fontawesome.tss` still wins over the bundled default. See [`apply-directive.md`](./apply-directive.md).
|
|
19
|
+
|
|
20
|
+
### Fixed in v7.10.0
|
|
21
|
+
|
|
22
|
+
- **`borderRadius` arrays inside `apply:`** — the post-merge dedup step now tracks depth on `[]` alongside `{}`, so directional rules like `rounded-{t,b,l,r,tl,tr,bl,br}-*` no longer get split on internal commas.
|
|
23
|
+
- **`brand --padding <n>` shortcut** — now applies to BOTH Android paddings (`androidAdaptivePadding` AND `androidLegacyPadding`) as the help text always promised. Previously only fed the adaptive one.
|
|
24
|
+
|
|
25
|
+
### v7.10.1 — copy-only changes
|
|
26
|
+
|
|
27
|
+
- **"Tailwind" framing dropped** from copy that did not document a functional integration. Error block now reports `Square brackets "[ ]" are not supported` (previously `Tailwind-style brackets "[ ]"`). The promotional `<Label>` injected into new projects by `purgetss create` changed from `"Tailwind-inspired utility classes for Titanium/Alloy"` to `"Utility-first styling for Titanium/Alloy"`.
|
|
28
|
+
- **Functional integrations stay**: `tailwindcss@3` dependency installed by `install-dependencies` (drives the `defaultColors` / `defaultTheme` palette base AND the VSCode IntelliSense extension); `--tailwind` flag on `purgetss shades`; recommended `Tailwind CSS IntelliSense` and `Tailwind Raw Reorder (v4)` VSCode extensions.
|
|
29
|
+
|
|
30
|
+
### v7.10.2 — pre-7.7.0 brand config auto-migration
|
|
31
|
+
|
|
32
|
+
If your project still uses the **flat** `brand:` config that predates v7.7.0, v7.10.2 normalizes it in memory on every run before defaults are applied. Without this, the build crashed with `TypeError: Cannot create property 'ios' on number '15'` because `brand.padding` was a number, not an object.
|
|
33
|
+
|
|
34
|
+
Mapping (see [`app-branding.md` → Upgrading from pre-7.7.0 configs](./app-branding.md#upgrading-from-pre-7-7-0-configs)):
|
|
35
|
+
|
|
36
|
+
| Pre-7.7.0 flat key | Current grouped key |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `brand.padding: <number\|string>` | `brand.padding.androidLegacy` AND `brand.padding.androidAdaptive` (same value applied to both) |
|
|
39
|
+
| `brand.iosPadding` | `brand.padding.ios` |
|
|
40
|
+
| `brand.bgColor` | `brand.colors.background` |
|
|
41
|
+
| `brand.darkBgColor` | `brand.ios.darkBackground` |
|
|
42
|
+
| `brand.notification` | `brand.android.notification` |
|
|
43
|
+
| `brand.splash` | `brand.android.splash` |
|
|
44
|
+
|
|
45
|
+
The grouped key always wins when both forms coexist. A one-time deprecation notice per session lists which legacy keys were migrated. Auto-migration is transitional and may be removed in a future major version — update `config.cjs` to the grouped schema to silence the notice and stay future-proof.
|
|
46
|
+
|
|
47
|
+
### What to review
|
|
48
|
+
|
|
49
|
+
- If you maintain a `brand:` block from pre-7.7.0, plan the one-time update to the grouped schema (`logos`, `padding`, `android`, `ios`, `colors`).
|
|
50
|
+
- If you previously skipped `apply:` with icon fonts because they were silently dropped, that workaround is no longer needed in v7.10.0.
|
|
51
|
+
- Deeply nested color families in `theme.extend.colors.*` that you flattened by hand to stay at depth ≤ 2 can be restructured by domain — the recursive emission now reaches every leaf.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Upgrade to v7.9.0
|
|
56
|
+
|
|
57
|
+
v7.9.0 ships one **breaking** path rename plus a behavior change for `theme.Window` / `theme.View` / `theme.ImageView` that can surface as a regression if a project depended on the framework defaults being merged in.
|
|
58
|
+
|
|
59
|
+
### Breaking — glossary output path renamed
|
|
60
|
+
|
|
61
|
+
The user-facing glossary output path moved from `purgetss/experimental/tailwind-classes/` to `purgetss/glossary/tailwind-classes/`. Tooling or CI that reads from the old path needs updating on upgrade — no transition shim was added on purpose. The `--glossary` flag and command surface are unchanged.
|
|
62
|
+
|
|
63
|
+
### Headline behavior change — replace mode for top-level `theme.Window` / `View` / `ImageView`
|
|
64
|
+
|
|
65
|
+
Before v7.9.0, `theme.Window` (no `extend`) still merged with the framework defaults (white `backgroundColor`, `Ti.UI.SIZE` on `View`, iOS `hires: true` on `ImageView`), which produced gradient ghosting and similar overrides. v7.9.0 makes top-level configs behave as true **replace mode**.
|
|
66
|
+
|
|
67
|
+
If you previously wrote:
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
theme: {
|
|
71
|
+
Window: {
|
|
72
|
+
apply: 'bg-gradient-to-b from-blue-500 to-purple-600'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
…and **depended** on the implicit white background, the gradient now renders without that background underneath. Move the config under `theme.extend.Window` to keep the merged behavior, or add the previously-implicit utilities back into the `apply` string. See [`apply-directive.md` → Extend mode vs replace mode](./apply-directive.md#extend-mode-vs-replace-mode).
|
|
78
|
+
|
|
79
|
+
### Added in v7.9.0
|
|
80
|
+
|
|
81
|
+
- **Opacity modifiers on semantic colors** — `bg-surface/65` now works for any class mapped through `theme.extend.colors`. PurgeTSS auto-derives `<originalKey>_<alphaPercent>` entries in `semantic.colors.json` per mode (light/dark). **Native rebuild required** — Liveview hot-reload alone does not refresh `semantic.colors.json`. See [`semantic-colors.md`](./semantic-colors.md#opacity-modifier-auto-derivation).
|
|
82
|
+
|
|
83
|
+
### Fixed in v7.9.0
|
|
84
|
+
|
|
85
|
+
- Several fixes around semantic colors, gradients, and Ti Element defaults: tonal palette no longer inverts Light and Dark; gradient `from` / `to` color order is position-stable across `sort()`; `bg-gradient-to-X` direction is preserved when combined with `from-X to-Y` in the same `apply`; `theme.Window` / `theme.View` / `theme.ImageView` no longer ghost framework presets at the top level (see Headline behavior change above).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Upgrade to v7.8.0
|
|
90
|
+
|
|
91
|
+
v7.8.0 introduces a structured `Class Syntax Error` block that **halts the build** when it detects known class-name mistakes — previously these flowed silently into the `// Unused or unsupported classes` block of `app.tss`.
|
|
92
|
+
|
|
93
|
+
### Added — Class Syntax Error pre-validation
|
|
94
|
+
|
|
95
|
+
Five patterns are now caught and reported with file + line + suggested fix:
|
|
96
|
+
|
|
97
|
+
| Pattern | Offending input | Fix |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Inverted negative sign | `top-(-10)` | `-top-(10)` |
|
|
100
|
+
| Square-bracket notation | `top-[10px]` | `top-(10px)` |
|
|
101
|
+
| Empty parentheses | `wh-()` | (flagged, no auto-fix) |
|
|
102
|
+
| Whitespace inside parentheses | `wh-( 200 )` | `wh-(200)` |
|
|
103
|
+
| Redundant `px` unit | `top-(10px)` | `top-(10)` |
|
|
104
|
+
|
|
105
|
+
All offenders are reported in a single run. Generic unknown classes — typos, vendor utilities not enabled, custom classes not declared yet — continue to flow into `// Unused or unsupported classes`. See [`arbitrary-values.md` → Class syntax pre-validation](./arbitrary-values.md#class-syntax-pre-validation).
|
|
106
|
+
|
|
107
|
+
### Added — `purgetss images --width <n>` (v7.8.0)
|
|
108
|
+
|
|
109
|
+
Pins Android `mdpi` (= iPhone `@1x`) to `<n>` pixels wide. Larger scales derive as ×1.5, ×2, ×3, ×4 from that base. Range `[1, 8192]`. Most useful for SVG sources from vector editors (Affinity, Illustrator) with disproportionate viewBoxes. CLI-only — width is per-asset, not a project-wide setting. See [`multi-density-images.md`](./multi-density-images.md#pinning-the-output-width-with---width).
|
|
110
|
+
|
|
111
|
+
### Fixed in v7.8.0
|
|
112
|
+
|
|
113
|
+
- The arbitrary-value parser no longer crashes on negative values inside parentheses — `top-(-10)` is now recognized and reported as an inverted-negative-sign error instead of triggering a `Cannot read properties of null (reading 'pop')` exception.
|
|
114
|
+
|
|
115
|
+
### What to review
|
|
116
|
+
|
|
117
|
+
- Run the build once on the upgraded version and address every `Class Syntax Error` it surfaces. The offender list is exhaustive in one pass.
|
|
118
|
+
- If a CI step depended on a malformed class quietly landing in the unused-classes block, it will now hard-fail — adjust the CI accordingly.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Upgrade to v7.7.0
|
|
123
|
+
|
|
124
|
+
v7.7.0 cleans up the `brand:` config before stabilizing it. **Pre-7.10.2** projects on the flat schema crashed; from v7.10.2 onward the flat schema auto-migrates in memory (see Upgrade to v7.10.x). The recommended migration is still a one-time update to the grouped schema.
|
|
125
|
+
|
|
126
|
+
### Restructure — grouped `brand:` config
|
|
127
|
+
|
|
128
|
+
Branding settings moved out of flat keys into purpose-based groups: `brand.logos`, `brand.padding`, `brand.android`, `brand.ios`, `brand.colors`.
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
// Pre-7.7.0 — flat
|
|
132
|
+
brand: {
|
|
133
|
+
padding: 15,
|
|
134
|
+
iosPadding: 4,
|
|
135
|
+
bgColor: '#FFFFFF',
|
|
136
|
+
notification: false,
|
|
137
|
+
splash: false
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// v7.7.0+ — grouped
|
|
141
|
+
brand: {
|
|
142
|
+
padding: {
|
|
143
|
+
ios: '4%',
|
|
144
|
+
androidLegacy: '10%',
|
|
145
|
+
androidAdaptive: '19%'
|
|
146
|
+
},
|
|
147
|
+
android: {
|
|
148
|
+
notification: false,
|
|
149
|
+
splash: false
|
|
150
|
+
},
|
|
151
|
+
colors: {
|
|
152
|
+
background: '#FFFFFF'
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Added in v7.7.0
|
|
158
|
+
|
|
159
|
+
- **Separate Android brand inputs** — `logos.androidLauncher` / `--icon-logo` for the Android launcher icon; `logos.androidSplash` / `--splash-logo` for Android 12+ splash artwork. Drop `logo-icon.*` / `logo-splash.*` into `purgetss/brand/` for auto-discovery.
|
|
160
|
+
- **Independent Android paddings** — `--android-adaptive-padding` (default `19%`) and `--android-legacy-padding` (default `10%`) replace the single `--padding`. `--padding` is now a shortcut that sets both for one run (note: the shortcut bug where only `androidAdaptive` was applied was fixed in v7.10.0).
|
|
161
|
+
- **Android splash fallback regenerated** — `app/assets/android/default.png` (Alloy) or `Resources/android/default.png` (Classic). `cleanup-legacy` no longer removes `default.png`.
|
|
162
|
+
- **Values and Units doc** — new official reference explaining how `ti.ui.defaultunit` in `tiapp.xml` interprets PurgeTSS unitless values. See [`values-and-units.md`](./values-and-units.md).
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
9
166
|
## Upgrade to v7.6.0
|
|
10
167
|
|
|
11
168
|
v7.6.0 introduces three new CLI commands for app-asset generation plus two new `config.cjs` sections. None of the additions are breaking — existing projects continue to work untouched, and the new config sections are auto-injected on first run.
|
|
@@ -211,3 +368,7 @@ If you previously worked around this by inlining the gradient directly in TSS, r
|
|
|
211
368
|
- After v7.5.0: diff generated `utilities.tss` to confirm property deduplication produces the expected output.
|
|
212
369
|
- After v7.5.3: consider wiring `Appearance.init()` at app boot if you want runtime Light/Dark switching.
|
|
213
370
|
- After v7.6.0: run `brand`, `images`, and `semantic` once in a scratch project before pointing them at production assets, so you can preview the output layout.
|
|
371
|
+
- After v7.7.0: migrate the `brand:` block in `config.cjs` to the grouped schema (`logos`, `padding`, `android`, `ios`, `colors`). v7.10.2 auto-migrates flat configs in memory, but the one-time update is recommended to silence the deprecation notice.
|
|
372
|
+
- 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
|
+
- 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
|
+
- 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`.
|
|
@@ -304,6 +304,67 @@ purgetss images --format webp --quality 85
|
|
|
304
304
|
|
|
305
305
|
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
306
|
|
|
307
|
+
## Reducing alpha across every density with `--opacity` (v7.10.0)
|
|
308
|
+
|
|
309
|
+
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).
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
purgetss images logo.svg --opacity 50 --format png
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
- `--opacity` accepts integers in `[0, 100]`. Out-of-range values exit immediately without writing anything (`Invalid --opacity '150'. Must be an integer between 0 and 100.`).
|
|
316
|
+
- `--opacity 100` is a no-op — the compositing pass is skipped entirely.
|
|
317
|
+
- `--opacity 0` produces a fully transparent output (technically valid, visually empty).
|
|
318
|
+
|
|
319
|
+
### Format interactions
|
|
320
|
+
|
|
321
|
+
- **PNG / WebP / AVIF:** alpha is preserved.
|
|
322
|
+
- **JPEG:** JPEG has no alpha. The existing flatten-on-white step composites the semi-transparent image onto white before writing, so `--opacity 50 --format jpeg` produces a 50%-faded version **on white**, not a transparent JPEG.
|
|
323
|
+
|
|
324
|
+
## Adding breathing room with `--padding` (v7.10.0)
|
|
325
|
+
|
|
326
|
+
`--padding <n>` shrinks the rendered image inside each density canvas by `n%` symmetric borders. Useful when the source logo has no built-in padding and you want a placeholder with breathing room — without editing the source asset.
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
purgetss images purgetss/brand/logo.png --padding 15 --format png
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Each density's output canvas keeps the same dimensions it would have without `--padding`, but the rendered image takes only `(1 − 2 × 0.15) = 70%` of that canvas (centered). The remaining 30% of the canvas (15% on each side) is transparent.
|
|
333
|
+
|
|
334
|
+
- `--padding` accepts integers in `[0, 40]`. Out-of-range or negative values are rejected (`Invalid --padding '50'. Must be an integer between 0 and 40.`).
|
|
335
|
+
- `--padding 0` is a no-op (skipped — no extend pass).
|
|
336
|
+
|
|
337
|
+
### When *not* to use `--padding`
|
|
338
|
+
|
|
339
|
+
If your source logo already has the breathing room you want baked in, you don't need `--padding` — it compounds the existing padding. Use `--padding` when:
|
|
340
|
+
|
|
341
|
+
- the source is edge-to-edge (no built-in margin) and you want a centered placeholder
|
|
342
|
+
- you need a fast way to produce a "loose" variant of a logo without touching the source file
|
|
343
|
+
|
|
344
|
+
## Renaming the output with `--output` (v7.10.0)
|
|
345
|
+
|
|
346
|
+
By default, the output basename comes from the source filename and the subfolder mirrors the source's location inside `purgetss/images/`. When you want a different output path — for example, sourcing a logo from `purgetss/brand/` and writing it as a placeholder under `images/logos/` — `--output <relpath>` overrides both:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
purgetss images purgetss/brand/logo.svg --output logos/default-image
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
That writes `images/logos/default-image.png` (or `.jpg` / `.webp` depending on `--format`) across all densities, regardless of the source's location.
|
|
353
|
+
|
|
354
|
+
### Combining `--opacity`, `--padding`, and `--output`
|
|
355
|
+
|
|
356
|
+
The three flags compose for the canonical "transparent placeholder with padding under a custom path" use case:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
purgetss images purgetss/brand/logo.svg \
|
|
360
|
+
--opacity 30 \
|
|
361
|
+
--padding 15 \
|
|
362
|
+
--output 'logos/default-image' \
|
|
363
|
+
--format png
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Produces a 30% opacity, 15%-padded version of the brand logo at `images/logos/default-image.png` for every Android density and iPhone scale — a one-command way to ship a default ImageView placeholder.
|
|
367
|
+
|
|
307
368
|
## Full pipeline alongside `build`
|
|
308
369
|
|
|
309
370
|
The typical sequence when iterating on an app:
|
|
@@ -348,6 +409,9 @@ If you only tweaked CSS classes (no image changes), you don't need to re-run `pu
|
|
|
348
409
|
| `--format <ext>` | Convert all outputs to: `webp`, `jpeg`, `png`, `avif`, `gif`, `tiff`. Default: keep source format. |
|
|
349
410
|
| `--quality <n>` | Quality `0–100` for lossy formats. Default `85`. |
|
|
350
411
|
| `--width <n>` | (v7.8.0) Pin `mdpi` / `@1x` output width to `n` pixels; `[1, 8192]`. Other densities derive from this base (×1.5 / ×2 / ×3 / ×4). Most useful for SVG sources with non-standard viewBoxes. CLI-only — no `config.cjs` equivalent because width is per-asset. |
|
|
412
|
+
| `--opacity <n>` | (v7.10.0) Multiply the alpha channel of every generated density by `n/100`. Range `[0, 100]`. Combine with `--format jpeg` and the alpha is flattened on white instead of producing a transparent JPEG. CLI-only. |
|
|
413
|
+
| `--padding <n>` | (v7.10.0) Shrink the rendered image inside each density canvas by `n%` symmetric borders. Range `[0, 40]`. CLI-only. |
|
|
414
|
+
| `--output <relpath>` | (v7.10.0) Override the basename and subpath relative to each platform's `images/` root. Lets a source from outside `purgetss/images/` (e.g. `purgetss/brand/`) write into a custom output folder like `images/logos/`. CLI-only. |
|
|
351
415
|
|
|
352
416
|
**Project & output**
|
|
353
417
|
|
|
@@ -371,6 +435,11 @@ purgetss images background/pink-texture.png # re-process one file (sh
|
|
|
371
435
|
purgetss images background/ # re-process one subfolder
|
|
372
436
|
purgetss images --android # only Android densities
|
|
373
437
|
purgetss images --format webp --quality 90 # convert all outputs to WebP
|
|
438
|
+
purgetss images --opacity 50 --format png # 50% alpha placeholder (v7.10.0)
|
|
439
|
+
purgetss images logo.svg --padding 15 --format png # add 15% breathing room (v7.10.0)
|
|
440
|
+
purgetss images purgetss/brand/logo.svg \
|
|
441
|
+
--opacity 30 --padding 15 \
|
|
442
|
+
--output 'logos/default-image' --format png # placeholder under custom path (v7.10.0)
|
|
374
443
|
purgetss images --dry-run # preview
|
|
375
444
|
```
|
|
376
445
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# PurgeTSS — Version History
|
|
2
|
+
|
|
3
|
+
Release-by-release feature additions and behavior changes. The current behavior of PurgeTSS is documented in the main `SKILL.md` and its reference files; this page is the historical record.
|
|
4
|
+
|
|
5
|
+
## What's New in v7.10.2
|
|
6
|
+
|
|
7
|
+
- **Pre-7.7.0 brand config auto-migration.** Configs written before v7.7.0 (the `brand:` regroup) now auto-migrate in memory on every run. The legacy flat layout (`brand.padding: <number>`, `brand.iosPadding`, `brand.bgColor`, `brand.darkBgColor`, top-level `brand.notification` / `brand.splash`) used to crash auto-purge with `TypeError: Cannot create property 'ios' on number '15'`. `getConfigFile()` now normalizes legacy keys to the grouped layout (`brand.padding.{ios, androidLegacy, androidAdaptive}`, `brand.android.*`, `brand.ios.darkBackground`, `brand.colors.background`) before applying defaults. When both legacy and new keys coexist, the new key wins. A one-time deprecation notice per session lists the migrated keys. See [App Icons & Branding → Upgrading from pre-7.7.0 configs](app-branding.md).
|
|
8
|
+
- **Internal logger fix.** `logger.warning` and `logger.success` are now defined. Across `brand`, `images`, `cleanup-legacy`, and `svg-utils`, ~30 callsites of `logger.warning` and ~10 of `logger.success` referenced methods that did not exist on the logger object — any opt-in command path that hit one used to throw `TypeError: logger.warning is not a function`. The auto-purge entry point most users hit did not reach those callsites, so the bug stayed latent until commands like `purgetss brand` or `purgetss images` were run.
|
|
9
|
+
|
|
10
|
+
## What's New in v7.10.1
|
|
11
|
+
|
|
12
|
+
- **"Tailwind" framing dropped from copy that did not document a functional integration.** The Class Syntax Error block now reports `'Square brackets "[ ]" are not supported'` instead of `'Tailwind-style brackets "[ ]" are not supported'`. The promotional `<Label>` injected into new projects by `purgetss create` changed from `"Tailwind-inspired utility classes for Titanium/Alloy"` to `"Utility-first styling for Titanium/Alloy"`.
|
|
13
|
+
- **Functional integrations stay.** The `tailwindcss@3` dependency installed by `install-dependencies` (drives both the `defaultColors` / `defaultTheme` palette base AND the VSCode IntelliSense extension) still ships. The `--tailwind` flag on `purgetss shades` and the recommended `Tailwind CSS IntelliSense` / `Tailwind Raw Reorder (v4)` VSCode extensions are unchanged.
|
|
14
|
+
|
|
15
|
+
## What's New in v7.10.0
|
|
16
|
+
|
|
17
|
+
- **`purgetss images` got three CLI-only flags.**
|
|
18
|
+
- `--opacity <n>` (integer `0-100`) 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). With `--format jpeg`, the JPEG flatten-on-white step composites the semi-transparent image onto white instead of producing transparent JPEGs (JPEG has no alpha).
|
|
19
|
+
- `--padding <n>` (integer `0-40`) shrinks the rendered image inside each density canvas by symmetric percentage borders, preserving canvas size with transparent fill — useful for breathing room around an unpadded logo.
|
|
20
|
+
- `--output <relpath>` overrides the basename and subpath relative to each platform's `images/` root, so a logo from `purgetss/brand/` can be written as `images/logos/loading.png` across all densities in a single command.
|
|
21
|
+
- The three flags combine naturally for "transparent placeholder with padding under a custom path". See [Multi-Density Images](multi-density-images.md).
|
|
22
|
+
- **`purgetss brand` now generates `MarketplaceArtworkFeature.png` (1024×500 Google Play Feature Graphic)** alongside the existing iTunesConnect and MarketplaceArtwork submission assets. Auto-discovers `purgetss/brand/logo-feature.{svg,png}` or reuses the master logo if not provided. Default vertical padding is `12%`; override with `--feature-graphic-padding <n>` (range `0-40`), config `brand.padding.featureGraphic`, or CLI `--feature-logo <path>` for a dedicated source. Submission artwork only — written to project root for upload to the Play Console, not bundled into the APK. See [App Icons & Branding](app-branding.md).
|
|
23
|
+
- **Arbitrary nesting depth in `config.cjs` `theme` objects.** Property emission now walks nested values recursively instead of stopping at level 2, so `theme.extend.colors.brand.primary.500` flattens to `brand-primary-500` instead of being silently dropped. Same for `backgroundGradient` and `backgroundSelectedGradient`. Default modifier keys (`default`, `global`, `DEFAULT`) collapse without contributing to the suffix. See [Arbitrary Values](arbitrary-values.md).
|
|
24
|
+
- **Fix:** `apply:` now resolves built-in icon font classes (`fas`, `fab`, `fa-*`, `mi-*`, `ms-*`, `f7-*`) from `dist/` for projects that don't run `build-fonts`. Previously those classes were silently dropped from generated rules — `apply: 'fas fa-times-circle wh-12 ...'` produced everything except the FontAwesome family and the icon glyph. See [Apply Directive → Use icon font classes](apply-directive.md).
|
|
25
|
+
- **Fix:** `borderRadius: [...]` arrays no longer get truncated when combined with other utilities in an `apply:` string. The post-merge dedup step (from v7.9.0) tracked depth on `{}` only, so `borderRadius: [0, 0, 0, 16]` (emitted by directional `rounded-{t,b,l,r,tl,tr,bl,br}-*` utilities) was split on its internal commas. The depth tracker now respects `[]` alongside `{}`.
|
|
26
|
+
- **Fix:** `brand --padding <n>` shortcut now applies to BOTH Android paddings as the help text always promised. Previously the shortcut only fed `androidAdaptivePadding` while `androidLegacyPadding` fell through to its own config value, so `purgetss brand --padding 17` actually produced `androidAdaptive=17, androidLegacy=10`.
|
|
27
|
+
|
|
28
|
+
## What's New in v7.9.0
|
|
29
|
+
|
|
30
|
+
- Opacity modifier on semantic colors — `bg-surface/65` syntax now works for any class mapped through `theme.extend.colors`. PurgeTSS auto-derives `<originalKey>_<alphaPercent>` entries in `semantic.colors.json` per mode (light/dark). See [Semantic Colors → Opacity modifier auto-derivation](semantic-colors.md#opacity-modifier-auto-derivation). **Native rebuild required** — Liveview hot-reload alone does not refresh `semantic.colors.json`
|
|
31
|
+
- `theme.Window` / `theme.View` / `theme.ImageView` presets now use **replace mode** — they no longer carry framework defaults (white background, `Ti.UI.SIZE`, iOS `hires: true`). This fixes gradient ghosting where a preset Window with `bg-gradient-*` apply was being covered by the implicit `backgroundColor: '#FFFFFF'`. Use `theme.extend.Window` / `theme.extend.View` / `theme.extend.ImageView` when you want **extend mode** (merge with defaults). See [Apply Directive → Extend mode vs replace mode](apply-directive.md#extend-mode-vs-replace-mode)
|
|
32
|
+
- Glossary path renamed: `purgetss/experimental/tailwind-classes/` → `purgetss/glossary/tailwind-classes/`
|
|
33
|
+
|
|
34
|
+
## What's New in v7.8.0
|
|
35
|
+
|
|
36
|
+
- `purgetss images --width <n>` — pin SVG output to a specific base width; PurgeTSS derives per-density assets from the multiplier scale (×1 / ×1.5 / ×2 / ×3 / ×4). Range `[1, 8192]`. CLI-only (no `images:` config equivalent — width is per-asset). See [Multi-Density Images → Pinning the output width with --width](multi-density-images.md#pinning-the-output-width-with---width)
|
|
37
|
+
- Class syntax pre-validation — the build now emits a `Class Syntax Error` block (file path + line + `Fix:` suggestion) for 5 detected patterns: inverted negative sign (`top-(-10)` → `-top-(10)`), Tailwind brackets (`top-[10px]` → `top-(10px)`), empty parens (`wh-()`), whitespace inside parens (`wh-( 200 )` → `wh-(200)`), redundant `px` unit (`top-(10px)` → `top-(10)`). See [Arbitrary Values → Class syntax pre-validation](arbitrary-values.md#class-syntax-pre-validation)
|
|
38
|
+
- Parser fix for negative values inside parentheses — `top-(-10)` is now correctly flagged as inverted-negative-sign instead of silently misparsed
|
|
39
|
+
|
|
40
|
+
## What's New in v7.7.0
|
|
41
|
+
|
|
42
|
+
- `brand:` config restructured — flat keys replaced by purpose-based groups: `brand.logos`, `brand.padding`, `brand.android`, `brand.ios`, `brand.colors`
|
|
43
|
+
- Separate Android brand inputs — `logos.androidLauncher` / `--icon-logo` for Android launcher icons; `logos.androidSplash` / `--splash-logo` for Android 12+ splash artwork. Drop `logo-icon.*` and `logo-splash.*` into `purgetss/brand/`
|
|
44
|
+
- `--android-adaptive-padding` (default `19%`) and `--android-legacy-padding` (default `10%`) replace the single `--padding`. The shortcut `--padding` now sets both Android paddings to the same value for one run
|
|
45
|
+
- Legacy Android splash fallback regenerated — `app/assets/android/default.png` (Alloy) or `Resources/android/default.png` (Classic). `cleanup-legacy` no longer removes `default.png`
|
|
46
|
+
- New official doc: [Values and Units](values-and-units.md) — explains `ti.ui.defaultunit` interpretation of PurgeTSS unitless values
|
|
47
|
+
|
|
48
|
+
## What's New in v7.6.x
|
|
49
|
+
|
|
50
|
+
- `brand` command — complete Titanium branding set (launcher icons, adaptive, iOS 18+ Dark/Tinted, marketplace) from logos in `./purgetss/brand/` (v7.6.0)
|
|
51
|
+
- `images` command — multi-density UI images (Android res-*dpi + iPhone @1x/@2x/@3x) from `./purgetss/images/` (v7.6.0)
|
|
52
|
+
- `semantic` command — Titanium semantic colors for Light/Dark mode (palette mode + single mode) (v7.6.0)
|
|
53
|
+
- `brand:` and `images:` config sections auto-injected into older configs (v7.6.0)
|
|
54
|
+
- Percentages as strings (`'15%'`) for self-documenting clarity in brand/images configs (v7.6.0)
|
|
55
|
+
- Confirmation prompt for destructive writes in `brand` / `images` (`y` / `N` / `a`); auto-skipped on non-TTY, with `-y`, or `PURGETSS_YES=1` (v7.6.1)
|
|
56
|
+
- `semantic` command works in Classic projects — writes to `Resources/semantic.colors.json` (v7.6.2)
|
|
57
|
+
|
|
58
|
+
## What's New in v7.5.3
|
|
59
|
+
|
|
60
|
+
- Appearance module — Light/Dark/System mode switching with persistence
|
|
61
|
+
- Default font family classes (`font-sans`, `font-serif`, `font-mono`) generated automatically with platform-appropriate values
|
|
62
|
+
- XML validation — detects illegal `--` inside XML comments during pre-validation
|
|
63
|
+
|
|
64
|
+
## What's New in v7.5.0
|
|
65
|
+
|
|
66
|
+
- `extend` support for Window, View, and ImageView in `config.cjs`
|
|
67
|
+
- Shorthand `apply` directive normalization
|
|
68
|
+
- Apply directive property deduplication
|
|
69
|
+
- Automatic platform resolution in apply directives
|
|
70
|
+
- Updated Font Awesome to 7.2.0
|
|
71
|
+
- Fixed: `extend.Window` was silently ignored
|
|
72
|
+
- Fixed: Array-type properties (`extendEdges`, `mediaTypes`) bracket notation
|
|
73
|
+
|
|
74
|
+
## What's New in v7.4.0
|
|
75
|
+
|
|
76
|
+
- 9 new Animation methods: `transition`, `pulse`, `sequence`, `swap`, `shake`, `snapTo`, `reorder`, `undraggable`, `detectCollisions` (module now has 15 methods total)
|
|
77
|
+
- Snap behavior classes: `snap-back`, `snap-center`, `snap-magnet`
|
|
78
|
+
- `keep-z-index` utility class
|
|
79
|
+
- Enriched callback event object with `action`, `state`, `id`, `targetId`, `index`, `total`, `getTarget()`
|
|
80
|
+
- Delta-based drag for views with rotate/scale transforms
|
|
81
|
+
- Position normalization for draggable views
|
|
82
|
+
- Property inheritance from Animation object for all new methods
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ti-expert
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use when designing, reviewing, analyzing, or examining Titanium SDK architecture and implementation (Alloy or Classic) — creating controllers/views/services, choosing models vs collections, implementing communication patterns, handling memory cleanup, testing, auditing code, migrating legacy apps, or building adaptive/responsive layouts for tablets, foldables, and large screens. AUTO-DETECT: If tiapp.xml exists, invoke BEFORE making architectural decisions, creating new controllers/views, or restructuring code. Titanium has its own patterns for navigation (NavigationWindow, TabGroup), memory management, and event handling that differ from web frameworks."
|
|
4
4
|
argument-hint: "[architecture-topic]"
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Edit, Write, Bash(git *), Bash(node *)
|
|
6
6
|
---
|
package/skills/ti-ui/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ti-ui
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use when working with, reviewing, analyzing, or examining Titanium SDK UI/UX patterns and components — Titanium layouts, ListView/TableView performance optimization, event handling and bubbling, gestures (swipe, pinch), animations, accessibility (VoiceOver/TalkBack), orientation changes, custom fonts/icons, app icons/splash screens, or platform-specific UI (Action Bar, Navigation Bar). AUTO-DETECT: If tiapp.xml exists, invoke BEFORE creating or modifying any UI view, window, or layout. Titanium layouts (composite, vertical, horizontal) differ from web/CSS — never assume web layout behavior."
|
|
4
4
|
argument-hint: "[component]"
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
|
|
6
6
|
---
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: alloy-guides
|
|
3
|
-
description: "Titanium Alloy MVC official framework reference. Use when working with, reviewing, analyzing, or examining Alloy models, views, controllers, Backbone.js data binding, TSS styling, widgets, Alloy CLI, sync adapters, migrations, or MVC compilation. AUTO-DETECT: If the project has an app/views/ + app/controllers/ + app/styles/ folder structure, it is an Alloy project — invoke this skill BEFORE editing XML views, JS controllers, or TSS styles. Alloy XML is NOT HTML; TSS is NOT CSS; controllers follow Alloy-specific patterns, not web MVC."
|
|
4
|
-
argument-hint: "[concept]"
|
|
5
|
-
allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Alloy MVC framework guide
|
|
9
|
-
|
|
10
|
-
Reference for building Titanium mobile applications with the Alloy MVC framework and Backbone.js.
|
|
11
|
-
|
|
12
|
-
## Project detection
|
|
13
|
-
|
|
14
|
-
> **️ℹ️ AUTO-DETECTS ALLOY PROJECTS**
|
|
15
|
-
> This skill automatically detects Alloy projects when invoked and provides framework-specific guidance.
|
|
16
|
-
>
|
|
17
|
-
> **Detection occurs automatically** - no manual command needed.
|
|
18
|
-
>
|
|
19
|
-
> **Alloy project indicators:**
|
|
20
|
-
> - `app/` folder (MVC structure)
|
|
21
|
-
> - `app/views/`, `app/controllers/` folders
|
|
22
|
-
> - `app/models/` folder
|
|
23
|
-
>
|
|
24
|
-
> **Behavior based on detection:**
|
|
25
|
-
> - **Alloy detected** → Provides Alloy MVC documentation, Backbone.js patterns, TSS styling, widgets
|
|
26
|
-
> - **Not detected** → Indicates this skill is for Alloy projects only, does not suggest Alloy-specific features
|
|
27
|
-
|
|
28
|
-
## Quick reference
|
|
29
|
-
|
|
30
|
-
| Topic | Reference File |
|
|
31
|
-
| ------------------------------------------------ | ----------------------------------------------------------------------- |
|
|
32
|
-
| Core concepts, MVC, Backbone.js, conventions | [CONCEPTS.md](references/CONCEPTS.md) |
|
|
33
|
-
| Controllers, events, conditional code, arguments | [CONTROLLERS.md](references/CONTROLLERS.md) |
|
|
34
|
-
| Models, collections, data binding, migrations | [MODELS.md](references/MODELS.md) |
|
|
35
|
-
| XML markup, elements, attributes, events | [VIEWS_XML.md](references/VIEWS_XML.md) |
|
|
36
|
-
| TSS styling, themes, platform-specific styles | [VIEWS_STYLES.md](references/VIEWS_STYLES.md) |
|
|
37
|
-
| Dynamic styles, autostyle, runtime styling | [VIEWS_DYNAMIC.md](references/VIEWS_DYNAMIC.md) |
|
|
38
|
-
| Controllers-less views, patterns | [VIEWS_WITHOUT_CONTROLLERS.md](references/VIEWS_WITHOUT_CONTROLLERS.md) |
|
|
39
|
-
| Creating and using widgets | [WIDGETS.md](references/WIDGETS.md) |
|
|
40
|
-
| CLI commands, code generation | [CLI_TASKS.md](references/CLI_TASKS.md) |
|
|
41
|
-
| PurgeTSS integration (optional addon) | [PURGETSS.md](references/PURGETSS.md) |
|
|
42
|
-
|
|
43
|
-
## Project structure
|
|
44
|
-
|
|
45
|
-
Standard Alloy project structure:
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
app/
|
|
49
|
-
├── alloy.js # Initializer file
|
|
50
|
-
├── alloy.jmk # Build configuration
|
|
51
|
-
├── config.json # Project configuration
|
|
52
|
-
├── assets/ # Images, fonts, files (→ Resources/)
|
|
53
|
-
├── controllers/ # Controller files (.js)
|
|
54
|
-
├── i18n/ # Localization strings (→ i18n/)
|
|
55
|
-
├── lib/ # CommonJS modules
|
|
56
|
-
├── migrations/ # DB migrations (<DATETIME>_<name>.js)
|
|
57
|
-
├── models/ # Model definitions (.js)
|
|
58
|
-
├── platform/ # Platform-specific resources (→ platform/)
|
|
59
|
-
├── specs/ # Test-only files (dev/test only)
|
|
60
|
-
├── styles/ # TSS files (.tss)
|
|
61
|
-
├── themes/ # Theme folders
|
|
62
|
-
├── views/ # XML markup files (.xml)
|
|
63
|
-
└── widgets/ # Widget components
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## MVC quick start
|
|
67
|
-
|
|
68
|
-
**Controller** (`app/controllers/index.js`):
|
|
69
|
-
```javascript
|
|
70
|
-
function doClick(e) {
|
|
71
|
-
alert($.label.text);
|
|
72
|
-
}
|
|
73
|
-
$.index.open();
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**View** (`app/views/index.xml`):
|
|
77
|
-
```xml
|
|
78
|
-
<Alloy>
|
|
79
|
-
<Window class="container">
|
|
80
|
-
<Label id="label" onClick="doClick">Hello, World</Label>
|
|
81
|
-
</Window>
|
|
82
|
-
</Alloy>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Style** (`app/styles/index.tss`):
|
|
86
|
-
```javascript
|
|
87
|
-
".container": { backgroundColor: "white" }
|
|
88
|
-
"Label": { color: "#000" }
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Key concepts
|
|
92
|
-
|
|
93
|
-
- **Models/Collections**: Backbone.js objects with sync adapters (sql, properties)
|
|
94
|
-
- **Views**: XML markup with TSS styling
|
|
95
|
-
- **Controllers**: JavaScript logic with `$` reference to view components
|
|
96
|
-
- **Data Binding**: Bind collections to UI components automatically
|
|
97
|
-
- **Widgets**: Reusable components with MVC structure
|
|
98
|
-
- **Conventions**: File naming and placement drive code generation
|
|
99
|
-
|
|
100
|
-
## Critical rules
|
|
101
|
-
|
|
102
|
-
### Platform-specific properties in TSS
|
|
103
|
-
|
|
104
|
-
> **🚨 CRITICAL: Platform-specific properties require modifiers**
|
|
105
|
-
> Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties in TSS without platform modifiers causes cross-platform compilation failures.
|
|
106
|
-
>
|
|
107
|
-
> Example of the failure:
|
|
108
|
-
> ```tss
|
|
109
|
-
> // WRONG - Adds Ti.UI.iOS to Android project
|
|
110
|
-
> "#mainWindow": {
|
|
111
|
-
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT // FAILS on Android!
|
|
112
|
-
> }
|
|
113
|
-
> ```
|
|
114
|
-
>
|
|
115
|
-
> Correct approach - use platform modifiers:
|
|
116
|
-
> ```tss
|
|
117
|
-
> // CORRECT - Only adds to iOS
|
|
118
|
-
> "#mainWindow[platform=ios]": {
|
|
119
|
-
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
120
|
-
> }
|
|
121
|
-
>
|
|
122
|
-
> // CORRECT - Only adds to Android
|
|
123
|
-
> "#mainWindow[platform=android]": {
|
|
124
|
-
> actionBar: {
|
|
125
|
-
> displayHomeAsUp: true
|
|
126
|
-
> }
|
|
127
|
-
> }
|
|
128
|
-
> ```
|
|
129
|
-
>
|
|
130
|
-
> Properties that always require platform modifiers:
|
|
131
|
-
> - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, any `Ti.UI.iOS.*`
|
|
132
|
-
> - Android: `actionBar` config, any `Ti.UI.Android.*` constant
|
|
133
|
-
>
|
|
134
|
-
> **Available modifiers:** `[platform=ios]`, `[platform=android]`, `[formFactor=handheld]`, `[formFactor=tablet]`, `[if=Alloy.Globals.customVar]`
|
|
135
|
-
>
|
|
136
|
-
> For more platform-specific patterns, see [Code conventions (ti-expert)](skills/ti-expert/references/code-conventions.md#platform--device-modifiers) or [Platform UI guides (ti-ui)](skills/ti-ui/references/platform-ui-ios.md).
|
|
137
|
-
|
|
138
|
-
## Common patterns
|
|
139
|
-
|
|
140
|
-
### Creating a model
|
|
141
|
-
```bash
|
|
142
|
-
alloy generate model book sql title:string author:string
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Data binding
|
|
146
|
-
```xml
|
|
147
|
-
<Collection src="book" />
|
|
148
|
-
<TableView dataCollection="book">
|
|
149
|
-
<TableViewRow title="{title}" />
|
|
150
|
-
</TableView>
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Platform-specific code
|
|
154
|
-
```javascript
|
|
155
|
-
if (OS_IOS) {
|
|
156
|
-
// iOS-only code
|
|
157
|
-
}
|
|
158
|
-
if (OS_ANDROID) {
|
|
159
|
-
// Android-only code
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Widget usage
|
|
164
|
-
```xml
|
|
165
|
-
<Widget src="mywidget" id="foo" />
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Compilation process
|
|
169
|
-
|
|
170
|
-
1. Cleanup: Resources folder cleaned
|
|
171
|
-
2. Build Config: alloy.jmk loaded (pre:load task)
|
|
172
|
-
3. Framework Files: Backbone.js, Underscore.js, sync adapters copied
|
|
173
|
-
4. MVC Generation: Models, widgets, views, controllers compiled to JS
|
|
174
|
-
5. Main App: app.js generated from template
|
|
175
|
-
6. Optimization: UglifyJS optimization, platform-specific code removal
|
|
176
|
-
|
|
177
|
-
## References
|
|
178
|
-
|
|
179
|
-
Read detailed documentation from the reference files listed above based on your specific task.
|
|
180
|
-
|
|
181
|
-
## Related skills
|
|
182
|
-
|
|
183
|
-
For tasks beyond Alloy MVC basics, use these complementary skills:
|
|
184
|
-
|
|
185
|
-
| Task | Use This Skill |
|
|
186
|
-
| ---------------------------------------------- | -------------- |
|
|
187
|
-
| Modern architecture, services, patterns | `ti-expert` |
|
|
188
|
-
| Alloy CLI, config files, debugging errors | `alloy-howtos` |
|
|
189
|
-
| Utility-first styling with PurgeTSS (optional) | `purgetss` |
|
|
190
|
-
| Native features (location, push, media) | `ti-howtos` |
|