@maccesar/titools 2.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 (120) hide show
  1. package/AGENTS-TEMPLATE.md +173 -0
  2. package/README.md +867 -0
  3. package/agents/ti-researcher.md +108 -0
  4. package/bin/titools.js +53 -0
  5. package/lib/commands/agents.js +126 -0
  6. package/lib/commands/install.js +188 -0
  7. package/lib/commands/uninstall.js +215 -0
  8. package/lib/commands/update.js +159 -0
  9. package/lib/config.js +119 -0
  10. package/lib/downloader.js +153 -0
  11. package/lib/installer.js +253 -0
  12. package/lib/platform.js +108 -0
  13. package/lib/symlink.js +142 -0
  14. package/lib/utils.js +270 -0
  15. package/package.json +67 -0
  16. package/skills/alloy-expert/SKILL.md +247 -0
  17. package/skills/alloy-expert/assets/ControllerAutoCleanup.js +182 -0
  18. package/skills/alloy-expert/references/alloy-structure.md +381 -0
  19. package/skills/alloy-expert/references/anti-patterns.md +133 -0
  20. package/skills/alloy-expert/references/code-conventions.md +469 -0
  21. package/skills/alloy-expert/references/contracts.md +280 -0
  22. package/skills/alloy-expert/references/controller-patterns.md +520 -0
  23. package/skills/alloy-expert/references/error-handling.md +484 -0
  24. package/skills/alloy-expert/references/examples.md +735 -0
  25. package/skills/alloy-expert/references/migration-patterns.md +298 -0
  26. package/skills/alloy-expert/references/patterns.md +448 -0
  27. package/skills/alloy-expert/references/performance-patterns.md +855 -0
  28. package/skills/alloy-expert/references/security-patterns.md +847 -0
  29. package/skills/alloy-expert/references/state-management.md +779 -0
  30. package/skills/alloy-expert/references/testing.md +872 -0
  31. package/skills/alloy-guides/SKILL.md +214 -0
  32. package/skills/alloy-guides/references/CLI_TASKS.md +243 -0
  33. package/skills/alloy-guides/references/CONCEPTS.md +191 -0
  34. package/skills/alloy-guides/references/CONTROLLERS.md +298 -0
  35. package/skills/alloy-guides/references/MODELS.md +1028 -0
  36. package/skills/alloy-guides/references/PURGETSS.md +56 -0
  37. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +242 -0
  38. package/skills/alloy-guides/references/VIEWS_STYLES.md +388 -0
  39. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +109 -0
  40. package/skills/alloy-guides/references/VIEWS_XML.md +558 -0
  41. package/skills/alloy-guides/references/WIDGETS.md +176 -0
  42. package/skills/alloy-howtos/SKILL.md +203 -0
  43. package/skills/alloy-howtos/references/best_practices.md +138 -0
  44. package/skills/alloy-howtos/references/cli_reference.md +253 -0
  45. package/skills/alloy-howtos/references/config_files.md +87 -0
  46. package/skills/alloy-howtos/references/custom_tags.md +147 -0
  47. package/skills/alloy-howtos/references/debugging_troubleshooting.md +101 -0
  48. package/skills/alloy-howtos/references/samples.md +167 -0
  49. package/skills/purgetss/SKILL.md +442 -0
  50. package/skills/purgetss/assets/purgetss.config.cjs +17 -0
  51. package/skills/purgetss/references/EXAMPLES.md +247 -0
  52. package/skills/purgetss/references/animation-system.md +1294 -0
  53. package/skills/purgetss/references/apply-directive.md +375 -0
  54. package/skills/purgetss/references/arbitrary-values.md +612 -0
  55. package/skills/purgetss/references/class-index.md +1350 -0
  56. package/skills/purgetss/references/cli-commands.md +948 -0
  57. package/skills/purgetss/references/configurable-properties.md +654 -0
  58. package/skills/purgetss/references/custom-rules.md +161 -0
  59. package/skills/purgetss/references/customization-deep-dive.md +722 -0
  60. package/skills/purgetss/references/dynamic-component-creation.md +489 -0
  61. package/skills/purgetss/references/grid-layout.md +455 -0
  62. package/skills/purgetss/references/icon-fonts.md +609 -0
  63. package/skills/purgetss/references/installation-setup.md +366 -0
  64. package/skills/purgetss/references/opacity-modifier.md +291 -0
  65. package/skills/purgetss/references/platform-modifiers.md +479 -0
  66. package/skills/purgetss/references/smart-mappings.md +42 -0
  67. package/skills/purgetss/references/titanium-resets.md +359 -0
  68. package/skills/purgetss/references/ui-ux-design.md +1526 -0
  69. package/skills/ti-guides/SKILL.md +94 -0
  70. package/skills/ti-guides/references/advanced-data-and-images.md +19 -0
  71. package/skills/ti-guides/references/alloy-cli-advanced.md +84 -0
  72. package/skills/ti-guides/references/alloy-data-mastery.md +29 -0
  73. package/skills/ti-guides/references/alloy-widgets-and-themes.md +19 -0
  74. package/skills/ti-guides/references/android-manifest.md +97 -0
  75. package/skills/ti-guides/references/app-distribution.md +258 -0
  76. package/skills/ti-guides/references/application-frameworks.md +377 -0
  77. package/skills/ti-guides/references/cli-reference.md +402 -0
  78. package/skills/ti-guides/references/coding-best-practices.md +102 -0
  79. package/skills/ti-guides/references/commonjs-advanced.md +134 -0
  80. package/skills/ti-guides/references/hello-world.md +100 -0
  81. package/skills/ti-guides/references/hyperloop-native-access.md +62 -0
  82. package/skills/ti-guides/references/javascript-primer.md +411 -0
  83. package/skills/ti-guides/references/reserved-words.md +36 -0
  84. package/skills/ti-guides/references/resources.md +183 -0
  85. package/skills/ti-guides/references/style-and-conventions.md +48 -0
  86. package/skills/ti-guides/references/tiapp-config.md +609 -0
  87. package/skills/ti-howtos/SKILL.md +174 -0
  88. package/skills/ti-howtos/references/android-platform-deep-dives.md +658 -0
  89. package/skills/ti-howtos/references/automation-fastlane-appium.md +95 -0
  90. package/skills/ti-howtos/references/buffer-codec-streams.md +140 -0
  91. package/skills/ti-howtos/references/cross-platform-development.md +348 -0
  92. package/skills/ti-howtos/references/debugging-profiling.md +543 -0
  93. package/skills/ti-howtos/references/extending-titanium.md +723 -0
  94. package/skills/ti-howtos/references/google-maps-v2.md +169 -0
  95. package/skills/ti-howtos/references/ios-map-kit.md +143 -0
  96. package/skills/ti-howtos/references/ios-platform-deep-dives.md +783 -0
  97. package/skills/ti-howtos/references/local-data-sources.md +301 -0
  98. package/skills/ti-howtos/references/location-and-maps.md +252 -0
  99. package/skills/ti-howtos/references/media-apis.md +210 -0
  100. package/skills/ti-howtos/references/notification-services.md +599 -0
  101. package/skills/ti-howtos/references/remote-data-sources.md +349 -0
  102. package/skills/ti-howtos/references/tutorials.md +502 -0
  103. package/skills/ti-howtos/references/using-modules.md +237 -0
  104. package/skills/ti-howtos/references/web-content-integration.md +307 -0
  105. package/skills/ti-howtos/references/webpack-build-pipeline.md +78 -0
  106. package/skills/ti-ui/SKILL.md +179 -0
  107. package/skills/ti-ui/references/accessibility-deep-dive.md +242 -0
  108. package/skills/ti-ui/references/animation-and-matrices.md +599 -0
  109. package/skills/ti-ui/references/application-structures.md +655 -0
  110. package/skills/ti-ui/references/custom-fonts-styling.md +579 -0
  111. package/skills/ti-ui/references/event-handling.md +393 -0
  112. package/skills/ti-ui/references/gestures.md +473 -0
  113. package/skills/ti-ui/references/icons-and-splash-screens.md +409 -0
  114. package/skills/ti-ui/references/layouts-and-positioning.md +462 -0
  115. package/skills/ti-ui/references/listviews-and-performance.md +619 -0
  116. package/skills/ti-ui/references/orientation.md +362 -0
  117. package/skills/ti-ui/references/platform-ui-android.md +635 -0
  118. package/skills/ti-ui/references/platform-ui-ios.md +469 -0
  119. package/skills/ti-ui/references/scrolling-views.md +252 -0
  120. package/skills/ti-ui/references/tableviews.md +568 -0
