Skip to content

Commit 2e93eda

Browse files
committed
Merge branch 'development'
2 parents bd3b559 + 197a8c1 commit 2e93eda

11 files changed

Lines changed: 49 additions & 107 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: @module_name@ CI
1+
name: CommandBox Sprint Namer CI
22

33
# Only on Development we build snapshots
44
on:
@@ -8,7 +8,7 @@ on:
88
- master
99

1010
env:
11-
MODULE_ID: @MODULE_SLUG@
11+
MODULE_ID: commandbox-sprint-namer
1212

1313
jobs:
1414
#############################################
@@ -54,6 +54,7 @@ jobs:
5454
run: |
5555
# Create the CommandBox modules folder, for some reason it is not created
5656
mkdir -p ~/.CommandBox/cfml/modules
57+
box link --force
5758
# Build Project with Tests Included
5859
box task run taskfile=build/Build :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
5960

.github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
# Create the CommandBox modules folder, for some reason it is not created
3737
mkdir -p ~/.CommandBox/cfml/modules
3838
# Test away
39+
box link --force
3940
box run-script runTests
4041
4142
- name: Failure Logs

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Dependencies
22
/docbox/**
3+
modules/**
34

45
# Build Artifacts
56
.tmp/**
67
.artifacts/**
7-
changelog-latest.md
8+
changelog-latest.md

ModuleConfig.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
component {
88

9-
this.cfmapping = "@module_slug@";
10-
this.modelNamespace = "@module_slug@";
9+
this.cfmapping = "sprint-namer";
10+
this.modelNamespace = "sprint-namer";
1111

1212
function configure(){
1313
settings = {}

README.md

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,7 @@
1-
# Ortus CommandBox Module Template
1+
# Sprint Name Generator
22

3-
This template can be used to create CommandBox Modules with automation, testing and much more. To use, just click the `Use this Template` button in the github repository: https://github.com/commandbox-modules/commandbox-template and run the setup task from where you cloned it.
3+
A very handy command that you can use to generate Sprint names.
44

55
```bash
6-
box run-script setupTemplate
6+
sprint-namer go
77
```
8-
9-
The `setupTemplate` task will ask you for your module name, id and description and configure the template for you! Enjoy!
10-
11-
# Module Template
12-
13-
This is a CommandBox based module template. Here are some of the tokens to replace to make it your own:
14-
15-
- `@module_name@1` - Human readable name
16-
- `@module_slug@` - The module slug identifier
17-
- `@module_description@` - Module short description
18-
19-
## Directory Layout
20-
21-
Here is a description of the layout of a CommandBox module:
22-
23-
- `.github` - Github workflows
24-
- `build/Build.cfc` - Task that builds, tests and documents your module.
25-
- `build/Tests.cfc` - This is your test harness. Add all your commands to test inside the `run()` method
26-
- `commands` - The commands for you to implement.
27-
- `.cfformat.json` - A CFFormat using the Ortus Standards
28-
- `.cflintrc` - A CFLint configuration file according to Ortus Standards
29-
- `.editorconfig` - Smooth consistency between editors
30-
- `.gitattributes` - Git attributes
31-
- `.gitignore` - Basic ignores. Modify as needed.
32-
- `.markdownlint.json` - A linting file for markdown docs
33-
- `box.json` - The box.json for YOUR module. Modify as needed.
34-
- `changelog.md` - A nice semantic parselog changelog tracking file
35-
- `ModuleConfig.cfc` - Your module's configuration. Modify as needed.
36-
- `readme.md` - Your module's readme. Modify as needed.
37-
38-
## Package Scripts
39-
40-
Your module template comes with several useful package scripts:
41-
42-
| Script | Description |
43-
|-------------------|-----------|
44-
| `build:docs` | Build the API docs using DocBox |
45-
| `build:module` | Build the module distribution with Docs and tests |
46-
| `runTests` | Run the test task: `build/Tests.cfc` |
47-
| `setupTemplate` | Setup the template when cloning |
48-
| `format:check` | Check the formmating of your code |
49-
| `format:watch` | Watch for changes and format your code automatically |
50-
| `format` | Format your code|
51-
| `release` | Runs the `build/release.boxr` recipe, which merges `development` into `master`, tags, auto bumps and pushes to your repo |
52-
53-
## Github Actions Automation
54-
55-
The github actions will clone, test, package, deploy your module to ForgeBox and the Ortus S3 accounts for API Docs and Artifacts. So please make sure the following environment variables are set in your repository. ** Please note that most of them are already defined at the org level **
56-
57-
- `FORGEBOX_TOKEN` - The Ortus ForgeBox API Token
58-
- `AWS_ACCESS_KEY` - The travis user S3 account
59-
- `AWS_ACCESS_SECRET` - The travis secret S3
60-
61-
## API Docs
62-
63-
The build task will take care of building API Docs using DocBox for you but **ONLY** for the `commands` folder in your module. If you want to document more then make sure you modify the `build/Build.cfc` task.

box.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
{
2-
"name":"@MODULE_NAME@",
2+
"name":"CommandBox Sprint Namer",
33
"version":"1.0.0",
4-
"location":"https://downloads.ortussolutions.com/ortussolutions/commandbox-modules/@MODULE_SLUG@/@build.version@/@MODULE_SLUG@-@build.version@.zip",
5-
"slug":"@MODULE_SLUG@",
4+
"location":"https://downloads.ortussolutions.com/ortussolutions/commandbox-modules/commandbox-sprint-namer/@build.version@/commandbox-sprint-namer-@build.version@.zip",
5+
"slug":"commandbox-sprint-namer",
66
"author":"Ortus Solutions, Corp",
7-
"homepage":"https://www.forgebox.io/view/@MODULE_SLUG@",
7+
"homepage":"https://www.forgebox.io/view/commandbox-sprint-namer",
88
"documentation":"https://github.com/commandbox-modules/wiki",
99
"repository":{
1010
"type":"git",
11-
"url":"https://github.com/commandbox-modules/@MODULE_SLUG@"
11+
"url":"https://github.com/commandbox-modules/commandbox-sprint-namer"
1212
},
13-
"bugs":"https://github.com/commandbox-modules/@MODULE_SLUG@/issues",
14-
"shortDescription":"@module_description@",
13+
"bugs":"https://github.com/commandbox-modules/commandbox-sprint-namer/issues",
14+
"shortDescription":"A handy command to generate sprint names",
1515
"type":"commandbox-modules",
16-
"keywords": [],
16+
"keywords":[],
1717
"license":[
1818
{
1919
"type":"Apache2",
2020
"url":"http://www.apache.org/licenses/LICENSE-2.0"
2121
}
2222
],
23-
"contributors":[
24-
],
25-
"devDependencies":{
26-
"commandbox-cfformat":"*",
23+
"contributors":[],
24+
"devDependencies":{
25+
"commandbox-cfformat":"*",
2726
"commandbox-docbox":"*"
2827
},
2928
"dependencies":{
29+
"mockdatacfc":"^3.5.0+5"
3030
},
3131
"installPaths":{
32+
"mockdatacfc":"modules/mockdatacfc/"
3233
},
33-
"ignore":[
34+
"ignore":[
3435
"**/.*",
3536
"test-harness",
36-
"/server*.json"
37+
"/server*.json"
3738
],
3839
"scripts":{
39-
"build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`",
40-
"build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`",
41-
"runTests" : "task run taskFile=build/Build.cfc target=runTests :projectName=`package show slug` :version=`package show version`",
42-
"setupTemplate": "task run taskFile=build/SetupTemplate.cfc",
40+
"build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`",
41+
"build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`",
42+
"runTests":"task run taskFile=build/Build.cfc target=runTests :projectName=`package show slug` :version=`package show version`",
43+
"setupTemplate":"task run taskFile=build/SetupTemplate.cfc",
4344
"format:check":"cfformat check commands,build,ModuleConfig.cfc",
4445
"format:watch":"cfformat watch commands,build,ModuleConfig.cfc",
4546
"format":"cfformat run commands,build,ModuleConfig.cfc --overwrite",

build/Build.cfc

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ component {
3737
} );
3838

