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

[i18nIgnore] Rename entryPoint to entrypoint #5475

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/content/docs/de/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface AstroIntegration {
addRenderer: (renderer: AstroRenderer) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig }) => void | Promise<void>;
'astro:server:setup'?: (options: { server: vite.ViteDevServer }) => void | Promise<void>;
Expand Down Expand Up @@ -67,7 +67,7 @@ interface AstroIntegration {
addRenderer: (renderer: AstroRenderer) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
}) => void;
```

Expand Down Expand Up @@ -141,21 +141,21 @@ addWatchFile(new URL('./tailwind.config.js', config.root));

#### `injectRoute`-Option

**Typ:** `({ pattern: string, entryPoint: string }) => void;`
**Typ:** `({ pattern: string, entrypoint: string }) => void;`
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved

Eine Callback-Funktion, um Routen in ein Astro-Projekt zu injizieren. Injizierte Routen können [`.astro`-Seiten](/de/core-concepts/astro-pages/) oder [`.js` und `.ts`-Routenhandler](/de/core-concepts/endpoints/#endpunkte-für-statische-dateien) sein.

`injectRoute` nimmt ein Objekt mit einem `Pattern` und einem `EntryPoint`.

- `pattern` - wo die Route im Browser ausgegeben werden soll, z.B. `/foo/bar`. Ein Muster kann Astros Dateipfad-Syntax verwenden, um dynamische Routen zu bezeichnen, z.B. `/foo/[bar]` oder `/foo/[...bar]`. Beachte, dass eine Dateierweiterung **nicht** im `Pattern` benötigt wird.
- `entryPoint` - ein reiner Modulbezeichner, der auf die `.astro`-Seite oder den `.js`/`.ts`-Routenhandler zeigt, der die im `pattern` angegebene Route bearbeitet.
- `entrypoint` - ein reiner Modulbezeichner, der auf die `.astro`-Seite oder den `.js`/`.ts`-Routenhandler zeigt, der die im `pattern` angegebene Route bearbeitet.

Beispiel für die Verwendung:

```js
injectRoute({
pattern: '/foo/[dynamic]',
entryPoint: 'foo/dynamic-page.astro'
entrypoint: 'foo/dynamic-page.astro'
});
```

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/en/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface AstroIntegration {
addMiddleware: (middleware: AstroIntegrationMiddleware) => void;
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise<void>;
Expand Down Expand Up @@ -80,7 +80,7 @@ interface AstroIntegration {
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
```
Expand Down Expand Up @@ -309,14 +309,14 @@ export const onRequest = defineMiddleware(async (context, request) => {

#### `injectRoute` option

**Type:** `({ pattern: string, entryPoint: string }) => void;`
**Type:** `({ pattern: string, entrypoint: string }) => void;`

A callback function to inject routes into an Astro project. Injected routes can be [`.astro` pages](/en/core-concepts/astro-pages/) or [`.js` and `.ts` route handlers](/en/core-concepts/endpoints/#static-file-endpoints).

`injectRoute` takes an object with a `pattern` and an `entryPoint`.
`injectRoute` takes an object with a `pattern` and an `entrypoint`.

- `pattern` - where the route should be output in the browser, for example `/foo/bar`. A `pattern` can use Astro's filepath syntax for denoting dynamic routes, for example `/foo/[bar]` or `/foo/[...bar]`. Note that a file extension is **not** needed in the `pattern`.
- `entryPoint` - a bare module specifier pointing towards the `.astro` page or `.js`/`.ts` route handler that handles the route denoted in the `pattern`.
- `entrypoint` - a bare module specifier pointing towards the `.astro` page or `.js`/`.ts` route handler that handles the route denoted in the `pattern`.

##### Example usage

Expand All @@ -325,7 +325,7 @@ injectRoute({
// Use Astro’s pattern syntax for dynamic routes.
pattern: '/subfolder/[dynamic]',
// Use relative path syntax for a local route.
entryPoint: './src/dynamic-page.astro'
entrypoint: './src/dynamic-page.astro'
});
```

Expand All @@ -335,7 +335,7 @@ The following example shows a package published to npm as `@fancy/dashboard` inj
```js
injectRoute({
pattern: '/fancy-dashboard',
entryPoint: '@fancy/dashboard/dashboard.astro'
entrypoint: '@fancy/dashboard/dashboard.astro'
});
```

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/es/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface AstroIntegration {
addMiddleware: (middleware: AstroIntegrationMiddleware) => void;
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise<void>;
Expand Down Expand Up @@ -80,7 +80,7 @@ interface AstroIntegration {
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
```
Expand Down Expand Up @@ -309,14 +309,14 @@ export const onRequest = defineMiddleware(async (context, request) => {

#### Opción `injectRoute`

**Tipo:** `({ pattern: string, entryPoint: string }) => void;`
**Tipo:** `({ pattern: string, entrypoint: string }) => void;`

Una función callback para inyectar rutas a un proyecto de Astro. Las rutas inyectadas pueden ser [páginas `.astro`](/es/core-concepts/astro-pages/) o [handlers de ruta `.js` y `.ts`](/es/core-concepts/endpoints/#endpoints-de-archivos-estáticos).

`injectRoute` toma un objeto con un `pattern` y un `entryPoint`.
`injectRoute` toma un objeto con un `pattern` y un `entrypoint`.

- `pattern` - es la ruta en el navegador, por ejemplo `/foo/bar`. Un `pattern` puede usar la sintaxis de ruta de archivo de Astro para indicar rutas dinámicas, por ejemplo `/foo/[bar]` o `/foo/[...bar]`. Tenga en cuenta que **no** se necesita una extensión de archivo en el `patrón`.
- `entryPoint` - un especificador de módulo simple que apunta hacia la página `.astro` o el controlador de ruta `.js`/`.ts` que maneja la ruta indicada en el `pattern`.
- `entrypoint` - un especificador de módulo simple que apunta hacia la página `.astro` o el controlador de ruta `.js`/`.ts` que maneja la ruta indicada en el `pattern`.

##### Ejemplo de uso

Expand All @@ -325,7 +325,7 @@ injectRoute({
// Utiliza la sintaxis de patrón de Astro para rutas dinámicas.
pattern: '/subfolder/[dynamic]',
// Utiliza la sintaxis de ruta relativa para una ruta local.
entryPoint: './src/dynamic-page.astro'
entrypoint: './src/dynamic-page.astro'
});
```

Expand All @@ -335,7 +335,7 @@ El siguiente ejemplo muestra un paquete publicado en npm como `@fancy/dashboard`
```js
injectRoute({
pattern: '/fancy-dashboard',
entryPoint: '@fancy/dashboard/dashboard.astro'
entrypoint: '@fancy/dashboard/dashboard.astro'
});
```

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/pt-br/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface AstroIntegration {
addWatchFile: (path: URL | string) => void;
addClientDirective: (directive: ClientDirectiveConfig) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise<void>;
Expand Down Expand Up @@ -76,7 +76,7 @@ interface AstroIntegration {
addClientDirective: (directive: ClientDirectiveConfig) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
```
Expand Down Expand Up @@ -216,14 +216,14 @@ declare module 'astro' {

#### Opção `injectRoute`

**Tipo:** `({ pattern: string, entryPoint: string }) => void;`
**Tipo:** `({ pattern: string, entrypoint: string }) => void;`

Uma função de callback para injetar rotas em um projeto Astro. Rotas injetadas podem ser [páginas `.astro`](/pt-br/core-concepts/astro-pages/) ou [handlers de rotas `.js` e `.ts`](/pt-br/core-concepts/endpoints/#endpoints-de-arquivos-estáticos).

`injectRoute` recebe um objeto com um `pattern` e um `entryPoint`.
`injectRoute` recebe um objeto com um `pattern` e um `entrypoint`.

- `pattern` - aonde a rota deve ser inserida no navegador, por exemplo `/foo/bar`. Um `pattern` pode utilizar a sintaxe de caminho de arquivos do Astro para indicar rotas dinâmicas, por exemplo `/foo/[bar]` ou `/foo/[...bar]`. Note que uma extensão de arquivo **não** é necessária no `pattern`.
- `entryPoint` - apenas um especificador de módulo apontando para a página `.astro` ou handler de rota `.js`/`.ts` que manipula a rota indicada no `pattern`.
- `entrypoint` - apenas um especificador de módulo apontando para a página `.astro` ou handler de rota `.js`/`.ts` que manipula a rota indicada no `pattern`.

##### Exemplo de uso

Expand All @@ -232,7 +232,7 @@ injectRoute({
// Usa o padrão de sintaxe do Astro para rotas dinâmicas.
pattern: '/subpasta/[dinamico]',
// Usa a sintaxe de caminho relativo para uma rota local.
entryPoint: './src/pagina-dinamica.astro'
entrypoint: './src/pagina-dinamica.astro'
});
```

Expand All @@ -242,7 +242,7 @@ O seguinte exemplo mostra um pacote publicado para o npm como `@chique/painel` i
```js
injectRoute({
pattern: '/painel-chique',
entryPoint: '@chique/painel/painel.astro'
entrypoint: '@chique/painel/painel.astro'
});
```

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/zh-cn/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface AstroIntegration {
addMiddleware: (middleware: AstroIntegrationMiddleware) => void;
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig; logger: AstroIntegrationLogger; }) => void | Promise<void>;
'astro:server:setup'?: (options: { server: vite.ViteDevServer; logger: AstroIntegrationLogger; }) => void | Promise<void>;
Expand Down Expand Up @@ -79,7 +79,7 @@ interface AstroIntegration {
addDevOverlayPlugin: (pluginEntrypoint: string) => void;
addWatchFile: (path: URL | string) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: ({ pattern: string, entryPoint: string }) => void;
injectRoute: ({ pattern: string, entrypoint: string }) => void;
logger: AstroIntegrationLogger;
}) => void;
```
Expand Down Expand Up @@ -308,14 +308,14 @@ export const onRequest = defineMiddleware(async (context, request) => {

#### `injectRoute` 选项

**类型**:`({ pattern: string, entryPoint: string }) => void;`
**类型**:`({ pattern: string, entrypoint: string }) => void;`

用于向 Astro 项目注入路由的回调函数。注入的路由可以是 [`.astro`页面](/zh-cn/core-concepts/astro-pages/) 或 [`.js`和`.ts`路由处理程序](/zh-cn/core-concepts/endpoints/#静态文件端点)。

`injectRoute` 接收带有 `pattern` 和 `entryPoint` 的对象值。
`injectRoute` 接收带有 `pattern` 和 `entrypoint` 的对象值。

- `pattern` - 应该在浏览器中使用的路由,例如 `/foo/bar`。`pattern` 可以使用 Astro 的文件路径语法来表示动态路由,例如 `/foo/[bar]` 或 `/foo/[...bar]`。请注意,在 `pattern` 中**无需**文件扩展名。
- `entryPoint` — 裸模块指定器,指向 `.astro` 页面或 `.js`/`.ts` 路由处理程序,处理`pattern` 中指定路由。
- `entrypoint` — 裸模块指定器,指向 `.astro` 页面或 `.js`/`.ts` 路由处理程序,处理`pattern` 中指定路由。

##### 使用示例

Expand All @@ -324,7 +324,7 @@ injectRoute({
// 使用 Astro 语法模式来匹配动态路由
pattern: '/subfolder/[dynamic]',
// 使用相对路径语法来匹配本地路由
entryPoint: './src/dynamic-page.astro'
entrypoint: './src/dynamic-page.astro'
});
```

Expand All @@ -335,7 +335,7 @@ injectRoute({
```js
injectRoute({
pattern: '/fancy-dashboard',
entryPoint: '@fancy/dashboard/dashboard.astro'
entrypoint: '@fancy/dashboard/dashboard.astro'
});
```

Expand Down
Loading