@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,14 +1,14 @@
1
- # Hyperloop: Native API Access
1
+ # Hyperloop: native API access
2
2
 
3
- Hyperloop allows you to access 100% of native APIs (iOS Objective-C/Swift and Android Java/Kotlin) directly from JavaScript. It is pre-packaged with the Titanium SDK and works as a native module.
3
+ Hyperloop lets you access native APIs (iOS Objective-C/Swift and Android Java/Kotlin) directly from JavaScript. It ships with the Titanium SDK and works as a native module.
4
4
 
5
5
  ## 1. Requirements
6
6
 
7
- - **Titanium SDK**: 9.0.0+
8
- - **Titanium CLI**: 7.0.0+
9
- - **Alloy** (optional): 1.8.0+
10
- - **CocoaPods** (optional, iOS only): 1.0.0+
11
- - **Xcode location**: Must be at `/Applications/Xcode.app` -- Hyperloop uses a bundled library from Xcode to inspect available native APIs. Having Xcode in a non-default location (via `xcode-select` or Xcode preferences) while another installation exists in the default folder can cause metadata errors.
7
+ - Titanium SDK: 9.0.0+
8
+ - Titanium CLI: 7.0.0+
9
+ - Alloy (optional): 1.8.0+
10
+ - CocoaPods (optional, iOS only): 1.0.0+
11
+ - Xcode location: must be at `/Applications/Xcode.app`. Hyperloop uses a bundled Xcode library to inspect native APIs. If Xcode is in a non-default location while another installation exists in the default folder, metadata errors can occur.
12
12
 
13
13
  ## 2. Enabling Hyperloop
14
14
 
@@ -25,20 +25,20 @@ The `run-on-main-thread` property should already be in `tiapp.xml` by default:
25
25
  <property name="run-on-main-thread" type="bool">true</property>
26
26
  ```
27
27
 
28
- > Do NOT name your app "Hyperloop" in tiapp.xml -- it is a reserved word and will cause build failures.
28
+ Do not name your app "Hyperloop" in `tiapp.xml`. It is a reserved word and will cause build failures.
29
29
 
30
- ## 3. Framework Namespace Conventions
30
+ ## 3. Framework namespace conventions
31
31
 
32
- Each platform uses different `require()` conventions:
32
+ Each platform uses different `require()` conventions.
33
33
 
34
- **iOS** -- use `Framework/Class` with a forward slash:
34
+ iOS: use `Framework/Class` with a forward slash:
35
35
  ```javascript
36
36
  const UIView = require('UIKit/UIView');
37
37
  const NSBundle = require('Foundation/NSBundle');
38
38
  const UIColor = require('UIKit/UIColor');
39
39
  ```
40
40
 
41
- **Android** -- use the full Java package with dots:
41
+ Android: use the full Java package with dots:
42
42
  ```javascript
43
43
  const View = require('android.view.View');
44
44
  const Activity = require('android.app.Activity');
@@ -49,8 +49,8 @@ const Context = require('android.content.Context');
49
49
 
50
50
  ### Instantiation: `new` vs `alloc().init()`
51
51
 
52
- - **`new Class()`**: Equivalent to `alloc().init()`. Only calls the **default** initializer (`init`).
53
- - **`Class.alloc().initWith*()`**: Use when you need a **special initializer** with arguments.
52
+ - `new Class()` is equivalent to `alloc().init()`. It only calls the default initializer (`init`).
53
+ - `Class.alloc().initWith*()` is for special initializers that take arguments.
54
54
 
55
55
  ```javascript
56
56
  const UIView = require('UIKit/UIView');
@@ -59,12 +59,12 @@ const UIView = require('UIKit/UIView');
59
59
  const view1 = new UIView();
60
60
  const view2 = UIView.alloc().init();
61
61
 
62
- // Special initializer with arguments -- must use alloc().init*()
62
+ // Special initializer with arguments
63
63
  const CGRectMake = require('CoreGraphics').CGRectMake;
64
64
  const view3 = UIView.alloc().initWithFrame(CGRectMake(0, 0, 100, 100));
65
65
  ```
66
66
 
67
- ### Named Methods (Selector Concatenation)
67
+ ### Named methods (selector concatenation)
68
68
 
69
69
  Selectors with multiple parameters are camel-cased and colons are removed. Arguments are passed in the same order as in Objective-C.
70
70
 
