Skip to content

Commit 6380563

Browse files
committed
Merge branch 'development'
2 parents ab7dbc2 + 51d6509 commit 6380563

File tree

12 files changed

+367
-40
lines changed

12 files changed

+367
-40
lines changed

.github/copilot-instructions.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ColdBox CLI - AI Coding Instructions
2+
3+
This is a CommandBox module providing CLI commands for ColdBox framework development. It generates scaffolded code for handlers, models, views, tests, and complete applications with support for both CFML and BoxLang.
4+
5+
## Architecture & Key Components
6+
7+
**Command Structure**: Commands follow CommandBox's hierarchical structure in `/commands/coldbox/` with subcommands in nested folders (e.g., `create/handler.cfc`, `create/model.cfc`). Each command extends `BaseCommand.cfc` which provides common functionality like BoxLang detection and standardized print methods.
8+
9+
**Template System**: Code generation uses text templates in `/templates/` with token replacement (e.g., `|handlerName|`, `|Description|`). Templates are organized by type and language:
10+
- `/templates/modules/cfml/` - CFML templates
11+
- `/templates/modules/bx/` - BoxLang templates
12+
- `/templates/crud/cfml/` vs `/templates/crud/bx/` - Language-specific variants
13+
14+
**BoxLang Detection**: The `isBoxLangProject()` method in `BaseCommand.cfc` detects BoxLang projects via:
15+
1. Server engine detection (`serverInfo.cfengine` contains "boxlang")
16+
2. Package.json `testbox.runner` setting
17+
3. Package.json `language` property
18+
19+
## Development Workflows
20+
21+
**Command Development**:
22+
- New commands extend `BaseCommand.cfc` and use dependency injection (`property name="utility" inject="utility@coldbox-cli"`)
23+
- Use standardized print methods: `printInfo()`, `printError()`, `printWarn()`, `printSuccess()`
24+
- Commands support `--force` for overwriting and `--open` for opening generated files
25+
26+
**Template Management**:
27+
- Templates use token replacement with `replaceNoCase(content, "|token|", value, "all")`
28+
- BoxLang conversion uses `toBoxLangClass()` to transform `component` to `class`
29+
- Resource generation supports both REST and standard handlers via template selection
30+
31+
**Module Dependencies**: The module lazy-loads `testbox-cli` and `commandbox-migrations` via utility methods `ensureTestBoxModule()` and `ensureMigrationsModule()` only when needed.
32+
33+
## Key Patterns & Conventions
34+
35+
**File Generation Logic**: Commands typically:
36+
1. Resolve and validate paths using `resolvePath()`
37+
2. Read appropriate templates based on `--rest`, `--boxlang` flags
38+
3. Perform token replacements for customization
39+
4. Create directories if they don't exist
40+
5. Generate additional files (views, tests) based on flags
41+
42+
**Cross-Component Integration**:
43+
- Models can generate handlers via `--handler` flag
44+
- Handlers can generate views via `--views` flag
45+
- Resource commands generate full CRUD scaffolding
46+
- Migration and seeder generation integrated with model creation
47+
48+
**Error Handling**: Use `BaseCommand` print methods for consistent user feedback and check file existence before operations when `--force` is not specified.
49+
50+
## Testing & Build
51+
52+
**Build Process**: Uses `/build/Build.cfc` task runner with `box scripts` integration. Run `box build:module` for full build or `box format` for code formatting.
53+
54+
**Template Testing**: The `/tests/` directory contains sample module structure for testing generated code patterns.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions - updates uses: statements in workflows
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Where your .github/workflows/ folder is
6+
schedule:
7+
interval: "weekly"

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
fi
5151
5252
- name: Update changelog [unreleased] with latest version
53-
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
53+
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
5454
if: env.SNAPSHOT == 'false'
5555
with:
5656
changelogPath: ./changelog.md
@@ -118,7 +118,7 @@ jobs:
118118
box forgebox publish --force
119119
120120
- name: Create Github Release
121-
uses: taiki-e/create-gh-release-action@v1.8.0
121+
uses: taiki-e/create-gh-release-action@v1.9.1
122122
continue-on-error: true
123123
if: env.SNAPSHOT == 'false'
124124
with:
@@ -138,7 +138,7 @@ jobs:
138138
steps:
139139
# Checkout development
140140
- name: Checkout Repository
141-
uses: actions/checkout@v3
141+
uses: actions/checkout@v4
142142
with:
143143
ref: development
144144

@@ -148,7 +148,7 @@ jobs:
148148
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
149149

150150
- name: Download build artifacts
151-
uses: actions/download-artifact@v4
151+
uses: actions/download-artifact@v5
152152
with:
153153
name: ${{ env.MODULE_ID }}
154154
path: .tmp

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
cmd: run-script format
2929

3030
- name: Commit Format Changes
31-
uses: stefanzweifel/git-auto-commit-action@v5
31+
uses: stefanzweifel/git-auto-commit-action@v6
3232
with:
3333
commit_message: Apply cfformat changes
3434

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
********************************************************************************
2+
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
3+
www.coldbox.org | www.ortussolutions.com
4+
********************************************************************************
5+
ColdBox is open source. However, if you use this product please know that it is bound to the following License.
6+
If you use ColdBox, please make mention of it in your code or web site or add a Powered By Coldbox icon.
7+
8+
Apache License, Version 2.0
9+
10+
Copyright Since [2005] [Luis Majano and Ortus Solutions,Corp]
11+
12+
Licensed under the Apache License, Version 2.0 (the "License");
13+
you may not use this file except in compliance with the License.
14+
You may obtain a copy of the License at
15+
16+
http://www.apache.org/licenses/LICENSE-2.0
17+
18+
Unless required by applicable law or agreed to in writing, software
19+
distributed under the License is distributed on an "AS IS" BASIS,
20+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
See the License for the specific language governing permissions and
22+
limitations under the License.

0 commit comments

Comments
 (0)