@maccesar/titools 2.2.3 → 2.2.8

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 (96) hide show
  1. package/README.md +28 -27
  2. package/lib/commands/update.js +80 -101
  3. package/package.json +1 -1
  4. package/skills/alloy-guides/SKILL.md +31 -31
  5. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  6. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  7. package/skills/alloy-guides/references/MODELS.md +6 -6
  8. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  10. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  11. package/skills/alloy-howtos/SKILL.md +27 -27
  12. package/skills/alloy-howtos/references/best_practices.md +9 -9
  13. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  14. package/skills/alloy-howtos/references/config_files.md +16 -16
  15. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  16. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  17. package/skills/alloy-howtos/references/samples.md +19 -19
  18. package/skills/purgetss/SKILL.md +11 -1
  19. package/skills/purgetss/references/animation-system.md +1 -1
  20. package/skills/purgetss/references/cli-commands.md +3 -3
  21. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  22. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  23. package/skills/purgetss/references/icon-fonts.md +4 -0
  24. package/skills/purgetss/references/installation-setup.md +8 -1
  25. package/skills/purgetss/references/migration-guide.md +4 -0
  26. package/skills/purgetss/references/tikit-components.md +193 -204
  27. package/skills/purgetss/references/ui-ux-design.md +1 -1
  28. package/skills/ti-expert/SKILL.md +78 -118
  29. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  30. package/skills/ti-expert/references/alloy-structure.md +21 -21
  31. package/skills/ti-expert/references/anti-patterns.md +15 -15
  32. package/skills/ti-expert/references/cli-expert.md +15 -15
  33. package/skills/ti-expert/references/code-conventions.md +38 -38
  34. package/skills/ti-expert/references/contracts.md +8 -8
  35. package/skills/ti-expert/references/controller-patterns.md +14 -14
  36. package/skills/ti-expert/references/error-handling.md +11 -11
  37. package/skills/ti-expert/references/examples.md +12 -12
  38. package/skills/ti-expert/references/migration-patterns.md +24 -24
  39. package/skills/ti-expert/references/patterns.md +10 -10
  40. package/skills/ti-expert/references/performance-listview.md +16 -16
  41. package/skills/ti-expert/references/performance-optimization.md +41 -41
  42. package/skills/ti-expert/references/security-device.md +22 -22
  43. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  44. package/skills/ti-expert/references/state-management.md +33 -33
  45. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  46. package/skills/ti-expert/references/testing-unit.md +24 -24
  47. package/skills/ti-expert/references/theming.md +15 -15
  48. package/skills/ti-guides/SKILL.md +58 -60
  49. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  50. package/skills/ti-guides/references/android-manifest.md +15 -15
  51. package/skills/ti-guides/references/app-distribution.md +70 -166
  52. package/skills/ti-guides/references/application-frameworks.md +96 -114
  53. package/skills/ti-guides/references/cli-reference.md +294 -294
  54. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  55. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  56. package/skills/ti-guides/references/hello-world.md +36 -36
  57. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  58. package/skills/ti-guides/references/javascript-primer.md +83 -101
  59. package/skills/ti-guides/references/reserved-words.md +9 -9
  60. package/skills/ti-guides/references/resources.md +75 -83
  61. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  62. package/skills/ti-guides/references/tiapp-config.md +110 -74
  63. package/skills/ti-howtos/SKILL.md +88 -92
  64. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  65. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  66. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  67. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  68. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  69. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  70. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  71. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  72. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  73. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  74. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  75. package/skills/ti-howtos/references/media-apis.md +87 -86
  76. package/skills/ti-howtos/references/notification-services.md +250 -260
  77. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  78. package/skills/ti-howtos/references/tutorials.md +226 -216
  79. package/skills/ti-howtos/references/using-modules.md +73 -102
  80. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  81. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  82. package/skills/ti-ui/SKILL.md +85 -85
  83. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  84. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  85. package/skills/ti-ui/references/application-structures.md +96 -99
  86. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  87. package/skills/ti-ui/references/event-handling.md +58 -58
  88. package/skills/ti-ui/references/gestures.md +62 -64
  89. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  90. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  91. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  92. package/skills/ti-ui/references/orientation.md +87 -88
  93. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  94. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  95. package/skills/ti-ui/references/scrolling-views.md +29 -29
  96. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -5,145 +5,141 @@ argument-hint: "[feature]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash, Bash(node *)
