@svebcomponents/utils Changelog
@svebcomponents/utils
0.1.0
Minor Changes
-
c2f1b6c: Add
defineElement(tagName, component)— a safe registration helper for component entry points.Every component package previously hand-wrote the same guarded
customElements.defineboilerplate, with subtle variations (some checked"element" in Component, someComponent.elementtruthiness, some forgot the already-registered guard).defineElementowns the arcana:- no-ops when the component has no custom element constructor (the server compile)
- no-ops when there is no
customElementsregistry at all - no-ops when the tag is already registered — svelte auto-defines when
<svelte:options customElement={{ tag }}>declares a tag, and a page can load two bundles containing the same component; first registration wins instead of throwing
Entry points shrink to:
import { defineElement } from "@svebcomponents/utils";import MyComponent from "./MyComponent.svelte";export default MyComponent;defineElement("my-component", MyComponent);
0.0.3
Patch Changes
- 9be6326: Allow digits in
isKebabCaseso attribute names likecol-2orheading2are correctly detected as attributes, fixing SSR/client markup divergence. - 724f00a: Declare supported Node versions (
engines.node: ">=20.19.0") so consumers get a clear error instead of an opaque runtime failure on unsupported Node versions. - e7e4adf: Fix publint compliance: put the
typesexport condition first so TypeScript resolves declarations as published, addfilesfields so tarballs only shipdist(andbin.jsfor the build package), and run publint as part of every publishable package’s build. - d2094d2: Remove the unused
TODO()helper export and its README documentation. Nothing in the repo (or any published svebcomponents package) called it — it was dead code that only logged to the console. Strictly speaking, dropping an export is a breaking change, but the package is 0.x and the helper was documented as internal/experimental, so this ships as a patch.
0.0.2
Patch Changes
- 8aa8512: fix: publish private utils dependency