rtgl 0.0.11-rc2 → 0.0.11-rc21
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 +85 -10
- package/package.json +5 -4
package/cli.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
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 {
|
|
5
|
+
import { buildSite, watchSite, screenshotCommand } from "@rettangoli/sites/cli";
|
|
6
|
+
import { buildSvg } from "@rettangoli/ui/cli";
|
|
6
7
|
import { Command } from "commander";
|
|
7
8
|
import { readFileSync, existsSync } from "fs";
|
|
8
9
|
import { resolve } from "path";
|
|
@@ -54,6 +55,8 @@ feCommand
|
|
|
54
55
|
.command("build")
|
|
55
56
|
.description("Build UI components")
|
|
56
57
|
.option("-o, --outfile <path>", "The output file")
|
|
58
|
+
.option("-s, --setup-path <path>", "Custom setup file path")
|
|
59
|
+
.option("-d, --development", "Development mode (no minification, no source maps)")
|
|
57
60
|
.addHelpText(
|
|
58
61
|
"after",
|
|
59
62
|
`
|
|
@@ -62,6 +65,10 @@ Examples:
|
|
|
62
65
|
$ rettangoli fe build
|
|
63
66
|
$ rettangoli fe build --outfile ./dist/bundle.js
|
|
64
67
|
$ rettangoli fe build -o ./public/js/main.js
|
|
68
|
+
$ rettangoli fe build --development
|
|
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
|
|
65
72
|
`,
|
|
66
73
|
)
|
|
67
74
|
.action((options) => {
|
|
@@ -85,7 +92,8 @@ Examples:
|
|
|
85
92
|
|
|
86
93
|
// Pass dirs, setup, and outfile from config
|
|
87
94
|
options.dirs = config.fe.dirs;
|
|
88
|
-
|
|
95
|
+
// Use setup-path if provided, otherwise use config setup
|
|
96
|
+
options.setup = options.setupPath || config.fe.setup || "setup.js";
|
|
89
97
|
|
|
90
98
|
// Use config outfile if not specified via CLI option
|
|
91
99
|
if (!options.outfile && config.fe.outfile) {
|
|
@@ -124,6 +132,7 @@ feCommand
|
|
|
124
132
|
.command("watch")
|
|
125
133
|
.description("Watch for changes")
|
|
126
134
|
.option("-p, --port <port>", "The port to use", parseInt, 3001)
|
|
135
|
+
.option("-s, --setup-path <path>", "Custom setup file path")
|
|
127
136
|
.addHelpText(
|
|
128
137
|
"after",
|
|
129
138
|
`
|
|
@@ -132,6 +141,8 @@ Examples:
|
|
|
132
141
|
$ rettangoli fe watch
|
|
133
142
|
$ rettangoli fe watch --port 8080
|
|
134
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
|
|
135
146
|
`,
|
|
136
147
|
)
|
|
137
148
|
.action((options) => {
|
|
@@ -155,7 +166,8 @@ Examples:
|
|
|
155
166
|
|
|
156
167
|
// Pass dirs, setup, and outfile from config
|
|
157
168
|
options.dirs = config.fe.dirs;
|
|
158
|
-
|
|
169
|
+
// Use setup-path if provided, otherwise use config setup
|
|
170
|
+
options.setup = options.setupPath || config.fe.setup || "setup.js";
|
|
159
171
|
|
|
160
172
|
// Use config outfile if not specified via CLI option
|
|
161
173
|
if (!options.outfile && config.fe.outfile) {
|
|
@@ -230,17 +242,80 @@ const sitesCommand = program.command("sites").description("Rettangoli Sites");
|
|
|
230
242
|
sitesCommand
|
|
231
243
|
.command("build")
|
|
232
244
|
.description("Build the site")
|
|
233
|
-
.option("-r, --
|
|
234
|
-
.option("-
|
|
235
|
-
.option("-o, --output <path>", "Path to destination directory", "./_site")
|
|
245
|
+
.option("-r, --rootDir <path>", "Path to root directory", "./")
|
|
246
|
+
.option("-o, --outputPath <path>", "Path to destination directory", "./_site")
|
|
236
247
|
.action(async (options) => {
|
|
237
248
|
console.log("Building site with options:", options);
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
outputPath: options.output,
|
|
249
|
+
buildSite({
|
|
250
|
+
rootDir: options.rootDir,
|
|
251
|
+
outputPath: options.outputPath,
|
|
242
252
|
});
|
|
243
253
|
console.log("Build completed successfully!");
|
|
244
254
|
});
|
|
245
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
|
+
|
|
284
|
+
const uiCommand = program.command("ui").description("UI component tools");
|
|
285
|
+
|
|
286
|
+
uiCommand
|
|
287
|
+
.command("build-svg")
|
|
288
|
+
.description("Build SVG icons from directory")
|
|
289
|
+
.option("-d, --dir <dir>", "Directory containing SVG files")
|
|
290
|
+
.option("-o, --outfile <path>", "Output file path")
|
|
291
|
+
.addHelpText(
|
|
292
|
+
"after",
|
|
293
|
+
`
|
|
294
|
+
|
|
295
|
+
Examples:
|
|
296
|
+
$ rettangoli ui build-svg
|
|
297
|
+
$ rettangoli ui build-svg --dir ./icons --outfile ./dist/icons.js
|
|
298
|
+
$ rettangoli ui build-svg -d ./assets/svg -o ./public/js/icons.js
|
|
299
|
+
`,
|
|
300
|
+
)
|
|
301
|
+
.action((options) => {
|
|
302
|
+
const config = readConfig();
|
|
303
|
+
|
|
304
|
+
// Use config values if options not provided
|
|
305
|
+
if (!options.dir && config?.ui?.svg?.dir) {
|
|
306
|
+
options.dir = config.ui.svg.dir;
|
|
307
|
+
}
|
|
308
|
+
if (!options.outfile && config?.ui?.svg?.outfile) {
|
|
309
|
+
options.outfile = config.ui.svg.outfile;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Check if required options are available (either from CLI or config)
|
|
313
|
+
if (!options.dir || !options.outfile) {
|
|
314
|
+
console.error("Error: Both dir and outfile are required. Provide them via CLI options or in rettangoli.config.yaml under ui.svg");
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
buildSvg(options);
|
|
319
|
+
});
|
|
320
|
+
|
|
246
321
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtgl",
|
|
3
|
-
"version": "0.0.11-
|
|
3
|
+
"version": "0.0.11-rc21",
|
|
4
4
|
"description": "CLI tool for Rettangoli - A frontend framework and development toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"commander": "^14.0.0",
|
|
49
49
|
"js-yaml": "^4.1.0",
|
|
50
|
-
"@rettangoli/fe": "0.0.7-
|
|
51
|
-
"@rettangoli/sites": "0.
|
|
52
|
-
"@rettangoli/vt": "0.0.2-
|
|
50
|
+
"@rettangoli/fe": "0.0.7-rc14",
|
|
51
|
+
"@rettangoli/sites": "0.2.0-rc6",
|
|
52
|
+
"@rettangoli/vt": "0.0.2-rc3",
|
|
53
|
+
"@rettangoli/ui": "0.1.2-rc32"
|
|
53
54
|
}
|
|
54
55
|
}
|