softschema 0.2.1
softschema 0.2.1 is a patch release that repairs the npm library entrypoint and makes the CLI's module-entry detection ESM-safe, alongside a documentation pass and internal review cleanups. No breaking changes; Python and TypeScript publish together under this one version.
Fixes and hardening
- Library entrypoint (#16). The published
index.jslisted re-exports the bundler had tree-shaken away — a side effect of"sideEffects": falseon a pure re-export barrel — soimport { validateArtifact } from "softschema"threwSyntaxError: Export 'X' is not definedat load time. The entrypoint now resolves every public symbol, andindex.js/cli.jsshare one chunk. - ESM main check (#16). The CLI's
import.meta.mainguard lowered to an always-true CommonJS check in the bundle, so importing the module (for example via the./clisubpath) executed the CLI. It now compares the realpath ofprocess.argv[1]againstimport.meta.url, which also handles the symlink that npm/npx install for the bin.
Documentation
- Applied the common documentation guidelines across the living docs: American-style em dashes, Title Case headings, and relative in-repo links.
Internal
- Senior-review cleanups in both implementations, with no behavior change: consolidated a duplicated type-name helper, replaced a module-level mutable regex with a local one, dropped redundant tests, and modernized an
isinstancecheck.
Testing and release safety
- Added a regression test proving the named import resolves to callables and that importing the package (entrypoint or
./cli) never runs CLI behavior, plus a check of the public type surface. - Both packaged artifacts were smoke-tested from clean installs before tagging: the Python wheel in a fresh venv, and the npm tarball under plain Node (bin shebang, bundled resources, and the library import).