rtgl 0.0.10 → 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 +50 -6
- 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";
|
|
@@ -153,9 +154,15 @@ Examples:
|
|
|
153
154
|
throw new Error(`Directories do not exist: ${missingDirs.join(", ")}`);
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
// Pass dirs and
|
|
157
|
+
// Pass dirs, setup, and outfile from config
|
|
157
158
|
options.dirs = config.fe.dirs;
|
|
158
159
|
options.setup = config.fe.setup || "setup.js";
|
|
160
|
+
|
|
161
|
+
// Use config outfile if not specified via CLI option
|
|
162
|
+
if (!options.outfile && config.fe.outfile) {
|
|
163
|
+
options.outfile = config.fe.outfile;
|
|
164
|
+
}
|
|
165
|
+
|
|
159
166
|
watch(options);
|
|
160
167
|
});
|
|
161
168
|
|
|
@@ -186,7 +193,7 @@ vtCommand
|
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
// Use vt.path from config, default to 'vt'
|
|
189
|
-
options.
|
|
196
|
+
options.vtPath = config.vt?.path || "vt";
|
|
190
197
|
|
|
191
198
|
generate(options);
|
|
192
199
|
});
|
|
@@ -201,8 +208,8 @@ vtCommand
|
|
|
201
208
|
throw new Error("rettangoli.config.yaml not found");
|
|
202
209
|
}
|
|
203
210
|
|
|
204
|
-
const
|
|
205
|
-
report({
|
|
211
|
+
const vtPath = config.vt?.path || "vt";
|
|
212
|
+
report({ vtPath });
|
|
206
213
|
});
|
|
207
214
|
|
|
208
215
|
vtCommand
|
|
@@ -215,8 +222,8 @@ vtCommand
|
|
|
215
222
|
throw new Error("rettangoli.config.yaml not found");
|
|
216
223
|
}
|
|
217
224
|
|
|
218
|
-
const
|
|
219
|
-
accept({
|
|
225
|
+
const vtPath = config.vt?.path || "vt";
|
|
226
|
+
accept({ vtPath });
|
|
220
227
|
});
|
|
221
228
|
|
|
222
229
|
const sitesCommand = program.command("sites").description("Rettangoli Sites");
|
|
@@ -237,4 +244,41 @@ sitesCommand
|
|
|
237
244
|
console.log("Build completed successfully!");
|
|
238
245
|
});
|
|
239
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
|
+
|
|
240
284
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtgl",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
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
|
}
|