@jay-framework/jay-stack-cli 0.15.4 → 0.15.6

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.
Files changed (36) hide show
  1. package/agent-kit-template/{INSTRUCTIONS.md → designer/INSTRUCTIONS.md} +11 -8
  2. package/agent-kit-template/{contracts-and-plugins.md → designer/contracts-and-plugins.md} +1 -0
  3. package/agent-kit-template/{jay-html-syntax.md → designer/jay-html-components.md} +89 -158
  4. package/agent-kit-template/designer/jay-html-styling.md +97 -0
  5. package/agent-kit-template/designer/jay-html-syntax.md +44 -0
  6. package/agent-kit-template/designer/jay-html-template-syntax.md +203 -0
  7. package/agent-kit-template/developer/INSTRUCTIONS.md +34 -0
  8. package/agent-kit-template/developer/cli-commands.md +228 -0
  9. package/agent-kit-template/developer/component-data.md +109 -0
  10. package/agent-kit-template/developer/component-refs.md +117 -0
  11. package/agent-kit-template/developer/component-state.md +140 -0
  12. package/agent-kit-template/developer/configuration.md +76 -0
  13. package/agent-kit-template/developer/page-components.md +103 -0
  14. package/agent-kit-template/developer/page-contracts.md +114 -0
  15. package/agent-kit-template/developer/project-structure.md +242 -0
  16. package/agent-kit-template/developer/render-results.md +112 -0
  17. package/agent-kit-template/developer/routing.md +161 -0
  18. package/agent-kit-template/developer/seo-guide.md +93 -0
  19. package/agent-kit-template/plugin/INSTRUCTIONS.md +40 -0
  20. package/agent-kit-template/plugin/actions-guide.md +125 -0
  21. package/agent-kit-template/plugin/component-context.md +103 -0
  22. package/agent-kit-template/plugin/component-data.md +109 -0
  23. package/agent-kit-template/plugin/component-refs.md +117 -0
  24. package/agent-kit-template/plugin/component-state.md +140 -0
  25. package/agent-kit-template/plugin/component-structure.md +174 -0
  26. package/agent-kit-template/plugin/contracts-guide.md +193 -0
  27. package/agent-kit-template/plugin/plugin-structure.md +194 -0
  28. package/agent-kit-template/plugin/render-results.md +112 -0
  29. package/agent-kit-template/plugin/seo-guide.md +93 -0
  30. package/agent-kit-template/plugin/services-guide.md +116 -0
  31. package/agent-kit-template/plugin/validation.md +101 -0
  32. package/dist/index.js +805 -61
  33. package/package.json +10 -10
  34. /package/agent-kit-template/{cli-commands.md → designer/cli-commands.md} +0 -0
  35. /package/agent-kit-template/{project-structure.md → designer/project-structure.md} +0 -0
  36. /package/agent-kit-template/{routing.md → designer/routing.md} +0 -0
@@ -0,0 +1,101 @@
1
+ # Plugin Validation
2
+
3
+ Run `jay-stack validate-plugin` to check your plugin for errors.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ # Validate the current plugin
9
+ jay-stack validate-plugin
10
+
11
+ # Validate a specific plugin path
12
+ jay-stack validate-plugin --path ./src/plugins/my-plugin
13
+
14
+ # Verbose output
15
+ jay-stack validate-plugin -v
16
+ ```
17
+
18
+ ## What It Checks
19
+
20
+ ### Contract Validation
21
+
22
+ - YAML structure is valid
23
+ - All required fields are present (`name`, `tags`)
24
+ - Tag types are valid (`data`, `variant`, `interactive`, `sub-contract`)
25
+ - `dataType` is valid for the tag type
26
+ - `trackBy` references an existing data tag with string/number type
27
+ - `repeated` sub-contracts have `trackBy`
28
+ - Phase constraints are satisfied (children >= parent for arrays)
29
+ - No duplicate tag names at the same level
30
+ - Props have valid types and unique names
31
+
32
+ ### Plugin Structure
33
+
34
+ - `plugin.yaml` exists and is valid YAML
35
+ - Contract files referenced in `plugin.yaml` exist
36
+ - Component export names are valid strings (not file paths)
37
+ - Action metadata files (`.jay-action`) exist
38
+
39
+ ### Type Generation
40
+
41
+ - Contracts compile to valid TypeScript types
42
+ - Generated ViewState, Refs, Props, and Params interfaces are correct
43
+
44
+ ## Common Errors
45
+
46
+ ### "trackBy references non-existent tag"
47
+
48
+ The `trackBy` field must reference a `data` tag within the same sub-contract:
49
+
50
+ ```yaml
51
+ # Wrong — trackBy references a tag that doesn't exist
52
+ - tag: items
53
+ type: sub-contract
54
+ repeated: true
55
+ trackBy: itemId # No tag named "itemId"
56
+ tags:
57
+ - tag: id # Should be "itemId" or trackBy should be "id"
58
+ type: data
59
+ dataType: string
60
+ ```
61
+
62
+ ### "Child phase earlier than parent"
63
+
64
+ Array children must have phase >= parent:
65
+
66
+ ```yaml
67
+ # Wrong
68
+ - tag: items
69
+ type: sub-contract
70
+ repeated: true
71
+ trackBy: id
72
+ phase: fast
73
+ tags:
74
+ - tag: name
75
+ type: data
76
+ phase: slow # Error: slow < fast
77
+ ```
78
+
79
+ ### "Interactive tag cannot have explicit phase"
80
+
81
+ Interactive tags are always `fast+interactive`:
82
+
83
+ ```yaml
84
+ # Wrong
85
+ - tag: button
86
+ type: interactive
87
+ elementType: HTMLButtonElement
88
+ phase: slow # Error: remove this line
89
+ ```
90
+
91
+ ### "Component looks like a path"
92
+
93
+ The `component` field in `plugin.yaml` should be an export name, not a file path:
94
+
95
+ ```yaml
96
+ # Wrong
97
+ component: ./lib/components/product-page.ts
98
+
99
+ # Right
100
+ component: productPage
101
+ ```