Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Improve schema.json #4139

Closed
6 tasks done
lorenzolewis opened this issue May 16, 2022 · 4 comments
Closed
6 tasks done

[docs] Improve schema.json #4139

lorenzolewis opened this issue May 16, 2022 · 4 comments
Assignees
Labels
priority: 3 low scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate

Comments

@lorenzolewis
Copy link
Member

lorenzolewis commented May 16, 2022

There are a few things in the schema that could be updated (based on tauri-apps/tauri-docs#604). File for reference: https://github.com/tauri-apps/tauri/blob/dev/tooling/cli/schema.json

We should also be aware of any down-stream impacts and keep in mind increasing quality there (such as the VS Code extension). I'm willing to do this myself once I have some spare time

  • "HttpAllowlistScope" description
  • Fix link in ShellAllowlistConfig.sidecar description
  • This should be marked as optional, not an array of types
    "type": [
    "string",
    "null"
  • Escape brackets in description
    "description": "Specifies the maximum number of values are for this argument. For example, if you had a -f <file> argument where you wanted up to 3 'files', you would set .max_values(3), and this argument would be satisfied if the user provided, 1, 2, or 3 values.",
  • These newlines cause an issue when rendering in a table, should be a break instead
    "description": "A shell command to run before `tauri build` kicks in.\n\nThe TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.",
  • This link is broken
    "description": "The Content Security Policy that will be injected on all HTML files on the built application. If [`dev_csp`](SecurityConfig.dev_csp) is not specified, this value is also injected on dev.\n\nThis is a really important part of the configuration since it helps you ensure your WebView is secured. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>.",
@lorenzolewis lorenzolewis added scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate priority: 3 low labels May 16, 2022
@lorenzolewis lorenzolewis self-assigned this May 16, 2022
@lorenzolewis
Copy link
Member Author

If someone could give me a bit of context in the meantime it would help (pointing me in the direction of how/where this is generated and any other downstream impacts such as the VS Code extension I should test out)

@lucasfernog
Copy link
Member

The schema is generated using schemars, you can see the usage in the structs on the config source code. @lorenzolewis

@lucasfernog
Copy link
Member

You can regenerate the schema by running cargo build in the tooling/cli folder. Just make any changes you wish, and you can verify how it looks on VS Code by opening examples/api/src-tauri/tauri.conf.json and hovering any of the fields.

@lucasfernog
Copy link
Member

Since the schema is automated, we should probably do a post processing here for newlines and etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: 3 low scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate
Projects
None yet
Development

No branches or pull requests

2 participants