@kurot/cli 3.6.1 → 3.8.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +129 -2
  2. package/README.md +49 -121
  3. package/dist/core/config-watcher.d.ts +8 -0
  4. package/dist/core/config-watcher.d.ts.map +1 -0
  5. package/dist/core/config-watcher.js +63 -0
  6. package/dist/core/config-watcher.js.map +1 -0
  7. package/dist/core/config.d.ts +12 -2
  8. package/dist/core/config.d.ts.map +1 -1
  9. package/dist/core/config.js +26 -6
  10. package/dist/core/config.js.map +1 -1
  11. package/dist/core/dev-server.d.ts.map +1 -1
  12. package/dist/core/dev-server.js +2 -0
  13. package/dist/core/dev-server.js.map +1 -1
  14. package/dist/core/diagnostics/codes.d.ts +2 -0
  15. package/dist/core/diagnostics/codes.d.ts.map +1 -1
  16. package/dist/core/diagnostics/codes.js +2 -0
  17. package/dist/core/diagnostics/codes.js.map +1 -1
  18. package/dist/core/diagnostics/output.d.ts +1 -1
  19. package/dist/core/diagnostics/output.d.ts.map +1 -1
  20. package/dist/core/plugins/generate-html.d.ts +7 -1
  21. package/dist/core/plugins/generate-html.d.ts.map +1 -1
  22. package/dist/core/plugins/generate-html.js +20 -4
  23. package/dist/core/plugins/generate-html.js.map +1 -1
  24. package/dist/core/plugins/index.d.ts +2 -1
  25. package/dist/core/plugins/index.d.ts.map +1 -1
  26. package/dist/core/plugins/index.js +4 -1
  27. package/dist/core/plugins/index.js.map +1 -1
  28. package/dist/core/plugins/version-assets.d.ts +7 -0
  29. package/dist/core/plugins/version-assets.d.ts.map +1 -0
  30. package/dist/core/plugins/version-assets.js +108 -0
  31. package/dist/core/plugins/version-assets.js.map +1 -0
  32. package/docs/ai-context.md +42 -58
  33. package/docs/architecture.md +14 -2
  34. package/docs/default-ui-skins.md +12 -23
  35. package/docs/dev-resource-watching.md +25 -6
  36. package/docs/game-template.md +20 -29
  37. package/docs/label-text-layout.md +13 -15
  38. package/docs/release-assets.md +76 -0
  39. package/docs/text-components.md +3 -7
  40. package/package.json +3 -2
  41. package/templates/empty/README.md +4 -1
  42. package/templates/empty/src/Main.ts +5 -7
  43. package/templates/game/README.md +4 -1
  44. package/templates/game/src/Main.ts +2 -8
@@ -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.6.0 consumes ui-document ^0.13.0, retaining Label text-fitting metadata. The
43
+ CLI 3.8.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,11 +92,15 @@ 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
- Since 3.3.1, the resource watcher synchronizes all runtime assets even without UI,
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.
91
99
  Changes are debounced and queued, with changed bytes staged before publication.
100
+ A shallow root configuration watcher re-evaluates ESM config after stage edits
101
+ and publishes complete HTML through an atomic rename. Invalid values retain the
102
+ last successful page; structural build changes require restarting dev. This path
103
+ shares the resource build queue and does not mutate the immutable Project.
92
104
  Browser refresh remains manual and HTTP responses use no-store. Individual
93
105
  renames do not form an atomic multi-file transaction. See
94
106
  [resource watching](dev-resource-watching.md).
@@ -1,8 +1,6 @@
1
1
  # Default KUI skins
2
2
 
3
- This game-template refresh is included in published CLI 3.6.0, verified on npm
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
- Core 2.5.0 ink-centering correction. Button label padding is 10 pixels
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#visual-centering-and-stable-baselines-core-250).
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. The checkout Core also fixes fractional WebGL scissor bounds so scaled
76
- Lists retain their right outline. Published Core 2.4.0 lacks that correction;
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
- their old default-Skin placeholders were not conventional Theme mappings and
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
- The example now locks registry Core 2.5.4, which supports sheet density. Its
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 3.6.0 preserves constructor names in development and release
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. Published CLI 3.5.0 lacks the development correction.
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
- Core 2.5.0 and CLI 3.6.0 are published; Core was published first.
118
- UI/Game/document/runtime need no incidental release; existing 1× consumers keep
119
- their behavior. See [density units and adoption](../../core/docs/texture-density.md).
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
- Available in published CLI 3.3.1. No configuration or
4
- dependency-range changes are required. Projects must install the new CLI to
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
 
@@ -18,9 +17,26 @@ translations and other project-owned files.
18
17
  | PNG, fonts, language properties and other runtime files | Synchronize assets |
