Skip to content

Commit

Permalink
docs: fix links for new site
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 22, 2024
1 parent b2acab8 commit 208ed90
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 46 deletions.
38 changes: 19 additions & 19 deletions packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export interface Builder {
generateEnvModule(): void;

/**
* Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/types#public-types-server) with.
* Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with.
* @param opts a relative path to the base directory of the app and optionally in which format (esm or cjs) the manifest should be generated
*/
generateManifest(opts: { relativePath: string; routes?: RouteDefinition[] }): string;
Expand Down Expand Up @@ -397,12 +397,12 @@ export interface KitConfig {
*/
dir?: string;
/**
* A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](https://svelte.dev/docs/kit/modules#$env-static-public) and [`$env/dynamic/public`](https://svelte.dev/docs/kit/modules#$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
* A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) and [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
* @default "PUBLIC_"
*/
publicPrefix?: string;
/**
* A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](https://svelte.dev/docs/kit/modules#$env-static-private) and [`$env/dynamic/private`](https://svelte.dev/docs/kit/modules#$env-dynamic-private).
* A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) and [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private).
* @default ""
* @since 1.21.0
*/
Expand Down Expand Up @@ -505,7 +505,7 @@ export interface KitConfig {
*/
assets?: '' | `http://${string}` | `https://${string}`;
/**
* A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/modules#$app-paths-base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
* A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/$app-paths#base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
* @default ""
*/
base?: '' | `/${string}`;
Expand Down Expand Up @@ -647,7 +647,7 @@ export interface KitConfig {
* </script>
* ```
*
* If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of the [`updated`](https://svelte.dev/docs/kit/modules#$app-stores-updated) store to `true` when it detects one.
* If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of the [`updated`](https://svelte.dev/docs/kit/$app-stores#updated) store to `true` when it detects one.
*/
version?: {
/**
Expand Down Expand Up @@ -730,7 +730,7 @@ export type HandleFetch = (input: {
export type Reroute = (event: { url: URL }) => void | string;

/**
* The generic form of `PageLoad` and `LayoutLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#generated-types))
* The generic form of `PageLoad` and `LayoutLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types))
* rather than using `Load` directly.
*/
export type Load<
Expand All @@ -742,7 +742,7 @@ export type Load<
> = (event: LoadEvent<Params, InputData, ParentData, RouteId>) => MaybePromise<OutputData>;

/**
* The generic form of `PageLoadEvent` and `LayoutLoadEvent`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#generated-types))
* The generic form of `PageLoadEvent` and `LayoutLoadEvent`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types))
* rather than using `LoadEvent` directly.
*/
export interface LoadEvent<
Expand Down Expand Up @@ -787,7 +787,7 @@ export interface LoadEvent<
*
* Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
*
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/types#public-types-cookies) API in a server-only `load` function instead.
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead.
*
* `setHeaders` has no effect when a `load` function runs in the browser.
*/
Expand All @@ -800,7 +800,7 @@ export interface LoadEvent<
*/
parent(): Promise<ParentData>;
/**
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/modules#$app-navigation-invalidate) to cause `load` to rerun.
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
*
* Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
*
Expand Down Expand Up @@ -939,7 +939,7 @@ export interface Navigation {
}

/**
* The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/modules#$app-navigation-beforenavigate) callbacks.
* The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/$app-navigation#beforeNavigate) callbacks.
*/
export interface BeforeNavigate extends Navigation {
/**
Expand All @@ -949,7 +949,7 @@ export interface BeforeNavigate extends Navigation {
}

/**
* The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/modules#$app-navigation-onnavigate) callbacks.
* The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/$app-navigation#onNavigate) callbacks.
*/
export interface OnNavigate extends Navigation {
/**
Expand All @@ -967,7 +967,7 @@ export interface OnNavigate extends Navigation {
}

/**
* The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/modules#$app-navigation-afternavigate) callbacks.
* The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/$app-navigation#afterNavigate) callbacks.
*/
export interface AfterNavigate extends Omit<Navigation, 'type'> {
/**
Expand Down Expand Up @@ -1022,7 +1022,7 @@ export interface Page<
*/
data: App.PageData & Record<string, any>;
/**
* The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/modules#$app-navigation-pushstate) and [`replaceState`](https://svelte.dev/docs/kit/modules#$app-navigation-replacestate) functions from `$app/navigation`.
* The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
*/
state: App.PageState;
/**
Expand Down Expand Up @@ -1105,7 +1105,7 @@ export interface RequestEvent<
*
* Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
*
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/types#public-types-cookies) API instead.
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead.
*/
setHeaders(headers: Record<string, string>): void;
/**
Expand All @@ -1126,7 +1126,7 @@ export interface RequestEvent<
/**
* A `(event: RequestEvent) => Response` function exported from a `+server.js` file that corresponds to an HTTP verb (`GET`, `PUT`, `PATCH`, etc) and handles requests with that method.
*
* It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#generated-types) instead.
* It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#Generated-types) instead.
*/
export type RequestHandler<
Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
Expand Down Expand Up @@ -1202,7 +1202,7 @@ export interface SSRManifest {
}

/**
* The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#generated-types))
* The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types))
* rather than using `ServerLoad` directly.
*/
export type ServerLoad<
Expand All @@ -1224,7 +1224,7 @@ export interface ServerLoadEvent<
*/
parent(): Promise<ParentData>;
/**
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/modules#$app-navigation-invalidate) to cause `load` to rerun.
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
*
* Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
*
Expand Down Expand Up @@ -1317,7 +1317,7 @@ export type ActionResult<
| { type: 'error'; status?: number; error: any };

/**
* The object returned by the [`error`](https://svelte.dev/docs/kit/modules#sveltejs-kit-error) function.
* The object returned by the [`error`](https://svelte.dev/docs/kit/@sveltejs-kit#error) function.
*/
export interface HttpError {
/** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses), in the range 400-599. */
Expand All @@ -1327,7 +1327,7 @@ export interface HttpError {
}

/**
* The object returned by the [`redirect`](https://svelte.dev/docs/kit/modules#sveltejs-kit-redirect) function
* The object returned by the [`redirect`](https://svelte.dev/docs/kit/@sveltejs-kit#redirect) function
*/
export interface Redirect {
/** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages), in the range 300-308. */
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ declare namespace App {
export interface Locals {}

/**
* Defines the common shape of the [$page.data store](https://svelte.dev/docs/kit/modules#$app-stores-page) - that is, the data that is shared between all pages.
* Defines the common shape of the [$page.data store](https://svelte.dev/docs/kit/$app-stores#page) - that is, the data that is shared between all pages.
* The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly.
* Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`).
*/
export interface PageData {}

/**
* The shape of the `$page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/modules#$app-navigation-pushstate) and [`replaceState`](https://svelte.dev/docs/kit/modules#$app-navigation-replacestate) functions from `$app/navigation`.
* The shape of the `$page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
*/
export interface PageState {}

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/types/synthetic/$env+dynamic+public.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Similar to [`$env/dynamic/private`](https://svelte.dev/docs/kit/modules#$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.
Similar to [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.

Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead.

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/types/synthetic/$env+static+private.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://svelte.dev/docs/kit/modules#$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured).
Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured).

_Unlike_ [`$env/dynamic/private`](https://svelte.dev/docs/kit/modules#$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination.
_Unlike_ [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination.

```ts
import { API_KEY } from '$env/static/private';
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/types/synthetic/$env+static+public.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Similar to [`$env/static/private`](https://svelte.dev/docs/kit/modules#$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.
Similar to [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.

Values are replaced statically at build time.

Expand Down
Loading

0 comments on commit 208ed90

Please sign in to comment.