@wire-dsl/cli 0.1.6 → 0.2.1

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/LICENSE CHANGED
@@ -19,18 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
- ---
24
-
25
- ## Third-Party Components & Assets
26
-
27
- ### Feather Icons
28
-
29
- This project includes icons from Feather Icons (https://feathericons.com), created by Cole Bemis and contributors.
30
-
31
- - **License**: MIT License
32
- - **Repository**: https://github.com/feathericons/feather
33
- - **Location in project**: `packages/core/src/renderer/icons/`
34
- - **Full details**: See `packages/core/src/renderer/icons/ICONS-LICENSE.md`
35
-
36
- Feather Icons are used under the terms of the MIT License, which is fully compatible with this project's MIT License.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @wire-dsl/cli
2
2
 
3
- Command-line interface for Wire-DSL. Transform `.wire` DSL files into interactive wireframes, components, and releases.
3
+ Command-line interface for Wire-DSL. Transform `.wire` DSL files into SVG, PNG, and PDF wireframes.
4
4
 
5
5
  ## Installation
6
6
 
@@ -66,14 +66,26 @@ Wire-DSL is a **block-declarative Domain-Specific Language** for creating intera
66
66
  Write wireframes like this:
67
67
 
68
68
  ```wire
69
- screen "Dashboard" {
70
- layout grid(columns: 2, gap: 16) {
71
- layout card(padding: lg, gap: md, border: true) {
72
- component StatCard title: "Q4 Revenue" value: "$2.5M"
73
- }
74
-
75
- layout card(padding: lg, gap: md, border: true) {
76
- component StatCard title: "Active Users" value: "1.2K"
69
+ project "Dashboard" {
70
+ theme {
71
+ density: "normal"
72
+ spacing: "md"
73
+ radius: "md"
74
+ stroke: "normal"
75
+ font: "base"
76
+ }
77
+ screen Dashboard {
78
+ layout grid(columns: 2, gap: md) {
79
+ cell span: 1 {
80
+ layout card(padding: lg, gap: md, radius: md, border: true) {
81
+ component StatCard title: "Q4 Revenue" value: "$2.5M"
82
+ }
83
+ }
84
+ cell span: 1 {
85
+ layout card(padding: lg, gap: md, radius: md, border: true) {
86
+ component StatCard title: "Active Users" value: "1.2K"
87
+ }
88
+ }
77
89
  }
78
90
  }
79
91
  }
@@ -82,7 +94,7 @@ screen "Dashboard" {
82
94
  ## Features
83
95
 
84
96
  - 🎯 **Block-declarative syntax** - Intuitive, structured definitions
85
- - 📱 **23 UI components** - Buttons, forms, cards, modals, and more
97
+ - 📱 **30+ UI components** - Buttons, forms, cards, modals, and more
86
98
  - 🎨 **Theming support** - Customize colors, typography, spacing
87
99
  - 🔄 **Responsive layouts** - Grid, Stack, Split containers
88
100
  - ⚡ **Fast compilation** - Powered by Chevrotain parser
@@ -5,7 +5,8 @@ import { program } from "commander";
5
5
  import { readFile, mkdir, stat } from "fs/promises";
6
6
  import path from "path";
7
7
  import chokidar from "chokidar";
8
- import { LayoutEngine, SVGRenderer, generateIR, parseWireDSL, exportSVG, exportPNG, exportMultipagePDF } from "@wire-dsl/core";
8
+ import { LayoutEngine, SVGRenderer, generateIR, parseWireDSL } from "@wire-dsl/engine";
9
+ import { exportSVG, exportPNG, exportMultipagePDF } from "@wire-dsl/exporters";
9
10
  var modules = {};
10
11
  async function loadDependencies() {
11
12
  if (!modules.chalk) {
package/dist/cli.cjs CHANGED
@@ -30,7 +30,8 @@ var import_commander = require("commander");
30
30
  var import_promises = require("fs/promises");
31
31
  var import_path = __toESM(require("path"), 1);
32
32
  var import_chokidar = __toESM(require("chokidar"), 1);
33
- var import_core = require("@wire-dsl/core");
33
+ var import_engine = require("@wire-dsl/engine");
34
+ var import_exporters = require("@wire-dsl/exporters");
34
35
  var modules = {};
35
36
  async function loadDependencies() {
36
37
  if (!modules.chalk) {
@@ -91,9 +92,9 @@ var renderCommand = async (input, options = {}) => {
91
92
  const spinner = ora(`Rendering ${input}`).start();
92
93
  try {
93
94
  const source = await (0, import_promises.readFile)(resolvedInputPath, "utf8");
94
- const ast = (0, import_core.parseWireDSL)(source);
95
- const ir = (0, import_core.generateIR)(ast);
96
- const layout = new import_core.LayoutEngine(ir).calculate();
95
+ const ast = (0, import_engine.parseWireDSL)(source);
96
+ const ir = (0, import_engine.generateIR)(ast);
97
+ const layout = new import_engine.LayoutEngine(ir).calculate();
97
98
  const baseViewport = ir.project.screens[0]?.viewport ?? { width: 1280, height: 720 };
98
99
  let screensToRender = ir.project.screens;
99
100
  if (options.screen) {
@@ -116,7 +117,7 @@ var renderCommand = async (input, options = {}) => {
116
117
  const viewport = screen.viewport ?? baseViewport;
117
118
  const width = options.width ?? viewport.width;
118
119
  const height = options.height ?? viewport.height;
119
- const renderer = new import_core.SVGRenderer(ir, layout, {
120
+ const renderer = new import_engine.SVGRenderer(ir, layout, {
120
121
  width,
121
122
  height,
122
123
  theme: options.theme ?? "light",
@@ -144,7 +145,7 @@ var renderCommand = async (input, options = {}) => {
144
145
  } else if (!pdfPath.endsWith(".pdf")) {
145
146
  pdfPath += ".pdf";
146
147
  }
147
- await (0, import_core.exportMultipagePDF)(renderedScreens, pdfPath);
148
+ await (0, import_exporters.exportMultipagePDF)(renderedScreens, pdfPath);
148
149
  renderedFiles.push(pdfPath);
149
150
  spinner.succeed(
150
151
  `PDF written to ${chalk3.cyan(pdfPath)} (${renderedScreens.length} page${renderedScreens.length > 1 ? "s" : ""})`
@@ -161,7 +162,7 @@ var renderCommand = async (input, options = {}) => {
161
162
  const sanitizedName = sanitizeScreenName(screen.name);
162
163
  const fileName = `${basename}-${sanitizedName}.png`;
163
164
  const filePath = import_path.default.join(outputDir, fileName);
164
- await (0, import_core.exportPNG)(screen.svg, filePath, screen.width, screen.height);
165
+ await (0, import_exporters.exportPNG)(screen.svg, filePath, screen.width, screen.height);
165
166
  filePaths.push(filePath);
166
167
  }
167
168
  } else if (multiScreen || isDir) {
@@ -172,7 +173,7 @@ var renderCommand = async (input, options = {}) => {
172
173
  const sanitizedName = sanitizeScreenName(screen.name);
173
174
  const fileName = multiScreen ? `${basename}-${sanitizedName}.png` : import_path.default.basename(outputPath).endsWith(".png") ? import_path.default.basename(outputPath) : `${basename}.png`;
174
175
  const filePath = import_path.default.join(outputDir, fileName);
175
- await (0, import_core.exportPNG)(screen.svg, filePath, screen.width, screen.height);
176
+ await (0, import_exporters.exportPNG)(screen.svg, filePath, screen.width, screen.height);
176
177
  filePaths.push(filePath);
177
178
  }
178
179
  } else {
@@ -180,7 +181,7 @@ var renderCommand = async (input, options = {}) => {
180
181
  await (0, import_promises.mkdir)(outputDir, { recursive: true }).catch(() => {
181
182
  });
182
183
  const screen = renderedScreens[0];
183
- await (0, import_core.exportPNG)(screen.svg, outputPath, screen.width, screen.height);
184
+ await (0, import_exporters.exportPNG)(screen.svg, outputPath, screen.width, screen.height);
184
185
  filePaths.push(outputPath);
185
186
  }
186
187
  const renderedFiles2 = filePaths;
@@ -203,13 +204,13 @@ var renderCommand = async (input, options = {}) => {
203
204
  const sanitizedName = sanitizeScreenName(screen.name);
204
205
  const fileName = `${basename}-${sanitizedName}.svg`;
205
206
  const filePath = import_path.default.join(outputDir, fileName);
206
- await (0, import_core.exportSVG)(screen.svg, filePath);
207
+ await (0, import_exporters.exportSVG)(screen.svg, filePath);
207
208
  renderedFiles.push(filePath);
208
209
  }
209
210
  spinner.succeed(`${renderedFiles.length} SVG files written:`);
210
211
  renderedFiles.forEach((file) => console.log(` ${chalk3.cyan(file)}`));
211
212
  } else {
212
- await (0, import_core.exportSVG)(renderedScreens[0].svg, outputPath);
213
+ await (0, import_exporters.exportSVG)(renderedScreens[0].svg, outputPath);
213
214
  spinner.succeed(`SVG written to ${chalk3.cyan(outputPath)}`);
214
215
  }
215
216
  }
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-MVVC2C2L.js";
2
+ import "./chunk-LCHD2B6S.js";
package/dist/index.cjs CHANGED
@@ -43,7 +43,8 @@ var import_commander = require("commander");
43
43
  var import_promises = require("fs/promises");
44
44
  var import_path = __toESM(require("path"), 1);
45
45
  var import_chokidar = __toESM(require("chokidar"), 1);
46
- var import_core = require("@wire-dsl/core");
46
+ var import_engine = require("@wire-dsl/engine");
47
+ var import_exporters = require("@wire-dsl/exporters");
47
48
  var modules = {};
48
49
  async function loadDependencies() {
49
50
  if (!modules.chalk) {
@@ -104,9 +105,9 @@ var renderCommand = async (input, options = {}) => {
104
105
  const spinner = ora(`Rendering ${input}`).start();
105
106
  try {
106
107
  const source = await (0, import_promises.readFile)(resolvedInputPath, "utf8");
107
- const ast = (0, import_core.parseWireDSL)(source);
108
- const ir = (0, import_core.generateIR)(ast);
109
- const layout = new import_core.LayoutEngine(ir).calculate();
108
+ const ast = (0, import_engine.parseWireDSL)(source);
109
+ const ir = (0, import_engine.generateIR)(ast);
110
+ const layout = new import_engine.LayoutEngine(ir).calculate();
110
111
  const baseViewport = ir.project.screens[0]?.viewport ?? { width: 1280, height: 720 };
111
112
  let screensToRender = ir.project.screens;
112
113
  if (options.screen) {
@@ -129,7 +130,7 @@ var renderCommand = async (input, options = {}) => {
129
130
  const viewport = screen.viewport ?? baseViewport;
130
131
  const width = options.width ?? viewport.width;
131
132
  const height = options.height ?? viewport.height;
132
- const renderer = new import_core.SVGRenderer(ir, layout, {
133
+ const renderer = new import_engine.SVGRenderer(ir, layout, {
133
134
  width,
134
135
  height,
135
136
  theme: options.theme ?? "light",
@@ -157,7 +158,7 @@ var renderCommand = async (input, options = {}) => {
157
158
  } else if (!pdfPath.endsWith(".pdf")) {
158
159
  pdfPath += ".pdf";
159
160
  }
160
- await (0, import_core.exportMultipagePDF)(renderedScreens, pdfPath);
161
+ await (0, import_exporters.exportMultipagePDF)(renderedScreens, pdfPath);
161
162
  renderedFiles.push(pdfPath);
162
163
  spinner.succeed(
163
164
  `PDF written to ${chalk3.cyan(pdfPath)} (${renderedScreens.length} page${renderedScreens.length > 1 ? "s" : ""})`
@@ -174,7 +175,7 @@ var renderCommand = async (input, options = {}) => {
174
175
  const sanitizedName = sanitizeScreenName(screen.name);
175
176
  const fileName = `${basename}-${sanitizedName}.png`;
176
177
  const filePath = import_path.default.join(outputDir, fileName);
177
- await (0, import_core.exportPNG)(screen.svg, filePath, screen.width, screen.height);
178
+ await (0, import_exporters.exportPNG)(screen.svg, filePath, screen.width, screen.height);
178
179
  filePaths.push(filePath);
179
180
  }
180
181
  } else if (multiScreen || isDir) {
@@ -185,7 +186,7 @@ var renderCommand = async (input, options = {}) => {
185
186
  const sanitizedName = sanitizeScreenName(screen.name);
186
187
  const fileName = multiScreen ? `${basename}-${sanitizedName}.png` : import_path.default.basename(outputPath).endsWith(".png") ? import_path.default.basename(outputPath) : `${basename}.png`;
187
188
  const filePath = import_path.default.join(outputDir, fileName);
188
- await (0, import_core.exportPNG)(screen.svg, filePath, screen.width, screen.height);
189
+ await (0, import_exporters.exportPNG)(screen.svg, filePath, screen.width, screen.height);
189
190
  filePaths.push(filePath);
190
191
  }
191
192
  } else {
@@ -193,7 +194,7 @@ var renderCommand = async (input, options = {}) => {
193
194
  await (0, import_promises.mkdir)(outputDir, { recursive: true }).catch(() => {
194
195
  });
195
196
  const screen = renderedScreens[0];
196
- await (0, import_core.exportPNG)(screen.svg, outputPath, screen.width, screen.height);
197
+ await (0, import_exporters.exportPNG)(screen.svg, outputPath, screen.width, screen.height);
197
198
  filePaths.push(outputPath);
198
199
  }
199
200
  const renderedFiles2 = filePaths;
@@ -216,13 +217,13 @@ var renderCommand = async (input, options = {}) => {
216
217
  const sanitizedName = sanitizeScreenName(screen.name);
217
218
  const fileName = `${basename}-${sanitizedName}.svg`;
218
219
  const filePath = import_path.default.join(outputDir, fileName);
219
- await (0, import_core.exportSVG)(screen.svg, filePath);
220
+ await (0, import_exporters.exportSVG)(screen.svg, filePath);
220
221
  renderedFiles.push(filePath);
221
222
  }
222
223
  spinner.succeed(`${renderedFiles.length} SVG files written:`);
223
224
  renderedFiles.forEach((file) => console.log(` ${chalk3.cyan(file)}`));
224
225
  } else {
225
- await (0, import_core.exportSVG)(renderedScreens[0].svg, outputPath);
226
+ await (0, import_exporters.exportSVG)(renderedScreens[0].svg, outputPath);
226
227
  spinner.succeed(`SVG written to ${chalk3.cyan(outputPath)}`);
227
228
  }
228
229
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  initCommand,
3
3
  renderCommand,
4
4
  validateCommand
5
- } from "./chunk-MVVC2C2L.js";
5
+ } from "./chunk-LCHD2B6S.js";
6
6
  export {
7
7
  initCommand,
8
8
  renderCommand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wire-dsl/cli",
3
- "version": "0.1.6",
3
+ "version": "0.2.1",
4
4
  "description": "WireDSL CLI - Command-line tool for wireframe generation and validation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,18 +33,19 @@
33
33
  "dependencies": {
34
34
  "chokidar": "5.0.0",
35
35
  "chalk": "5.6.2",
36
- "commander": "14.0.2",
36
+ "commander": "14.0.3",
37
37
  "ora": "9.1.0",
38
- "@wire-dsl/core": "0.1.6"
38
+ "@wire-dsl/engine": "0.0.3",
39
+ "@wire-dsl/exporters": "0.0.3"
39
40
  },
40
41
  "devDependencies": {
41
- "@types/node": "25.0.9",
42
- "@typescript-eslint/eslint-plugin": "8.53.1",
43
- "@typescript-eslint/parser": "8.53.1",
42
+ "@types/node": "25.2.0",
43
+ "@typescript-eslint/eslint-plugin": "8.54.0",
44
+ "@typescript-eslint/parser": "8.54.0",
44
45
  "eslint": "9.39.2",
45
46
  "tsup": "8.5.1",
46
47
  "typescript": "5.9.3",
47
- "vitest": "4.0.17"
48
+ "vitest": "4.0.18"
48
49
  },
49
50
  "engines": {
50
51
  "node": ">=20.0.0"