Skip to content

Releases: kosude/devinit

v0.4.7

07 Jun 20:31
v0.4.7
71d09d4
Compare
Choose a tag to compare
v0.4.7 Pre-release
Pre-release

This minor release includes the addition of a new parent_name builtin variable, which contains the name of the parent directory of the output file, if using the --path option in the file subcommand.

Full Changelog: v0.4.6...v0.4.7

v0.4.6

04 Jun 19:20
v0.4.6
1eaa0b6
Compare
Choose a tag to compare
v0.4.6 Pre-release
Pre-release

This release adds the ability to automatically abort templating into a file if that file already exists and has existing content - this new feature is integrated into the VS Code extension, which has the extra benefit of fixing a bug where templating output would be duplicated when renaming or moving files.

Full Changelog: v0.4.5...v0.4.6

v0.4.5

01 Jun 14:39
v0.4.5
17efcb3
Compare
Choose a tag to compare
v0.4.5 Pre-release
Pre-release

Fixed bug where the --version flag would return "latest" instead of showing the actual version in precompiled binaries

Full Changelog: v0.4.4...v0.4.5

v0.4.4

31 May 15:52
v0.4.4
0179f82
Compare
Choose a tag to compare
v0.4.4 Pre-release
Pre-release

Some more convenience functions have been added:

  • year: get the current year
  • lang_by_filename: get likely programming language ID from a given filename
  • comment_by_lang: get the comment format object associated with the specified programming language

Full Changelog: v0.4.3...v0.4.4

v0.4.3

30 May 15:49
v0.4.3
a35bc1c
Compare
Choose a tag to compare
v0.4.3 Pre-release
Pre-release

This pre-release has been shipped to provide native release binaries for each supported platform via CI - program-wise, there are no changes between this and v0.4.2.

v0.4.2

29 May 15:41
v0.4.2
c0a53c8
Compare
Choose a tag to compare
v0.4.2 Pre-release
Pre-release

This minor prerelease marks the addition of built-in variables, which are defined automatically by devinit at render-time. Documentation for the available variables can be found in the project README.

The file_contents builtin is particularly useful since it allows for writing templates that append to a file's content, rather than replacing it entirely:

Pre
{{ BUILTIN.file_contents }}
Post

If this template is rendered to an existing file that looks like this:

Foo

bar

Then the resulting output will look like this:

Pre
Foo

bar
Post

As a side note - one other feature introduced by this prerelease is sorted lists, so the output of devinit list and --list-vars commands are sorted alphabetically.

Full Changelog: v0.4.1...v0.4.2

v0.4.0 and v0.4.1

29 May 15:32
v0.4.1
4d0372f
Compare
Choose a tag to compare
v0.4.0 and v0.4.1 Pre-release
Pre-release

Version 0.4.0 introduces the official VS Code extension, originally with just the ability to render a template into the currently active document and interactively prompt for variables.

Since then, enough has happened to warrant version 0.4.1 - this release includes full automation of template rendering into newly created documents that match a user-specified glob pattern, in addition to the ability to specify default values for variables to skip prompts (especially helpful when creating new files that match any of the glob rules).

Full Changelog: v0.4.0...v0.4.1/

v0.3.1

26 May 15:15
v0.3.1
3f69134
Compare
Choose a tag to compare
v0.3.1 Pre-release
Pre-release

Minor prerelease - a few new QoL features have been added to the devinit CLI, namely the list subcommand and the --list-vars flag.

There is a known issue with the latter addition - when using --list-vars, undefined variables inside macro blocks are not included. While this behaviour isn't intended, it's sorta just staying that way for now since determining whether or not those tokens are actually variables or just macro arguments is a pain (and potentially not possible as of yet) :/

Full Changelog: v0.3.0...v0.3.1

v0.3.0

25 May 14:33
v0.3.0
e2d5d51
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

The other half of the original requirements has now been implemented - project templates can now be created and rendered into a folder on disk, or into stdout via the --dry-run flag, similar to file templates.

A global rendering context is now being used as opposed to individually per-template, which means templates now support include directives to import other templates, like a #include in C, which works pretty well!

There are still quite a few features I want to implement in project templates, and particularly in the templaterc.yml configuration spec (which is currently extremely limited), but I don't really have the time to spend on this project for ages and want to get it integrated into VS Code as soon as possible to replace my old NeoCopyrighter extension, so any other non-essential things will probably be added after v1.0.0.

Full Changelog: v0.2.0...v0.3.0

v0.2.0

18 May 18:19
v0.2.0
9e8ec7c
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

This prerelease marks a massive improvement in template syntax and feature availability, thanks to the Tera template engine, which is now being used instead of me trying to do it all myself (which would have taken ages to get to the same level of quality!)

Tera's documentation should be consulted for info on syntax and built-in functions and filters, all of which can now be used in Devinit templates, in addition to logical control structures like if-else blocks and for-in loops.

Existing Devinit functions (licence and wrap*) have also been ported to the new engine.

Example template with the new update:

{% set mit = licence(id = "MIT") -%}

{# Print licence body with string substitutions, and word-wrapped to 80 characters per line. -#}
{{ mit.text
    | replace(from = "<year>", to = "2024")
    | replace(from = "<copyright holders>", to = "Ty Coon")
    | wrap(len=80)
}}

*wrap was previously added but not available in v0.1.0

Full Changelog: v0.1.0...v0.2.0