Skip to content

softschema 0.2.1

Choose a tag to compare

@jlevy jlevy released this 15 Jun 17:14
ee64231

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.js listed re-exports the bundler had tree-shaken away — a side effect of "sideEffects": false on a pure re-export barrel — so import { validateArtifact } from "softschema" threw SyntaxError: Export 'X' is not defined at load time. The entrypoint now resolves every public symbol, and index.js/cli.js share one chunk.
  • ESM main check (#16). The CLI's import.meta.main guard lowered to an always-true CommonJS check in the bundle, so importing the module (for example via the ./cli subpath) executed the CLI. It now compares the realpath of process.argv[1] against import.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 isinstance check.

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).