@@ -84,7 +84,7 @@ UIView.animateWithDurationAnimationsCompletion(1.0, () => {
84
84
 
85
85
  ### Properties
86
86
 
87
- Objective-C properties map directly to JavaScript property accessors. Auto-generated setters are also available:
87
+ Objective-C properties map to JavaScript property accessors. Auto-generated setters are also available:
88
88
  ```javascript
89
89
  view.backgroundColor = UIColor.redColor;
90
90
  // or
@@ -105,7 +105,7 @@ const tiView = Ti.UI.createView({ backgroundColor: 'red' });
105
105
  const nativeView = UIView.cast(tiView);
106
106
  ```
107
107
 
108
- > Be careful with casting: casting to the wrong type will cause a crash.
108
+ Be careful with casting. Casting to the wrong type can crash.
109
109
 
110
110
  ### Blocks
111
111
 
@@ -120,7 +120,7 @@ UIView.animateWithDurationAnimationsCompletion(1.0, () => {
120
120
  });
121
121
  ```
122
122
 
123
- ### Constants, Enumerations, and Functions
123
+ ### Constants, enumerations, and functions
124
124
 
125
125
  Framework-level constants and enums are accessed by requiring the framework itself:
126
126
  ```javascript
@@ -129,7 +129,7 @@ const unspecified = UIKit.UISemanticContentAttributeUnspecified;
129
129
  view.semanticContentAttribute = unspecified;
130
130
  ```
131
131
 
132
- ### TiApp Utility Class
132
+ ### TiApp utility class
133
133
 
134
134
  Access Titanium's app instance for the app delegate, key window, and app-level properties:
135
135
  ```javascript
@@ -137,7 +137,7 @@ const TiApp = require('TiApp/TiApp');
137
137
  const app = TiApp.app();
138
138
  ```
139
139
 
140
- ## 5. iOS: Creating Custom Classes
140
+ ## 5. iOS: creating custom classes
141
141
 
142
142
  Use `Hyperloop.defineClass()` to create Objective-C classes at runtime:
143
143
 
@@ -172,27 +172,27 @@ MyView.addMethod({
172
172
  ```
173
173
 
174
174
  `addMethod` properties:
175
- - **`selector`**: The Objective-C selector string
176
- - **`instance`**: `true` for instance methods, `false` for class methods
177
- - **`arguments`**: Array or String of argument types (Objective-C encoding types or general types like `float`, `int`, `id`)
178
- - **`returnType`**: String return type. Omit for `void`.
179
- - **`callback`**: The JavaScript function implementation
175
+ - `selector`: Objective-C selector string
176
+ - `instance`: `true` for instance methods, `false` for class methods
177
+ - `arguments`: array or string of argument types (Objective-C encoding types or general types like `float`, `int`, `id`)
178
+ - `returnType`: string return type (omit for `void`)
179
+ - `callback`: JavaScript implementation
180
180
 
181
181
  Instantiate the custom class normally:
182
182
  ```javascript
183
183
  const myView = new MyView();
184
184
  ```
185
185
 
186
- ## 6. iOS: CocoaPods Support
186
+ ## 6. iOS: CocoaPods support
187
187
 
188
188
  ### Installation
189
189
 
190
- Install CocoaPods if not already installed:
190
+ Install CocoaPods if needed:
191
191
  ```bash
192
192
  sudo gem install cocoapods
193
193
  ```
194
194
 
195
- ### Podfile Configuration
195
+ ### Podfile configuration
196
196
 
197
197
  Create a `Podfile` in your Titanium project root:
198
198
  ```ruby
@@ -206,9 +206,9 @@ target 'YourProjectName' do
206
206
  end
207
207
  ```
208
208
 
209
- Replace `YourProjectName` with your actual Titanium project name.
209
+ Replace `YourProjectName` with your Titanium project name.
210
210
 
211
- ### Using the Pod
211
+ ### Using the pod
212
212
 
213
213
  ```javascript
214
214
  const JBBarChartView = require('JBChartView/JBBarChartView');
@@ -217,7 +217,7 @@ chart.minimumValue = 1;
217
217
  chart.maximumValue = 100;
218
218
  ```
219
219
 
220
- ### Bitcode Handling for Ad-Hoc Builds
220
+ ### Bitcode handling for Ad Hoc builds
221
221
 
222
222
  If your build fails due to mixed Bitcode frameworks, disable Bitcode in your Podfile:
223
223
  ```ruby
@@ -230,11 +230,11 @@ post_install do |installer|
230
230
  end
231
231
  ```
232
232
 
233
- ### Custom Frameworks (without CocoaPods)
233
+ ### Custom frameworks (without CocoaPods)
234
234
 
235
- Drop native iOS frameworks (static or dynamic) into `app/platform/ios` (Alloy) or `platform/ios` (Classic). They will be automatically detected and linked.
235
+ Drop native iOS frameworks (static or dynamic) into `app/platform/ios` (Alloy) or `platform/ios` (Classic). They will be detected and linked.
236
236
 
237
- ## 7. iOS: Swift Support
237
+ ## 7. iOS: Swift support
238
238
 
239
239
  Hyperloop supports Swift classes alongside Objective-C:
240
240
  - Swift and Objective-C classes can be mixed in the same app
@@ -243,7 +243,7 @@ Hyperloop supports Swift classes alongside Objective-C:
243
243
 
244
244
  ## 8. iOS: XIB and Storyboards
245
245
 
246
- XIB files and Storyboards must be programmatically loaded. Place them in `app/assets/iphone` (Alloy) or `Resources/iphone` (Classic) and they will be compiled automatically.
246
+ XIB files and Storyboards must be loaded programmatically. Place them in `app/assets/iphone` (Alloy) or `Resources/iphone` (Classic) and they will be compiled automatically.
247
247
 
248
248
  ```javascript
249
249
  const NSBundle = require('Foundation/NSBundle');
@@ -255,7 +255,7 @@ const objects = nib.instantiateWithOwnerOptions(null, null);
255
255
 
256
256
  The following resources are compiled automatically: `*.storyboard`, `*.xcdatamodel`, `*.xcdatamodeld`, `*.xcmappingmodel`, `*.xib`.
257
257
 
258
- ## 9. iOS: Customizing the Xcode Build
258
+ ## 9. iOS: customizing the Xcode build
259
259
 
260
260
  Use `appc.js` in the project root to pass custom flags to `xcodebuild`:
261
261
  ```javascript
@@ -274,7 +274,7 @@ module.exports = {
274
274
 
275
275
  ## 10. Android (Java)
276
276
 
277
- ### Activity Context
277
+ ### Activity context
278
278
 
279
279
  Most Android view constructors require an Activity context:
280
280
  ```javascript
@@ -282,17 +282,17 @@ const Activity = require('android.app.Activity');
282
282
  const activity = new Activity(Ti.Android.currentActivity);
283
283
  ```
284
284
 
285
- ### Methods and Fields
285
+ ### Methods and fields
286
286
 
287
287
  Java methods map to JavaScript functions. Java fields map to JavaScript property accessors. Static methods and constants are attached to the class type:
288
288
  ```javascript
289
289
  const View = require('android.view.View');
290
- const generatedId = View.generateViewId(); // static method
290
+ const generatedId = View.generateViewId();
291
291
  ```
292
292
 
293
- ### Method Overloading
293
+ ### Method overloading
294
294
 
295
- Hyperloop automatically selects the matching overload based on parameter types. It is slightly more liberal with numeric primitives due to JavaScript Number conversion.
295
+ Hyperloop selects the matching overload based on parameter types. It is slightly more liberal with numeric primitives because JavaScript numbers are all `Number`.
296
296
 
297
297
  ### Casting
298
298
 
@@ -321,7 +321,7 @@ const listener = new OnTouchListener({
321
321
  });
322
322
  ```
323
323
 
324
- ### Creating Custom Classes (Android)
324
+ ### Creating custom classes (Android)
325
325
 
326
326
  Use `.extend()` on the class to subclass, passing an object with method overrides:
327
327
  ```javascript
@@ -338,9 +338,9 @@ const MyView = View.extend({
338
338
  const customView = new MyView(activity);
339
339
  ```
340
340
 
341
- ## 11. Android: Native XML Layouts
341
+ ## 11. Android: native XML layouts
342
342
 
343
- ### Creating the Layout
343
+ ### Creating the layout
344
344
 
345
345
  Place XML layout files in `app/platform/android/res/layout/` (Alloy) or `platform/android/res/layout/` (Classic).
346
346
 
@@ -366,7 +366,7 @@ Example `main_content.xml`:
366
366
  </androidx.coordinatorlayout.widget.CoordinatorLayout>
367
367
  ```
368
368
 
369
- ### Inflating the Layout
369
+ ### Inflating the layout
370
370
 
371
371
  ```javascript
372
372
  const Activity = require('android.app.Activity');
@@ -386,15 +386,15 @@ const view = inflater.inflate(resId, null);
386
386
  $.myView.add(view);
387
387
  ```
388
388
 
389
- `getIdentifier()` also works for other resource types: `R.color.*`, `R.string.*`, `R.drawable.*`, etc.
389
+ `getIdentifier()` also works for other resource types: `R.color.*`, `R.string.*`, `R.drawable.*`, and others.
390
390
 
391
- ## 12. Android: Third-Party Libraries
391
+ ## 12. Android: third-party libraries
392
392
 
393
- ### AndroidX Requirement
393
+ ### AndroidX requirement
394
394
 
395
- As of Titanium SDK 9.0.0, you must use **AndroidX** libraries. Google's deprecated Support libraries (`android.support.*`) are no longer supported.
395
+ As of Titanium SDK 9.0.0, you must use AndroidX libraries. The deprecated Support libraries (`android.support.*`) are not supported.
396
396
 
397
- ### Gradle Dependencies (Preferred)
397
+ ### Gradle dependencies (preferred)
398
398
 
399
399
  Add a `build.gradle` file to `app/platform/android/` (Alloy) or `platform/android/` (Classic):
400
400
 
@@ -404,13 +404,13 @@ dependencies {
404
404
  }
405
405
  ```
406
406
 
407
- ### Local JAR/AAR Dependencies
407
+ ### Local JAR/AAR dependencies
408
408
 
409
- Place JAR and AAR files directly in `app/platform/android/` (Alloy) or `platform/android/` (Classic). Hyperloop will automatically:
409
+ Place JAR and AAR files directly in `app/platform/android/` (Alloy) or `platform/android/` (Classic). Hyperloop will:
410
410
  - Load Java classes and generate bindings
411
- - For AARs: extract resources, assets, `*.so` libraries, and merge `AndroidManifest.xml`
411
+ - For AARs, extract resources, assets, `*.so` libraries, and merge `AndroidManifest.xml`
412
412
 
413
- ### Third-Party Library Example
413
+ ### Third-party library example
414
414
 
415
415
  ```javascript
416
416
  // After adding the AAR to app/platform/android/
@@ -436,20 +436,20 @@ $.myView.add(parkedView);
436
436
 
437
437
  ## 13. Debugging Hyperloop
438
438
 
439
- - **iOS**: Use **Safari Web Inspector** to debug Hyperloop code up to the native transition point
440
- - **Android**: Use **Chrome DevTools** for JavaScript debugging
441
- - Breakpoints may not hit correctly in all cases because Hyperloop modifies source files during the build process
439
+ - iOS: use Safari Web Inspector to debug Hyperloop code up to the native transition point
440
+ - Android: use Chrome DevTools for JavaScript debugging
441
+ - Breakpoints may not hit correctly because Hyperloop modifies source files during the build process
442
442
  - No source maps are available for processed Alloy controllers
443
443
 
444
- ## 14. Performance Tips
444
+ ## 14. Performance tips
445
445
 
446
- - Do NOT use Hyperloop for things Titanium already does well
447
- - Use it for specialized APIs: custom UI components, hardware access not covered by modules, or native third-party library integration
448
- - Existing Titanium modules (Java for Android, Objective-C for iOS) continue to be fully supported alongside Hyperloop
446
+ - Do not use Hyperloop for things Titanium already does well.
447
+ - Use it for specialized APIs: custom UI components, hardware access not covered by modules, or native third-party library integration.
448
+ - Existing Titanium modules (Java for Android, Objective-C for iOS) continue to be supported alongside Hyperloop.
449
449
 
450
- ## 15. Sample Projects
450
+ ## 15. Sample projects
451
451
 
452
- The official cross-platform example app demonstrates native APIs for iOS and Android, including CocoaPods, Android AAR packages, UICollectionView, Beacons, BottomNavigationView, native XML layouts, Storyboards, XIBs, and more:
452
+ The cross-platform example app demonstrates native APIs for iOS and Android, including CocoaPods, Android AAR packages, UICollectionView, Beacons, BottomNavigationView, native XML layouts, Storyboards, XIBs, and more.
453
453
 
454
- - **Repository**: `https://github.com/tidev/hyperloop-examples`
455
- - **Community modules**: `https://github.com/hyperloop-modules` -- JavaScript wrappers around native APIs (Speech, Mapbox, Snackbar, etc.)
454
+ - Repository: https://github.com/tidev/hyperloop-examples
455
+ - Community modules: https://github.com/hyperloop-modules (JavaScript wrappers around native APIs such as Speech, Mapbox, Snackbar)