@maccesar/titools 2.0.7 → 2.2.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.
- package/{AGENTS-TEMPLATE.md → AGENTS-VERCEL-RESEARCH.md} +16 -18
- package/README.md +250 -168
- package/agents/{ti-researcher.md → ti-pro.md} +10 -10
- package/bin/titools.js +16 -12
- package/lib/cleanup.js +95 -0
- package/lib/commands/agents.js +146 -70
- package/lib/commands/skills.js +349 -0
- package/lib/commands/uninstall.js +189 -154
- package/lib/commands/update.js +104 -21
- package/lib/config.js +26 -20
- package/lib/downloader.js +1 -1
- package/lib/installer.js +37 -97
- package/lib/platform.js +9 -5
- package/lib/prompts/checkboxCancel.js +264 -0
- package/lib/prompts/selectCancel.js +204 -0
- package/lib/symlink.js +19 -7
- package/lib/utils.js +17 -17
- package/package.json +10 -10
- package/skills/alloy-guides/SKILL.md +8 -30
- package/skills/alloy-guides/references/CLI_TASKS.md +14 -24
- package/skills/alloy-guides/references/CONCEPTS.md +5 -25
- package/skills/alloy-guides/references/CONTROLLERS.md +2 -19
- package/skills/alloy-guides/references/MODELS.md +40 -10
- package/skills/alloy-guides/references/PURGETSS.md +1 -11
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +8 -14
- package/skills/alloy-guides/references/VIEWS_STYLES.md +14 -25
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +2 -8
- package/skills/alloy-guides/references/VIEWS_XML.md +29 -40
- package/skills/alloy-guides/references/WIDGETS.md +1 -17
- package/skills/alloy-howtos/SKILL.md +1 -22
- package/skills/alloy-howtos/references/best_practices.md +0 -17
- package/skills/alloy-howtos/references/cli_reference.md +1 -23
- package/skills/alloy-howtos/references/config_files.md +86 -15
- package/skills/alloy-howtos/references/custom_tags.md +14 -13
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +3 -22
- package/skills/alloy-howtos/references/samples.md +4 -14
- package/skills/purgetss/SKILL.md +11 -37
- package/skills/purgetss/references/EXAMPLES.md +106 -17
- package/skills/purgetss/references/animation-system.md +0 -67
- package/skills/purgetss/references/apply-directive.md +0 -18
- package/skills/purgetss/references/arbitrary-values.md +0 -25
- package/skills/purgetss/references/class-index.md +0 -46
- package/skills/purgetss/references/cli-commands.md +0 -41
- package/skills/purgetss/references/configurable-properties.md +0 -55
- package/skills/purgetss/references/custom-rules.md +0 -14
- package/skills/purgetss/references/customization-deep-dive.md +0 -49
- package/skills/purgetss/references/dynamic-component-creation.md +56 -37
- package/skills/purgetss/references/grid-layout.md +0 -32
- package/skills/purgetss/references/icon-fonts.md +0 -50
- package/skills/purgetss/references/installation-setup.md +61 -32
- package/skills/purgetss/references/migration-guide.md +127 -0
- package/skills/purgetss/references/opacity-modifier.md +0 -34
- package/skills/purgetss/references/performance-tips.md +261 -0
- package/skills/purgetss/references/platform-modifiers.md +0 -46
- package/skills/purgetss/references/smart-mappings.md +0 -12
- package/skills/purgetss/references/tikit-components.md +393 -0
- package/skills/purgetss/references/titanium-resets.md +1 -27
- package/skills/purgetss/references/ui-ux-design.md +467 -117
- package/skills/{alloy-expert → ti-expert}/SKILL.md +45 -54
- package/skills/ti-expert/references/alloy-builtins.md +387 -0
- package/skills/{alloy-expert → ti-expert}/references/alloy-structure.md +147 -40
- package/skills/ti-expert/references/anti-patterns.md +90 -0
- package/skills/ti-expert/references/cli-expert.md +109 -0
- package/skills/{alloy-expert → ti-expert}/references/code-conventions.md +182 -49
- package/skills/{alloy-expert → ti-expert}/references/controller-patterns.md +103 -93
- package/skills/{alloy-expert → ti-expert}/references/error-handling.md +12 -12
- package/skills/{alloy-expert → ti-expert}/references/examples.md +144 -85
- package/skills/{alloy-expert → ti-expert}/references/migration-patterns.md +38 -36
- package/skills/{alloy-expert → ti-expert}/references/patterns.md +8 -8
- package/skills/ti-expert/references/performance-listview.md +251 -0
- package/skills/{alloy-expert/references/performance-patterns.md → ti-expert/references/performance-optimization.md} +67 -283
- package/skills/{alloy-expert/references/security-patterns.md → ti-expert/references/security-device.md} +12 -295
- package/skills/ti-expert/references/security-fundamentals.md +284 -0
- package/skills/{alloy-expert → ti-expert}/references/state-management.md +10 -10
- package/skills/ti-expert/references/testing-e2e-ci.md +432 -0
- package/skills/ti-expert/references/testing-unit.md +433 -0
- package/skills/ti-expert/references/theming.md +394 -0
- package/skills/ti-guides/SKILL.md +1 -14
- package/skills/ti-guides/references/advanced-data-and-images.md +126 -10
- package/skills/ti-guides/references/app-distribution.md +48 -10
- package/skills/ti-guides/references/application-frameworks.md +9 -2
- package/skills/ti-guides/references/cli-reference.md +338 -82
- package/skills/ti-guides/references/coding-best-practices.md +14 -4
- package/skills/ti-guides/references/commonjs-advanced.md +103 -6
- package/skills/ti-guides/references/hello-world.md +5 -2
- package/skills/ti-guides/references/hyperloop-native-access.md +439 -46
- package/skills/ti-guides/references/javascript-primer.md +4 -3
- package/skills/ti-guides/references/resources.md +0 -1
- package/skills/ti-guides/references/style-and-conventions.md +57 -9
- package/skills/ti-guides/references/tiapp-config.md +48 -6
- package/skills/ti-howtos/SKILL.md +2 -27
- package/skills/ti-howtos/references/android-platform-deep-dives.md +41 -90
- package/skills/ti-howtos/references/automation-fastlane-appium.md +15 -14
- package/skills/ti-howtos/references/buffer-codec-streams.md +22 -22
- package/skills/ti-howtos/references/cross-platform-development.md +68 -37
- package/skills/ti-howtos/references/debugging-profiling.md +8 -53
- package/skills/ti-howtos/references/extending-titanium.md +12 -51
- package/skills/ti-howtos/references/google-maps-v2.md +30 -29
- package/skills/ti-howtos/references/ios-map-kit.md +19 -25
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +95 -283
- package/skills/ti-howtos/references/local-data-sources.md +45 -37
- package/skills/ti-howtos/references/location-and-maps.md +47 -28
- package/skills/ti-howtos/references/media-apis.md +84 -27
- package/skills/ti-howtos/references/notification-services.md +40 -89
- package/skills/ti-howtos/references/remote-data-sources.md +21 -36
- package/skills/ti-howtos/references/tutorials.md +79 -39
- package/skills/ti-howtos/references/using-modules.md +4 -30
- package/skills/ti-howtos/references/web-content-integration.md +28 -45
- package/skills/ti-howtos/references/webpack-build-pipeline.md +54 -18
- package/skills/ti-ui/SKILL.md +1 -21
- package/skills/ti-ui/references/accessibility-deep-dive.md +71 -25
- package/skills/ti-ui/references/animation-and-matrices.md +0 -47
- package/skills/ti-ui/references/application-structures.md +0 -46
- package/skills/ti-ui/references/custom-fonts-styling.md +9 -57
- package/skills/ti-ui/references/event-handling.md +32 -40
- package/skills/ti-ui/references/gestures.md +0 -40
- package/skills/ti-ui/references/icons-and-splash-screens.md +21 -44
- package/skills/ti-ui/references/layouts-and-positioning.md +47 -39
- package/skills/ti-ui/references/listviews-and-performance.md +187 -73
- package/skills/ti-ui/references/orientation.md +57 -71
- package/skills/ti-ui/references/platform-ui-android.md +114 -48
- package/skills/ti-ui/references/platform-ui-ios.md +63 -38
- package/skills/ti-ui/references/scrolling-views.md +14 -23
- package/skills/ti-ui/references/tableviews.md +6 -56
- package/lib/commands/install.js +0 -188
- package/skills/alloy-expert/references/anti-patterns.md +0 -133
- package/skills/alloy-expert/references/testing.md +0 -872
- package/skills/ti-guides/references/alloy-cli-advanced.md +0 -84
- package/skills/ti-guides/references/alloy-data-mastery.md +0 -29
- package/skills/ti-guides/references/alloy-widgets-and-themes.md +0 -19
- /package/skills/{alloy-expert → ti-expert}/assets/ControllerAutoCleanup.js +0 -0
- /package/skills/{alloy-expert → ti-expert}/references/contracts.md +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Framework options and architectural patterns for Titanium applications.
|
|
4
4
|
|
|
5
|
-
## Table of Contents
|
|
6
5
|
1. [Alloy Framework](#alloy-framework)
|
|
7
6
|
2. [Classic Titanium](#classic-titanium)
|
|
8
7
|
3. [Choosing a Framework](#choosing-a-framework)
|
|
@@ -12,7 +11,7 @@ Framework options and architectural patterns for Titanium applications.
|
|
|
12
11
|
|
|
13
12
|
## Alloy Framework
|
|
14
13
|
|
|
15
|
-
**Alloy** is the official MVC framework for Titanium, developed by TiDev.
|
|
14
|
+
**Alloy** is the official MVC framework for Titanium, originally developed by Appcelerator and now maintained by TiDev.
|
|
16
15
|
|
|
17
16
|
### What is Alloy?
|
|
18
17
|
|
|
@@ -79,6 +78,14 @@ $.index.open();
|
|
|
79
78
|
- **Alloy Data:** See `alloy-data-mastery.md`
|
|
80
79
|
- **Alloy Widgets:** See `alloy-widgets-and-themes.md`
|
|
81
80
|
|
|
81
|
+
### Angular Integration
|
|
82
|
+
|
|
83
|
+
Angular integration with Titanium SDK was under development but is no longer actively maintained.
|
|
84
|
+
|
|
85
|
+
### React Community Framework
|
|
86
|
+
|
|
87
|
+
A community-based React integration exists at https://github.com/nicolomonili/react-titanium (experimental).
|
|
88
|
+
|
|
82
89
|
### When to Use Alloy
|
|
83
90
|
|
|
84
91
|
✅ **Use Alloy for:**
|
|
@@ -12,6 +12,15 @@ ti setup check
|
|
|
12
12
|
|
|
13
13
|
Reports configured tools and potential issues.
|
|
14
14
|
|
|
15
|
+
### Setup Wizard
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
ti setup
|
|
19
|
+
ti setup <section>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Runs the interactive setup wizard. The `<section>` can be one of: **quick**, **check**, **user**, **app**, **network**, **cli**, **sdk**, **ios**, **android**, and **paths**.
|
|
23
|
+
|
|
15
24
|
### Get System Info
|
|
16
25
|
|
|
17
26
|
```bash
|
|
@@ -25,6 +34,24 @@ ti info -p android # Android-specific info
|
|
|
25
34
|
ti info -p ios # iOS-specific info
|
|
26
35
|
```
|
|
27
36
|
|
|
37
|
+
#### Info Options
|
|
38
|
+
|
|
39
|
+
| Option | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `-o, --output <value>` | Output format: **report** or **json**. Defaults to **report**. |
|
|
42
|
+
| `-t, --types <value>` | Comma-separated list of types: **all**, **os**, **nodejs**, **titanium**, **ios**, **jdk**, **haxm**, **android**. Defaults to **all**. |
|
|
43
|
+
|
|
44
|
+
### Help
|
|
45
|
+
|
|
46
|
+
Displays the help screen for the CLI or a specific command.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ti help
|
|
50
|
+
ti help <command>
|
|
51
|
+
ti --help
|
|
52
|
+
ti <command> --help
|
|
53
|
+
```
|
|
54
|
+
|
|
28
55
|
### Configure CLI
|
|
29
56
|
|
|
30
57
|
```bash
|
|
@@ -41,6 +68,14 @@ ti config -a paths.hooks "/path/to/hook"
|
|
|
41
68
|
ti config -r android
|
|
42
69
|
```
|
|
43
70
|
|
|
71
|
+
#### Config Options
|
|
72
|
+
|
|
73
|
+
| Option | Description |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `-a, --append` | Append a value to a key containing a list of values. |
|
|
76
|
+
| `-r, --remove` | Remove the specified config key and all its descendants. |
|
|
77
|
+
| `-o, --output <value>` | Output format: **report**, **json**, or **json-object**. Defaults to **report**. |
|
|
78
|
+
|
|
44
79
|
**Alternative methods:**
|
|
45
80
|
```bash
|
|
46
81
|
# Pass JSON string
|
|
@@ -73,12 +108,15 @@ ti create -t app --id <APP_ID> -n <APP_NAME> -p <PLATFORMS> -d <WORKSPACE> -u <U
|
|
|
73
108
|
|
|
74
109
|
**Parameters:**
|
|
75
110
|
- `--alloy`: Create an Alloy project (recommended for new projects)
|
|
76
|
-
- `-t, --type`: Project type (
|
|
111
|
+
- `-t, --type`: Project type: **app** (default), **applewatch**, **module** (or **timodule**)
|
|
77
112
|
- `--id`: App ID (reverse domain notation)
|
|
78
113
|
- `-n, --name`: App name
|
|
79
114
|
- `-p, --platforms`: Comma-separated platforms (`android`, `ios`, `ipad`, `iphone`)
|
|
80
|
-
- `-d, --dir`: Workspace directory
|
|
115
|
+
- `-d, --workspace-dir`: Workspace directory
|
|
81
116
|
- `-u, --url`: App URL
|
|
117
|
+
- `-f, --force`: Force creation even if the path already exists
|
|
118
|
+
- `--template`: Project template to use (name, directory, ZIP file, or remote ZIP URL)
|
|
119
|
+
- `-s, --sdk`: Titanium SDK version to use
|
|
82
120
|
|
|
83
121
|
> **Note:** Always use the `--alloy` flag when creating new projects. The Alloy framework provides MVC structure, data binding, and modern development patterns. Use Classic (`--classic` or omitting `--alloy`) only when maintaining legacy projects.
|
|
84
122
|
|
|
@@ -88,10 +126,54 @@ ti create -t app --id <APP_ID> -n <APP_NAME> -p <PLATFORMS> -d <WORKSPACE> -u <U
|
|
|
88
126
|
ti build -p <PLATFORM> [OPTIONS]
|
|
89
127
|
```
|
|
90
128
|
|
|
129
|
+
### Project Management
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
ti project [OPTIONS] [<key>] [<value>]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Gets and sets `tiapp.xml` settings. When called with a key, returns the value. When called with a key and value, sets the value in `tiapp.xml`.
|
|
136
|
+
|
|
137
|
+
It also allows you to set the deployment-targets using a comma-separated list of platforms. If a specific platform is being enabled for the first time, it will also non-destructively copy that platform's default resources into your project's Resources folder.
|
|
138
|
+
|
|
139
|
+
**Examples:**
|
|
140
|
+
```bash
|
|
141
|
+
# Get a tiapp.xml value
|
|
142
|
+
ti project sdk-version
|
|
143
|
+
|
|
144
|
+
# Set a tiapp.xml value
|
|
145
|
+
ti project sdk-version 12.2.0.GA
|
|
146
|
+
|
|
147
|
+
# Set deployment targets (must list all desired platforms)
|
|
148
|
+
ti project deployment-targets iphone,ipad,android
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Tasks:**
|
|
152
|
+
- `scan`: Scan directory for Titanium projects.
|
|
153
|
+
|
|
154
|
+
**Options:**
|
|
155
|
+
|
|
156
|
+
| Option | Description |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| `-o, --output <value>` | Output format: **report**, **json**, or **text**. Defaults to **report**. |
|
|
159
|
+
| `--project-dir <directory>` | Directory containing the project. Defaults to current working directory. |
|
|
160
|
+
|
|
91
161
|
---
|
|
92
162
|
|
|
93
163
|
## Build Commands
|
|
94
164
|
|
|
165
|
+
### Generic Build Options and Flags
|
|
166
|
+
|
|
167
|
+
| Option | Description |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `-b, --build-only` | Only perform the build; does not install or run the app. |
|
|
170
|
+
| `-f, --force` | Force a clean rebuild. |
|
|
171
|
+
| `--skip-js-minify` | Bypass JavaScript minification. Simulator builds are never minified. Only supported for Android and iOS. |
|
|
172
|
+
| `--log-level <level>` | Minimum logging level: **trace**, **debug**, **info**, **warn**, **error**. |
|
|
173
|
+
| `-p, --platforms <platform>` | Target build platform: **android** or **ios** (**iphone** and **ipad** are accepted as synonyms for **ios**). |
|
|
174
|
+
| `-d, --project-dir <directory>` | Directory containing the project. Defaults to current working directory. |
|
|
175
|
+
| `-s, --sdk <version>` | Titanium SDK version to build with. |
|
|
176
|
+
|
|
95
177
|
### Android Emulator
|
|
96
178
|
|
|
97
179
|
```bash
|
|
@@ -118,6 +200,23 @@ ti build -p android -T device -C deadbeef
|
|
|
118
200
|
|
|
119
201
|
Omit `-C` if only one device connected.
|
|
120
202
|
|
|
203
|
+
### Android Build Options
|
|
204
|
+
|
|
205
|
+
| Option | Description |
|
|
206
|
+
| --- | --- |
|
|
207
|
+
| `-A, --android-sdk <path>` | Path to the Android SDK. |
|
|
208
|
+
| `-C, --device-id <name>` | Name of the device or emulator. Use "all" with --target "device" to install on all connected devices. |
|
|
209
|
+
| `-D, --deploy-type <type>` | Controls optimization, encryption, analytics: **development**, **test**, **production**. |
|
|
210
|
+
| `-K, --keystore <path>` | Location of the keystore file. |
|
|
211
|
+
| `--key-password <keypass>` | Password of the keystore private key. Defaults to --store-password value. |
|
|
212
|
+
| `--liveview` | Start a LiveView session for live UI previews. |
|
|
213
|
+
| `-L, --alias <alias>` | Alias for the keystore. |
|
|
214
|
+
| `--no-launch` | Disable launching the app after installing. |
|
|
215
|
+
| `-O, --output-dir <dir>` | Output directory (used when target is **dist-playstore**). |
|
|
216
|
+
| `-P, --store-password <password>` | Password for the keystore. |
|
|
217
|
+
| `--sigalg <algorithm>` | Digital signature algorithm: **MD5withRSA**, **SHA1withRSA**, **SHA256withRSA**. |
|
|
218
|
+
| `-T, --target <value>` | Target: **emulator**, **device**, or **dist-playstore**. |
|
|
219
|
+
|
|
121
220
|
### iOS Simulator
|
|
122
221
|
|
|
123
222
|
```bash
|
|
@@ -142,6 +241,29 @@ ti build -p ios -T device -C itunes -V "Loretta Martin (GE7BAC5)" -P "11111111-2
|
|
|
142
241
|
|
|
143
242
|
Omit `-V` and `-P` to be prompted.
|
|
144
243
|
|
|
244
|
+
### iOS Build Options
|
|
245
|
+
|
|
246
|
+
| Option | Description |
|
|
247
|
+
| --- | --- |
|
|
248
|
+
| `-C, --device-id <name>` | Name of the device or simulator. Use "all" with --target "device" to install on all connected devices. |
|
|
249
|
+
| `-D, --deploy-type <type>` | Controls optimization, encryption, analytics: **development**, **test**, **production**. |
|
|
250
|
+
| `-F, --device-family <value>` | Device family: **iphone**, **ipad**, or **universal** (default). |
|
|
251
|
+
| `--force-copy` | Force files to be copied instead of symlinked (simulator builds only). |
|
|
252
|
+
| `-I, --ios-version <value>` | iOS SDK version to build for. Default: latest installed. |
|
|
253
|
+
| `-K, --keychain <value>` | Path to distribution keychain (for device/dist targets). |
|
|
254
|
+
| `--launch-bundle-id <id>` | After installing in simulator, launch a different app (useful for test runners). |
|
|
255
|
+
| `--launch-watch-app` | Launch both the watch app and main app (simulator only). |
|
|
256
|
+
| `--launch-watch-app-only` | Launch only the watch app (simulator only). |
|
|
257
|
+
| `-O, --output-dir <dir>` | Output directory (used when target is **dist-adhoc**). |
|
|
258
|
+
| `-P, --pp-uuid <uuid>` | Provisioning profile UUID (for device/dist targets). |
|
|
259
|
+
| `-R, --distribution-name <name>` | iOS Distribution Certificate (for dist targets). |
|
|
260
|
+
| `--sim-focus` | Focus the iOS Simulator after launching (default: true). Use --no-sim-focus to disable. |
|
|
261
|
+
| `-T, --target <value>` | Target: **simulator**, **device**, **dist-appstore**, or **dist-adhoc**. |
|
|
262
|
+
| `-V, --developer-name <name>` | iOS Developer Certificate (required for device target). |
|
|
263
|
+
| `-W, --watch-device-id <udid>` | Watch simulator UDID (simulator only). |
|
|
264
|
+
| `--watch-app-name <name>` | Name of the watch app to launch (simulator only). |
|
|
265
|
+
| `-Y, --sim-type <type>` | iOS Simulator type: **iphone** or **ipad** (simulator only). |
|
|
266
|
+
|
|
145
267
|
### Clean Build
|
|
146
268
|
|
|
147
269
|
```bash
|
|
@@ -154,6 +276,15 @@ ti clean # All platforms
|
|
|
154
276
|
ti clean -p ios # iOS only
|
|
155
277
|
```
|
|
156
278
|
|
|
279
|
+
#### Clean Options
|
|
280
|
+
|
|
281
|
+
| Option | Description |
|
|
282
|
+
| --- | --- |
|
|
283
|
+
| `-p, --platforms <platform>` | A single platform to clean: **android** or **ios**. |
|
|
284
|
+
| `-d, --project-dir <directory>` | Directory containing the project. Defaults to current working directory. |
|
|
285
|
+
| `-s, --sdk <version>` | Titanium SDK version. |
|
|
286
|
+
| `--log-level <level>` | Minimum logging level: **trace**, **debug**, **info**, **warn**, **error**. |
|
|
287
|
+
|
|
157
288
|
### Module Management
|
|
158
289
|
|
|
159
290
|
```bash
|
|
@@ -162,15 +293,62 @@ ti module [TASK] [OPTIONS]
|
|
|
162
293
|
|
|
163
294
|
**Tasks:**
|
|
164
295
|
- `create`: Create a new Titanium module.
|
|
296
|
+
- `list`: List installed Titanium modules.
|
|
165
297
|
|
|
166
|
-
|
|
298
|
+
#### Module Create
|
|
167
299
|
|
|
168
300
|
```bash
|
|
169
|
-
ti
|
|
301
|
+
ti create -t module --id <MODULE_ID> -n <MODULE_NAME> -p <PLATFORMS> -d <WORKSPACE>
|
|
170
302
|
```
|
|
171
303
|
|
|
172
|
-
**
|
|
173
|
-
-
|
|
304
|
+
**Parameters:**
|
|
305
|
+
- `-t, --type`: Set to **module** (or **timodule**)
|
|
306
|
+
- `--id`: Module ID (reverse domain notation)
|
|
307
|
+
- `-n, --name`: Module name
|
|
308
|
+
- `-p, --platforms`: Target platforms
|
|
309
|
+
- `-d, --workspace-dir`: Workspace directory
|
|
310
|
+
- `-f, --force`: Force creation even if path already exists
|
|
311
|
+
- `--template`: Module template to use
|
|
312
|
+
|
|
313
|
+
#### Module List
|
|
314
|
+
|
|
315
|
+
Prints a list of installed modules.
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
ti module
|
|
319
|
+
ti module list
|
|
320
|
+
ti module list --project-dir /path/to/project
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Options:**
|
|
324
|
+
|
|
325
|
+
| Option | Description |
|
|
326
|
+
| --- | --- |
|
|
327
|
+
| `-o, --output <value>` | Output format: **report**, **json**, or **grid**. Defaults to **report**. |
|
|
328
|
+
| `--project-dir <value>` | Directory of the project to analyze. Defaults to current working directory. |
|
|
329
|
+
|
|
330
|
+
### Plugin Management
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
ti plugin [TASK] [OPTIONS]
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### Plugin List
|
|
337
|
+
|
|
338
|
+
Prints a list of installed plugins.
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
ti plugin
|
|
342
|
+
ti plugin list
|
|
343
|
+
ti plugin list --project-dir /path/to/project
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Options:**
|
|
347
|
+
|
|
348
|
+
| Option | Description |
|
|
349
|
+
| --- | --- |
|
|
350
|
+
| `-o, --output <value>` | Output format: **report**, **json**, or **grid**. Defaults to **report**. |
|
|
351
|
+
| `--project-dir <value>` | Directory of the project to analyze. Defaults to current working directory. |
|
|
174
352
|
|
|
175
353
|
---
|
|
176
354
|
|
|
@@ -226,13 +404,71 @@ Installs package to Xcode Organizer.
|
|
|
226
404
|
ti sdk list
|
|
227
405
|
```
|
|
228
406
|
|
|
407
|
+
**Options:**
|
|
408
|
+
|
|
409
|
+
| Option | Description |
|
|
410
|
+
| --- | --- |
|
|
411
|
+
| `-b, --branches` | Retrieve and print all branches. |
|
|
412
|
+
| `-r, --releases` | Retrieve and print all releases. |
|
|
413
|
+
| `-o, --output <value>` | Output format: **report** or **json**. Defaults to **report**. |
|
|
414
|
+
|
|
229
415
|
### Select SDK
|
|
230
416
|
|
|
231
417
|
```bash
|
|
232
|
-
ti sdk select
|
|
418
|
+
ti sdk select [<version>]
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Interactive selection of default SDK. This sets the SDK used to run CLI commands. If the `tiapp.xml` file does not contain an SDK version and the `app.sdk` setting is not set, the application will be built with this SDK.
|
|
422
|
+
|
|
423
|
+
### Install SDK
|
|
424
|
+
|
|
425
|
+
Downloads the latest Titanium SDK or a specific version.
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
ti sdk install [<version>] [--default] [--force] [--branch <branch_name>]
|
|
233
429
|
```
|
|
234
430
|
|
|
235
|
-
|
|
431
|
+
`<version>` may be a specific version number (e.g. `12.2.0.GA`), a URL to a ZIP file, or a local ZIP file path.
|
|
432
|
+
|
|
433
|
+
**Options:**
|
|
434
|
+
|
|
435
|
+
| Option | Description |
|
|
436
|
+
| --- | --- |
|
|
437
|
+
| `-d, --default` | Set as the default SDK. |
|
|
438
|
+
| `-f, --force` | Force reinstallation. |
|
|
439
|
+
| `-k, --keep-files` | Keep downloaded files after install. |
|
|
440
|
+
| `-b, --branch <branch_name>` | Branch to install from, or "latest". |
|
|
441
|
+
|
|
442
|
+
### Uninstall SDK
|
|
443
|
+
|
|
444
|
+
Uninstalls a specific Titanium SDK version.
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
ti sdk uninstall [<version>] [--force]
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Options:**
|
|
451
|
+
|
|
452
|
+
| Option | Description |
|
|
453
|
+
| --- | --- |
|
|
454
|
+
| `-f, --force` | Force uninstallation without confirmation. |
|
|
455
|
+
|
|
456
|
+
### Update SDK
|
|
457
|
+
|
|
458
|
+
Finds the latest version of the Titanium SDK and optionally installs it.
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
ti sdk update [--default] [--force] [--install] [--branch <branch_name>]
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**Options:**
|
|
465
|
+
|
|
466
|
+
| Option | Description |
|
|
467
|
+
| --- | --- |
|
|
468
|
+
| `-d, --default` | Set as the default SDK. |
|
|
469
|
+
| `-f, --force` | Force reinstallation. |
|
|
470
|
+
| `-i, --install` | Install the latest version. |
|
|
471
|
+
| `-b, --branch <branch_name>` | Branch to update from. |
|
|
236
472
|
|
|
237
473
|
---
|
|
238
474
|
|
|
@@ -240,93 +476,96 @@ Interactive selection of default SDK.
|
|
|
240
476
|
|
|
241
477
|
### Android Options
|
|
242
478
|
|
|
243
|
-
| Option
|
|
244
|
-
|
|
|
245
|
-
| `android.sdkPath`
|
|
246
|
-
| `android.ndkPath`
|
|
247
|
-
| `android.adb.port`
|
|
248
|
-
| `android.autoSelectDevice`
|
|
249
|
-
| `android.symlinkResources`
|
|
250
|
-
| `android.buildTools.selectedVersion` | max
|
|
251
|
-
| `android.javac.maxmemory`
|
|
252
|
-
| `android.javac.source`
|
|
253
|
-
| `android.javac.target`
|
|
254
|
-
| `android.mergeCustomAndroidManifest` | false
|
|
479
|
+
| Option | Default | Description |
|
|
480
|
+
| --- | --- | --- |
|
|
481
|
+
| `android.sdkPath` | auto | Android SDK path |
|
|
482
|
+
| `android.ndkPath` | auto | Android NDK path |
|
|
483
|
+
| `android.adb.port` | 5037 | ADB port number |
|
|
484
|
+
| `android.autoSelectDevice` | true | Auto-select device/emulator |
|
|
485
|
+
| `android.symlinkResources` | true (OS X) | Symlink vs copy resources |
|
|
486
|
+
| `android.buildTools.selectedVersion` | max | Build tools version |
|
|
487
|
+
| `android.javac.maxmemory` | "3072M" | JVM heap size |
|
|
488
|
+
| `android.javac.source` | "1.8" | Java source version |
|
|
489
|
+
| `android.javac.target` | "1.8" | Java target version |
|
|
490
|
+
| `android.mergeCustomAndroidManifest` | false | Merge custom AndroidManifest.xml |
|
|
491
|
+
|
|
492
|
+
> **Note:** The `android.javac.source` and `android.javac.target` defaults were originally "1.6" in earlier SDK versions. Modern Titanium SDK requires Java 1.8 or higher. These can be overridden per-project in `tiapp.xml` using `<property name="android.javac.source" type="string">1.8</property>`.
|
|
255
493
|
|
|
256
494
|
### iOS Options
|
|
257
495
|
|
|
258
|
-
| Option
|
|
259
|
-
|
|
|
260
|
-
| `ios.developerName`
|
|
261
|
-
| `ios.distributionName` | -
|
|
262
|
-
| `ios.autoSelectDevice` | true
|
|
263
|
-
| `ios.symlinkResources` | true (OS X) | Symlink vs copy resources
|
|
264
|
-
| `ios.keychain`
|
|
265
|
-
| `ios.xcodePath`
|
|
496
|
+
| Option | Default | Description |
|
|
497
|
+
| --- | --- | --- |
|
|
498
|
+
| `ios.developerName` | - | Developer certificate name |
|
|
499
|
+
| `ios.distributionName` | - | Distribution certificate name |
|
|
500
|
+
| `ios.autoSelectDevice` | true | Auto-select device/simulator |
|
|
501
|
+
| `ios.symlinkResources` | true (OS X) | Symlink vs copy resources |
|
|
502
|
+
| `ios.keychain` | - | Specific keychain to search for certs |
|
|
503
|
+
| `ios.xcodePath` | auto | Path to Xcode installation |
|
|
266
504
|
|
|
267
505
|
### CLI Options
|
|
268
506
|
|
|
269
|
-
| Option
|
|
270
|
-
|
|
|
271
|
-
| `cli.logLevel`
|
|
272
|
-
| `cli.colors`
|
|
273
|
-
| `cli.progressBars`
|
|
274
|
-
| `cli.prompt`
|
|
275
|
-
| `cli.quiet`
|
|
276
|
-
| `cli.rejectUnauthorized` | true
|
|
277
|
-
| `cli.width`
|
|
278
|
-
| `cli.failOnWrongSDK`
|
|
279
|
-
| `cli.hideCharEncWarning` | false
|
|
280
|
-
| `cli.httpProxyServer`
|
|
507
|
+
| Option | Default | Description |
|
|
508
|
+
| --- | --- | --- |
|
|
509
|
+
| `cli.logLevel` | trace | Log level: error, warning, info, debug, trace |
|
|
510
|
+
| `cli.colors` | true | Color output |
|
|
511
|
+
| `cli.progressBars` | true | Show progress bars |
|
|
512
|
+
| `cli.prompt` | true | Prompt for missing info |
|
|
513
|
+
| `cli.quiet` | false | Suppress all output |
|
|
514
|
+
| `cli.rejectUnauthorized` | true | Reject bad SSL certs |
|
|
515
|
+
| `cli.width` | 100 | Text wrap width |
|
|
516
|
+
| `cli.failOnWrongSDK` | false | Fail on SDK mismatch |
|
|
517
|
+
| `cli.hideCharEncWarning` | false | Hide encoding warnings |
|
|
518
|
+
| `cli.httpProxyServer` | - | Proxy server URL |
|
|
281
519
|
|
|
282
520
|
### SDK Options
|
|
283
521
|
|
|
284
|
-
| Option
|
|
285
|
-
|
|
|
522
|
+
| Option | Description |
|
|
523
|
+
| --- | --- |
|
|
286
524
|
| `sdk.defaultInstallLocation` | SDK install location (OS-specific) |
|
|
287
|
-
| `sdk.selected`
|
|
525
|
+
| `sdk.selected` | Selected SDK version (REQUIRED) |
|
|
288
526
|
|
|
289
527
|
### Paths
|
|
290
528
|
|
|
291
|
-
| Option
|
|
292
|
-
|
|
|
529
|
+
| Option | Description |
|
|
530
|
+
| --- | --- |
|
|
293
531
|
| `paths.commands` | Additional CLI command scripts |
|
|
294
|
-
| `paths.hooks`
|
|
295
|
-
| `paths.modules`
|
|
296
|
-
| `paths.plugins`
|
|
297
|
-
| `paths.sdks`
|
|
298
|
-
| `paths.xcode`
|
|
532
|
+
| `paths.hooks` | CLI hook scripts |
|
|
533
|
+
| `paths.modules` | Module search paths |
|
|
534
|
+
| `paths.plugins` | Plugin search paths |
|
|
535
|
+
| `paths.sdks` | SDK search paths |
|
|
536
|
+
| `paths.xcode` | Xcode installation paths |
|
|
299
537
|
|
|
300
538
|
### Java Options
|
|
301
539
|
|
|
302
|
-
| Option
|
|
303
|
-
|
|
|
304
|
-
| `java.home`
|
|
305
|
-
| `java.executables.java`
|
|
306
|
-
| `java.executables.javac`
|
|
540
|
+
| Option | Description |
|
|
541
|
+
| --- | --- |
|
|
542
|
+
| `java.home` | JDK directory |
|
|
543
|
+
| `java.executables.java` | java executable path |
|
|
544
|
+
| `java.executables.javac` | javac executable path |
|
|
307
545
|
| `java.executables.jarsigner` | jarsigner executable path |
|
|
308
|
-
| `java.executables.keytool`
|
|
546
|
+
| `java.executables.keytool` | keytool executable path |
|
|
309
547
|
|
|
310
548
|
### Genymotion Options
|
|
311
549
|
|
|
312
|
-
| Option
|
|
313
|
-
|
|
|
314
|
-
| `genymotion.enabled`
|
|
315
|
-
| `genymotion.
|
|
316
|
-
| `genymotion.
|
|
317
|
-
| `genymotion.executables.
|
|
318
|
-
| `genymotion.executables.
|
|
550
|
+
| Option | Description |
|
|
551
|
+
| --- | --- |
|
|
552
|
+
| `genymotion.enabled` | Enable Genymotion support |
|
|
553
|
+
| `genymotion.home` | Genymotion virtual machine data directory |
|
|
554
|
+
| `genymotion.path` | Genymotion app directory |
|
|
555
|
+
| `genymotion.executables.genymotion` | genymotion executable |
|
|
556
|
+
| `genymotion.executables.player` | player executable |
|
|
557
|
+
| `genymotion.executables.vboxmanage` | vboxmanage executable |
|
|
319
558
|
|
|
320
559
|
### Application Options
|
|
321
560
|
|
|
322
|
-
| Option
|
|
323
|
-
|
|
|
324
|
-
| `app.idprefix`
|
|
325
|
-
| `app.publisher`
|
|
326
|
-
| `app.url`
|
|
327
|
-
| `app.workspace`
|
|
328
|
-
| `app.skipAppIdValidation`
|
|
329
|
-
| `app.skipVersionValidation` | Skip version validation
|
|
561
|
+
| Option | Description |
|
|
562
|
+
| --- | --- |
|
|
563
|
+
| `app.idprefix` | Prefix for new app IDs |
|
|
564
|
+
| `app.publisher` | Default publisher |
|
|
565
|
+
| `app.url` | Default company URL |
|
|
566
|
+
| `app.workspace` | Default workspace directory |
|
|
567
|
+
| `app.skipAppIdValidation` | Skip app ID validation |
|
|
568
|
+
| `app.skipVersionValidation` | Skip version validation |
|
|
330
569
|
|
|
331
570
|
---
|
|
332
571
|
|
|
@@ -372,17 +611,34 @@ adb devices
|
|
|
372
611
|
|
|
373
612
|
## Command Quick Reference
|
|
374
613
|
|
|
375
|
-
| Command
|
|
376
|
-
|
|
|
377
|
-
| `ti
|
|
378
|
-
| `ti
|
|
379
|
-
| `ti
|
|
380
|
-
| `ti
|
|
381
|
-
| `ti
|
|
382
|
-
| `ti
|
|
383
|
-
| `ti
|
|
384
|
-
| `ti
|
|
385
|
-
| `ti
|
|
614
|
+
| Command | Description |
|
|
615
|
+
| --- | --- |
|
|
616
|
+
| `ti help` | Display help screen |
|
|
617
|
+
| `ti help <command>` | Display help for a specific command |
|
|
618
|
+
| `ti setup` | Run setup wizard |
|
|
619
|
+
| `ti setup check` | Check environment setup |
|
|
620
|
+
| `ti setup <section>` | Run specific setup section (quick, check, user, app, network, cli, sdk, ios, android, paths) |
|
|
621
|
+
| `ti info` | Display system info |
|
|
622
|
+
| `ti info -p <PLATFORM>` | Platform-specific info |
|
|
623
|
+
| `ti info -o json` | Output system info as JSON |
|
|
624
|
+
| `ti config` | Display/set config |
|
|
625
|
+
| `ti config -o json` | Output config as JSON |
|
|
626
|
+
| `ti create` | Create new project |
|
|
627
|
+
| `ti create -t module` | Create new module |
|
|
628
|
+
| `ti build` | Build project |
|
|
629
|
+
| `ti build -b` | Build only (no install/launch) |
|
|
630
|
+
| `ti build -f` | Force clean rebuild |
|
|
631
|
+
| `ti clean` | Clean build folder |
|
|
632
|
+
| `ti clean -p <PLATFORM>` | Clean specific platform |
|
|
633
|
+
| `ti project` | Get/set tiapp.xml settings |
|
|
634
|
+
| `ti module list` | List installed modules |
|
|
635
|
+
| `ti plugin list` | List installed plugins |
|
|
636
|
+
| `ti sdk list` | List installed SDKs |
|
|
637
|
+
| `ti sdk select` | Select default SDK |
|
|
638
|
+
| `ti sdk install` | Install latest SDK |
|
|
639
|
+
| `ti sdk install <version>` | Install specific SDK |
|
|
640
|
+
| `ti sdk uninstall <version>` | Uninstall specific SDK |
|
|
641
|
+
| `ti sdk update` | Check for SDK updates |
|
|
386
642
|
|
|
387
643
|
---
|
|
388
644
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Coding Best Practices
|
|
2
2
|
|
|
3
|
+
The recommended standard for Titanium apps is a single-context, modular pattern with well-structured code and well-organized resources.
|
|
4
|
+
|
|
3
5
|
## 1. Scope Management
|
|
4
6
|
- **Avoid Global Scope**: Global variables are not automatically garbage collected and can cause naming conflicts.
|
|
5
7
|
- **Always use `let` or `const`**: (Original guide says `var`, but modernization rules apply). Omitting declarations places variables in the global scope.
|
|
@@ -40,16 +42,23 @@ win1.addEventListener('click', () => {
|
|
|
40
42
|
const WindowTwo = require('ui/WindowTwo').WindowTwo;
|
|
41
43
|
const win2 = new WindowTwo();
|
|
42
44
|
win2.open();
|
|
45
|
+
|
|
46
|
+
win2.addEventListener('click', () => {
|
|
47
|
+
// load window three JavaScript only when needed
|
|
48
|
+
const WindowThree = require('ui/WindowThree').WindowThree;
|
|
49
|
+
const win3 = new WindowThree();
|
|
50
|
+
win3.open();
|
|
51
|
+
});
|
|
43
52
|
});
|
|
44
53
|
```
|
|
45
54
|
|
|
46
55
|
- **Bridge Efficiency**: Minimize requests for device properties like `Ti.Platform.osname`. Store them in a local variable once.
|
|
47
|
-
- **Avoid Extending Ti Namespace**:
|
|
56
|
+
- **Avoid Extending Ti Namespace**: Ti namespace objects are proxy representations of native OS components. Properties set on them may be stored on the proxy but won't be passed to the native object. Arrays stored on proxies return copies, not live references. There is no guarantee properties will persist across SDK versions. Use native modules instead to extend core functionality.
|
|
48
57
|
|
|
49
58
|
## 5. App Architecture Recommendations
|
|
50
59
|
|
|
51
60
|
### Modular Components with CommonJS (Recommended)
|
|
52
|
-
Titanium's primary recommended architecture. Discrete and independent building blocks that eliminate global variables.
|
|
61
|
+
Titanium's primary recommended architecture. Discrete and independent building blocks that eliminate global variables. See `commonjs-advanced.md` for detailed module patterns and path resolution.
|
|
53
62
|
|
|
54
63
|
**MyModule.js**
|
|
55
64
|
```javascript
|
|
@@ -72,11 +81,12 @@ myModule.sayHello('User');
|
|
|
72
81
|
```
|
|
73
82
|
|
|
74
83
|
### Custom Objects as Components
|
|
75
|
-
Popular for rapid deployment. Uses a namespace hierarchy.
|
|
84
|
+
Popular for rapid deployment. Uses a namespace hierarchy. However, this pattern is less performant than CommonJS modules. Memory management can be difficult as object references may persist after they're no longer needed.
|
|
85
|
+
|
|
76
86
|
```javascript
|
|
77
87
|
const myapp = {};
|
|
78
88
|
(() => {
|
|
79
|
-
myapp.ui = {};
|
|
89
|
+
myapp.ui = {};
|
|
80
90
|
myapp.ui.createApplicationWindow = () => {
|
|
81
91
|
const win = Ti.UI.createWindow({ backgroundColor:'white' });
|
|
82
92
|
return win;
|