Skip to content

Commit cc27fdc

Browse files
committed
Merge branch 'development'
# Conflicts: # .cfformat.json
2 parents 3c798ef + cbe7b52 commit cc27fdc

40 files changed

+729
-311
lines changed

.cfformat.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"array.empty_padding": false,
33
"array.padding": true,
44
"array.multiline.min_length": 40,
5-
"array.multiline.element_count": 4,
5+
"array.multiline.element_count": 2,
66
"array.multiline.leading_comma.padding": true,
77
"array.multiline.leading_comma": false,
88
"alignment.consecutive.assignments": true,
@@ -17,19 +17,19 @@
1717
"function_call.multiline.leading_comma.padding": true,
1818
"function_call.casing.builtin": "cfdocs",
1919
"function_call.casing.userdefined": "camel",
20-
"function_call.multiline.element_count": 4,
20+
"function_call.multiline.element_count": 2,
2121
"function_call.multiline.leading_comma": false,
2222
"function_call.multiline.min_length": 40,
2323
"function_declaration.padding": true,
2424
"function_declaration.empty_padding": false,
2525
"function_declaration.multiline.leading_comma": false,
2626
"function_declaration.multiline.leading_comma.padding": true,
27-
"function_declaration.multiline.element_count": 4,
27+
"function_declaration.multiline.element_count": 2,
2828
"function_declaration.multiline.min_length": 40,
2929
"function_declaration.group_to_block_spacing": "compact",
3030
"function_anonymous.empty_padding": false,
3131
"function_anonymous.group_to_block_spacing": "compact",
32-
"function_anonymous.multiline.element_count": 4,
32+
"function_anonymous.multiline.element_count": 2,
3333
"function_anonymous.multiline.leading_comma": false,
3434
"function_anonymous.multiline.leading_comma.padding": true,
3535
"function_anonymous.multiline.min_length": 40,
@@ -42,9 +42,11 @@
4242
"keywords.spacing_to_group": true,
4343
"keywords.empty_group_spacing": false,
4444
"max_columns": 120,
45-
"metadata.multiline.element_count": 4,
45+
"metadata.multiline.element_count": 3,
4646
"metadata.multiline.min_length": 40,
47-
"property.multiline.element_count": 4,
47+
"method_call.chain.multiline" : 3,
48+
"newline":"\n",
49+
"property.multiline.element_count": 3,
4850
"property.multiline.min_length": 40,
4951
"parentheses.padding": true,
5052
"strings.quote": "double",
@@ -54,7 +56,7 @@
5456
"struct.empty_padding": false,
5557
"struct.multiline.leading_comma": false,
5658
"struct.multiline.leading_comma.padding": true,
57-
"struct.multiline.element_count": 4,
59+
"struct.multiline.element_count": 2,
5860
"struct.multiline.min_length": 40,
5961
"tab_indent": true
6062
}

.markdownlint.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"line-length": false,
3+
"single-h1": false,
4+
"no-hard-tabs" : false,
5+
"fenced-code-language" : false,
6+
"no-bare-urls" : false,
7+
"first-line-h1": false,
8+
"no-multiple-blanks": {
9+
"maximum": 2
10+
},
11+
"no-duplicate-header" : {
12+
"siblings_only" : true
13+
}
14+
}

.travis.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,21 @@ sudo: required
2525
before_install:
2626
# CommandBox Keys
2727
- curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add -
28-
- sudo echo "deb https://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
28+
- sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
2929
/etc/apt/sources.list.d/commandbox.list
3030

3131
install:
3232
# Install Commandbox
3333
- sudo apt-get update && sudo apt-get --assume-yes install rsync jq commandbox
3434
# Install CommandBox Supporting Librarires
35-
- box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox,commandbox-cfformat
35+
- box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox
3636
# If using auto-publish, you will need to provide your API token with this line:
3737
- box config set endpoints.forgebox.APIToken=$FORGEBOX_API_TOKEN > /dev/null
3838

3939
script:
40-
# Set Current Version
40+
# Set Current Version and Travis Tag
4141
- TARGET_VERSION=`cat $TRAVIS_BUILD_DIR/box.json | jq '.version' -r`
42+
- TRAVIS_TAG=${TARGET_VERSION}
4243
- echo "Starting build for ${MODULE_ID} v${TARGET_VERSION}"
4344
# Replace version so builder can issue it
4445
@@ -57,7 +58,7 @@ script:
5758
# Build Project
5859
- box task run taskfile=build/Build target=run :version=${TARGET_VERSION} :projectName=${MODULE_ID} :buildID=${TRAVIS_BUILD_NUMBER} :branch=${TRAVIS_BRANCH}
5960
# Cat results for debugging
60-
- cat build/results.json
61+
#- cat build/results.json
6162

