Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions content/docs/cli/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Frozen rejects every root <code>replace</code>, even unused entries, before acce

| Command | Relevant flags |
|---------|----------------|
| <code>generate</code> | <code>--project</code> (repeatable), <code>--all</code>, <code>--workspace</code>, <code>--descriptor_set_out</code>, <code>--descriptor_set_out_dir</code>, <code>--include_imports</code> |
| <code>generate</code> | <code>--gen-config</code>, <code>--project</code> (repeatable), <code>--all</code>, <code>--workspace</code>, <code>--descriptor_set_out</code>, <code>--descriptor_set_out_dir</code>, <code>--include_imports</code> |
| <code>lint</code> | <code>--path</code> (<code>-p</code>), <code>--root</code> (<code>-r</code>) |
| <code>breaking</code> | <code>--path</code> (<code>-p</code>), <code>--root</code> (<code>-r</code>), <code>--against</code> |
| <code>init</code> | <code>--dir</code> (<code>-d</code>), <code>--module</code> |
Expand All @@ -62,7 +62,7 @@ Frozen rejects every root <code>replace</code>, even unused entries, before acce

The global flags are <code>--cfg</code> (alias <code>--config</code>, default <code>easyp.yaml</code>), <code>--debug</code> (<code>-d</code>), <code>--format</code> (<code>-f</code>, <code>text</code> or <code>json</code>), and <code>--frozen</code>. <code>EASYP_CFG</code>, <code>EASYP_DEBUG</code>, and <code>EASYP_FORMAT</code> set their respective defaults. The module cache uses <code>EASYPPATH</code> or <code>$HOME/.easyp</code>.

By default, <code>generate</code> selects the closest <code>easyp.gen.yaml</code> in the current directory or a workspace ancestor. Repeat <code>--project</code> for multiple explicit consumers. <code>--all</code> separately opts into recursive selection below the invocation directory and is mutually exclusive with <code>--project</code>. <code>--workspace</code> sets the boundary for module paths and inheritance; by default this is the nearest Git repository or enclosing EasyP files. Modules and roots come from <code>protobuf.mod</code>; <code>generate.packages</code> selects exact protobuf package names across the selected modules. The <code>generate --path</code> and <code>generate --root</code> flags are unavailable.
By default, <code>generate</code> selects the closest <code>easyp.gen.yaml</code> in the current directory or a workspace ancestor. Use <code>--gen-config private.easyp.gen.yaml</code> for one explicitly named generation file; <code>--cfg</code>/<code>--config</code> selects policy only. Repeat <code>--project</code> for multiple explicit consumers. <code>--all</code> separately opts into recursive selection below the invocation directory. <code>--gen-config</code>, <code>--project</code> and <code>--all</code> are mutually exclusive selection modes. <code>--workspace</code> sets the boundary for module paths and inheritance; by default this is the nearest Git repository or enclosing EasyP files. Modules and roots come from <code>protobuf.mod</code>; <code>generate.packages</code> selects exact protobuf package names across the selected modules. The <code>generate --path</code> and <code>generate --root</code> flags are unavailable.

<code>--descriptor_set_out</code> merges compatible graphs into one file; <code>--descriptor_set_out_dir</code> produces an independent file per project/module pair. The flags are mutually exclusive and destinations are invocation-relative. <code>--include_imports</code> defaults to false and affects exports only. <code>plugins[].with_imports</code> also defaults to false but separately enables imported code generation for an individual plugin. <code>options.go.package_prefix</code> changes Go only; full managed mode requires explicit <code>generate.managed.enabled: true</code>.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/cli/configuration.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Frozen отклоняет все корневые <code>replace</code>, даже

