@vnejs/docs 0.2.80 → 0.2.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +16 -16
  2. package/architecture/backends.md +7 -7
  3. package/architecture/bridge.md +24 -0
  4. package/architecture/build.md +7 -7
  5. package/architecture/bundles.md +5 -5
  6. package/architecture/cli.md +7 -7
  7. package/architecture/configs.md +9 -9
  8. package/architecture/contracts.md +15 -13
  9. package/architecture/dependencies.md +35 -35
  10. package/architecture/editor.md +4 -4
  11. package/architecture/games.md +7 -7
  12. package/architecture/helpers.md +5 -5
  13. package/architecture/model.md +15 -14
  14. package/architecture/modules.md +35 -35
  15. package/architecture/packages.md +16 -16
  16. package/architecture/plugins.md +15 -15
  17. package/architecture/shared.md +15 -15
  18. package/architecture/uis.md +8 -8
  19. package/changelog/0.2.81.md +3 -0
  20. package/changelog/0.2.82.md +4 -0
  21. package/changelog/README.md +2 -0
  22. package/manifest.json +1 -1
  23. package/package.json +1 -1
  24. package/plugins/controls/cursor.md +1 -1
  25. package/plugins/controls/gamepad.md +2 -2
  26. package/plugins/scenario/choose.md +14 -14
  27. package/plugins/scenario/fastforward.md +1 -1
  28. package/plugins/scenario/history.md +7 -7
  29. package/plugins/scenario/point_and_click.md +5 -5
  30. package/plugins/scenario/qte.md +17 -10
  31. package/plugins/text/smooth.md +4 -4
  32. package/plugins/text/text.md +10 -10
  33. package/plugins/views.scenario/choose.md +1 -1
  34. package/plugins/views.scenario/interface.md +8 -8
  35. package/plugins/views.scenario/point_and_click.md +4 -4
  36. package/plugins/views.scenario/qte.md +5 -5
  37. package/scenario.guide/choose.md +1 -1
  38. package/scenario.guide/qte-random.md +1 -1
  39. package/architecture/compatibility.md +0 -22
