Skip to content

Commit a7c76bf

Browse files
committed
Sync comments
1 parent e03874a commit a7c76bf

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

crates/napi/src/next_api/project.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,18 @@ pub struct NapiWatchOptions {
122122

123123
#[napi(object)]
124124
pub struct NapiProjectOptions {
125-
/// A root path from which all files must be nested under. Trying to access
126-
/// a file outside this root will fail. Think of this as a chroot.
125+
/// An absolute root path from which all files must be nested under. Trying to access
126+
/// a file outside this root will fail, so think of this as a chroot.
127+
/// E.g. `/home/user/projects/my-repo`.
127128
pub root_path: RcStr,
128129

129-
/// A path inside the root_path which contains the app/pages directories.
130+
/// A path which contains the app/pages directories, relative to [`Project::root_path`].
131+
/// E.g. `apps/my-app`
130132
pub project_path: RcStr,
131133

132-
/// next.config's distDir. Project initialization occurs earlier than
133-
/// deserializing next.config, so passing it as separate option.
134+
/// A path where to emit the build outputs, relative to [`Project::project_path`].
135+
/// Corresponds to next.config.js's `distDir`.
136+
/// E.g. `.next`
134137
pub dist_dir: RcStr,
135138

136139
/// Filesystem watcher options.
@@ -176,15 +179,18 @@ pub struct NapiProjectOptions {
176179
/// [NapiProjectOptions] with all fields optional.
177180
#[napi(object)]
178181
pub struct NapiPartialProjectOptions {
179-
/// A root path from which all files must be nested under. Trying to access
180-
/// a file outside this root will fail. Think of this as a chroot.
182+
/// An absolute root path from which all files must be nested under. Trying to access
183+
/// a file outside this root will fail, so think of this as a chroot.
184+
/// E.g. `/home/user/projects/my-repo`.
181185
pub root_path: Option<RcStr>,
182186

183-
/// A path inside the root_path which contains the app/pages directories.
187+
/// A path which contains the app/pages directories, relative to [`Project::root_path`].
188+
/// E.g. `apps/my-app`
184189
pub project_path: Option<RcStr>,
185190

186-
/// next.config's distDir. Project initialization occurs earlier than
187-
/// deserializing next.config, so passing it as separate option.
191+
/// A path where to emit the build outputs, relative to [`Project::project_path`].
192+
/// Corresponds to next.config.js's `distDir`.
193+
/// E.g. `.next`
188194
pub dist_dir: Option<Option<RcStr>>,
189195

190196
/// Filesystem watcher options.

packages/next/src/build/swc/types.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,20 @@ export interface ProjectOptions {
348348
/**
349349
* An absolute root path from which all files must be nested under. Trying to access
350350
* a file outside this root will fail, so think of this as a chroot.
351-
* E.g. `/home/user/projects/my-repo`. */
351+
* E.g. `/home/user/projects/my-repo`.
352+
*/
352353
rootPath: string
353354

354355
/**
355-
* A path which contains the app/pages directories, relative to [`Project::root_path`].
356+
* A path which contains the app/pages directories, relative to `root_path`.
356357
* E.g. `apps/my-app`
357358
*/
358359
projectPath: string
359360

360361
/**
361-
* The path to the .next directory.
362+
* A path where to emit the build outputs, relative to [`Project::project_path`].
363+
* Corresponds to next.config.js's `distDir`.
364+
* E.g. `.next`
362365
*/
363366
distDir: string
364367

0 commit comments

Comments
 (0)