mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
refactor(ui-design): enhance import-from-code with CLI analysis and fix discovery script
- fix(discover-design-files.sh): Fix script errors and expand framework support * Fix variable quoting and conditional checks * Remove keyword restrictions for JS file discovery * Add support for .mjs, .cjs, .vue, .svelte files * Now correctly discovers all JS/TS framework files recursively - feat(import-from-code): Add optional gemini/qwen CLI analysis for agents * Add CLI-Assisted Analysis step to Style/Animation/Layout agents * Optional usage for large codebases (>20 files) or complex frameworks * All CLI calls use analysis mode (READ-ONLY) * Agent can use CLI output to guide file reading and token extraction 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,18 +11,23 @@ output_json="${2:-discovered-files.json}"
|
||||
find_files() {
|
||||
local pattern="$1"
|
||||
local files
|
||||
files=$(find "$source_dir" -type f $pattern \
|
||||
! -path "*/node_modules/*" \
|
||||
! -path "*/dist/*" \
|
||||
! -path "*/.git/*" \
|
||||
! -path "*/build/*" \
|
||||
! -path "*/coverage/*" \
|
||||
2>/dev/null | sort || true)
|
||||
files=$(eval "find \"$source_dir\" -type f $pattern \
|
||||
! -path \"*/node_modules/*\" \
|
||||
! -path \"*/dist/*\" \
|
||||
! -path \"*/.git/*\" \
|
||||
! -path \"*/build/*\" \
|
||||
! -path \"*/coverage/*\" \
|
||||
2>/dev/null | sort || true")
|
||||
|
||||
local count=$(echo "$files" | grep -c . || echo 0)
|
||||
local count
|
||||
if [ -z "$files" ]; then
|
||||
count=0
|
||||
else
|
||||
count=$(echo "$files" | grep -c . || echo 0)
|
||||
fi
|
||||
local json_files=""
|
||||
|
||||
if [ $count -gt 0 ]; then
|
||||
if [ "$count" -gt 0 ]; then
|
||||
json_files=$(echo "$files" | awk '{printf "\"%s\"%s\n", $0, (NR<'$count'?",":"")}' | tr '\n' ' ')
|
||||
fi
|
||||
|
||||
@@ -34,8 +39,8 @@ css_result=$(find_files '\( -name "*.css" -o -name "*.scss" \)')
|
||||
css_count=${css_result%%|*}
|
||||
css_files=${css_result#*|}
|
||||
|
||||
# Discover JS/TS theme files
|
||||
js_result=$(find_files '\( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" \) -a \( -name "*theme*" -o -name "*config*" -o -name "*style*" -o -name "*color*" \)')
|
||||
# Discover JS/TS files (all framework files)
|
||||
js_result=$(find_files '\( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" -o -name "*.mjs" -o -name "*.cjs" -o -name "*.vue" -o -name "*.svelte" \)')
|
||||
js_count=${js_result%%|*}
|
||||
js_files=${js_result#*|}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user