How can I start a tauri app on a workspace?

I'm trying to use the same folder structure as this repository.

To start in a simpler way I have made a workspace with the following structure:

.
├── Cargo.toml
├── client
│   └── tauri
│       ├── Cargo.toml
│       └── src
│           └── main.rs
├── core
│   ├── Cargo.toml
│   └── src
│       └── lib.rs
├── README.md

cargo.toml

[workspace]
members = [
  "client/tauri",
  "core"
]

I want to initialize the tauri app in the client/tauri folder. So I've changed into the client directory and done pnpm create tauri-app, but I've gotten a dependencies error:

❯ pnpm create tauri-app
.../share/pnpm/store/v3/tmp/dlx-879980   |  +96 ++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/user/.local/share/pnpm/store/v3
  Virtual store is at:             ../../../../.local/share/pnpm/store/v3/tmp/dlx-879980/node_modules/.pnpm
.../share/pnpm/store/v3/tmp/dlx-879980   | Progress: resolved 96, reused 96, downloaded 0, added 96, done

We hope to help you create something special with Tauri!
You will have a choice of one of the UI frameworks supported by the greater web tech community.
This tool should get you quickly started. See our docs at https://tauri.app/

If you haven't already, please take a moment to setup your system.
You may find the requirements here: https://tauri.app/v1/guides/getting-started/prerequisites

Press any key to continue...
? What is your app name? tauri-app
? What should the window title be? Tauri App
? What UI recipe would you like to add? create-react-app (https://create-react-app.dev/)
? Add "@tauri-apps/api" npm package? Yes
? Which create-react-app template would you like to use? create-react-app (Typescript)
>> Running initial command(s)
.../share/pnpm/store/v3/tmp/dlx-880128   |  WARN  deprecated tar@2.2.2
.../share/pnpm/store/v3/tmp/dlx-880128   |  +67 +++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/user/.local/share/pnpm/store/v3
  Virtual store is at:             ../../../../.local/share/pnpm/store/v3/tmp/dlx-880128/node_modules/.pnpm
.../share/pnpm/store/v3/tmp/dlx-880128   | Progress: resolved 67, reused 67, downloaded 0, added 67, done

Creating a new React app in /home/user/code/rust/rust-app/client/tauri-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...


added 1393 packages in 2m

193 packages are looking for funding
  run `npm fund` for details

Installing template dependencies using npm...
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated

added 52 packages in 12s

193 packages are looking for funding
  run `npm fund` for details
Removing template package using npm...


removed 1 package, and audited 1445 packages in 3s

193 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Success! Created tauri-app at /home/user/code/rust/rust-app/client/tauri-app
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd tauri-app
  npm start

Happy hacking!
 WARN  deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
 WARN  deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Packages: +1167
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/user/.local/share/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 1168, reused 1167, downloaded 0, added 1167, done

dependencies:
+ @testing-library/jest-dom 5.16.4
+ @testing-library/react 13.3.0
+ @testing-library/user-event 13.5.0 (14.2.1 is available)
+ react 18.2.0
+ react-dom 18.2.0
+ react-scripts 5.0.1
+ web-vitals 2.1.4

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
├─┬ @testing-library/user-event
│ └── ✕ missing peer @testing-library/dom@>=7.21.4
└─┬ react-scripts
  ├── ✕ missing peer typescript@"^3.2.1 || ^4"
  ├─┬ eslint-config-react-app
  │ ├── ✕ missing peer typescript@"*"
  │ ├─┬ @typescript-eslint/eslint-plugin
  │ │ ├── ✕ missing peer typescript@"*"
  │ │ └─┬ @typescript-eslint/type-utils
  │ │   ├── ✕ missing peer typescript@"*"
  │ │   └─┬ @typescript-eslint/utils
  │ │     └─┬ @typescript-eslint/typescript-estree
  │ │       ├── ✕ missing peer typescript@"*"
  │ │       └─┬ tsutils
  │ │         └── ✕ missing peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
  │ ├─┬ @typescript-eslint/parser
  │ │ └── ✕ missing peer typescript@"*"
  │ └─┬ eslint-plugin-flowtype
  │   ├── ✕ missing peer @babel/plugin-syntax-flow@^7.14.5
  │   └── ✕ missing peer @babel/plugin-transform-react-jsx@^7.14.9
  └─┬ react-dev-utils
    └─┬ fork-ts-checker-webpack-plugin
      └── ✕ missing peer typescript@">= 2.7"
Peer dependencies that should be installed:
  @babel/plugin-syntax-flow@^7.14.5              @testing-library/dom@>=7.21.4
  @babel/plugin-transform-react-jsx@^7.14.9      typescript@">=3.2.1 <4.0.0 || >=4.0.0 <5.0.0"

hint: If you want peer dependencies to be automatically installed, add "auto-install-peers=true" to an .npmrc file at the root of your project.
hint: If you don't want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.
Error with command: pnpm
Error: Error: Command failed with exit code 1: pnpm install
    at /home/user/.local/share/pnpm/store/v3/tmp/dlx-879980/node_modules/.pnpm/create-tauri-app@1.0.1/node_modules/create-tauri-app/dist/index.js:146:15
    at Generator.throw (<anonymous>)
    at rejected (/home/user/.local/share/pnpm/store/v3/tmp/dlx-879980/node_modules/.pnpm/create-tauri-app@1.0.1/node_modules/create-tauri-app/dist/index.js:38:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

How do I initialize tauri in that location and put the rust code in the core directory?

I'm on Manjaro Linux and I had done this before:

sudo pacman -Syu
sudo pacman -S --needed \
    webkit2gtk \
    base-devel \
    curl \
    wget \
    openssl \
    appmenu-gtk-module \
    gtk3 \
    libappindicator-gtk3 \
    librsvg \
    libvips

In the root folder rust-app I've done:

❯ pnpm add -D @tauri-apps/cli
Packages: +3
+++
Packages are copied from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/user/.local/share/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm

devDependencies:
+ @tauri-apps/cli 1.0.0

Progress: resolved 10, reused 3, downloaded 0, added 3, done

I didn't have much luck with create-tauri-app either. IIRC I manually installed the @tauri-apps/cli then used pnpm tauri init.

Hopefully this is all just 1.0 jitters and it gets worked out!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.