package/README.md CHANGED
@@ -32,21 +32,21 @@ The package has two scenario entries. Compare them and pick one. Both link to `p
32
32
 
33
33
  ## Monorepo map
34
34
 
35
- | Directory | Role |
36
- | --------------------------------------------------- | ------------------------------------------ |
37
- | [`packages/`](./architecture/packages.md) | Runtime: `registry`, `observer`, `core`, … |
38
- | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
- | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
- | [`contracts/`](./architecture/contracts.md) | Public plugin API |
41
- | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
- | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
- | [`compatibility/`](./architecture/compatibility.md) | Link between plugins |
44
- | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
- | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
- | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
- | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
- | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
- | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
- | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
35
+ | Directory | Role |
36
+ | -------------------------------------------------- | ------------------------------------------ |
37
+ | [`packages/`](./architecture/packages.md) | Runtime: `registry`, `observer`, `core`, … |
38
+ | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
+ | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
+ | [`contracts/`](./architecture/contracts.md) | Public API of plugins and bridge |
41
+ | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
+ | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
+ | [`bridge/`](./architecture/bridge.md) | Link between plugins |
44
+ | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
+ | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
+ | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
+ | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
+ | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
+ | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
+ | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
51
51
 
52
52
  A game imports one `bundles/` package and gets `VneCore`, the engine entry. That bundle lists the matching `@vnejs/shared.*` package in `dependencies`. Menu factories still come from `@vnejs/shared.*` in the game script.
@@ -1,18 +1,18 @@
1
1
  # backends/
2
2
 
3
- **Отдельные Cloudflare Workers** — не плагины и не часть `VneCore`. Игра ходит к ним по HTTP. Пакеты в `plugins/` их не импортируют.
3
+ **Separate Cloudflare Workers.** Not plugins and not part of `VneCore`. The game calls them over HTTP. Packages in `plugins/` do not import them.
4
4
 
5
- | Пакет | Назначение |
6
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
7
- | **`backends/auth`** | Steam OpenID и проверка покупки своего AppID. Отдаёт подписанный JWT (`steamId`, `ownsApp`, `exp`). |
8
- | **`backends/content`** | `GET /label/*` — JSON меток из `dist/label`. Пускает только запрос с тем же JWT и `ownsApp`. Картинки и `mods.json` не отдаёт. |
5
+ | Package | Role |
6
+ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | **`backends/auth`** | Steam OpenID and a check that the user owns this AppID. Returns a signed JWT (`steamId`, `ownsApp`, `exp`). |
8
+ | **`backends/content`** | `GET /label/*` — label JSON from `dist/label`. Allows only a request with that JWT and `ownsApp`. Does not serve images or `mods.json`. |
9
9
 
10
- Оба воркера знают один `AUTH_SECRET`. Контент-воркер Steam не вызывает. Каталог ассетов при деплое указывает на `dist` игры, сами JSON в репозиторий воркера не копируются. Закрытый деплой не кладёт то же дерево `label/` рядом со статикой игры.
10
+ Both workers share one `AUTH_SECRET`. The content worker does not call Steam. On deploy, the asset catalog points at the game `dist`. The worker repo does not copy those JSON files. A closed deploy does not put the same `label/` tree next to the game static files.
11
11
 
12
12
  ```mermaid
13
13
  flowchart LR
14
14
  Game[games/] -->|popup OpenID| Auth[backends/auth]
15
15
  Auth --> Steam[steamcommunity.com]
16
16
  Game -->|GET /label Bearer| Content[backends/content]
17
- Auth -.->|общий AUTH_SECRET| Content
17
+ Auth -.->|shared AUTH_SECRET| Content
18
18
  ```
@@ -0,0 +1,24 @@
1
+ # bridge/
2
+
3
+ **Optional integration** between independent plugins. A `bundles/` package turns it on. It is not hard-wired inside `plugins/`.
4
+
5
+ - One module. It extends `ModuleCore`. The class lives in `src/modules/`. `src/index.ts` only imports and calls `regPlugin`.
6
+ - In **`subscribe`** it listens to A and emits B.
7
+ - A contract in `contracts/bridge/` mirrors this package. `PLUGIN_NAME` is the namespace `BRIDGE_PLUGIN_{PLUGIN_NAME_1}_PLUGIN_{PLUGIN_NAME_2}`.
8
+ - **`regPlugin`** takes the shape from that contract. The shape is empty when the bridge adds no constants, events, params, or settings. When it owns some, it passes those fields. The choose↔qte bridge passes `constants` and extends `ChooseOption` with `qte`.
9
+ - It depends on its contract and on the contracts of the plugins it links. It does not import implementations from `plugins/`.
10
+
11
+ Naming: `@vnejs/bridge.plugins.{package-1}.plugins.{package-2}` → path `bridge/plugins.{package-1}/plugins.{package-2}/`. The contract is `@vnejs/contracts.bridge.plugins.{package-1}.plugins.{package-2}` at `contracts/bridge/plugins.{package-1}/plugins.{package-2}/`. The two segments are the real plugin package names, without the `@vnejs/` scope.
12
+
13
+ ```mermaid
14
+ flowchart LR
15
+ PA[plugins/ A] -->|"emit EVENT_A"| OBS[Observer]
16
+ OBS --> BR[bridge/]
17
+ BR -->|"emit EVENT_B"| OBS
18
+ OBS --> PB[plugins/ B]
19
+
20
+ PA -.->|"does not import"| PB
21
+ BR --> CT[contracts/bridge]
22
+ BR --> CTA[contracts/ A]
23
+ BR --> CTB[contracts/ B]
24
+ ```
@@ -1,15 +1,15 @@
1
- # Сборка end-to-end
1
+ # End-to-end build
2
2
 
3
3
  ```mermaid
4
4
  flowchart TD
5
- subgraph repo ["Монорепозиторий"]
5
+ subgraph repo ["Monorepo"]
6
6
  CFG[configs/]
7
7
  PKG[packages/]
8
8
  ME[modules_extensions/]
9
9
  CT[contracts/]
10
10
  SH[shared/]
11
11
  PL[plugins/]
12
- CP[compatibility/]
12
+ CP[bridge/]
13
13
  BD[bundles/]
14
14
  CL[cli/]
15
15
  end
@@ -34,7 +34,7 @@ flowchart TD
34
34
  ART --> PLAY[Browser / Electron]
35
35
  ```
36
36
 
37
- 1. `bundles/` регистрирует `plugins/` и `compatibility/` в `VNE` и записывает соответствующий `@vnejs/shared.*` в `dependencies`. Фабрики из `shared/` импортирует скрипт игры.
38
- 2. `cli/` собирает сценарий в JSON и клиент в `dist/`.
39
- 3. `new VneCore().init()` — модули, media, lifecycle до `start`.
40
- 4. Игра живёт на событиях шины; cross-plugin связи — через `compatibility/` из `bundles/`.
37
+ 1. `bundles/` registers `plugins/` and `bridge/` in `VNE` and lists the matching `@vnejs/shared.*` in `dependencies`. The game script imports factories from `shared/`.
38
+ 2. `cli/` builds the scenario to JSON and the client to `dist/`.
39
+ 3. `new VneCore().init()` — modules, media, and the lifecycle up to `start`.
40
+ 4. The game runs on bus events. Cross-plugin links go through `bridge/` from `bundles/`.
@@ -1,10 +1,10 @@
1
1
  # bundles/
2
2
 
3
- **Композиция** без бизнес-логики — цепочка side-effect импортов из `plugins/` и `compatibility/`.
3
+ **Composition** with no business logic. A chain of side-effect imports from `plugins/` and `bridge/`.
4
4
 
5
- - Определяет **набор возможностей** для `games/`.
6
- - Экспортирует **`VneCore`**.
7
- - Бандл, который включает плагин, записывает соответствующий **`@vnejs/shared.*`** в `dependencies`. Исходники фабрики не импортируют и не реэкспортируют. Их импортирует скрипт игры.
5
+ - Sets the **ability set** for `games/`.
6
+ - Exports **`VneCore`**.
7
+ - A bundle that includes a plugin lists the matching **`@vnejs/shared.*`** in `dependencies`. Bundle source does not import or re-export the factories. The game script imports them.
8
8
 
9
9
  ```mermaid
10
10
  flowchart BT
@@ -17,4 +17,4 @@ flowchart BT
17
17
  CORE --> CANVAS --> SKEL --> BASE --> GAME
18
18
  ```
19
19
 
20
- Entry point: re-export `VneCore` → импорт `plugins/` → импорт `compatibility/`.
20
+ Entry point: re-export `VneCore` → import `plugins/` → import `bridge/`.
@@ -1,6 +1,6 @@
1
1
  # cli/
2
2
 
3
- **CLI** для монорепы и сборки `games/` (`npx @vnejs/*`).
3
+ **CLI** for the monorepo and for building `games/` (`npx @vnejs/*`).
4
4
 
5
5
  ```mermaid
6
6
  flowchart LR
@@ -9,17 +9,17 @@ flowchart LR
9
9
  DS["@vnejs/desktop"]
10
10
  TL["@vnejs/tools"]
11
11
 
12
- MR --> WS[workspace-пакеты]
12
+ MR --> WS[workspace packages]
13
13
  BD --> G[games/]
14
14
  DS --> G
15
15
  TL --> G
16
16
  ```
17
17
 
18
- | CLI | Роль |
18
+ | CLI | Role |
19
19
  | --------------------- | ----------------------------------------------------------------------------------- |
20
20
  | **`@vnejs/monorepo`** | `build`, `package`, `publish`, `bump`, `sync-deps`, `graph`, `run-changed`, `clear` |
21
- | **`@vnejs/build`** | **`data`** — `game/` → JSON в `dist/`; **`client`** — Vite entry → `dist/` |
22
- | **`@vnejs/desktop`** | **`web`** — static-сервер для `dist/` |
23
- | **`@vnejs/tools`** | Resize image/video/audio, контент-пайплайн |
21
+ | **`@vnejs/build`** | **`data`** — `game/` → JSON in `dist/`; **`client`** — Vite entry → `dist/` |
22
+ | **`@vnejs/desktop`** | **`web`** — a static server for `dist/` |
23
+ | **`@vnejs/tools`** | Resize image, video, and audio. Content pipeline |
24
24
 
25
- Корень: `npm run build` → monorepo build; **Turbo** кэширует `build` с `dependsOn: ["^build"]`.
25
+ Root: `npm run build` → monorepo build. **Turbo** caches `build` with `dependsOn: ["^build"]`.
@@ -1,19 +1,19 @@
1
1
  # configs/
2
2
 
3
- **Общие конфигурации сборки** — переиспользуемые TypeScript-настройки, не runtime.
3
+ **Shared build configs.** Reusable TypeScript settings. Not runtime.
4
4
 
5
- | Пакет | Назначение |
6
- | ------------------------------ | ------------------------------------------------------------------------------------- |
7
- | **`@vnejs/configs.ts-common`** | tsconfig для `plugins/`, `contracts/`, `packages/`, `modules_extensions/`, `helpers/`, `shared/` |
8
- | **`@vnejs/configs.ts-uis`** | tsconfig для `uis/react/` и view-кода `games/` (JSX, React-типы) |
9
- | **`@vnejs/configs.vitest`** | Общий Vitest-конфиг (`create-config.js`, `setup.js`) для пакетов с тестами |
5
+ | Package | Role |
6
+ | ------------------------------ | ------------------------------------------------------------------------------------------------ |
7
+ | **`@vnejs/configs.ts-common`** | tsconfig for `plugins/`, `bridge/`, `contracts/`, `packages/`, `modules_extensions/`, `helpers/`, `shared/` |
8
+ | **`@vnejs/configs.ts-uis`** | tsconfig for `uis/react/` and view code in `games/` (JSX, React types) |
9
+ | **`@vnejs/configs.vitest`** | Shared Vitest config (`create-config.js`, `setup.js`) for packages with tests |
10
10
 
11
11
  ```mermaid
12
12
  flowchart LR
13
- TC[configs.ts-common] --> PL[plugins/ / contracts/ / packages/ / shared/]
13
+ TC[configs.ts-common] --> PL[plugins/ / bridge/ / contracts/ / packages/ / shared/]
14
14
  TU[configs.ts-uis] --> UI[uis/react/]
15
15
  TU --> GM[games/]
16
- TV[configs.vitest] --> TEST[пакеты с vitest]
16
+ TV[configs.vitest] --> TEST[packages with vitest]
17
17
  ```
18
18
 
19
- Пакеты `ts-*` экспортируют json; локальный `tsconfig.json` пакета **extends** общий и задаёт `rootDir` / `outDir`. Vitest-конфиг — JS-хелперы, не tsconfig.
19
+ `ts-*` packages export JSON. A package `tsconfig.json` **extends** the shared one and sets `rootDir` / `outDir`. The Vitest config is JS helpers, not a tsconfig.
@@ -1,30 +1,32 @@
1
1
  # contracts/
2
2
 
3
- **Контракт** — публичный API одного плагина: **спецификация**, не поведение.
3
+ A **contract** is the public API of one plugin or one bridge. It is a **specification**, not behavior.
4
4
 
5
- ### Что входит в контракт
5
+ ### What a contract holds
6
6
 
7
- - **`PLUGIN_NAME`** — namespace в реестре `VNE`.
8
- - **`CONSTANTS`**, **`SUBSCRIBE_EVENTS`**, **`PARAMS`**, **`SETTINGS_KEYS`**.
9
- - **Типы** — payload событий, shape глобального state, shared-поля.
7
+ - **`PLUGIN_NAME`** — the namespace in the `VNE` registry.
8
+ - **`CONSTANTS`**, **`SUBSCRIBE_EVENTS`**, **`PARAMS`**, **`SETTINGS_KEYS`** — when that package owns them.
9
+ - **Types** — event payloads, the shape of global state, shared fields.
10
10
 
11
11
  ### TypeScript augmentation
12
12
 
13
- Контракт расширяет типы через `declare module`:
13
+ A contract extends types through `declare module`:
14
14
 
15
15
  - `@vnejs/registry` — `VnePluginEventsMap`, `VnePluginConstantsMap`, …
16
16
  - `@vnejs/module` — `ModuleGlobalState`, `ModuleShared`
17
- - другие контракты — при cross-cutting типах
17
+ - other contracts — for cross-cutting types
18
18
 
19
- ### Принципы
19
+ ### Principles
20
20
 
21
- - Один контракт обычно соответствует **одному плагину** в `plugins/` (1:1).
22
- - Контракт **не импортирует** реализацию из `plugins/`.
23
- - Доменная структура `contracts/` зеркалит таксономию `plugins/`.
21
+ - One contract matches **one plugin** in `plugins/` or **one bridge** in `bridge/` (1:1).
22
+ - A contract **does not import** an implementation from `plugins/` or `bridge/`.
23
+ - Plugin contracts mirror the `plugins/` taxonomy (`contracts/text/text/` for `plugins/text/text/`).
24
+ - Bridge contracts live under `contracts/bridge/` and mirror the `bridge/` path.
24
25
 
25
26
  ```mermaid
26
27
  flowchart LR
27
- CT[contracts/] -->|"declare module"| TS[Типы VNE / Module]
28
- CT -->|"CONSTANTS, EVENTS, PARAMS"| REG[regPlugin при загрузке plugins/]
28
+ CT[contracts/] -->|"declare module"| TS[VNE / Module types]
29
+ CT -->|"CONSTANTS, EVENTS, PARAMS"| REG[regPlugin when plugins/ or bridge/ load]
29
30
  PL[plugins/] -->|"import"| CT
31
+ BR[bridge/] -->|"import"| CT
30
32
  ```
@@ -1,4 +1,4 @@
1
- # Граф зависимостей между каталогами
1
+ # Dependency graph between directories
2
2
 
3
3
  ```mermaid
4
4
  flowchart TD
@@ -6,7 +6,7 @@ flowchart TD
6
6
  G --> CLI[cli/]
7
7
  G -.->|HTTP| BE[backends/]
8
8
  B --> P[plugins/]
9
- B --> C[compatibility/]
9
+ B --> C[bridge/]
10
10
  B --> SH[shared/]
11
11
  G --> SH
12
12
  SH --> CT[contracts/]
@@ -20,42 +20,42 @@ flowchart TD
20
20
  CFG[configs/] --> P
21
21
  CFG --> PKG
22
22
  CFG --> U
23
- VSC[vs_code_extensions/] -.->|"подсветка .vne"| G
23
+ VSC[vs_code_extensions/] -.->|".vne highlight"| G
24
24
  ```
25
25
 
26
- **Направление зависимостей:**
26
+ **Dependency direction:**
27
27
 
28
- | От | К | Смысл |
29
- | ---------------- | ----------------------------------- | -------------------------------------------------------------------------------------- |
30
- | `games/` | `bundles/`, `cli/`, `shared/` | Сборка через `cli/`. Фабрики `shared/` импортирует скрипт, без записи в `package.json` |
31
- | `games/` | `backends/` | HTTP к воркерам токена и меток, без импорта пакетов |
32
- | `bundles/` | `plugins/`, `compatibility/` | Набор плагинов |
33
- | `bundles/` | `shared/` | `@vnejs/shared.*` в `dependencies` бандла с этим плагином. Фабрики не реэкспортирует |
34
- | `shared/` | `contracts/` | Фабрики настройки читают события, не реализации |
35
- | `plugins/` | `contracts/` | Реализация следует объявленному API |
36
- | `plugins/` | `modules_extensions/` → `packages/` | Модули наследуют базы, базы опираются на registry/observer |
37
- | `compatibility/` | `contracts/` (2+) | Связка по событиям, без импорта реализаций |
38
- | `plugins/` | `helpers/`, `uis/` | Горизонтальные утилиты и UI |
39
- | `plugins/` | — другой `plugins/` | **Напрямую не зависит** |
40
- | `configs/` | пакеты workspace | Общие tsconfig, не runtime |
28
+ | From | To | Meaning |
29
+ | ---------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
30
+ | `games/` | `bundles/`, `cli/`, `shared/` | Build goes through `cli/`. The game script imports `shared/` factories. The game `package.json` does not list them |
31
+ | `games/` | `backends/` | HTTP to the token and label workers. No package import |
32
+ | `bundles/` | `plugins/`, `bridge/` | The plugin set |
33
+ | `bundles/` | `shared/` | The bundle lists `@vnejs/shared.*` in `dependencies` when it includes that plugin. The bundle does not re-export factories |
34
+ | `shared/` | `contracts/` | Setup factories read events, not implementations |
35
+ | `plugins/` | `contracts/` | The implementation follows the declared API |
36
+ | `plugins/` | `modules_extensions/` → `packages/` | Modules extend bases. Bases rest on registry and observer |
37
+ | `bridge/` | `contracts/` | Its contract in `contracts/bridge/`, plus the plugin contracts it links. No import of implementations |
38
+ | `plugins/` | `helpers/`, `uis/` | Shared utils and UI |
39
+ | `plugins/` | — another `plugins/` | **No direct dependency** |
40
+ | `configs/` | workspace packages | Shared tsconfig. Not runtime |
41
41
 
42
- ## Резюме
42
+ ## Summary
43
43
 
44
- | Каталог | Одной фразой |
45
- | ------------------------- | --------------------------------- |
46
- | **`packages/`** | Реестр, шина, VneCore |
47
- | **`modules_extensions/`** | Базовые классы модулей |
48
- | **`configs/`** | Общие tsconfig |
49
- | **`contracts/`** | API плагина: события, типы |
50
- | **`shared/`** | Пресеты настройки плагинов |
51
- | **`plugins/`** | Реализация на шине |
52
- | **`compatibility/`** | Opt-in связка двух плагинов |
53
- | **`bundles/`** | Набор способностей для игры |
54
- | **`helpers/`** | Утилиты без движка |
55
- | **`uis/`** | React/UI для view |
56
- | **`cli/`** | Сборка монорепы и игр |
57
- | **`games/`** | Сценарий + entry + dist |
58
- | **`backends/`** | Workers: токен Steam и JSON меток |
59
- | **`vs_code_extensions/`** | Подсветка `.vne` |
44
+ | Directory | In one line |
45
+ | ------------------------- | ----------------------------------- |
46
+ | **`packages/`** | Registry, bus, VneCore |
47
+ | **`modules_extensions/`** | Base classes for modules |
48
+ | **`configs/`** | Shared tsconfig |
49
+ | **`contracts/`** | Plugin and bridge API |
50
+ | **`shared/`** | Plugin setup presets |
51
+ | **`plugins/`** | Behavior on the bus |
52
+ | **`bridge/`** | Opt-in link between two plugins |
53
+ | **`bundles/`** | A set of abilities for a game |
54
+ | **`helpers/`** | Utils with no engine tie |
55
+ | **`uis/`** | React UI for views |
56
+ | **`cli/`** | Build the monorepo and the games |
57
+ | **`games/`** | Scenario, entry, and dist |
58
+ | **`backends/`** | Workers: Steam token and label JSON |
59
+ | **`vs_code_extensions/`** | `.vne` highlight |
60
60
 
61
- **Главное правило:** `plugins/` не знают друг о друге; интеграция — через события по `contracts/` и явный `compatibility/` в `bundles/`.
61
+ **Main rule:** `plugins/` do not know each other. Integration goes through events in `contracts/` and an explicit `bridge/` package in `bundles/`.
@@ -1,7 +1,7 @@
1
1
  # vs_code_extensions/
2
2
 
3
- **Расширения редактора** для формата сценария — не runtime.
3
+ **Editor extensions** for the scenario format. Not runtime.
4
4
 
5
- | Расширение | Назначение |
6
- | --------------------- | -------------------------------------------------- |
7
- | **`@vnejs/language`** | Подсветка **`.vne`** в `games/*/game/**/scenario/` |
5
+ | Extension | Role |
6
+ | --------------------- | --------------------------------------------------- |
7
+ | **`@vnejs/language`** | Highlight **`.vne`** in `games/*/game/**/scenario/` |
@@ -1,16 +1,16 @@
1
1
  # games/
2
2
 
3
- **Проекты игр** — потребители `bundles/` + `cli/`.
3
+ **Game projects.** They consume `bundles/` and `cli/`.
4
4
 
5
5
  ```
