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] Support for custom recipes #3

Open
gurupras opened this issue Jan 14, 2022 · 8 comments
Open

[feat] Support for custom recipes #3

gurupras opened this issue Jan 14, 2022 · 8 comments

Comments

@gurupras
Copy link

Describe the problem

I love how tauri supports so many recipes out-of-the-box. However, over time, I've built up a bunch of my own create-* packages that I would love to initialize my Tauri app with. Most of these extend existing templates (e.g. packages and configs on top of create-vite).

Describe the solution you'd like

Looking at the svelte merge, it looks like there's some custom, tauri-specific config that's required on top of the create-* package. Is it possible to extend existing recipes in some way?

Alternatives considered

Currently, I initialize a new tauri app and then go about installing packages and configs from my custom templates.

Additional context

No response

@nothingismagick
Copy link
Sponsor Member

That's a great idea. Maybe @jbolda would like to respond.

@amrbashir
Copy link
Member

Honestly at first, I was opposed to the idea, because different front-end setups requires different integration with Tauri but the idea has grown on me and I think it can help reduce the amount of recipes we need to maintain at the core package.

I still don't know what is the optimal way to do this but I think it should be like this:

  1. the custom template is hosted on github
    • it has a cta-manifest.json that contains some metadata, like beforeBuildCommand, devPath...etc.
    • OR The github repo simply has a js file that exports a default object that follows the recipe interface. This approach will make the custom template have a finer control over how to bootstrap the template and if different package managers need different steps. I am skeptic about the security implications of this but it might be the best way imo because of the fore mentioned advantages and it would require less work on our end.

@gurupras
Copy link
Author

I know you're trying to target a much broader audience and use-case, but for my uses, I don't even change Vite's ports or configs that much. I add some Vite plugins that I've come to love which can maybe be merged with Tauri's default config? It gets difficult because these are arrays rather than objects 😕

Beyond that, I'm just installing my own set of packages, setting up stylesheets, having my own eslint rules, etc.

@amrbashir
Copy link
Member

I know you're trying to target a much broader audience and use-case, but for my uses, I don't even change Vite's ports or configs that much. I add some Vite plugins that I've come to love which can maybe be merged with Tauri's default config?

Not likely. We only bootstrap base projects. Plugins should be added by the user afterwards. Opinionated/Custom recipes shouldn't be baked in create-tauri-app. That's what you are asking for and I think the above proposal is the solution.

It gets difficult because these are arrays rather than objects 😕

Not sure what you mean by that.

Beyond that, I'm just installing my own set of packages, setting up stylesheets, having my own eslint rules, etc.

All should be done by you afterwards or a custom recipe using the above proposal.

@lucasfernog lucasfernog transferred this issue from tauri-apps/tauri Feb 19, 2022
@jbolda
Copy link
Member

jbolda commented Mar 4, 2022

@gurupras do your custom templates have any Tauri "elements" in them? It sounds like you are looking to layer on the Tauri part of it atop your existing template. Is that correct?

@nothingismagick
Copy link
Sponsor Member

In light of the feedback from the 3.0 release's approach of removing several popular projects, we should address this now and find a way to tackle this from several approaches:

  1. A public "community-owned" repo of recipes
  2. A personal recipe (either local or remote)

@amrbashir
Copy link
Member

So far, every discussion of this ended up at the same conclusion, what would create-tauri-app do different than just git clone <template-repo>? and the answer was nothing, it can't do anything more than just git clone which begs the question, is it worth it to implement?

Other direction was to curate the list of templates in awesome-tauri and provide them as a list in create-tauri-app but that was reject because of security concerns.

@escwxyz
Copy link
Contributor

escwxyz commented Apr 6, 2023

I am not sure if it's related but maybe it's worthy to check out how Astro handles integrations.

@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
@tauri-apps tauri-apps deleted a comment from jose8109 Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants