Skip to content

divide 0.6.1

Choose a tag to compare

@github-actions github-actions released this 22 Nov 13:14

divide 0.6.1 gives the Flow Designer an example of what divide is for: a generator. The application itself is unchanged.

A generator to try the Flow Designer on

examples/generator is a small, independent generator project. Div templates turn a JSON model of a PHP class (a DTO) into the class's source code and its README. A Runner Flow orders the stages in four Blocks:

  • main loads the model, validates it, checks whether the outputs are current, generates, verifies and writes a report.
  • validate checks the model's schema and identifiers. If the model is not valid, it ends the run before anything is written.
  • generate renders the class and the README with Div, and writes a manifest of hashes.
  • quality runs php -l on the class and checks that the outputs say what the model says.

main calls the other three Blocks. When nothing has changed since the last run, main.current jumps over generation.

The output is deterministic: the same inputs write the same bytes. Nothing is written outside build/.

cd examples/generator && composer install && divide .

Open flows/generate_php_dto.yml and use Run > Flow designer. Ctrl+F9 runs it, with generate.json as the initial context and functions as the function root.

Runner is one way to order a generator's stages, not a requirement: a PHP script that renders with Div is a generator too.

Help

  • Flow Designer, in English and Spanish, now shows and explains this example.
  • Its screenshots were retaken on it at 80, 120 and 160 columns, along with choosing a jump's target, the Block dialog, a context and the Phosphor Green theme.
  • examples/runner keeps its Flows, fulfil.yml among them, as general Runner examples.

Install

Ready to run, with nothing else to install:

  • macOS and Linux: brew install divengine/tap/divide
  • Windows: scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the .msi below
  • Linux: the .deb, .rpm, .apk and Arch packages, the AppImage or the binary alone, below
  • macOS: the archive for Apple silicon or Intel, below

Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.