Thinking
Modularly
Modern CFML
Brad Wood
@bdw429s
What is a package?
Reusable, self contained, self describing, versioned code, functionality, or
application building blocks.
● A folder
● A box.json file
● Some code
A package could be a single UDF or an entire CMS. What makes it portable is the
agreed format of packaging, distribution, and installation.
What is a module?
A Box module is everything a package is, but with additional conventions and
lifecycle methods defined by ColdBox, ContentBox, CommandBox, etc.
● A folder
● A box.json file
● A ModuleConfig.cfc
● Some code
A Module could be a single interceptor or an entire shopping cart. Box modules are
“active” the framework loads them and they can run custom logic on registration as
well as contribute behaviors or functionality to the base app.
● Forgebox
○ https://www.forgebox.io
● HTTP(S)
○ http://mysite.com/myPackage.zip
● Git
○ git@github.com:bdw429s/commandbox-fusionreactor.git
● GitHub
○ bdw429s/commandbox-fusionreactor
● Local file/folder
○ C:/folder/myPackage.zip
● Jars
○ https://search.maven.org/remotecontent?filepath=org/jline/jline/3.7.0/jline-3.7.0.jar
Installing Packages
● ColdBox modules
○ cborm, cbvalidation, cbmessagebox
● CommandBox modules
○ Fusion-reactor, bullet train, host updater
● Non-box frameworks/CMSs
○ Preside, FW/1, CFWheels
● Total standalone stuff
○ SecurityUtil, BrewPunk API
ForgeBox.io
● Packages can depend on other packages
● Promotes reusability and smaller, single-purpose packages
● cborm
○ cbvalidation
■ Cb18n
● Dev dependencies
○ Only required for developing on the project (like testing frameworks)
○ Don’t want installed on production
○ Use “install --production” to skip
Package Dependencies
CFConfig Example
● Commandbox-cfconfig
○ cfconfig-services
■ lucee-password-util
■ JSONPrettyPrint
■ Adobe-password-util
● propertyFile
■ semver
■ propertyFile
Turn any folder into a package with one CLI command:
package init
Want some hand holding?
package init --wizard
Set additional metadata with:
package set name=”My Package”
Let’s create a package
Scaffold out a new module with one CLI command:
coldbox create module myModule
Let’s take a look at the ModuleConfig.cfc
component {
function configure() {
}
}
Let’s create a module
modules/
These are modules managed by CommandBox. Usually 3rd party. Not committed to
source control.
modules_app/
These are modules that are a core part of your app that you want to be part of the
main source repo. CommandBox doesn’t not manage them.
Box Module Locations
A ForgeBox account is free, easy, and let’s you publish packages and collaborators
forgebox register
Already have a ForgeBox account?
forgebox login
Create a ForgeBox account
● What happens when your code changes?
● You need to increment the version!
● Semantic versioning
○ Major
○ Minor
○ Patch
○ Prerelease Identifier
○ Build ID
Versioning
❏ 5
❏ 3.2
❏ 1.7.8
❏ 1.2.3-alpha
❏ 5.6+0045
❏ 2-beta.3
❏ 1.2.3-rc.4+9876
Semver Ranges
● Give me the latest version that starts with 5
○ 5.x
● Any version greater than 1.0.0 starting with 1.0.1
○ >1.0.0
● Any version between 2.0.0 and 2.5.0 inclusive
○ >=2.0.0 <=2.5.0
○ 2.0.0 - 2.5.0
● Any one of these exact versions
○ 1.0.0 || 2.0.0 || 3.0.0
● Allows 1.2.4 and 1.3, but not 2.0 (same as 1.x.x)
○ ^1.2.3
From the CLI
install coldbox@4.3
install testbox@<=2.6
In your box.json
“dependencies” : {
“coldbox” : “4.3”,
“Testbox” : “<=2.6”
}
Install a Specific Version
Automatically increment version numbers in box.json
● bump --major
● bump --minor
● bump --patch
If package is a Git repo, a tag will be created that matches the version number.
This helps “lock in” the exact commit of this version.
Bump Command
● Arbitrary commands of your choice to run at interception points
● postVersion
● onRelease
● postPublish
● Ties multiple steps together
● Automates repetitive bits
● Boils releasing down to a single command
"scripts" : {
"postVersion":"package set location='Ortus-Solutions/commandbox-cfconfig#v`package version`'",
"onRelease":"publish",
"postPublish":"!git push --follow-tags",
}
Package Scripts
A nice tool for scaffolding box modules complete with tests, Travis-CI builds, and
package scripts.
module scaffold myCoolModule
https://www.forgebox.io/view/cb-module-template
cbModuleTemplate Module
● Your code
● Frameworks
● 3rd party modules
● Your modules
● Git ignores
● box.json
● “Install” command
● --production flag
Building Your Apps

More Related Content

