rtgl 0.0.11-rc1 → 0.0.11-rc10
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 +38 -0
- package/package.json +5 -4
package/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { build, scaffold, watch, examples } from "@rettangoli/fe/cli";
|
|
4
4
|
import { generate, report, accept } from "@rettangoli/vt/cli";
|
|
5
5
|
import { copyPagesToSite } 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";
|
|
@@ -243,4 +244,41 @@ sitesCommand
|
|
|
243
244
|
console.log("Build completed successfully!");
|
|
244
245
|
});
|
|
245
246
|
|
|
247
|
+
const uiCommand = program.command("ui").description("UI component tools");
|
|
248
|
+
|
|
249
|
+
uiCommand
|
|
250
|
+
.command("build-svg")
|
|
251
|
+
.description("Build SVG icons from directory")
|
|
252
|
+
.option("-d, --dir <dir>", "Directory containing SVG files")
|
|
253
|
+
.option("-o, --outfile <path>", "Output file path")
|
|
254
|
+
.addHelpText(
|
|
255
|
+
"after",
|
|
256
|
+
`
|
|
257
|
+
|
|
258
|
+
Examples:
|
|
259
|
+
$ rettangoli ui build-svg
|
|
260
|
+
$ rettangoli ui build-svg --dir ./icons --outfile ./dist/icons.js
|
|
261
|
+
$ rettangoli ui build-svg -d ./assets/svg -o ./public/js/icons.js
|
|
262
|
+
`,
|
|
263
|
+
)
|
|
264
|
+
.action((options) => {
|
|
265
|
+
const config = readConfig();
|
|
266
|
+
|
|
267
|
+
// Use config values if options not provided
|
|
268
|
+
if (!options.dir && config?.ui?.svg?.dir) {
|
|
269
|
+
options.dir = config.ui.svg.dir;
|
|
270
|
+
}
|
|
271
|
+
if (!options.outfile && config?.ui?.svg?.outfile) {
|
|
272
|
+
options.outfile = config.ui.svg.outfile;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Check if required options are available (either from CLI or config)
|
|
276
|
+
if (!options.dir || !options.outfile) {
|
|
277
|
+
console.error("Error: Both dir and outfile are required. Provide them via CLI options or in rettangoli.config.yaml under ui.svg");
|
|
278
|
+
process.exit(1);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
buildSvg(options);
|
|
282
|
+
});
|
|
283
|
+
|
|
246
284
|
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-rc10",
|
|
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.1.
|
|
52
|
-
"@rettangoli/vt": "0.0.2-
|
|
50
|
+
"@rettangoli/fe": "0.0.7-rc10",
|
|
51
|
+
"@rettangoli/sites": "0.1.1",
|
|
52
|
+
"@rettangoli/vt": "0.0.2-rc3",
|
|
53
|
+
"@rettangoli/ui": "0.1.2-rc14"
|
|
53
54
|
}
|
|
54
55
|
}
|