6
6
  games/<name>/
7
- ├── entry/ # index.ts, index.html → импорт bundles/, new VneCore()
7
+ ├── entry/ # index.ts, index.html → import bundles/, new VneCore()
8
8
  ├── game/<mod>/ # scenario (.vne), scripts, media, public
9
9
  ├── desktop/ # Electron dev/prod
10
- ├── dist/ # JSON + JS после сборки
10
+ ├── dist/ # JSON + JS after the build
11
11
  │ ├── mods.json
12
- │ ├── label/ # label/<path>.json (например label/prologue/1.json)
13
- │ └── media_info/ # media_info/<mod>.json (не путать с /media/ ассетов)
12
+ │ ├── label/ # label/<path>.json (for example label/prologue/1.json)
13
+ │ └── media_info/ # media_info/<mod>.json (not the /media/ assets)
14
14
  └── package.json
15
15
  ```
16
16
 
@@ -31,8 +31,8 @@ flowchart LR
31
31
  SRV --> RUN
32
32
  ```
33
33
 
34
- 1. **`build:data`** — JSON для **`VneCore.init()`**: `mods.json`, `label/<path>.json`, `media_info/<mod>.json`.
34
+ 1. **`build:data`** — JSON for **`VneCore.init()`**: `mods.json`, `label/<path>.json`, `media_info/<mod>.json`.
35
35
  2. **`build:client`** — Vite + `bundles/`.
