Răsfoiți Sursa

chore(docs): `devPath` & `distDir` are relative to `tauri.conf.json`, closes #2236 (#2259)

* chore(docs): `devPath` & `distDir` are relative to tauri.conf.json

* change cli.rs message
Amr Bashir 4 ani în urmă
părinte
comite
74a278fcfc
2 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 6 6
      docs/api/config.md
  2. 1 1
      tooling/cli.rs/src/main.rs

+ 6 - 6
docs/api/config.md

@@ -15,12 +15,12 @@ It's composed of the following properties:
 ## `build`
 
 <Properties anchorRoot="build" rows={[
-{property: "distDir", type: "string", description: `The path—either absolute or relative—to the production-ready webpage/webapp directory that will be bundled by Tauri.
+{property: "distDir", type: "string", description: `The path to the production-ready webpage/webapp directory (either absolute or relative to tauri.conf.json) that will be bundled by Tauri.
 
 <div class="alert alert--info" role="alert" style="margin-top: 10px;">
   The target directory <em>must</em> contain an index.html file.
 </div>`},
-{property: "devPath", type: "string", description: `Can be a path—either absolute or relative—to a folder or a URL (like a live reload server).`},
+{property: "devPath", type: "string", description: `Can be a path to a folder (either absolute or relative to tauri.conf.json) or a URL (like a live reload server).`},
 {property: "beforeDevCommand", optional: true, type: "string", description: `A command to run before starting Tauri in dev mode.`},
 {property: "beforeBuildCommand", optional: true, type: "string", description: `A command to run before starting Tauri in build mode.`},
 {property: "withGlobalTauri", optional: true, type: "boolean", description: "Enables the API injection to the window.__TAURI__ object. Useful if you're using Vanilla JS instead of importing the API using Rollup or Webpack. Reduces the command security since any external code can access it, so be careful with XSS attacks."}
@@ -66,7 +66,7 @@ It's composed of the following properties:
             <li>Using an equals and no space such as <code>-o=value</code> or <code>--option=value</code></li>
             <li>Use a short and no space such as <code>-ovalue</code></li>
           </ul>
-        </div>` 
+        </div>`
         },
         { property: "index", type: "number", optional: true, description: `The positional argument index, starting at 1.
         <div class="alert alert--info" role="alert" style="margin-top: 10px;">
@@ -135,7 +135,7 @@ It's composed of the following properties:
       { property: "externalBin", optional: true, type: "string[]", description: `A list of—either absolute or relative—paths to binaries to embed with your application.
       <div class="alert alert--info" role="alert" style="margin-top: 10px;">
         Note that Tauri will look for system-specific binaries following the pattern "binary-name{-target-triple}{.system-extension}". <br/>
-        E.g. you typed "my-binary": 
+        E.g. you typed "my-binary":
         <ul>
           <li>"my-binary-x86_64-pc-windows-msvc.exe" for Windows</li>
           <li>"my-binary-x86_64-apple-darwin" for macOS</li>
@@ -144,7 +144,7 @@ It's composed of the following properties:
         so don't forget to provide binaries for <strong>all targeted platforms</strong>.
       </div>` },
       { property: "copyright", optional: true, type: "string", description: `A copyright string associated with your application.` },
-      { property: "category", optional: true, type: "string", description: `What kind of application this is. 
+      { property: "category", optional: true, type: "string", description: `What kind of application this is.
         Should be one among the following list: <br/>
         Business, DeveloperTool, Education, Entertainment, Finance, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, CardGame, CasinoGame, DiceGame, EducationalGame, FamilyGame, KidsGame, MusicGame, PuzzleGame, RacingGame, RolePlayingGame, SimulationGame, SportsGame, StrategyGame, TriviaGame, WordGame, GraphicsAndDesign, HealthcareAndFitness, Lifestyle, Medical, Music, News, Photography, Productivity, Reference, SocialNetworking, Sports, Travel, Utility, Video, Weather.
       ` },
@@ -278,7 +278,7 @@ It's composed of the following properties:
   {
     property: "security", type: "object",
     child: <Properties anchorRoot="tauri.security" rows={[
-      { property: "csp", optional: true, type: "string", description: `The Content Security Policy. 
+      { property: "csp", optional: true, type: "string", description: `The Content Security Policy.
       <div class="alert alert--warning" role="alert" style="margin-top: 10px;">
   This is a really important part of the configuration since it helps you ensure your WebView is secured. See more <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP" target="_blank">on Mozilla</a>.
 </div>` },

+ 1 - 1
tooling/cli.rs/src/main.rs

@@ -119,7 +119,7 @@ fn init_command(matches: &ArgMatches) -> Result<()> {
     dist_dir,
     dist_dir,
     ci,
-    r#"Where are your web assets (HTML/CSS/JS) located, relative to the "<current dir>/src-tauri" folder that will be created?"#,
+    r#"Where are your web assets (HTML/CSS/JS) located, relative to the "<current dir>/src-tauri/tauri.conf.json" file that will be created?"#,
     init_defaults.framework.as_ref().map(|f| f.dist_dir())
   );
   init_runner = value_or_prompt!(