### Shared Library Configuration File Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Shows a sample `.library-config.json` file used to define paths to shared component libraries for a PCB design project. This ensures consistency across team members' setups. ```json { "libraries": { "kicad": "./libraries/kicad", "custom": "./libraries/custom" } } ``` -------------------------------- ### Unit and Comment Syntax Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Illustrates the usage of various measurement units and documentation styles within the design file. ```CodeYourPCB // Line comment /* Block comment */ size 50mm x 30mm at 1.5in, 20mil width 0.254mm component R1 resistor "0805" { value "330" // Chosen for ~10mA LED current at 15mm, 15mm } ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Installs the necessary Node.js dependencies for the web viewer. This command should be run from the `viewer` directory. ```bash cd viewer npm install ``` -------------------------------- ### Define PCB Routing Test Configuration Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/examples.md Demonstrates basic board setup, component placement for 0402 resistors and capacitors, and net connectivity definitions. This configuration is used to verify FreeRouting integration. ```cypcb version 1 board routing_test { size 40mm x 25mm layers 2 } component R1 resistor "0402" { value "10k" at 10mm, 12mm } component R2 resistor "0402" { value "10k" at 25mm, 12mm } component C1 capacitor "0402" { value "100nF" at 17mm, 8mm } net VCC { R1.1 C1.1 } net GND { R1.2 R2.1 C1.2 } net SIGNAL { R2.2 } ``` -------------------------------- ### Blink Circuit: Basic .cypcb Structure and Component Placement Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/examples.md Demonstrates the fundamental structure of a .cypcb file, including board definition, component placement with coordinates, and basic net definitions for a simple LED circuit. This serves as a 'Hello World' example for PCB design with CodeYourPCB. ```cypcb // Comments start with // (C-style) version 1 // File format version (currently always 1) // Board definition: size and layer count board blink { size 50mm x 30mm // Physical board dimensions (width x height) layers 2 // 2-layer board (Top and Bottom copper) } // Component placement: LED component LED1 led "0805" { // RefDes, type, footprint package value "RED" // Component value/color at 25mm, 15mm // Position on board (x, y from origin) } // Component placement: Current-limiting resistor component R1 resistor "0402" { value "330" // 330 ohm resistor at 15mm, 15mm } // Net definition: Power rail // Constraints go in square brackets BEFORE the braces net VCC [current 20mA] { // Net named "VCC" with 20mA current limit R1.1 // Pin 1 of R1 } // Net definition: LED anode connection net LED_ANODE { R1.2 // Pin 2 of R1 LED1.A // Anode pin of LED1 } // Net definition: Ground rail net GND { LED1.K // Cathode pin of LED1 } ``` -------------------------------- ### CodeYourPCB: Simple LED Blink Circuit Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md This is a basic example of a .cypcb file defining a simple LED blink circuit. It includes board dimensions, component placement for an LED and a resistor, and net definitions for VCC, LED_ANODE, and GND. ```cypcb // Simple LED blink circuit version 1 board blink { size 50mm x 30mm layers 2 } component LED1 led "0805" { value "RED" at 25mm, 15mm } component R1 resistor "0402" { value "330" at 15mm, 15mm } // Net constraints go in square brackets BEFORE the braces net VCC [current 20mA] { R1.1 } net LED_ANODE { R1.2 LED1.A } net GND { LED1.K } ``` -------------------------------- ### Import and Query Library Components Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Provides examples for importing various library formats and executing search or retrieval queries against the manager. ```rust // Import libraries manager.import_kicad_library("/path/to/Resistor_SMD.pretty")?; manager.import_all_kicad_libraries()?; // Query components let results = manager.search("resistor", Some(filters))?; let component = manager.get_component("kicad::R_0805_2012Metric")?; // Batch add components manager.add_components(vec![component1, component2, component3])?; ``` -------------------------------- ### Define Board and Components Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Initializes the board dimensions and places essential components like connectors, resistors, LEDs, and capacitors using specific coordinates. ```CodeYourPCB version 1 board power_indicator { size 25mm x 20mm layers 2 } component J1 connector "PIN-HDR-1x2" { at 5mm, 10mm } component R1 resistor "0805" { value "330R" at 12mm, 14mm } component LED1 led "0805" { value "GREEN" at 18mm, 14mm } component C1 capacitor "0805" { value "100nF" at 12mm, 6mm } ``` -------------------------------- ### Common PCB Design Patterns Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Demonstrates standard practices for power decoupling, ground planes, and high-current trace specifications. ```CodeYourPCB // Power decoupling net VCC [current 500mA width 0.4mm] { J1.1 C1.1 U1.VCC } // High-current trace net MOTOR_POWER [current 2A width 1mm clearance 0.5mm] { J1.1 Q1.D M1.PLUS } ``` -------------------------------- ### Example Review Comment on PCB Net Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Provides an example of a code review comment on a PCB net within a `.cypcb` file. This demonstrates how collaborators can suggest specific changes to improve the design. ```text In my_board.cypcb line 45: > net VCC [current 500mA] { This net should probably have width constraint: net VCC [current 500mA width 0.4mm] { ``` -------------------------------- ### Build Desktop Application Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Builds the native desktop application using Tauri. This command requires Tauri prerequisites to be installed and will output platform-specific installers in `src-tauri/target/release/bundle/`. ```bash cd viewer npm run build:desktop ``` -------------------------------- ### Routing Test - Demonstrating Routing Algorithms Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/examples.md This is a test case designed to validate routing algorithms. It showcases the use of numeric pin names and a basic net topology, serving as a minimal working example for auto-routing tools. ```cypcb This file contains a routing test case. The actual code is not provided in the input text, but the description indicates it demonstrates numeric pin names and basic net topology for auto-routing validation. ``` -------------------------------- ### Simple Power Supply (Advanced) - 5V Linear Regulator Circuit Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/examples.md This example demonstrates a complete 5V linear regulator circuit (LDO) using integrated circuits. It covers voltage regulation with input/output filtering, multiple power domains, and pin number assignments for ICs. The DSL syntax is consistent regardless of comment language. ```cypcb // Najprostszy zasilacz 5V (Simplest 5V power supply) // Wejście: 7-12V DC (Input: 7-12V DC) // Wyjście: 5V stabilizowane (Output: 5V regulated) version 1 board simple_psu { size 30mm x 20mm layers 2 } // Złącze wejściowe - 2-pin header (Input connector) component J1 connector "PIN-HDR-1x2" { at 5mm, 10mm } // Kondensator wejściowy (filtr) (Input capacitor - filter) component C1 capacitor "0805" { value "100nF" at 12mm, 14mm } // Regulator napięcia LDO 5V (SOT-23) (LDO 5V voltage regulator) // np. MCP1700, XC6206, lub podobny (e.g., MCP1700, XC6206, or similar) component U1 ic "SOT-23" { // IC type, SOT-23 package value "LDO-5V" // Part type designation at 18mm, 10mm } // Kondensator wyjściowy (stabilizacja) (Output capacitor - stabilization) component C2 capacitor "0805" { value "100nF" at 24mm, 14mm } // Złącze wyjściowe - 2-pin header (Output connector) component J2 connector "PIN-HDR-1x2" { at 27mm, 10mm } // Sieć VIN - wejście nieregulowane (VIN net - unregulated input) net VIN { J1.1 // Input header pin 1 C1.1 // Input filter cap U1.3 // MCP1700: pin 3 = VIN } // Sieć VOUT - wyjście 5V (VOUT net - 5V output) net VOUT { U1.2 // MCP1700: pin 2 = VOUT C2.1 // Output filter cap J2.1 // Output header pin 1 } // Masa wspólna (Common ground) net GND { J1.2 // Input ground C1.2 // Input cap ground U1.1 // MCP1700: pin 1 = GND C2.2 // Output cap ground J2.2 // Output ground } ``` -------------------------------- ### Context-Aware Auto-Completion Examples Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/api/lsp-server.md Demonstrates how the completion provider suggests relevant keywords, types, and units based on the cursor position within the .cypcb file. ```cypcb component R1 | // Suggests: resistor, capacitor, ic, ... at 10| // Suggests: mm, mil layer | // Suggests: Top, Bottom, Inner1, ... ``` -------------------------------- ### Start Development Server Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Launches the Vite development server for the web viewer. This command should be run from the `viewer` directory. It enables hot reloading for frontend changes. ```bash cd viewer npm run dev ``` -------------------------------- ### Run CodeYourPCB Viewer Development Server Source: https://github.com/szymontex/codeyourpcb/blob/main/README.md This bash script details how to set up and run the development server for the CodeYourPCB viewer. It involves installing Node.js dependencies and then starting the development server using npm. ```bash # Build WASM engine cd viewer wasm-pack build ../crates/cypcb-render --target web --out-dir src/wasm # Run dev server npm install npm run dev ``` -------------------------------- ### Example Git Diff of PCB Design Changes Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Presents a sample output of `git diff` for a `.cypcb` file, highlighting added components and nets. This diff format clearly shows the exact modifications made to the design. ```diff + component J1 connector "USB-C" { + at 5mm, 10mm + } + net VBUS { + J1.VBUS + U1.VIN + } ``` -------------------------------- ### Searching Components with Filters Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Provides examples of searching the component library using full-text queries and optional search filters to narrow results by source, category, package, or tags. ```rust use cypcb_library::SearchFilters; // Basic search let results = manager.search("resistor", None)?; // Search with filters let filters = SearchFilters { source: Some("kicad".to_string()), category: Some("Resistor_SMD".to_string()), package: Some("0805".to_string()), manufacturer: None, tags: vec![], }; let results = manager.search("resistor", Some(filters))?; ``` -------------------------------- ### CodeYourPCB Syntax Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/api/lsp-server.md A sample .cypcb file demonstrating board definition and component placement, used for testing diagnostics and error reporting. ```cypcb version 1 board test { size 50mm x 30mm layers 2 } component R1 unknown_type "0805" { at 10mm, 10mm } ``` -------------------------------- ### Initialize and Configure LibraryManager Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Covers the initialization of the LibraryManager and configuration of search paths for KiCad footprints and 3D models. ```rust use cypcb_library::LibraryManager; // Create manager with default SQLite database let manager = LibraryManager::new()?; // Set KiCad search paths manager.set_kicad_search_paths(vec![ "/usr/share/kicad/footprints/".to_string(), ]); // Set 3D model search paths manager.set_model_search_paths(vec![ "/usr/share/kicad/3dmodels/".to_string(), ]); ``` -------------------------------- ### Power Indicator: Advanced .cypcb with Connectors and Decoupling Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/examples.md Illustrates an intermediate .cypcb design featuring a header connector, LED, resistor, and decoupling capacitor. This example showcases power distribution, advanced net constraints (current and width), and good PCB design practices for a power indicator circuit. ```cypcb version 1 // Comments explaining circuit purpose // - 5V power input via 2-pin header // - LED with current limiting resistor (330R for ~10mA @ 5V) // - Decoupling capacitor for noise filtering board power_indicator { size 25mm x 20mm layers 2 } // Power input - 2.54mm pitch header component J1 connector "PIN-HDR-1x2" { // Through-hole 2-pin header at 5mm, 10mm } // Current limiting resistor for LED // 5V - 2V(LED) = 3V, 3V/330R = ~9mA component R1 resistor "0805" { value "330R" // Explicit "R" suffix for ohms at 12mm, 14mm } // Power indicator LED (green) component LED1 led "0805" { value "GREEN" // LED color at 18mm, 14mm } // Decoupling capacitor near power input component C1 capacitor "0805" { value "100nF" // Nanofarads at 12mm, 6mm } // Power rail connections // Net constraints go in square brackets BEFORE the braces net VCC [current 100mA width 0.3mm] { // Power net with current and trace width J1.1 // Pin 1 of header (VCC) R1.1 // Resistor power side C1.1 // Capacitor power side } // Ground rail net GND { J1.2 // Pin 2 of header (GND) LED1.2 // LED cathode C1.2 // Capacitor ground side } // LED circuit: R1 -> LED1 net LED_ANODE { R1.2 // Resistor output LED1.1 // LED anode } ``` -------------------------------- ### Run CodeYourPCB Desktop App (Tauri) Source: https://github.com/szymontex/codeyourpcb/blob/main/README.md These bash commands demonstrate how to run the CodeYourPCB desktop application using Tauri. It includes installing Linux prerequisites and then running the application in development mode or building a release installer. ```bash # Linux prerequisites sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev pkg-config npm run tauri dev # dev mode npm run tauri build # release installer (MSI / DMG / AppImage) ``` -------------------------------- ### Organize Libraries by Source Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Shows how to import different library types while maintaining namespace isolation for better component management. ```rust manager.import_kicad_library("/path/to/kicad/Resistor_SMD.pretty")?; manager.import_custom_library("mycompany", "/path/to/custom/MyParts.pretty")?; ``` -------------------------------- ### Manual Component Creation in Rust Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Demonstrates how to instantiate a Component object with metadata and add it to the LibraryManager. This process enables custom components to be indexed and searchable within the library. ```rust use cypcb_library::{LibraryManager, Component, ComponentMetadata}; let mut manager = LibraryManager::new()?; let component = Component { source: "mycompany".to_string(), name: "CUSTOM_CONNECTOR_4PIN".to_string(), category: Some("Connectors".to_string()), footprint_data: "...kicad_mod content...".to_string(), metadata: ComponentMetadata { description: Some("Custom 4-pin connector for product X".to_string()), manufacturer: Some("ACME Corp".to_string()), mpn: Some("CONN-4P-001".to_string()), datasheet_url: Some("https://example.com/datasheet.pdf".to_string()), package: Some("Custom".to_string()), library_version: Some("1.0".to_string()), tags: vec!["connector".to_string(), "4pin".to_string()], custom_fields: HashMap::new(), }, thumbnail: None, model_3d_path: None, }; manager.add_component(component)?; ``` -------------------------------- ### Extract and Store Footprint Thumbnails Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Shows how to generate a PNG thumbnail from footprint data and associate it with a component. ```rust use cypcb_library::preview::extract_thumbnail; let thumbnail_data = extract_thumbnail(&footprint_data)?; // Store with component let component = Component { // ... thumbnail: Some(thumbnail_data), // ... }; ``` -------------------------------- ### Importing Custom Footprint Libraries Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Shows how to import an entire directory of KiCad footprint files into the library manager under a specific namespace. ```rust let mut manager = LibraryManager::new()?; manager.import_custom_library( "mycompany", // Namespace "/path/to/MyCompany_Footprints.pretty" )?; ``` -------------------------------- ### Linux Prerequisites for Tauri Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Installs essential system libraries required for building Tauri desktop applications on Linux. These packages are necessary for the webview and other native functionalities. ```bash sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev pkg-config ``` -------------------------------- ### Add Component Metadata in Rust Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Demonstrates how to construct a Component struct with nested metadata and custom fields, then persist it using the LibraryManager. ```rust let component = Component { source: "kicad".to_string(), name: "R_0805_2012Metric".to_string(), category: Some("Resistor_SMD".to_string()), footprint_data: "...".to_string(), metadata: ComponentMetadata { description: Some("0805 (2012 Metric) resistor footprint".to_string()), package: Some("0805".to_string()), tags: vec!["smd".to_string(), "resistor".to_string()], custom_fields: { let mut map = HashMap::new(); map.insert("power_rating".to_string(), "0.125W".to_string()); map }, ..Default::default() }, thumbnail: None, model_3d_path: None, }; manager.add_component(component)?; ``` -------------------------------- ### Define Component Metadata and Tags Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Illustrates how to add descriptive metadata and search tags to custom components to improve discoverability and documentation. ```rust tags: vec![ "smd".to_string(), "resistor".to_string(), "0805".to_string(), "power-rating-0.125W".to_string(), ]; metadata: ComponentMetadata { description: Some("Custom connector for X project - DO NOT MODIFY".to_string()), } ``` -------------------------------- ### Track and Query Component Versions Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Demonstrates setting a library version in metadata and performing a search filtered by that version. ```rust let metadata = ComponentMetadata { library_version: Some("2024.01".to_string()), ..Default::default() }; // Find all components from a specific library version let filters = SearchFilters::default(); let results = manager.search("library_version:2024.01", Some(filters))?; ``` -------------------------------- ### Start Desktop Development Mode Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Launches the Tauri desktop application in development mode with hot reload enabled. This command should be run from the `viewer` directory and allows for rapid iteration on both Rust and TypeScript code. ```bash cd viewer npm run dev:desktop ``` -------------------------------- ### Perform End-to-End Library Import and Search in Rust Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Demonstrates the complete workflow of importing a KiCad library, searching for a specific component, and retrieving its metadata using the LibraryManager. ```rust manager.import_kicad_library("/usr/share/kicad/footprints/Resistor_SMD.pretty")?; let results = manager.search("0805", None)?; assert!(!results.is_empty()); let component = manager.get_component("kicad::R_0805_2012Metric")?; assert_eq!(component.category, Some("Resistor_SMD".to_string())); ``` -------------------------------- ### Parse KiCad S-Expression Footprints Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/api/library-format.md Provides an example of a KiCad footprint file and the Rust function signature used for manual S-expression tree walking to extract component metadata. ```lisp (footprint "R_0805_2012Metric" (version 20221018) (generator pcbnew) (layer "F.Cu") (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal") (pad "1" smd roundrect (at -0.9125 0) (size 1.025 1.4) (layers "F.Cu" "F.Paste" "F.Mask") ) ) ``` ```rust fn parse_footprint(sexpr: &lexpr::Value) -> Result { // Navigate Cons cells and recursively search for fields: descr, property, attr, model, pad } ``` -------------------------------- ### Associate 3D Models and Configure Search Paths Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md Illustrates how to link a 3D model file path to a component and configure the library manager to search specific directories for 3D assets. ```rust let component = Component { // ... model_3d_path: Some("models/resistor_0805.step".to_string()), // ... }; manager.set_model_search_paths(vec![ "/usr/share/kicad/3dmodels/".to_string(), ]); ``` -------------------------------- ### CodeYourPCB: Component Definition Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Defines a component on the PCB, specifying its reference designator, type, footprint, value, and position. Rotation is optional. ```cypcb component LED1 led "0805" { value "RED" at 25mm, 15mm } ``` -------------------------------- ### CodeYourPCB: Board Definition Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Defines the physical properties of the PCB, including its name, size (width x height with units), and the number of copper layers. ```cypcb board blink { size 50mm x 30mm layers 2 } ``` -------------------------------- ### CodeYourPCB: Inline Pin Assignment Example Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Assigns nets directly within a component definition, providing a more compact way to define point-to-point connections compared to separate net definitions. ```cypcb component R1 resistor "0402" { value "330" at 15mm, 15mm pin.1 = VCC pin.2 = LED_ANODE } ``` -------------------------------- ### Define Net Connections Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Establishes electrical connectivity between components, including constraints for power rails to ensure proper current handling. ```CodeYourPCB net VCC [current 100mA width 0.3mm] { J1.1 R1.1 C1.1 } net GND { J1.2 LED1.2 C1.2 } net LED_ANODE { R1.2 LED1.1 } ``` -------------------------------- ### Build Production Web Application Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Creates an optimized production build of the web application for static hosting. This command should be run from the `viewer` directory, and the output will be in `viewer/dist/`. ```bash cd viewer npm run build:web ``` -------------------------------- ### CodeYourPCB: Basic Net Definition Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Defines an electrical connection (net) between component pins. It lists the component and pin for each connection point within the net. ```cypcb net VCC { R1.1 } ``` -------------------------------- ### CodeYourPCB: Version Declaration Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md The version declaration must be the first non-comment line in a .cypcb file. It specifies the syntax version used, ensuring compatibility and allowing for future DSL evolution. ```cypcb version 1 ``` -------------------------------- ### CodeYourPCB: Net Definition with Constraints Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/getting-started.md Defines a net with specific electrical and physical constraints, such as current capacity, minimum trace width, and clearance to other nets. Constraints must precede the net's pin list. ```cypcb net VCC [current 100mA width 0.3mm clearance 0.2mm] { R1.1 C1.1 } ``` -------------------------------- ### Component Definition in .cypcb File Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/library-management.md An example of how a component is defined within a '.cypcb' file, utilizing a namespace-prefixed component ID to specify the source and name of the footprint. ```plaintext component R1 resistor "kicad::R_0805_2012Metric" { value "330" at 15mm, 15mm } ``` -------------------------------- ### Project Directory Structure Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Recommended file system layout for organizing multi-board PCB projects, separating mainboard designs, modular sub-components, and custom libraries. ```text product/ ├── mainboard/ │ ├── design/ │ ├── output/ │ └── README.md ├── modules/ │ ├── sensor/ │ ├── power/ │ └── io/ ├── libraries/ │ └── custom/ └── README.md ``` -------------------------------- ### Git Version Tagging for Production Releases Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Shows how to create an annotated Git tag for a specific version, such as a production release, and push these tags to the remote repository. This is crucial for marking stable versions of the PCB design. ```bash git tag -a v1.0 -m "First production version" git push --tags ``` -------------------------------- ### Install WASM Pack Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md Installs `wasm-pack`, a tool for building Rust-generated WebAssembly packages for the web. This is a prerequisite for building WASM modules. ```bash cargo install wasm-pack ``` -------------------------------- ### Conventional Commit Message Example Source: https://github.com/szymontex/codeyourpcb/blob/main/CONTRIBUTING.md An example of a commit message following the conventional commit format. It includes a type, scope, description, and detailed body explaining the changes. ```text feat(library): add FTS5 full-text search for components - Implement BM25 ranking for relevance scoring - Add search filters for manufacturer, package type - Create component_search_fts5 table with automatic sync ``` -------------------------------- ### Viewing PCB Design Changes with Git Diff Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Illustrates how to use `git diff` to view the specific changes made to a PCB design file (`.cypcb`). Since `.cypcb` files are plain text, `git diff` provides a clear, line-by-line comparison of modifications. ```bash git diff design/my_board.cypcb ``` -------------------------------- ### Diagnostic Error and Warning Examples Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/api/lsp-server.md Examples of how syntax errors and Design Rule Check (DRC) violations are represented in the .cypcb language. These diagnostics are captured by the parser and DRC engine to provide visual feedback in the editor. ```cypcb component R1 unknown_type "0805" { // ^^^^^^^^^^^^ // Error: Unknown component type: 'unknown_type' component C1 capacitor "0805" { at 10mm, 10mm } // Warning: Pin C1.1 is not connected to any net // Warning: Pin C1.2 is not connected to any net ``` -------------------------------- ### Git Feature Branch Workflow for PCB Design Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Demonstrates the typical Git commands for creating a new feature branch, adding a PCB design file, committing changes, and pushing to the remote repository. This workflow is essential for collaborative development and managing design iterations. ```bash git checkout -b feature/add-usb-connector # Edit my_board.cypcb git add design/my_board.cypcb git commit -m "feat: add USB-C connector for power input" git push origin feature/add-usb-connector # Create pull request ``` -------------------------------- ### Git Branching for Design Variants Source: https://github.com/szymontex/codeyourpcb/blob/main/docs/user-guide/project-structure.md Explains how to use Git branches to manage different design alternatives or variants of a PCB. This approach allows for parallel development and easy merging of features. ```bash git checkout -b variant/high-power # Modify my_board.cypcb for high-power variant git commit -m "variant: increase trace widths for 5A operation" git checkout main git checkout -b variant/low-cost # Modify my_board.cypcb for cost-optimized variant git commit -m "variant: replace high-end components with generic parts" ```