Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Creating the Library Source and Building the Distribution File
The create and build steps will create the form field templates, and then build them into a Javascript library file for you to include into your project. You can use the standard field templates (and then apply your own CSS styles for customisation), or if you prefer you can modify the templates themselves to create a highly customised form output.
Using the standard field templates
At this stage, if you're happy with your project setup, you're now able to run the bm forms create command. :
Code Block | ||
---|---|---|
| ||
bm forms create |
This will create the library source by reading your forms definition and using the templates specified by the plugin you selected in the init step.This command will build the library automatically, however you can prevent this command from building so that you're able to edit the source files/templates first, should you require further customisation - we've included the
Advanced Customisation (optional)
If you would like to modify the standard templates, you can do so by using the create command with the --no-build build flag for this purpose.
When running the command, you have the following two options:
Will create and build your library source
Code Block | ||
---|---|---|
| ||
bm forms create |
. This will create the templates, but not perform the final build step:
Code Block | ||
---|---|---|
| ||
bm forms create --no-build |
Now that Once you've built your library sourcerun this command, you can look at tweaking your templates to customise your outputthen modify the template files.
Infotip |
---|
We recommend running bm forms create before editing the templates so you can see what a default form will look like. |
lik |
Modify Your Template Files
my-forms/templates contains contains templates used by the transforms in the plugin. You can modify them to include any html/javascript HTML or JavaScript you want, and commit them to your own version control for future reusability.
For more information on editing the templates, see the template documentation.
Re-Building Your Source Code
If you have modified your source files after this process, you will need to run the build command again. This will build out the library from the source folder:
Code Block | ||
---|---|---|
| ||
bm forms build |
Info |
---|
It is important to note that bm forms create will overwrite anything in the sourcePath folder. If you have modified anything in the sourcePath folder, running bm forms create will remove it. |
Final Project Layout Example
If you've followed through these steps, you will You should now have my-forms/src and my-forms/dist folders on your local machine:
width | 225px |
---|
bgColor | lightblue |
---|---|
borderStyle | solid |
Code Block |
---|
|--my-project/
| |-- |
my-forms/
| | |--dist
| | |--src
| | |--templates |
| |--.blinkmrc.json
| |--package.json |
my-forms/dist
/ folder will contain your form components.Further Steps
Managing PluginsWill contain the Javascript libraries ready for integration into your app, as well as an index.html example file that shows you how to include the libraries and dependencies.
my-forms/src
Will contain the individual Javascript and components for your project. This does not need to be included in your project for deployment.
my-forms/templates
Will contain the template files used by the plugin to create your Javascript libraries.