Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Setting up your Project Folder:
A few steps should be taken by the developer before running the initial bm forms init command:
- Start with a folder for Inside your project folder, and inside that create a folder to hold the sub folder that will contain your forms components.
Within Using the command line, cd into into your project folder (not your new forms folder, but the parent project folder) and run npm init followed by git init. This will setup your package.json and initialise a git repository, if you wish to do so.
json file, which is needed to handle the forms plugins.
You should end up with a folder structure similar to this:
Code Block |
---|
|--my-project/
| |--my-forms/
| |--package.json |
You can now use the init command.
Initialising the Builder Properties
After setting up your forms folder, you can then start using the Forms CLI by running the init command.
From your project folder, run the following command:
Code Block |
---|
bm forms init |
This will initialise the project, which will set up your blinkmrc.json file.
You will prompted to answer a handful of questions:
Source of your forms definition -This will either be the answerSpace form, or your own JSON definition.
The following question will ask for the location of this definition. This Location of this definition - This will either be the answerSpace URL, or the location of the JSON definition files within your project folder.You'll then be prompted for , depending on what you selected for the first option.
Location of the output folders - This is the location of the folders you want to write both your source components and component distribution file too, as well as where the framework templates will be created. If We recommend you use the defaults, these will be bm-forms-src, dist and templates (only the templates folder will be created initially, until the bm forms createand build steps are ran later).Finallyset the path to your "my-forms" folder, as this will keep your project folder well structured.
Framework plugin to use - Finally, you'll be asked which framework plugin you wish to use. AngularJS and JSON are currently included by default. Later, we'll talk more about how you can use your own custom Forms CLI plugins.
If the defaults are used, you should end up with a folder structure that matches the following:
width | 225px |
---|
Code Block |
---|
|--my-project/
| |
|
|--my-forms/ | | |--templates/ | |--.blinkmrc.json | |--package.json |