6
6
  ---
7
7
 
8
- # Titanium SDK How-tos Expert
8
+ # Titanium SDK how-tos
9
9
 
10
- Comprehensive expert covering all official Titanium SDK how-to guides. Provides step-by-step instructions for integrating native features, handling data, working with media, and implementing platform-specific APIs.
10
+ Hands-on guide to Titanium SDK native integrations. Focuses on practical steps, platform differences, and the details that usually bite.
11
11
 
12
- ## Project Detection
12
+ ## Project detection
13
13
 
14
- :::info AUTO-DETECTS TITANIUM PROJECTS
15
- This skill automatically detects Titanium projects when invoked and provides native feature integration guides.
14
+ ::::info Auto-detects Titanium projects
15
+ This skill detects Titanium projects automatically.
16
16
 
17
- **Detection occurs automatically** - no manual command needed.
17
+ Indicators:
18
+ - `tiapp.xml` exists (definitive)
19
+ - Alloy project: `app/` folder
20
+ - Classic project: `Resources/` folder
18
21
 
19
- **Titanium project indicator:**
20
- - `tiapp.xml` file (definitive indicator)
22
+ Behavior:
23
+ - Titanium detected: provide native integration guidance, permissions, modules, and platform notes
24
+ - Not detected: say this skill is for Titanium projects only
25
+ ::::
21
26
 
22
- **Applicable to BOTH:**
23
- - **Alloy projects** (app/ folder)
24
- - **Classic projects** (Resources/ folder)
27
+ ## Integration workflow
25
28
 
26
- **Behavior based on detection:**
27
- - **Titanium detected** Provides native feature integration guides, platform-specific API usage, permissions/modules/CI/CD help
28
- - **Not detected** Indicates this is for Titanium projects only
29
- :::
29
+ 1. Requirement check: permissions, `tiapp.xml`, and module dependencies.
30
+ 2. Service setup: listeners and services (Location, Push, Core Motion, and so on).
31
+ 3. Lifecycle sync: tie listeners to Android and iOS lifecycle events.
32
+ 4. Error handling: use robust callbacks for async native calls.
33
+ 5. Platform optimization: apply platform-specific logic (Intent filters, Spotlight, Core Motion).
30
34
 
31
- ## Integration Workflow
35
+ ## Native integration rules
32
36
 
33
- 1. **Requirement Check**: Identify needed permissions, `tiapp.xml` configurations, and module dependencies.
34
- 2. **Service Setup**: Register listeners or services (Location, Push, Core Motion, etc.).
35
- 3. **Lifecycle Sync**: Coordinate service listeners with Android/iOS lifecycle events.
36
- 4. **Error Handling**: Implement robust error callbacks for asynchronous native calls.
37
- 5. **Platform Optimization**: Apply platform-specific deep-dive logic (e.g., Intent Filters, Spotlight, Core Motion).
37
+ ### iOS permissions
38
+ - Location: `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysAndWhenInUseUsageDescription` in `tiapp.xml`.
39
+ - Motion activity: required for Core Motion Activity API.
40
+ - Camera and photo: `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription`.
41
+ - Background modes: required for background audio, location, or VOIP.
42
+ - iOS 17+: add `PrivacyInfo.xcprivacy` for UserDefaults and File Timestamps.
38
43
 
