Changelog
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.
Unreleased
0.1.1 - 2026-10-25
Changed
- Tooling: updated
fallowto 3.35 andtsdownto 0.23.2
0.1.0 - 2026-10-24
Added
- Flags:
flag.string(with typedchoices),flag.number(min,max,integer),flag.url,flag.email,flag.directoryandflag.file(exists), andflag.customfor user-defined parsers, which may be async - Standard Schema support:
flag.schema(schema, name?)andarg.schema(schema, name?)use any Standard Schema (zod, valibot, arktype, …) as the parser, with types from the schema's output. Schemas that can't receive a string (e.g.z.number()) are type errors. No new dependencies; a compatibleStandardSchemaV1type is exported - Environment variable fallback:
env: 'API_TOKEN'on any flag reads the variable when the flag isn't given (priority: argv, env, default), parsed and validated like a command-line value.jinju({ env })supplies the variables (defaults toprocess.env), andHelpFlag.envexposes them to help templates - Switches:
flag.boolean(with--no-xnegation, and--x=<value>acceptingtrue/false,1/0,yes/no,on/off) andflag.count(-vvv). Built-in--help/--versionfollow the same rules - Positional args:
arg.*creators sharing the same parsers as flags, plusarg.custom - Immutable modifiers
.required(),.multiple()and.default()on flags and args, with fully inferred types (InferFlagType,InferArgType,InferFlags,InferArgs).Flag,ArgandSwitchare classes built on a shared abstractParambase. Every type used in a public signature is exported (e.g.Param,Defined,ParseOptions,MergeFlags,CheckArgs) - Positional allocation supporting one
.multiple()arg in any position (e.g.cp-style[...sources, dest]) command()with typedruncontext, optionalname,aliases,hiddenand exit codes returned fromrunscope()for flags and args shared by groups of commands; scopes nest, and shared flags are accepted before the command name- Dynamic segments: a
:namekey in the command tree reads a value before the command name into the commands' arg calledname(e.g.app my-site deploy), with static names taking priority and setup checked byjinju(). Mistakes in the command tree are compile-time errors:$must be a command, one segment per level, no args on$next to a segment, and (with literal arg names) each command's segment args.Arghas a third type parameter carrying its literalname, andCheckTree(with its building blocksTreeErrors,NodeErrorsandSegmentError) is exported jinju()program with nested command trees ($for a level's own command), built-in--help/-hand--version, help generation,strictmode and injectablestdout,stderrandexit- Customisable help: pass a
HelpTemplateinstance ashelptojinju(). Configure it withsortFlagsandshowHidden, or extend it and override any method:render,sections, the per-section and per-row formatters (formatFlag,formatArg,formatCommand, …) and the layout primitives. It renders fromHelpData, the building blocks of a page with no filtering or sorting applied: the program, path, usage lines, and every subcommand, arg and flag with its syntaxlabel,source(command, scope or built-in), raw details and creatoroptions. Also exported:formatPath, and theHelpTemplateOptions,HelpRow,HelpData,HelpProgram,HelpPathPart,HelpCommand,HelpArg,HelpFlagandHelpParamtypes - Customisable errors: pass an
ErrorTemplateinstance aserrortojinju(). Configure it withhint, or extend it and overriderender,sections,formatErrors,formatError,formatHintorformatCommand. It renders fromErrorData: the program, theJinjuErrorinstances, the matched path, the words as typed, and the matched level'sHelpData. Also exported: theErrorDataandErrorTemplateOptionstypes packageVersion(import.meta.url)readsversionfrom the nearestpackage.json, forjinju({ version })- Tokenizer support for
--x=v,--x v,-xv, bundled shorts (-abc), negative numbers as values and-- - Error classes extending
JinjuError; errors are collected and reported together - Tooling:
fallow(with type-aware analysis enabled, andfallow dead-codechecked in CI), CI tests on Node 22, 24 and 26 (including loading the build withrequire()), coverage checks (100% required), CI summary support and type tests run byvitest AGENTS.md(imported byCLAUDE.md) with contributor guidance for coding agents, including keeping the changelog and documentation up to date- Documentation site at https://jinju.js.org/, built with VitePress: guides and an API reference, with examples type-checked against the source. Docs are versioned: the root is the latest release,
/x.y.z/each release and/next/the newest prerelease, with a version switcher. Every release redeploys it to GitHub Pages. For AI assistants, it publishesllms.txt,llms-full.txtand a Markdown copy of every page, with the types the examples show on hover written in as comments, and each page has a Copy page menu for copying it as Markdown or opening it in ChatGPT or Claude - Docs tooling:
docs:dev,docs:buildanddocs:build:allscripts, a docs build in CI (catching dead links and broken examples), and a test that every export has an entry in the API reference
Changed
README.mdis now a short introduction. The full reference has moved to the documentation site, which is also the package'shomepage- Build is ESM-only (
dist/index.js,dist/index.d.ts), built withtsdown(rolldown), withexportsfixed to match the build output - Requires Node
>=22.12. CommonJS projects canrequire('jinju'), which loads the ESM build - Replaced
eslintwithoxlintandprettierwithoxfmt - Updated
nodetov24(pinned to24.22.0in.nvmrc),vitesttov5andtypescripttov6 - Updated GitHub Actions
actions/checkoutandactions/setup-nodetov7 - Releases publish to npm with Trusted Publishing (OIDC) instead of an
NPM_TOKENsecret, and published versions now carry provenance. Prereleases run fromrelease.ymlafter CI passes onmain - Bump dependencies
- Releases are staged on npm (
npm stage publishvia trusted publishing) and go live once approved on npmjs.com - VSCode config updates
- Updated LICENSE date
Removed
- The 0.0.1 APIs (
celebrate,debug,fail,log,spinner,success,warn) and configuration support, replaced by the command-line toolkit above - CommonJS build, and
rollupwith its plugins (replaced bytsdown)
0.0.1 - 2025-05-06
Added
- Initial setup
- New APIs;
celebrate,debug,fail,log,spinner,success,warn - Ability to set a configuration