From 6ec07706b92c2d54ec4d8e656c70a49d6d75acc3 Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 11 Jun 2024 01:29:25 +0600 Subject: [PATCH 1/4] =?UTF-8?q?feat(docs)=20=D0=9F=D0=B5=D1=80=D0=B5=D0=B2?= =?UTF-8?q?=D0=BE=D0=B4=20Nitro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scorecards.yml | 2 +- docs/1.getting-started/11.testing.md | 2 +- docs/2.guide/3.going-further/3.modules.md | 4 +- docs/3.api/5.kit/1.modules.md | 4 +- docs/3.api/5.kit/10.templates.md | 28 ++++---- docs/3.api/5.kit/11.nitro.md | 86 +++++++++++------------ docs/3.api/5.kit/12.resolving.md | 2 +- docs/3.api/5.kit/2.programmatic.md | 10 +-- docs/3.api/5.kit/3.compatibility.md | 12 ++-- docs/3.api/5.kit/4.autoimports.md | 54 +++++++------- docs/3.api/5.kit/5.components.md | 64 ++++++++--------- docs/3.api/5.kit/7.pages.md | 14 ++-- docs/3.api/5.kit/8.layout.md | 2 +- docs/3.api/5.kit/9.plugins.md | 26 +++---- 14 files changed, 155 insertions(+), 155 deletions(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 7a36b4a41231..bf6111f0da90 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -56,7 +56,7 @@ jobs: # of the value entered here. publish_results: true - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # Upload the results as artifacts (опциональный). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 diff --git a/docs/1.getting-started/11.testing.md b/docs/1.getting-started/11.testing.md index 805b6a4507ab..100d90130ca9 100644 --- a/docs/1.getting-started/11.testing.md +++ b/docs/1.getting-started/11.testing.md @@ -43,7 +43,7 @@ We currently ship an environment for unit testing code that needs a [Nuxt](https ### Настройка -1. Add `@nuxt/test-utils/module` to your `nuxt.config` file (optional). It adds a Vitest integration to your Nuxt DevTools which supports running your unit tests in development. +1. Add `@nuxt/test-utils/module` to your `nuxt.config` file (опциональный). It adds a Vitest integration to your Nuxt DevTools which supports running your unit tests in development. ```ts twoslash export default defineNuxtConfig({ diff --git a/docs/2.guide/3.going-further/3.modules.md b/docs/2.guide/3.going-further/3.modules.md index 8c354e5e2192..e002fa4362ab 100644 --- a/docs/2.guide/3.going-further/3.modules.md +++ b/docs/2.guide/3.going-further/3.modules.md @@ -333,14 +333,14 @@ export default defineNuxtModule({ // From the runtime directory addComponent({ name: 'MySuperComponent', // name of the component to be used in vue templates - export: 'MySuperComponent', // (optional) if the component is a named (rather than default) export + export: 'MySuperComponent', // (опциональный) if the component is a named (rather than default) export filePath: resolver.resolve('runtime/components/MySuperComponent.vue') }) // From a library addComponent({ name: 'MyAwesomeComponent', // name of the component to be used in vue templates - export: 'MyAwesomeComponent', // (optional) if the component is a named (rather than default) export + export: 'MyAwesomeComponent', // (опциональный) if the component is a named (rather than default) export filePath: '@vue/awesome-components' }) } diff --git a/docs/3.api/5.kit/1.modules.md b/docs/3.api/5.kit/1.modules.md index 6e4c8f88e4d4..9173ff41c208 100644 --- a/docs/3.api/5.kit/1.modules.md +++ b/docs/3.api/5.kit/1.modules.md @@ -57,7 +57,7 @@ interface ModuleMeta { **Тип**: `ModuleDefinition | NuxtModule` -**Обязательно**: `true` +**Обязательный**: `true` Объект определения модуля или функция модуля. @@ -129,7 +129,7 @@ async function installModule (moduleToInstall: string | NuxtModule, inlineOption **Тип**: `string` | `NuxtModule` -**Обязательно**: `true` +**Обязательный**: `true` Модуль для установки. Может быть либо строкой с именем модуля, либо самим объектом модуля. diff --git a/docs/3.api/5.kit/10.templates.md b/docs/3.api/5.kit/10.templates.md index c60b6a3124e1..76c0eae45aee 100644 --- a/docs/3.api/5.kit/10.templates.md +++ b/docs/3.api/5.kit/10.templates.md @@ -46,41 +46,41 @@ interface ResolvedNuxtTemplate { **Тип**: `NuxtTemplate | string` -**Обязательно**: `true` +**Обязательный**: `true` A template object or a string with the path to the template. If a string is provided, it will be converted to a template object with `src` set to the string value. If a template object is provided, it must have the following properties: -- `src` (optional) +- `src` (опциональный) **Тип**: `string` Path to the template. If `src` is not provided, `getContents` must be provided instead. -- `filename` (optional) +- `filename` (опциональный) **Тип**: `string` Filename of the template. If `filename` is not provided, it will be generated from the `src` path. In this case, the `src` option is required. -- `dst` (optional) +- `dst` (опциональный) **Тип**: `string` Path to the destination file. If `dst` is not provided, it will be generated from the `filename` path and nuxt `buildDir` option. -- `options` (optional) +- `options` (опциональный) **Тип**: `Options` Options to pass to the template. -- `getContents` (optional) +- `getContents` (опциональный) **Тип**: `(data: Options) => string | Promise` A function that will be called with the `options` object. It should return a string or a promise that resolves to a string. If `src` is provided, this function will be ignored. -- `write` (optional) +- `write` (опциональный) **Тип**: `boolean` @@ -162,35 +162,35 @@ interface ResolvedNuxtTemplate { **Тип**: `NuxtTypeTemplate | string` -**Обязательно**: `true` +**Обязательный**: `true` A template object or a string with the path to the template. If a string is provided, it will be converted to a template object with `src` set to the string value. If a template object is provided, it must have the following properties: -- `src` (optional) +- `src` (опциональный) **Тип**: `string` Path to the template. If `src` is not provided, `getContents` must be provided instead. -- `filename` (optional) +- `filename` (опциональный) **Тип**: `string` Filename of the template. If `filename` is not provided, it will be generated from the `src` path. In this case, the `src` option is required. -- `dst` (optional) +- `dst` (опциональный) **Тип**: `string` Path to the destination file. If `dst` is not provided, it will be generated from the `filename` path and nuxt `buildDir` option. -- `options` (optional) +- `options` (опциональный) **Тип**: `Options` Options to pass to the template. -- `getContents` (optional) +- `getContents` (опциональный) **Тип**: `(data: Options) => string | Promise` @@ -252,7 +252,7 @@ interface ResolvedNuxtTemplate { Options to pass to the template. This object can have the following property: -- `filter` (optional) +- `filter` (опциональный) **Тип**: `(template: ResolvedNuxtTemplate) => boolean` diff --git a/docs/3.api/5.kit/11.nitro.md b/docs/3.api/5.kit/11.nitro.md index e2baf414ee08..6c99e8ced6fe 100644 --- a/docs/3.api/5.kit/11.nitro.md +++ b/docs/3.api/5.kit/11.nitro.md @@ -1,6 +1,6 @@ --- title: "Nitro" -description: Nuxt Kit provides a set of utilities to help you work with Nitro. These functions allow you to add server handlers, plugins, and prerender routes. +description: Nuxt Kit предоставляет набор утилит, которые помогут вам работать с Nitro. Эти функции позволяют вам добавлять серверные обработчики, плагины и маршруты для предварительного рендеринга. links: - label: Исходники icon: i-simple-icons-github @@ -8,11 +8,11 @@ links: size: xs --- -Nitro is an open source TypeScript framework to build ultra-fast web servers. Nuxt 3 (and, optionally, Nuxt Bridge) uses Nitro as its server engine. You can use `useNitro` to access the Nitro instance, `addServerHandler` to add a server handler, `addDevServerHandler` to add a server handler to be used only in development mode, `addServerPlugin` to add a plugin to extend Nitro's runtime behavior, and `addPrerenderRoutes` to add routes to be prerendered by Nitro. +Nitro - это TypeScript фреймворк с открытым исходный кодом для создания сверхбыстрых веб-серверов. Nuxt 3 (и, по желанию, Nuxt Bridge) использует Nitro в качестве своего серверного движка. Вы можете использовать `useNitro` для доступа к экземпляру Nitro, `addServerHandler` для добавления обработчика сервера, `addDevServerHandler` для добавления обработчика сервера, который будет использоваться только в режиме разработки, `addServerPlugin` для добавления плагина для расширения поведения времени выполнения Nitro, и `addPrerenderRoutes` для добавления маршрутов для предварительного рендеринга Nitro. ## `addServerHandler` -Adds a nitro server handler. Use it if you want to create server middleware or custom route. +Добавляет обработчик сервера Nitro. Используйте его, если вы хотите создать серверное middleware или настраиваемый маршрут. ### Тип @@ -34,39 +34,39 @@ export interface NitroEventHandler { **Тип**: `NitroEventHandler` -**Обязательно**: `true` +**Обязательный**: `true` -A handler object with the following properties: +Объект обработчика со следующими свойствами: -- `handler` (required) +- `handler` (обязательный) **Тип**: `string` - Path to event handler. + Путь к обработчику событий. -- `route` (optional) +- `route` (опциональный) **Тип**: `string` - Path prefix or route. If an empty string used, will be used as a middleware. + Префикс пути или маршрут. Если используется пустая строка, то будет использоваться middleware. -- `middleware` (optional) +- `middleware` (опциональный) **Тип**: `boolean` - Specifies this is a middleware handler. Middleware are called on every route and should normally return nothing to pass to the next handlers. + Указывает, что это обработчик middleware. Middleware вызываются на каждом маршруте и обычно не должны возвращать ничего для передачи следующим обработчикам. -- `lazy` (optional) +- `lazy` (опциональный) **Тип**: `boolean` - Use lazy loading to import handler. + Использовать ленивую загрузку для импорта обработчика. -- `method` (optional) +- `method` (опциональный) **Тип**: `string` - Router method matcher. If handler name contains method name, it will be used as a default value. + Метод сопоставления маршрутизатора. Если имя обработчика содержит имя метода, оно будет использоваться в качестве значения по умолчанию. ### Примеры @@ -100,7 +100,7 @@ export default defineEventHandler(() => { ## `addDevServerHandler` -Adds a nitro server handler to be used only in development mode. This handler will be excluded from production build. +Добавляет обработчик сервера Nitro, который будет использоваться только в режиме разработки. Этот обработчик будет исключен из сборки для продакшена. ### Тип @@ -119,21 +119,21 @@ export interface NitroDevEventHandler { **Тип**: `NitroEventHandler` -**Обязательно**: `true` +**Обязательный**: `true` -A handler object with the following properties: +Объект обработчика с следующими свойствами: -- `handler` (required) +- `handler` (обязательный) **Тип**: `string` - The event handler. + Обработчик события. -- `route` (optional) +- `route` (опциональный) **Тип**: `string` - Path prefix or route. If an empty string used, will be used as a middleware. + Префикс пути или маршрут. Если используется пустая строка, будет использоваться в качестве middleware. ### Примеры @@ -149,7 +149,7 @@ export default defineNuxtModule({ addDevServerHandler({ handler: () => { return { - body: `Response generated at ${new Date().toISOString()}` + body: `Ответ, сгенерированный в ${new Date().toISOString()}` } }, route: '/_handler' @@ -180,14 +180,14 @@ export default defineNuxtModule({ ## `useNitro` -Returns the Nitro instance. +Возвращает экземпляр Nitro. ::warning -You can call `useNitro()` only after `ready` hook. +Вы можете вызывать `useNitro()` только после хука `ready`. :: ::note -Changes to the Nitro instance configuration are not applied. +Изменения в конфигурации экземпляра Nitro не применяются. :: ### Тип @@ -221,7 +221,7 @@ export default defineNuxtModule({ nuxt.hook('ready', () => { const nitro = useNitro() if (nitro.options.static && nuxt.options.experimental.payloadExtraction === undefined) { - console.warn('Using experimental payload extraction for full-static output. You can opt-out by setting `experimental.payloadExtraction` to `false`.') + console.warn('Использование экспериментального извлечения полезной нагрузки для полностью статического вывода. Вы можете отказаться от этого, установив `experimental.payloadExtraction` в значение `false`.') nuxt.options.experimental.payloadExtraction = true } nitro.options.replace['process.env.NUXT_PAYLOAD_EXTRACTION'] = String(!!nuxt.options.experimental.payloadExtraction) @@ -237,10 +237,10 @@ export default defineNuxtModule({ ## `addServerPlugin` -Add plugin to extend Nitro's runtime behavior. +Добавление плагина для расширения поведения времени выполнения Nitro. ::tip -You can read more about Nitro plugins in the [Nitro documentation](https://nitro.unjs.io/guide/plugins). +Вы можете прочитать больше о плагинах Nitro в [Nitro документации](https://nitro.unjs.io/guide/plugins). :: ### Тип @@ -255,9 +255,9 @@ function addServerPlugin (plugin: string): void **Тип**: `string` -**Обязательно**: `true` +**Обязательный**: `true` -Path to the plugin. The plugin must export a function that accepts Nitro instance as an argument. +Путь к плагину. Плагин должен экспортировать функцию, принимающую экземпляр Nitro в качестве аргумента. ### Примеры @@ -277,15 +277,15 @@ export default defineNuxtModule({ ```ts [runtime/plugin.ts] export default defineNitroPlugin((nitroApp) => { nitroApp.hooks.hook("request", (event) => { - console.log("on request", event.path); + console.log("при запросе", event.path); }); nitroApp.hooks.hook("beforeResponse", (event, { body }) => { - console.log("on response", event.path, { body }); + console.log("при запросе", event.path, { body }); }); nitroApp.hooks.hook("afterResponse", (event, { body }) => { - console.log("on after response", event.path, { body }); + console.log("после ответа", event.path, { body }); }); }); ``` @@ -308,9 +308,9 @@ function function addPrerenderRoutes (routes: string | string[]): void **Тип**: `string | string[]` -**Обязательно**: `true` +**Обязательный**: `true` -A route or an array of routes to prerender. +Добавляет маршруты для предварительного рендеринга в Nitro. ### Примеры @@ -336,7 +336,7 @@ export default defineNuxtModule({ ## `addServerImportsDir` -Add a directory to be scanned for auto-imports by Nitro. +Добавьте директорию которая будет сканироваться Nitro на предмет автоимпорта. ### Тип @@ -350,9 +350,9 @@ function addServerImportsDir (dirs: string | string[], opts: { prepend?: boolean **Тип**: `string | string[]` -**Обязательно**: `true` +**Обязательный**: `true` -A directory or an array of directories to register to be scanned by Nitro +Директория или массив директорий, которые необходимо зарегистрировать для сканирования Nitro ### Примеры @@ -373,8 +373,8 @@ export default defineNuxtModule({ ## `addServerScanDir` -Add directories to be scanned by Nitro. It will check for subdirectories, which will be registered -just like the `~/server` folder is. +Добавьте директории, которые будут сканироваться Nitro. Nitro будет проверять подкаталоги, которые будут зарегистрированы +так же, как и папка `~/server`. ### Тип @@ -388,9 +388,9 @@ function addServerScanDir (dirs: string | string[], opts: { prepend?: boolean }) **Тип**: `string | string[]` -**Обязательно**: `true` +**Обязательный**: `true` -A directory or an array of directories to register to be scanned for by Nitro as server dirs. +Директория или массив директорий, которые Nitro хочет зарегистрировать в качестве серверных директорий. ### Примеры diff --git a/docs/3.api/5.kit/12.resolving.md b/docs/3.api/5.kit/12.resolving.md index 1922cebb1f52..a5c4c391dd87 100644 --- a/docs/3.api/5.kit/12.resolving.md +++ b/docs/3.api/5.kit/12.resolving.md @@ -26,7 +26,7 @@ async function resolvePath (path: string, options?: ResolvePathOptions): Promise **Тип**: `string` -**Обязательно**: `true` +**Обязательный**: `true` Путь к резолву. diff --git a/docs/3.api/5.kit/2.programmatic.md b/docs/3.api/5.kit/2.programmatic.md index eb0a4b0aa1d9..1f7d63b24726 100644 --- a/docs/3.api/5.kit/2.programmatic.md +++ b/docs/3.api/5.kit/2.programmatic.md @@ -35,7 +35,7 @@ interface LoadNuxtOptions extends LoadNuxtConfigOptions { Loading conditions for Nuxt. `loadNuxt` uses [`c12`](https://github.com/unjs/c12) under the hood, so it accepts the same options as `c12.loadConfig` with some additional options: -- `dev` (optional) +- `dev` (опциональный) **Тип**: `boolean` @@ -43,7 +43,7 @@ Loading conditions for Nuxt. `loadNuxt` uses [`c12`](https://github.com/unjs/c12 If set to `true`, Nuxt will be loaded in development mode. -- `ready` (optional) +- `ready` (опциональный) **Тип**: `boolean` @@ -67,7 +67,7 @@ async function buildNuxt (nuxt: Nuxt): Promise **Тип**: `Nuxt` -**Обязательно**: `true` +**Обязательный**: `true` Nuxt instance to build. It can be retrieved from the context via `useNuxt()` call. @@ -87,7 +87,7 @@ async function loadNuxtConfig (options: LoadNuxtConfigOptions): Promise { Constraints to check for. It accepts the following properties: -- `nuxt` (optional) +- `nuxt` (опциональный) **Тип**: `string` Nuxt version in semver format. Versions may be defined in Node.js way, for example: `>=2.15.0 <3.0.0`. -- `bridge` (optional) +- `bridge` (опциональный) **Тип**: `boolean` @@ -101,13 +101,13 @@ interface NuxtCompatibility { Constraints to check for. It accepts the following properties: -- `nuxt` (optional) +- `nuxt` (опциональный) **Тип**: `string` Nuxt version in semver format. Versions may be defined in Node.js way, for example: `>=2.15.0 <3.0.0`. -- `bridge` (optional) +- `bridge` (опциональный) **Тип**: `boolean` @@ -149,13 +149,13 @@ interface NuxtCompatibility { Constraints to check for. It accepts the following properties: -- `nuxt` (optional) +- `nuxt` (опциональный) **Тип**: `string` Nuxt version in semver format. Versions may be defined in Node.js way, for example: `>=2.15.0 <3.0.0`. -- `bridge` (optional) +- `bridge` (опциональный) **Тип**: `boolean` diff --git a/docs/3.api/5.kit/4.autoimports.md b/docs/3.api/5.kit/4.autoimports.md index 57e0ff86051d..b555153c80e6 100644 --- a/docs/3.api/5.kit/4.autoimports.md +++ b/docs/3.api/5.kit/4.autoimports.md @@ -53,17 +53,17 @@ interface Import { **Тип**: `Import | Import[]` -**Обязательно**: `true` +**Обязательный**: `true` An object or an array of objects with the following properties: -- `from` (required) +- `from` (обязательный) **Тип**: `string` Module specifier to import from. -- `priority` (optional) +- `priority` (опциональный) **Тип**: `number` @@ -71,55 +71,55 @@ An object or an array of objects with the following properties: Priority of the import, if multiple imports have the same name, the one with the highest priority will be used. -- `disabled` (optional) +- `disabled` (опциональный) **Тип**: `boolean` If this import is disabled. -- `meta` (optional) +- `meta` (опциональный) **Тип**: `object` Metadata of the import. -- `meta.description` (optional) +- `meta.description` (опциональный) **Тип**: `string` Short description of the import. -- `meta.docsUrl` (optional) +- `meta.docsUrl` (опциональный) **Тип**: `string` URL to the documentation. -- `meta[key]` (optional) +- `meta[key]` (опциональный) **Тип**: `any` Additional metadata. -- `type` (optional) +- `type` (опциональный) **Тип**: `boolean` If this import is a pure type import. -- `typeFrom` (optional) +- `typeFrom` (опциональный) **Тип**: `string` Using this as the from when generating type declarations. -- `name` (required) +- `name` (обязательный) **Тип**: `string` Import name to be detected. -- `as` (optional) +- `as` (опциональный) **Тип**: `string` @@ -164,7 +164,7 @@ function addImportsDir (dirs: string | string[], options?: { prepend?: boolean } **Тип**: `string | string[]` -**Обязательно**: `true` +**Обязательный**: `true` A string or an array of strings with the path to the directory to import from. @@ -231,25 +231,25 @@ type PresetImport = Omit | string | [name: string, as?: string, **Тип**: `ImportSource | ImportSource[]` -**Обязательно**: `true` +**Обязательный**: `true` An object or an array of objects with the following properties: -- `imports` (required) +- `imports` (обязательный) **Тип**: `PresetImport | ImportSource[]` - **Обязательно**: `true` + **Обязательный**: `true` An object or an array of objects, which can be import names, import objects or import sources. -- `from` (required) +- `from` (обязательный) **Тип**: `string` Module specifier to import from. -- `priority` (optional) +- `priority` (опциональный) **Тип**: `number` @@ -257,55 +257,55 @@ An object or an array of objects with the following properties: Priority of the import, if multiple imports have the same name, the one with the highest priority will be used. -- `disabled` (optional) +- `disabled` (опциональный) **Тип**: `boolean` If this import is disabled. -- `meta` (optional) +- `meta` (опциональный) **Тип**: `object` Metadata of the import. -- `meta.description` (optional) +- `meta.description` (опциональный) **Тип**: `string` Short description of the import. -- `meta.docsUrl` (optional) +- `meta.docsUrl` (опциональный) **Тип**: `string` URL to the documentation. -- `meta[key]` (optional) +- `meta[key]` (опциональный) **Тип**: `any` Additional metadata. -- `type` (optional) +- `type` (опциональный) **Тип**: `boolean` If this import is a pure type import. -- `typeFrom` (optional) +- `typeFrom` (опциональный) **Тип**: `string` Using this as the from when generating type declarations. -- `name` (required) +- `name` (обязательный) **Тип**: `string` Import name to be detected. -- `as` (optional) +- `as` (опциональный) **Тип**: `string` diff --git a/docs/3.api/5.kit/5.components.md b/docs/3.api/5.kit/5.components.md index 525b8c779f15..8e658cf5067a 100644 --- a/docs/3.api/5.kit/5.components.md +++ b/docs/3.api/5.kit/5.components.md @@ -69,74 +69,74 @@ interface Component { **Тип**: `ComponentsDir` -**Обязательно**: `true` +**Обязательный**: `true` An object with the following properties: -- `path` (required) +- `path` (обязательный) **Тип**: `string` Path (absolute or relative) to the directory containing your components. You can use Nuxt aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require. -- `pattern` (optional) +- `pattern` (опциональный) **Тип**: `string | string[]` Accept Pattern that will be run against specified path. -- `ignore` (optional) +- `ignore` (опциональный) **Тип**: `string[]` Ignore patterns that will be run against specified path. -- `prefix` (optional) +- `prefix` (опциональный) **Тип**: `string` Prefix all matched components with this string. -- `pathPrefix` (optional) +- `pathPrefix` (опциональный) **Тип**: `boolean` Prefix component name by its path. -- `enabled` (optional) +- `enabled` (опциональный) **Тип**: `boolean` Ignore scanning this directory if set to `true`. -- `prefetch` (optional) +- `prefetch` (опциональный) **Тип**: `boolean` These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) -- `preload` (optional) +- `preload` (опциональный) **Тип**: `boolean` These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) -- `isAsync` (optional) +- `isAsync` (опциональный) **Тип**: `boolean` This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not. -- `extendComponent` (optional) +- `extendComponent` (опциональный) **Тип**: `(component: Component) => Promise | (Component | void)` A function that will be called for each component found in the directory. It accepts a component object and should return a component object or a promise that resolves to a component object. -- `global` (optional) +- `global` (опциональный) **Тип**: `boolean` @@ -144,25 +144,25 @@ An object with the following properties: If enabled, registers components to be globally available. -- `island` (optional) +- `island` (опциональный) **Тип**: `boolean` If enabled, registers components as islands. -- `watch` (optional) +- `watch` (опциональный) **Тип**: `boolean` Watch specified path for changes, including file additions and file deletions. -- `extensions` (optional) +- `extensions` (опциональный) **Тип**: `string[]` Extensions supported by Nuxt builder. -- `transpile` (optional) +- `transpile` (опциональный) **Тип**: `'auto' | boolean` @@ -170,9 +170,9 @@ An object with the following properties: #### `opts` -**Обязательно**: `false` +**Обязательный**: `false` -- `prepend` (optional) +- `prepend` (опциональный) **Тип**: `boolean` @@ -210,35 +210,35 @@ interface AddComponentOptions { **Тип**: `AddComponentOptions` -**Обязательно**: `true` +**Обязательный**: `true` An object with the following properties: -- `name` (required) +- `name` (обязательный) **Тип**: `string` Component name. -- `filePath` (required) +- `filePath` (обязательный) **Тип**: `string` Path to the component. -- `pascalName` (optional) +- `pascalName` (опциональный) **Тип**: `pascalCase(options.name)` Pascal case component name. If not provided, it will be generated from the component name. -- `kebabName` (optional) +- `kebabName` (опциональный) **Тип**: `kebabCase(options.name)` Kebab case component name. If not provided, it will be generated from the component name. -- `export` (optional) +- `export` (опциональный) **Тип**: `string` @@ -246,13 +246,13 @@ An object with the following properties: Specify named or default export. If not provided, it will be set to `'default'`. -- `shortPath` (optional) +- `shortPath` (опциональный) **Тип**: `string` Short path to the component. If not provided, it will be generated from the component path. -- `chunkName` (optional) +- `chunkName` (опциональный) **Тип**: `string` @@ -260,21 +260,21 @@ An object with the following properties: Chunk name for the component. If not provided, it will be generated from the component name. -- `prefetch` (optional) +- `prefetch` (опциональный) **Тип**: `boolean` These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) -- `preload` (optional) +- `preload` (опциональный) **Тип**: `boolean` These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) -- `global` (optional) +- `global` (опциональный) **Тип**: `boolean` @@ -282,13 +282,13 @@ An object with the following properties: If enabled, registers component to be globally available. -- `island` (optional) +- `island` (опциональный) **Тип**: `boolean` If enabled, registers component as island. You can read more about islands in [``](/docs/api/components/nuxt-island#nuxtisland) component description. -- `mode` (optional) +- `mode` (опциональный) **Тип**: `'client' | 'server' | 'all'` @@ -296,7 +296,7 @@ An object with the following properties: This options indicates if component should render on client, server or both. By default, it will render on both client and server. -- `priority` (optional) +- `priority` (опциональный) **Тип**: `number` diff --git a/docs/3.api/5.kit/7.pages.md b/docs/3.api/5.kit/7.pages.md index 24b922ee3d8f..da6c48377fa0 100644 --- a/docs/3.api/5.kit/7.pages.md +++ b/docs/3.api/5.kit/7.pages.md @@ -38,7 +38,7 @@ type NuxtPage = { **Тип**: `(pages: NuxtPage[]) => void` -**Обязательно**: `true` +**Обязательный**: `true` A function that will be called with the pages configuration. You can alter this array by adding, deleting, or modifying its elements. Note: You should modify the provided pages array directly, as changes made to a copied array will not be reflected in the configuration. @@ -128,7 +128,7 @@ interface ProxyOptions { **Тип**: `string` -**Обязательно**: `true` +**Обязательный**: `true` A route pattern to match against. @@ -136,7 +136,7 @@ A route pattern to match against. **Тип**: `NitroRouteConfig` -**Обязательно**: `true` +**Обязательный**: `true` A route configuration to apply to the matched route. @@ -218,23 +218,23 @@ interface AddRouteMiddlewareOptions { **Тип**: `NuxtMiddleware | NuxtMiddleware[]` -**Обязательно**: `true` +**Обязательный**: `true` A middleware object or an array of middleware objects with the following properties: -- `name` (required) +- `name` (обязательный) **Тип**: `string` Middleware name. -- `path` (required) +- `path` (обязательный) **Тип**: `string` Path to the middleware. -- `global` (optional) +- `global` (опциональный) **Тип**: `boolean` diff --git a/docs/3.api/5.kit/8.layout.md b/docs/3.api/5.kit/8.layout.md index 8a9c387d1b1d..dd7fdb25c36c 100644 --- a/docs/3.api/5.kit/8.layout.md +++ b/docs/3.api/5.kit/8.layout.md @@ -39,7 +39,7 @@ interface NuxtTemplate { **Тип**: `NuxtTemplate | string` -**Обязательно**: `true` +**Обязательный**: `true` Объект шаблона или строка с путем к шаблону. Если указана строка, она будет преобразована в объект шаблона с `src`, установленным на значение строки. Если указан объект шаблона, он должен обладать следующими свойствами: diff --git a/docs/3.api/5.kit/9.plugins.md b/docs/3.api/5.kit/9.plugins.md index 44cec7f1a63b..ffd3a673fac3 100644 --- a/docs/3.api/5.kit/9.plugins.md +++ b/docs/3.api/5.kit/9.plugins.md @@ -38,17 +38,17 @@ interface AddPluginOptions { append?: boolean } **Тип**: `NuxtPlugin | string` -**Обязательно**: `true` +**Обязательный**: `true` A plugin object or a string with the path to the plugin. If a string is provided, it will be converted to a plugin object with `src` set to the string value. If a plugin object is provided, it must have the following properties: -- `src` (required) +- `src` (обязательный) **Тип**: `string` Path to the plugin. -- `mode` (optional) +- `mode` (опциональный) **Тип**: `'all' | 'server' | 'client'` @@ -56,7 +56,7 @@ A plugin object or a string with the path to the plugin. If a string is provided If set to `'all'`, the plugin will be included in both client and server bundles. If set to `'server'`, the plugin will only be included in the server bundle. If set to `'client'`, the plugin will only be included in the client bundle. You can also use `.client` and `.server` modifiers when specifying `src` option to use plugin only in client or server side. -- `order` (optional) +- `order` (опциональный) **Тип**: `number` @@ -149,29 +149,29 @@ interface NuxtPlugin { **Тип**: `NuxtPluginTemplate` -**Обязательно**: `true` +**Обязательный**: `true` A plugin template object with the following properties: -- `src` (optional) +- `src` (опциональный) **Тип**: `string` Path to the template. If `src` is not provided, `getContents` must be provided instead. -- `filename` (optional) +- `filename` (опциональный) **Тип**: `string` Filename of the template. If `filename` is not provided, it will be generated from the `src` path. In this case, the `src` option is required. -- `dst` (optional) +- `dst` (опциональный) **Тип**: `string` Path to the destination file. If `dst` is not provided, it will be generated from the `filename` path and nuxt `buildDir` option. -- `mode` (optional) +- `mode` (опциональный) **Тип**: `'all' | 'server' | 'client'` @@ -179,25 +179,25 @@ A plugin template object with the following properties: If set to `'all'`, the plugin will be included in both client and server bundles. If set to `'server'`, the plugin will only be included in the server bundle. If set to `'client'`, the plugin will only be included in the client bundle. You can also use `.client` and `.server` modifiers when specifying `src` option to use plugin only in client or server side. -- `options` (optional) +- `options` (опциональный) **Тип**: `Options` Options to pass to the template. -- `getContents` (optional) +- `getContents` (опциональный) **Тип**: `(data: Options) => string | Promise` A function that will be called with the `options` object. It should return a string or a promise that resolves to a string. If `src` is provided, this function will be ignored. -- `write` (optional) +- `write` (опциональный) **Тип**: `boolean` If set to `true`, the template will be written to the destination file. Otherwise, the template will be used only in virtual filesystem. -- `order` (optional) +- `order` (опциональный) **Тип**: `number` From 6f21fd11e9e64acfcc5964727234611cefad420e Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 11 Jun 2024 01:48:41 +0600 Subject: [PATCH 2/4] =?UTF-8?q?fix(docs)=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=81=D1=8B=D0=BB?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/1.getting-started/5.seo-meta.md | 2 +- docs/3.api/1.components/4.nuxt-link.md | 2 +- docs/3.api/3.utils/define-page-meta.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/1.getting-started/5.seo-meta.md b/docs/1.getting-started/5.seo-meta.md index 62011505e79b..2e5095093e9e 100644 --- a/docs/1.getting-started/5.seo-meta.md +++ b/docs/1.getting-started/5.seo-meta.md @@ -99,7 +99,7 @@ const title = ref('Привет, мир!') ``` -## Типы +## Типы {#types} Ниже приведены нереактивные типы, используемые для [`useHead`](/docs/api/composables/use-head), [`app.head`](/docs/api/nuxt-config#head) и компонентов. ```ts diff --git a/docs/3.api/1.components/4.nuxt-link.md b/docs/3.api/1.components/4.nuxt-link.md index f40fe19cdf44..ed64260afb27 100644 --- a/docs/3.api/1.components/4.nuxt-link.md +++ b/docs/3.api/1.components/4.nuxt-link.md @@ -136,7 +136,7 @@ links: Значения по умолчанию могут быть перезаписаны, см. раздел [перезапись значений по умолчанию](#overwriting-defaults), если вы хотите их изменить. :: -## Перезапись значений по умолчанию +## Перезапись значений по умолчанию {#overwriting-defaults} ### В Nuxt Config diff --git a/docs/3.api/3.utils/define-page-meta.md b/docs/3.api/3.utils/define-page-meta.md index c21ee488eca5..019a26be3fc0 100644 --- a/docs/3.api/3.utils/define-page-meta.md +++ b/docs/3.api/3.utils/define-page-meta.md @@ -192,7 +192,7 @@ definePageMeta({ ``` -### Использование пользовательского регулярного выражения +### Использование пользовательского регулярного выражения {#using-a-custom-regular-expression} Пользовательское регулярное выражение является хорошим способом разрешения конфликтов между пересекающимися маршрутами, например: From 99e27ff6d8ec37f4caba90e7ad0b8163ec985c3c Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 11 Jun 2024 01:51:27 +0600 Subject: [PATCH 3/4] =?UTF-8?q?fix(docs)=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=81=D1=8B=D0=BB?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/1.getting-started/6.data-fetching.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/1.getting-started/6.data-fetching.md b/docs/1.getting-started/6.data-fetching.md index 47f888c5dc5c..3bcd2e60f6b5 100644 --- a/docs/1.getting-started/6.data-fetching.md +++ b/docs/1.getting-started/6.data-fetching.md @@ -318,7 +318,7 @@ watch(() => route.path, (path) => { ``` -#### Наблюдение +#### Наблюдение {#watch} Чтобы повторно запускать функцию получения данных при каждом изменении других реактивных значений в вашем приложении, используйте опцию `watch`. Вы можете использовать ее для одного или нескольких _наблюдаемых_ элементов. @@ -347,7 +347,7 @@ const { data, error, refresh } = await useFetch(`/api/users/${id.value}`, { Если вам нужно изменить URL на основе реактивного значения, вместо него лучше использовать [вычисляемый URL](#computed-url). -#### Вычисляемый URL +#### Вычисляемый URL {#computed-url} Иногда вам может потребоваться вычислить URL из реактивных значений и обновлять данные каждый раз, когда они меняются. Вместо того чтобы жонглировать данными, вы можете прикрепить каждый параметр как реактивное значение. Nuxt будет автоматически использовать реактивное значение и обновлять данные при каждом его изменении. @@ -398,7 +398,7 @@ const { data, pending, status } = useLazyFetch(() => `/api/users/${id.value}`, { Если вам нужно принудительно обновлять данные при изменении других реактивных значений, вы также можете [следить за другими значениями](#watch). -### Не срочно +### Не срочно {#not-immediate} Композабл `useFetch` начнет получать данные в момент вызова. Вы можете предотвратить это, установив `immediate: false`, например, чтобы дождаться взаимодействия с пользователем. From 90044a1eab3b7cc55988f34b45698d03b8c7f25d Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 11 Jun 2024 13:38:43 +0600 Subject: [PATCH 4/4] =?UTF-8?q?feat(docs)=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/3.api/5.kit/11.nitro.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/3.api/5.kit/11.nitro.md b/docs/3.api/5.kit/11.nitro.md index 6c99e8ced6fe..7b0fb6221b6e 100644 --- a/docs/3.api/5.kit/11.nitro.md +++ b/docs/3.api/5.kit/11.nitro.md @@ -8,11 +8,11 @@ links: size: xs --- -Nitro - это TypeScript фреймворк с открытым исходный кодом для создания сверхбыстрых веб-серверов. Nuxt 3 (и, по желанию, Nuxt Bridge) использует Nitro в качестве своего серверного движка. Вы можете использовать `useNitro` для доступа к экземпляру Nitro, `addServerHandler` для добавления обработчика сервера, `addDevServerHandler` для добавления обработчика сервера, который будет использоваться только в режиме разработки, `addServerPlugin` для добавления плагина для расширения поведения времени выполнения Nitro, и `addPrerenderRoutes` для добавления маршрутов для предварительного рендеринга Nitro. +Nitro - это TypeScript фреймворк с открытым исходный кодом для создания сверхбыстрых веб-серверов. Nuxt 3 (и, по желанию, Nuxt Bridge) использует Nitro в качестве своего серверного движка. Вы можете использовать `useNitro` для доступа к экземпляру Nitro, `addServerHandler` для добавления обработчика сервера, `addDevServerHandler` для добавления обработчика сервера, который будет использоваться только в режиме разработки, `addServerPlugin` для добавления плагина для расширения поведения Nitro во время выполнения и `addPrerenderRoutes` для добавления маршрутов для предварительного рендеринга Nitro. ## `addServerHandler` -Добавляет обработчик сервера Nitro. Используйте его, если вы хотите создать серверное middleware или настраиваемый маршрут. +Добавляет обработчик сервера Nitro. Используйте его, если вы хотите создать серверную middleware или настраиваемый маршрут. ### Тип @@ -237,7 +237,7 @@ export default defineNuxtModule({ ## `addServerPlugin` -Добавление плагина для расширения поведения времени выполнения Nitro. +Добавление плагина для расширения runtime-поведения Nitro. ::tip Вы можете прочитать больше о плагинах Nitro в [Nitro документации](https://nitro.unjs.io/guide/plugins). @@ -281,7 +281,7 @@ export default defineNitroPlugin((nitroApp) => { }); nitroApp.hooks.hook("beforeResponse", (event, { body }) => { - console.log("при запросе", event.path, { body }); + console.log("при ответе", event.path, { body }); }); nitroApp.hooks.hook("afterResponse", (event, { body }) => { @@ -336,7 +336,7 @@ export default defineNuxtModule({ ## `addServerImportsDir` -Добавьте директорию которая будет сканироваться Nitro на предмет автоимпорта. +Добавьте директорию, которая будет сканироваться Nitro на предмет автоимпорта. ### Тип