@kurot/cli 3.3.0 → 3.4.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 +66 -0
- package/README.md +31 -6
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/core/components/discover-components.d.ts.map +1 -1
- package/dist/core/components/discover-components.js +27 -0
- package/dist/core/components/discover-components.js.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +6 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/dev-server.d.ts +2 -2
- package/dist/core/dev-server.d.ts.map +1 -1
- package/dist/core/dev-server.js +78 -45
- package/dist/core/dev-server.js.map +1 -1
- package/dist/core/diagnostics/collector.d.ts +9 -0
- package/dist/core/diagnostics/collector.d.ts.map +1 -1
- package/dist/core/diagnostics/collector.js +12 -0
- package/dist/core/diagnostics/collector.js.map +1 -1
- package/dist/core/diagnostics/output.d.ts +1 -1
- package/dist/core/diagnostics/output.d.ts.map +1 -1
- package/dist/core/errors.d.ts +6 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +6 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/kui/codegen.js +63 -0
- package/dist/core/kui/codegen.js.map +1 -1
- package/dist/core/kui/kui-diagnostics.d.ts.map +1 -1
- package/dist/core/kui/kui-diagnostics.js.map +1 -1
- package/dist/core/kui/kui-parser.d.ts.map +1 -1
- package/dist/core/kui/kui-parser.js +45 -4
- package/dist/core/kui/kui-parser.js.map +1 -1
- package/dist/core/kui/registry.d.ts.map +1 -1
- package/dist/core/kui/registry.js +11 -0
- package/dist/core/kui/registry.js.map +1 -1
- package/dist/core/kui/skin-module-builder.js +15 -0
- package/dist/core/kui/skin-module-builder.js.map +1 -1
- package/dist/core/kui/skin-parts-declaration.d.ts.map +1 -1
- package/dist/core/kui/skin-parts-declaration.js +27 -0
- package/dist/core/kui/skin-parts-declaration.js.map +1 -1
- package/dist/core/kui/source-location.d.ts +3 -0
- package/dist/core/kui/source-location.d.ts.map +1 -1
- package/dist/core/kui/source-location.js +3 -0
- package/dist/core/kui/source-location.js.map +1 -1
- package/dist/core/kui/validate-text-components.d.ts +7 -0
- package/dist/core/kui/validate-text-components.d.ts.map +1 -0
- package/dist/core/kui/validate-text-components.js +40 -0
- package/dist/core/kui/validate-text-components.js.map +1 -0
- package/dist/core/namespace-external-plugin.d.ts.map +1 -1
- package/dist/core/namespace-external-plugin.js +3 -0
- package/dist/core/namespace-external-plugin.js.map +1 -1
- package/dist/core/plugins/clean-output.d.ts.map +1 -1
- package/dist/core/plugins/clean-output.js +3 -0
- package/dist/core/plugins/clean-output.js.map +1 -1
- package/dist/core/plugins/compile-custom-namespaces.d.ts.map +1 -1
- package/dist/core/plugins/compile-custom-namespaces.js +15 -0
- package/dist/core/plugins/compile-custom-namespaces.js.map +1 -1
- package/dist/core/plugins/compile-engine.d.ts.map +1 -1
- package/dist/core/plugins/compile-engine.js +3 -0
- package/dist/core/plugins/compile-engine.js.map +1 -1
- package/dist/core/plugins/compile-kui.d.ts.map +1 -1
- package/dist/core/plugins/compile-kui.js +27 -0
- package/dist/core/plugins/compile-kui.js.map +1 -1
- package/dist/core/plugins/compile-source.d.ts.map +1 -1
- package/dist/core/plugins/compile-source.js +6 -0
- package/dist/core/plugins/compile-source.js.map +1 -1
- package/dist/core/plugins/component-catalog.d.ts.map +1 -1
- package/dist/core/plugins/component-catalog.js +3 -0
- package/dist/core/plugins/component-catalog.js.map +1 -1
- package/dist/core/plugins/copy-assets.d.ts.map +1 -1
- package/dist/core/plugins/copy-assets.js +3 -0
- package/dist/core/plugins/copy-assets.js.map +1 -1
- package/dist/core/plugins/generate-html.d.ts.map +1 -1
- package/dist/core/plugins/generate-html.js +3 -0
- package/dist/core/plugins/generate-html.js.map +1 -1
- package/dist/core/plugins/manifest.d.ts.map +1 -1
- package/dist/core/plugins/manifest.js +3 -0
- package/dist/core/plugins/manifest.js.map +1 -1
- package/dist/core/project.d.ts.map +1 -1
- package/dist/core/project.js +6 -0
- package/dist/core/project.js.map +1 -1
- package/dist/core/resource-asset-sync.d.ts +8 -0
- package/dist/core/resource-asset-sync.d.ts.map +1 -0
- package/dist/core/resource-asset-sync.js +121 -0
- package/dist/core/resource-asset-sync.js.map +1 -0
- package/dist/core/resource-watcher.d.ts +6 -0
- package/dist/core/resource-watcher.d.ts.map +1 -0
- package/dist/core/resource-watcher.js +54 -0
- package/dist/core/resource-watcher.js.map +1 -0
- package/dist/core/template.d.ts.map +1 -1
- package/dist/core/template.js.map +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/logger.d.ts +15 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +18 -0
- package/dist/utils/logger.js.map +1 -1
- package/docs/ai-context.md +24 -4
- package/docs/architecture.md +9 -3
- package/docs/dev-resource-watching.md +88 -0
- package/docs/label-text-layout.md +1 -1
- package/docs/text-components.md +45 -0
- package/package.json +2 -2
package/dist/utils/logger.js
CHANGED
|
@@ -6,6 +6,9 @@ const cyan = '\x1b[36m';
|
|
|
6
6
|
const dim = '\x1b[2m';
|
|
7
7
|
const tag = `${cyan}[kurot]${reset}`;
|
|
8
8
|
let enabled = true;
|
|
9
|
+
/**
|
|
10
|
+
* Writes human-readable logs only when logging is enabled.
|
|
11
|
+
*/
|
|
9
12
|
function write(method, message) {
|
|
10
13
|
if (!enabled)
|
|
11
14
|
return;
|
|
@@ -22,10 +25,25 @@ export function setLoggerEnabled(value) {
|
|
|
22
25
|
* Human-readable CLI logger with a consistent Kurot prefix and severity color.
|
|
23
26
|
*/
|
|
24
27
|
export const logger = {
|
|
28
|
+
/**
|
|
29
|
+
* Writes an informational message.
|
|
30
|
+
*/
|
|
25
31
|
info: (msg) => write('log', `${tag} ${msg}`),
|
|
32
|
+
/**
|
|
33
|
+
* Writes a successful-operation message.
|
|
34
|
+
*/
|
|
26
35
|
success: (msg) => write('log', `${tag} ${green}${msg}${reset}`),
|
|
36
|
+
/**
|
|
37
|
+
* Writes a warning message.
|
|
38
|
+
*/
|
|
27
39
|
warn: (msg) => write('warn', `${tag} ${yellow}${msg}${reset}`),
|
|
40
|
+
/**
|
|
41
|
+
* Writes an error message.
|
|
42
|
+
*/
|
|
28
43
|
error: (msg) => write('error', `${tag} ${red}${msg}${reset}`),
|
|
44
|
+
/**
|
|
45
|
+
* Writes a build-stage message.
|
|
46
|
+
*/
|
|
29
47
|
step: (msg) => write('log', `${tag} ${dim}›${reset} ${msg}`),
|
|
30
48
|
};
|
|
31
49
|
//# sourceMappingURL=logger.js.map
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,GAAG,GAAG,UAAU,CAAC;AACvB,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,GAAG,GAAG,SAAS,CAAC;AAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,UAAU,KAAK,EAAE,CAAC;AAErC,IAAI,OAAO,GAAG,IAAI,CAAC;AAEnB,SAAS,KAAK,CAAC,MAAgC,EAAE,OAAe;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC9C,OAAO,GAAG,KAAK,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,IAAI,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,GAAG,GAAG,UAAU,CAAC;AACvB,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,GAAG,GAAG,SAAS,CAAC;AAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,UAAU,KAAK,EAAE,CAAC;AAErC,IAAI,OAAO,GAAG,IAAI,CAAC;AAEnB;;GAEG;AACH,SAAS,KAAK,CAAC,MAAgC,EAAE,OAAe;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC9C,OAAO,GAAG,KAAK,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IAE1D;;OAEG;IACH,OAAO,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAE7E;;OAEG;IACH,IAAI,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,MAAM,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAE5E;;OAEG;IACH,KAAK,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAE3E;;OAEG;IACH,IAAI,EAAE,CAAC,GAAW,EAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;CAC1E,CAAC"}
|
package/docs/ai-context.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @kurot/cli — AI context map
|
|
2
2
|
|
|
3
3
|
Read this before exploring `src/`. [`architecture.md`](./architecture.md)
|
|
4
|
-
explains the plugin pipeline.
|
|
5
|
-
|
|
4
|
+
explains the plugin pipeline. Version `@kurot/cli@3.4.0` is prepared (not yet published), runs on Node.js 20+,
|
|
5
|
+
and is installed as a project dev dependency.
|
|
6
6
|
|
|
7
7
|
## Directory map
|
|
8
8
|
|
|
@@ -16,6 +16,8 @@ src/
|
|
|
16
16
|
│ ├── project.ts resolved paths, dependencies, namespaces
|
|
17
17
|
│ ├── pipeline.ts BuildContext and ordered plugin runner
|
|
18
18
|
│ ├── dev-server.ts static server and watchers
|
|
19
|
+
│ ├── resource-watcher.ts recursive resource + shallow parent watch/reconnect
|
|
20
|
+
│ ├── resource-asset-sync.ts content comparison, staged writes and deletion reconciliation
|
|
19
21
|
│ ├── diagnostics/ stable codes and JSON/JSONL output
|
|
20
22
|
│ ├── components/ reusable component discovery
|
|
21
23
|
│ ├── kui/ UIDocument → SkinIR → ESM compiler
|
|
@@ -28,8 +30,21 @@ The 3.2.1 game template includes fixed style/locale configuration,
|
|
|
28
30
|
English properties and licensed regular/bold font files. StyleManager finishes
|
|
29
31
|
font loading before Main creates Player/Preloader; LocaleManager registers
|
|
30
32
|
preload texts before creating the scene. See [game-template.md](game-template.md).
|
|
31
|
-
Version 3.3.0 is
|
|
33
|
+
Version 3.3.0 is published with Label preset compilation and
|
|
32
34
|
published ui-document 0.11.0. It has no local document-kernel override.
|
|
35
|
+
Published version 3.3.1 adds whole-resource dev synchronization, deletion/reconnect
|
|
36
|
+
handling and no-store responses. Installed CLI 3.3.0 lacks these fixes; consumers
|
|
37
|
+
must update their installed/locked version to receive them.
|
|
38
|
+
|
|
39
|
+
## Native text adoption in 3.4.0
|
|
40
|
+
|
|
41
|
+
The prepared release registers BitmapLabel and RichLabel from published UI
|
|
42
|
+
3.3.0 and consumes document 0.12.0. `kui/validate-text-components.ts` applies
|
|
43
|
+
strict shared property/state validation only to these new built-ins, preserving
|
|
44
|
+
existing CLI-only and custom class contracts. Text flows remain literal arrays;
|
|
45
|
+
Span data does not create nodes/parts. Only width/height use percent conversion.
|
|
46
|
+
See [text-components.md](text-components.md). Apps need Core ^2.3.0/UI ^3.3.0
|
|
47
|
+
when using the new tags; other controls need no incidental engine upgrade.
|
|
33
48
|
|
|
34
49
|
## KUI compilation
|
|
35
50
|
|
|
@@ -45,7 +60,7 @@ and layout apply to the runtime Skin, and its direct visual children become
|
|
|
45
60
|
`property.state` attributes. Storage IDs and runtime mapping metadata are not
|
|
46
61
|
authored XML fields.
|
|
47
62
|
|
|
48
|
-
CLI 3.
|
|
63
|
+
CLI 3.4.0 requires published `@kurot/ui-document@^0.12.0`. Schema-defined strings, including
|
|
49
64
|
numeric/boolean-looking text and state text, are literal attributes without
|
|
50
65
|
backslash type escaping. Old synthetic prefixes become literal characters;
|
|
51
66
|
do not migrate them silently. Numeric/boolean properties and schema-free
|
|
@@ -88,6 +103,11 @@ manual prefix cannot conflict with `ui.components.namespace`.
|
|
|
88
103
|
`--strict` or release policy.
|
|
89
104
|
- Machine diagnostic modes own stdout: build emits one JSON result; dev emits
|
|
90
105
|
JSONL lifecycle events.
|
|
106
|
+
- Since 3.3.1, dev watches all resource assets even without UI, emits
|
|
107
|
+
resource-change for copy-only batches, retains KUI requirements across mixed
|
|
108
|
+
batches, and reconciles deletions. Browser refresh remains manual; HTTP is
|
|
109
|
+
no-store. Per-file staging/rename is not an atomic atlas pair transaction.
|
|
110
|
+
Read [dev resource watching](dev-resource-watching.md) for the exact boundaries.
|
|
91
111
|
- `compileCustomNamespaces` must precede `compileSource`. Application-relative
|
|
92
112
|
imports and generated `#ns/<prefix>` imports must resolve to one bundled class
|
|
93
113
|
identity.
|
package/docs/architecture.md
CHANGED
|
@@ -39,7 +39,7 @@ factory variables, property assignments, semantic layout children, and state
|
|
|
39
39
|
property overrides. Document contracts, reusable instances, data bindings, and
|
|
40
40
|
actions remain `UIDocument` concepts.
|
|
41
41
|
|
|
42
|
-
CLI 3.
|
|
42
|
+
CLI 3.4.0 consumes ui-document 0.12.x, retaining Label text-fitting metadata. The
|
|
43
43
|
compiler emits `textFit`, `minFontSize`, base font sizes and state overrides;
|
|
44
44
|
native UI owns measurement and derives drawing sizes after layout validation.
|
|
45
45
|
See [Label compilation](label-text-layout.md). The application supplies UI
|
|
@@ -78,8 +78,14 @@ convention-based reusable components. A component change can affect its source
|
|
|
78
78
|
namespace, paired skin, generated type declaration, and editor catalog, so that
|
|
79
79
|
path refreshes all four outputs as one operation. The server preserves the last
|
|
80
80
|
successful output after an invalid edit.
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
Since 3.3.1, the resource watcher synchronizes all runtime assets even without UI,
|
|
82
|
+
and reconciles additions, deletions and directory replacement. Runtime-only
|
|
83
|
+
changes do not recompile skins. The fixed style.json and default.res.json paths
|
|
84
|
+
still trigger KUI compilation; font loading remains an application responsibility.
|
|
85
|
+
Changes are debounced and queued, with changed bytes staged before publication.
|
|
86
|
+
Browser refresh remains manual and HTTP responses use no-store. Individual
|
|
87
|
+
renames do not form an atomic multi-file transaction. See
|
|
88
|
+
[resource watching](dev-resource-watching.md).
|
|
83
89
|
|
|
84
90
|
## Diagnostics
|
|
85
91
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Development resource watching
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Inputs and rebuilds
|
|
8
|
+
|
|
9
|
+
`kurot dev` watches the entire `resource/` subtree regardless of whether `ui` is
|
|
10
|
+
enabled. Runtime files do not need an extension allowlist or a special atlas
|
|
11
|
+
directory. This includes JSON configurations, PNG/JPEG/WebP, fonts, audio,
|
|
12
|
+
translations and other project-owned files.
|
|
13
|
+
|
|
14
|
+
| Input change | Action |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| KUI source, default.res.json or config/style.json in a UI project | Compile KUI and synchronize runtime assets |
|
|
17
|
+
| Runtime JSON, including config/locale.json and sheet JSON | Synchronize assets |
|
|
18
|
+
| PNG, fonts, language properties and other runtime files | Synchronize assets |
|
|
19
|
+
| Resource directory creation, replacement or deletion | Reconnect watcher and reconcile output; compile KUI when enabled |
|
|
20
|
+
| 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
|
|
24
|
+
not introduce a locale parser or mutate authored skins. A style edit may change
|
|
25
|
+
compiled skin assignments while its XML remains untouched.
|
|
26
|
+
|
|
27
|
+
The resource watcher uses recursive `fs.watch` on the resource directory plus a
|
|
28
|
+
shallow parent watcher, so it can reconnect when a missing root is created or an
|
|
29
|
+
existing root is replaced. It does not recursively watch dependencies or build
|
|
30
|
+
output. Native recursive watch support is required; setup failures are logged.
|
|
31
|
+
|
|
32
|
+
## Batches and synchronization
|
|
33
|
+
|
|
34
|
+
Events are debounced for 100 ms. A batch retains its need for KUI compilation even
|
|
35
|
+
when a later event concerns only a runtime resource. Resource updates and
|
|
36
|
+
component rebuilds share a serialized queue. Failed KUI batches are retried on
|
|
37
|
+
subsequent resource edits before any resource synchronization can succeed.
|
|
38
|
+
|
|
39
|
+
Synchronization scans source assets, compares SHA-256 content hashes and writes
|
|
40
|
+
only changed files. It stages every changed file on the output filesystem before
|
|
41
|
+
publishing. Each changed file is renamed into place; source-owned deleted files
|
|
42
|
+
and empty parent directories are removed. Directory renames and file/directory
|
|
43
|
+
replacements are reconciled. Generated theme files, compiled bundles and catalogs
|
|
44
|
+
are not treated as source-owned assets. Identical contents are not rewritten.
|
|
45
|
+
|
|
46
|
+
Source renames during a scan are retried at most twice after an initial ENOENT
|
|
47
|
+
failure. Other errors are reported through a failed build-complete event; dev
|
|
48
|
+
stays running for the next edit. A failed scan leaves staged bytes unpublished.
|
|
49
|
+
Publication itself can fail after some files have been renamed: this is not a
|
|
50
|
+
rollback transaction.
|
|
51
|
+
|
|
52
|
+
A resource-only batch emits JSONL build-start with reason `resource-change`,
|
|
53
|
+
followed by build-complete after synchronization. Existing `kui-change` and
|
|
54
|
+
`source-change` reasons retain their meaning. Consumers should tolerate the
|
|
55
|
+
additional reason and refresh only after a successful build-complete event.
|
|
56
|
+
|
|
57
|
+
## Preview and atlas boundaries
|
|
58
|
+
|
|
59
|
+
Browser refresh remains manual. Successful HTTP responses use
|
|
60
|
+
`Cache-Control: no-store`, so a reloaded preview requests current output files.
|
|
61
|
+
The CLI does not invalidate resources inside a running game's Core cache.
|
|
62
|
+
Reskin's existing reload-preview button can load synchronized assets without
|
|
63
|
+
restarting the dev process.
|
|
64
|
+
|
|
65
|
+
Atlas PNG and JSON can be saved together and handled in the same debounce batch.
|
|
66
|
+
The CLI copies bytes; it does not parse or validate atlas geometry, discover
|
|
67
|
+
source images, pack atlases or require an atlas dependency. It does not infer
|
|
68
|
+
when an external packer has finished a job.
|
|
69
|
+
|
|
70
|
+
**Debouncing and per-file atomic renames are not an atomic PNG/JSON transaction.**
|
|
71
|
+
Files saved farther apart can produce separate successful batches, and a request
|
|
72
|
+
during publication can observe different generations. For now, save both files
|
|
73
|
+
before refreshing. A tool requiring strict cross-process group consistency needs
|
|
74
|
+
a separate commit notification/version protocol; that is outside this change.
|
|
75
|
+
|
|
76
|
+
Every resource batch currently scans and hashes the complete source asset tree,
|
|
77
|
+
reading one file at a time and staging changed files on disk. This avoids retaining
|
|
78
|
+
all decoded assets in memory and avoids rewriting unchanged output, but scan I/O
|
|
79
|
+
still grows with total resource size. Path-based scan caches can be evaluated
|
|
80
|
+
separately for large projects.
|
|
81
|
+
|
|
82
|
+
## Verification
|
|
83
|
+
|
|
84
|
+
`test/resource-watch.test.ts` starts actual CLI processes and verifies HTTP bytes,
|
|
85
|
+
cache headers, runtime-only updates without changed skin output, atlas atomic-save
|
|
86
|
+
events, locale/properties/fonts, rename/deletion, Core-only root creation/recreation,
|
|
87
|
+
mixed style/runtime changes, failure retention and recovery. Existing CLI KUI,
|
|
88
|
+
manifest, component and Label preset watch tests cover their respective rebuilds.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Label text compilation
|
|
2
2
|
|
|
3
|
-
CLI 3.
|
|
3
|
+
CLI 3.4.0 consumes ui-document 0.12.x 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
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# BitmapLabel and RichLabel compilation
|
|
2
|
+
|
|
3
|
+
CLI 3.4.0 uses published ui-document 0.12.0. Applications rendering these tags
|
|
4
|
+
must install UI `^3.3.0` and Core `^2.3.0`; Core 2.3.1 fixes unstyled blank
|
|
5
|
+
rich-text line metrics. The CLI does not install or bundle its own Core/UI.
|
|
6
|
+
Document format version 2 and existing project configuration are unchanged.
|
|
7
|
+
|
|
8
|
+
```xml
|
|
9
|
+
<Skin xmlns="https://kurot.dev/ui/1" class="TextSkin" states="disabled">
|
|
10
|
+
<BitmapLabel id="score" text="100.80" font="score_font" />
|
|
11
|
+
<RichLabel id="notice" width="240">
|
|
12
|
+
<textFlow>
|
|
13
|
+
<Span text="Balance: " size="20" />
|
|
14
|
+
<Span text="100.80" size="20" bold="true" textColor="#FFCC00" />
|
|
15
|
+
</textFlow>
|
|
16
|
+
<textFlow.disabled />
|
|
17
|
+
</RichLabel>
|
|
18
|
+
</Skin>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Register `score_font` as a `font` in default.res.json. Core's font analyzer loads
|
|
22
|
+
the descriptor and its image page; `style.json.fonts` describes vector fonts
|
|
23
|
+
and is a separate contract. BitmapLabel uses glyph metrics, not Label size,
|
|
24
|
+
colors or text presets. Scale the component when bitmap glyph scaling is needed.
|
|
25
|
+
|
|
26
|
+
RichLabel inherits Component, not Label. Its only content property is textFlow.
|
|
27
|
+
Supported Span styles are fontFamily, size, bold, italic, textColor, strokeColor
|
|
28
|
+
and stroke. Runs share continuous wrapping; omitted styles use native defaults
|
|
29
|
+
independently. Text, including spaces, backslashes and numeric-looking strings,
|
|
30
|
+
is literal. Use ` ` for explicit hard line breaks.
|
|
31
|
+
|
|
32
|
+
A state flow replaces the complete run array. `<textFlow.disabled />` clears
|
|
33
|
+
content, while an omitted state flow inherits it. Generated native SetProperty
|
|
34
|
+
overrides restore the prior array when removed. Span elements are not component
|
|
35
|
+
nodes; `.kurot/skin-parts.d.ts` exposes only the identified text components.
|
|
36
|
+
|
|
37
|
+
New text components reject unsupported properties and malformed base/state
|
|
38
|
+
values before emitting output. Existing CLI-only controls and project classes
|
|
39
|
+
retain their separate registration rules. Authored XML is never rewritten, and
|
|
40
|
+
failed builds retain the last good theme bundle and part declarations.
|
|
41
|
+
|
|
42
|
+
See the [shared authoring contract](../../ui-document/docs/text-components.md)
|
|
43
|
+
and [native RichLabel](../../ui/docs/rich-label.md). Existing apps that do not
|
|
44
|
+
use the new tags need no UI/Core upgrade just to update the CLI. Editor adoption
|
|
45
|
+
is separate; an old Editor does not acquire new authoring controls from a CLI upgrade.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurot/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"kurot": "tsx src/index.ts"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@kurot/ui-document": "^0.
|
|
31
|
+
"@kurot/ui-document": "^0.12.0",
|
|
32
32
|
"commander": "^13.0.0",
|
|
33
33
|
"esbuild": "^0.25.0"
|
|
34
34
|
},
|