39
- ## Native Integration Rules (Low Freedom)
44
+ ### Android resource management
45
+ - Services: stop background services when they are no longer needed.
46
+ - Location: use `distanceFilter` and FusedLocationProvider (requires `ti.playservices`).
47
+ - Intents: set action, data type, and category. Copy the root activity to `tiapp.xml` for intent filters.
40
48
 
41
- ### iOS Permissions
42
- - **Location**: `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysAndWhenInUseUsageDescription` in `tiapp.xml`
43
- - **Motion Activity**: Required for Core Motion Activity API
44
- - **Camera/Photo**: `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription`
45
- - **Background Modes**: Required for background audio, location, or VOIP
46
- - **iOS 17+ Privacy**: Mandatory `PrivacyInfo.xcprivacy` manifest for UserDefaults and FileTimestamps.
49
+ ### Data and networking
50
+ - HTTPClient: handle both `onload` and `onerror`.
51
+ - SQLite: close both `db` and `resultSet` to avoid locks.
52
+ - Filesystem: check `isExternalStoragePresent()` before using SD card storage.
53
+ - Binary data: use `Ti.Buffer` and `Ti.Codec` for byte-level work.
54
+ - Streams: use `BufferStream`, `FileStream`, or `BlobStream` for chunked I/O.
47
55
 
48
- ### Android Resource Management
49
- - **Services**: Always stop background services when no longer needed
50
- - **Location**: Use `distanceFilter` and FusedLocationProvider (requires `ti.playservices`)
51
- - **Intents**: Specify proper action, data type, and category. Copy root activity to `tiapp.xml` for Intent Filters.
56
+ ### Media and memory
57
+ - Camera and gallery: use `imageAsResized` to reduce memory pressure.
58
+ - Audio: handle `pause` and `resume` for streaming interruptions.
59
+ - WebView: avoid TableView embedding; set `touchEnabled=false` if needed.
60
+ - Video: Android requires fullscreen; iOS supports embedded players.
52
61
 
53
- ### Data & Networking
54
- - **HTTPClient**: Always handle both `onload` and `onerror` callbacks
55
- - **SQLite**: Always `db.close()` and `resultSet.close()` to prevent locks
56
- - **Filesystem**: Check `isExternalStoragePresent()` before accessing SD card
57
- - **Binary Data**: Use `Ti.Buffer` and `Ti.Codec` for low-level byte manipulation
58
- - **Streams**: Use `BufferStream`, `FileStream` or `BlobStream` for efficient chunk-based I/O.
62
+ ### Platform-specific properties
59
63
 
60
- ### Media & Memory
61
- - **Camera/Gallery**: Use `imageAsResized` to avoid memory exhaustion
62
- - **Audio**: Handle `pause`/`resume` events for streaming interruption
63
- - **WebView**: Avoid embedding in TableViews; set `touchEnabled=false` if needed
64
- - **Video**: Android requires fullscreen; iOS supports embedded players
64
+ ::::danger Platform-specific properties need modifiers
65
+ Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` without platform modifiers can break cross-platform builds.
65
66
 
66
- ### Platform-Specific Properties
67
-
68
- :::danger CRITICAL: Platform-Specific Properties Require Modifiers
69
- Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties WITHOUT platform modifiers causes cross-platform compilation failures.
70
-
71
- **Example of the damage:**
67
+ Bad example:
72
68
  ```javascript
73
- // WRONG - Adds Ti.UI.iOS to Android project
69
+ // Wrong: adds Ti.UI.iOS to Android build
74
70
  const win = Ti.UI.createWindow({
75
- statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT // FAILS on Android!
76
- })
71
+ statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
72
+ });
77
73
  ```
78
74
 
79
- **CORRECT approaches:**
75
+ Good options:
80
76
 
81
- **Option 1 - TSS modifier (Alloy projects):**
77
+ TSS modifier (Alloy):
82
78
  ```tss
83
79
  "#mainWindow[platform=ios]": {
84
80
  statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
85
81
  }
