rtgl 0.0.11-rc16 → 0.0.11-rc18
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/cli.js +39 -3
- package/package.json +3 -3
package/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { build, scaffold, watch, examples } from "@rettangoli/fe/cli";
|
|
4
4
|
import { generate, report, accept } from "@rettangoli/vt/cli";
|
|
5
|
-
import { buildSite } from "@rettangoli/sites/cli";
|
|
5
|
+
import { buildSite, watchSite, screenshotCommand } from "@rettangoli/sites/cli";
|
|
6
6
|
import { buildSvg } from "@rettangoli/ui/cli";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { readFileSync, existsSync } from "fs";
|
|
@@ -55,6 +55,7 @@ feCommand
|
|
|
55
55
|
.command("build")
|
|
56
56
|
.description("Build UI components")
|
|
57
57
|
.option("-o, --outfile <path>", "The output file")
|
|
58
|
+
.option("-s, --setup-path <path>", "Custom setup file path")
|
|
58
59
|
.option("-d, --development", "Development mode (no minification, no source maps)")
|
|
59
60
|
.addHelpText(
|
|
60
61
|
"after",
|
|
@@ -66,6 +67,8 @@ Examples:
|
|
|
66
67
|
$ rettangoli fe build -o ./public/js/main.js
|
|
67
68
|
$ rettangoli fe build --development
|
|
68
69
|
$ rettangoli fe build -d -o ./dist/dev.js
|
|
70
|
+
$ rettangoli fe build -s src/setup.tauri.js
|
|
71
|
+
$ rettangoli fe build --setup-path src/setup.web.js
|
|
69
72
|
`,
|
|
70
73
|
)
|
|
71
74
|
.action((options) => {
|
|
@@ -89,7 +92,8 @@ Examples:
|
|
|
89
92
|
|
|
90
93
|
// Pass dirs, setup, and outfile from config
|
|
91
94
|
options.dirs = config.fe.dirs;
|
|
92
|
-
|
|
95
|
+
// Use setup-path if provided, otherwise use config setup
|
|
96
|
+
options.setup = options.setupPath || config.fe.setup || "setup.js";
|
|
93
97
|
|
|
94
98
|
// Use config outfile if not specified via CLI option
|
|
95
99
|
if (!options.outfile && config.fe.outfile) {
|
|
@@ -128,6 +132,7 @@ feCommand
|
|
|
128
132
|
.command("watch")
|
|
129
133
|
.description("Watch for changes")
|
|
130
134
|
.option("-p, --port <port>", "The port to use", parseInt, 3001)
|
|
135
|
+
.option("-s, --setup-path <path>", "Custom setup file path")
|
|
131
136
|
.addHelpText(
|
|
132
137
|
"after",
|
|
133
138
|
`
|
|
@@ -136,6 +141,8 @@ Examples:
|
|
|
136
141
|
$ rettangoli fe watch
|
|
137
142
|
$ rettangoli fe watch --port 8080
|
|
138
143
|
$ rettangoli fe watch -p 4000
|
|
144
|
+
$ rettangoli fe watch -s src/setup.tauri.js
|
|
145
|
+
$ rettangoli fe watch --setup-path src/setup.web.js
|
|
139
146
|
`,
|
|
140
147
|
)
|
|
141
148
|
.action((options) => {
|
|
@@ -159,7 +166,8 @@ Examples:
|
|
|
159
166
|
|
|
160
167
|
// Pass dirs, setup, and outfile from config
|
|
161
168
|
options.dirs = config.fe.dirs;
|
|
162
|
-
|
|
169
|
+
// Use setup-path if provided, otherwise use config setup
|
|
170
|
+
options.setup = options.setupPath || config.fe.setup || "setup.js";
|
|
163
171
|
|
|
164
172
|
// Use config outfile if not specified via CLI option
|
|
165
173
|
if (!options.outfile && config.fe.outfile) {
|
|
@@ -245,6 +253,34 @@ sitesCommand
|
|
|
245
253
|
console.log("Build completed successfully!");
|
|
246
254
|
});
|
|
247
255
|
|
|
256
|
+
sitesCommand
|
|
257
|
+
.command("watch")
|
|
258
|
+
.description("Watch and rebuild site on changes")
|
|
259
|
+
.option("-p, --port <port>", "The port to use", parseInt, 3001)
|
|
260
|
+
.option("-r, --rootDir <path>", "Path to root directory", ".")
|
|
261
|
+
.option("-s, --screenshots", "Enable automatic screenshot capture on page changes", false)
|
|
262
|
+
.action(async (options) => {
|
|
263
|
+
console.log("Starting watch mode with options:", options);
|
|
264
|
+
watchSite({
|
|
265
|
+
port: options.port,
|
|
266
|
+
rootDir: options.rootDir,
|
|
267
|
+
screenshots: options.screenshots,
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
sitesCommand
|
|
272
|
+
.command("screenshot")
|
|
273
|
+
.description("Capture screenshots of all pages")
|
|
274
|
+
.option("-p, --port <port>", "The port to use for temp server", parseInt, 3001)
|
|
275
|
+
.option("-r, --rootDir <path>", "Path to root directory", ".")
|
|
276
|
+
.action(async (options) => {
|
|
277
|
+
console.log("Capturing screenshots with options:", options);
|
|
278
|
+
await screenshotCommand({
|
|
279
|
+
port: options.port,
|
|
280
|
+
rootDir: options.rootDir,
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
|
|
248
284
|
const uiCommand = program.command("ui").description("UI component tools");
|
|
249
285
|
|
|
250
286
|
uiCommand
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtgl",
|
|
3
|
-
"version": "0.0.11-
|
|
3
|
+
"version": "0.0.11-rc18",
|
|
4
4
|
"description": "CLI tool for Rettangoli - A frontend framework and development toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"commander": "^14.0.0",
|
|
49
49
|
"js-yaml": "^4.1.0",
|
|
50
50
|
"@rettangoli/fe": "0.0.7-rc14",
|
|
51
|
-
"@rettangoli/sites": "0.2.0-
|
|
51
|
+
"@rettangoli/sites": "0.2.0-rc3",
|
|
52
52
|
"@rettangoli/vt": "0.0.2-rc3",
|
|
53
|
-
"@rettangoli/ui": "0.1.2-
|
|
53
|
+
"@rettangoli/ui": "0.1.2-rc30"
|
|
54
54
|
}
|
|
55
55
|
}
|