From c8fbe6609759fa2f97a28cedc5554ef073d9d470 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:29:52 +0000 Subject: [PATCH 1/6] Initial plan From 1b90dad1deff95368429a3371405b4fe6bcf40b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:33:53 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20Add=20GitHub=20Copilot=20instru?= =?UTF-8?q?ctions=20for=20CBWIRE=20repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com> --- .github/copilot-instructions.md | 245 ++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..fcbbeca --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,245 @@ +# GitHub Copilot Instructions for CBWIRE + +## Project Overview + +CBWIRE is a ColdBox module that enables developers to build modern, reactive, single-page CFML applications without writing extensive JavaScript or building backend APIs. It's inspired by Laravel Livewire and brings similar reactive component functionality to the CFML ecosystem. + +## Language and Framework + +- **Primary Language**: CFML (ColdFusion Markup Language) +- **Framework**: ColdBox (CFML MVC framework) +- **File Extensions**: `.cfc` (ColdFusion Component), `.cfm` (ColdFusion Markup) +- **CFML Engines Supported**: Lucee 5+, Adobe ColdFusion 2021+, Adobe ColdFusion 2023+ + +## Code Style and Conventions + +### General CFML Conventions + +1. **Component Syntax**: Use script-based component syntax (not tag-based) +2. **Function Casing**: + - Built-in functions: Follow CFDocs casing conventions + - User-defined functions: camelCase +3. **Indentation**: Use tabs (4 spaces equivalent) +4. **Line Length**: Maximum 120 characters +5. **Quotes**: Use double quotes for strings +6. **Struct Separator**: Use ` : ` (space-colon-space) for struct key-value pairs + +### Code Formatting + +This project uses `commandbox-cfformat` for automatic code formatting. The configuration is in `.cfformat.json`. Key formatting rules: + +- Tab indentation (4 spaces) +- Double quotes for strings +- Padding inside parentheses, brackets, and struct literals +- Arrays/structs split to multiple lines when > 40 characters or > 2 elements +- Binary operators should have padding +- Block spacing: spaced between keywords and blocks + +To format code: + +```bash +box run-script format +``` + +To check formatting: + +```bash +box run-script format:check +``` + +### Component Structure + +Components should follow this general structure: + +```cfml +component { + // Properties at the top + property name="propertyName" type="string"; + + // Constructor/init method + function init() { + return this; + } + + // Public methods + public function publicMethod() { + // implementation + } + + // Private methods + private function privateMethod() { + // implementation + } +} +``` + +## Project Structure + +- `/models/` - Core CBWIRE models and components + - `ComponentLoader.cfc` - Loads wire components + - `preprocessor/` - Template preprocessing components + - `SingleFileComponentBuilder.cfc` - Builds single-file components +- `/handlers/` - HTTP request handlers +- `/interceptors/` - ColdBox interceptors for CBWIRE lifecycle +- `/views/` - View templates +- `/helpers/` - Helper functions and utilities +- `/test-harness/` - Testing application + - `/tests/` - TestBox test suites + - `/wires/` - Example wire components for testing +- `/includes/` - Static assets (CSS, JS) +- `ModuleConfig.cfc` - Module configuration and settings + +## Build and Test + +### Package Manager + +This project uses **CommandBox** as its package manager and CLI tool. + +### Installing Dependencies + +```bash +# Install main dependencies +box install + +# Install test harness dependencies +cd test-harness && box install +``` + +### Running Tests + +Tests use **TestBox** framework and run on multiple CFML engines: + +```bash +# Start test server (from test-harness directory) +cd test-harness +box server start + +# Run tests +box testbox run +``` + +The CI runs tests against: + +- Lucee 5 +- Adobe ColdFusion 2021 +- Adobe ColdFusion 2023 + +### Building Documentation + +```bash +box run-script build:docs +``` + +## Development Guidelines + +### Creating Wire Components + +Wire components are reactive CFML components stored in `/wires/` (configurable). They should: + +1. Extend the base CBWIRE component +2. Define data properties that will be reactive +3. Implement action methods that can be called from the frontend +4. Use lifecycle methods when needed (mount, hydrate, etc.) + +Example wire component: + +```cfml +component extends="cbwire.models.Component" { + + data = { + "message": "Hello World" + }; + + function updateMessage( newMessage ) { + data.message = newMessage; + } +} +``` + +### Adding New Features + +1. Create models in `/models/` if adding core functionality +2. Add tests in `/test-harness/tests/specs/` +3. Update documentation if needed +4. Run tests locally before committing +5. Format code with `box run-script format` + +### Testing Requirements + +- Write TestBox specs for new functionality +- Place specs in `/test-harness/tests/specs/` +- Follow existing test patterns (BDD style with `describe()` and `it()`) +- Ensure tests pass on all supported CFML engines +- Test files should end with `Spec.cfc` + +Example test structure: + +```cfml +component extends="coldbox.system.testing.BaseTestCase" { + + function run() { + describe("Feature Name", function() { + it("should do something specific", function() { + expect( result ).toBe( expected ); + }); + }); + } +} +``` + +## Configuration + +### Module Settings + +Module settings are defined in `ModuleConfig.cfc`: + +- `autoInjectAssets` - Auto-include CSS/JS assets +- `moduleRootPath` - Physical path to module +- `moduleRootURL` - URL to module root +- `throwOnMissingSetterMethod` - Throw exception on missing setters +- `wiresLocation` - Folder name for wire components (default: "wires") +- `trimStringValues` - Trim string properties +- `showProgressBar` - Enable progress bar with wire:navigate +- `progressBarColor` - Progress bar color + +## Dependencies + +- **cbcsrf**: CSRF protection module (required dependency) +- See `box.json` for current version constraints + +## Common Patterns + +### Dependency Injection + +Use ColdBox's WireBox for dependency injection: + +```cfml +property name="serviceName" inject="ServiceName@module"; +``` + +### Settings Access + +Access module settings: + +```cfml +variables.settings = getModuleSettings( "cbwire" ); +``` + +### Route Definitions + +Routes are defined in `ModuleConfig.cfc` under the `routes` array. + +## Documentation + +- Official Docs: https://cbwire.ortusbooks.com/ +- Repository: https://github.com/coldbox-modules/cbwire +- Issue Tracker: https://github.com/coldbox-modules/cbwire/issues + +## Additional Notes + +- This is a module for ColdBox, not a standalone application +- The project includes a test-harness which is a full ColdBox application for testing +- JavaScript assets are in `/includes/js/` and are part of the Livewire integration +- The project uses GitHub Actions for CI/CD (see `.github/workflows/`) +- Semantic versioning is followed +- Code is published to ForgeBox (CFML package registry) From fc9111b4832f59deb82821b0671a9306d6cf9125 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:35:38 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=93=9D=20Improve=20Copilot=20instruct?= =?UTF-8?q?ions=20accuracy=20and=20completeness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com> --- .github/copilot-instructions.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fcbbeca..aef798f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,7 +28,7 @@ CBWIRE is a ColdBox module that enables developers to build modern, reactive, si This project uses `commandbox-cfformat` for automatic code formatting. The configuration is in `.cfformat.json`. Key formatting rules: -- Tab indentation (4 spaces) +- Tab indentation (actual tab characters with display width of 4 spaces) - Double quotes for strings - Padding inside parentheses, brackets, and struct literals - Arrays/structs split to multiple lines when > 40 characters or > 2 elements @@ -120,9 +120,9 @@ box testbox run The CI runs tests against: -- Lucee 5 -- Adobe ColdFusion 2021 -- Adobe ColdFusion 2023 +- Lucee 5+ +- Adobe ColdFusion 2021+ +- Adobe ColdFusion 2023+ ### Building Documentation @@ -193,14 +193,14 @@ component extends="coldbox.system.testing.BaseTestCase" { Module settings are defined in `ModuleConfig.cfc`: -- `autoInjectAssets` - Auto-include CSS/JS assets +- `autoInjectAssets` - Auto-include CSS/JS assets (default: `true`) - `moduleRootPath` - Physical path to module -- `moduleRootURL` - URL to module root -- `throwOnMissingSetterMethod` - Throw exception on missing setters -- `wiresLocation` - Folder name for wire components (default: "wires") -- `trimStringValues` - Trim string properties -- `showProgressBar` - Enable progress bar with wire:navigate -- `progressBarColor` - Progress bar color +- `moduleRootURL` - URL to module root (default: `"/modules/cbwire"`) +- `throwOnMissingSetterMethod` - Throw exception on missing setters (default: `false`) +- `wiresLocation` - Folder name for wire components (default: `"wires"`) +- `trimStringValues` - Trim string properties (default: `false`) +- `showProgressBar` - Enable progress bar with wire:navigate (default: `true`) +- `progressBarColor` - Progress bar color (default: `"#2299dd"`) ## Dependencies From 659963c335b7defa0017b523211ee9ccde0e4d45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:36:45 +0000 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A7=20Clarify=20indentation=20and?= =?UTF-8?q?=20module=20path=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com> --- .github/copilot-instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index aef798f..edf8edd 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,7 +19,7 @@ CBWIRE is a ColdBox module that enables developers to build modern, reactive, si 2. **Function Casing**: - Built-in functions: Follow CFDocs casing conventions - User-defined functions: camelCase -3. **Indentation**: Use tabs (4 spaces equivalent) +3. **Indentation**: Use actual tab characters (display width: 4 spaces) 4. **Line Length**: Maximum 120 characters 5. **Quotes**: Use double quotes for strings 6. **Struct Separator**: Use ` : ` (space-colon-space) for struct key-value pairs @@ -194,7 +194,7 @@ component extends="coldbox.system.testing.BaseTestCase" { Module settings are defined in `ModuleConfig.cfc`: - `autoInjectAssets` - Auto-include CSS/JS assets (default: `true`) -- `moduleRootPath` - Physical path to module +- `moduleRootPath` - Physical path to module (computed from module location) - `moduleRootURL` - URL to module root (default: `"/modules/cbwire"`) - `throwOnMissingSetterMethod` - Throw exception on missing setters (default: `false`) - `wiresLocation` - Folder name for wire components (default: `"wires"`) From 7da81e43673c507ce0cdffcd0d86175fe8b1742b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:38:24 +0000 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9C=A8=20Improve=20code=20examples=20wit?= =?UTF-8?q?h=20best=20practices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com> --- .github/copilot-instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index edf8edd..d70990c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,7 +19,7 @@ CBWIRE is a ColdBox module that enables developers to build modern, reactive, si 2. **Function Casing**: - Built-in functions: Follow CFDocs casing conventions - User-defined functions: camelCase -3. **Indentation**: Use actual tab characters (display width: 4 spaces) +3. **Indentation**: Use tab characters for indentation (configured to display as 4 spaces width) 4. **Line Length**: Maximum 120 characters 5. **Quotes**: Use double quotes for strings 6. **Struct Separator**: Use ` : ` (space-colon-space) for struct key-value pairs @@ -150,7 +150,7 @@ component extends="cbwire.models.Component" { "message": "Hello World" }; - function updateMessage( newMessage ) { + public function updateMessage( required string newMessage ) { data.message = newMessage; } } From d1bcf3293fdc76d7e55680b1ce2511516d426237 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 12:49:56 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=93=9D=20Add=20BoxLang=20as=20primary?= =?UTF-8?q?=20language=20in=20Copilot=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com> --- .github/copilot-instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d70990c..b21448c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -6,10 +6,10 @@ CBWIRE is a ColdBox module that enables developers to build modern, reactive, si ## Language and Framework -- **Primary Language**: CFML (ColdFusion Markup Language) +- **Primary Languages**: CFML (ColdFusion Markup Language), BoxLang - **Framework**: ColdBox (CFML MVC framework) -- **File Extensions**: `.cfc` (ColdFusion Component), `.cfm` (ColdFusion Markup) -- **CFML Engines Supported**: Lucee 5+, Adobe ColdFusion 2021+, Adobe ColdFusion 2023+ +- **File Extensions**: `.cfc` (ColdFusion Component), `.cfm` (ColdFusion Markup), `.bx` (BoxLang) +- **CFML Engines Supported**: Lucee 5+, Adobe ColdFusion 2021+, Adobe ColdFusion 2023+, BoxLang 1+ ## Code Style and Conventions