How to Create a Bladeset

In order to create a bladeset you first need to create an application. Follow our guide to creating an app.

As with apps, there are two ways to create an app

  • Via the Command Line Interface (CLI) or
  • Via the Web dashboard

We will go through both these ways below. Remember, you only need to follow one of the options as they both achieve the same thing.

Option 1. Creating a bladeset via the CLI

Once you have an application you can create a bladeset as follows:

$ ./brjs create-bladeset <app-name> <bladeset-name>

Example

The following command will create a bladeset called todo which is part of the brjstodo app.

$ ./brjs create-bladeset brjstodo todo

The todo bladeset is represented on disk by a directory called todo-bladeset that resides under the brjstodo app directory.

Option 2. Creating an app using the web dashboard

Start the BRJS development server by by entering

./brjs serve

on the command line and navigate to http://localhost:7070. Click on the relevant app and select ‘New bladeset’.

Example

We are going to create a bladeset called todo within our existing app brjstodo which should be showing on your dashboard.

Open the app by clicking the button.

As the app does not currently contain any bladesets, there is nothing displayed here yet. Click the button in the top lefthand corner which says ‘New Bladeset’

This brings up the a window which prompts you enter a bladeset name.

Enter the bladeset name todo

You will now see the name of the new bladeset displayed on the dashboard.

If you hover over the bladeset box, you will see that you have two options ‘add blade’ and ‘run tests’. We go into more detail about adding blades on the How to create a blade document.

Results

Whichever method you have used to create your new bladeset, you will see that BladeRunnerJS has created a new folder called “todo-bladeset” within brjs-apps/brjstodo. Within the bladeset directory you'll find the following:

  • resources - for everything else
  • src - for the JavaScript for the bladeset
  • tests - for the bladeset tests
  • themes - for CSS and images

In future:

Where next?