Add public schema package and park schema command - #11
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a public
schemapackage that owns the canonical frontmatter contract and exposes it throughpark schemaandpark schema --json. This lets downstream tooling import the contract instead of re-deriving field names, categories, and the write template.What's new
schemapackage - canonicalFrontmatterstruct, category enum (inbox,projects,areas,archive),SchemaVersion, date format, and write template; stdlib only so other tools can import it.internal/noteuses the contract -note.Metadatais now an alias toschema.Frontmatter;note.Writeandnote.Todayread the template and date format fromschema.schema.Category*constants andinternal/model/assist.goparses dates withschema.DateFormat.park schemacommand - human-readable and JSON output surfaces the contract for scripts and downstream consumers.Usage
park schemapark schema --jsonBehavior changes / guardrails
schemais a pure leaf package with nointernalor Bubble Tea dependencies, so importing it from other modules is safe.park schemaruns through the normalBeforehook but falls back to default config when no config file exists, so it works on a fresh install.schema_versionstarts at 1 and increments only on breaking contract changes.Testing
schema/schema_test.gocover categories,Frontmattercompleteness,Render,Describe, and JSON round-tripping.internal/note,internal/config,internal/model, andinternal/storecontinue to pass against the aliasedMetadata.make checkruns fmt, vet, lint, and tests; all green.