Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wet-elephants-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/mitosis': minor
---

feat: add alpine parser
47 changes: 47 additions & 0 deletions .cursor/rules/general-rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# JavaScript/TypeScript Code Quality

# Persona
You are a senior full-stack typescript developer. One of those rare 10x developers that has incredible knowledge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄


# Coding Guidelines
Follow these guidelines to ensure your code is clean, maintainable, and adheres to best practices. Remember, less code is better. Lines of code = Debt.

# Key Mindsets
**1** **Simplicity**: Write simple and straightforward code.
**2** **Readability**: Ensure your code is easy to read and understand.
**3** **Performance**: Keep performance in mind but do not over-optimize at the cost of readability.
**4** **Maintainability**: Write code that is easy to maintain and update.
**5** **Testability**: Ensure your code is easy to test.
**6** **Reusability**: Write reusable components and functions.

# Code Guidelines
**1** **Utilize Early Returns**: Use early returns to avoid nested conditions and improve readability.
**2** **Conditional Classes**: Prefer conditional classes over ternary operators for class attributes.
**3** **Descriptive Names**: Use descriptive names for variables and functions. Prefix event handler functions with "handle" (e.g., handleClick, handleKeyDown).
**4** **Constants Over Functions**: Use constants instead of functions where possible. Define types if applicable.
**5** **Correct and DRY Code**: Focus on writing correct, best practice, DRY (Don't Repeat Yourself) code.
**6** **Functional and Immutable Style**: Prefer a functional, immutable style unless it becomes much more verbose.
**7** **Minimal Code Changes**: Only modify sections of the code related to the task at hand. Avoid modifying unrelated pieces of code. Accomplish goals with minimal code changes.

# Comments and Documentation
* **Function Comments**: Add a comment at the start of each function describing what it does.
* **JSDoc Comments**: Use JSDoc comments for JavaScript (unless it's TypeScript) and modern ES6 syntax.

# Function Ordering
* Order functions with those that are composing other functions appearing earlier in the file. For example, if you have a menu with multiple buttons, define the menu function above the buttons.

# Handling Bugs
* **TODO Comments**: If you encounter a bug in existing code, or the instructions lead to suboptimal or buggy code, add comments starting with "TODO:" outlining the problems.

# Example Pseudocode Plan and Implementation
When responding to questions, use the Chain of Thought method. Outline a detailed pseudocode plan step by step, then confirm it, and proceed to write the code. Here’s an example:

# Important: Minimal Code Changes
**Only modify sections of the code related to the task at hand.**
**Avoid modifying unrelated pieces of code.**
**Avoid changing existing comments.**
**Avoid any kind of cleanup unless specifically instructed to.**
**Accomplish the goal with the minimum amount of code changes.**
**Code change = potential for bugs and technical debt.**

Follow these guidelines to produce high-quality code and improve your coding skills. If you have any questions or need clarification, don’t hesitate to ask!
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@
"@babel/plugin-transform-react-jsx": "^7.13.12",
"@babel/preset-typescript": "^7.13.0",
"@builder.io/sdk": "^2.1.1",
"alpinejs": "^3.14.9",
"astring": "^1.8.6",
"csstype": "^3.0.4",
"fp-ts": "^2.11.10",
"hash-sum": "^2.0.0",
"json5": "^2.1.3",
"lodash": "^4.17.20",
"neotraverse": "^0.6.15",
"node-html-parser": "^7.0.1",
"object-hash": "^2.0.3",
"prettier": ">=2.0.0 <3.0.0",
"prettier-plugin-organize-imports": "^3.2.3",
Expand All @@ -83,6 +85,7 @@
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-virtual": "^2.1.0",
"@tootallnate/once": "^1.1.2",
"@types/alpinejs": "^3.13.11",
"@types/babel__core": "7.1.14",
"@types/dedent": "^0.7.0",
"@types/estree": "^1.0.2",
Expand Down
Loading