-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquick-demo.sh
More file actions
executable file
·163 lines (144 loc) · 5.6 KB
/
Copy pathquick-demo.sh
File metadata and controls
executable file
·163 lines (144 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
# ==========================================================================
# Library Insight — Quick Demo (3 min)
# ==========================================================================
# A concise walkthrough of the 12 most important commands.
# Great for onboarding, YouTube demos, and new user exploration.
#
# Requirements:
# - JDK 17+
# - library-insight installed:
# curl -fsSL https://raw.githubusercontent.com/Coding-Meet/Library-Insight/main/install.sh | bash
#
# Usage:
# chmod +x quick-demo.sh
# ./quick-demo.sh
# ==========================================================================
set -e
LIBRARY="com.squareup.retrofit2:retrofit:2.11.0"
LIBRARY_OLD="com.squareup.retrofit2:retrofit:2.9.0"
LIBRARY_NEW="com.squareup.retrofit2:retrofit:2.11.0"
SEP="=================================================="
CLI_CMD="library-insight"
if command -v li &> /dev/null; then
CLI_CMD="li"
fi
echo ""
echo "$SEP"
echo " LIBRARY INSIGHT — QUICK DEMO (v1.4.2 Suite)"
echo "$SEP"
echo ""
# ------------------------------------------------------------------
# 1. SCAN
# ------------------------------------------------------------------
echo ">> 1. SCAN — Index compiled dependency API from Maven"
echo " $CLI_CMD scan $LIBRARY"
echo ""
$CLI_CMD scan $LIBRARY
echo ""
# ------------------------------------------------------------------
# 2. SCAN-SOURCE
# ------------------------------------------------------------------
echo ">> 2. SCAN-SOURCE — Index local raw Java & Kotlin source files"
echo " $CLI_CMD scan-source sample/src/main/kotlin"
echo ""
$CLI_CMD scan-source sample/src/main/kotlin
echo ""
# ------------------------------------------------------------------
# 3. SEARCH
# ------------------------------------------------------------------
echo ">> 3. SEARCH — Find class, methods, or sourceLocation annotations"
echo " $CLI_CMD search \"anno:Keep\""
echo ""
$CLI_CMD search "anno:Keep"
echo ""
# ------------------------------------------------------------------
# 4. EXPLAIN & DEEP DSL RESOLUTION
# ------------------------------------------------------------------
echo ">> 4. EXPLAIN — Deep inspect class structure, source pointers, DSL scopes, & receivers"
echo " $CLI_CMD explain Grid --deep"
echo ""
$CLI_CMD explain Grid --deep
echo ""
# ------------------------------------------------------------------
# 5. DSL REPORT
# ------------------------------------------------------------------
echo ">> 5. DSL-REPORT — Kotlin DSL scopes, aliases, and extension receivers"
echo " $CLI_CMD dsl-report"
echo ""
$CLI_CMD dsl-report
echo ""
# ------------------------------------------------------------------
# 6. EXAMPLES
# ------------------------------------------------------------------
echo ">> 6. EXAMPLES — Generate usage patterns & extract guide examples"
echo " $CLI_CMD scan sample/build/libs/sample-1.1.0.jar --sources sample"
$CLI_CMD scan sample/build/libs/sample-1.1.0.jar --sources sample > /dev/null
echo " $CLI_CMD examples HtmlBuilder"
echo ""
$CLI_CMD examples HtmlBuilder
echo ""
# ------------------------------------------------------------------
# 7. HEALTH
# ------------------------------------------------------------------
echo ">> 7. HEALTH — Generate Package Health & API Complexity Report"
echo " $CLI_CMD health"
echo ""
$CLI_CMD health
echo ""
# ------------------------------------------------------------------
# 8. AUDIT
# ------------------------------------------------------------------
echo ">> 8. AUDIT — Scan dependencies for deprecated APIs recursively"
echo " $CLI_CMD audit"
echo ""
$CLI_CMD audit
echo ""
# ------------------------------------------------------------------
# 9. MIGRATE
# ------------------------------------------------------------------
echo ">> 9. MIGRATE — Get migration advisor report with replacements"
echo " $CLI_CMD migrate $LIBRARY_OLD $LIBRARY_NEW"
echo ""
$CLI_CMD migrate $LIBRARY_OLD $LIBRARY_NEW
echo ""
# ------------------------------------------------------------------
# 10. DEPENDENCY-CHECK
# ------------------------------------------------------------------
echo ">> 10. DEPENDENCY-CHECK — Scan classpath for Linkage/ABI conflicts"
echo " $CLI_CMD dependency-check"
echo ""
$CLI_CMD dependency-check
echo ""
# ------------------------------------------------------------------
# 11. CALLGRAPH
# ------------------------------------------------------------------
echo ">> 11. CALLGRAPH — Generate method call graph visual tree"
echo " $CLI_CMD callgraph HtmlBuilder.div"
echo ""
$CLI_CMD callgraph HtmlBuilder.div
echo ""
# ------------------------------------------------------------------
# 12. MCP
# ------------------------------------------------------------------
echo ">> 12. MCP — Test Model Context Protocol tools list interface"
echo " echo '{...}' | $CLI_CMD mcp"
echo ""
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | $CLI_CMD mcp
echo ""
# ------------------------------------------------------------------
# 13. KMP SCAN & EXPLAIN — Kotlin Multiplatform support
# ------------------------------------------------------------------
echo ">> 13. KMP SCAN & EXPLAIN — Multi-target platform variant resolution"
echo " $CLI_CMD scan io.ktor:ktor-client-core:3.0.0 --db build/ktor-index.json"
$CLI_CMD scan io.ktor:ktor-client-core:3.0.0 --db build/ktor-index.json > /dev/null
echo " $CLI_CMD explain io.ktor.client.HttpClient --db build/ktor-index.json"
echo ""
$CLI_CMD explain io.ktor.client.HttpClient --db build/ktor-index.json | head -n 35
echo ""
# Cleanup
rm -f build/ktor-index.json
echo "$SEP"
echo " Done! Run demo.sh for the full 23-command walkthrough."
echo "$SEP"
echo ""