@launchsecure/launch-kit 0.0.12 → 0.0.14

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.
@@ -0,0 +1,41 @@
1
+ ; Detect JSX usage (component/page/layout)
2
+ [(jsx_element) (jsx_self_closing_element)] @has_jsx
3
+
4
+ ; Detect React hooks (function name starts with use)
5
+ (function_declaration
6
+ name: (identifier) @hook_decl
7
+ (#match? @hook_decl "^use[A-Z]"))
8
+
9
+ (lexical_declaration
10
+ (variable_declarator
11
+ name: (identifier) @hook_const
12
+ (#match? @hook_const "^use[A-Z]")))
13
+
14
+ ; Detect useState/useEffect usage (consumer of hooks)
15
+ (call_expression
16
+ function: (identifier) @hook_call
17
+ (#match? @hook_call "^use[A-Z]"))
18
+
19
+ ; Detect React.createContext
20
+ (call_expression
21
+ function: (member_expression
22
+ object: (identifier) @_react
23
+ property: (property_identifier) @_createCtx)
24
+ (#eq? @_react "React")
25
+ (#eq? @_createCtx "createContext")) @has_create_context
26
+
27
+ (call_expression
28
+ function: (identifier) @_createCtx2
29
+ (#eq? @_createCtx2 "createContext")) @has_create_context_bare
30
+
31
+ ; Detect HTTP method exports (API endpoint)
32
+ (export_statement
33
+ declaration: (lexical_declaration
34
+ (variable_declarator
35
+ name: (identifier) @http_export
36
+ (#match? @http_export "^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)$"))))
37
+
38
+ (export_statement
39
+ declaration: (function_declaration
40
+ name: (identifier) @http_export_fn
41
+ (#match? @http_export_fn "^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)$")))