@maccesar/titools 2.0.6 → 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 +21 -31
- 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
package/lib/commands/install.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Install command
|
|
3
|
-
* Installs skills and agents to AI coding assistant directories
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import inquirer from 'inquirer';
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import ora from 'ora';
|
|
9
|
-
import {
|
|
10
|
-
SKILLS,
|
|
11
|
-
AGENTS,
|
|
12
|
-
REPO_URL,
|
|
13
|
-
} from '../config.js';
|
|
14
|
-
import {
|
|
15
|
-
detectPlatforms,
|
|
16
|
-
detectOS,
|
|
17
|
-
} from '../platform.js';
|
|
18
|
-
import {
|
|
19
|
-
installSkills,
|
|
20
|
-
installAgents,
|
|
21
|
-
installAgentsTemplate,
|
|
22
|
-
getLocalRepoDir,
|
|
23
|
-
} from '../installer.js';
|
|
24
|
-
import { downloadRepoArchive } from '../downloader.js';
|
|
25
|
-
import { createSkillSymlinks } from '../symlink.js';
|
|
26
|
-
import { formatList } from '../utils.js';
|
|
27
|
-
import { mkdtemp } from 'fs/promises';
|
|
28
|
-
import { join } from 'path';
|
|
29
|
-
import { tmpdir } from 'os';
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Install command handler
|
|
33
|
-
* @param {Object} options - Command options
|
|
34
|
-
*/
|
|
35
|
-
export async function installCommand(options) {
|
|
36
|
-
console.log('');
|
|
37
|
-
console.log(chalk.bold.blue('Titanium SDK Skills Installer'));
|
|
38
|
-
console.log('');
|
|
39
|
-
|
|
40
|
-
// Detect installed platforms
|
|
41
|
-
const detectedPlatforms = detectPlatforms();
|
|
42
|
-
|
|
43
|
-
if (detectedPlatforms.length === 0 && !options.path) {
|
|
44
|
-
console.log(chalk.yellow('No AI coding assistants detected.'));
|
|
45
|
-
console.log('Install one of: Claude Code, Gemini CLI, or Codex CLI');
|
|
46
|
-
console.log('Or use: titools install --path /custom/path');
|
|
47
|
-
process.exit(1);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Show detected platforms
|
|
51
|
-
for (const platform of detectedPlatforms) {
|
|
52
|
-
console.log(chalk.green('✓'), `${platform.displayName} detected`);
|
|
53
|
-
}
|
|
54
|
-
console.log('');
|
|
55
|
-
|
|
56
|
-
// Select platforms to install
|
|
57
|
-
let selectedPlatforms = [];
|
|
58
|
-
|
|
59
|
-
if (options.path) {
|
|
60
|
-
// Custom path mode - skip platform selection
|
|
61
|
-
selectedPlatforms = [];
|
|
62
|
-
} else if (options.all) {
|
|
63
|
-
// Install to all detected platforms
|
|
64
|
-
selectedPlatforms = detectedPlatforms;
|
|
65
|
-
} else {
|
|
66
|
-
// Interactive selection
|
|
67
|
-
const answers = await inquirer.prompt([
|
|
68
|
-
{
|
|
69
|
-
type: 'list',
|
|
70
|
-
name: 'platform',
|
|
71
|
-
message: 'Select platform to install:',
|
|
72
|
-
choices: [
|
|
73
|
-
{ name: 'All detected platforms', value: 'all' },
|
|
74
|
-
...detectedPlatforms.map((p) => ({
|
|
75
|
-
name: `${p.displayName} only`,
|
|
76
|
-
value: p.name,
|
|
77
|
-
})),
|
|
78
|
-
{ name: 'Cancel', value: 'cancel' },
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
]);
|
|
82
|
-
|
|
83
|
-
if (answers.platform === 'cancel') {
|
|
84
|
-
console.log('Cancelled.');
|
|
85
|
-
process.exit(0);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (answers.platform === 'all') {
|
|
89
|
-
selectedPlatforms = detectedPlatforms;
|
|
90
|
-
} else {
|
|
91
|
-
selectedPlatforms = detectedPlatforms.filter(
|
|
92
|
-
(p) => p.name === answers.platform
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (selectedPlatforms.length === 0 && !options.path) {
|
|
98
|
-
console.log('No platforms selected.');
|
|
99
|
-
process.exit(0);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Get repository directory (local or download)
|
|
103
|
-
const spinner = ora();
|
|
104
|
-
let repoDir = getLocalRepoDir();
|
|
105
|
-
|
|
106
|
-
if (!repoDir) {
|
|
107
|
-
// Download from GitHub
|
|
108
|
-
spinner.start('Downloading from GitHub...');
|
|
109
|
-
try {
|
|
110
|
-
const tempDir = tmpdir();
|
|
111
|
-
repoDir = await mkdtemp(join(tempDir, 'titanium-skills-'));
|
|
112
|
-
await downloadRepoArchive(repoDir);
|
|
113
|
-
spinner.succeed('Downloaded from GitHub');
|
|
114
|
-
} catch (error) {
|
|
115
|
-
spinner.fail('Failed to download');
|
|
116
|
-
console.error(chalk.red(error.message));
|
|
117
|
-
process.exit(1);
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
console.log(chalk.green('Using local repository'));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
try {
|
|
124
|
-
// Install skills
|
|
125
|
-
spinner.start('Installing skills...');
|
|
126
|
-
const skillsResult = await installSkills(repoDir);
|
|
127
|
-
spinner.succeed(
|
|
128
|
-
`Skills: ${formatList(skillsResult.installed)}`
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
// Install agents
|
|
132
|
-
spinner.start('Installing agents...');
|
|
133
|
-
const agentsResult = await installAgents(repoDir);
|
|
134
|
-
if (agentsResult.installed.length > 0) {
|
|
135
|
-
spinner.succeed(
|
|
136
|
-
`Agents: ${formatList(agentsResult.installed)}`
|
|
137
|
-
);
|
|
138
|
-
} else {
|
|
139
|
-
spinner.info('No agents to install (Claude Code not detected)');
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Install AGENTS-TEMPLATE.md
|
|
143
|
-
spinner.start('Installing AGENTS-TEMPLATE.md...');
|
|
144
|
-
const templateInstalled = await installAgentsTemplate(repoDir);
|
|
145
|
-
if (templateInstalled) {
|
|
146
|
-
spinner.succeed('AGENTS-TEMPLATE.md installed');
|
|
147
|
-
} else {
|
|
148
|
-
spinner.warn('AGENTS-TEMPLATE.md not found');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Create symlinks for selected platforms
|
|
152
|
-
for (const platform of selectedPlatforms) {
|
|
153
|
-
spinner.start(`Linking ${platform.displayName}...`);
|
|
154
|
-
const symlinkResult = await createSkillSymlinks(
|
|
155
|
-
platform.skillsDir,
|
|
156
|
-
SKILLS
|
|
157
|
-
);
|
|
158
|
-
if (symlinkResult.linked.length === SKILLS.length) {
|
|
159
|
-
spinner.succeed(`${platform.displayName} linked`);
|
|
160
|
-
} else {
|
|
161
|
-
spinner.warn(
|
|
162
|
-
`${platform.displayName}: ${symlinkResult.linked.length}/${SKILLS.length} linked`
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// Summary
|
|
168
|
-
console.log('');
|
|
169
|
-
console.log(chalk.green('✓ Installation complete!'));
|
|
170
|
-
console.log('');
|
|
171
|
-
console.log(chalk.bold('▸'), 'Add AGENTS.md to your project:', chalk.cyan('titools agents'));
|
|
172
|
-
console.log(chalk.bold('▸'), 'Improves AI:', chalk.red('53%'), '→', chalk.green('100%'));
|
|
173
|
-
console.log('');
|
|
174
|
-
|
|
175
|
-
if (detectOS() === 'windows') {
|
|
176
|
-
console.log(chalk.yellow('▸'), 'Windows: Ensure ~/bin is in your PATH');
|
|
177
|
-
console.log('');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
} finally {
|
|
181
|
-
// Clean up temp directory if we downloaded
|
|
182
|
-
if (repoDir !== getLocalRepoDir() && repoDir.startsWith(tmpdir())) {
|
|
183
|
-
await import('fs-extra').then(({ remove }) => remove(repoDir));
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export default installCommand;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# Titanium Alloy + PurgeTSS Anti-Patterns
|
|
2
|
-
|
|
3
|
-
## 1. Manual Styling (Legacy & Overwrite Risk)
|
|
4
|
-
**Symptom:** Editing `app.tss` manually or using inline attributes like `backgroundColor="#fff"`.
|
|
5
|
-
**Problem:** PurgeTSS will overwrite manual changes in `app.tss`. Inline attributes make theme changes impossible.
|
|
6
|
-
**Solution:** Use **PurgeTSS classes** in XML.
|
|
7
|
-
|
|
8
|
-
## 2. Fat Controllers
|
|
9
|
-
**Symptom:** Controllers with 100+ lines handling logic, API, and UI.
|
|
10
|
-
**Solution:** Delegate business logic to `lib/services/` and API calls to `lib/api/`.
|
|
11
|
-
|
|
12
|
-
## 3. Memory Leaks (Missing Cleanup)
|
|
13
|
-
**Symptom:** Adding `Ti.App` or `Alloy.Collections` listeners without a `cleanup()` function.
|
|
14
|
-
**Solution:** Always implement `$.cleanup = cleanup` and remove listeners there.
|
|
15
|
-
|
|
16
|
-
## 4. Direct Native Module Calls
|
|
17
|
-
**Symptom:** Calling `require('ti.module')` directly in a controller.
|
|
18
|
-
**Solution:** Wrap it in a service in `lib/services/` (e.g., `audioService.js`).
|
|
19
|
-
|
|
20
|
-
## 5. Direct Controller Navigation
|
|
21
|
-
**Symptom:** `Alloy.createController('name').getView().open()`.
|
|
22
|
-
**Solution:** Use a Navigation Service to centralize `open/close` and trigger the `cleanup()` function automatically.
|
|
23
|
-
|
|
24
|
-
## 6. Complex Matrix Animations
|
|
25
|
-
**Symptom:** Manual use of `Ti.UI.create2DMatrix()`.
|
|
26
|
-
**Solution:** Use the **PurgeTSS Animation Module** with state modifiers (`class="close:opacity-0 open:opacity-100"`).
|
|
27
|
-
|
|
28
|
-
## 7. Hardcoded Strings & Missing a11y
|
|
29
|
-
**Symptom:** `text="Login"` instead of `text="L('login')"`, or missing `accessibilityLabel`.
|
|
30
|
-
**Solution:** Always use i18n and accessibility properties.
|
|
31
|
-
|
|
32
|
-
## 8. Logic in TSS
|
|
33
|
-
**Symptom:** Using conditionals or calculations inside TSS.
|
|
34
|
-
**Solution:** Keep styling declarative through PurgeTSS classes.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## PurgeTSS-Specific Anti-Patterns
|
|
39
|
-
|
|
40
|
-
## 9. Flexbox Classes (Don't Exist)
|
|
41
|
-
**Symptom:** Using `flex-row`, `flex-col`, `justify-between`, `justify-center`, `items-center`.
|
|
42
|
-
**Problem:** Titanium does NOT support CSS Flexbox. These classes don't exist in PurgeTSS.
|
|
43
|
-
**Solution:** Use Titanium layout modes:
|
|
44
|
-
```xml
|
|
45
|
-
<!-- WRONG -->
|
|
46
|
-
<View class="flex-row justify-between">
|
|
47
|
-
|
|
48
|
-
<!-- CORRECT -->
|
|
49
|
-
<View class="horizontal">
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## 10. Padding on Container Views
|
|
53
|
-
**Symptom:** Using `p-4`, `px-2`, `py-3` on View, Window, ScrollView, or TableView.
|
|
54
|
-
**Problem:** Base container elements don't support padding in Titanium.
|
|
55
|
-
**Solution:** Use margins on children instead:
|
|
56
|
-
```xml
|
|
57
|
-
<!-- WRONG -->
|
|
58
|
-
<View class="p-4">
|
|
59
|
-
<Label text="Hello" />
|
|
60
|
-
</View>
|
|
61
|
-
|
|
62
|
-
<!-- CORRECT -->
|
|
63
|
-
<View>
|
|
64
|
-
<Label class="m-4" text="Hello" />
|
|
65
|
-
</View>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## 11. Confusing `w-full` with `w-screen`
|
|
69
|
-
**Symptom:** Using `w-full` when `w-screen` is needed.
|
|
70
|
-
**Difference:** `w-full` sets `width: '100%'` (100% of parent), while `w-screen` sets `width: Ti.UI.FILL` (fills available space).
|
|
71
|
-
**Solution:** Use `w-screen` for full-width elements that should fill space. `w-full` is useful when you need percentage-based sizing.
|
|
72
|
-
|
|
73
|
-
## 12. Using `rounded-full` Without Size
|
|
74
|
-
**Symptom:** Using `rounded-full` expecting a circle.
|
|
75
|
-
**Problem:** `rounded-full` (without number) doesn't exist. You need `rounded-full-XX` where XX × 4 = element size.
|
|
76
|
-
**Note:** `rounded-full-XX` already includes width and height. Don't add `w-XX h-XX` with it.
|
|
77
|
-
**Solution:** For a 48×48 circle, use `rounded-full-12` (includes size). For percentage-based, use `w-12 h-12 rounded-full`.
|
|
78
|
-
|
|
79
|
-
## 13. Adding `composite` Class Explicitly
|
|
80
|
-
**Symptom:** Adding `class="composite"` to Views.
|
|
81
|
-
**Problem:** Composite (absolute positioning) is the DEFAULT layout. Adding it is redundant.
|
|
82
|
-
**Solution:** Omit layout class for composite, only use `horizontal` or `vertical` when needed.
|
|
83
|
-
|
|
84
|
-
## 14. Square Brackets for Arbitrary Values
|
|
85
|
-
**Symptom:** Using `w-[100px]` or `bg-[#ff0000]` with square brackets.
|
|
86
|
-
**Problem:** PurgeTSS uses parentheses, not square brackets.
|
|
87
|
-
**Solution:** Use parentheses: `w-(100px)`, `bg-(#ff0000)`.
|
|
88
|
-
|
|
89
|
-
## 15. Creating Manual .tss Files Per Controller
|
|
90
|
-
**Symptom:** Creating `app/styles/login.tss`, `app/styles/profile.tss`, etc.
|
|
91
|
-
**Problem:** Defeats the purpose of PurgeTSS which auto-generates a single optimized `app.tss`.
|
|
92
|
-
**Solution:** Use ONLY utility classes in XML. Delete all manual `.tss` files except `_app.tss`.
|
|
93
|
-
|
|
94
|
-
## 16. Using `lib/` Prefix in Require Statements
|
|
95
|
-
**Symptom:** `const service = require('lib/services/picsum')`
|
|
96
|
-
**Problem:** Alloy flattens the `lib/` folder during build. Files in `app/lib/services/` become `Resources/iphone/services/`.
|
|
97
|
-
**Solution:** Omit the `lib/` prefix: `const service = require('services/picsum')`
|
|
98
|
-
|
|
99
|
-
## 17. Wrong Window ID in Controller
|
|
100
|
-
**Symptom:** Using `$.index.open()` when the Window has `id="mainWindow"`.
|
|
101
|
-
**Problem:** Alloy generates `$` references from XML IDs. If Window is `id="mainWindow"`, `$.index` doesn't exist.
|
|
102
|
-
**Solution:** Match the ID: `$.mainWindow.open()`
|
|
103
|
-
|
|
104
|
-
## 18. Using `Ti.UI.createNotification`
|
|
105
|
-
**Symptom:** `Ti.UI.createNotification({ message: 'Hi' }).show()`
|
|
106
|
-
**Problem:** This API doesn't exist in Titanium. Causes "invalid method" error.
|
|
107
|
-
**Solution:** Use `Ti.UI.createAlertDialog` for simple messages, or create custom toast views.
|
|
108
|
-
|
|
109
|
-
## 19. Using Nonexistent iOS Share APIs
|
|
110
|
-
**Symptom:** `Ti.UI.iOS.createActivityPopover` or `alloy/social` with wrong methods.
|
|
111
|
-
**Problem:** These APIs either don't exist or have changed. Causes runtime errors.
|
|
112
|
-
**Solution:**
|
|
113
|
-
- iOS: Use `Ti.UI.iOS.createDocumentViewer` for files, or simple `Ti.UI.createOptionDialog` + `Ti.UI.Clipboard` for links
|
|
114
|
-
- Android: Use `Ti.Android.createIntent` with ACTION_SEND
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Quick Reference Table
|
|
119
|
-
|
|
120
|
-
| Anti-Pattern | Why It Fails | Correct Approach |
|
|
121
|
-
| -------------------- | ------------------------ | ----------------------- |
|
|
122
|
-
| `flex-row` | Flexbox not supported | `horizontal` |
|
|
123
|
-
| `flex-col` | Flexbox not supported | `vertical` |
|
|
124
|
-
| `justify-*` | Flexbox not supported | Use margins/positioning |
|
|
125
|
-
| `p-4` on View | No padding on containers | `m-4` on children |
|
|
126
|
-
| `w-full` | Doesn't exist | `w-screen` |
|
|
127
|
-
| `rounded-full` | Needs size suffix | `rounded-full-12` |
|
|
128
|
-
| `composite` class | Already default | Omit it |
|
|
129
|
-
| `w-[100px]` | Wrong syntax | `w-(100px)` |
|
|
130
|
-
| Manual `.tss` | Overwritten by PurgeTSS | Use utility classes |
|
|
131
|
-
| `lib/` prefix | lib/ is flattened | Use path without lib/ |
|
|
132
|
-
| `$.index.open()` | Wrong ID reference | Use actual Window ID |
|
|
133
|
-
| `createNotification` | API doesn't exist | `createAlertDialog` |
|