diff --git a/src/node/utils/util.ts b/src/node/utils/util.ts index 3b70299bb8..b30f60c287 100644 --- a/src/node/utils/util.ts +++ b/src/node/utils/util.ts @@ -5,6 +5,7 @@ import os from 'os'; import { Uri } from '@shared/data/file-system.model'; import memoizeOne from 'memoize-one'; +// FOR SCHEME DOCUMENTATION, SEE Uri JSDOC const APP_SCHEME = 'app'; const CACHE_SCHEME = 'cache'; const CACHE_DIR_NAME = CACHE_SCHEME; @@ -40,6 +41,7 @@ export const getAppDir = memoizeOne((): string => { : path.join(__dirname, '../../../dev-appdata'); }); +// FOR SCHEME DOCUMENTATION, SEE Uri JSDOC /** Get a mapping from scheme to the absolute path to that scheme. */ // TODO: this is currently lazy-loaded because globalThis doesn't get populated until after this // file is imported. Fix this to be a normal object after fixing globalThis import dependencies. diff --git a/src/shared/data/file-system.model.ts b/src/shared/data/file-system.model.ts index a352e1b908..8a38babac0 100644 --- a/src/shared/data/file-system.model.ts +++ b/src/shared/data/file-system.model.ts @@ -4,10 +4,21 @@ * Represents a path in file system or other. Has a scheme followed by :// followed by a relative * path. If no scheme is provided, the app scheme is used. Available schemes are as follows: * - * - `app://` - goes to the app's home directory and into `.platform.bible` (platform-dependent) + * - `app://` - goes to the `.platform.bible` directory inside the user's home directory. + * + * - On Linux and Mac, this is `$HOME/.platform.bible` + * - On Windows, this is `%USERPROFILE%/.platform.bible` + * - Note: In development, `app://` always goes to `paranext-core/dev-appdata` * - `cache://` - goes to the app's temporary file cache at `app://cache` * - `data://` - goes to the app's data storage location at `app://data` - * - `resources://` - goes to the resources directory installed in the app - * - `file://` - an absolute file path from root + * - `resources://` - goes to the `resources` directory inside the install directory + * + * - Note: In development, `resources://` always goes to the repo root, `paranext-core`. Not all files + * are copied into the production `resources` folder, though. See `electron-builder.json5`'s + * `extraResources` for some that are copied. + * - `file://` - an absolute file path from drive root + * + * Note: projects are stored in the production version of `app://projects` regardless of whether you + * are in production or development */ export type Uri = string;