@maccesar/titools 2.10.0 → 3.1.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 (99) hide show
  1. package/AGENTS-VERCEL-RESEARCH.md +23 -12
  2. package/README.md +81 -182
  3. package/agents/ti-pro.md +8 -14
  4. package/lib/cleanup.js +13 -0
  5. package/lib/commands/skills.js +2 -1
  6. package/lib/commands/update.js +4 -1
  7. package/lib/config.js +9 -11
  8. package/lib/platform.js +1 -1
  9. package/package.json +2 -3
  10. package/skills/purgetss/SKILL.md +12 -0
  11. package/skills/purgetss/references/animation-advanced.md +0 -9
  12. package/skills/purgetss/references/app-branding.md +20 -0
  13. package/skills/purgetss/references/appearance-module.md +85 -27
  14. package/skills/purgetss/references/apply-directive.md +60 -0
  15. package/skills/purgetss/references/arbitrary-values.md +41 -0
  16. package/skills/purgetss/references/cli-commands.md +52 -17
  17. package/skills/purgetss/references/custom-rules.md +36 -19
  18. package/skills/purgetss/references/customization-deep-dive.md +37 -15
  19. package/skills/purgetss/references/grid-layout.md +45 -26
  20. package/skills/purgetss/references/icon-fonts.md +27 -25
  21. package/skills/purgetss/references/installation-setup.md +28 -2
  22. package/skills/purgetss/references/ios-large-titles.md +31 -15
  23. package/skills/purgetss/references/multi-density-images.md +57 -0
  24. package/skills/purgetss/references/opacity-modifier.md +11 -2
  25. package/skills/purgetss/references/semantic-colors.md +44 -1
  26. package/skills/purgetss/references/tikit-components.md +1 -3
  27. package/skills/alloy-guides/SKILL.md +0 -190
  28. package/skills/alloy-guides/references/CLI_TASKS.md +0 -233
  29. package/skills/alloy-guides/references/CONCEPTS.md +0 -171
  30. package/skills/alloy-guides/references/CONTROLLERS.md +0 -279
  31. package/skills/alloy-guides/references/MODELS.md +0 -1214
  32. package/skills/alloy-guides/references/PURGETSS.md +0 -46
  33. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +0 -235
  34. package/skills/alloy-guides/references/VIEWS_STYLES.md +0 -375
  35. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
  36. package/skills/alloy-guides/references/VIEWS_XML.md +0 -581
  37. package/skills/alloy-guides/references/WIDGETS.md +0 -160
  38. package/skills/alloy-howtos/SKILL.md +0 -181
  39. package/skills/alloy-howtos/references/best_practices.md +0 -121
  40. package/skills/alloy-howtos/references/cli_reference.md +0 -230
  41. package/skills/alloy-howtos/references/config_files.md +0 -158
  42. package/skills/alloy-howtos/references/custom_tags.md +0 -148
  43. package/skills/alloy-howtos/references/debugging_troubleshooting.md +0 -78
  44. package/skills/alloy-howtos/references/samples.md +0 -156
  45. package/skills/ti-api/SKILL.md +0 -109
  46. package/skills/ti-api/references/api-android.md +0 -675
  47. package/skills/ti-api/references/api-app-platform.md +0 -636
  48. package/skills/ti-api/references/api-core.md +0 -764
  49. package/skills/ti-api/references/api-data-network.md +0 -641
  50. package/skills/ti-api/references/api-media.md +0 -655
  51. package/skills/ti-api/references/api-modules-ble-bluetooth.md +0 -657
  52. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +0 -411
  53. package/skills/ti-api/references/api-modules-map.md +0 -632
  54. package/skills/ti-api/references/api-modules-nfc.md +0 -725
  55. package/skills/ti-api/references/api-modules-social-misc.md +0 -526
  56. package/skills/ti-api/references/api-services.md +0 -700
  57. package/skills/ti-api/references/api-ui-android.md +0 -499
  58. package/skills/ti-api/references/api-ui-extras.md +0 -702
  59. package/skills/ti-api/references/api-ui-ios-animator.md +0 -378
  60. package/skills/ti-api/references/api-ui-ios.md +0 -756
  61. package/skills/ti-api/references/api-ui-lists.md +0 -581
  62. package/skills/ti-api/references/api-ui-text-input.md +0 -607
  63. package/skills/ti-api/references/api-ui-views.md +0 -572
  64. package/skills/ti-api/references/api-ui-windows-navigation.md +0 -676
  65. package/skills/ti-api/references/api-xml-global.md +0 -743
  66. package/skills/ti-guides/SKILL.md +0 -75
  67. package/skills/ti-guides/references/advanced-data-and-images.md +0 -155
  68. package/skills/ti-guides/references/android-manifest.md +0 -97
  69. package/skills/ti-guides/references/app-distribution.md +0 -373
  70. package/skills/ti-guides/references/application-frameworks.md +0 -366
  71. package/skills/ti-guides/references/cli-reference.md +0 -700
  72. package/skills/ti-guides/references/coding-best-practices.md +0 -150
  73. package/skills/ti-guides/references/commonjs-advanced.md +0 -279
  74. package/skills/ti-guides/references/hello-world.md +0 -99
  75. package/skills/ti-guides/references/hyperloop-native-access.md +0 -458
  76. package/skills/ti-guides/references/javascript-primer.md +0 -402
  77. package/skills/ti-guides/references/reserved-words.md +0 -36
  78. package/skills/ti-guides/references/resources.md +0 -172
  79. package/skills/ti-guides/references/style-and-conventions.md +0 -104
  80. package/skills/ti-guides/references/tiapp-config.md +0 -655
  81. package/skills/ti-howtos/SKILL.md +0 -143
  82. package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -609
  83. package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
  84. package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
  85. package/skills/ti-howtos/references/cross-platform-development.md +0 -358
  86. package/skills/ti-howtos/references/debugging-profiling.md +0 -473
  87. package/skills/ti-howtos/references/extending-titanium.md +0 -684
  88. package/skills/ti-howtos/references/google-maps-v2.md +0 -172
  89. package/skills/ti-howtos/references/ios-map-kit.md +0 -149
  90. package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -595
  91. package/skills/ti-howtos/references/local-data-sources.md +0 -310
  92. package/skills/ti-howtos/references/location-and-maps.md +0 -267
  93. package/skills/ti-howtos/references/media-apis.md +0 -268
  94. package/skills/ti-howtos/references/notification-services.md +0 -539
  95. package/skills/ti-howtos/references/remote-data-sources.md +0 -339
  96. package/skills/ti-howtos/references/tutorials.md +0 -552
  97. package/skills/ti-howtos/references/using-modules.md +0 -182
  98. package/skills/ti-howtos/references/web-content-integration.md +0 -288
  99. package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -125