6263
after_failure:
6364
- cd $TRAVIS_BUILD_DIR/test-harness
@@ -100,9 +101,26 @@ deploy:
100101
upload-dir: coldbox-modules/$MODULE_ID/$TARGET_VERSION
101102
acl: public_read
102103

104+
# Github Release only on Master
105+
- provider: releases
106+
api_key: ${GITHUB_TOKEN}
107+
on:
108+
branch:
109+
- master
110+
condition: "$ENGINE = lucee@5"
111+
skip_cleanup: true
112+
edge: true
113+
file_glob: true
114+
file: $TRAVIS_BUILD_DIR/.artifacts/$MODULE_ID/**/*
115+
release_notes_file: changelog.md
116+
name: v${TRAVIS_TAG}
117+
tag_name: v${TRAVIS_TAG}
118+
overwrite: true
119+
120+
# Once API Docs and Binaries are deployed to S3 Publish to ForgeBox
103121
after_deploy:
104122
# Move to build out artifact
105123
- cd ${TRAVIS_BUILD_DIR}/.tmp/${MODULE_ID}
106124
- cat box.json
107-
# Only publish once
125+
# Only publish once using the lucee matrix
108126
- if [ ${ENGINE} = 'lucee@5' ]; then box forgebox publish; fi

ModuleConfig.cfc

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,76 @@
11
/**
2-
*********************************************************************************
3-
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4-
* www.coldbox.org | www.luismajano.com | www.ortussolutions.com
5-
********************************************************************************
6-
*/
7-
component{
2+
*********************************************************************************
3+
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4+
* www.coldbox.org | www.luismajano.com | www.ortussolutions.com
5+
********************************************************************************
6+
*/
7+
component {
88

99
// Module Properties
10-
this.title = "validation";
11-
this.author = "Luis Majano";
12-
this.webURL = "http://www.ortussolutions.com";
13-
this.description = "This module provides server-side validation to ColdBox applications";
14-
this.version = "@build.version@[email protected]@";
10+
this.title = "validation";
11+
this.author = "Luis Majano";
12+
this.webURL = "http://www.ortussolutions.com";
13+
this.description = "This module provides server-side validation to ColdBox applications";
14+
this.version = "@build.version@[email protected]@";
1515
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
16-
this.viewParentLookup = true;
16+
this.viewParentLookup = true;
1717
// If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
18-
this.layoutParentLookup = true;
18+
this.layoutParentLookup = true;
1919
// Model Namespace
20-
this.modelNamespace = "cbvalidation";
20+
this.modelNamespace = "cbvalidation";
2121
// CF Mapping
22-
this.cfmapping = "cbvalidation";
22+
this.cfmapping = "cbvalidation";
2323
// Auto-map models
24-
this.autoMapModels = true;
24+
this.autoMapModels = true;
2525
// Module Dependencies That Must Be Loaded First, use internal names or aliases
26-
this.dependencies = [ "cbi18n" ];
26+
this.dependencies = [ "cbi18n" ];
2727
// ColdBox Static path to validation manager
2828
this.COLDBOX_VALIDATION_MANAGER = "cbvalidation.models.ValidationManager";
2929

3030
/**
31-
* Configure module
32-
*/
31+
* Configure module
32+
*/
3333
function configure(){
3434
// Mixin our own methods on handlers, interceptors and views via the ColdBox UDF Library File setting
35-
arrayAppend( controller.getSetting( "ApplicationHelper" ), "#moduleMapping#/models/Mixins.cfm" );
35+
arrayAppend(
36+
controller.getSetting( "ApplicationHelper" ),
37+
"#moduleMapping#/models/Mixins.cfm"
38+
);
3639
}
3740

3841
/**
39-
* Fired when the module is registered and activated.
40-
*/
42+
* Fired when the module is registered and activated.
43+
*/
4144
function onLoad(){
4245
var configSettings = controller.getConfigSettings();
4346
// parse parent settings
4447
parseParentSettings();
4548
// Did you change the validation manager?
46-
if( configSettings.validation.manager != this.COLDBOX_VALIDATION_MANAGER ){
47-
binder.map( alias="validationManager@cbvalidation", force=true )
49+
if ( configSettings.validation.manager != this.COLDBOX_VALIDATION_MANAGER ) {
50+
binder
51+
.map(
52+
alias = "validationManager@cbvalidation",
53+
force = true
54+
)
4855
.to( configSettings.validation.manager )
4956
.asSingleton();
5057
}
5158
// setup shared constraints
52-
wirebox.getInstance( "validationManager@cbvalidation" )
59+
wirebox
60+
.getInstance( "validationManager@cbvalidation" )
5361
.setSharedConstraints( configSettings.validation.sharedConstraints );
5462
}
5563

5664
/**
57-
* Fired when the module is unregistered and unloaded
58-
*/
65+
* Fired when the module is unregistered and unloaded
66+
*/
5967
function onUnload(){
6068
var appHelperArray = controller.getSetting( "ApplicationHelper" );
61-
var mixinToRemove = "#moduleMapping#/models/Mixins.cfm";
62-
var mixinIndex = arrayFindNoCase( appHelperArray, mixinToRemove );
63-
69+
var mixinToRemove = "#moduleMapping#/models/Mixins.cfm";
70+
var mixinIndex = arrayFindNoCase( appHelperArray, mixinToRemove );
71+
6472
// If the mixin is in the array
65-
if( mixinIndex ) {
73+
if ( mixinIndex ) {
6674
// Remove it
6775
arrayDeleteAt( appHelperArray, mixinIndex );
6876
// Arrays passed by value in Adobe CF
@@ -71,13 +79,13 @@ component{
7179
}
7280

7381
/**
74-
* Prepare settings and returns true if using i18n else false.
75-
*/
82+
* Prepare settings and returns true if using i18n else false.
83+
*/
7684
private function parseParentSettings(){
7785
/**
78-
Sample:
86+
Sample :
7987
validation = {
80-
manager = "class path" // if overriding
88+
manager = "class path" // if overriding
8189
sharedConstraints = {
8290
name = {
8391
field = { constraints here }
@@ -87,23 +95,31 @@ component{
8795
}
8896
*/
8997
// Read parent application config
90-
var oConfig = controller.getSetting( "ColdBoxConfig" );
91-
var validationDSL = oConfig.getPropertyMixin( "validation", "variables", structnew() );
92-
var configStruct = controller.getConfigSettings();
98+
var oConfig = controller.getSetting( "ColdBoxConfig" );
99+
var validationDSL = oConfig.getPropertyMixin(
100+
"validation",
101+
"variables",
102+
structNew()
103+
);
104+
var configStruct = controller.getConfigSettings();
93105

94106
// Default Config Structure
95107
configStruct.validation = {
96-
manager = this.COLDBOX_VALIDATION_MANAGER,
97-
sharedConstraints = {}
108+
manager : this.COLDBOX_VALIDATION_MANAGER,
109+
sharedConstraints : {}
98110
};
99111

100112
// manager
101-
if( structKeyExists( validationDSL, "manager" ) ){
113+
if ( structKeyExists( validationDSL, "manager" ) ) {
102114
configStruct.validation.manager = validationDSL.manager;
103115
}
104116
// shared constraints
105-
if( structKeyExists( validationDSL, "sharedConstraints" ) ){
106-
structAppend( configStruct.validation.sharedConstraints, validationDSL.sharedConstraints, true );
117+
if ( structKeyExists( validationDSL, "sharedConstraints" ) ) {
118+
structAppend(
119+
configStruct.validation.sharedConstraints,
120+
validationDSL.sharedConstraints,
121+
true
122+
);
107123
}
108124
}
109125

box.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"ColdBox Validation",
33
"author":"Ortus Solutions <[email protected]>",
4-
"version":"2.1.0",
4+
"version":"2.2.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbvalidation/@build.version@/[email protected]@.zip",
66
"slug":"cbvalidation",
77
"type":"modules",
@@ -31,9 +31,9 @@
3131
".git*"
3232
],
3333
"scripts":{
34-
"toMaster":"recipe build/toMaster.boxr",
35-
"format":"cfformat run models/**/*.cfc,ModuleConfig.cfc,tests/specs/**/*.cfc,*.cfc --overwrite",
36-
"format:check":"cfformat run models/**/*.cfc,ModuleConfig.cfc,tests/specs/**/*.cfc,*.cfc --check",
37-
"lint":"cflint models/**.cfc --text --html --json --!exitOnError --suppress"
34+
"release":"recipe build/release.boxr",
35+
"format":"cfformat run models/,test-harness/tests/,*.cfc --overwrite",
36+
"format:watch":"cfformat watch models/,test-harness/tests/,*.cfc ./.cfformat.json",
37+
"format:check":"cfformat check models/,test-harness/tests/,*.cfc"
3838
}
3939
}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# This recipe signifies a new release of the module by doing merges and bumps accordingly
22

3-
# Check out master
3+
# Check out master and update it locally
44
!git checkout -f master
5-
# Merge development into it
5+
!git pull origin master
6+
7+
# Merge development into it for release
68
!git merge --no-ff development
7-
# Tag the master repo with the version in box.json
9+
10+
# Tag the master repo with the version from box.json
811
!git tag v`box package show version`
9-
# Push all branches
12+
13+
# Push all branches back out to github
1014
!git push origin --all
15+
1116
# Push all tags
1217
!git push origin --tags
18+
1319
# Check development again
1420
!git checkout -f development
21+
1522
# Bump to prepare for a new release, do minor, change if needed and don't tag
1623
bump --minor --!tagVersion
17-
# Send it out
1824
!git commit -a -m "version bump"
1925
!git push origin development

0 commit comments

Comments
 (0)