Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Apr 1, 2024
1 parent e9afd67 commit f226cb6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
24 changes: 12 additions & 12 deletions packages/astro/src/@types/astro.ts
Expand Up @@ -2353,7 +2353,7 @@ interface AstroSharedContext<
> {
/**
* The address (usually IP address) of the user.
*
*
* Throws an error if used within a static site, or within a prerendered page.
*/
clientAddress: string;
Expand Down Expand Up @@ -2407,7 +2407,7 @@ interface AstroSharedContext<
/**
* The `APIContext` is the object made available to endpoints and middleware.
* It is a subset of the `Astro` global object available in pages.
*
*
* [Reference](https://docs.astro.build/en/reference/api-reference/#endpoint-context)
*/
export interface APIContext<
Expand All @@ -2426,7 +2426,7 @@ export interface APIContext<
generator: string;
/**
* The url of the current request, parsed as an instance of `URL`.
*
*
* Equivalent to:
* ```ts
* new URL(context.request.url)
Expand All @@ -2441,7 +2441,7 @@ export interface APIContext<
* Example usage:
* ```ts
* import type { APIContext } from "astro"
*
*
* export function getStaticPaths() {
* return [
* { params: { id: '0' }, props: { name: 'Sarah' } },
Expand All @@ -2463,8 +2463,8 @@ export interface APIContext<
*
* Example usage:
* ```ts
* import type { APIContext } from "astro"
*
* import type { APIContext } from "astro"
*
* export function getStaticPaths() {
* return [
* { params: { id: '0' }, props: { name: 'Sarah' } },
Expand All @@ -2477,13 +2477,13 @@ export interface APIContext<
* return new Response(`Hello ${props.name}!`);
* }
* ```
*
*
* [Reference](https://docs.astro.build/en/guides/api-reference/#contextprops)
*/
props: AstroSharedContext<Props, APIParams>['props'];
/**
* Create a response that redirects to another page.
*
*
* Example usage:
* ```ts
* // src/pages/secret.ts
Expand All @@ -2498,11 +2498,11 @@ export interface APIContext<

/**
* An object that middlewares can use to store extra information related to the request.
*
*
* It will be made available to pages as `Astro.locals`, and to endpoints as `context.locals`.
*
*
* Example usage:
*
*
* ```ts
* // src/middleware.ts
* import { defineMiddleware } from "astro:middleware";
Expand All @@ -2520,7 +2520,7 @@ export interface APIContext<
* ---
* <h1>{greeting}</h1>
* ```
*
*
* [Reference](https://docs.astro.build/en/reference/api-reference/#contextlocals)
*/
locals: App.Locals;
Expand Down
2 changes: 2 additions & 0 deletions packages/astro/src/core/README.md
Expand Up @@ -3,6 +3,7 @@
Code that executes directly on Node (not processed by vite). Contains the main Astro logic for the `build`, `dev`, `preview`, and `sync` commands, and also manages the lifecycle of the Vite server.

The `core/index.ts` module exports the CLI commands as functions and is the main entrypoint of the `astro` package.

```ts
import { dev, build, preview, sync } from 'astro';
```
Expand Down Expand Up @@ -40,6 +41,7 @@ vite-plugin-astro-server --------- DevPipeline ------ Pipeline ------------- Ren
The pipeline is an interface representing data that stays unchanged throughout the duration of the server or build. For example: the user configuration, the list of pages and endpoints in the project, and environment-specific way of gathering scripts and styles.

There are 3 implementations of the pipeline:

- `DevPipeline`: in-use during the `astro dev` CLI command. Created and used by `vite-plugin-astro-server`, and then forwarded to other internals.
- `BuildPipeline`: in-use during the `astro build` command in `"static"` mode, and for prerendering in `"server"` and `"hybrid"` output modes. See `core/build/`.
- `AppPipeline`: in-use during production server(less) deployments. Created and used by `App` (see `core/app/`), and then forwarded to other internals.
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/core/constants.ts
Expand Up @@ -4,7 +4,7 @@ export const ASTRO_VERSION = process.env.PACKAGE_VERSION ?? 'development';
/**
* The name for the header used to help rerouting behavior.
* When set to "no", astro will NOT try to reroute an error response to the corresponding error page, which is the default behavior that can sometimes lead to loops.
*
*
* ```ts
* const response = new Response("keep this content as-is", {
* status: 404,
Expand Down Expand Up @@ -52,9 +52,9 @@ export const clientLocalsSymbol = Symbol.for('astro.locals');

/**
* The symbol used as a field on the response object to keep track of streaming.
*
*
* It is set when the `<head>` element has been completely generated, rendered, and the response object has been passed onto the adapter.
*
*
* Used to provide helpful errors and warnings when headers or cookies are added during streaming, after the response has already been sent.
*/
export const responseSentSymbol = Symbol.for('astro.responseSent');
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/core/request.ts
Expand Up @@ -29,9 +29,9 @@ const clientLocalsSymbol = Symbol.for('astro.locals');

/**
* Used by astro internals to create a web standard request object.
*
*
* The user of this function may provide the data in a runtime-agnostic way.
*
*
* This is used by the static build to create fake requests for prerendering, and by the dev server to convert node requests into the standard request object.
*/
export function createRequest({
Expand Down

0 comments on commit f226cb6

Please sign in to comment.