-
Notifications
You must be signed in to change notification settings - Fork 1
add llms docs; add type hints #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
7c1a8ab
4cb2afc
a714e12
5c29d43
e9512b0
f035ac4
ddc8cbf
bf7cc80
5bd8706
3583696
f12b1d5
a938b23
1d23c9e
27e1452
a61309d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,5 @@ yarn-error.log | |
| tmp/ | ||
|
|
||
| draft/ | ||
|
|
||
| .yarn/*.gz | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nodeLinker: node-modules |
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
|
|
||
| {} (:calcit-version |0.10.6) | ||
| {} (:calcit-version |0.11.5) | ||
| :dependencies $ {} (|calcit-lang/calcit-test |0.0.6) | ||
| |calcit-lang/lilac |main | ||
| |calcit-lang/memof |0.0.17 | ||
| |calcit-lang/memof |0.0.22 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -266,18 +266,48 @@ cr libs readme respo | |||||||||||||
| caps | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ### 7. Code Analysis | ||||||||||||||
| ### 7. Architectural Exploration (Structure & Patterns) | ||||||||||||||
|
|
||||||||||||||
| To quickly understand a project's architecture, combine **Top-Down call graphs** with **Pattern-based structure search**. | ||||||||||||||
|
|
||||||||||||||
| #### A. Top-Down: Call Graph Analysis | ||||||||||||||
|
|
||||||||||||||
| Use `call-graph` to visualize the component tree and data flow starting from an entry point. | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| # Visualize the app structure from the render entry point | ||||||||||||||
| cr analyze call-graph --root respo.app.core/render-app! --ns-prefix respo.app. --max-depth 3 | ||||||||||||||
|
|
||||||||||||||
| # This reveals the component hierarchy: | ||||||||||||||
| # └── render-app! | ||||||||||||||
| # ├── comp-container | ||||||||||||||
| # │ ├── comp-todolist | ||||||||||||||
| # │ │ ├── comp-task | ||||||||||||||
| # │ │ └── comp-wrap | ||||||||||||||
| # └── dispatch! -> updater | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| #### B. Pattern-Based: Structure Search | ||||||||||||||
|
|
||||||||||||||
| Use `search-expr` to find functional patterns (like state management or event handling) across the whole project. | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| # Call graph analysis from init-fn (or custom root) | ||||||||||||||
| cr analyze call-graph | ||||||||||||||
| cr analyze call-graph --root app.main/main! --ns-prefix app. --include-core --max-depth 5 --format json | ||||||||||||||
| # How is state being navigated? | ||||||||||||||
| cr query search-expr '>> states' -l | ||||||||||||||
|
|
||||||||||||||
| # Call count statistics | ||||||||||||||
| cr analyze count-calls | ||||||||||||||
| cr analyze count-calls --root app.main/main! --ns-prefix app. --include-core --format json --sort count | ||||||||||||||
| # Where are local state changes dispatched? | ||||||||||||||
| cr query search-expr 'd! cursor' -l | ||||||||||||||
|
|
||||||||||||||
| # Find all component event handler signatures | ||||||||||||||
| cr query search-expr 'fn (e d!)' -l | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **Strategy:** | ||||||||||||||
|
|
||||||||||||||
| 1. Use `call-graph` to find **WHO** calls **WHOM**. | ||||||||||||||
| 2. Use `search-expr` to find **HOW** certain features are implemented project-wide. | ||||||||||||||
| 3. Use `query usages` to find **WHERE** a specific function is integrated. | ||||||||||||||
|
Comment on lines
+307
to
+309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Reduce repeated sentence starts for readability. Lines 307–309 start with “Use”. Consider varying the phrasing to improve flow. 💡 Suggested wording-1. Use `call-graph` to find **WHO** calls **WHOM**.
-2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
-3. Use `query usages` to find **WHERE** a specific function is integrated.
+1. Start with `call-graph` to find **WHO** calls **WHOM**.
+2. Apply `search-expr` to see **HOW** features are implemented project-wide.
+3. Use `query usages` to locate **WHERE** a specific function is integrated.📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[style] ~309-~309: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Development Workflow for LLM Agents | ||||||||||||||
|
|
@@ -449,6 +479,8 @@ list-> $ {} | |||||||||||||
|
|
||||||||||||||
| ### 5. Styling Pattern | ||||||||||||||
|
|
||||||||||||||
| **A. Dynamic Inline Styles (Style Maps)** | ||||||||||||||
|
|
||||||||||||||
| ```cirru | ||||||||||||||
| ; Define styles as maps | ||||||||||||||
| def style-container $ {} | ||||||||||||||
|
|
@@ -469,6 +501,52 @@ let | |||||||||||||
| extended | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **B. Static CSS Styles with `defstyle` (Recommended for Performance)** | ||||||||||||||
|
|
||||||||||||||
| `defstyle` is a macro that generates CSS classes and injects them into `<style>` tags. Use it for static styles that don't need runtime computation. | ||||||||||||||
|
|
||||||||||||||
| ```cirru | ||||||||||||||
| ; Import from respo.css | ||||||||||||||
| ns my.namespace | ||||||||||||||
| :require (respo.css :refer $ defstyle) | ||||||||||||||
|
|
||||||||||||||
| ; Basic usage: & refers to current element | ||||||||||||||
| defstyle style-button $ {} | ||||||||||||||
| |& $ {} (:padding "|8px 16px") (:border-radius "|4px") | ||||||||||||||
| :background-color $ hsl 200 80 50 | ||||||||||||||
| :color "|white" | ||||||||||||||
|
|
||||||||||||||
| ; Pseudo-classes: :hover, :focus, :active, etc. | ||||||||||||||
| defstyle style-link $ {} | ||||||||||||||
| |& $ {} (:color "|blue") (:text-decoration :none) | ||||||||||||||
| |&:hover $ {} (:text-decoration :underline) | ||||||||||||||
|
|
||||||||||||||
| ; Pseudo-elements: ::before, ::after | ||||||||||||||
| defstyle style-text $ {} | ||||||||||||||
| |& $ {} (:font-size "|14px") (:line-height "|1.6") | ||||||||||||||
| |&::before $ {} (:content "|\"→ \"") | ||||||||||||||
|
|
||||||||||||||
| ; Media queries using 'contained | ||||||||||||||
| defstyle style-responsive $ {} | ||||||||||||||
| |& $ {} (:font-family "|Avenir,Verdana") | ||||||||||||||
| |& $ {} ('contained "|@media only screen and (max-width: 600px)") | ||||||||||||||
| :background-color $ hsl 0 0 90 | ||||||||||||||
|
|
||||||||||||||
| ; Usage in component (returns className string) | ||||||||||||||
| div | ||||||||||||||
| {} $ :class-name style-button | ||||||||||||||
| <> "|Click Me" | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **Key Points:** | ||||||||||||||
|
|
||||||||||||||
| - `|&` refers to the current element (required) | ||||||||||||||
| - Use string prefix `|` for CSS selectors like `|&:hover`, `|&::before` | ||||||||||||||
| - `'contained` for media queries and container queries | ||||||||||||||
| - `defstyle` generates unique class names automatically | ||||||||||||||
| - Styles are injected into `<head>` before render | ||||||||||||||
| - For SSR: read from `@*style-list-in-nodejs` to extract CSS | ||||||||||||||
|
|
||||||||||||||
| **Testing Style to String Conversion:** | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
|
|
@@ -808,12 +886,10 @@ cr query ns namespace-name # Check imports | |||||||||||||
| ### ⚠️ Critical Rules | ||||||||||||||
|
|
||||||||||||||
| 1. **NEVER directly edit `calcit.cirru` or `compact.cirru`** with text editors | ||||||||||||||
|
|
||||||||||||||
| - Use `cr edit` commands instead | ||||||||||||||
| - These are serialized AST structures, not human-readable code | ||||||||||||||
|
|
||||||||||||||
| 2. **ALWAYS use relative paths for documentation links** | ||||||||||||||
|
|
||||||||||||||
| - Use `../` and `../../` for navigation | ||||||||||||||
| - This allows easy file discovery for LLM tools | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.