Repository navigation
Releases
v0.1.4
First public release. The earlier v0.1.1–v0.1.2 tags were pre-releases; they are retracted in go.mod, and everything they contained is in this release.
Added
- First release of the shared base, stdlib only, additive-only from here on.
plugin:Plugin,Lookuper,Resolver,CommandRunner,ValueTransformer(path, value),SaveGuard(Document),ExpandObserver,Validator,Includer, theDocumentview, capabilities,Registry,*plugin.ErrorandErrUnavailable,ErrUnsupportedScheme,ErrDenied,ErrNotFound.expand:${VAR}engine with every operator, nesting,$$,$(cmd)only with a runner,${scheme:ref}through resolvers, cycle guard with positions.atomicfile: temp file, fsync, chmod, rename, folder fsync; keeps mode; writes through symlinks.pos:Pos, offsetIndex,file:line:colErrorandErrorList.path: dotted paths with quoted segments and indexes, JSON Pointer,ParseAny; a leading/key is quoted soParseAny(p.String())round-trips.texttest: round-trip and untouched-bytes property harness and a shared awkward-input corpus.expand.CommandError: the error for a$(command)whose runner failed;Cmdnames the command as handed to the runner andUnwrapreturns the runner's error.
Changed during the pre-releases
expand: a$(command)whoseRunreturns an error (the command failed, exited non-zero or was refused) now stopsExpandwith a*expand.CommandErrorinstead of expanding to"". Behaviour change: a failed command no longer reads as an empty value. dotenv and jsonc report it fromGetExpanded/Expanded(jsonc at the value'sfile:line:col).
Fixed during the pre-releases
pos.ErrorList.Error()says "(and 1 more error)" for two errors; "(and N more errors)" is kept for more.
Documentation
- Repository-wide docs under
docs/: a 14-step learning path and a "start from your goal" table (docs/README.md), 49 step-by-step guides, with an index page per folder, covering every module (getting started, dotenv, jsonc, jsonc tools, value plugins, the command line, push providers and clikit, base packages), decision guides underdocs/choosing/(format and modules, methods, value plugins, options per kind of app, library or CLI), a feature index of all 136 features with the guide step and example for each (docs/reference/features.md), and an architecture diagram (docs/assets/architecture.svg). examples/: a test-only module of 46 runnable programs, one per guide topic, each with a README and a test that checks its output; guide snippets are copied from them and kept in sync by docsync.- Module READMEs name their current tag, and links that used to go to the archived
ubgo/dotenvdocs point at the new guides. - Repository: README with install, quick start per format and FAQ;
CONTRIBUTING.md,CODE_OF_CONDUCT.md,SECURITY.md, and GitHub issue and pull request templates.
textdatactl/v0.1.5
Changed
- Requires
github.com/ubgo/textdata/jsonc/cliv0.1.5 andjsoncv0.1.5:textdatactl jsoncedits andfmtkeep a mixed LF/CRLF file's own line ending instead of one taken from inside a block comment.
textdatactl/v0.1.4
First public release. The earlier cmd/textdatactl/v0.1.1–cmd/textdatactl/v0.1.2 tags were pre-releases; they are retracted in go.mod, and everything they contained is in this release.
Added
- Umbrella CLI:
textdatactl dotenv …andtextdatactl jsonc …by delegation,versionand--versionfrom voltkitversioncmd.Collect.
Fixed during the pre-releases
- Release builds are no longer stamped
(dirty): volt writes its archives intodist/while building, and the repo now git-ignores that folder. Intextdatactlv0.1.1 every platform except darwin/arm64 was stamped dirty. textdatactl completion <shell>prints a completion script fortextdatactl, and its__completerequests insidedotenvandjsoncreach those formats' verbs;textdatactl dotenv completionprinted adotenvctlscript before.textdatactl dotenv <verb> --helpexamples now saytextdatactl dotenv.- Exec plugins run as
textdatactl dotenv <plugin>can call the host back:textdatactlsetsDOTENVCTL_BIN_ARGS=dotenv, so"$DOTENVCTL_BIN" ${DOTENVCTL_BIN_ARGS:-} -f FILE get KEYreaches the dotenv verbs instead of failing withunknown shorthand flag: 'f'.
plugins/vault/v0.1.4
First public release. The earlier plugins/vault/v0.1.1 tag was a pre-release; it is retracted in go.mod, and everything it contained is in this release.
Added
- HashiCorp Vault
Resolver+Lookuper: KV v1/v2 over HTTP,path[?version=N][#field], namespace, opt-inFromEnv, per-plugin cache,ErrDenied/ErrUnavailable/ErrNotFoundmapping; stdlib only. - Requires only the base module
github.com/ubgo/textdata: importing the plugin pulls no format. Its tests in dotenv and jsonc live in the repo's test-onlyintegration/module.
plugins/gopass/v0.1.4
First public release. The earlier plugins/gopass/v0.1.1 tag was a pre-release; it is retracted in go.mod, and everything it contained is in this release.
Added
- gopass
Resolver(${gopass:ref}) and an optional prefix/mappingLookuper; injectable runner, per-plugin cache, context and timeout; secrets never in errors or argv. - Requires only the base module
github.com/ubgo/textdata: importing the plugin pulls no format. Its tests in dotenv and jsonc live in the repo's test-onlyintegration/module.
plugins/file/v0.1.4
First public release. The earlier plugins/file/v0.1.1 tag was a pre-release; it is retracted in go.mod, and everything it contained is in this release.
Added
- file
Resolver(${file:ref}) relative to a base folder, confined to it by default (.., absolute and symlink escapes refused throughos.Root),WithRoot,Unconfined(), size limit, one trailing newline trimmed. - Requires only the base module
github.com/ubgo/textdata: importing the plugin pulls no format. Its tests in dotenv and jsonc live in the repo's test-onlyintegration/module.
plugins/extends/v0.1.4
First public release. The earlier plugins/extends/v0.1.1 tag was a pre-release; it is retracted in go.mod, and everything it contained is in this release.
Added
plugin.Includerfor$extends:New(disk;WithRootconfinement through the real path andos.Root,AllowAbsolute,WithMaxSize) andNewFS(fs.FS).- Requires only the base module
github.com/ubgo/textdata: importing the plugin pulls no format. Its tests in dotenv and jsonc live in the repo's test-onlyintegration/module.
plugins/aws/v0.1.4
First public release. The earlier plugins/aws/v0.1.1 tag was a pre-release; it is retracted in go.mod, and everything it contained is in this release.
Added
- AWS Secrets Manager and SSM Parameter Store
Resolver+Lookuper:sm/andssm/grammar,#jsonKey, stage/version, stdlib SigV4 checked against AWS's published suite, static/env/shared-file/source credentials, endpoint override, per-plugin cache. - Requires only the base module
github.com/ubgo/textdata: importing the plugin pulls no format. Its tests in dotenv and jsonc live in the repo's test-onlyintegration/module.
jsonc/v0.1.5
Fixed
- Text inserted into a file that mixes LF and CRLF took its line ending from a line break inside a block comment. In
{/*\r\n*/\n},Setwrote a CRLF thatDeletethen left behind, so Set then Delete no longer gave back the input. Inserted text now uses the break where it goes, or the line break just before the new line, or the document's first line break outside a comment, never one inside a block comment. This coversSetandSetAfter/SetBeforeon objects,Append/Inserton arrays,SetCommentand the commentsMergecopies. Found byFuzzSetDelete; the input is kept as a fuzz seed, and a table test covers each mixed LF/CRLF layout. format.Formattook the line ending from the first line break anywhere, so a CRLF inside a block comment turned an LF file into a CRLF one. It now uses the first break outside a block comment or string.
jsonc/v0.1.4
First public release. The earlier jsonc/v0.1.1–jsonc/v0.1.3 tags were pre-releases; they are retracted in go.mod, and everything they contained is in this release.
Added
- Lossless JSONC parser (tolerant by default,
Strict()for plain JSON matchingencoding/json.Valid), comments attached to members,file:line:colerrors. - Read:
JSON,Decode,Getand typed getters,Has,Keys,Len,Kind,Comment,Pos,KeyPos, dotted paths and JSON Pointer;Readone-call. - Edit:
Set,SetAfter,SetBefore,Delete,Append,Insert,Remove,SetComment,RemoveComment,Disable,Restore,Merge,Clone;Save/SaveAsthroughatomicfilewith save guards. - Dynamic values: expansion through the base engine with Lookupers, Resolvers, CommandRunner and ValueTransformers (off by default; positioned errors);
$extendsthroughExtendedwhen an Includer is installed. Lint, and packagesformat(Format,Minify),generate(builders,FromStruct),schema(FromStruct,Parse/Load,Validate,Plugin),diff(Diff).- Tests: JSONTestSuite conformance, a JSONC case set, property tests through
texttest, fuzz targets for parse, edits, merge, format, lint, extends, schema and diff.
Changed during the pre-releases
schema.Pluginis now also aplugin.SaveGuard: installing it makesSaveandSaveAsrefuse a document with schema errors, leaving the file untouched. Warnings never refuse a save. It used to be aValidatoronly, soSavenever ran it.- A failing or refused
$(command)is now an error fromGetExpanded,ExpandedandReadwith expansion, carrying the value'sfile:line:coland unwrapping to*expand.CommandError; it used to expand to""silently. Readon a missing file now returns an error that names the path and wrapsfs.ErrNotExist, matchingdotenv.Read; it used to return an empty map and no error.Openis unchanged: a missing file is still an empty document thatSavecreates.
Fixed during the pre-releases
Doc.Pos,Doc.KeyPosand every error position raced when several goroutines read one uneditedDoc: the lazily built offset index is now an atomic pointer, reset the same way by every edit.Clonebuilds a newDocinstead of copying one. Pinned by a race-detector test.schema.Parsereported atypethat is neither a string nor an array asmust be an array of strings; a single type name is valid too, so it now saysmust be a string or an array of strings.