86
82
  ```
87
83
 
88
- **Option 2 - Conditional code:**
84
+ Conditional code:
89
85
  ```javascript
90
86
  if (OS_IOS) {
91
- $.mainWindow.statusBarStyle = Ti.UI.iOS.StatusBar.LIGHT_CONTENT
87
+ $.mainWindow.statusBarStyle = Ti.UI.iOS.StatusBar.LIGHT_CONTENT;
92
88
  }
93
89
  ```
94
90
 
95
- **Properties that ALWAYS require platform modifiers:**
96
- - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, any `Ti.UI.iOS.*`
97
- - Android: `actionBar` config, any `Ti.UI.Android.*` constant
91
+ Always require modifiers:
92
+ - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, any `Ti.UI.iOS.*`.
93
+ - Android: `actionBar` config, any `Ti.UI.Android.*` constant.
98
94
 
99
- **For platform-specific modifier syntax in TSS, see** [Code Conventions (ti-expert)](skills/ti-expert/references/code-conventions.md#platform--device-modifiers) or [Platform UI guides](references/ios-platform-deep-dives.md).
100
- :::
95
+ For TSS platform modifiers, see the code conventions in `skills/ti-expert/references/code-conventions.md#platform--device-modifiers` or the platform UI guides in `references/ios-platform-deep-dives.md`.
96
+ ::::
101
97
 
102
- ## Reference Guides (Progressive Disclosure)
98
+ ## Reference guides
103
99
 
104
- ### Core Features
105
- - **[Location & Maps](references/location-and-maps.md)**: GPS tracking and battery-efficient location rules.
106
- - **[Google Maps v2 (Android)](references/google-maps-v2.md)**: API Keys, Google Play Services, and v2 features.
107
- - **[iOS Map Kit](references/ios-map-kit.md)**: 3D Camera, system buttons, and iOS-specific callouts.
108
- - **[Notification Services](references/notification-services.md)**: Push notifications (APNs/FCM), local alerts, interactive notifications.
100
+ ### Core features
101
+ - [Location and maps](references/location-and-maps.md): GPS tracking and battery-efficient location rules.
102
+ - [Google Maps v2 (Android)](references/google-maps-v2.md): API keys, Google Play Services, and v2 features.
103
+ - [iOS Map Kit](references/ios-map-kit.md): 3D camera, system buttons, and iOS callouts.
104
+ - [Notification services](references/notification-services.md): push notifications (APNs/FCM), local alerts, interactive notifications.
109
105
 
110
- ### Data Handling
111
- - **[Remote Data Sources](references/remote-data-sources.md)**: HTTPClient lifecycle, JSON/XML parsing, file uploads/downloads, sockets, SOAP, SSL security.
112
- - **[Local Data Sources](references/local-data-sources.md)**: Filesystem operations, SQLite databases, Properties API, persistence strategies.
113
- - **[Buffer, Codec, and Streams](references/buffer-codec-streams.md)**: Advanced binary data manipulation and serial data flows.
106
+ ### Data handling
107
+ - [Remote data sources](references/remote-data-sources.md): HTTPClient lifecycle, JSON/XML parsing, uploads, downloads, sockets, SOAP, SSL.
108
+ - [Local data sources](references/local-data-sources.md): filesystem operations, SQLite, Properties API, persistence strategy.
109
+ - [Buffer, Codec, and Streams](references/buffer-codec-streams.md): binary data manipulation and serial data flows.
114
110
 
115
- ### Media & Content
116
- - **[Media APIs](references/media-apis.md)**: Audio playback/recording, Video streaming, Camera/Gallery, Images and ImageViews, density-specific assets.
111
+ ### Media and content
112
+ - [Media APIs](references/media-apis.md): audio playback and recording, video streaming, camera and gallery, ImageViews, density assets.
117
113
 
