Blog

Brad Wood

December 25, 2017

Spread the word


Share your thoughts

We've talked about what packages are, how to create them and how to publish them on Forgebox.  Now that you have the basics down, we've got some special ninja kung foo magic that will let you crank out modules with almost no effort at all.  We obviously can't implement the module for you, but there is a lot of boilerplate around creating the Git repo, scaffolding out files, setting up tests, and publishing.  We can turn all that boilerplate into 2 commands. **

** Some one-time setup required

Module Template Module

The module template module is a module that helps you create modules. Whoa-- how meta, right?  This is a CommandBox module written by our very own Eric Peterson that you install into CommandBox.  It gives you some command line tools to whip a module in no time. 

install cb-module-template

https://www.forgebox.io/view/cb-module-template

The only requirements are that you have:

  • CommandBox and the module installed (duh!)
  • A free GitHub account
  • A free forgebox.io account

When you have a cool idea for a CommandBox module, ColdBox module, or ContentBox module, just create an empty directory and run this:

module scaffold myCoolModule "Short Module Description"

What did that just do?

The first time you run those commands, the module might ask you some questions, but it will remember the answers and be able to access your GitHub account automatically the next time.   That single command will:

  • scaffold out the basic files for a Box module
  • Sets up your box.json and ModuleConfig.cfc files with defaults
  • Configures a unit and integration test suite for you
  • Creates an actual GitHub repo under your account and ties it to your local folder
  • Configures a Travis-CI build for your repo and activates it, complete with a pass/fail banner in your default readme.md!

Ready to publish your work for all the world to see?  Just one command left.  (The version starts at 0.0.0 so use --major, --minor, or --patch based on what kind of version bump you want)

bump --major

That command (which is part of CommandBox proper) will:

  • Increment the version in your box.json
  • Tag your local git repo
  • Fire the inbuilt package scripts to:
    • Update your download location to point to the new tag
    • Push the new Git tag to GitHub
    • Publish the package to Forgebox

That's a lot of individual steps that just got boiled down to 2 simple commands.  Have fun playing around with this module and you use it to get some of your projects out there on ForgeBox.

 

Add Your Comment

Recent Entries

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Prepare for the Ortus Thanksgiving Day Deals! This is your chance to enhance your development journey with amazing deals catered to everyone—from experienced developers to tech aficionados. Our unique offers are crafted to assist you in reaching your objectives while conserving your budget!

Don't Let These Incredible Offers Slip Away!

Utilize the code THKSGIVING24 at checkout to take advantage of these fantastic discounts before they end...

Cristobal Escobar
Cristobal Escobar
November 04, 2024
BoxLang Newsletter: October 2024

BoxLang Newsletter: October 2024

Welcome to the October edition of the BoxLang Newsletter! **This month has been packed with exciting updates, new features, and enhancements that continue to shape BoxLang into a robust and versatile programming language. In this edition, we highlight the latest beta releases, new integrations, and key features that have been introduced.

Maria Jose Herrera
Maria Jose Herrera
November 04, 2024
BoxLang 1.0.0 Beta 21 Launched

BoxLang 1.0.0 Beta 21 Launched

This release brings another round of powerful tools and refinements to the BoxLang community, making development more dynamic and robust than ever. We’ve added new capabilities for debugging and tracing, expanded context-sensitive controls for thread management, and introduced new methods for fluent attachment handling.

For deeper flexibility, our improvements enhance configurability, streamline session control, and add deeper levels of JSON serialization management. Plus, we’ve squashed a wide range of bugs, enhancing stability across database connections, date handling, and runtime compatibility with CFML.

In addition, CSRF Token functionality is now provided via the bx-csrf module.

Luis Majano
Luis Majano
November 01, 2024