19
18
  | Resource directory creation, replacement or deletion | Reconnect watcher and reconcile output; compile KUI when enabled |
20
19
  | Reusable component source or skin | Retain component discovery/namespace/catalog rebuild and synchronize assets |
21
-
22
- Changes to `kurot.config.ts`, dependencies or build configuration still require
23
- restarting dev. Locale configuration is consumed by project code; the CLI does
20
+ | Root kurot.config.ts or .js stage defaults | Validate and atomically regenerate HTML; refresh manually |
21
+
22
+ With CLI >= 3.8.0 within 3.x, stage defaults in `kurot.config.ts` / `.js` can be
23
+ saved without restarting `kurot dev`. `kurot build --watch` retains its existing
24
+ source-watch behavior and does not install the configuration watcher.
25
+ After the successful configuration update, refresh the browser manually. The
26
+ new Player consumes HTML canvas attributes with the Core behavior described in
27
+ [stage configuration](../../core/docs/stage-configuration.md), requiring Core
28
+ >= 2.6.0 within 2.x; explicit runtime options still take priority.
29
+
30
+ The watcher handles ordinary and atomic editor saves of the root ESM config file,
31
+ re-evaluates it with a fresh module URL, validates width/height, scale mode,
32
+ orientation and frame rate, and atomically replaces only the generated HTML.
33
+ Invalid edits keep the last successful page, report an error and allow correction
34
+ without restarting. Imported configuration helpers and dependencies are not
35
+ reloaded; edits to them still require restarting dev.
36
+
37
+ Changes outside `stage`, including entry/output/UI paths, or dependencies still
38
+ require restarting dev. A detected structural config change reports
39
+ `KUROT_CONFIG_RESTART_REQUIRED` and leaves the active outputs intact. Locale configuration is consumed by project code; the CLI does
24
40
  not introduce a locale parser or mutate authored skins. A style edit may change
25
41
  compiled skin assignments while its XML remains untouched.
26
42
 
@@ -53,6 +69,9 @@ A resource-only batch emits JSONL build-start with reason `resource-change`,
53
69
  followed by build-complete after synchronization. Existing `kui-change` and
54
70
  `source-change` reasons retain their meaning. Consumers should tolerate the
55
71
  additional reason and refresh only after a successful build-complete event.
72
+ Root configuration updates emit `config-change`; failures additionally emit
73
+ `KUROT_CONFIG_RELOAD_FAILED` or `KUROT_CONFIG_RESTART_REQUIRED` diagnostics.
74
+ The stage watcher shares this serialized queue with resource/component work.
56
75
 
57
76
  ## Preview and atlas boundaries
58
77
 
@@ -1,27 +1,11 @@
1
- # Project styles and languages in the game template
2
-
3
- Project-owned style/font/language initialization was introduced in CLI 3.2.1
4
- and remains in published CLI 3.6.0. Existing projects keep their own startup
5
- code and HTML; the empty template stays minimal.
6
-
7
- ## Project documentation in 3.6.1
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
 
@@ -47,9 +31,17 @@ This ordering includes loading-screen Labels in the project font. The loading
47
31
  screen's startup messages stay in English because translations are not loaded yet.
48
32
  Templates do not implement live font/theme/language replacement.
49
33
 
50
- ## HTML brand splash
34
+ ## Stage defaults
51
35
 
52
- This splash is included in published CLI 3.6.0; npm CLI 3.5.0 lacks it.
36
+ Both starters use `createPlayer({ canvas })`. Configure width, height, scale mode,
37
+ orientation and frame rate in `kurot.config.ts`; the CLI writes canvas attributes.
38
+ This requires Core >= 2.6.0 within 2.x, documented in
39
+ [stage configuration](../../core/docs/stage-configuration.md). Explicit options
40
+ remain available for intentional overrides. In dev, save stage settings, wait
41
+ for the configuration update and refresh the browser with CLI >= 3.8.0 within
42
+ 3.x; no dev restart is needed.
43
+
44
+ ## HTML brand splash
53
45
 
54
46
  The game template's `web/index.html` presents `web/logo.png` beneath a small
55
47
  "Made with" caption. The mascot makes a gentle entrance, then repeats a playful
@@ -67,9 +59,8 @@ existing project HTML is project-owned.
67
59
 
68
60
  ## Change fonts and colors
69
61
 
70
- The CLI 3.6.0 [default KUI skins](default-ui-skins.md) use Kurot-owned textures
71
- under resource/assets/ui/kui and a matching color palette. Registry CLI 3.5.0
72
- does not include this skin refresh. Skin state text colors compile from the
62
+ The [default KUI skins](default-ui-skins.md) use Kurot-owned textures under
63
+ resource/assets/ui/kui and a matching color palette. Skin state text colors compile from the
73
64
  project stylesheet; texture colors are baked into the PNG, without live palette
