@jay-framework/jay-stack-cli 0.9.0 → 0.11.0

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/README.md CHANGED
@@ -14,16 +14,68 @@ npm install @jay-framework/stack-cli
14
14
 
15
15
  ## Usage
16
16
 
17
- ### Basic Usage
17
+ ### Commands
18
18
 
19
- Simply run the CLI from your project root:
19
+ #### `jay-stack dev [path]`
20
+
21
+ Start the development server:
20
22
 
21
23
  ```bash
22
- @jay-framework/@jay-framework/jay-cli
24
+ jay-stack dev # Start dev server in current directory
25
+ jay-stack dev ./my-project # Start dev server in specified directory
23
26
  ```
24
27
 
25
28
  This will start both the development server and editor server with default configuration.
26
29
 
30
+ #### `jay-stack validate [path]`
31
+
32
+ Validate all `.jay-html` and `.jay-contract` files in the project without creating output files:
33
+
34
+ ```bash
35
+ jay-stack validate # Validate files in pagesBase from config
36
+ jay-stack validate ./src/pages # Validate files in specified directory
37
+ jay-stack validate --verbose # Show per-file validation status
38
+ jay-stack validate --json # Output results as JSON (for CI/tooling)
39
+ ```
40
+
41
+ This command is useful for:
42
+
43
+ - **CI pipelines**: Returns exit code 1 on validation errors
44
+ - **Development workflow**: Quick syntax checking without running the dev server
45
+ - **Vite integration**: Validate generated `.jay-html` files
46
+
47
+ Example output:
48
+
49
+ ```
50
+ ✅ Jay Stack validation successful!
51
+
52
+ Scanned 12 .jay-html files, 5 .jay-contract files
53
+ No errors found.
54
+ ```
55
+
56
+ Or with errors:
57
+
58
+ ```
59
+ ❌ Jay Stack validation failed
60
+
61
+ Errors:
62
+ ❌ src/pages/product/page.jay-html
63
+ jay file should have exactly one jay-data script, found 2
64
+
65
+ 1 error(s) found, 11 file(s) valid.
66
+ ```
67
+
68
+ #### `jay-stack validate-plugin [path]`
69
+
70
+ Validate a Jay Stack plugin package:
71
+
72
+ ```bash
73
+ jay-stack validate-plugin # Validate plugin in current directory
74
+ jay-stack validate-plugin ./my-plugin # Validate plugin in specified directory
75
+ jay-stack validate-plugin --verbose # Show detailed validation output
76
+ jay-stack validate-plugin --strict # Treat warnings as errors (for CI)
77
+ ```
78
+
27
79
  ### Configuration
28
80
 
29
81
  The CLI uses a `.jay` configuration file (YAML format) to customize port ranges for both servers. Create a `.jay` file in your project root:
@@ -143,15 +195,29 @@ The CLI is built using:
143
195
  - **get-port** - Automatic port discovery
144
196
  - **Vite** - Build tool integration
145
197
 
146
- ## Future Enhancements
198
+ ## CLI Reference
199
+
200
+ | Command | Description |
201
+ | ---------------------------------- | ---------------------------------------- |
202
+ | `jay-stack dev [path]` | Start the development server |
203
+ | `jay-stack validate [path]` | Validate jay-html and jay-contract files |
204
+ | `jay-stack validate-plugin [path]` | Validate a plugin package |
205
+
206
+ ### Validate Command Options
207
+
208
+ | Option | Description |
209
+ | --------------- | ------------------------------- |
210
+ | `-v, --verbose` | Show per-file validation status |
211
+ | `--json` | Output results as JSON |
147
212
 
148
- **Note**: The CLI currently does not accept command-line parameters. This will change in future versions to support:
213
+ ### Validate-Plugin Command Options
149
214
 
150
- - Custom pages directory path
151
- - Custom TypeScript configuration file
152
- - Custom output directory
153
- - Additional server configuration options
154
- - Development vs production modes
215
+ | Option | Description |
216
+ | ------------------ | -------------------------------------- |
217
+ | `-v, --verbose` | Show detailed validation output |
218
+ | `--strict` | Treat warnings as errors (for CI) |
219
+ | `--local` | Validate local plugins in src/plugins/ |
220
+ | `--generate-types` | Generate .d.ts files for contracts |
155
221
 
156
222
  ## Related Packages
157
223
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import { PublishMessage, PublishResponse, SaveImageMessage, SaveImageResponse, HasImageMessage, HasImageResponse } from '@jay-framework/editor-protocol';
1
+ import { PublishMessage, PublishResponse, SaveImageMessage, SaveImageResponse, HasImageMessage, HasImageResponse, GetProjectInfoMessage, GetProjectInfoResponse } from '@jay-framework/editor-protocol';
2
+
3
+ interface StartDevServerOptions {
4
+ projectPath?: string;
5
+ }
6
+ declare function startDevServer(options?: StartDevServerOptions): Promise<void>;
2
7
 
3
8
  interface JayConfig {
4
9
  devServer?: {
@@ -6,6 +11,7 @@ interface JayConfig {
6
11
  pagesBase?: string;
7
12
  componentsBase?: string;
8
13
  publicFolder?: string;
14
+ configBase?: string;
9
15
  };
10
16
  editorServer?: {
11
17
  portRange?: [number, number];
@@ -16,10 +22,11 @@ declare function loadConfig(): JayConfig;
16
22
  declare function getConfigWithDefaults(config: JayConfig): Required<JayConfig>;
17
23
  declare function updateConfig(updates: Partial<JayConfig>): void;
18
24
 
19
- declare function createEditorHandlers(config: Required<JayConfig>, tsConfigPath: string): {
25
+ declare function createEditorHandlers(config: Required<JayConfig>, tsConfigPath: string, projectRoot: string): {
20
26
  onPublish: (params: PublishMessage) => Promise<PublishResponse>;
21
27
  onSaveImage: (params: SaveImageMessage) => Promise<SaveImageResponse>;
22
28
  onHasImage: (params: HasImageMessage) => Promise<HasImageResponse>;
29
+ onGetProjectInfo: (params: GetProjectInfoMessage) => Promise<GetProjectInfoResponse>;
23
30
  };
24
31
 
25
- export { type JayConfig, createEditorHandlers, getConfigWithDefaults, loadConfig, updateConfig };
32
+ export { type JayConfig, type StartDevServerOptions, createEditorHandlers, getConfigWithDefaults, loadConfig, startDevServer, updateConfig };