ui-ux-pro-max-skill/cli/tests/e2e/template-script-paths.spec.ts
Dmso d62fe62f88
feat: add ZCode platform support (#504)
Add ZCode as a first-class install target so the skill can be installed
with `uipro init --ai zcode` (workspace) or `uipro init --ai zcode --global`
(~/.zcode/skills/), and removed via `uipro uninstall` auto-detection.

- new platform config src/ui-ux-pro-max/templates/platforms/zcode.json
  (synced to cli/assets via sync:assets)
- register 'zcode' in AIType union, AI_TYPES, AI_FOLDERS, AI_TO_PLATFORM
- detect .zcode workspace directories and describe the platform in CLI prompts
- cover zcode in the dry-run and template-script-paths e2e specs
- document ZCode in README install/usage sections

Co-authored-by: Dmso <22094486+dmsobtl@users.noreply.github.com>
2026-09-26 17:00:18 +07:00

35 lines
1.5 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { loadPlatformConfig, renderSkillFile } from '../../src/utils/template.js';
const cases = [
['claude', '.claude/skills/ui-ux-pro-max/scripts/search.py'],
['codex', '.agents/skills/ui-ux-pro-max/scripts/search.py'],
['copilot', '.github/prompts/ui-ux-pro-max/scripts/search.py'],
['kiro', '.kiro/steering/ui-ux-pro-max/scripts/search.py'],
['droid', '.factory/skills/ui-ux-pro-max/scripts/search.py'],
['zcode', '.zcode/skills/ui-ux-pro-max/scripts/search.py'],
] as const;
const SEARCH_COMMAND_COUNT = 17;
function extractSearchScriptPaths(content: string): string[] {
return [...content.matchAll(/^python3\s+(\S*search\.py)\b/gm)].map(match => match[1]);
}
for (const [platform, localPath] of cases) {
test(`${platform} renders project-root and global script paths`, async () => {
const config = await loadPlatformConfig(platform);
const localContent = await renderSkillFile(config);
const localPaths = extractSearchScriptPaths(localContent);
expect(localPaths).toHaveLength(SEARCH_COMMAND_COUNT);
expect(new Set(localPaths)).toEqual(new Set([localPath]));
expect(localContent).not.toContain('{{SCRIPT_PATH}}');
const globalContent = await renderSkillFile(config, true);
const globalPaths = extractSearchScriptPaths(globalContent);
expect(globalPaths).toHaveLength(SEARCH_COMMAND_COUNT);
expect(new Set(globalPaths)).toEqual(new Set([`~/${localPath}`]));
expect(globalContent).not.toContain('{{SCRIPT_PATH}}');
});
}