74
65
  switching. Templates inherit project fonts and retain the existing licensed files.
75
66
 
@@ -1,6 +1,6 @@
1
1
  # Label text compilation
2
2
 
3
- CLI 3.6.0 consumes ui-document ^0.13.0 and compiles KUI text-fitting properties
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
- - The application must install UI `^3.1.0` and Core `^2.1.0` for shrinking.
38
- These are the feature's original API minimums. Installing current UI 3.4.0
39
- requires Core `^2.4.0` for that package's centered-flip contract.
40
- They remain application dependencies; CLI depends on the headless document
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
- - Multiline Labels keep their base size; EditableText rejects shrinking.
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
- UI 3.1's public Label contract owns the full fitting, overflow, layout and
55
- font-readiness rules. ui-document 0.9's catalog describes the authoring fields.
56
- The build does not rewrite existing skins or apply project translation rules.
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
- ## Migration
57
+ ## Authored line policy
59
58
 
60
- In Core 2.1.0, explicit `multiline="false"` means one unwrapped first line.
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
- Existing EXML projects remain on CLI 1.3.x. The KUI release does not introduce
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.
@@ -1,12 +1,8 @@
1
1
  # BitmapLabel and RichLabel compilation
2
2
 
3
- Native text compilation was introduced in CLI 3.4.0 with document 0.12.0.
4
- Current CLI 3.6.0 requires published ui-document ^0.13.0 and retains these tags.
5
- Applications rendering these tags
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.6.1",
3
+ "version": "3.8.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",
@@ -33,7 +33,10 @@ browser console, resource requests and intended interactions.
33
33
  - `src/Main.ts`: creates the single Player and root Sprite; add game objects
34
34
  and input/update logic here or in application modules it imports.
35
35
  - `kurot.config.ts`: build entry, stage settings and output paths. Keep explicit
36
- createPlayer options in Main consistent with the intended stage settings.
36
+ stage defaults here; Main uses `createPlayer({ canvas })` to consume the generated
37
+ canvas attributes. This requires Core >= 2.6.0 within 2.x. With CLI >= 3.8.0
38
+ within 3.x, save stage edits, wait for the dev update, then refresh the browser;
39
+ structural build changes require restarting dev.
37
40
  - `template/web/index.html`: authored HTML and canvas.
38
41
  - `bin-debug/`, `bin-release/` and `.kurot/`: generated files; edit their inputs.
39
42
 
@@ -21,12 +21,10 @@ class Main extends Sprite {
21
21
  }
22
22
 
23
23
  // ── Bootstrap ─────────────────────────────────────────────────────────────
24
- const app = createPlayer({
25
- canvas: document.getElementById('gameCanvas') as HTMLCanvasElement,
26
- contentWidth: 640,
27
- contentHeight: 1136,
28
- scaleMode: 'showAll',
29
- frameRate: 60,
30
- });
24
+ const canvas = document.getElementById('gameCanvas');
25
+ if (!(canvas instanceof HTMLCanvasElement)) {
26
+ throw new Error('Missing gameCanvas.');
27
+ }
28
+ const app = createPlayer({ canvas });
31
29
 
32
30
  app.start(new Main());
@@ -45,7 +45,10 @@ requests and the intended interactions in the browser.
45
45
  `src/components/<Name>.ts` with
46
46
  `resource/ui/components/<Name>Skin.kui.xml`; export the matching class name.
47
47
  - `kurot.config.ts`: build/stage/component settings; `template/web/index.html`:
48
- authored HTML. Keep explicit createPlayer options consistent with stage intent.
48
+ authored HTML. Main uses `createPlayer({ canvas })` with the generated canvas
49
+ attributes; edit stage defaults only in config. This requires Core >= 2.6.0
50
+ within 2.x. With CLI >= 3.8.0 within 3.x, save stage edits, wait for the update
51
+ and refresh the browser; structural build changes require restarting.
49
52
  - `bin-debug/`, `bin-release/`, `.kurot/` and generated theme JSON: build outputs.
50
53
  Edit authored inputs; the CLI generates the Skin module and part declarations.
51
54
 
@@ -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
 
@@ -181,13 +181,7 @@ async function start(): Promise<void> {
181
181
  if (!(canvas instanceof HTMLCanvasElement)) {
182
182
  throw new Error('Missing gameCanvas.');
183
183
  }
184
- const app = createPlayer({
185
- canvas,
186
- contentWidth: 640,
187
- contentHeight: 1136,
188
- scaleMode: 'showAll',
189
- frameRate: 60,
190
- });
184
+ const app = createPlayer({ canvas });
191
185
  app.start(new Main());
192
186
  }
193
187