@kurot/cli 3.6.1 → 3.7.0
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.
- package/CHANGELOG.md +74 -2
- package/README.md +36 -120
- package/dist/core/config.d.ts +6 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +3 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/plugins/index.d.ts +2 -1
- package/dist/core/plugins/index.d.ts.map +1 -1
- package/dist/core/plugins/index.js +4 -1
- package/dist/core/plugins/index.js.map +1 -1
- package/dist/core/plugins/version-assets.d.ts +7 -0
- package/dist/core/plugins/version-assets.d.ts.map +1 -0
- package/dist/core/plugins/version-assets.js +108 -0
- package/dist/core/plugins/version-assets.js.map +1 -0
- package/docs/ai-context.md +37 -58
- package/docs/architecture.md +10 -2
- package/docs/default-ui-skins.md +12 -23
- package/docs/dev-resource-watching.md +2 -3
- package/docs/game-template.md +10 -29
- package/docs/label-text-layout.md +13 -15
- package/docs/release-assets.md +76 -0
- package/docs/text-components.md +3 -7
- package/package.json +3 -2
- package/templates/game/src/Main.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,9 +7,77 @@ and CLI command/configuration APIs follow [Semantic Versioning](https://semver.o
|
|
|
7
7
|
The early KUI XML contract follows the pre-1.0 `ui-document` kernel; authored
|
|
8
8
|
format changes are documented explicitly in each release.
|
|
9
9
|
|
|
10
|
+
## 3.7.0 — 2026-10-27
|
|
11
|
+
|
|
12
|
+
Prepared for publication; not yet published.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Optional `output.versionedAssets` release packaging: place runtime files in
|
|
17
|
+
`assets/<content-hash>/` and emit an HTML base URL, covering same-name resource
|
|
18
|
+
updates, generated themes, atlas/font pages and page-shell assets. Identical
|
|
19
|
+
output reuses the version; development and existing configurations keep their
|
|
20
|
+
paths. Root manifest and reported script paths use the version prefix.
|
|
21
|
+
- Validate the option and reject conflicting HTML base elements before moving
|
|
22
|
+
output. Add regressions for same-name replacements, deterministic versions,
|
|
23
|
+
generated KUI, shell/script changes and disabled/development builds.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- The game starter resolves its Theme URL against document.baseURI so compiled
|
|
28
|
+
skin imports follow the selected release directory with existing UI runtimes.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Parse release HTML with parse5 before inserting the versioned base URL.
|
|
33
|
+
Preserve quoted attribute values containing greater-than signs and ignore
|
|
34
|
+
base-like text in scripts/styles. Keep the authored template intact, require
|
|
35
|
+
an explicit head and reject actual conflicting base elements.
|
|
36
|
+
|
|
37
|
+
### Compatibility and adoption
|
|
38
|
+
|
|
39
|
+
- This minor release adds an opt-in configuration field. The default paths,
|
|
40
|
+
development/watch behavior, commands and KUI/resource formats retain their
|
|
41
|
+
existing contracts. ui-document remains ^0.13.0; Core/UI and other SDKs need
|
|
42
|
+
no new release or higher peer minima.
|
|
43
|
+
- Add parse5 ^7.3.0 as a CLI dependency for HTML parsing. Its entities dependency
|
|
44
|
+
supports the CLI's Node.js >= 20 baseline; it is not shipped in game bundles.
|
|
45
|
+
- Projects enabling versioning need CLI >= 3.7.0 within 3.x, an absolute Theme
|
|
46
|
+
config URL based on document.baseURI and the deployment rules in
|
|
47
|
+
docs/release-assets.md. Existing projects may keep versioning disabled.
|
|
48
|
+
- demo/game use ^3.3.1, and the selected Tentax/MilfMaster templates use ^3.6.0;
|
|
49
|
+
these ranges accept 3.7.0 as optional installation/lock adoption. Star Catcher
|
|
50
|
+
pins 3.3.1, and Editor/Studio pin 3.6.1; adopting this feature requires explicit
|
|
51
|
+
declaration updates. Their installations/locks are unchanged by preparation.
|
|
52
|
+
- Bundled template latest placeholders remain; create records the running CLI's
|
|
53
|
+
version range. New scaffolds from 3.7.0 receive the Theme URL correction.
|
|
54
|
+
Other SDK peers/development locks and unrelated applications are unaffected.
|
|
55
|
+
|
|
56
|
+
### Adoption
|
|
57
|
+
|
|
58
|
+
- MilfMaster enables versioning using a committed pnpm patch to its installed
|
|
59
|
+
registry CLI 3.6.0. The patch carries the release feature without upgrading
|
|
60
|
+
runtime SDKs or depending on another checkout. No npm publication is claimed.
|
|
61
|
+
|
|
62
|
+
### Verification — 2026-10-27
|
|
63
|
+
|
|
64
|
+
- Clean CLI build and all 25 test files / 132 tests pass with maxWorkers=1,
|
|
65
|
+
including quoted HTML attributes, script/style text, release process
|
|
66
|
+
configuration and generated KUI output. git diff --check passes. An earlier
|
|
67
|
+
parallel run hit a resource-watch batch-reason assertion; its isolated rerun
|
|
68
|
+
and subsequent full runs passed.
|
|
69
|
+
- The packed 3.7.0 archive contains 239 entries, including the compiled version
|
|
70
|
+
plugin, release deployment guide and corrected game starter. Its metadata
|
|
71
|
+
declares parse5 ^7.3.0 and the unchanged ui-document ^0.13.0 requirement.
|
|
72
|
+
- MilfMaster's same-browser-cache fixture keeps its old immutable response
|
|
73
|
+
cached while the next deployment loads the changed resource, atlas page and
|
|
74
|
+
font through a new version directory; uncached old-version lazy loads remain
|
|
75
|
+
available. Actual minified game startup passes on WebGL and Canvas.
|
|
76
|
+
|
|
10
77
|
## 3.6.1 — 2026-10-18
|
|
11
78
|
|
|
12
|
-
|
|
79
|
+
Published; verified on npm on 2026-10-18, including latest, downloaded tarball
|
|
80
|
+
SHA-512 integrity and all 234 files matching prepared commit 46459e97.
|
|
13
81
|
|
|
14
82
|
### Fixed
|
|
15
83
|
|
|
@@ -36,13 +104,17 @@ Prepared locally; not published.
|
|
|
36
104
|
- Command/configuration APIs, KUI format and runtime Skin output are unchanged.
|
|
37
105
|
ui-document remains ^0.13.0, locked to registry 0.13.0; no Core/UI dependency
|
|
38
106
|
or other dependency/lock update is added.
|
|
39
|
-
- To receive the declaration correction
|
|
107
|
+
- To receive the declaration correction, update the project's
|
|
40
108
|
CLI installation/lock and rebuild to regenerate .kurot/skin-parts.d.ts.
|
|
41
109
|
Published 3.6.0 keeps the old property form. Core/UI runtime upgrades are not
|
|
42
110
|
required for this fix; existing compatible application ranges remain valid.
|
|
43
111
|
- New scaffolds receive README/AGENTS entries. Existing games retain their own
|
|
44
112
|
instructions, resources and directories. Template latest placeholders remain
|
|
45
113
|
unchanged; UI 3.6.2 is needed only to read the new bundled UI guides.
|
|
114
|
+
- Kurot-Studio adopts exact registry CLI 3.6.1 with a matching lock in commit
|
|
115
|
+
048e5c1. Its application build and complete check (175 files / 1,451 tests)
|
|
116
|
+
pass; other direct/transitive dependencies and game installations are unchanged.
|
|
117
|
+
The application has not been published.
|
|
46
118
|
|
|
47
119
|
### Verification
|
|
48
120
|
|
package/README.md
CHANGED
|
@@ -1,94 +1,21 @@
|
|
|
1
1
|
# @kurot/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Build-time KUI XML → ESM Skin compilation, game scaffolding and development
|
|
4
|
+
resource watching. Package version: **3.7.0** (prepared for publication).
|
|
5
|
+
Requires Node.js >= 20 and
|
|
6
|
+
ui-document **^0.13.0**; games supply their own Core/UI runtime packages.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
> **Current version: 3.6.1 (prepared; not published).** Requires `@kurot/ui-document@^0.13.0`
|
|
12
|
-
> and Node.js 20 or later. The CLI runs only at build time.
|
|
13
|
-
|
|
14
|
-
> **Release scope:** The 3.x line is dedicated to Kurot Editor integration.
|
|
15
|
-
> Existing game projects that use EXML should remain on
|
|
16
|
-
> `@kurot/cli@1.3.x`. The KUI toolchain is not an in-place project upgrade and does
|
|
17
|
-
> not require those projects to change their configuration or UI assets.
|
|
18
|
-
|
|
19
|
-
Version 3.6.1 fixes generated host skinParts declarations for full TypeScript
|
|
20
|
-
checks with skipLibCheck=false and ships README/AGENTS entries in both templates.
|
|
21
|
-
The game entry links UI 3.6.2's authoring/directory guide and complete ScoreHUD
|
|
22
|
-
recipe. Runtime Skin output, dependency ranges and locks are unchanged. After
|
|
23
|
-
publication, existing projects adopt the fix by updating their CLI installation/
|
|
24
|
-
lock and rebuilding; new template docs do not overwrite existing project files.
|
|
25
|
-
|
|
26
|
-
See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
27
|
-
|
|
28
|
-
Version 3.3.1 fixes development synchronization for all runtime resources,
|
|
29
|
-
including locale JSON, atlas PNG/JSON, fonts and translations. No project
|
|
30
|
-
configuration changes are required; refresh the preview after synchronization.
|
|
31
|
-
See [development resource watching](docs/dev-resource-watching.md).
|
|
32
|
-
|
|
33
|
-
Version 3.2.1 adds project styles, bundled fonts and English translations to the
|
|
34
|
-
game template. Existing projects are not rewritten. See [game template setup](docs/game-template.md).
|
|
35
|
-
|
|
36
|
-
Version 3.3.0 compiles shared Label presets from `style.json.labels` into native
|
|
37
|
-
properties, with local and Skin state fields taking priority. See [Label presets](#label-presets-in-330).
|
|
38
|
-
|
|
39
|
-
## Centered flips in 3.5.0
|
|
40
|
-
|
|
41
|
-
Compile independent `flipX`/`flipY` booleans on display nodes and named Skin
|
|
42
|
-
states, for example `flipY="true" flipY.down="false"`. The compiler rejects
|
|
43
|
-
malformed booleans and flags on the nonvisual Skin root. Percent dimensions and
|
|
44
|
-
negative scale retain their existing contracts; no authored XML is converted.
|
|
45
|
-
|
|
46
|
-
The dependency/lock uses published ui-document 0.13.0. Apps rendering these
|
|
47
|
-
flags need published Core 2.4.0/UI 3.4.0; CLI-built skins run directly through
|
|
48
|
-
UI. CLI 3.5.0 is published.
|
|
49
|
-
|
|
50
|
-
## BitmapLabel and RichLabel in 3.4.0
|
|
51
|
-
|
|
52
|
-
Compile BitmapLabel with a configured `font` resource, and RichLabel with
|
|
53
|
-
literal `textFlow` / `Span` elements. Named Skin states replace complete run
|
|
54
|
-
arrays; an empty flow clears content. Span elements never become display
|
|
55
|
-
children or Skin parts. New native text fields are validated before output,
|
|
56
|
-
and percentage-looking text such as `100%` remains literal.
|
|
57
|
-
|
|
58
|
-
Rendering these new tags requires UI `^3.3.0` and Core `^2.3.0` in the app;
|
|
59
|
-
these are the original native API minimums. Current UI 3.4.0 requires Core
|
|
60
|
-
`^2.4.0`, which includes the Core 2.3.1 blank rich-text line correction. Existing controls
|
|
61
|
-
and templates do not require automatic upgrades or migrations. See
|
|
62
|
-
[text component compilation](docs/text-components.md).
|
|
63
|
-
|
|
64
|
-
## Label text fitting in 3.1.0
|
|
65
|
-
|
|
66
|
-
The shared ui-document catalog supports Label `textFit` and `minFontSize`
|
|
67
|
-
in KUI XML:
|
|
68
|
-
|
|
69
|
-
```xml
|
|
70
|
-
<Skin xmlns="https://kurot.dev/ui/1" class="skins.AmountSkin" states="down">
|
|
71
|
-
<Label id="labelDisplay" text="KZT 10 000,00" width="140" size="24"
|
|
72
|
-
multiline="false" textFit="shrink" minFontSize="16" size.down="20" />
|
|
73
|
-
</Skin>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The compiler emits the policy, base size and state overrides unchanged. UI
|
|
77
|
-
derives the drawing size after layout validation. Rendering this capability
|
|
78
|
-
requires `@kurot/ui@^3.1.0` and `@kurot/core@^2.1.0` in the application.
|
|
79
|
-
These are the original fitting API minimums; current UI 3.4.0 requires Core ^2.4.0.
|
|
80
|
-
Explicit `multiline="false"` means one unwrapped first line; remove it or set
|
|
81
|
-
it to true for text intended to wrap. Files are not migrated automatically.
|
|
82
|
-
See the [compilation contract](docs/label-text-layout.md) and
|
|
83
|
-
[native Label contract](../ui/docs/label-text-layout.md).
|
|
8
|
+
For UI production use the installed UI [authoring guide](../ui/docs/ui-authoring.md)
|
|
9
|
+
and [ScoreHUD recipe](../ui/docs/recipes/score-hud.md). Legacy EXML projects use
|
|
10
|
+
the separate CLI 1.3.x line. KUI configuration and resource files are project-owned.
|
|
84
11
|
|
|
85
12
|
## Usage
|
|
86
13
|
|
|
87
|
-
The CLI does not require a global install.
|
|
14
|
+
The CLI does not require a global install. Install the CLI as a project development dependency. New game scaffolds need Core ^2.5.0 for the
|
|
88
15
|
2× skin kit; existing projects keep their own installed SDKs and resources.
|
|
89
16
|
|
|
90
17
|
```bash
|
|
91
|
-
npx @kurot/cli@3.
|
|
18
|
+
npx @kurot/cli@3.7.0 create my-game
|
|
92
19
|
cd my-game
|
|
93
20
|
pnpm install
|
|
94
21
|
pnpm dev
|
|
@@ -96,7 +23,7 @@ pnpm dev
|
|
|
96
23
|
|
|
97
24
|
Scaffolded projects expose `build`, `dev`, and `clean` scripts. For an
|
|
98
25
|
Editor-managed KUI XML project, install the package with
|
|
99
|
-
`pnpm add -D @kurot/cli@^3.
|
|
26
|
+
`pnpm add -D @kurot/cli@^3.7.0`. Existing EXML projects should keep their current
|
|
100
27
|
1.3.x dependency.
|
|
101
28
|
|
|
102
29
|
## Commands
|
|
@@ -113,24 +40,12 @@ resource loading, and an editable HTML template. Fonts load before creating UI;
|
|
|
113
40
|
translations register after preload. The `empty` template contains a minimal
|
|
114
41
|
`Sprite` application without UI/style/language dependencies.
|
|
115
42
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
CLI 3.6.0 supplies rounded Kurot-owned textures,
|
|
123
|
-
native `.kui.xml` component states and resource-default nine-slice grids under
|
|
124
|
-
`resource/assets/ui/kui`. See [default KUI skins](docs/default-ui-skins.md).
|
|
125
|
-
Registry CLI 3.5.0 still contains the previous atlas.
|
|
126
|
-
The default Button uses symmetric padding and Panel titles use middle alignment.
|
|
127
|
-
The source preview also uses Core 2.5.0's multilingual ink centering;
|
|
128
|
-
inputs and multiline text retain stable baselines.
|
|
129
|
-
The new 2× atlas requires published Core ^2.5.0; CLI 3.6.0 is also published.
|
|
130
|
-
|
|
131
|
-
The CLI 3.6.0 game-template refresh introduces a "Made with Kurot" brand splash
|
|
132
|
-
with a playful mascot entrance, looping hops and sparkles. It supports reduced
|
|
133
|
-
motion and applies to newly created projects; see [HTML brand splash](docs/game-template.md#html-brand-splash).
|
|
43
|
+
Both templates include README/AGENTS entries for commands, authored/generated
|
|
44
|
+
files and installed SDK guides. The game template supplies rounded 2× KUI skins,
|
|
45
|
+
project fonts/colors/translations and a mascot splash with reduced-motion support.
|
|
46
|
+
The 2× skin kit needs Core >= 2.5.0 within 2.x. Existing project files remain
|
|
47
|
+
project-owned. See [template startup](docs/game-template.md) and
|
|
48
|
+
[default UI skins](docs/default-ui-skins.md).
|
|
134
49
|
|
|
135
50
|
### `kurot build`
|
|
136
51
|
|
|
@@ -144,8 +59,14 @@ Development output is written to `bin-debug/`. Release output is written to
|
|
|
144
59
|
project namespace, theme, and application code are separate ESM chunks joined
|
|
145
60
|
by the generated HTML import map.
|
|
146
61
|
|
|
147
|
-
|
|
148
|
-
|
|
62
|
+
Set `output: { dir: 'bin-debug', versionedAssets: true }` to place release
|
|
63
|
+
resources and scripts in `assets/<content-hash>/`. A generated HTML base URL
|
|
64
|
+
versions relative requests, including atlas pages, fonts and startup images.
|
|
65
|
+
Identical builds reuse the same path; development output is unchanged.
|
|
66
|
+
See [release assets and deployment](docs/release-assets.md) for theme loading,
|
|
67
|
+
cache headers and upload order. This option requires CLI >= 3.7.0 within 3.x.
|
|
68
|
+
|
|
69
|
+
Asset copying omits empty runtime directory trees. With KUI enabled, authored
|
|
149
70
|
`.kui.xml` files are compiled into the theme chunk and excluded from `resource/`;
|
|
150
71
|
skin-only directories such as `resource/ui` therefore do not appear in output.
|
|
151
72
|
Images, JSON and other runtime files inside those directories are still copied.
|
|
@@ -165,7 +86,7 @@ The development server rebuilds TypeScript, KUI XML, custom namespaces, and
|
|
|
165
86
|
the component catalog as their sources change. Browser refresh is currently
|
|
166
87
|
manual. JSONL mode reserves stdout for incremental build and server events.
|
|
167
88
|
|
|
168
|
-
|
|
89
|
+
Dev also synchronizes the complete `resource/` tree,
|
|
169
90
|
including locale JSON, atlas PNG/JSON, fonts and translation files, with deletion
|
|
170
91
|
and rename handling. Runtime-only edits do not recompile skins; style and resource
|
|
171
92
|
default changes still do. Refresh after synchronization succeeds. No atlas
|
|
@@ -239,7 +160,7 @@ use `property.state` on the affected node, so internal graphics remain unnamed.
|
|
|
239
160
|
Image sources use their resource key directly, for example
|
|
240
161
|
`source="button_up_png"`.
|
|
241
162
|
|
|
242
|
-
CLI
|
|
163
|
+
The CLI uses `@kurot/ui-document@^0.13.0` and its literal-string XML rules.
|
|
243
164
|
For example, `<Label text="100.80" text.down="false" size="48" />` compiles
|
|
244
165
|
the exact strings `100.80` and `false`, while the font size stays numeric.
|
|
245
166
|
String properties no longer add or remove backslash type escapes. Remove old
|
|
@@ -265,11 +186,10 @@ node inside the Skin is inferred as a skin part; its `id` is the part
|
|
|
265
186
|
name. The declaration augments the UI runtime with those exact names and types.
|
|
266
187
|
This file is editor-only, ignored by git, and never enters browser bundles.
|
|
267
188
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
requirements are unchanged. Generated runtime Skin factories are unaffected.
|
|
189
|
+
Generated host skinParts use getter signatures matching Component's accessor.
|
|
190
|
+
After changing authored Skin inputs, rebuild the declarations and run
|
|
191
|
+
`tsc --noEmit --skipLibCheck false`. Edit authored inputs rather than generated
|
|
192
|
+
`.kurot/` files. Runtime Skin factories are separate from editor declarations.
|
|
273
193
|
|
|
274
194
|
## Reusable components
|
|
275
195
|
|
|
@@ -325,7 +245,7 @@ enabled properties files are registered in `preload`. Replace fonts by changing
|
|
|
325
245
|
the resource-relative files/paths, and add languages through the Editor.
|
|
326
246
|
See [game template setup](docs/game-template.md) for lifecycle and fallback rules.
|
|
327
247
|
|
|
328
|
-
## Resource defaults
|
|
248
|
+
## Resource defaults
|
|
329
249
|
|
|
330
250
|
KUI builds validate `resource/default.res.json` and inherit image or sheet-frame
|
|
331
251
|
`scale9grid` values into compiled `Image.scale9Grid` when XML does not set one.
|
|
@@ -337,7 +257,7 @@ Sheet `subkeys` must be an object-valued frame map. Refresh old sheets in the
|
|
|
337
257
|
Editor before upgrading a KUI project; string-valued subkeys now fail the build.
|
|
338
258
|
See the [resource nine-slice contract](../ui-document/docs/resource-nine-slice.md).
|
|
339
259
|
|
|
340
|
-
## Project style colors
|
|
260
|
+
## Project style colors
|
|
341
261
|
|
|
342
262
|
The optional fixed `resource/config/style.json` is independent of
|
|
343
263
|
`default.res.json`. Each KUI build reads it through the shared document kernel, validates
|
|
@@ -365,14 +285,12 @@ switching. CLI-built skins run directly through `@kurot/ui`; `@kurot/ui-runtime`
|
|
|
365
285
|
is not required for this compilation path. Node.js >= 20 and semantic format
|
|
366
286
|
version 2 remain unchanged.
|
|
367
287
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
literal. Existing EXML projects remain on CLI 1.3.x. No Core/UI rendering change
|
|
371
|
-
is required for color expansion.
|
|
288
|
+
Only `@style:colors:<key>` is accepted for authored palette references.
|
|
289
|
+
Ordinary text remains literal; color expansion changes compiled copies only.
|
|
372
290
|
|
|
373
|
-
## Label presets
|
|
291
|
+
## Label presets
|
|
374
292
|
|
|
375
|
-
|
|
293
|
+
The compiler expands `textStyle="@style:labels:<key>"` through the shared
|
|
376
294
|
`style.json.labels` contract before generating native Label properties. Local and
|
|
377
295
|
state fields win; authoring references remain in XML. Development watches the
|
|
378
296
|
stylesheet and retains the last good bundle on errors. Programmatic `compileKUI`
|
|
@@ -383,6 +301,4 @@ than selecting a different preset. Missing presets, unsupported selection or
|
|
|
383
301
|
invalid configuration fail explicitly. Expansion runs after resource defaults
|
|
384
302
|
and before color resolution. It does not load fonts or measure text.
|
|
385
303
|
|
|
386
|
-
CLI 3.6.0/3.6.1 uses published ui-document 0.13.0 without local overrides. CLI
|
|
387
|
-
3.2.1 does not include this feature. Existing projects are not migrated.
|
|
388
304
|
See [the shared contract](../ui-document/docs/project-styles.md).
|
package/dist/core/config.d.ts
CHANGED
|
@@ -67,6 +67,11 @@ export interface OutputConfig {
|
|
|
67
67
|
* `bin-release/web/<timestamp>` regardless of this setting.
|
|
68
68
|
*/
|
|
69
69
|
readonly dir: string;
|
|
70
|
+
/**
|
|
71
|
+
* Place release assets in `assets/<content-hash>/` and set the entry page's
|
|
72
|
+
* base URL to that directory. Defaults to false; ignored in development.
|
|
73
|
+
*/
|
|
74
|
+
readonly versionedAssets?: boolean;
|
|
70
75
|
}
|
|
71
76
|
export interface HtmlConfig {
|
|
72
77
|
/**
|
|
@@ -86,7 +91,7 @@ export interface ProjectConfig {
|
|
|
86
91
|
*/
|
|
87
92
|
readonly entry: string;
|
|
88
93
|
/**
|
|
89
|
-
*
|
|
94
|
+
* Build output settings.
|
|
90
95
|
*/
|
|
91
96
|
readonly output: OutputConfig;
|
|
92
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IA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1B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC;CACxB;AA0BD;;;;;;;GAOG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,CAgDzD"}
|
package/dist/core/config.js
CHANGED
|
@@ -45,6 +45,9 @@ export async function loadConfig() {
|
|
|
45
45
|
else {
|
|
46
46
|
config = DEFAULTS;
|
|
47
47
|
}
|
|
48
|
+
if (config.output.versionedAssets !== undefined && typeof config.output.versionedAssets !== 'boolean') {
|
|
49
|
+
throw new ConfigError('Invalid config: output.versionedAssets must be a boolean');
|
|
50
|
+
}
|
|
48
51
|
if (!Number.isInteger(config.stage.frameRate) || config.stage.frameRate <= 0) {
|
|
49
52
|
throw new ConfigError(`Invalid config: stage.frameRate must be a positive integer, got ${config.stage.frameRate}`);
|
|
50
53
|
}
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mapp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M,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,WAAW,CAAC,kCAAkC,MAAM,CAAC,IAAI,CAAC,QAAQ,kBAAkB,CAAC,CAAC;QACjG,CAAC;IACF,CAAC;IAED,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAE5B,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,EAAyB;IAClD,IAAI,CAAC,EAAE;QAAE,OAAO;IAChB,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,WAAW,CAAC,gDAAgD,CAAC,CAAC;IACzE,CAAC;IAED,wBAAwB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,SAAS,wBAAwB,CAAC,UAAwC;IACzE,IAAI,CAAC,UAAU;QAAE,OAAO;IACxB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,WAAW,CACpB,sFAAsF,UAAU,CAAC,SAAS,GAAG,CAC7G,CAAC;IACH,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,WAAW,CAAC,2DAA2D,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,WAAW,CAAC,yDAAyD,CAAC,CAAC;IAClF,CAAC;AACF,CAAC"}
|
|
@@ -8,6 +8,7 @@ export { compileSource } from './compile-source.js';
|
|
|
8
8
|
export { generateHtml } from './generate-html.js';
|
|
9
9
|
export { writeManifest } from './manifest.js';
|
|
10
10
|
export { copyAssets } from './copy-assets.js';
|
|
11
|
+
export { versionAssets } from './version-assets.js';
|
|
11
12
|
/**
|
|
12
13
|
* The standard build sequence.
|
|
13
14
|
*
|
|
@@ -16,7 +17,7 @@ export { copyAssets } from './copy-assets.js';
|
|
|
16
17
|
* files external and exclude them from per-file dev output (see
|
|
17
18
|
* `compile-source.ts`). Engine and source compilation report their output
|
|
18
19
|
* paths, then the HTML and manifest referencing them are written, and
|
|
19
|
-
* finally static assets are copied.
|
|
20
|
+
* finally static assets are copied and optionally versioned for release.
|
|
20
21
|
*/
|
|
21
22
|
export declare function defaultPlugins(): BuildPlugin[];
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYlD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,IAAI,WAAW,EAAE,CAa9C"}
|
|
@@ -7,6 +7,7 @@ import { compileSource } from './compile-source.js';
|
|
|
7
7
|
import { generateHtml } from './generate-html.js';
|
|
8
8
|
import { writeManifest } from './manifest.js';
|
|
9
9
|
import { copyAssets } from './copy-assets.js';
|
|
10
|
+
import { versionAssets } from './version-assets.js';
|
|
10
11
|
export { cleanOutput } from './clean-output.js';
|
|
11
12
|
export { compileKUI } from './compile-kui.js';
|
|
12
13
|
export { compileEngine } from './compile-engine.js';
|
|
@@ -16,6 +17,7 @@ export { compileSource } from './compile-source.js';
|
|
|
16
17
|
export { generateHtml } from './generate-html.js';
|
|
17
18
|
export { writeManifest } from './manifest.js';
|
|
18
19
|
export { copyAssets } from './copy-assets.js';
|
|
20
|
+
export { versionAssets } from './version-assets.js';
|
|
19
21
|
/**
|
|
20
22
|
* The standard build sequence.
|
|
21
23
|
*
|
|
@@ -24,7 +26,7 @@ export { copyAssets } from './copy-assets.js';
|
|
|
24
26
|
* files external and exclude them from per-file dev output (see
|
|
25
27
|
* `compile-source.ts`). Engine and source compilation report their output
|
|
26
28
|
* paths, then the HTML and manifest referencing them are written, and
|
|
27
|
-
* finally static assets are copied.
|
|
29
|
+
* finally static assets are copied and optionally versioned for release.
|
|
28
30
|
*/
|
|
29
31
|
export function defaultPlugins() {
|
|
30
32
|
return [
|
|
@@ -37,6 +39,7 @@ export function defaultPlugins() {
|
|
|
37
39
|
generateHtml(),
|
|
38
40
|
writeManifest(),
|
|
39
41
|
copyAssets(),
|
|
42
|
+
versionAssets(),
|
|
40
43
|
];
|
|
41
44
|
}
|
|
42
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,C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,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,WAAW,EAAE;QACb,UAAU,EAAE;QACZ,aAAa,EAAE;QACf,uBAAuB,EAAE;QACzB,qBAAqB,EAAE;QACvB,aAAa,EAAE;QACf,YAAY,EAAE;QACd,aAAa,EAAE;QACf,UAAU,EAAE;QACZ,aAAa,EAAE;KACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuildPlugin } from '../pipeline.js';
|
|
2
|
+
/**
|
|
3
|
+
* Gives every relative release URL one content-addressed base, including
|
|
4
|
+
* secondary analyzer requests, fonts and assets owned by the HTML template.
|
|
5
|
+
*/
|
|
6
|
+
export declare function versionAssets(): BuildPlugin;
|
|
7
|
+
//# sourceMappingURL=version-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-assets.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/version-assets.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,aAAa,IAAI,WAAW,CAyC3C"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { createReadStream } from 'node:fs';
|
|
3
|
+
import * as fs from 'node:fs/promises';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { defaultTreeAdapter, parse } from 'parse5';
|
|
6
|
+
import { BuildError } from '../errors.js';
|
|
7
|
+
/**
|
|
8
|
+
* Gives every relative release URL one content-addressed base, including
|
|
9
|
+
* secondary analyzer requests, fonts and assets owned by the HTML template.
|
|
10
|
+
*/
|
|
11
|
+
export function versionAssets() {
|
|
12
|
+
return {
|
|
13
|
+
name: 'version release assets',
|
|
14
|
+
async apply(ctx) {
|
|
15
|
+
if (ctx.project.mode !== 'release' || !ctx.project.config.output.versionedAssets) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const outputDir = ctx.project.outputDir;
|
|
19
|
+
const htmlPath = path.join(outputDir, 'index.html');
|
|
20
|
+
const html = await fs.readFile(htmlPath, 'utf8');
|
|
21
|
+
const headEnd = validateHtml(html);
|
|
22
|
+
const version = await hashDirectory(outputDir);
|
|
23
|
+
const prefix = `assets/${version}/`;
|
|
24
|
+
const entries = await fs.readdir(outputDir);
|
|
25
|
+
const staging = await fs.mkdtemp(path.join(outputDir, '.version-assets-'));
|
|
26
|
+
try {
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
if (entry === 'index.html' || entry === 'manifest.json') {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
await fs.rename(path.join(outputDir, entry), path.join(staging, entry));
|
|
32
|
+
}
|
|
33
|
+
await fs.mkdir(path.join(outputDir, 'assets'));
|
|
34
|
+
await fs.rename(staging, path.join(outputDir, prefix));
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await fs.rm(staging, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
prefixOutputs(ctx, prefix);
|
|
40
|
+
const manifest = {
|
|
41
|
+
initial: Object.values(ctx.outputs.engine),
|
|
42
|
+
game: [ctx.outputs.skinsScript, ctx.outputs.entryScript].filter(Boolean),
|
|
43
|
+
};
|
|
44
|
+
await fs.writeFile(path.join(outputDir, 'manifest.json'), JSON.stringify(manifest, undefined, '\t') + '\n');
|
|
45
|
+
await fs.writeFile(htmlPath, `${html.slice(0, headEnd)}\n\t<base href="./${prefix}">${html.slice(headEnd)}`);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function validateHtml(html) {
|
|
50
|
+
const document = parse(html, { sourceCodeLocationInfo: true });
|
|
51
|
+
const root = document.childNodes.find(defaultTreeAdapter.isElementNode);
|
|
52
|
+
const head = root?.childNodes.filter(defaultTreeAdapter.isElementNode).find(node => node.tagName === 'head');
|
|
53
|
+
// HTML parsing can imply a head; insertion requires its authored start tag.
|
|
54
|
+
const headEnd = head?.sourceCodeLocation?.startTag?.endOffset;
|
|
55
|
+
if (headEnd === undefined) {
|
|
56
|
+
throw new BuildError('output.versionedAssets requires an HTML template with a <head> element.');
|
|
57
|
+
}
|
|
58
|
+
const elements = root ? [root] : [];
|
|
59
|
+
while (elements.length > 0) {
|
|
60
|
+
const element = elements.pop();
|
|
61
|
+
if (element.tagName === 'base') {
|
|
62
|
+
throw new BuildError("output.versionedAssets owns the HTML base URL; remove the template's <base> element.");
|
|
63
|
+
}
|
|
64
|
+
elements.push(...element.childNodes.filter(defaultTreeAdapter.isElementNode));
|
|
65
|
+
}
|
|
66
|
+
return headEnd;
|
|
67
|
+
}
|
|
68
|
+
async function hashDirectory(root) {
|
|
69
|
+
const hash = createHash('sha256');
|
|
70
|
+
const files = await listFiles(root);
|
|
71
|
+
for (const relative of files.sort()) {
|
|
72
|
+
const file = path.join(root, relative);
|
|
73
|
+
const stat = await fs.stat(file);
|
|
74
|
+
hash.update(JSON.stringify([relative, stat.size]) + '\n');
|
|
75
|
+
for await (const chunk of createReadStream(file)) {
|
|
76
|
+
hash.update(chunk);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return hash.digest('hex').slice(0, 32);
|
|
80
|
+
}
|
|
81
|
+
async function listFiles(root, directory = '') {
|
|
82
|
+
const files = [];
|
|
83
|
+
for (const entry of await fs.readdir(path.join(root, directory), { withFileTypes: true })) {
|
|
84
|
+
const relative = path.posix.join(directory, entry.name);
|
|
85
|
+
if (entry.isDirectory()) {
|
|
86
|
+
files.push(...(await listFiles(root, relative)));
|
|
87
|
+
}
|
|
88
|
+
else if (entry.isFile()) {
|
|
89
|
+
files.push(relative);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
throw new BuildError(`Versioned assets require regular files or directories: ${relative}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return files;
|
|
96
|
+
}
|
|
97
|
+
function prefixOutputs(ctx, prefix) {
|
|
98
|
+
if (ctx.outputs.entryScript) {
|
|
99
|
+
ctx.outputs.entryScript = prefix + ctx.outputs.entryScript;
|
|
100
|
+
}
|
|
101
|
+
if (ctx.outputs.skinsScript) {
|
|
102
|
+
ctx.outputs.skinsScript = prefix + ctx.outputs.skinsScript;
|
|
103
|
+
}
|
|
104
|
+
for (const specifier of Object.keys(ctx.outputs.engine)) {
|
|
105
|
+
ctx.outputs.engine[specifier] = prefix + ctx.outputs.engine[specifier];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=version-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-assets.js","sourceRoot":"","sources":["../../../src/core/plugins/version-assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC5B,OAAO;QACN,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,KAAK,CAAC,GAAiB;YAC5B,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;gBAClF,OAAO;YACR,CAAC;YA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,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxE,CAAC;AACF,CAAC"}
|
package/docs/ai-context.md
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
# @kurot/cli — AI context map
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[centered flips](../../../docs/centered-flips.md) for transform and adoption contracts.
|
|
8
|
-
|
|
9
|
-
Read this before exploring `src/`. [`architecture.md`](./architecture.md)
|
|
10
|
-
explains the plugin pipeline. Version `@kurot/cli@3.6.1` is prepared locally (not published), runs on Node.js 20+,
|
|
11
|
-
and is installed as a project dev dependency.
|
|
3
|
+
`@kurot/cli@3.7.0` is build-time tooling on Node.js >= 20, with ordinary
|
|
4
|
+
ui-document dependency **^0.13.0**. Projects supply their own Core/UI runtime.
|
|
5
|
+
Read [architecture](architecture.md) for the plugin pipeline; the source and
|
|
6
|
+
configuration exports establish current behavior.
|
|
12
7
|
|
|
13
8
|
## Directory map
|
|
14
9
|
|
|
@@ -31,34 +26,15 @@ src/
|
|
|
31
26
|
└── utils/
|
|
32
27
|
```
|
|
33
28
|
|
|
34
|
-
Project templates are under `templates/game` and `templates/empty
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
The 2× sheet requires Core ^2.5.0; published Core 2.4.0
|
|
44
|
-
does not interpret it. Private preview tooling binds checkout Core in an isolated
|
|
45
|
-
trial. Core 2.5.0 was published before CLI 3.6.0; both are verified on npm.
|
|
46
|
-
The CLI 3.6.0 game template includes the looping mascot brand splash; registry
|
|
47
|
-
CLI 3.5.0 does not contain that HTML/logo refresh. See game-template.md.
|
|
48
|
-
The 3.2.1 game template includes fixed style/locale configuration,
|
|
49
|
-
English properties and licensed regular/bold font files. StyleManager finishes
|
|
50
|
-
font loading before Main creates Player/Preloader; LocaleManager registers
|
|
51
|
-
preload texts before creating the scene. See [game-template.md](game-template.md).
|
|
52
|
-
Version 3.3.0 is published with Label preset compilation and
|
|
53
|
-
published ui-document 0.11.0. It has no local document-kernel override.
|
|
54
|
-
Published version 3.3.1 adds whole-resource dev synchronization, deletion/reconnect
|
|
55
|
-
handling and no-store responses. Installed CLI 3.3.0 lacks these fixes; consumers
|
|
56
|
-
must update their installed/locked version to receive them.
|
|
57
|
-
|
|
58
|
-
## Native text adoption in 3.4.0
|
|
59
|
-
|
|
60
|
-
Version 3.4.0 registers BitmapLabel and RichLabel from published UI
|
|
61
|
-
3.3.0 and consumes document 0.12.0. `kui/validate-text-components.ts` applies
|
|
29
|
+
Project templates are under `templates/game` and `templates/empty`, including
|
|
30
|
+
README/AGENTS entries for installed SDK guides and project commands. The game
|
|
31
|
+
template supplies paired KUI/TS components, default skins, a 2× atlas, palette,
|
|
32
|
+
fonts, translations and splash HTML. See [template startup](game-template.md)
|
|
33
|
+
and [default skins](default-ui-skins.md).
|
|
34
|
+
|
|
35
|
+
## Native text compilation
|
|
36
|
+
|
|
37
|
+
The compiler registers BitmapLabel and RichLabel through ui-document. `kui/validate-text-components.ts` applies
|
|
62
38
|
strict shared property/state validation only to these new built-ins, preserving
|
|
63
39
|
existing CLI-only and custom class contracts. Text flows remain literal arrays;
|
|
64
40
|
Span data does not create nodes/parts. Only width/height use percent conversion.
|
|
@@ -80,11 +56,11 @@ transforms such as `flipX`/`flipY` belong on those children. Overrides use local
|
|
|
80
56
|
`property.state` attributes. Storage IDs and runtime mapping metadata are not
|
|
81
57
|
authored XML fields.
|
|
82
58
|
|
|
83
|
-
|
|
59
|
+
The compiler validates centered-flip booleans on display nodes and named-state
|
|
84
60
|
overrides, including CLI-only controls. Malformed values and flags on the
|
|
85
61
|
nonvisual Skin root fail compilation. Negative scales are preserved.
|
|
86
62
|
|
|
87
|
-
CLI
|
|
63
|
+
The CLI requires `@kurot/ui-document@^0.13.0`. Schema-defined strings, including
|
|
88
64
|
numeric/boolean-looking text and state text, are literal attributes without
|
|
89
65
|
backslash type escaping. Old synthetic prefixes become literal characters;
|
|
90
66
|
do not migrate them silently. Numeric/boolean properties and schema-free
|
|
@@ -107,10 +83,9 @@ as the part name. Internal nodes can omit `id`; the declaration augments
|
|
|
107
83
|
component classes. The file is development metadata and is excluded from
|
|
108
84
|
runtime output.
|
|
109
85
|
|
|
110
|
-
|
|
111
|
-
preserving Component's accessor kind under `skipLibCheck=false`.
|
|
112
|
-
|
|
113
|
-
the fixed CLI; do not change Core/UI or hand-edit the generated declaration.
|
|
86
|
+
The generator narrows host `skinParts` through a getter signature,
|
|
87
|
+
preserving Component's accessor kind under `skipLibCheck=false`. Regenerate after
|
|
88
|
+
authored Skin changes; keep generated declarations out of manual edits.
|
|
114
89
|
|
|
115
90
|
## Reusable components
|
|
116
91
|
|
|
@@ -132,7 +107,7 @@ manual prefix cannot conflict with `ui.components.namespace`.
|
|
|
132
107
|
`--strict` or release policy.
|
|
133
108
|
- Machine diagnostic modes own stdout: build emits one JSON result; dev emits
|
|
134
109
|
JSONL lifecycle events.
|
|
135
|
-
-
|
|
110
|
+
- Dev watches all resource assets even without UI, emits
|
|
136
111
|
resource-change for copy-only batches, retains KUI requirements across mixed
|
|
137
112
|
batches, and reconciles deletions. Browser refresh remains manual; HTTP is
|
|
138
113
|
no-store. Per-file staging/rename is not an atomic atlas pair transaction.
|
|
@@ -143,9 +118,8 @@ manual prefix cannot conflict with `ui.components.namespace`.
|
|
|
143
118
|
- Engine and custom namespace chunks share `ctx.outputs.engine` because the
|
|
144
119
|
import-map writer treats both as external specifier mappings.
|
|
145
120
|
- Engine and reusable namespace bundles preserve class names in both modes.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
names only. Theme fallback uses constructor names.
|
|
121
|
+
Self-referencing classes retain stable names in both modes because Theme
|
|
122
|
+
fallback uses constructor names.
|
|
149
123
|
- The Skin module builder stages output in a temporary directory and installs a
|
|
150
124
|
bundle only after every Skin succeeds.
|
|
151
125
|
- `cleanOutput` wipes the active output directory at the start of each build.
|
|
@@ -153,11 +127,10 @@ manual prefix cannot conflict with `ui.components.namespace`.
|
|
|
153
127
|
- `create` queries the npm registry for current Kurot package versions and falls
|
|
154
128
|
back to `latest` if the request fails.
|
|
155
129
|
- Release output is timestamped and `manifest.json` exists only in release.
|
|
156
|
-
-
|
|
130
|
+
- Asset copying omits empty runtime directory trees,
|
|
157
131
|
including skin-only `resource/ui`. Runtime files under UI directories remain
|
|
158
132
|
eligible; generated theme JSON and the compiled Skin module remain required.
|
|
159
|
-
Template copies still preserve empty directories.
|
|
160
|
-
include this correction.
|
|
133
|
+
Template copies still preserve empty directories.
|
|
161
134
|
|
|
162
135
|
## Plugin order
|
|
163
136
|
|
|
@@ -171,11 +144,19 @@ manual prefix cannot conflict with `ui.components.namespace`.
|
|
|
171
144
|
6. compile application source;
|
|
172
145
|
7. generate HTML;
|
|
173
146
|
8. write the release manifest;
|
|
174
|
-
9. copy runtime assets
|
|
147
|
+
9. copy runtime assets;
|
|
148
|
+
10. optionally version release assets with `output.versionedAssets`.
|
|
175
149
|
|
|
176
150
|
Do not reorder namespace or source compilation without reviewing externalization
|
|
177
151
|
in `namespace-external-plugin.ts`.
|
|
178
152
|
|
|
153
|
+
Release versioning runs last so the digest covers generated themes, scripts,
|
|
154
|
+
resource bytes and template assets. It keeps index.html/manifest.json at the
|
|
155
|
+
output root and moves all other files under assets/<hash>/. The HTML base URL
|
|
156
|
+
versions document-relative requests; callers that explicitly resolve URLs must
|
|
157
|
+
use document.baseURI. Existing UI Theme must receive an absolute config URL.
|
|
158
|
+
See [release assets](release-assets.md). This option requires CLI >= 3.7.0 within 3.x.
|
|
159
|
+
|
|
179
160
|
## Configuration lookup
|
|
180
161
|
|
|
181
162
|
| Task | File |
|
|
@@ -205,14 +186,14 @@ pnpm test
|
|
|
205
186
|
CLI end-to-end tests bind localhost and may require permission in a restricted
|
|
206
187
|
execution environment.
|
|
207
188
|
|
|
208
|
-
## Resource configuration
|
|
189
|
+
## Resource configuration
|
|
209
190
|
|
|
210
191
|
KUI builds validate object subkeys, resolve resource nine-slice defaults, and
|
|
211
192
|
watch the manifest during development. See
|
|
212
193
|
[the resource-default contract](../../ui-document/docs/resource-nine-slice.md)
|
|
213
194
|
for conversion and compilation boundaries.
|
|
214
195
|
|
|
215
|
-
## Label text compilation
|
|
196
|
+
## Label text compilation
|
|
216
197
|
|
|
217
198
|
The compiler consumes the shared ui-document catalog and emits Label `textFit`,
|
|
218
199
|
`minFontSize`, authored `size` and state-size overrides unchanged. Runtime
|
|
@@ -222,7 +203,7 @@ within their respective majors. Neither engine is a CLI runtime dependency.
|
|
|
222
203
|
See [text compilation](label-text-layout.md) and
|
|
223
204
|
[native Label text layout](../../ui/docs/label-text-layout.md) for the boundary.
|
|
224
205
|
|
|
225
|
-
## Project styles
|
|
206
|
+
## Project styles
|
|
226
207
|
|
|
227
208
|
Read [project styles](../../ui-document/docs/project-styles.md). buildSkinsModule
|
|
228
209
|
reads the optional fixed config/style.json once per build and forwards its numeric
|
|
@@ -233,13 +214,11 @@ without migrating files. Fonts are validated but not loaded; the application own
|
|
|
233
214
|
font loading and rendering. Build/preview copies resolve references while authored
|
|
234
215
|
XML retains them. No live runtime palette switching is introduced.
|
|
235
216
|
|
|
236
|
-
## Label presets
|
|
217
|
+
## Label presets
|
|
237
218
|
|
|
238
219
|
skin-module-builder.ts reads the entire stylesheet once per build and passes it
|
|
239
220
|
through parseToIR/parseKUISkin. Resolve resource defaults, then Label presets, then colors before
|
|
240
221
|
native emission; retain XML references and local/state precedence. compileKUI
|
|
241
222
|
accepts an optional styleSheet. style.json changes already trigger whole-Skin
|
|
242
|
-
rebuilds. Invalid presets retain the last successful bundle.
|
|
243
|
-
lockfile used published ui-document 0.11.0 without a local override. Current
|
|
244
|
-
CLI 3.5.0 development uses published ui-document 0.13.0. textStyle is
|
|
223
|
+
rebuilds. Invalid presets retain the last successful bundle. textStyle is
|
|
245
224
|
Default-only; individual named-state fields can still override preset properties.
|
package/docs/architecture.md
CHANGED
|
@@ -18,6 +18,7 @@ clean output
|
|
|
18
18
|
→ generate HTML
|
|
19
19
|
→ write release manifest
|
|
20
20
|
→ copy runtime assets
|
|
21
|
+
→ optionally version release assets
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
KUI compilation runs first because skin factories can import project namespace
|
|
@@ -39,7 +40,7 @@ factory variables, property assignments, semantic layout children, and state
|
|
|
39
40
|
property overrides. Document contracts, reusable instances, data bindings, and
|
|
40
41
|
actions remain `UIDocument` concepts.
|
|
41
42
|
|
|
42
|
-
CLI 3.
|
|
43
|
+
CLI 3.7.0 consumes ui-document ^0.13.0, retaining Label text-fitting metadata. The
|
|
43
44
|
compiler emits `textFit`, `minFontSize`, base font sizes and state overrides;
|
|
44
45
|
native UI owns measurement and derives drawing sizes after layout validation.
|
|
45
46
|
See [Label compilation](label-text-layout.md). The application supplies UI
|
|
@@ -71,6 +72,13 @@ Development builds preserve application source module structure under
|
|
|
71
72
|
`manifest.json`. Static resources retain stable paths because application code
|
|
72
73
|
addresses them by key or URL.
|
|
73
74
|
|
|
75
|
+
With `output.versionedAssets: true`, the final stage hashes the complete output
|
|
76
|
+
and moves runtime files into `assets/<hash>/`. The entry HTML receives a base URL;
|
|
77
|
+
the root release manifest and BuildContext script paths receive the same prefix.
|
|
78
|
+
Relative references inside resources and ESM modules remain intact. This is one
|
|
79
|
+
version for the complete build, rather than independent hashes per resource.
|
|
80
|
+
See [release deployment](release-assets.md) for URL and hosting requirements.
|
|
81
|
+
|
|
74
82
|
Asset copying creates directories only when an accepted runtime file needs them.
|
|
75
83
|
KUI source files and source theme JSON are excluded when UI compilation is enabled,
|
|
76
84
|
so a skin-only `resource/ui` tree is absent from output. Mixed directories retain
|
|
@@ -84,7 +92,7 @@ convention-based reusable components. A component change can affect its source
|
|
|
84
92
|
namespace, paired skin, generated type declaration, and editor catalog, so that
|
|
85
93
|
path refreshes all four outputs as one operation. The server preserves the last
|
|
86
94
|
successful output after an invalid edit.
|
|
87
|
-
|
|
95
|
+
The resource watcher synchronizes all runtime assets even without UI,
|
|
88
96
|
and reconciles additions, deletions and directory replacement. Runtime-only
|
|
89
97
|
changes do not recompile skins. The fixed style.json and default.res.json paths
|
|
90
98
|
still trigger KUI compilation; font loading remains an application responsibility.
|
package/docs/default-ui-skins.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Default KUI skins
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
on 2026-10-10. CLI 3.5.0 contains the older atlas. The 2× kit requires published
|
|
5
|
-
Core ^2.5.0; actual published CLI scaffolding resolves that dependency.
|
|
3
|
+
The 2× atlas needs Core >= 2.5.0 within 2.x for source-density metadata.
|
|
6
4
|
The template owns the XML, textures and project colors; `@kurot/ui`
|
|
7
5
|
does not ship a bitmap theme or load a stylesheet itself.
|
|
8
6
|
|
|
@@ -30,14 +28,12 @@ to draw the components, and no runtime light/dark switching is introduced.
|
|
|
30
28
|
## Text and spacing
|
|
31
29
|
|
|
32
30
|
Single-line captions use `multiline="false" verticalAlign="middle"` with the
|
|
33
|
-
|
|
31
|
+
native dynamic-text ink centering. Button label padding is 10 pixels
|
|
34
32
|
above/below; its down state uses 12/8 to retain a deliberate 2-pixel press offset.
|
|
35
33
|
The icon has the same neutral/down centers. Panel titles also opt into middle
|
|
36
34
|
alignment. Input text retains Core's stable font baseline while its placeholder
|
|
37
35
|
uses dynamic visual centering. No language-specific skin offsets are required.
|
|
38
|
-
See [Core text alignment](../../core/docs/text-layout.md#
|
|
39
|
-
Published Core 2.4.0 does not contain that correction; the isolated preview uses
|
|
40
|
-
checkout Core for both text alignment and source density.
|
|
36
|
+
See [Core text alignment](../../core/docs/text-layout.md#baselines-and-cached-metrics).
|
|
41
37
|
|
|
42
38
|
## Resources and XML
|
|
43
39
|
|
|
@@ -72,13 +68,11 @@ automatic scrolling policies and touch/trackpad scrolling. To display bars in a
|
|
|
72
68
|
project, edit those parts explicitly.
|
|
73
69
|
|
|
74
70
|
ItemRenderer backgrounds fit the allocated row width without extra horizontal
|
|
75
|
-
padding.
|
|
76
|
-
|
|
77
|
-
shrinking the skin or changing its nine-slice grid is not required.
|
|
71
|
+
padding. Core encloses fractional WebGL scissor bounds so scaled Lists retain their
|
|
72
|
+
right outline; use the allocated row geometry without compensating skin offsets.
|
|
78
73
|
|
|
79
74
|
Group, List, TabBar, ViewStack and text/image nodes are composed directly in XML;
|
|
80
|
-
|
|
81
|
-
are removed. Use `itemRendererSkinName` to choose a List/TabBar row appearance,
|
|
75
|
+
they do not require placeholder default skins. Use `itemRendererSkinName` to choose a List/TabBar row appearance,
|
|
82
76
|
and wrap the node with Group/Image/Scroller for its surface and viewport.
|
|
83
77
|
|
|
84
78
|
## Native preview and maintenance
|
|
@@ -87,9 +81,7 @@ and wrap the node with Group/Image/Scroller for its surface and viewport.
|
|
|
87
81
|
`src/DefaultUI.ts` only connects data and events. The example installs its own
|
|
88
82
|
project font loader and document dependency; other projects are unchanged.
|
|
89
83
|
|
|
90
|
-
|
|
91
|
-
installed CLI remains 3.3.1, so use checkout CLI 3.6.0 for the current gallery's
|
|
92
|
-
constructor-name preservation. From the repository root:
|
|
84
|
+
Use the checkout CLI with the example's installed SDKs. From the repository root:
|
|
93
85
|
|
|
94
86
|
```sh
|
|
95
87
|
pnpm --dir packages/cli build
|
|
@@ -105,18 +97,15 @@ directory, the same CLI accepts `build` and `build --release` for one-shot build
|
|
|
105
97
|
The private asset tool's isolated source preview remains an optional maintenance
|
|
106
98
|
tool for testing checkout engine changes; it is not required by the installed Core.
|
|
107
99
|
|
|
108
|
-
CLI
|
|
100
|
+
The CLI preserves constructor names in development and release
|
|
109
101
|
engine/namespace bundles so Theme lookup also works for self-referencing
|
|
110
|
-
classes such as Scroller.
|
|
102
|
+
classes such as Scroller.
|
|
111
103
|
|
|
112
104
|
`tools/default-ui-assets` contains editable SVG geometry and the reproducible
|
|
113
105
|
PNG/atlas generator. It uses registry `@kurot/atlas@0.1.0` only as private
|
|
114
106
|
repository tooling. CLI and runtime SDKs gain no atlas dependency. See its
|
|
115
107
|
[maintenance instructions](../../../tools/default-ui-assets/README.md).
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Existing projects keep their own skins, resource keys and startup code. New
|
|
121
|
-
scaffolds receive this kit after the supporting Core and CLI publications;
|
|
122
|
-
installing a new CLI does not rewrite an existing project's resources.
|
|
109
|
+
Existing projects keep their own skins, resource keys and startup code. Updating
|
|
110
|
+
the installed CLI does not rewrite authored resources. New scaffolds receive
|
|
111
|
+
the template's current kit.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Development resource watching
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
receive these behaviors; installed CLI 3.3.0 does not include them.
|
|
3
|
+
`kurot dev` synchronizes runtime assets without additional watcher configuration.
|
|
4
|
+
Browser refresh remains manual.
|
|
6
5
|
|
|
7
6
|
## Inputs and rebuilds
|
|
8
7
|
|
package/docs/game-template.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
CLI 3.6.1 includes a project README and short AGENTS entry in both templates.
|
|
10
|
-
This version is prepared locally and has not been published.
|
|
11
|
-
They identify the gameplay entry, commands, expected startup, generated files
|
|
12
|
-
and task-specific guides in installed SDK packages. Read the consumer project's
|
|
13
|
-
manifest, lock and installation for its actual versions. These additions are
|
|
14
|
-
not in the already published CLI 3.6.0 artifact and do not rewrite existing games.
|
|
15
|
-
For gameplay, the entries point to Core's game-authoring guide when installed,
|
|
16
|
-
or the Star Catcher reference in an engine checkout; older packages retain their
|
|
17
|
-
README/type-declaration fallback.
|
|
18
|
-
|
|
19
|
-
The [standard UI guide](../../ui/docs/ui-authoring.md), bundled in UI 3.6.2, adds
|
|
20
|
-
directory, TS/Skin pairing and lifecycle rules above the API reference, with a
|
|
21
|
-
complete HUD recipe. The game README points at its installed copy. UI 3.6.2 and
|
|
22
|
-
CLI 3.6.1 are separate packages: installing UI supplies the guides, while using
|
|
23
|
-
the new CLI for create supplies template entry docs. Existing projects keep
|
|
24
|
-
their own instructions and can add the links explicitly.
|
|
1
|
+
# Game template startup and project services
|
|
2
|
+
|
|
3
|
+
The game template owns its style/font/language initialization, HTML, README and
|
|
4
|
+
AGENTS entry. The empty template stays Core-only. New scaffolds receive these
|
|
5
|
+
files; existing projects keep their own authored resources and instructions.
|
|
6
|
+
For UI organization and component/Skin pairing use
|
|
7
|
+
[standard authoring](../../ui/docs/ui-authoring.md) and the
|
|
8
|
+
[ScoreHUD recipe](../../ui/docs/recipes/score-hud.md).
|
|
25
9
|
|
|
26
10
|
## Files
|
|
27
11
|
|
|
@@ -49,8 +33,6 @@ Templates do not implement live font/theme/language replacement.
|
|
|
49
33
|
|
|
50
34
|
## HTML brand splash
|
|
51
35
|
|
|
52
|
-
This splash is included in published CLI 3.6.0; npm CLI 3.5.0 lacks it.
|
|
53
|
-
|
|
54
36
|
The game template's `web/index.html` presents `web/logo.png` beneath a small
|
|
55
37
|
"Made with" caption. The mascot makes a gentle entrance, then repeats a playful
|
|
56
38
|
hop and sway every 3.2 seconds while the entry module loads. Sparkles and a soft
|
|
@@ -67,9 +49,8 @@ existing project HTML is project-owned.
|
|
|
67
49
|
|
|
68
50
|
## Change fonts and colors
|
|
69
51
|
|
|
70
|
-
The
|
|
71
|
-
|
|
72
|
-
does not include this skin refresh. Skin state text colors compile from the
|
|
52
|
+
The [default KUI skins](default-ui-skins.md) use Kurot-owned textures under
|
|
53
|
+
resource/assets/ui/kui and a matching color palette. Skin state text colors compile from the
|
|
73
54
|
project stylesheet; texture colors are baked into the PNG, without live palette
|
|
74
55
|
switching. Templates inherit project fonts and retain the existing licensed files.
|
|
75
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Label text compilation
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
The CLI consumes ui-document ^0.13.0 and compiles KUI text-fitting properties
|
|
4
4
|
through the existing UIDocument → SkinIR → ESM factory pipeline. The semantic
|
|
5
5
|
document format remains version 2.
|
|
6
6
|
|
|
@@ -34,12 +34,10 @@ introduces build-time text measurement. See the
|
|
|
34
34
|
|
|
35
35
|
## Runtime boundary
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
package rather than importing the engine into the build process.
|
|
42
|
-
- `textFit` is `none` by default or `shrink` for ordinary single-line Labels.
|
|
37
|
+
- Applications supply an accepted Core/UI pair and satisfy the installed UI's
|
|
38
|
+
Core peer. The compiler depends on the headless document kernel.
|
|
39
|
+
- `textFit` is `none` by default or `shrink` for ordinary Labels.
|
|
40
|
+
Supported fitting modes and bounds follow the installed native UI contract.
|
|
43
41
|
Put a Button's policy on its `labelDisplay` skin part.
|
|
44
42
|
- `minFontSize` defaults to 12 logical pixels and must be finite and >= 1.
|
|
45
43
|
A minimum greater than the authored size does not enlarge the text.
|
|
@@ -47,20 +45,20 @@ introduces build-time text measurement. See the
|
|
|
47
45
|
State removal restores the authored base size before fitting again.
|
|
48
46
|
- `renderedSize` and `textFitOverflow` are runtime observations; do not author
|
|
49
47
|
them in KUI XML.
|
|
50
|
-
-
|
|
48
|
+
- EditableText rejects shrinking. Current native Label supports fitting in either
|
|
49
|
+
line mode; `multiline` continues to choose line generation.
|
|
51
50
|
- Load fonts before measuring text. For late loading, native UI callers use
|
|
52
51
|
`label.invalidateSize()` after the font becomes ready.
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
font-readiness rules.
|
|
56
|
-
|
|
53
|
+
The [native Label contract](../../ui/docs/label-text-layout.md) owns fitting,
|
|
54
|
+
overflow, layout and font-readiness rules. The compiler does not rewrite
|
|
55
|
+
existing skins or apply project translation rules.
|
|
57
56
|
|
|
58
|
-
##
|
|
57
|
+
## Authored line policy
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
Explicit `multiline="false"` means one unwrapped first line.
|
|
61
60
|
Remove that flag or set it to true where wrapping is intended. The literal-string
|
|
62
61
|
XML contract is retained: a backslash followed by `n` stays literal text rather
|
|
63
62
|
than becoming a hard separator.
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
an EXML migration or resource-format change.
|
|
64
|
+
EXML authoring uses the CLI 1.x line. This KUI compiler does not migrate EXML.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Versioned release assets
|
|
2
|
+
|
|
3
|
+
Enable content-addressed release packaging in `kurot.config.ts`:
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
export default {
|
|
7
|
+
output: { dir: 'bin-debug', versionedAssets: true },
|
|
8
|
+
// Keep the project's other settings.
|
|
9
|
+
};
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The option requires CLI >= 3.7.0 within 3.x. It defaults to false and is ignored
|
|
13
|
+
by development/watch builds.
|
|
14
|
+
An index query string does not propagate to requests for resources.
|
|
15
|
+
|
|
16
|
+
## Output and URLs
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
bin-release/web/<timestamp>/
|
|
20
|
+
├── index.html
|
|
21
|
+
├── manifest.json
|
|
22
|
+
└── assets/<hash>/
|
|
23
|
+
├── js/
|
|
24
|
+
├── resource/
|
|
25
|
+
└── <files copied beside the HTML template>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The hash is the first 32 hexadecimal characters of SHA-256 over sorted output
|
|
29
|
+
paths, file sizes and bytes, including generated HTML, theme JSON and scripts.
|
|
30
|
+
Any changed file changes the complete build's version. Identical builds retain
|
|
31
|
+
their URL; unchanged individual files also get new URLs when another file changes.
|
|
32
|
+
This trades granular cache reuse for one consistent release across all loaders.
|
|
33
|
+
|
|
34
|
+
The CLI inserts `<base href="./assets/<hash>/">` first inside `<head>`. A request
|
|
35
|
+
for `resource/assets/atlas.png` then resolves under the version directory, even
|
|
36
|
+
when the entry is `/game/index.html?launch=...`. Atlas `file` references, bitmap
|
|
37
|
+
font pages, stylesheet fonts, relative imports and direct browser requests use
|
|
38
|
+
that directory without rewriting authored resources or keys. The release manifest
|
|
39
|
+
stays at the root with prefixed script paths. Source maps move with their scripts.
|
|
40
|
+
|
|
41
|
+
Custom templates must have an explicit `<head>` and no `<base>` element. The
|
|
42
|
+
CLI inserts the base at the parsed start tag's source location without
|
|
43
|
+
reserializing the template. Quoted attributes and script/style text are preserved.
|
|
44
|
+
The build rejects symbolic links and other nonregular output files. Relative URLs
|
|
45
|
+
must refer to files inside the build; root-relative URLs, remote URLs, and URLs
|
|
46
|
+
explicitly based on location.href remain outside this mechanism. Applications
|
|
47
|
+
that construct URLs should use document.baseURI for build assets. Relative links
|
|
48
|
+
and forms also inherit the base; use explicit destinations for application navigation.
|
|
49
|
+
If hosting has a CSP base-uri directive, it must allow this same-origin base.
|
|
50
|
+
|
|
51
|
+
## Theme loading with existing UI
|
|
52
|
+
|
|
53
|
+
UI runtimes that resolve a relative Theme config against location.href need an
|
|
54
|
+
absolute config URL. The game starter uses:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const theme = new Theme(new URL('resource/default.thm.json', document.baseURI).href);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Use the same pattern in existing projects. This keeps the theme's `skinsJs`
|
|
61
|
+
import inside the version directory without requiring a UI runtime update.
|
|
62
|
+
|
|
63
|
+
## Deployment
|
|
64
|
+
|
|
65
|
+
Upload the complete generated directory, including `assets/<hash>/`. Upload new
|
|
66
|
+
asset directories first, then replace root manifest.json and index.html. Keep
|
|
67
|
+
previous version directories available while older sessions may request assets;
|
|
68
|
+
avoid deploy commands that delete those directories immediately. Publish the
|
|
69
|
+
entry at a directory URL ending in `/` or at its actual `index.html` URL.
|
|
70
|
+
|
|
71
|
+
Serve index.html with revalidation, for example `Cache-Control: no-cache`.
|
|
72
|
+
Serve `assets/<hash>/**` with `Cache-Control: public, max-age=31536000, immutable`.
|
|
73
|
+
If a launcher reads root manifest.json, give it revalidation too. These are server
|
|
74
|
+
settings; the CLI writes static files and cannot set response headers. Never
|
|
75
|
+
overwrite files inside an already published hash directory. Rollback replaces
|
|
76
|
+
the root entry files with those of the previous complete release.
|
package/docs/text-components.md
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
# BitmapLabel and RichLabel compilation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
must install UI `^3.3.0` and Core `^2.3.0`; Core 2.3.1 fixes unstyled blank
|
|
7
|
-
rich-text line metrics. The CLI does not install or bundle its own Core/UI.
|
|
8
|
-
Document format version 2 and existing project configuration are unchanged.
|
|
9
|
-
Installing UI 3.4.0 requires Core ^2.4.0 for that package's centered-flip contract.
|
|
3
|
+
The compiler registers native text types through ui-document and generates Skin
|
|
4
|
+
factories. Applications supply an accepted Core/UI pair; the CLI does not bundle
|
|
5
|
+
its own engine. Semantic document format is 2.
|
|
10
6
|
|
|
11
7
|
```xml
|
|
12
8
|
<Skin xmlns="https://kurot.dev/ui/1" class="TextSkin" states="disabled">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurot/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Kurot CLI - build tool for Kurot Editor KUI XML workflows",
|
|
5
5
|
"author": "Kelvin <kyia.x52@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@kurot/ui-document": "^0.13.0",
|
|
32
32
|
"commander": "^13.0.0",
|
|
33
|
-
"esbuild": "^0.25.0"
|
|
33
|
+
"esbuild": "^0.25.0",
|
|
34
|
+
"parse5": "^7.3.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@types/node": "^22.0.0",
|
|
@@ -75,7 +75,7 @@ class Main extends UILayer {
|
|
|
75
75
|
|
|
76
76
|
private async _loadTheme(): Promise<void> {
|
|
77
77
|
// Load the theme and its default UI skin mappings.
|
|
78
|
-
const theme = new Theme('resource/default.thm.json');
|
|
78
|
+
const theme = new Theme(new URL('resource/default.thm.json', document.baseURI).href);
|
|
79
79
|
await new Promise<void>(resolve => theme.addEventListener(Event.COMPLETE, () => resolve()));
|
|
80
80
|
}
|
|
81
81
|
|