| Команда | Основные флаги |
|---------|----------------|
| <code>generate</code> | <code>--project</code> (повторяемый), <code>--all</code>, <code>--workspace</code>, <code>--descriptor_set_out</code>, <code>--descriptor_set_out_dir</code>, <code>--include_imports</code> |
| <code>generate</code> | <code>--gen-config</code>, <code>--project</code> (повторяемый), <code>--all</code>, <code>--workspace</code>, <code>--descriptor_set_out</code>, <code>--descriptor_set_out_dir</code>, <code>--include_imports</code> |
| <code>lint</code> | <code>--path</code> (<code>-p</code>), <code>--root</code> (<code>-r</code>) |
| <code>breaking</code> | <code>--path</code> (<code>-p</code>), <code>--root</code> (<code>-r</code>), <code>--against</code> |
| <code>init</code> | <code>--dir</code> (<code>-d</code>), <code>--module</code> |
Expand All @@ -62,7 +62,7 @@ Frozen отклоняет все корневые <code>replace</code>, даже

Общие флаги: <code>--cfg</code> (псевдоним <code>--config</code>, по умолчанию <code>easyp.yaml</code>), <code>--debug</code> (<code>-d</code>), <code>--format</code> (<code>-f</code>, <code>text</code> или <code>json</code>) и <code>--frozen</code>. Переменные <code>EASYP_CFG</code>, <code>EASYP_DEBUG</code> и <code>EASYP_FORMAT</code> задают значения по умолчанию. Кеш модулей находится в <code>EASYPPATH</code> или <code>$HOME/.easyp</code>.

По умолчанию <code>generate</code> выбирает ближайший <code>easyp.gen.yaml</code> в текущем или родительском каталоге workspace. <code>--project</code> можно повторять для нескольких явных потребителей. <code>--all</code> отдельно включает рекурсивный выбор внутри каталога запуска и несовместим с <code>--project</code>. <code>--workspace</code> задаёт границу для путей модулей и наследования; по умолчанию используется ближайший Git-репозиторий или охватывающие файлы EasyP. Модули и корни исходников берутся из <code>protobuf.mod</code>; <code>generate.packages</code> выбирает точные имена protobuf-пакетов среди выбранных модулей. Флагов <code>generate --path</code> и <code>generate --root</code> нет.
По умолчанию <code>generate</code> выбирает ближайший <code>easyp.gen.yaml</code> в текущем или родительском каталоге workspace. Для одного файла с другим именем используйте <code>--gen-config private.easyp.gen.yaml</code>; <code>--cfg</code>/<code>--config</code> выбирает только политики. <code>--project</code> можно повторять для нескольких явных потребителей. <code>--all</code> отдельно включает рекурсивный выбор внутри каталога запуска. <code>--gen-config</code>, <code>--project</code> и <code>--all</code> — взаимоисключающие режимы выбора. <code>--workspace</code> задаёт границу для путей модулей и наследования; по умолчанию используется ближайший Git-репозиторий или охватывающие файлы EasyP. Модули и корни исходников берутся из <code>protobuf.mod</code>; <code>generate.packages</code> выбирает точные имена protobuf-пакетов среди выбранных модулей. Флагов <code>generate --path</code> и <code>generate --root</code> нет.

<code>--descriptor_set_out</code> объединяет совместимые графы в один файл; <code>--descriptor_set_out_dir</code> создаёт независимый файл для каждой пары проект/модуль. Флаги взаимоисключающие, пути считаются от каталога запуска. <code>--include_imports</code> по умолчанию равен false и влияет только на экспорт. <code>plugins[].with_imports</code> также по умолчанию равен false, но отдельно включает генерацию импортов для конкретного плагина. <code>options.go.package_prefix</code> меняет только Go; полный managed mode требует явного <code>generate.managed.enabled: true</code>.

Expand Down
21 changes: 19 additions & 2 deletions content/docs/cli/generator/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,24 @@ easyp generate --workspace ../.. --project ..

<code>--project</code> is repeatable and cannot be combined with <code>--all</code>. Recursive discovery skips hidden directories, <code>easyp_vendor</code>, <code>node_modules</code>, and nested Git repositories. Select a project in a skipped directory explicitly. Automatic selection rejects a symlink configuration file; an explicit project selection is required to use it. Choosing <code>--all</code> authorizes plugins in the discovered projects, including command plugins.

