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

Generate unique bundle identifier #2431

Open
kornelski opened this issue Aug 14, 2021 · 3 comments
Open

Generate unique bundle identifier #2431

kornelski opened this issue Aug 14, 2021 · 3 comments
Labels
cli.rs good first issue priority: low type: enhancement

Comments

@kornelski
Copy link

@kornelski kornelski commented Aug 14, 2021

Is your feature request related to a problem? Please describe.
I've set up a new tauri project following docs on tauri.studio, and my newly-generated app had bundle.identifier set to com.tauri.dev.

For macOS apps (and probably other OSes) this identifier has to be globally unique for every app. It can be problematic when developers forget to customize it. An existing example tauri app I've found had forgotten to change it.

Describe the solution you'd like
It would be nice if you could customize the default identifier, so that even if developer forgets to change it, it won't be clashing with other apps. For example, append application name to your domain prefix. If productName is foo app, generate studio.tauri.dev.foo-app. Or generate random string: studio.tauri.dev.rqudxcdvmdomlfbrhjt.

Describe alternatives you've considered
You could ask users to provide their proper domain name, but I suspect you'd prefer not to bother users with too many setup questions.

@vsnthdev
Copy link

@vsnthdev vsnthdev commented Aug 15, 2021

I believe create-tauri-app should be developed in the following way:

  1. All configuration should be done using CLI options with something like (commander or command-line-args)
  2. A CLI option that has a default value, should never create an interactive question prompt. If the CLI option was provided, the value would be altered, otherwise assuming the default.
  3. Certain core CLI options will have no default value. In which case the user can either pass the CLI option to suppress the interactive question prompt or answer the interactive prompt.
  4. When create-tauri-app is executed in a non-interactive environment such as CI/CD pipeline or an automated script file, we simply error out if any CLI options don't have a value after parsed.

Benefits of this approach:

  1. The CLI will be super customizable, for people who really need it.
  2. We can limit the number of questions by not having a default value, but still provide customizability.
  3. Tutorials/articles referring to create-tauri-app will be able to create commands to bootstrap tauri projects with specific settings.
  4. CI/CD pipelines and automated scripts can bootstrap tauri projects with specific settings.

I would love to have @lucasfernog thoughts on this 😀

@lucasfernog
Copy link

@lucasfernog lucasfernog commented Aug 15, 2021

@jbolda and @amrbashir are the designers and maintainers of create-tauri-app.

@amrbashir
Copy link

@amrbashir amrbashir commented Aug 15, 2021

@vsnthdev This seems unrelated to the issue itself but I will answer anyway:

  1. we use minimst which is similar tool but we could swap it for commander in the future. I don't see this as an issue.
    • Having a default value is mainly to provide hints to user as what might the answer be and to be used as fallback if their corresponding cli argument is not used or when --ci is usd.
    • All prompts can be suppressed by either passing their cli argument or just using --ci but it is not perfect unfortunately because some recipes might need additional prompts and these prompts doesn't have a corresponding cli argument so when --ci is passed we use the default for these additional prompts.
  2. Same as above, all interactive prompts have defaults to give hints to users and to be used as fallback when if their corresponding cli argument is not used or --ci is used.
    • I don't think this is true, we always have defaults to fallback to if cli argument isn't passed. if an error happened then you should file an issue with the error.
    • The only thing I can think of is that we use npx and yarn to bootstrap the recipe front-end and that might prompt you to install a package and would fail your CI. I think they can be suppressed and we definitely need to suppress them for CI.

create-tauri-app is still a young project and there is a lot to improve and we would appreciate PRs to help it improve.

@tauri-apps tauri-apps deleted a comment from Ganzonias777 Aug 15, 2021
@amrbashir amrbashir added cli.rs good first issue priority: low type: enhancement labels Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli.rs good first issue priority: low type: enhancement
Projects
None yet
Development

No branches or pull requests

5 participants
@kornelski @lucasfernog @vsnthdev @amrbashir and others