Skip to content

Commit

Permalink
fixes, dosc update, new deps
Browse files Browse the repository at this point in the history
  • Loading branch information
gtamas committed Mar 3, 2024
1 parent 7ba94a1 commit 7e9fd28
Show file tree
Hide file tree
Showing 18 changed files with 548 additions and 90 deletions.
39 changes: 39 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ sourceview5 = "0.6.1"
convert_case = "0.6.0"
is_executable = "1.0.1"
mockall = "0.12.1"
regex = "1.10.3"

12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@
## 1. <a name='Whatisthisprojectabout'></a>What is this project about?

This app aims to be a GUI generator for any software based on Google's [Schematics](https://angular.io/guide/schematics) library.
Schematics provides only CLI support by default. SchematicsUI, however, can automatically generate a fully native and easy to use [GKT4](https://www.gtk.org/) GUI for any schematic. This GUI is entirely based on the JSON schema of the schematic, so it should work with any package out there.
The generated GUI is highly customizable and this requires only a schema extension, so the CLI shouldn't be affected.
Furthermore, ahe app also provides all the tools you need to browse schematics packages as well as manage their settings and execute any schematic right from GUI.
Schematics provides only CLI support by default. Schematics UI can automatically generate a fully native and easy to use [GKT4](https://www.gtk.org/) GUI for any schematic. This GUI is entirely based on the JSON schema of the schematic, so it should work with any package out there.
The generated GUI is highly customizable and this requires only some JSON schema extension, so the CLI shouldn't be affected.
Furthermore, the app also provides all the tools you need to work with schematics. You may browse contents of any schematics package, sync frequently used settings to disk creating different profiles for each schematic, reload, update or clone these profiles and of course you may also execute any schematic right from GUI.

It's a native app, written in Rust, uses [Relm4](https://relm4.org/) and [GTK-rs](https://gtk-rs.org/) rust bindings and it's gonna be available for OSX, Windows and Linux.

Currently it's not fully production-ready, but RC1 is available for OSX. See the releases page for download link.

## 2. <a name='Awordofwarning'></a>A word of warning

This is still a work in progress. Although it should work fine, the app is not released yet so it's **NOT** production-ready. Currently, an alpha version is available. Use it at your own risk.
This is still a work in progress. Although it should work fine with any schematics package, it was only tested with FND and NestJS so far. The app is not released yet and it's **NOT** production-ready. Currently, an alpha version is available. Use it at your own risk.

## 3. <a name='Whatdoyouneedtousethis'></a>What do you need to use this?

This is app NOT a Schematics engine. It's just a GUI which can execute schematics via CLI. So in order to use this, you need something like Google's [Schematics CLI](https://www.npmjs.com/package/@angular-devkit/schematics-cli) or another schematics runner.
This is NOT a Schematics engine! It's just a GUI generator which can build UI for any schematic and execute that schematic using CLI. In order to use this, you need something like Google's [Schematics CLI](https://www.npmjs.com/package/@angular-devkit/schematics-cli) or another schematics implementation.

Once you've installed that, you are good to go.

Expand Down
49 changes: 44 additions & 5 deletions UI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# About the UI

<!-- vscode-markdown-toc -->
* 1. [Default UI](#DefaultUI)
* 2. [The x-widget property](#Thex-widgetproperty)
Expand All @@ -13,13 +11,15 @@
* 2.5. [dir and file](#dirandfile)
* 2.6. [choice](#choice)
* 2.7. [menu](#menu)
* 2.7.1. [About items](#Aboutitems)
* 2.8. [About items](#Aboutitems)
* 2.8.1. [Items special syntax](#Itemsspecialsyntax)

<!-- vscode-markdown-toc-config
numbering=true
autoSave=true
/vscode-markdown-toc-config -->
<!-- /vscode-markdown-toc -->
<!-- /vscode-markdown-toc --># About the UI



## 1. <a name='DefaultUI'></a>Default UI
Expand Down Expand Up @@ -258,7 +258,7 @@ multiselect | ListView

All these are single selection widgets, except for `multiselect`, obviously. In case of `radio` and `toggle` you get a group with a button for each selectable option.

#### 2.7.1. <a name='Aboutitems'></a>About items
### 2.8. <a name='Aboutitems'></a>About items

The selectable items must be pre-defined in your schema. All syntaxes supported by Schematics should work.

Expand Down Expand Up @@ -319,3 +319,42 @@ As list, using an array of objects:
},
```

#### 2.8.1. <a name='Itemsspecialsyntax'></a>Items special syntax

Besides the syntax supported by schematics engines, some special directives regarding items are also supported.
The value of the `x-prompt.items` property can be one of the following:

| Directive | Description |
| ---- | ------ |
| $modules | Items will be populated using the names of all subdirectories in current working directory.
| $models | Items will be populated using the absolute path of all files matching the following pattern `src/**/models/*.model.ts`.
| $dir:/some/path | Items will be populated using the names of all subdirectories under `/some/path`.
| $files:/some/path | Items will be populated using the absolute path of all files under `/some/path`.

Let's see some examples:


```json
"env": {
"type": "string",
"description": "The env name",
"x-prompt": {
"message": "What is the name of the env?",
"type": "list",
"items": "$modules"
}
},
```


```json
"env": {
"type": "string",
"description": "The env name",
"x-prompt": {
"message": "What is the name of the env?",
"type": "list",
"items": "$dir:/foobar"
}
},
```
Loading

0 comments on commit 7e9fd28

Please sign in to comment.