36
36
  3. **`entry/`** — `new VneCore()`, `await init()`.
37
37
 
38
- `games/` **не собирает** `plugins/` — выбирает `bundles/` и добавляет контент.
38
+ `games/` **do not build** `plugins/`. A game picks a `bundles/` package and adds content.
@@ -1,14 +1,14 @@
1
1
  # helpers/
2
2
 
3
- **Чистые утилиты** вне event-архитектуры.
3
+ **Plain utils** outside the event architecture.
4
4
 
5
- - **`helpers/primitives/`** — атомарные функции (`tokenize-*`, `get-id`, `to-json`, …).
6
- - **`helpers/composites/`** — составные утилиты поверх primitives (например `call-all-promises`).
7
- - **`helpers/base/`** — barrel **`@vnejs/helpers`** (реэкспорт primitives и composites).
5
+ - **`helpers/primitives/`** — atomic functions (`tokenize-*`, `get-id`, `to-json`, …).
6
+ - **`helpers/composites/`** — composite utils on top of primitives (for example `call-all-promises`).
7
+ - **`helpers/base/`** — barrel **`@vnejs/helpers`** (re-exports primitives and composites).
8
8
 
9
9
  ```mermaid
10
10
  flowchart LR
11
11
  H[helpers/] --> P[plugins/]
12
12
  H --> CORE[VneCore]
13
- H -.->|"не связан"| VNE[(VNE / Observer)]
13
+ H -.->|"no tie"| VNE[(VNE / Observer)]
14
14
  ```
