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

[feat] Allow $schema field in tauri.conf.json #3464

Closed
kt215 opened this issue Feb 15, 2022 · 7 comments
Closed

[feat] Allow $schema field in tauri.conf.json #3464

kt215 opened this issue Feb 15, 2022 · 7 comments

Comments

@kt215
Copy link

kt215 commented Feb 15, 2022

Having a schema for tauri.conf.json would be very helpful.

I made my own schema file based on your documentation and I reference that schema using the $schema field. But your parser doesn't accept the field. As a workaround, I customized the CLI in config.rs and removed deny_unknown_fields to make it work.

I later found out that you do generate a schema.json file from config.rs code automatically. It doesn't have very good enum support right now IMO, but I recommend you make that schema file available and use it in the code examples.

@lucasfernog
Copy link
Member

We validate the schema on our CLI. Why do you need the $schema field? Are you performing the validation on your end?

@kt215
Copy link
Author

kt215 commented Feb 15, 2022

My IDE (Webstorm) uses it, so I get intellisense/code-completion. I'm also used to these features when editing angular.json which is the main configuration file in Angular. At the top of the angular.json file we have this:

"$schema": "./node_modules/@angular/cli/lib/config/schema.json",

@lucasfernog
Copy link
Member

Ahh makes sense, we'll implement this :)

@JonasKruckenberg
Copy link
Contributor

I think pointing to an URL would work too 🤔 having the schema locally would be nicer, but only helps people who use the cli from npm

@angelxmoreno
Copy link

so like, where is the url? lol

@amrbashir
Copy link
Member

amrbashir commented Apr 28, 2024

schema is released to GitHub releases on each release of tauri-build crate, here is one of them https://github.com/tauri-apps/tauri/releases/download/tauri-build-v2.0.0-beta.13/schema.json

schema is also distributed with the NPM cli package so you can use a local path to it.

@angelxmoreno
Copy link

Nice. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants