vovk-rust 0.0.1-draft.49 → 0.0.1-draft.51
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.
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<%- t.getFirstLineBanner('html') %>
|
|
2
2
|
# <%= t.package.name.replace(/-/g, '_') %> v<%= t.package.version %> [](https://www.rust-lang.org) [](https://vovk.dev)
|
|
3
3
|
|
|
4
|
-
<%- t.package.description ? `> ${t.package.description}` : '' %>
|
|
4
|
+
<%- t.readme.description ?? (`${t.package.description ? `> ${t.package.description}` : ''}`) %>
|
|
5
5
|
|
|
6
6
|
<%- t.package.license ? `License: **${t.package.license}**` : '' %>
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
```bash
|
|
10
9
|
# Install the package
|
|
11
|
-
cargo install
|
|
10
|
+
<%= t.readme.installCommand ?? `cargo install ${t.package.name.replace(/-/g, '_')}` %>
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
<% Object.entries(t.schema.segments).forEach(([segmentName, segment]) => {
|
|
@@ -30,6 +29,7 @@ cargo install <%= t.package.name.replace(/-/g, '_') %>
|
|
|
30
29
|
handlerName,
|
|
31
30
|
controllerSchema,
|
|
32
31
|
package: t.package,
|
|
32
|
+
config: t.snippets,
|
|
33
33
|
}).rs %>
|
|
34
34
|
```
|
|
35
35
|
<% }) %>
|
package/index.js
CHANGED
|
@@ -189,7 +189,7 @@ export function generateEnum(schema, name, level, pad = 0) {
|
|
|
189
189
|
code += `${indentFn(level)}pub enum ${name} {\n`;
|
|
190
190
|
schema.enum.forEach((value, index) => {
|
|
191
191
|
// Create valid Rust enum variant
|
|
192
|
-
const variant = value
|
|
192
|
+
const variant = value?.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
193
193
|
// Add documentation if available in enumDescriptions
|
|
194
194
|
if (schema.enumDescriptions && schema.enumDescriptions[index]) {
|
|
195
195
|
const description = schema.enumDescriptions[index];
|