@launchsecure/launch-kit 0.0.21 → 0.0.22
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/dist/server/chart-serve.js +336 -95
- package/dist/server/cli.js +337 -96
- package/dist/server/graph/queries/classify.scm +8 -0
- package/dist/server/graph/queries/db-calls.scm +21 -0
- package/dist/server/graph/queries/deep/jsx-semantic.scm +13 -2
- package/dist/server/graph/queries/navigations.scm +28 -12
- package/dist/server/graph-mcp-entry.js +341 -96
- package/package.json +1 -1
|
@@ -39,3 +39,11 @@
|
|
|
39
39
|
declaration: (function_declaration
|
|
40
40
|
name: (identifier) @http_export_fn
|
|
41
41
|
(#match? @http_export_fn "^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)$")))
|
|
42
|
+
|
|
43
|
+
; Detect Next.js Server Action directive: 'use server' at file top.
|
|
44
|
+
; Tree-sitter represents the directive as an expression_statement whose only
|
|
45
|
+
; child is a string literal — and it must be at program level.
|
|
46
|
+
(program
|
|
47
|
+
(expression_statement
|
|
48
|
+
(string (string_fragment) @use_server_directive)
|
|
49
|
+
(#eq? @use_server_directive "use server")))
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
; ── Prisma / Drizzle shape ─────────────────────────────────────────────────
|
|
1
2
|
; db.user.findUnique(...), db.session.create(...), etc.
|
|
2
3
|
; Matches any <ident>.<model>.<method>() — no hardcoded DB identifier
|
|
3
4
|
(call_expression
|
|
@@ -6,3 +7,23 @@
|
|
|
6
7
|
object: (identifier) @db.identifier
|
|
7
8
|
property: (property_identifier) @db.model)
|
|
8
9
|
property: (property_identifier) @db.method))
|
|
10
|
+
|
|
11
|
+
; ── Supabase shape ─────────────────────────────────────────────────────────
|
|
12
|
+
; <client>.from("table").<select|insert|update|delete|upsert>(...)
|
|
13
|
+
; Captures the table name string and the operation method. The "from_name"
|
|
14
|
+
; capture must equal "from" — filtered at emit time.
|
|
15
|
+
(call_expression
|
|
16
|
+
function: (member_expression
|
|
17
|
+
object: (call_expression
|
|
18
|
+
function: (member_expression
|
|
19
|
+
property: (property_identifier) @sb.from_name)
|
|
20
|
+
arguments: (arguments
|
|
21
|
+
(string (string_fragment) @sb.table)))
|
|
22
|
+
property: (property_identifier) @sb.method)
|
|
23
|
+
(#eq? @sb.from_name "from"))
|
|
24
|
+
|
|
25
|
+
; Supabase but the `from()` call is on a function-call result, e.g.
|
|
26
|
+
; getServiceClient().from("merchants").select(...)
|
|
27
|
+
; The `object: (call_expression...)` above already covers this case because
|
|
28
|
+
; tree-sitter's grammar allows any expression as `object` of a member_expression.
|
|
29
|
+
; No extra pattern required.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
; Self-closing JSX
|
|
1
|
+
; Self-closing JSX with props: <Input type="email" placeholder="..." />
|
|
2
2
|
(jsx_self_closing_element
|
|
3
3
|
name: (identifier) @el.tag
|
|
4
4
|
(jsx_attribute
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[(string (string_fragment) @el.prop.value.str)
|
|
7
7
|
(jsx_expression (_) @el.prop.value.expr)])) @el.self
|
|
8
8
|
|
|
9
|
-
; Opening JSX
|
|
9
|
+
; Opening JSX with props: <Button variant="destructive">
|
|
10
10
|
(jsx_opening_element
|
|
11
11
|
name: (identifier) @el.tag
|
|
12
12
|
(jsx_attribute
|
|
@@ -14,6 +14,17 @@
|
|
|
14
14
|
[(string (string_fragment) @el.prop.value.str)
|
|
15
15
|
(jsx_expression (_) @el.prop.value.expr)])) @el.open
|
|
16
16
|
|
|
17
|
+
; Self-closing JSX without props: <Shell />, <DuetLogo />
|
|
18
|
+
; Captures the element so composition wrappers / providers / shells appear
|
|
19
|
+
; in deep elements. The consumer keys by position, so this match coexists
|
|
20
|
+
; with the prop-bearing pattern above when both apply.
|
|
21
|
+
(jsx_self_closing_element
|
|
22
|
+
name: (identifier) @el.tag) @el.self
|
|
23
|
+
|
|
24
|
+
; Opening JSX without props: <Shell>children</Shell>
|
|
25
|
+
(jsx_opening_element
|
|
26
|
+
name: (identifier) @el.tag) @el.open
|
|
27
|
+
|
|
17
28
|
; JSX text content (direct text inside elements)
|
|
18
29
|
(jsx_element
|
|
19
30
|
(jsx_opening_element
|
|
@@ -20,44 +20,60 @@
|
|
|
20
20
|
(#eq? @_router2 "router")
|
|
21
21
|
(#match? @nav.method.template "^(push|replace)$"))
|
|
22
22
|
|
|
23
|
-
; <
|
|
23
|
+
; <ANY href="LITERAL"> — opening element with href prop. Captures
|
|
24
|
+
; <Link>, <a>, and any custom wrapper component (LinkRow, NavItem, …). The
|
|
25
|
+
; resolver filters non-route literals out of the final edge set.
|
|
24
26
|
(jsx_opening_element
|
|
25
|
-
name: (
|
|
27
|
+
name: (_) @nav.link.tag
|
|
26
28
|
attribute: (jsx_attribute
|
|
27
29
|
(property_identifier) @_href
|
|
28
30
|
(string (string_fragment) @nav.link.literal))
|
|
29
|
-
(#eq? @_link_tag "Link")
|
|
30
31
|
(#eq? @_href "href"))
|
|
31
32
|
|
|
32
|
-
; <
|
|
33
|
+
; <ANY href="LITERAL" /> — self-closing
|
|
33
34
|
(jsx_self_closing_element
|
|
34
|
-
name: (
|
|
35
|
+
name: (_) @nav.link.tag.self
|
|
35
36
|
attribute: (jsx_attribute
|
|
36
37
|
(property_identifier) @_href2
|
|
37
38
|
(string (string_fragment) @nav.link.literal.self))
|
|
38
|
-
(#eq? @_link_tag2 "Link")
|
|
39
39
|
(#eq? @_href2 "href"))
|
|
40
40
|
|
|
41
|
-
; <
|
|
41
|
+
; <ANY href={`...`}> — template, opening
|
|
42
42
|
(jsx_opening_element
|
|
43
|
-
name: (
|
|
43
|
+
name: (_) @nav.link.tag.tpl
|
|
44
44
|
attribute: (jsx_attribute
|
|
45
45
|
(property_identifier) @_href3
|
|
46
46
|
(jsx_expression
|
|
47
47
|
(template_string) @nav.link.template))
|
|
48
|
-
(#eq? @_link_tag3 "Link")
|
|
49
48
|
(#eq? @_href3 "href"))
|
|
50
49
|
|
|
51
|
-
; <
|
|
50
|
+
; <ANY href={`...`} /> — template, self-closing
|
|
52
51
|
(jsx_self_closing_element
|
|
53
|
-
name: (
|
|
52
|
+
name: (_) @nav.link.tag.tpl.self
|
|
54
53
|
attribute: (jsx_attribute
|
|
55
54
|
(property_identifier) @_href4
|
|
56
55
|
(jsx_expression
|
|
57
56
|
(template_string) @nav.link.template.self))
|
|
58
|
-
(#eq? @_link_tag4 "Link")
|
|
59
57
|
(#eq? @_href4 "href"))
|
|
60
58
|
|
|
59
|
+
; redirect('/path') / redirect(`/path/${id}`) — bare call. Convention from
|
|
60
|
+
; next/navigation; matches by name regardless of import path so wrappers
|
|
61
|
+
; that re-export `redirect` still work. Filtering noise: callers like
|
|
62
|
+
; redirect(url) (variable) are skipped because we only capture string args.
|
|
63
|
+
(call_expression
|
|
64
|
+
function: (identifier) @_redirect_fn
|
|
65
|
+
arguments: (arguments
|
|
66
|
+
.
|
|
67
|
+
(string (string_fragment) @nav.redirect.literal))
|
|
68
|
+
(#eq? @_redirect_fn "redirect"))
|
|
69
|
+
|
|
70
|
+
(call_expression
|
|
71
|
+
function: (identifier) @_redirect_fn_tpl
|
|
72
|
+
arguments: (arguments
|
|
73
|
+
.
|
|
74
|
+
(template_string) @nav.redirect.template)
|
|
75
|
+
(#eq? @_redirect_fn_tpl "redirect"))
|
|
76
|
+
|
|
61
77
|
; window.location.href = '...'
|
|
62
78
|
(assignment_expression
|
|
63
79
|
left: (member_expression
|