The nearest Git repository, including a worktree with a <code>.git</code> file, supplies the workspace boundary. Without Git, enclosing EasyP configuration and manifest files establish the boundary; <code>--workspace</code> sets it explicitly. Project paths and descriptor destinations are relative to the invocation directory. Plugin output paths are relative to their <code>easyp.gen.yaml</code>. The command has no <code>--path</code> or <code>--root</code> flag.
The nearest Git repository, including a worktree with a <code>.git</code> file, supplies the workspace boundary. Without Git, enclosing EasyP configuration and manifest files establish the boundary; <code>--workspace</code> sets it explicitly. Project paths and descriptor destinations are relative to the invocation directory. Plugin output paths are relative to the selected generation file. The command has no <code>--path</code> or <code>--root</code> flag.

## Named generation configs

Keep profiles such as <code>private.easyp.gen.yaml</code> and <code>public.easyp.gen.yaml</code> beside the same <code>protobuf.mod</code>, then select one file with <code>--gen-config</code>:

~~~bash
easyp generate --gen-config private.easyp.gen.yaml
easyp generate --gen-config public.easyp.gen.yaml
# The selected profile can also export descriptors.
easyp generate --gen-config public.easyp.gen.yaml --descriptor_set_out build/public.pb
~~~

The flag accepts one relative or absolute file path inside the workspace. Relative paths start at the invocation directory; <code>--workspace</code> can set the boundary explicitly. The file uses the native <code>version: v1</code> generation format. Missing, empty or invalid selections fail without falling back to <code>easyp.gen.yaml</code>.

Do not combine <code>--gen-config</code> with <code>--project</code> or <code>--all</code>. Automatic selection and <code>--all</code> still discover only standard <code>easyp.gen.yaml</code> files. The global <code>--config</code>/<code>--cfg</code> flag selects a policy file and does not select a generation profile.

Colocated profiles keep the same source, module and output path rules; no directory relocation or extra <code>../</code> is needed. Plugin outputs remain relative to the selected file's directory. Options inherit from standard <code>easyp.gen.yaml</code> files in ancestor directories; a standard file in the same directory is an independent profile and is not inherited. See [profiles for one module](/docs/guides/multi-target-generation#profiles-for-one-module) for complete examples.

## Frozen generation

Expand All @@ -64,7 +81,7 @@ easyp --frozen generate --all --descriptor_set_out_dir build/descriptors

Each selected local native module must have <code>protobuf.mod</code> and <code>protobuf.lock</code>, including an empty lock without dependencies. An explicit workspace-relative path uses the selected module's files: <code>backend/easyp.gen.yaml</code> with <code>generate.modules: [proto/user]</code> validates <code>proto/user/protobuf.mod</code> and <code>proto/user/protobuf.lock</code>. The generator-only <code>backend</code> directory needs neither file. Frozen rejects all root replacements, even unused ones, and validates the locked direct and transitive graph before any plugin executes. A failure in a later selected project therefore prevents plugins in earlier projects from running. The same preflight applies to both descriptor export modes and pluginless exports.

A dependency selected by identity through <code>generate.modules</code> requires its consumer's manifest and lock; the downloaded dependency does not need its own lock. Unselected projects are ignored. <code>--frozen</code> does not change the existing <code>--project</code>/<code>--all</code> selection and plugin authorization rules.
A dependency selected by identity through <code>generate.modules</code> requires its consumer's manifest and lock; the downloaded dependency does not need its own lock. Unselected projects are ignored. <code>--frozen</code> does not change the existing <code>--gen-config</code>/<code>--project</code>/<code>--all</code> selection and plugin authorization rules.

Exact locked commits may be downloaded into the cache and are hash-verified, including on cache reuse. Manifest and lock files are never rewritten, and dependency HEAD/tags are never resolved. Frozen is explicit, not inferred from CI, and does not make remote plugins offline or pin local plugin executables. See [frozen builds](/docs/cli/package-manager#frozen-builds).

Expand Down
Loading
Loading