PDF
MySQL Compatible Open Source Connectors
ODP
#1 Backend Meetup - Symfony 2 - wstęp
PPTX
Advantages and disadvantages of a monorepo
PPTX
Master the Monorepo
PPTX
Edius and K2 Connect in FTP mode
ODP
Comparison between OpenERP v6.1 and v7
 
PDF
Do you speak vcl
PDF
Do you speak VCL?
MySQL Compatible Open Source Connectors
#1 Backend Meetup - Symfony 2 - wstęp
Advantages and disadvantages of a monorepo
Master the Monorepo
Edius and K2 Connect in FTP mode
Comparison between OpenERP v6.1 and v7
 
Do you speak vcl
Do you speak VCL?

Similar to Itb2018 thinking modularly (20)

PDF
Intro To CommandBox CLI,Package Manager, Server at the Japan CFUG
PDF
CommandBox & ForgeBox Package Management
PDF
ITB2016 - ForgeBox 2 Package Management
PDF
Command Box ColdFusion Package Manager, Automation
ODP
CommandBox REPL, CLI, and Package Manager
PPTX
Command box, Package Manager, Automation, REPL
PDF
CommandBox at CFCamp 2014
PDF
CommandBox : Free CFML
PDF
Command box
PDF
Command box
PDF
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
PDF
Into The Box 2018 Ortus Keynote
PPTX
ITB2015 - Go Commando with CommandBox CLI
PDF
ITB2017 - Keynote
PDF
ITB2019 ForgeBox Enterprise : Private Software Directory - Javier Quintero
PDF
Cold box hierarchical mvc
PDF
ITB2019 Scaling with CommandBox in Production! - Brad Wood
PDF
Itb2018 cf apps to dev to production with command box cf-config docker
PDF
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
PDF
Brad Wood 5 command box modules you should be using
Intro To CommandBox CLI,Package Manager, Server at the Japan CFUG
CommandBox & ForgeBox Package Management
ITB2016 - ForgeBox 2 Package Management
Command Box ColdFusion Package Manager, Automation
CommandBox REPL, CLI, and Package Manager
Command box, Package Manager, Automation, REPL
CommandBox at CFCamp 2014
CommandBox : Free CFML
Command box
Command box
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
Into The Box 2018 Ortus Keynote
ITB2015 - Go Commando with CommandBox CLI
ITB2017 - Keynote
ITB2019 ForgeBox Enterprise : Private Software Directory - Javier Quintero
Cold box hierarchical mvc
ITB2019 Scaling with CommandBox in Production! - Brad Wood
Itb2018 cf apps to dev to production with command box cf-config docker
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad Wood 5 command box modules you should be using
Ad

More from Ortus Solutions, Corp (20)

PDF
BoxLang in Japan - The Future is Dynamic.pdf
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
PDF
What's New with BoxLang Led by Brad Wood.pdf
PDF
Vector Databases and the BoxLangCFML Developer.pdf
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
PDF
Use JSON to Slash Your Database Performance.pdf
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
PDF
Supercharging CommandBox with Let's Encrypt.pdf
PDF
Spice up your site with cool animations using GSAP..pdf
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
BoxLang in Japan - The Future is Dynamic.pdf
BoxLang Dynamic AWS Lambda - Japan Edition
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
June Webinar: BoxLang-Dynamic-AWS-Lambda
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
What's New with BoxLang Led by Brad Wood.pdf
Vector Databases and the BoxLangCFML Developer.pdf
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Use JSON to Slash Your Database Performance.pdf
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Supercharging CommandBox with Let's Encrypt.pdf
Spice up your site with cool animations using GSAP..pdf
Passkeys and cbSecurity Led by Eric Peterson.pdf
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Ad

Recently uploaded (20)

PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
SaaS reusability assessment using machine learning techniques
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
The AI Revolution in Customer Service - 2025
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Examining Bias in AI Generated News Content.pdf
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Altius execution marketplace concept.pdf
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Auditboard EB SOX Playbook 2023 edition.
 
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
CEH Module 2 Footprinting CEH V13, concepts
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Build Real-Time ML Apps with Python, Feast & NoSQL
SaaS reusability assessment using machine learning techniques
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
The AI Revolution in Customer Service - 2025
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Examining Bias in AI Generated News Content.pdf
A symptom-driven medical diagnosis support model based on machine learning te...
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Altius execution marketplace concept.pdf
Early detection and classification of bone marrow changes in lumbar vertebrae...
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Auditboard EB SOX Playbook 2023 edition.
 
SGT Report The Beast Plan and Cyberphysical Systems of Control
Advancing precision in air quality forecasting through machine learning integ...
Electrocardiogram sequences data analytics and classification using unsupervi...
Lung cancer patients survival prediction using outlier detection and optimize...
CEH Module 2 Footprinting CEH V13, concepts
AI-driven Assurance Across Your End-to-end Network With ThousandEyes