@@ -1,366 +0,0 @@
1
- # Application frameworks
2
-
3
- Framework options and architecture patterns for Titanium applications.
4
-
5
- ## Alloy framework
6
-
7
- Alloy is the official MVC framework for Titanium. It was developed by Appcelerator and is now maintained by TiDev.
8
-
9
- ### What Alloy provides
10
-
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
18
-
19
- ### Project structure
20
-
21
- ```
22
- app/
23
- ├── controllers/ # UI logic
24
- ├── models/ # Data models
25
- ├── views/ # XML view definitions
26
- ├── styles/ # TSS style sheets
27
- ├── assets/ # Images, fonts
28
- ├── lib/ # CommonJS libraries
29
- ├── themes/ # Theming support
30
- ├── config.json # App configuration
31
- └── alloy.js # Entry point
32
- ```
33
-
34
- ### Sample Alloy code
35
-
36
- View (XML):
37
- ```xml
38
- <Alloy>
39
- <Window class="container">
40
- <Label id="title" onClick="doClick">Click Me</Label>
41
- </Window>
42
- </Alloy>
43
- ```
44
-
45
- Style (TSS):
46
- ```css
47
- ".container": {
48
- backgroundColor: "#fff"
49
- }
50
-
51
- "#title": {
52
- color: "#000",
53
- font: { fontSize: 18 }
54
- }
55
- ```
56
-
57
- Controller (JS):
58
- ```javascript
59
- const doClick = (e) => {
60
- alert('Clicked!');
61
- };
62
-
63
- $.index.open();
64
- ```
65
-
66
- ### Alloy resources
67
-
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`
72
-
73
- ### Angular integration
74
-
75
- Angular integration with Titanium SDK was under development but is no longer maintained.
76
-
77
- ### React community framework
78
-
79
- A community React integration exists at https://github.com/nicolomonili/react-titanium (experimental).
80
-
81
- ### When to use Alloy
82
-
83
- Use Alloy for:
84
- - New projects (default choice)
85
- - Teams that want MVC structure
86
- - Projects that need data binding
87
- - Rapid development with XML views
88
- - Reusable components (widgets)
89
-
90
- Consider alternatives for:
91
- - Very simple apps
92
- - Teams that prefer pure JavaScript
93
- - Projects with unique architectural needs
94
-
95
- ---
96
-
97
- ## Classic Titanium
98
-
99
- Classic Titanium means building apps without Alloy, using JavaScript and CommonJS modules.
100
-
101
- ### Project structure
102
-
103
- ```
104
- Resources/
105
- ├── app.js # Entry point
106
- ├── ui/ # UI components
107
- │ ├── ApplicationWindow.js
108
- │ └── ...
109
- ├── models/ # Data models
110
- ├── lib/ # Utilities
111
- └── assets/ # Images, etc.
112
- ```
113
-
114
- ### Sample Classic code
115
-
116
- app.js:
117
- ```javascript
118
- // Single namespace pattern
119
- const app = {};
120
-
121
- // Load components via require (Ti.include is deprecated)
122
- const AppWindow = require('ui/ApplicationWindow');
123
-
124
- // Create and open window
125
- app.mainWindow = AppWindow.createApplicationWindow();
126
- app.mainWindow.open();
127
- ```
128
-
129
- ui/ApplicationWindow.js:
130
- ```javascript
131
- // Extend namespace
132
- app.ui = app.ui || {};
133
-
134
- app.ui.createApplicationWindow = () => {
135
- const win = Ti.UI.createWindow({
136
- backgroundColor: 'white',
137
- title: 'My App'
138
- });
139
-
140
- const label = Ti.UI.createLabel({
141
- text: 'Hello World',
142
- color: '#000'
143
- });
144
-
145
- win.add(label);
146
- return win;
147
- };
148
- ```
149
-
150
- ### CommonJS pattern (recommended)
151
-
152
- myModule.js:
153
- ```javascript
154
- // Private variables
155
- const privateData = 'secret';
156
-
157
- // Public API
158
- exports.createWindow = () => {
159
- return Ti.UI.createWindow({
160
- backgroundColor: 'white'
161
- });
162
- };
163
-
164
- exports.getData = () => {
165
- return privateData;
166
- };
167
- ```
168
-
169
- app.js:
170
- ```javascript
171
- const myModule = require('myModule');
172
- const win = myModule.createWindow();
173
- win.open();
174
- ```
175
-
176
- ### When to use Classic
177
-
178
- Use Classic for:
179
- - Simple projects
180
- - Developers who prefer pure JavaScript
181
- - Migrating from older Titanium projects
182
- - Fine-grained control over UI creation
183
- - Learning the Titanium API directly
184
-
185
- Consider Alloy for:
186
- - Large teams
187
- - Complex apps with many screens
188
- - Projects that need built-in MVC
189
- - Data-heavy applications
190
-
191
- ---
192
-
193
- ## Choosing a framework
194
-
195
- ### Comparison
196
-
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) |
206
-
207
- ### Recommendation
208
-
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.
210
-
211
- ---
212
-
213
- ## Architecture patterns
214
-
215
- ### Namespaced pattern
216
-
217
- Classic Titanium pattern with a single global namespace:
218
-
219
- ```javascript
220
- const app = {
221
- models: {},
222
- views: {},
223
- controllers: {},
224
-
225
- init() {
226
- // Initialize app
227
- },
228
-
229
- run() {
230
- // Run app
231
- }
232
- };
233
-
234
- app.init();
235
- app.run();
236
- ```
237
-
238
- ### CommonJS modules
239
-
240
- Modern JavaScript pattern for Titanium:
241
-
242
- models/user.js:
243
- ```javascript
244
- exports.create = (attrs) => {
245
- return {
246
- name: attrs.name,
247
- email: attrs.email,
248
- save() {
249
- // Save to database
250
- }
251
- };
252
- };
253
- ```
254
-
255
- controllers/user.js:
256
- ```javascript
257
- const User = require('models/user');
258
-
259
- exports.register = (data) => {
260
- const user = User.create(data);
261
- user.save();
262
- return user;
263
- };
264
- ```
265
-
266
- ### MVC with Alloy (built-in)
267
-
268
- Alloy enforces MVC:
269
-
270
- ```
271
- app/
272
- ├── controllers/userController.js # Logic
273
- ├── models/userModel.js # Data
274
- └── views/userView.xml # Presentation
275
- ```
276
-
277
- ### Repository pattern
278
-
279
- Separate data access from business logic:
280
-
281
- repositories/userRepository.js:
282
- ```javascript
283
- exports.findById = (id) => {
284
- // Database call
285
- return db.query('SELECT * FROM users WHERE id = ?', [id]);
286
- };
287
-
288
- exports.save = (user) => {
289
- // Insert/update
290
- return db.execute('INSERT INTO users ...');
291
- };
292
- ```
293
-
294
- services/userService.js:
295
- ```javascript
296
- const repo = require('repositories/userRepository');
297
-
298
- exports.register = (data) => {
299
- // Business logic
300
- if (!data.email) {
301
- throw new Error('Email required');
302
- }
303
- return repo.save(data);
304
- };
305
- ```
306
-
307
- ---
308
-
309
- ## Framework interoperability
310
-
311
- ### Mix Alloy and Classic
312
-
313
- You can use Alloy and include Classic CommonJS modules:
314
-
315
- ```javascript
316
- // In Alloy controller
317
- var classicModule = require('lib/myClassicModule');
318
- var data = classicModule.getData();
319
- $.label.text = data;
320
- ```
321
-
322
- ### Migrate Classic to Alloy
323
-
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/`.
329
-
330
- ---
331
-
332
- ## Best practices
333
-
334
- ### For Alloy projects
335
-
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/`.
341
-
342
- ### For Classic projects
343
-
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.
349
-
350
- ### For both
351
-
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.
357
-
358
- ---
359
-
360
- ## Resources
361
-
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`