This grimoire contains a collection of interesting DataWeave spells that can be executed with our DataWeave CLI.
You can create your own grimoire and be part of the DataWeave Wizards Secret Club.
Let's start defining some concepts:
A wizard
is just a user that we trust and we want to have all their spells
available.
A wizard
has a grimoire
, a GitHub repository that is inferred by https://github.com/${wizard_name}/${wizard_name}-data-weave-grimoire
, that includes all the spells
from this wizard
.
A grimoire
is a collection of spells
created by a wizard
. The grimoire
is hosted in a GitHub repository in the default branch. Currently, there is no support for versioning or branching scheme.
A spell
is a DataWeave application that contains one or more DataWeave transformations (entry points) and is hosted in a GitHub repository.
This makes it very easy to share and distribute across other wizards
(users).
The DataWeave Grimoire is the default grimoire provided by the DataWeave CLI.
This grimoire contains the following spells:
Spell | Description |
---|---|
HelloWizard | Just a simple example that shows how to create a very basic spell. |
CountWizards | Spell to find other DataWeave wizards. |
Playground | This spell will launch the playground UI. |
In order to add a new wizard
use the DataWeave CLI
dw --add-wizard <wizard_name>
The wizard's grimoire is going to be cloned at {user.home}/.dw/grimoires
Using the --list-spells
it will show all the available spells for each wizard with the documentation of each spell.
dw --list-spells
There are several ways to run a spell using the DataWeave CLI.
dw --spell <wizard_name>/<spell_name>
The above command runs the spell located at {user.home}/.dw/grimoires/<wizard_name>-grimoire/<spell_name>/src/Main.dwl
dw --spell <spell_name>
The above command runs the spell located at {user.home}/.dw/grimoires/data-weave-grimoire/<spell_name>/src/Main.dwl
dw --local-spell <spell_name>
The above command runs the spell based on your current path location. The spell to run is located at <current_path>/<spell_name>/src/Main.dwl
In order to become a wizard
first create your GitHub repository
https://github.com/${wizard_name}/${wizard_name}-data-weave-grimoire
Your wizard name is going to be your GitHub user id
git clone https://github.com/${wizard_name}/${wizard_name}-data-weave-grimoire
Inside your cloned repository run
dw --new-spell <spell_name>
Use DataWeave VSCode Plugin to develop your script.
code <spell_name>
In order to test a local spell you can use
dw --local-spell <spell_name>
Once your spell is finished push it to your repository and tell your friends to try it out.
The following example shows how run a DataWeave Playground locally:
dw --eval --spell Playground
It is going to execute the Playground
spell that is going to be located in {user.home}/.dw/grimoires/data-weave-grimoire/Playground/src/Main.dwl
Contributions to this project can be made through Pull Requests and Issues on the GitHub Repository.
Before creating a pull request review the following:
When you submit your pull request, you are asked to sign a contributor license agreement (CLA) if we don't have one on file for you