@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
@@ -1,30 +1,22 @@
1
- # Application Frameworks
1
+ # Application frameworks
2
2
 
3
- Framework options and architectural patterns for Titanium applications.
3
+ Framework options and architecture patterns for Titanium applications.
4
4
 
5
- 1. [Alloy Framework](#alloy-framework)
6
- 2. [Classic Titanium](#classic-titanium)
7
- 3. [Choosing a Framework](#choosing-a-framework)
8
- 4. [Architecture Patterns](#architecture-patterns)
5
+ ## Alloy framework
9
6
 
10
- ---
11
-
12
- ## Alloy Framework
7
+ Alloy is the official MVC framework for Titanium. It was developed by Appcelerator and is now maintained by TiDev.
13
8
 
14
- **Alloy** is the official MVC framework for Titanium, originally developed by Appcelerator and now maintained by TiDev.
9
+ ### What Alloy provides
15
10
 
16
- ### What is Alloy?
11
+ - MVC structure with models, views, and controllers
12
+ - Built-in libraries (Backbone.js, Underscore.js)
13
+ - XML views for declarative UI
14
+ - TSS for CSS-like styling
15
+ - Data binding between views and models
16
+ - Widgets for reusable UI components
17
+ - Model and collection sync with REST and SQL adapters
17
18
 
18
- Alloy provides:
19
- - **MVC Architecture** - Separate models, views, and controllers
20
- - **Built-in Libraries** - Backbone.js, Underscore.js
21
- - **XML Views** - Declarative UI markup
22
- - **TSS Styling** - CSS-like styling system
23
- - **Data Binding** - Automatic view-to-model synchronization
24
- - **Widgets** - Reusable UI components
25
- - **Model/Collection Sync** - Built-in REST and SQL adapters
26
-
27
- ### Project Structure
19
+ ### Project structure
28
20
 
29
21
  ```
30
22
  app/
@@ -39,9 +31,9 @@ app/
39
31
  └── alloy.js # Entry point
40
32
  ```
41
33
 
42
- ### Sample Alloy Code
34
+ ### Sample Alloy code
43
35
 
44
- **View (XML):**
36
+ View (XML):
45
37
  ```xml
46
38
  <Alloy>
47
39
  <Window class="container">
@@ -50,7 +42,7 @@ app/
50
42
  </Alloy>
51
43
  ```
52
44
 
53
- **Style (TSS):**
45
+ Style (TSS):
54
46
  ```css
55
47
  ".container": {
56
48
  backgroundColor: "#fff"
@@ -62,7 +54,7 @@ app/
62
54
  }
63
55
  ```
64
56
 
65
- **Controller (JS):**
57
+ Controller (JS):
66
58
  ```javascript
67
59
  const doClick = (e) => {
68
60
  alert('Clicked!');
@@ -71,42 +63,42 @@ const doClick = (e) => {
71
63
  $.index.open();
72
64
  ```
73
65
 
74
- ### Alloy Resources
66
+ ### Alloy resources
75
67
 
76
- - **Alloy Guides:** See the `alloy-guides` skill
77
- - **Alloy CLI:** See `alloy-cli-advanced.md`
78
- - **Alloy Data:** See `alloy-data-mastery.md`
79
- - **Alloy Widgets:** See `alloy-widgets-and-themes.md`
68
+ - Alloy guides: see the `alloy-guides` skill
69
+ - Alloy CLI: see `alloy-cli-advanced.md`
70
+ - Alloy data: see `alloy-data-mastery.md`
71
+ - Alloy widgets: see `alloy-widgets-and-themes.md`
80
72
 
81
- ### Angular Integration
73
+ ### Angular integration
82
74
 
83
- Angular integration with Titanium SDK was under development but is no longer actively maintained.
75
+ Angular integration with Titanium SDK was under development but is no longer maintained.
84
76
 
85
- ### React Community Framework
77
+ ### React community framework
86
78
 
87
- A community-based React integration exists at https://github.com/nicolomonili/react-titanium (experimental).
79
+ A community React integration exists at https://github.com/nicolomonili/react-titanium (experimental).
88
80
 
89
- ### When to Use Alloy
81
+ ### When to use Alloy
90
82
 
91
- ✅ **Use Alloy for:**
83
+ Use Alloy for:
92
84
  - New projects (default choice)
93
- - Teams wanting MVC structure
94
- - Projects needing data binding
85
+ - Teams that want MVC structure
86
+ - Projects that need data binding
95
87
  - Rapid development with XML views
96
88
  - Reusable components (widgets)
97
89
 
98
- ❌ **Consider alternatives for:**
99
- - Very simple apps (overkill)
100
- - Teams preferring pure JavaScript
90
+ Consider alternatives for:
91
+ - Very simple apps
92
+ - Teams that prefer pure JavaScript
101
93
  - Projects with unique architectural needs
102
94
 
103
95
  ---
104
96
 
105
97
  ## Classic Titanium
106
98
 
107
- Classic Titanium refers to building apps without Alloy, using pure JavaScript and CommonJS modules.
99
+ Classic Titanium means building apps without Alloy, using JavaScript and CommonJS modules.
108
100
 
109
- ### Project Structure
101
+ ### Project structure
110
102
 
111
103
  ```
112
104
  Resources/
@@ -119,9 +111,9 @@ Resources/
119
111
  └── assets/ # Images, etc.
120
112
  ```
121
113
 
122
- ### Sample Classic Code
114
+ ### Sample Classic code
123
115
 
124
- **app.js:**
116
+ app.js:
125
117
  ```javascript
126
118
  // Single namespace pattern
127
119
  const app = {};
@@ -134,7 +126,7 @@ app.mainWindow = app.ui.createApplicationWindow();
134
126
  app.mainWindow.open();
135
127
  ```
136
128
 
137
- **ui/ApplicationWindow.js:**
129
+ ui/ApplicationWindow.js:
138
130
  ```javascript
139
131
  // Extend namespace
140
132
  app.ui = app.ui || {};
@@ -155,9 +147,9 @@ app.ui.createApplicationWindow = () => {
155
147
  };
156
148
  ```
157
149
 
158
- ### CommonJS Pattern (Recommended)
150
+ ### CommonJS pattern (recommended)
159
151
 
160
- **myModule.js:**
152
+ myModule.js:
161
153
  ```javascript
162
154
  // Private variables
163
155
  const privateData = 'secret';
@@ -174,65 +166,55 @@ exports.getData = () => {
174
166
  };
175
167
  ```
176
168
 
177
- **app.js:**
169
+ app.js:
178
170
  ```javascript
179
171
  const myModule = require('myModule');
180
172
  const win = myModule.createWindow();
181
173
  win.open();
182
174
  ```
183
175
 
184
- ### When to Use Classic
176
+ ### When to use Classic
185
177
 
186
- ✅ **Use Classic for:**
178
+ Use Classic for:
187
179
  - Simple projects
188
180
  - Developers who prefer pure JavaScript
189
181
  - Migrating from older Titanium projects
190
182
  - Fine-grained control over UI creation
191
183
  - Learning the Titanium API directly
192
184
 
193
- ❌ **Consider Alloy for:**
185
+ Consider Alloy for:
194
186
  - Large teams
195
187
  - Complex apps with many screens
196
- - Projects needing built-in MVC
188
+ - Projects that need built-in MVC
197
189
  - Data-heavy applications
198
190
 
199
191
  ---
200
192
 
201
- ## Choosing a Framework
193
+ ## Choosing a framework
202
194
 
203
195
  ### Comparison
204
196
 
205
- | Feature | Alloy | Classic |
206
- | ------------------ | ----------------------- | ------------------ |
207
- | **Learning Curve** | Steeper (XML, TSS, MVC) | Easier (just JS) |
208
- | **Boilerplate** | Less (declarative) | More (imperative) |
209
- | **Structure** | Enforced (MVC) | Manual |
210
- | **Data Binding** | Built-in | Manual |
211
- | **Styling** | TSS (CSS-like) | Inline JS |
212
- | **Team Size** | Better for large teams | Flexible |
213
- | **Rapid Dev** | Faster (once learned) | Slower (more code) |
197
+ | Feature | Alloy | Classic |
198
+ | ----------------- | ----------------------- | ------------------ |
199
+ | Learning curve | Steeper (XML, TSS, MVC) | Easier (just JS) |
200
+ | Boilerplate | Less (declarative) | More (imperative) |
201
+ | Structure | Enforced (MVC) | Manual |
202
+ | Data binding | Built-in | Manual |
203
+ | Styling | TSS (CSS-like) | Inline JS |
204
+ | Team size | Better for large teams | Flexible |
205
+ | Rapid development | Faster once learned | Slower (more code) |
214
206
 
215
207
  ### Recommendation
216
208
 
217
- **Start with Alloy** - It's the default for new projects and provides:
218
- - Built-in best practices
219
- - MVC structure from day one
220
- - Less code to write
221
- - Better team collaboration
222
- - Official support and updates
223
-
224
- **Switch to Classic** if:
225
- - Alloy feels too complex for your needs
226
- - You prefer pure JavaScript
227
- - Your app is very simple
209
+ Start with Alloy if you are building a new app or expect multiple contributors. If Alloy feels like overhead or the app is very small, Classic is fine.
228
210
 
229
211
  ---
230
212
 
231
- ## Architecture Patterns
213
+ ## Architecture patterns
232
214
 
233
- ### Namespaced Pattern
215
+ ### Namespaced pattern
234
216
 
235
- Classic Titanium pattern with single global namespace:
217
+ Classic Titanium pattern with a single global namespace:
236
218
 
237
219
  ```javascript
238
220
  const app = {
@@ -253,11 +235,11 @@ app.init();
253
235
  app.run();
254
236
  ```
255
237
 
256
- ### CommonJS Modules
238
+ ### CommonJS modules
257
239
 
258
240
  Modern JavaScript pattern for Titanium:
259
241
 
260
- **models/user.js:**
242
+ models/user.js:
261
243
  ```javascript
262
244
  exports.create = (attrs) => {
263
245
  return {
@@ -270,7 +252,7 @@ exports.create = (attrs) => {
270
252
  };
271
253
  ```
272
254
 
273
- **controllers/user.js:**
255
+ controllers/user.js:
274
256
  ```javascript
275
257
  const User = require('models/user');
276
258
 
@@ -281,7 +263,7 @@ exports.register = (data) => {
281
263
  };
282
264
  ```
283
265
 
284
- ### MVC with Alloy (Built-in)
266
+ ### MVC with Alloy (built-in)
285
267
 
286
268
  Alloy enforces MVC:
287
269
 
@@ -292,11 +274,11 @@ app/
292
274
  └── views/userView.xml # Presentation
293
275
  ```
294
276
 
295
- ### Repository Pattern
277
+ ### Repository pattern
296
278
 
297
279
  Separate data access from business logic:
298
280
 
299
- **repositories/userRepository.js:**
281
+ repositories/userRepository.js:
300
282
  ```javascript
301
283
  exports.findById = (id) => {
302
284
  // Database call
@@ -309,7 +291,7 @@ exports.save = (user) => {
309
291
  };
310
292
  ```
311
293
 
312
- **services/userService.js:**
294
+ services/userService.js:
313
295
  ```javascript
314
296
  const repo = require('repositories/userRepository');
315
297
 
@@ -324,7 +306,7 @@ exports.register = (data) => {
324
306
 
325
307
  ---
326
308
 
327
- ## Framework Interoperability
309
+ ## Framework interoperability
328
310
 
329
311
  ### Mix Alloy and Classic
330
312
 
@@ -339,46 +321,46 @@ $.label.text = data;
339
321
 
340
322
  ### Migrate Classic to Alloy
341
323
 
342
- 1. Create new Alloy project
343
- 2. Move business logic to `controllers/` or `lib/`
344
- 3. Convert UI creation to `views/` (XML)
345
- 4. Create `styles/` (TSS) from inline styles
346
- 5. Update data access to use `models/`
324
+ 1. Create a new Alloy project.
325
+ 2. Move business logic to `controllers/` or `lib/`.
326
+ 3. Convert UI creation to `views/` (XML).
327
+ 4. Create `styles/` (TSS) from inline styles.
328
+ 5. Update data access to use `models/`.
347
329
 
348
330
  ---
349
331
 
350
- ## Best Practices
332
+ ## Best practices
351
333
 
352
- ### For Alloy Projects
334
+ ### For Alloy projects
353
335
 
354
- 1. **Follow MVC strictly** - Keep models/models, views/views, controllers/logic
355
- 2. **Use data binding** - Avoid manual view updates
356
- 3. **Leverage widgets** - Reusable components
357
- 4. **Use themes** - For styling variations
358
- 5. **Keep controllers lean** - Move business logic to lib/
336
+ 1. Follow MVC strictly. Keep models in `models/`, views in `views/`, and controller logic in `controllers/`.
337
+ 2. Use data binding and avoid manual view updates.
338
+ 3. Use widgets for reusable UI.
339
+ 4. Use themes for styling variants.
340
+ 5. Keep controllers lean and move business logic to `lib/`.
359
341
 
360
- ### For Classic Projects
342
+ ### For Classic projects
361
343
 
362
- 1. **Use CommonJS modules** - Not `Ti.include()`
363
- 2. **Single namespace** - One global variable maximum
364
- 3. **Protect global scope** - Use IIFEs
365
- 4. **Separate concerns** - Models, views, controllers folders
366
- 5. **Document patterns** - Make architecture clear to team
344
+ 1. Use CommonJS modules instead of `Ti.include()`.
345
+ 2. Keep a single global namespace.
346
+ 3. Protect global scope with IIFEs.
347
+ 4. Separate concerns with `models/`, `views/`, and `controllers/` folders.
348
+ 5. Document patterns so the team shares the same structure.
367
349
 
368
- ### For Both
350
+ ### For both
369
351
 
370
- 1. **Memory management** - Clean up listeners, null objects
371
- 2. **Error handling** - Try/catch around critical code
372
- 3. **Logging** - Use Ti.API for debugging
373
- 4. **Code style** - Follow `style-and-conventions.md`
374
- 5. **Testing** - Write unit tests for business logic
352
+ 1. Clean up listeners and null heavy objects.
353
+ 2. Add try/catch around critical code paths.
354
+ 3. Use `Ti.API` for logging.
355
+ 4. Follow `style-and-conventions.md` for code style.
356
+ 5. Write unit tests for business logic.
375
357
 
376
358
  ---
377
359
 
378
360
  ## Resources
379
361
 
380
- - **Alloy Guides:** See the `alloy-guides` skill
381
- - **CommonJS Advanced:** See `commonjs-advanced.md`
382
- - **Coding Best Practices:** See `coding-best-practices.md`
383
- - **JavaScript Primer:** See `javascript-primer.md`
384
- - **Alloy CLI:** See `alloy-cli-advanced.md`
362
+ - Alloy guides: see the `alloy-guides` skill
363
+ - CommonJS advanced: see `commonjs-advanced.md`
364
+ - Coding best practices: see `coding-best-practices.md`
365
+ - JavaScript primer: see `javascript-primer.md`
366
+ - Alloy CLI: see `alloy-cli-advanced.md`