@@ -0,0 +1,247 @@
1
+ # PurgeTSS Examples - WRONG vs CORRECT
2
+
3
+ Complete examples of common patterns with anti-patterns and correct implementations.
4
+
5
+ ## Table of Contents
6
+
7
+ - [PurgeTSS Examples - WRONG vs CORRECT](#purgetss-examples---wrong-vs-correct)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [Titanium Layout Patterns](#titanium-layout-patterns)
10
+ - [Horizontal Row with Space Between](#horizontal-row-with-space-between)
11
+ - [Centered Content (Vertically and Horizontally)](#centered-content-vertically-and-horizontally)
12
+ - [Vertical Stack with Spacing](#vertical-stack-with-spacing)
13
+ - [Header with Left/Right Elements](#header-with-leftright-elements)
14
+ - [Available Layout Classes](#available-layout-classes)
15
+ - [Manual .tss Files Anti-Pattern](#manual-tss-files-anti-pattern)
16
+ - [Grid with Percentages](#grid-with-percentages)
17
+ - [Gap Usage](#gap-usage)
18
+ - [Layout Defaults](#layout-defaults)
19
+
20
+ ---
21
+
22
+ ## Titanium Layout Patterns
23
+
24
+ :::danger NO FLEXBOX IN TITANIUM
25
+ Titanium does NOT support CSS Flexbox. All examples use `horizontal`, `vertical`, or `composite` layouts.
26
+ :::
27
+
28
+ ### Horizontal Row with Space Between
29
+
30
+ **❌ WRONG (Flexbox classes don't exist):**
31
+ ```xml
32
+ <View class="flex-row justify-between">
33
+ <Label text="Left" />
34
+ <Label text="Right" />
35
+ </View>
36
+ ```
37
+
38
+ **✅ CORRECT (Use horizontal layout + spacer):**
39
+ ```xml
40
+ <View class="horizontal w-screen">
41
+ <Label text="Left" />
42
+ <View class="w-screen" /> <!-- Spacer -->
43
+ <Label text="Right" />
44
+ </View>
45
+ ```
46
+
47
+ **✅ ALTERNATIVE (Use margins):**
48
+ ```xml
49
+ <View class="horizontal w-screen">
50
+ <Label text="Left" class="ml-4" />
51
+ <Label text="Right" class="mr-4" />
52
+ </View>
53
+ ```
54
+
55
+ ### Centered Content (Vertically and Horizontally)
56
+
57
+ **❌ WRONG (Flexbox center doesn't exist):**
58
+ ```xml
59
+ <View class="flex items-center justify-center">
60
+ <Label text="Centered" />
61
+ </View>
62
+ ```
63
+
64
+ **✅ CORRECT (Composite layout + center class):**
65
+ ```xml
66
+ <!-- Parent defaults to composite, no layout class needed -->
67
+ <View class="h-screen w-screen">
68
+ <Label text="Centered" class="center" />
69
+ </View>
70
+ ```
71
+
72
+ **✅ ALTERNATIVE (Use margins):**
73
+ ```xml
74
+ <View class="h-screen w-screen">
75
+ <Label text="Centered" class="mt-(40%) ml-(35%)" />
76
+ </View>
77
+ ```
78
+
79
+ ### Vertical Stack with Spacing
80
+
81
+ **❌ WRONG (Flexbox gap doesn't work):**
82
+ ```xml
83
+ <View class="flex-col gap-4">
84
+ <Label text="Item 1" />
85
+ <Label text="Item 2" />
86
+ <Label text="Item 3" />
87
+ </View>
88
+ ```
89
+
90
+ **✅ CORRECT (Use vertical layout + margins):**
91
+ ```xml
92
+ <View class="vertical">
93
+ <Label text="Item 1" class="mt-4" />
94
+ <Label text="Item 2" class="mt-4" />
95
+ <Label text="Item 3" class="mt-4" />
96
+ </View>
97
+ ```
98
+
99
+ ### Header with Left/Right Elements
100
+
101
+ **❌ WRONG (Flexbox justify-between):**
102
+ ```xml
103
+ <View class="flex-row items-center justify-between">
104
+ <Label text="Title" class="font-bold" />
105
+ <Label class="fas fa-bars" />
106
+ </View>
107
+ ```
108
+
109
+ **✅ CORRECT (Composite + positioning):**
110
+ ```xml
111
+ <View class="h-14 w-screen">
112
+ <Label text="Title" class="center left-4 font-bold" />
113
+ <Label class="fas fa-bars center right-4" />
114
+ </View>
115
+ ```
116
+
117
+ ### Available Layout Classes
118
+
119
+ | Class | Description | Use Case |
120
+ | ------------ | ------------------------------------ | ------------------------------ |
121
+ | `horizontal` | Children arranged left to right | Rows of buttons, form fields |
122
+ | `vertical` | Children arranged top to bottom | Stacked content, lists |
123
+ | *(no class)* | Defaults to `composite` | Absolute positioning, overlays |
124
+ | `flow-col` | Horizontal grid flow with 100% width | Special grid layouts |
125
+ | `flow-row` | Vertical grid flow with 100% height | Special grid layouts |
126
+
127
+ ---
128
+
129
+ ## Manual .tss Files Anti-Pattern
130
+
131
+ **❌ WRONG (Creating manual .tss files):**
132
+ ```xml
133
+ <!-- app/views/index.xml -->
134
+ <Alloy>
135
+ <Window class="bg-white">
136
+ <Label id="myLabel" class="text-red-500" text="Hello" />
137
+ </Window>
138
+ </Alloy>
139
+ ```
140
+
141
+ ```javascript
142
+ // app/styles/index.tss - ❌ DON'T CREATE THIS!
143
+ '#myLabel': {
144
+ color: 'red',
145
+ font: { fontSize: 18 }
146
+ }
147
+ '.text-red-500': {
148
+ color: '#ef4444'
149
+ }
150
+ ```
151
+
152
+ **✅ CORRECT (Let PurgeTSS generate app.tss):**
153
+ ```xml
154
+ <!-- app/views/index.xml - ONLY THIS -->
155
+ <Alloy>
156
+ <Window class="bg-white">
157
+ <Label class="text-lg text-red-500" text="Hello" />
158
+ </Window>
159
+ </Alloy>
160
+ ```
161
+
162
+ ```bash
163
+ # Then run:
164
+ purgetss build
165
+ # OR just compile:
166
+ alloy compile
167
+ ```
168
+
169
+ ```tss
170
+ /* app/styles/app.tss - AUTO-GENERATED */
171
+ '.bg-white': { backgroundColor: '#ffffff' }
172
+ '.text-red-500': { color: '#ef4444', textColor: '#ef4444' }
173
+ '.text-lg': { font: { fontSize: 18 } }
174
+ /* ONLY the classes you actually used */
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Grid with Percentages
180
+
181
+ **❌ WRONG (Children with % widths, parent without w-screen):**
182
+ ```xml
183
+ <View class="horizontal m-4">
184
+ <View class="w-(48%)">...</view>
185
+ <View class="w-(48%)">...</view>
186
+ </View>
187
+ <!-- Parent doesn't have w-screen, % calculations may fail -->
188
+ ```
189
+
190
+ **✅ CORRECT (Parent has w-screen):**
191
+ ```xml
192
+ <View class="horizontal m-4 w-screen">
193
+ <View class="w-(48%)">...</view>
194
+ <View class="w-(48%)">...</view>
195
+ </View>
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Gap Usage
201
+
202
+ **❌ WRONG (gap adds margin all around, breaks % widths):**
203
+ ```xml
204
+ <View class="grid grid-cols-2 gap-4">
205
+ <View class="col-span-6">...</view> <!-- 50% + 16px margins -->
206
+ <View class="col-span-6">...</view> <!-- 50% + 16px margins -->
207
+ </View>
208
+ <!-- Total > 100%, elements wrap or overflow -->
209
+ ```
210
+
211
+ **✅ CORRECT (Use explicit margins):**
212
+ ```xml
213
+ <View class="horizontal mb-4 w-screen">
214
+ <View class="w-(48%) mr-2">...</view>
215
+ <View class="w-(48%) ml-2">...</view>
216
+ </View>
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Layout Defaults
222
+
223
+ **❌ WRONG (Explicit composite class):**
224
+ ```xml
225
+ <View class="composite">
226
+ <Label class="right-4 top-8" />
227
+ </View>
228
+ ```
229
+
230
+ **✅ CORRECT (Omit layout - defaults to composite):**
231
+ ```xml
232
+ <View>
233
+ <Label class="right-4 top-8" />
234
+ </View>
235
+ ```
236
+
237
+ **❌ WRONG (Adding composite to remove vertical):**
238
+ ```xml
239
+ <!-- To switch from vertical to composite -->
240
+ <View class="vertical composite">
241
+ ```
242
+
243
+ **✅ CORRECT (Just remove vertical):**
244
+ ```xml
245
+ <!-- Omitting layout defaults to composite -->
246
+ <View>
247
+ ```