@@ -1,20 +1,20 @@
1
- # Архитектура монорепозитория VNEJS
1
+ # VNEJS monorepo architecture
2
2
 
3
- Документ описывает **общую модель** монорепозитория: каталоги движка, направление зависимостей и сборку игры. Конкретные пакеты не перечисляются — только принципы и связи.
3
+ This file describes the **shared model** of the monorepo: engine directories, dependency direction, and how a game is built. It does not list concrete packages. It states principles and links.
4
4
 
5
- ## Суть модели
5
+ ## Model
6
6
 
7
- Движок построен на **событийной шине** и **глобальном реестре**:
7
+ The engine is an **event bus** and a **global registry**:
8
8
 
9
- - **`Observer`** — шина событий; модули подписываются (`on`) и публикуют (`emit`) по строковым ключам.
10
- - **`VNE`** — реестр, заполняемый при загрузке: `CONST`, `EVENTS`, `SETTINGS`, `PARAMS` — по namespace каждого плагина.
11
- - **`VneCore`** — runtime: собирает зарегистрированные модули, инжектит зависимости и запускает lifecycle (`inject → subscribe → setup → init → start`).
9
+ - **`Observer`** — the event bus. Modules subscribe (`on`) and publish (`emit`) by string keys.
10
+ - **`VNE`** — the registry, filled at load: `CONST`, `EVENTS`, `SETTINGS`, `PARAMS`, one namespace per plugin.
11
+ - **`VneCore`** — the runtime. It builds registered modules, injects dependencies, and runs the lifecycle (`inject → subscribe → setup → init → start`).
12
12
 