3939
// Create Project Dependency Mappings
40-
fileSystemUtil.createMapping( "@module_name@", variables.cwd );
40+
fileSystemUtil.createMapping( "CommandBox Sprint Namer", variables.cwd );
4141

4242
return this;
4343
}
@@ -94,24 +94,8 @@ component {
9494

9595
var sTime = getTickCount();
9696

97-
variables.print
98-
.line()
99-
.boldMagentaLine( "Linking your module..." )
100-
.toConsole();
101-
command( "link --force" ).run();
102-
103-
// Tests First, if they fail then exit
104-
try {
105-
// Run your tests via the `command()` options here.
106-
command( "task run build/Tests.cfc" ).run();
107-
} finally {
108-
// Unlink your module
109-
variables.print
110-
.line()
111-
.boldMagentaLine( "Unlinking your module..." )
112-
.toConsole();
113-
command( "unlink" ).run();
114-
}
97+
// Run your tests via the `command()` options here.
98+
command( "task run build/Tests.cfc" ).run();
11599

116100
// Check Exit Code?
117101
if ( shell.getExitCode() ) {
@@ -236,7 +220,7 @@ component {
236220
.params(
237221
"source" = "commands",
238222
"excludes" = "",
239-
"mapping" = "@module_name@",
223+
"mapping" = "CommandBox Sprint Namer",
240224
"strategy-projectTitle" = "#arguments.projectName# v#arguments.version#",
241225
"strategy-outputDir" = arguments.outputDir
242226
)

build/SetupTemplate.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ component {
3232
command( "tokenReplace" )
3333
.params(
3434
path = "/#variables.cwd#/**",
35-
token = "@MODULE_NAME@",
35+
token = "CommandBox Sprint Namer",
3636
replacement = moduleName
3737
)
3838
.run();
3939

4040
command( "tokenReplace" )
4141
.params(
4242
path = "/#variables.cwd#/**",
43-
token = "@MODULE_SLUG@",
43+
token = "commandbox-sprint-namer",
4444
replacement = moduleSlug
4545
)
4646
.run();
4747

4848
command( "tokenReplace" )
4949
.params(
5050
path = "/#variables.cwd#/**",
51-
token = "@MODULE_DESCRIPTION@",
51+
token = "A handy command to generate sprint names",
5252
replacement = moduleDescription
5353
)
5454
.run();

build/Tests.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ component{
88
* Run my test suites
99
*/
1010
function run(){
11-
command( "hello ?" ).run();
11+
command( "sprint-namer go" ).run();
1212
}
1313
}

commands/sprint-namer/go.cfc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
component excludeFromHelp=true {
2+
3+
property name="mockdata" inject="mockData@mockDatacfc";
4+
5+
function run(){
6+
var name = mockData.mock( "name" : "words:2", $returnType : "struct" ).name;
7+
print.line( "Your sprint name is: #name#" );
8+
}
9+
10+
}

0 commit comments

Comments
 (0)