rtgl 0.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/cli.js +139 -0
  4. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yuusoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included
13
+ in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
+ IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # rtgl - Rettangoli CLI
2
+
3
+ The official command-line interface for the Rettangoli framework - a modern UI toolkit for building web applications with custom HTML elements, visual testing, and static site generation.
4
+
5
+ ## Installation
6
+
7
+ Use with `bunx` or `npx`:
8
+
9
+ ```bash
10
+ bunx rtgl --help
11
+ ```
12
+
13
+ ## Features
14
+
15
+ - **Frontend Framework (`fe`)** - Build web components with YAML views, state management, and event handlers
16
+ - **Visual Testing (`vt`)** - Generate, compare, and manage UI component screenshots
17
+ - **Static Sites (`sites`)** - Build documentation, blogs, and landing pages with Markdown and YAML
package/cli.js ADDED
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { build, scaffold, watch } from "rettangoli-fe/cli";
4
+ import { generate, report, accept } from "rettangoli-vt/cli";
5
+ import { copyPagesToSite } from "rettangoli-sites/cli";
6
+ import { Command } from "commander";
7
+
8
+ const program = new Command();
9
+
10
+ program
11
+ .name("rtgl")
12
+ .description("CLI tool for Rettangoli development")
13
+ .version("0.0.1");
14
+
15
+ // Add examples to main program
16
+ program.addHelpText(
17
+ "after",
18
+ `
19
+
20
+ Examples:
21
+ $ rettangoli fe build
22
+ $ rettangoli fe scaffold -c components -n Button
23
+ $ rettangoli fe watch -d ./src -d ./components -p 3001
24
+ `,
25
+ );
26
+
27
+ const feCommand = program.command("fe").description("Frontend framework");
28
+
29
+ feCommand
30
+ .command("build")
31
+ .description("Build UI components")
32
+ .option("-d, --dirs <dirs...>", "The directories to build", ["./example"])
33
+ .option("-o, --outfile <path>", "The output file", "./viz/static/main.js")
34
+ .addHelpText(
35
+ "after",
36
+ `
37
+
38
+ Examples:
39
+ $ rettangoli fe build
40
+ $ rettangoli fe build --base ./my-project --outfile ./dist/bundle.js
41
+ $ rettangoli fe build -b ./src -o ./public/js/main.js
42
+ `,
43
+ )
44
+ .action((options) => {
45
+ build(options);
46
+ });
47
+
48
+ feCommand
49
+ .command("scaffold")
50
+ .description("Scaffold UI components")
51
+ .option("-d, --dir <dir>", "The directory to scaffold", "./example")
52
+ .option("-c, --category <category>", "The category of the component", "pages")
53
+ .option(
54
+ "-n, --component-name <component-name>",
55
+ "The name of the component",
56
+ "component-name",
57
+ )
58
+ .addHelpText(
59
+ "after",
60
+ `
61
+
62
+ Examples:
63
+ $ rettangoli fe scaffold
64
+ $ rettangoli fe scaffold --category components --name MyButton
65
+ $ rettangoli fe scaffold -c layouts -n HeaderLayout
66
+ $ rettangoli fe scaffold -c pages -n HomePage
67
+ `,
68
+ )
69
+ .action((options) => {
70
+ scaffold(options);
71
+ });
72
+
73
+ feCommand
74
+ .command("watch")
75
+ .description("Watch for changes")
76
+ .option("-d, --dirs <dirs...>", "The directories to watch", ["./example"])
77
+ .option("-p, --port <port>", "The port to use", parseInt, 3001)
78
+ .addHelpText(
79
+ "after",
80
+ `
81
+
82
+ Examples:
83
+ $ rettangoli fe watch
84
+ $ rettangoli fe watch --port 8080
85
+ $ rettangoli fe watch --dirs ./src ./components ./pages
86
+ $ rettangoli fe watch -d ./src -d ./lib -p 4000
87
+ `,
88
+ )
89
+ .action((options) => {
90
+ watch(options);
91
+ });
92
+
93
+ const vtCommand = program
94
+ .command("vt")
95
+ .description("Rettangoli Visual Testing");
96
+
97
+ vtCommand
98
+ .command("generate")
99
+ .description("Generate visualizations")
100
+ .option("--skip-screenshots", "Skip screenshot generation")
101
+ .option("--screenshot-wait-time <time>", "Wait time between screenshots", "0")
102
+ .option("--viz-path <path>", "Path to the viz directory", "./viz")
103
+ .action((options) => {
104
+ generate(options);
105
+ });
106
+
107
+ vtCommand
108
+ .command("report")
109
+ .description("Create reports")
110
+ .action(() => {
111
+ report();
112
+ });
113
+
114
+ vtCommand
115
+ .command("accept")
116
+ .description("Accept changes")
117
+ .action(() => {
118
+ accept();
119
+ });
120
+
121
+ const sitesCommand = program.command("sites").description("Rettangoli Sites");
122
+
123
+ sitesCommand
124
+ .command("build")
125
+ .description("Build the site")
126
+ .option("-r, --resources <path>", "Path to resources directory", "./sitic")
127
+ .option("-p, --pages <path>", "Path to pages directory", "./pages")
128
+ .option("-o, --output <path>", "Path to destination directory", "./_site")
129
+ .action(async (options) => {
130
+ console.log("Building site with options:", options);
131
+ await copyPagesToSite({
132
+ resourcesPath: options.resources,
133
+ pagesPath: options.pages,
134
+ outputPath: options.output,
135
+ });
136
+ console.log("Build completed successfully!");
137
+ });
138
+
139
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "rtgl",
3
+ "version": "0.0.1",
4
+ "description": "CLI tool for Rettangoli - A frontend framework and development toolkit",
5
+ "type": "module",
6
+ "bin": {
7
+ "rtgl": "./cli.js"
8
+ },
9
+ "files": [
10
+ "cli.js",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "test": "echo \"No test specified\""
16
+ },
17
+ "keywords": [
18
+ "rettangoli",
19
+ "cli",
20
+ "ui",
21
+ "framework",
22
+ "web-components",
23
+ "frontend",
24
+ "development",
25
+ "build-tool",
26
+ "scaffold",
27
+ "visual-testing",
28
+ "static-site-generator"
29
+ ],
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/yuusoft-org/rettangoli.git",
34
+ "directory": "packages/rettangoli-cli"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/yuusoft-org/rettangoli/issues"
38
+ },
39
+ "homepage": "https://rettangoli.dev/",
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
+ },
47
+ "dependencies": {
48
+ "commander": "^14.0.0",
49
+ "rettangoli-fe": "workspace:*",
50
+ "rettangoli-sites": "workspace:*",
51
+ "rettangoli-vt": "workspace:*"
52
+ }
53
+ }