@jay-framework/jay-stack-cli 0.6.9 → 0.7.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 +57 -12
- package/dist/index.js +123 -15913
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ The CLI uses a `.jay` configuration file (YAML format) to customize port ranges
|
|
|
32
32
|
devServer:
|
|
33
33
|
portRange: [3000, 3100]
|
|
34
34
|
pagesBase: './src/pages' # Directory containing your Jay pages
|
|
35
|
+
componentsBase: './src/components' # Directory containing your Jay components
|
|
35
36
|
publicFolder: './public' # Directory for static files (CSS, JS, images, etc.)
|
|
36
37
|
editorServer:
|
|
37
38
|
portRange: [3101, 3200]
|
|
@@ -42,6 +43,7 @@ If no `.jay` file is found, the CLI will use default values:
|
|
|
42
43
|
|
|
43
44
|
- **Dev Server Port Range**: `3000-3100`
|
|
44
45
|
- **Pages Directory**: `./src/pages`
|
|
46
|
+
- **Components Directory**: `./src/components`
|
|
45
47
|
- **Public Folder**: `./public`
|
|
46
48
|
- **Editor Server Port Range**: `3101-3200`
|
|
47
49
|
|
|
@@ -54,6 +56,7 @@ The CLI automatically finds available ports within these ranges using the `get-p
|
|
|
54
56
|
The CLI uses the following default configuration:
|
|
55
57
|
|
|
56
58
|
- **Pages Directory**: `./src/pages` - All Jay pages should be placed in this directory
|
|
59
|
+
- **Components Directory**: `./src/components` - All Jay components should be placed in this directory
|
|
57
60
|
- **Public Folder**: `./public` - Static files (CSS, JS, images) are served from this directory
|
|
58
61
|
- **TypeScript Config**: `./tsconfig.json` - Uses the project's TypeScript configuration
|
|
59
62
|
- **Output Directory**: `build/@jay-framework/runtime` - Compiled Jay runtime files
|
|
@@ -68,18 +71,25 @@ Your project should have the following structure:
|
|
|
68
71
|
```
|
|
69
72
|
your-project/
|
|
70
73
|
├── src/
|
|
71
|
-
│
|
|
72
|
-
│
|
|
73
|
-
│
|
|
74
|
-
│
|
|
75
|
-
│
|
|
76
|
-
│
|
|
77
|
-
│
|
|
78
|
-
│
|
|
79
|
-
│
|
|
80
|
-
│
|
|
81
|
-
│
|
|
82
|
-
│
|
|
74
|
+
│ ├── pages/ # Your Jay pages go here
|
|
75
|
+
│ │ ├── page.jay-html # homepage
|
|
76
|
+
│ │ ├── page.jay-contract # optional contract for homepage (headless pages)
|
|
77
|
+
│ │ ├── page.ts # optional logic for the page
|
|
78
|
+
│ │ └── page2/
|
|
79
|
+
│ │ ├── page.jay-html # a page with the url /page2
|
|
80
|
+
│ │ ├── page.jay-contract # optional contract for page2
|
|
81
|
+
│ │ └── page.ts # optional logic for page2
|
|
82
|
+
│ │ └── segment/
|
|
83
|
+
│ │ ├── page.jay-html # the root page for the url subdirectory /segment
|
|
84
|
+
│ │ ├── page.ts # optional logic for the segment root page
|
|
85
|
+
│ │ └── [slug]/ # parameterized segment
|
|
86
|
+
│ │ ├── page.jay-html # a page with url parameters
|
|
87
|
+
│ │ ├── page.ts # optional logic for the segment parameterized page
|
|
88
|
+
│ └── components/ # Your Jay components go here
|
|
89
|
+
│ ├── Button.jay-html # reusable button component
|
|
90
|
+
│ ├── Button.jay-contract # optional contract for headless components
|
|
91
|
+
│ ├── Button.ts # optional logic for the button
|
|
92
|
+
│ └── Counter.jay-html # another component
|
|
83
93
|
├── public/ # Static files (CSS, JS, images, etc.)
|
|
84
94
|
│ ├── styles.css
|
|
85
95
|
│ ├── script.js
|
|
@@ -88,6 +98,41 @@ your-project/
|
|
|
88
98
|
└── package.json
|
|
89
99
|
```
|
|
90
100
|
|
|
101
|
+
## Editor Integration & Contract Publishing
|
|
102
|
+
|
|
103
|
+
The Jay Stack CLI supports publishing both pages and components through editor integrations. This includes support for **jay-contract files** which enable headless component functionality:
|
|
104
|
+
|
|
105
|
+
### Contract Files
|
|
106
|
+
|
|
107
|
+
Contract files (`.jay-contract`) define the interface for headless components:
|
|
108
|
+
|
|
109
|
+
- **Data Structure**: Defines what data the component expects
|
|
110
|
+
- **Refs Interface**: Specifies interactive elements and their types
|
|
111
|
+
- **Component Name**: Identifies the component for imports
|
|
112
|
+
|
|
113
|
+
### Publishing Support
|
|
114
|
+
|
|
115
|
+
When using design tools or editor integrations, you can publish:
|
|
116
|
+
|
|
117
|
+
1. **Pages**: `page.jay-html` + optional `page.jay-contract`
|
|
118
|
+
2. **Components**: `{name}.jay-html` + optional `{name}.jay-contract`
|
|
119
|
+
|
|
120
|
+
Contract files are automatically placed alongside their corresponding jay-html files and can be referenced in headless imports:
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<script
|
|
124
|
+
type="application/jay-headless"
|
|
125
|
+
contract="./Button.jay-contract"
|
|
126
|
+
src="./Button"
|
|
127
|
+
name="button"
|
|
128
|
+
key="button"
|
|
129
|
+
></script>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Backward Compatibility
|
|
133
|
+
|
|
134
|
+
Contract publishing is completely optional and maintains full backward compatibility with existing Jay Stack projects.
|
|
135
|
+
|
|
91
136
|
## Development
|
|
92
137
|
|
|
93
138
|
The CLI is built using:
|