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

chore: move "defaults.." jsdoc value to use @default #9316

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 26 additions & 19 deletions packages/remix-dev/config.ts
Expand Up @@ -50,14 +50,15 @@ type NodeBuiltinsPolyfillOptions = Pick<
*/
export interface AppConfig {
/**
* The path to the `app` directory, relative to `remix.config.js`. Defaults
* to `"app"`.
* The path to the `app` directory, relative to `remix.config.js`.
* @default "app"
*/
appDirectory?: string;

/**
* The path to a directory Remix can use for caching things in development,
* relative to `remix.config.js`. Defaults to `".cache"`.
* relative to `remix.config.js`.
* @default ".cache"
*/
cacheDirectory?: string;

Expand All @@ -73,14 +74,15 @@ export interface AppConfig {
| Promise<ReturnType<DefineRoutesFunction>>;

/**
* The path to the browser build, relative to `remix.config.js`. Defaults to
* "public/build".
* The path to the browser build, relative to `remix.config.js`.
* @default "public/build"
*/
assetsBuildDirectory?: string;

/**
* The URL prefix of the browser build with a trailing slash. Defaults to
* `"/build/"`. This is the path the browser will use to find assets.
* The URL prefix of the browser build with a trailing slash.
* This is the path the browser will use to find assets.
* @default "/build/"
*/
publicPath?: string;

Expand All @@ -96,7 +98,7 @@ export interface AppConfig {

/**
* Whether to process CSS using PostCSS if a PostCSS config file is present.
* Defaults to `true`.
* @default true
*/
postcss?: boolean;

Expand Down Expand Up @@ -131,20 +133,21 @@ export interface AppConfig {

/**
* The order of main fields to use when resolving server dependencies.
* Defaults to `["main", "module"]`.
* @default ["main", "module"]
*
* For more information, see: https://esbuild.github.io/api/#main-fields
*/
serverMainFields?: string[];

/**
* Whether to minify the server build in production or not.
* Defaults to `false`.
* @default false
*/
serverMinify?: boolean;

/**
* The output format of the server build. Defaults to "esm".
* The output format of the server build.
* @default "esm"
*/
serverModuleFormat?: ServerModuleFormat;

Expand All @@ -160,13 +163,15 @@ export interface AppConfig {
browserNodeBuiltinsPolyfill?: NodeBuiltinsPolyfillOptions;

/**
* The platform the server build is targeting. Defaults to "node".
* The platform the server build is targeting.
* @default "node"
*/
serverPlatform?: ServerPlatform;

/**
* Whether to support Tailwind functions and directives in CSS files if
* `tailwindcss` is installed. Defaults to `true`.
* `tailwindcss` is installed.
* @default true
*/
tailwind?: boolean;

Expand Down Expand Up @@ -266,7 +271,7 @@ export interface RemixConfig {

/**
* Whether to process CSS using PostCSS if a PostCSS config file is present.
* Defaults to `true`.
* @default true
*/
postcss: boolean;

Expand Down Expand Up @@ -304,15 +309,15 @@ export interface RemixConfig {

/**
* The order of main fields to use when resolving server dependencies.
* Defaults to `["main", "module"]`.
* @default ["main", "module"]
*
* For more information, see: https://esbuild.github.io/api/#main-fields
*/
serverMainFields: string[];

/**
* Whether to minify the server build in production or not.
* Defaults to `false`.
* @default false
*/
serverMinify: boolean;

Expand All @@ -322,7 +327,8 @@ export interface RemixConfig {
serverMode: ServerMode;

/**
* The output format of the server build. Defaults to "esm".
* The output format of the server build.
* @default "esm"
*/
serverModuleFormat: ServerModuleFormat;

Expand All @@ -338,13 +344,14 @@ export interface RemixConfig {
browserNodeBuiltinsPolyfill?: NodeBuiltinsPolyfillOptions;

/**
* The platform the server build is targeting. Defaults to "node".
* The platform the server build is targeting.
* @default "node"
*/
serverPlatform: ServerPlatform;

/**
* Whether to support Tailwind functions and directives in CSS files if `tailwindcss` is installed.
* Defaults to `true`.
* @default true
*/
tailwind: boolean;

Expand Down
7 changes: 4 additions & 3 deletions packages/remix-dev/config/routes.ts
Expand Up @@ -16,7 +16,8 @@ export interface ConfigRoute {
index?: boolean;

/**
* Should be `true` if the `path` is case-sensitive. Defaults to `false`.
* Should be `true` if the `path` is case-sensitive.
* @default false
*/
caseSensitive?: boolean;

Expand Down Expand Up @@ -45,8 +46,8 @@ export interface RouteManifest {

export interface DefineRouteOptions {
/**
* Should be `true` if the route `path` is case-sensitive. Defaults to
* `false`.
* Should be `true` if the route `path` is case-sensitive.
* @default false
*/
caseSensitive?: boolean;

Expand Down
14 changes: 8 additions & 6 deletions packages/remix-dev/vite/plugin.ts
Expand Up @@ -193,12 +193,13 @@ export type Preset = {

export type VitePluginConfig = SupportedRemixEsbuildUserConfig & {
/**
* The react router app basename. Defaults to `"/"`.
* The react router app basename.
* @default "/"
*/
basename?: string;
/**
* The path to the build directory, relative to the project. Defaults to
* `"build"`.
* The path to the build directory, relative to the project.
* @default "build"
*/
buildDirectory?: string;
/**
Expand All @@ -207,7 +208,7 @@ export type VitePluginConfig = SupportedRemixEsbuildUserConfig & {
buildEnd?: BuildEndHook;
/**
* Whether to write a `"manifest.json"` file to the build directory.`
* Defaults to `false`.
* @default false
*/
manifest?: boolean;
/**
Expand All @@ -218,7 +219,7 @@ export type VitePluginConfig = SupportedRemixEsbuildUserConfig & {
/**
* The file name of the server build output. This file
* should end in a `.js` extension and should be deployed to your server.
* Defaults to `"index.js"`.
* @default "index.js"
*/
serverBuildFile?: string;
/**
Expand All @@ -231,7 +232,8 @@ export type VitePluginConfig = SupportedRemixEsbuildUserConfig & {
* Enable server-side rendering for your application. Disable to use Remix in
* "SPA Mode", which will request the `/` path at build-time and save it as
* an `index.html` file with your assets so your application can be deployed
* as a SPA without server-rendering. Default's to `true`.
* as a SPA without server-rendering.
* @default true
*/
ssr?: boolean;
};
Expand Down
5 changes: 3 additions & 2 deletions packages/remix-node/upload/fileUploadHandler.ts
Expand Up @@ -39,7 +39,8 @@ export type FileUploadHandlerPathResolver = (
export type FileUploadHandlerOptions = {
/**
* Avoid file conflicts by appending a count on the end of the filename
* if it already exists on disk. Defaults to `true`.
* if it already exists on disk.
* @default true
*/
avoidFileConflicts?: boolean;
/**
Expand All @@ -53,7 +54,7 @@ export type FileUploadHandlerOptions = {
file?: FileUploadHandlerPathResolver;
/**
* The maximum upload size allowed. If the size is exceeded an error will be thrown.
* Defaults to 3000000B (3MB).
* @default 3000000 (3MB)
*/
maxPartSize?: number;
/**
Expand Down
5 changes: 2 additions & 3 deletions packages/remix-server-runtime/responses.ts
Expand Up @@ -62,8 +62,7 @@ export type RedirectFunction = (

/**
* A redirect response. Sets the status code and the `Location` header.
* Defaults to "302 Found".
*
* @default 302 Found
* @see https://remix.run/utils/redirect
*/
export const redirect: RedirectFunction = (url, init = 302) => {
Expand All @@ -73,7 +72,7 @@ export const redirect: RedirectFunction = (url, init = 302) => {
/**
* A redirect response that will force a document reload to the new location.
* Sets the status code and the `Location` header.
* Defaults to "302 Found".
* @default 302 Found
*
* @see https://remix.run/utils/redirect
*/
Expand Down
Expand Up @@ -10,7 +10,7 @@ export type MemoryUploadHandlerFilterArgs = {
export type MemoryUploadHandlerOptions = {
/**
* The maximum upload size allowed. If the size is exceeded an error will be thrown.
* Defaults to 3000000B (3MB).
* @default 3000000 (3MB)
*/
maxPartSize?: number;
/**
Expand Down