Repository navigation
envschema: ready to publish (README, Apache-2.0, docs.rs examples, a Laravel Rust example) - #142
Merged
Merged
Conversation
…Laravel Rust example)
ndbroadbent
force-pushed
the
envschema-publish-ready
branch
from
December 3, 2026 17:25
faf23e9 to
5e207f4
Compare
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.
Makes
crates/envschemaandcrates/envschema-derive(from #140, sc-9026) ready for crates.io. Nothing is published: both keeppublish = falseuntil the crate has run in production for a few days.What changes
README for each crate. envschema's explains the conventions:
required,required_in_productionandsecretper setting;Debug,Summaryand error messages;.env.examplegenerated and kept in step by a test.It also has a quick start, the attribute table, a Laravel Rust section, a Loco note, a "when to use it, and when not" section comparing it with confique, figment, envy and config-rs, and the MSRV. The derive crate's README is short and points to envschema.
docs.rs. envschema's crate docs are its README (
#![doc = include_str!("../README.md")]), so every README example is a doc test: the derive, an env map, a customSource(and a closure), every problem at once with secrets masked, the production check with an external group, unknown-variable warnings, and Markdown and.env.examplegeneration.Valuegained a doc test that implements it for an enum. Both crates have#![deny(missing_docs)], and every public field and builder method is now documented. No[package.metadata.docs.rs]: there are no features.Laravel Rust example: an
ignored block in the README that mirrorsapp/src/config.rs'sinstall,checkandreport, cut to two groups. It isn't anexamples/file because laravel-rust as a dev-dependency would build the whole framework forcargo test -p envschema. It would also join the CItestjob's feature set (--workspace --exclude visualci-app), which keeps the app's dependencies apart from the CLI's tests on purpose. app/'s own code is the compiled, tested version.A plain std::env example:
examples/std_env.rs(cargo run -p envschema --example std_env).Cargo.toml metadata. Added
rust-version = "1.88",homepage,documentation,readme, and keywords and categories for the derive crate.license(Apache-2.0) andrepositorycome from the workspace.publish = falsestays, with a comment that it flips when we publish. envschema's dependency on the derive already hadversion = "0.1.0"next topath.LICENSE. Each crate has
LICENSE, a symlink to the repository's.cargo packagecopies the file's contents into the .crate. This differs from snapshot-diff, which ships only the SPDXlicensefield and no licence text. Apache-2.0 §4(a) asks redistributors to include the licence, so snapshot-diff could take the same symlink in its next release.release.yml: an
envschemajob, inert for now. It publishes envschema-derive and then envschema through trusted publishing, once per version, like thesnapshot-diffjob. It skips any crate whose Cargo.toml still sayspublish = false, so it can't publish anything until that line goes.Publishing, later
publish = falsefrom both Cargo.toml files.crates-io-envschema-tokenin 1Password'snathans-ai-agentsvault, scoped topublish-new(andpublish-updatefor these two crate names). Then runCARGO_REGISTRY_TOKEN=... cargo publish --locked -p envschema-derive -p envschema. Trusted publishing can only be configured for a crate that already exists.release.yml, no environment.DELETE https://crates.io/api/v1/tokens/currentwith the token itself, or in the browser) and delete the 1Password item. Thecrates-token-revocationmemory note tracks this pattern.Checks (agents-build-1)
cargo fmt --all --check: clean.cargo clippy --locked -p envschema -p envschema-derive --all-targets -- -D warnings: clean.cargo test --locked -p envschema -p envschema-derive: 4 unit tests, 9 integration tests and 9 doc tests passed. The Laravel block is the 1 ignored.RUSTDOCFLAGS="-D warnings" cargo doc -p envschema -p envschema-derive --no-deps: clean.cargo +1.88 check --all-targetsandcargo +1.88 testpassed (let-chains need 1.88).examples/std_env: it stops when a required setting is missing, warnsMYAPP_PROT is set, but nothing reads it (did you mean MYAPP_PORT?), and stops in production withoutMYAPP_POSTMARK_TOKEN.cargo package --list: envschema shipsCargo.lock,Cargo.toml,LICENSE,README.md,examples/std_env.rs,src/lib.rsandtests/settings.rs. envschema-derive shipsCargo.lock,Cargo.toml,LICENSE,README.mdandsrc/lib.rs.publish = false,cargo package -p envschemafails with "no matching package namedenvschema-derive". Cargo only builds its local registry overlay for an unpublished workspace dependency when the packages are publishable.publish = trueand rancargo package --locked -p envschema-derive -p envschemawith verification: both packaged and built from their .crate files.cargo publish --dry-runfor the same two crates also passed and aborted before uploading. The packaged Cargo.toml hasenvschema-derive = { version = "0.1.0" }andlicense = "Apache-2.0".actionlinton release.yml (rhysd/actionlint:1.7.7): the new job is clean. It still reports one existing SC2015 note in thebuildjob's Package step (cp ... || true), which this PR doesn't touch.No CLI crate changes, so no version bump.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.