|
| 1 | +# Changelog: v0.18.1 |
| 2 | + |
| 3 | +> Release date: 2026-05-17 |
| 4 | +> Release type: **minor patch (CLI + diagnostics)** |
| 5 | +
|
| 6 | +## Overview |
| 7 | + |
| 8 | +v0.18.1 adds `less validate-manifest` — a deterministic validation command for |
| 9 | +CEM manifests. Users and CI pipelines can now verify a third-party Web Component |
| 10 | +package's compatibility before installing or rendering it. |
| 11 | + |
| 12 | +## What's New |
| 13 | + |
| 14 | +### Core Validation Module (`@lessjs/core/validate-manifest`) |
| 15 | + |
| 16 | +New module `packages/core/src/validate-manifest.ts` with comprehensive validation: |
| 17 | + |
| 18 | +| Check | Code | Severity | What it validates | |
| 19 | +| ------------------ | ------------------------------ | -------- | ------------------------------------------------------ | |
| 20 | +| Schema version | `MISSING_SCHEMA_VERSION` | error | `schemaVersion` field | |
| 21 | +| Modules array | `MISSING_MODULES` | error | `modules` array exists | |
| 22 | +| Empty modules | `EMPTY_MODULES` | warning | `modules` array is not empty | |
| 23 | +| Module path | `MISSING_MODULE_PATH` | warning | Each module has a `path` field | |
| 24 | +| Tag name | `EMPTY_TAG_NAME` | error | Tag name is not empty | |
| 25 | +| Tag name format | `INVALID_TAG_NAME` | error | Tag name contains a hyphen | |
| 26 | +| Duplicate tags | `DUPLICATE_TAG` | error | No duplicate tag across modules | |
| 27 | +| Absolute path | `INVALID_MODULE_PATH` | error | Module paths are relative, not absolute | |
| 28 | +| Path traversal | `INVALID_MODULE_PATH` | error | No `../` outside package root | |
| 29 | +| URL path | `INVALID_MODULE_PATH` | error | No HTTP/HTTPS paths | |
| 30 | +| Superclass path | `INVALID_SUPERCLASS_PATH` | error | Superclass module paths are valid | |
| 31 | +| `less.ssr` type | `INVALID_SSR_VALUE` | error | Must be boolean | |
| 32 | +| `less.dsd` type | `INVALID_DSD_VALUE` | error | Must be boolean | |
| 33 | +| Hydrate strategy | `INVALID_HYDRATE_STRATEGY` | error | Must be one of: eager/lazy/idle/visible | |
| 34 | +| Layer | `INVALID_LAYER` | error | Must be one of: dsd-static/dsd-interactive/pure-island | |
| 35 | +| No custom elements | `NO_CUSTOM_ELEMENTS` | warning | At least one `custom-element` declaration | |
| 36 | +| Exports no decls | `EXPORTS_WITHOUT_DECLARATIONS` | warning | Module has exports but no declarations | |
| 37 | + |
| 38 | +### CLI (`less validate-manifest`) |
| 39 | + |
| 40 | +Three modes: |
| 41 | + |
| 42 | +```sh |
| 43 | +# Human-readable default |
| 44 | +deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json |
| 45 | + |
| 46 | +# Machine-readable JSON |
| 47 | +deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --json |
| 48 | + |
| 49 | +# Strict mode (fails on warnings too) |
| 50 | +deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --strict |
| 51 | +``` |
| 52 | + |
| 53 | +Exit codes: |
| 54 | + |
| 55 | +- `0` — manifest is valid |
| 56 | +- `1` — manifest has errors (or warnings in strict mode) |
| 57 | + |
| 58 | +### New Public API |
| 59 | + |
| 60 | +Added to `@lessjs/core`: |
| 61 | + |
| 62 | +**Types**: |
| 63 | + |
| 64 | +- `ValidationDiagnostic` — structured error/warning with code, severity, message, fix |
| 65 | +- `ValidatedTag` — per-tag validation result with compatibility tier |
| 66 | +- `ManifestValidationReport` — full validation report |
| 67 | + |
| 68 | +**Functions**: |
| 69 | + |
| 70 | +- `validateManifest(manifest)` — validate a parsed `CustomElementsManifest` |
| 71 | +- `validateManifestFromJson(json)` — convenience wrapper for raw JSON |
| 72 | + |
| 73 | +**Exports**: |
| 74 | + |
| 75 | +- `@lessjs/core/validate-manifest` — validation module |
| 76 | +- `@lessjs/core/cli/validate-manifest` — CLI entry point |
| 77 | + |
| 78 | +## Verification |
| 79 | + |
| 80 | +- [x] valid Less manifest returns exit code 0 |
| 81 | +- [x] CEM-only package is valid but `client-only` |
| 82 | +- [x] duplicate tag returns exit code 1 |
| 83 | +- [x] path traversal returns exit code 1 |
| 84 | +- [x] malformed Less extension returns actionable error |
| 85 | +- [x] JSON output is deterministic |
| 86 | +- [x] `deno task fmt && deno task lint && deno task typecheck` |
| 87 | +- [x] `deno task test` (659 tests, 29 new) |
| 88 | +- [x] `deno task build` |
| 89 | + |
| 90 | +## Breaking Changes |
| 91 | + |
| 92 | +None. v0.18.1 adds new API surface without modifying existing interfaces. |
| 93 | + |
| 94 | +- New optional exports: `validateManifest`, `validateManifestFromJson` |
| 95 | +- New optional subpath exports: `@lessjs/core/validate-manifest`, `@lessjs/core/cli/validate-manifest` |
| 96 | +- No behavior changes to existing code |
| 97 | + |
| 98 | +## Migration Guide |
| 99 | + |
| 100 | +**For users**: No action needed. v0.18.1 is a drop-in replacement for v0.18.0. |
| 101 | + |
| 102 | +**For CI/CD pipelines**: Add `less validate-manifest` to your pre-install gates: |
| 103 | + |
| 104 | +```sh |
| 105 | +deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json --json |
| 106 | +``` |
| 107 | + |
| 108 | +**For package authors**: Run `validate-manifest` on your `custom-elements.json` to |
| 109 | +catch issues before publishing: |
| 110 | + |
| 111 | +```sh |
| 112 | +deno run -A jsr:@lessjs/core/cli/validate-manifest ./custom-elements.json |
| 113 | +``` |
| 114 | + |
| 115 | +## Next Steps |
| 116 | + |
| 117 | +With v0.18.1 complete, the project can now proceed to: |
| 118 | + |
| 119 | +- **v0.18.2**: `less add` — one-click install + configuration flow |
| 120 | +- See `docs/sop/v0.18.2-less-add-install-flow.md` |
| 121 | + |
| 122 | +## Diff Summary |
| 123 | + |
| 124 | +```bash |
| 125 | +git diff --stat v0.18.0..v0.18.1 |
| 126 | + |
| 127 | +packages/core/__tests__/validate-manifest.test.ts (new, 513 lines) |
| 128 | +packages/core/deno.json (2 lines changed) |
| 129 | +packages/core/src/cli/validate-manifest.ts (new, 104 lines) |
| 130 | +packages/core/src/index.ts (9 lines changed) |
| 131 | +packages/core/src/types.ts (72 lines changed) |
| 132 | +packages/core/src/validate-manifest.ts (new, 466 lines) |
| 133 | +``` |
| 134 | + |
| 135 | +**Stats**: |
| 136 | + |
| 137 | +- 3 new files |
| 138 | +- 3 modified files |
| 139 | +- 29 new tests (659 total) |
| 140 | +- +1,167 / -1 lines |
0 commit comments