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

Custom folder for Rust source code #2752

Closed
crapStone opened this issue Oct 15, 2021 · 4 comments
Closed

Custom folder for Rust source code #2752

crapStone opened this issue Oct 15, 2021 · 4 comments

Comments

@crapStone
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I want to split my codebase into two separate folders: the ui/app and a rust workspace where one of the crates is the tauri app and the rest are libraries that are used by the app.

Describe the solution you'd like
My idea was to add options to the package.json and tauri.conf.json to specify the relative path to the respectively other config.

folder structure:

.
├── crates
│   ├── lib1
│   │   ├── Cargo.toml
│   │   └── src
│   ├── lib2
│   │   ├── Cargo.toml
│   │   └── src
│   └── tauri_app
│       ├── Cargo.toml
│       ├── src
│       └── tauri.conf.json
├── LICENSE
├── README.md
└── ui
    ├── package.json
    └── src

package.json:

{
  "tauri": {
    "rustConfigPath": "../crates/tauri_app/"
  }
}

tari.conf.json

{
  "build": {
    "appPath": "../../ui/",
  }
}

Describe alternatives you've considered
I found this commit but it requires the app and tauri app to be just one folder level apart.

@dannymcgee
Copy link

I would also really appreciate this feature. I use Nx to manage my TypeScript workspaces, and without this, it doesn't look like there's a clean way to integrate a Tauri app into my existing projects. I haven't really started investigating workarounds though — I'll comment with a follow-up if I come up with something.

@dannymcgee
Copy link

I haven't really started investigating workarounds though — I'll comment with a follow-up if I come up with something.

I came up with an okay workaround for Nx by using a global install of @tauri-apps/cli and executing the command with an explicit working directory. Trying to use npm run tauri dev instead of tauri dev always fails, regardless of the cwd setting — I'm assuming that's because my node_modules directory is in an unexpected location (two folders up from where it would be normally).

lucasfernog added a commit that referenced this issue Dec 6, 2021
`package.json > tauri > appPath` defines the path to the tauri crate and cli.js sets the proper CWD when running cli.rs
lucasfernog added a commit that referenced this issue Dec 9, 2021
…3035)

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
@lodmfjord
Copy link

I really want this feature too. Any reason why you closed this?

@amrbashir
Copy link
Member

you can now rename it and have it nested too up to three levels. Just rename and move, if the cli doesn't pick it up let us know.

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

Successfully merging a pull request may close this issue.

4 participants