All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
CommentSyntaxoption plumbed throughCodeFile,CodeBuilder, the docblock helpers, the manual-section helpers, and the codelock helpers. Constructnew CodeFile(path, { commentSyntax: { kind: "line", prefix: "# " } })to generate files whose only comment form is a line prefix (e.g..gitattributes). The default remains{ kind: "jsdoc" }, preserving the existing JSDoc/C-style output byte-for-byte.CommentSyntaxis re-exported from the package root.CodeBuilder.indent(amount, fn)for generating indentation-sensitive languages (Python, YAML, Terraform, Makefile, …). Opens a nested builder scope whose ambient indent is the current indent plusamount; every emitted line — including manual-section markers and bodies — is prefixed accordingly. Indent scopes compose additively and accept any string (spaces, tabs, mixed).createManualSectionaccepts a new optionalindentargument for callers who use the helper directly.CodeBuilderconstructor accepts an optional thirdindentargument (defaults to"").
- Manual sections are now stored as semantic (column-0) content.
extractManualSectionsauto-detects each section's indent from the BEGIN marker and dedents every body line uniformly, so round-tripping works cleanly regardless of where a section lives in the file. The previous behaviour was subtly buggy:.trim()on the whole captured body only dedented line 1, and multi-line bodies kept the original indent on lines 2+. - Migrated test runner from Jest to Vitest. Simpler setup, no
ts-jesttransformer required, and faster runs. - Bumped dev dependencies to latest: TypeScript 6.x, ESLint 10.x,
typescript-eslint8.x, Prettier 3.8.x, Vitest 4.x, and related tooling. - ESLint flat config simplified to use
typescript-eslint's config helpers and@vitest/eslint-pluginin place ofeslint-plugin-jest. - TypeScript target updated from ES2018 to ES2022 to match the current supported Node versions.
- Dropped the deprecated
codecovnpm uploader; CI now uploads coverage to Codecov via the officialcodecov/codecov@5CircleCI orb, using thelcov.infoproduced by Vitest's v8 coverage. - Dropped
@eslint/eslintrccompat layer. - Raised minimum Node.js version to
>=20.18.0.
- Codelock hashes produced prior to this release are no longer valid.
The normalized form consumed by
emptyManualSections— which is the input to the codelock hash — now preserves the BEGIN marker's indent, andcreateManualSection's output for multi-line bodies is now correctly dedented rather than partially dedented. Files locked by earlier versions will failverify()and need to be regenerated. - Manual-section markers must each appear on their own line. The
historical regex also matched the pathological single-line form
/* BEGIN MANUAL SECTION k */body/* END MANUAL SECTION */, which is never emitted bycreateManualSectionand is now ignored.
CodeBuilder.formatno longer accepts aprettierOptionsargument.
CodeBuilder.formatnow resolves Prettier config from the project config file (when present) and falls back to Prettier defaults if config resolution fails.
CodeBuilder.formatnow accepts an optionalprettierOptionsparameter to customize Prettier formatting without resolving config from disk.
- Prettier 3 only:
peerDependencies.prettieris now3.x(was2.x || 3.x). - Added
@prettier/syncas a runtime dependency for Prettier 3 compatibility.
- Bumped dev dependencies to latest: TypeScript 5.x, ESLint 10.x, Jest 30.x, Prettier 3.x, and related tooling.
- TypeScript target updated from ES2015 to ES2018.
- Migrated ESLint to flat config (
eslint.config.mjs).
CodeFile.lock, a new manual lock step that allows you to customize the lock docstring.
- BREAKNG:
CodeFile.buildno longer locks the file automatically. CallCodeFile.lockafter callingbuildto get the old behavior.