118
- ### Web Integration
119
- - **[Web Content Integration](references/web-content-integration.md)**: WebView component (WKWebView), local/remote content, bidirectional communication.
120
- - **[Webpack Build Pipeline](references/webpack-build-pipeline.md)**: Modern build pipeline (Ti 9.1.0+), NPM integration, and the `@` source alias.
114
+ ### Web integration
115
+ - [Web content integration](references/web-content-integration.md): WebView (WKWebView), local and remote content, bidirectional communication.
116
+ - [Webpack build pipeline](references/webpack-build-pipeline.md): Ti 9.1.0+ build pipeline, npm integration, and the `@` alias.
121
117
 
122
- ### Platform-Specific (Android)
123
- - **[Android Platform Deep Dives](references/android-platform-deep-dives.md)**: Intents, advanced Intent Filters, Broadcast with permissions, Background Services.
118
+ ### Platform-specific (Android)
119
+ - [Android platform deep dives](references/android-platform-deep-dives.md): intents, intent filters, broadcast permissions, background services.
124
120
 
125
- ### Platform-Specific (iOS)
126
- - **[iOS Platform Deep Dives](references/ios-platform-deep-dives.md)**: iOS 17 Privacy, Silent Push, Spotlight, Handoff, iCloud, Core Motion, WatchKit/Siri integration.
121
+ ### Platform-specific (iOS)
122
+ - [iOS platform deep dives](references/ios-platform-deep-dives.md): iOS 17 privacy, silent push, Spotlight, Handoff, iCloud, Core Motion, WatchKit and Siri.
127
123
 
128
- ### Advanced & DevOps
129
- - **[Extending Titanium](references/extending-titanium.md)**: Hyperloop, native module architecture (Proxy/View), Xcode debugging, SDK 9.0 (AndroidX) migration.
130
- - **[Debugging & Profiling](references/debugging-profiling.md)**: Memory management, leak detection, native tools.
131
- - **[Automation (Fastlane & Appium)](references/automation-fastlane-appium.md)**: CI/CD pipelines, UI testing, and automated store deployment.
124
+ ### Advanced and DevOps
125
+ - [Extending Titanium](references/extending-titanium.md): Hyperloop, native modules (Proxy and View), Xcode debugging, AndroidX migration for SDK 9.0.
126
+ - [Debugging and profiling](references/debugging-profiling.md): memory management, leak detection, native tools.
127
+ - [Automation (Fastlane and Appium)](references/automation-fastlane-appium.md): CI/CD, UI testing, store deployment.
132
128
 
133
- ## Related Skills
129
+ ## Related skills
134
130
 
135
- For tasks beyond native feature integration, use these complementary skills:
131
+ For tasks beyond native feature integration, use:
136
132
 
137
- | Task | Use This Skill |
133
+ | Task | Use this skill |
138
134
  | ---------------------------------------------- | -------------- |
139
135
  | Project architecture, services, memory cleanup | `ti-expert` |
140
136
  | UI layouts, ListViews, gestures, animations | `ti-ui` |
141
137
  | Hyperloop, app distribution, tiapp.xml config | `ti-guides` |
142
138
  | Alloy MVC, models, data binding | `alloy-guides` |
143
139
 
144
- ## Response Format
140
+ ## Response format
145
141
 
146
- 1. **Prerequisites**: List required permissions, `tiapp.xml` configurations, or module dependencies.
147
- 2. **Step-by-Step Implementation**: Task-focused code guide with error handling.
148
- 3. **Platform Caveats**: Mention specific behavior differences between iOS and Android.
149
- 4. **Best Practices**: Include memory management, lifecycle considerations, and performance tips.
142
+ 1. Prerequisites: required permissions, `tiapp.xml` config, or modules.
143
+ 2. Step-by-step implementation: task-focused code guide with error handling.
144
+ 3. Platform caveats: iOS and Android differences.
145
+ 4. Best practices: memory, lifecycle, and performance tips.