13
- Регистрация происходит **side-effect импортами** — при импорте пакета код сразу вызывает `regPlugin` или `regModule`, не дожидаясь явного вызова API.
13
+ Registration is a **side effect of import**. On import, the package calls `regPlugin` or `regModule` at once. It does not wait for an explicit API call.
14
14
 
15
15
  ```mermaid
16
16
  flowchart LR
17
- subgraph load ["Загрузка bundles/"]
17
+ subgraph load ["Load bundles/"]
18
18
  I[side-effect import]
19
19
  RP[regPlugin / regModule]
20
20
  VNE[(VNE + VNE_MODULES)]
@@ -24,21 +24,22 @@ flowchart LR
24
24
  subgraph runtime ["Runtime"]
25
25
  VC[VneCore]
26
26
  OBS[Observer]
27
- VC -->|"создаёт модули из VNE_MODULES"| MOD[Модули]
27
+ VC -->|"creates modules from VNE_MODULES"| MOD[Modules]
28
28
  MOD -->|"on / emit"| OBS
29
- MOD -->|"читает"| VNE
29
+ MOD -->|"reads"| VNE
30
30
  end
31
31
 
32
32
  VNE --> VC
33
33
  ```
34
34
 
35
- ## Именование npm-пакетов
35
+ ## npm package names
36
36
 
37
37
  ```
38
38
  plugins/core/system/ → @vnejs/plugins.core.system
39
39
  contracts/text/text/ → @vnejs/contracts.text
40
+ contracts/bridge/plugins.text/plugins.scenario.autoread/ → @vnejs/contracts.bridge.plugins.text.plugins.scenario.autoread
40
41
  shared/views.screens/gamemenu/ → @vnejs/shared.views.screens.gamemenu
41
- compatibility/text/scenario.autoread/ → @vnejs/compatibility.text-with-scenario.autoread
42
+ bridge/plugins.text/plugins.scenario.autoread/ → @vnejs/bridge.plugins.text.plugins.scenario.autoread
42
43
  ```
43
44
 
44
- Слеш в пути → точка в имени; `compatibility/` — суффикс **`-with-`**.
45
+ A slash in the path becomes a dot in the name. `bridge/` repeats `plugins.` so the two plugin packages stay visible.