📎polyrule build

Build command allows you to compile given rule(s) to wanted programming language. You can use it like this :

polyrule build -l js -i user.json -o user.js

In this example, you transform your rules from user.json to javascript in user.js file.

Required flags

This section indicates that certain flags must be included in the polyrule build command for it to work properly. It's important to pay attention to these flags because they are essential for the main job of the build command.

Input

polyrule build -i user.json

This flag (-i or --input) specifies the input file that will be used to generate the output file. In this case, user.json is the input file that will be processed to generate output.

Output

polyrule build -o user.js

This flag (-o or --output) specifies the output file that will be generated after the build process is complete. In this case, user.js is the output file that will be generated from input.

Lang

polyrule build -l js

This flag (-l or --lang) specifies the programming language of the output file. In this case, the output file will be written in JavaScript (js).

Optional flags

This section indicates that certain flags must be included in the polyrule build command for it to work properly. It's important to pay attention to these flags because they are essential for the main job of the build command.

Clean

polyrule build -c

This flag (-c or --clean) specifies that the output directory should be cleaned before the generated file is inserted. This can be useful to ensure that the output directory only contains the latest version of the generated file, without any old versions or temporary files.

Namespace

polyrule build -n App/Rules

This flag (-n or --namespace) specifies the namespace that the generated code should be wrapped in. In this case, the namespace is App/Rules. Wrapping code in a namespace can help to organize it and prevent naming conflicts with other code.

Verbose

polyrule build -v

This flag (-v or --verbose) specifies that the build process should output more detailed information about the build process, such as which files are being processed and what actions are being taken.

Last updated