Itb2018 thinking modularly

  • 2. What is a package? Reusable, self contained, self describing, versioned code, functionality, or application building blocks. ● A folder ● A box.json file ● Some code A package could be a single UDF or an entire CMS. What makes it portable is the agreed format of packaging, distribution, and installation.
  • 3. What is a module? A Box module is everything a package is, but with additional conventions and lifecycle methods defined by ColdBox, ContentBox, CommandBox, etc. ● A folder ● A box.json file ● A ModuleConfig.cfc ● Some code A Module could be a single interceptor or an entire shopping cart. Box modules are “active” the framework loads them and they can run custom logic on registration as well as contribute behaviors or functionality to the base app.
  • 4. ● Forgebox ○ https://www.forgebox.io ● HTTP(S) ○ http://mysite.com/myPackage.zip ● Git ○ [email protected]:bdw429s/commandbox-fusionreactor.git ● GitHub ○ bdw429s/commandbox-fusionreactor ● Local file/folder ○ C:/folder/myPackage.zip ● Jars ○ https://search.maven.org/remotecontent?filepath=org/jline/jline/3.7.0/jline-3.7.0.jar Installing Packages
  • 5. ● ColdBox modules ○ cborm, cbvalidation, cbmessagebox ● CommandBox modules ○ Fusion-reactor, bullet train, host updater ● Non-box frameworks/CMSs ○ Preside, FW/1, CFWheels ● Total standalone stuff ○ SecurityUtil, BrewPunk API ForgeBox.io
  • 6. ● Packages can depend on other packages ● Promotes reusability and smaller, single-purpose packages ● cborm ○ cbvalidation ■ Cb18n ● Dev dependencies ○ Only required for developing on the project (like testing frameworks) ○ Don’t want installed on production ○ Use “install --production” to skip Package Dependencies
  • 7. CFConfig Example ● Commandbox-cfconfig ○ cfconfig-services ■ lucee-password-util ■ JSONPrettyPrint ■ Adobe-password-util ● propertyFile ■ semver ■ propertyFile
  • 8. Turn any folder into a package with one CLI command: package init Want some hand holding? package init --wizard Set additional metadata with: package set name=”My Package” Let’s create a package
  • 9. Scaffold out a new module with one CLI command: coldbox create module myModule Let’s take a look at the ModuleConfig.cfc component { function configure() { } } Let’s create a module
  • 10. modules/ These are modules managed by CommandBox. Usually 3rd party. Not committed to source control. modules_app/ These are modules that are a core part of your app that you want to be part of the main source repo. CommandBox doesn’t not manage them. Box Module Locations
  • 11. A ForgeBox account is free, easy, and let’s you publish packages and collaborators forgebox register Already have a ForgeBox account? forgebox login Create a ForgeBox account
  • 12. ● What happens when your code changes? ● You need to increment the version! ● Semantic versioning ○ Major ○ Minor ○ Patch ○ Prerelease Identifier ○ Build ID Versioning ❏ 5 ❏ 3.2 ❏ 1.7.8 ❏ 1.2.3-alpha ❏ 5.6+0045 ❏ 2-beta.3 ❏ 1.2.3-rc.4+9876
  • 13. Semver Ranges ● Give me the latest version that starts with 5 ○ 5.x ● Any version greater than 1.0.0 starting with 1.0.1 ○ >1.0.0 ● Any version between 2.0.0 and 2.5.0 inclusive ○ >=2.0.0 <=2.5.0 ○ 2.0.0 - 2.5.0 ● Any one of these exact versions ○ 1.0.0 || 2.0.0 || 3.0.0 ● Allows 1.2.4 and 1.3, but not 2.0 (same as 1.x.x) ○ ^1.2.3
  • 14. From the CLI install [email protected] install testbox@<=2.6 In your box.json “dependencies” : { “coldbox” : “4.3”, “Testbox” : “<=2.6” } Install a Specific Version
  • 15. Automatically increment version numbers in box.json ● bump --major ● bump --minor ● bump --patch If package is a Git repo, a tag will be created that matches the version number. This helps “lock in” the exact commit of this version. Bump Command
  • 16. ● Arbitrary commands of your choice to run at interception points ● postVersion ● onRelease ● postPublish ● Ties multiple steps together ● Automates repetitive bits ● Boils releasing down to a single command "scripts" : { "postVersion":"package set location='Ortus-Solutions/commandbox-cfconfig#v`package version`'", "onRelease":"publish", "postPublish":"!git push --follow-tags", } Package Scripts
  • 17. A nice tool for scaffolding box modules complete with tests, Travis-CI builds, and package scripts. module scaffold myCoolModule https://www.forgebox.io/view/cb-module-template cbModuleTemplate Module
  • 18. ● Your code ● Frameworks ● 3rd party modules ● Your modules ● Git ignores ● box.json ● “Install” command ● --production flag Building Your Apps