A Slew of (Breaking) Fixes (MfGames Writing Tools)

We've just pushed up a new version of mfgames-writing-js. Naturally, this started with the usual process of doing a little housekeeping, and bringing packages up to date.

The main focus was to fix two bugs:

Unfortunately, we had to make a breaking change and bumped the major version of some of the packages, which also requires at least a minor update to the other changes to pick up the new version ranges.

And then what followed was an embarassing set of NPM package updates as we tried to get everything working consistently and feeding into dependent projects like fedran-writing-setup-flake which is a mass setup scrip for all the writing projects on fedran.com.

Along the way, we also introduced --log-level support so mfgames-writing-format build wasn't quite as noisy.

Short Version

If you use mfgames-writing-js, update all your packages to the latest and things should Just Work™. If they don't, please don't hesitate to report an issue or contact Dulan

Pipeline Exclusions

Added an exclude to pipelines in the same pattern as the content elements:

contents:
  - element: chapter
    source: pipeline.md
    pipeline:
      - module: "@mfgames-writing/hyphen-pipeline"
        exclude:
          editions: [docx]

This caused a difficulty with an undocumented element in hyphen-pipeline which allowed for a regular expression to ignore certain words that caused problem with hyphenation. This was moved to exclude.regex.

contents:
  - element: chapter
    source: pipeline.md
    pipeline:
      - module: "@mfgames-writing/hyphen-pipeline"
        exclude:
          editions: [docx]
          regex: ["^bob$"]

Because this changed some projects in use, it was treated as a breaking change and bumped the version.

Section Breaks

When we write in Markdown, we always use *** for section breaks.

---
title: Chapter One
---

Something happened.

---

After the break.

However, proejcts like mfgames-writing-setup-flake use prettier which always converted the *** into --- which is also a proper Markdown rule (which we use as a section break in stories).

Due to interactions with SmartyPaths, those --- were helpfully turned into an em-dash (—). We put in a little patch code that an em-dash on a line by itself is considered a rule for section breaks and turned back into ---.

Output Directory

Another thing that we've done with mfgames-writing-setup-flake is put all the output files into the build/release folder to keep them out of the root directory of the repository. But there was a little but where .docx files couldn't handle that.

We fixed it.

Logging

Also, it was a little annoying having so much data that we added a --log-level to control output. It defaults to info but can also be trace, debug, info, warn, and error.

Metadata

Project

Categories: