@glasshome/widget-cli 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/widget-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "CLI for creating and managing GlassHome widgets",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,6 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
3
  import { log, spinner } from "@clack/prompts";
4
- import { WidgetManifestSchema } from "@glasshome/widget-sdk/schemas";
5
4
  import {
6
5
  discoverWidgets,
7
6
  formatBytes,
@@ -23,13 +22,25 @@ function validateManifest(manifest: WidgetManifest): ValidationResult {
23
22
  const errors: string[] = [];
24
23
  const warnings: string[] = [];
25
24
 
26
- // Validate core manifest shape using the shared schema
27
- const result = WidgetManifestSchema.safeParse(manifest);
28
- if (!result.success) {
29
- for (const issue of result.error.issues) {
30
- const path = issue.path.length > 0 ? issue.path.join(".") : "manifest";
31
- errors.push(`${path}: ${issue.message}`);
32
- }
25
+ // Required fields
26
+ if (!manifest.tag) errors.push("Missing required field: tag");
27
+ if (!manifest.name) errors.push("Missing required field: name");
28
+ if (!manifest.sdkVersion) errors.push("Missing required field: sdkVersion");
29
+
30
+ // Size validation
31
+ if (
32
+ !manifest.minSize ||
33
+ typeof manifest.minSize.w !== "number" ||
34
+ typeof manifest.minSize.h !== "number"
35
+ ) {
36
+ errors.push("minSize must be an object with numeric w and h properties");
37
+ }
38
+ if (
39
+ !manifest.maxSize ||
40
+ typeof manifest.maxSize.w !== "number" ||
41
+ typeof manifest.maxSize.h !== "number"
42
+ ) {
43
+ errors.push("maxSize must be an object with numeric w and h properties");
33
44
  }
34
45
 
35
46
  // Tag format (stricter than schema — enforces kebab-case with at least one hyphen)