Skip to content

0.18.1

Choose a tag to compare

@SisyphusZheng SisyphusZheng released this 17 May 02:51
· 254 commits to main since this release

Changelog: v0.18.1

Release date: 2026-05-17
Release type: minor patch (CLI + diagnostics)

Overview

v0.18.1 adds less validate-manifest — a deterministic validation command for
CEM manifests. Users and CI pipelines can now verify a third-party Web Component
package's compatibility before installing or rendering it.

What's New

Core Validation Module (@lessjs/core/validate-manifest)

New module packages/core/src/validate-manifest.ts with comprehensive validation:

Check Code Severity What it validates
Schema version MISSING_SCHEMA_VERSION error schemaVersion field
Modules array MISSING_MODULES error modules array exists
Empty modules EMPTY_MODULES warning modules array is not empty
Module path MISSING_MODULE_PATH warning Each module has a path field
Tag name EMPTY_TAG_NAME error Tag name is not empty
Tag name format INVALID_TAG_NAME error Tag name contains a hyphen
Duplicate tags DUPLICATE_TAG error No duplicate tag across modules
Absolute path INVALID_MODULE_PATH error Module paths are relative, not absolute
Path traversal INVALID_MODULE_PATH error No ../ outside package root
URL path INVALID_MODULE_PATH error No HTTP/HTTPS paths
Superclass path INVALID_SUPERCLASS_PATH error Superclass module paths are valid
less.ssr type INVALID_SSR_VALUE error Must be boolean
less.dsd type INVALID_DSD_VALUE error Must be boolean
Hydrate strategy INVALID_HYDRATE_STRATEGY error Must be one of: eager/lazy/idle/visible
Layer INVALID_LAYER error Must be one of: dsd-static/dsd-interactive/pure-island
No custom elements NO_CUSTOM_ELEMENTS warning At least one custom-element declaration
Exports no decls EXPORTS_WITHOUT_DECLARATIONS warning Module has exports but no declarations

CLI (less validate-manifest)

Three modes:

# Human-readable default
deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json

# Machine-readable JSON
deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --json

# Strict mode (fails on warnings too)
deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --strict

Exit codes:

  • 0 — manifest is valid
  • 1 — manifest has errors (or warnings in strict mode)

New Public API

Added to @lessjs/core:

Types:

  • ValidationDiagnostic — structured error/warning with code, severity, message, fix
  • ValidatedTag — per-tag validation result with compatibility tier
  • ManifestValidationReport — full validation report

Functions:

  • validateManifest(manifest) — validate a parsed CustomElementsManifest
  • validateManifestFromJson(json) — convenience wrapper for raw JSON

Exports:

  • @lessjs/core/validate-manifest — validation module
  • @lessjs/core/cli/validate-manifest — CLI entry point

Verification

  • valid Less manifest returns exit code 0
  • CEM-only package is valid but client-only
  • duplicate tag returns exit code 1
  • path traversal returns exit code 1
  • malformed Less extension returns actionable error
  • JSON output is deterministic
  • deno task fmt && deno task lint && deno task typecheck
  • deno task test (659 tests, 29 new)
  • deno task build

Breaking Changes

None. v0.18.1 adds new API surface without modifying existing interfaces.

  • New optional exports: validateManifest, validateManifestFromJson
  • New optional subpath exports: @lessjs/core/validate-manifest, @lessjs/core/cli/validate-manifest
  • No behavior changes to existing code

Migration Guide

For users: No action needed. v0.18.1 is a drop-in replacement for v0.18.0.

For CI/CD pipelines: Add less validate-manifest to your pre-install gates:

deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --json

For package authors: Run validate-manifest on your custom-elements.json to
catch issues before publishing:

deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json

Next Steps

With v0.18.1 complete, the project can now proceed to:

  • v0.18.2: less add — one-click install + configuration flow
  • See docs/sop/v0.18.2-less-add-install-flow.md

Diff Summary

git diff --stat v0.18.0..v0.18.1

packages/core/__tests__/validate-manifest.test.ts (new, 513 lines)
packages/core/deno.json (2 lines changed)
packages/core/src/cli/validate-manifest.ts (new, 104 lines)
packages/core/src/index.ts (9 lines changed)
packages/core/src/types.ts (72 lines changed)
packages/core/src/validate-manifest.ts (new, 466 lines)

Stats:

  • 3 new files
  • 3 modified files
  • 29 new tests (659 total)
  • +1,167 / -1 lines