@kurot/cli 3.2.1 → 3.3.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 +26 -0
- package/README.md +26 -6
- package/dist/core/kui/index.d.ts +6 -2
- package/dist/core/kui/index.d.ts.map +1 -1
- package/dist/core/kui/index.js +3 -3
- package/dist/core/kui/index.js.map +1 -1
- package/dist/core/kui/kui-parser.d.ts +2 -2
- package/dist/core/kui/kui-parser.d.ts.map +1 -1
- package/dist/core/kui/kui-parser.js +3 -3
- package/dist/core/kui/kui-parser.js.map +1 -1
- package/dist/core/kui/skin-module-builder.js +5 -5
- package/dist/core/kui/skin-module-builder.js.map +1 -1
- package/docs/ai-context.md +14 -3
- package/docs/architecture.md +8 -6
- package/docs/game-template.md +1 -1
- package/docs/label-text-layout.md +6 -1
- package/package.json +2 -2
- package/templates/game/resource/assets/fonts/OFL.txt +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ 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.3.0 — 2026-10-07
|
|
11
|
+
|
|
12
|
+
### Label Presets
|
|
13
|
+
|
|
14
|
+
- Expand shared Label presets from the optional fixed style.json before SkinIR
|
|
15
|
+
generation. Emit only native Label properties; retain authored XML untouched.
|
|
16
|
+
- Rebuild all consuming skins when presets change. Invalid presets retain the
|
|
17
|
+
previous successful bundle and recover after configuration correction.
|
|
18
|
+
- Add the optional `styleSheet` compilation option for programmatic KUI compilation.
|
|
19
|
+
- Preserve the precedence of state fields over local fields, preset fields and
|
|
20
|
+
native defaults. Missing references and unsupported state preset selection fail
|
|
21
|
+
explicitly rather than falling back silently.
|
|
22
|
+
|
|
23
|
+
### Dependencies and Compatibility
|
|
24
|
+
|
|
25
|
+
- Require published `@kurot/ui-document@^0.11.0` and remove the local pnpm override;
|
|
26
|
+
installation and compilation use the registry kernel.
|
|
27
|
+
- Command/configuration APIs, style schemaVersion 1 and document format version 2
|
|
28
|
+
remain unchanged. Existing skins receive no automatic migration. Core/UI do
|
|
29
|
+
not need a new release for preset compilation; font loading belongs to the project.
|
|
30
|
+
|
|
31
|
+
### Tests
|
|
32
|
+
|
|
33
|
+
- Cover native property emission, local/state precedence, invalid references and
|
|
34
|
+
shared preset changes across skins, including watcher failure and recovery.
|
|
35
|
+
|
|
10
36
|
## 3.2.1 — 2026-10-06
|
|
11
37
|
|
|
12
38
|
### Game Template
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Build tooling for the Kurot UI Editor workflow. It uses esbuild, emits ES2022
|
|
4
4
|
ESM, and compiles canonical KUI XML skins into runtime theme modules.
|
|
5
5
|
|
|
6
|
-
> **Current version: 3.
|
|
6
|
+
> **Current version: 3.3.0 (prepared for publication).** Requires published `@kurot/ui-document@^0.11.0`
|
|
7
7
|
> and Node.js 20 or later. The CLI runs only at build time.
|
|
8
8
|
|
|
9
9
|
> **Release scope:** The 3.x line is dedicated to Kurot Editor integration.
|
|
@@ -16,6 +16,9 @@ See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
|
16
16
|
Version 3.2.1 adds project styles, bundled fonts and English translations to the
|
|
17
17
|
game template. Existing projects are not rewritten. See [game template setup](docs/game-template.md).
|
|
18
18
|
|
|
19
|
+
Version 3.3.0 compiles shared Label presets from `style.json.labels` into native
|
|
20
|
+
properties, with local and Skin state fields taking priority. See [Label presets](#label-presets-in-330).
|
|
21
|
+
|
|
19
22
|
## Label text fitting in 3.1.0
|
|
20
23
|
|
|
21
24
|
The shared ui-document catalog supports Label `textFit` and `minFontSize`
|
|
@@ -41,7 +44,7 @@ See the [compilation contract](docs/label-text-layout.md) and
|
|
|
41
44
|
The CLI does not require a global install.
|
|
42
45
|
|
|
43
46
|
```bash
|
|
44
|
-
npx @kurot/cli@3.
|
|
47
|
+
npx @kurot/cli@3.3.0 create my-game
|
|
45
48
|
cd my-game
|
|
46
49
|
pnpm install
|
|
47
50
|
pnpm dev
|
|
@@ -49,7 +52,7 @@ pnpm dev
|
|
|
49
52
|
|
|
50
53
|
Scaffolded projects expose `build`, `dev`, and `clean` scripts. For an
|
|
51
54
|
Editor-managed KUI XML project, install the package with
|
|
52
|
-
`pnpm add -D @kurot/cli@^3.
|
|
55
|
+
`pnpm add -D @kurot/cli@^3.3.0`. Existing EXML projects should keep their current
|
|
53
56
|
1.3.x dependency.
|
|
54
57
|
|
|
55
58
|
## Commands
|
|
@@ -159,7 +162,7 @@ use `property.state` on the affected node, so internal graphics remain unnamed.
|
|
|
159
162
|
Image sources use their resource key directly, for example
|
|
160
163
|
`source="button_up_png"`.
|
|
161
164
|
|
|
162
|
-
Version 3.
|
|
165
|
+
Version 3.3.0 uses `@kurot/ui-document@^0.11.0` and retains its literal-string XML rules.
|
|
163
166
|
For example, `<Label text="100.80" text.down="false" size="48" />` compiles
|
|
164
167
|
the exact strings `100.80` and `false`, while the font size stays numeric.
|
|
165
168
|
String properties no longer add or remove backslash type escapes. Remove old
|
|
@@ -245,7 +248,7 @@ KUI builds validate `resource/default.res.json` and inherit image or sheet-frame
|
|
|
245
248
|
`scale9grid` values into compiled `Image.scale9Grid` when XML does not set one.
|
|
246
249
|
Local grids and `scale9Grid="false"` take priority. Development mode rebuilds
|
|
247
250
|
skins after manifest edits; a malformed manifest leaves the last good Skin
|
|
248
|
-
bundle in place. The current CLI requires `@kurot/ui-document@^0.
|
|
251
|
+
bundle in place. The current CLI requires `@kurot/ui-document@^0.11.0`.
|
|
249
252
|
|
|
250
253
|
Sheet `subkeys` must be an object-valued frame map. Refresh old sheets in the
|
|
251
254
|
Editor before upgrading a KUI project; string-valued subkeys now fail the build.
|
|
@@ -254,7 +257,7 @@ See the [resource nine-slice contract](../ui-document/docs/resource-nine-slice.m
|
|
|
254
257
|
## Project style colors in 3.2.0
|
|
255
258
|
|
|
256
259
|
The optional fixed `resource/config/style.json` is independent of
|
|
257
|
-
`default.res.json`. Each KUI build reads it
|
|
260
|
+
`default.res.json`. Each KUI build reads it through the shared document kernel, validates
|
|
258
261
|
font definitions and the optional named `colors` palette, and resolves color
|
|
259
262
|
references before generating Skin factories:
|
|
260
263
|
|
|
@@ -283,3 +286,20 @@ The previous `@token:color:<key>` XML prefix is rejected by ui-document 0.10.
|
|
|
283
286
|
Update those references explicitly before adopting CLI 3.2; ordinary text stays
|
|
284
287
|
literal. Existing EXML projects remain on CLI 1.3.x. No Core/UI rendering change
|
|
285
288
|
is required for color expansion.
|
|
289
|
+
|
|
290
|
+
## Label presets in 3.3.0
|
|
291
|
+
|
|
292
|
+
CLI 3.3.0 expands `textStyle="@style:labels:<key>"` through the shared
|
|
293
|
+
`style.json.labels` contract before generating native Label properties. Local and
|
|
294
|
+
state fields win; authoring references remain in XML. Development watches the
|
|
295
|
+
stylesheet and retains the last good bundle on errors. Programmatic `compileKUI`
|
|
296
|
+
accepts `styleSheet: parseUIStyleSheet(config)`. No Core/UI renderer change is needed.
|
|
297
|
+
|
|
298
|
+
Select a preset only in Default; named states override individual fields rather
|
|
299
|
+
than selecting a different preset. Missing presets, unsupported selection or
|
|
300
|
+
invalid configuration fail explicitly. Expansion runs after resource defaults
|
|
301
|
+
and before color resolution. It does not load fonts or measure text.
|
|
302
|
+
|
|
303
|
+
Version 3.3.0 uses published ui-document 0.11.0 without local overrides. CLI
|
|
304
|
+
3.2.1 does not include this feature. Existing projects are not migrated.
|
|
305
|
+
See [the shared contract](../ui-document/docs/project-styles.md).
|
package/dist/core/kui/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* KUI Skin parser and ESM factory generator.
|
|
3
|
+
*/
|
|
4
|
+
import type { UIResourceConfigEntry, UIStyleSheet } from '@kurot/ui-document';
|
|
2
5
|
import type { SkinIR } from './ast.js';
|
|
3
6
|
import type { CodeGenOptions } from './codegen.js';
|
|
4
7
|
import type { NamespaceModule } from './registry.js';
|
|
@@ -17,6 +20,7 @@ export interface CompileKUIOptions extends CodeGenOptions {
|
|
|
17
20
|
readonly customNamespaces?: readonly NamespaceModule[];
|
|
18
21
|
readonly resources?: readonly UIResourceConfigEntry[];
|
|
19
22
|
readonly colors?: Readonly<Record<string, number>>;
|
|
23
|
+
readonly styleSheet?: UIStyleSheet;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* Compiles one KUI Skin source string to an ESM factory module.
|
|
@@ -25,5 +29,5 @@ export declare function compileKUI(source: string, className?: string, options?:
|
|
|
25
29
|
/**
|
|
26
30
|
* Parses one KUI Skin source string into the compiler IR.
|
|
27
31
|
*/
|
|
28
|
-
export declare function parseToIR(source: string, className?: string, customNamespaces?: readonly NamespaceModule[], resources?: readonly UIResourceConfigEntry[], colors?: Readonly<Record<string, number
|
|
32
|
+
export declare function parseToIR(source: string, className?: string, customNamespaces?: readonly NamespaceModule[], resources?: readonly UIResourceConfigEntry[], colors?: Readonly<Record<string, number>>, styleSheet?: UIStyleSheet): SkinIR;
|
|
29
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/kui/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/kui/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OA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AAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,UAAU,CAAC,EAAE,YAAY,GACvB,MAAM,CAER"}
|
package/dist/core/kui/index.js
CHANGED
|
@@ -11,13 +11,13 @@ export { generateCode } from './codegen.js';
|
|
|
11
11
|
* Compiles one KUI Skin source string to an ESM factory module.
|
|
12
12
|
*/
|
|
13
13
|
export function compileKUI(source, className, options) {
|
|
14
|
-
const ir = parseKUISkin(source, className, options?.customNamespaces ?? [], options?.resources ?? [], options?.colors ?? {});
|
|
14
|
+
const ir = parseKUISkin(source, className, options?.customNamespaces ?? [], options?.resources ?? [], options?.colors ?? options?.styleSheet?.colors ?? {}, options?.styleSheet);
|
|
15
15
|
return generateCode(ir, options);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Parses one KUI Skin source string into the compiler IR.
|
|
19
19
|
*/
|
|
20
|
-
export function parseToIR(source, className, customNamespaces = [], resources = [], colors
|
|
21
|
-
return parseKUISkin(source, className, customNamespaces, resources, colors);
|
|
20
|
+
export function parseToIR(source, className, customNamespaces = [], resources = [], colors, styleSheet) {
|
|
21
|
+
return parseKUISkin(source, className, customNamespaces, resources, colors, styleSheet);
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/kui/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/kui/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK/C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAiB1E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGhF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,SAAkB,EAAE,OAA2B;IACzF,MAAM,EAAE,GAAG,YAAY,CACtB,MAAM,EACN,SAAS,EACT,OAAO,EAAE,gBAAgB,IAAI,EAAE,EAC/B,OAAO,EAAE,SAAS,IAAI,EAAE,EACxB,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,EAAE,EACpD,OAAO,EAAE,UAAU,CACnB,CAAC;IACF,OAAO,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CACxB,MAAc,EACd,SAAkB,EAClB,mBAA+C,EAAE,EACjD,YAA8C,EAAE,EAChD,MAAyC,EACzC,UAAyB;IAEzB,OAAO,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UIResourceConfigEntry } from '@kurot/ui-document';
|
|
1
|
+
import type { UIResourceConfigEntry, UIStyleSheet } from '@kurot/ui-document';
|
|
2
2
|
import type { SkinIR } from './ast.js';
|
|
3
3
|
import type { NamespaceModule } from './registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parses a KUI Skin document into the existing skin code-generation IR.
|
|
6
6
|
*/
|
|
7
|
-
export declare function parseKUISkin(source: string, className?: string, customNamespaces?: readonly NamespaceModule[], resources?: readonly UIResourceConfigEntry[], colors?: Readonly<Record<string, number
|
|
7
|
+
export declare function parseKUISkin(source: string, className?: string, customNamespaces?: readonly NamespaceModule[], resources?: readonly UIResourceConfigEntry[], colors?: Readonly<Record<string, number>>, styleSheet?: UIStyleSheet): SkinIR;
|
|
8
8
|
//# sourceMappingURL=kui-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kui-parser.d.ts","sourceRoot":"","sources":["../../../src/core/kui/kui-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kui-parser.d.ts","sourceRoot":"","sources":["../../../src/core/kui/kui-parser.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAuC,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,KAAK,EAIX,MAAM,EAIN,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;GAEG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,gBAAgB,GAAE,SAAS,eAAe,EAAO,EACjD,SAAS,GAAE,SAAS,qBAAqB,EAAO,EAChD,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,UAAU,CAAC,EAAE,YAAY,GACvB,MAAM,CAMR"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isUIAssetReference, isUIDesignTokenReference, isUIResourceReference, isSyntheticNodeId, parseUIDocument, resolveUIResourceDefaults, resolveUIStyleColors, } from '@kurot/ui-document';
|
|
1
|
+
import { isUIAssetReference, isUIDesignTokenReference, isUIResourceReference, isSyntheticNodeId, parseUIDocument, resolveUIResourceDefaults, resolveUIStyleColors, resolveUILabelStyles, } from '@kurot/ui-document';
|
|
2
2
|
import { localName, lookupComponent } from './registry.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parses a KUI Skin document into the existing skin code-generation IR.
|
|
5
5
|
*/
|
|
6
|
-
export function parseKUISkin(source, className, customNamespaces = [], resources = [], colors
|
|
7
|
-
const document = resolveUIStyleColors(resolveUIResourceDefaults(parseUIDocument(source), resources), colors);
|
|
6
|
+
export function parseKUISkin(source, className, customNamespaces = [], resources = [], colors, styleSheet) {
|
|
7
|
+
const document = resolveUIStyleColors(resolveUILabelStyles(resolveUIResourceDefaults(parseUIDocument(source), resources), styleSheet), colors ?? styleSheet?.colors ?? {});
|
|
8
8
|
return new KUIParseContext(source, document, className ?? document.id, customNamespaces).parse();
|
|
9
9
|
}
|
|
10
10
|
class KUIParseContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kui-parser.js","sourceRoot":"","sources":["../../../src/core/kui/kui-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAG3D;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAc,EACd,SAAkB,EAClB,mBAA+C,EAAE,EACjD,YAA8C,EAAE,EAChD,
|
|
1
|
+
{"version":3,"file":"kui-parser.js","sourceRoot":"","sources":["../../../src/core/kui/kui-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAG3D;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAc,EACd,SAAkB,EAClB,mBAA+C,EAAE,EACjD,YAA8C,EAAE,EAChD,MAAyC,EACzC,UAAyB;IAEzB,MAAM,QAAQ,GAAG,oBAAoB,CACpC,oBAAoB,CAAC,yBAAyB,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,EAAE,UAAU,CAAC,EAC/F,MAAM,IAAI,UAAU,EAAE,MAA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kinsModule(ctx, skins) {
|
|
|
27
27
|
throw new BuildError(`Resource configuration failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
let
|
|
30
|
+
let styleSheet;
|
|
31
31
|
try {
|
|
32
32
|
const source = await fs.readFile(path.join(ctx.project.resourceDir, 'config/style.json'), 'utf8');
|
|
33
|
-
|
|
33
|
+
styleSheet = parseUIStyleSheet(JSON.parse(source));
|
|
34
34
|
}
|
|
35
35
|
catch (error) {
|
|
36
36
|
if (error.code !== 'ENOENT') {
|
|
37
37
|
throw new BuildError(`resource/config/style.json: ${error instanceof Error ? error.message : String(error)}`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
const modules = await Promise.all(skins.map(skin => generateSkinModule(ctx, skin, resources,
|
|
40
|
+
const modules = await Promise.all(skins.map(skin => generateSkinModule(ctx, skin, resources, styleSheet)));
|
|
41
41
|
if (modules.some(module => module === undefined) || ctx.diagnostics.hasErrors()) {
|
|
42
42
|
throw new BuildError('KUI compilation failed.');
|
|
43
43
|
}
|
|
@@ -58,14 +58,14 @@ export async function buildSkinsModule(ctx, skins) {
|
|
|
58
58
|
await fs.rm(temporaryRoot, { recursive: true, force: true });
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
async function generateSkinModule(ctx, skin, resources,
|
|
61
|
+
async function generateSkinModule(ctx, skin, resources, styleSheet) {
|
|
62
62
|
try {
|
|
63
63
|
const namespaces = ctx.project.customNamespaces.map(ns => ({
|
|
64
64
|
prefix: ns.prefix,
|
|
65
65
|
specifier: ns.specifier,
|
|
66
66
|
...(ns.components ? { componentNames: new Set(ns.components.map(component => component.name)) } : {}),
|
|
67
67
|
}));
|
|
68
|
-
const ir = parseToIR(skin.file.contents, skin.className, namespaces, resources, colors);
|
|
68
|
+
const ir = parseToIR(skin.file.contents, skin.className, namespaces, resources, styleSheet?.colors ?? {}, styleSheet);
|
|
69
69
|
const diagnostics = createUnresolvedTagDiagnostics(skin.file.relPath, skin.file.contents, ir.unresolvedTags, namespaces);
|
|
70
70
|
for (const diagnostic of diagnostics) {
|
|
71
71
|
ctx.diagnostics.report(diagnostic);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skin-module-builder.js","sourceRoot":"","sources":["../../../src/core/kui/skin-module-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA0CrD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAiB,EAAE,KAA8B;IACvF,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAC/E,IAAI,CAAC;QACJ,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC5E,IAAI,SAAS,GAAqC,EAAE,CAAC;QACrD,IAAI,CAAC;YACJ,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,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B,EAAE,cAAsB;IACzF,MAAM,SAAS,CAAC,cAAc,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC;IAChF,IAAI,CAAC;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACrD,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;YAAS,CAAC;QACV,MAAM,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACF,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACrC,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACpF,OAAO,SAAS,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
package/docs/ai-context.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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. The package is `@kurot/cli@3.
|
|
4
|
+
explains the plugin pipeline. The package is `@kurot/cli@3.3.0`, runs on
|
|
5
5
|
Node.js 20+, and is installed as a project dev dependency.
|
|
6
6
|
|
|
7
7
|
## Directory map
|
|
@@ -28,7 +28,8 @@ The 3.2.1 game template includes fixed style/locale configuration,
|
|
|
28
28
|
English properties and licensed regular/bold font files. StyleManager finishes
|
|
29
29
|
font loading before Main creates Player/Preloader; LocaleManager registers
|
|
30
30
|
preload texts before creating the scene. See [game-template.md](game-template.md).
|
|
31
|
-
Version 3.
|
|
31
|
+
Version 3.3.0 is prepared for publication with Label preset compilation and
|
|
32
|
+
published ui-document 0.11.0. It has no local document-kernel override.
|
|
32
33
|
|
|
33
34
|
## KUI compilation
|
|
34
35
|
|
|
@@ -44,7 +45,7 @@ and layout apply to the runtime Skin, and its direct visual children become
|
|
|
44
45
|
`property.state` attributes. Storage IDs and runtime mapping metadata are not
|
|
45
46
|
authored XML fields.
|
|
46
47
|
|
|
47
|
-
CLI 3.
|
|
48
|
+
CLI 3.3.0 requires `@kurot/ui-document@^0.11.0`. Schema-defined strings, including
|
|
48
49
|
numeric/boolean-looking text and state text, are literal attributes without
|
|
49
50
|
backslash type escaping. Old synthetic prefixes become literal characters;
|
|
50
51
|
do not migrate them silently. Numeric/boolean properties and schema-free
|
|
@@ -175,3 +176,13 @@ Base and state colors use @style:colors:<key>; reject the previous color prefix
|
|
|
175
176
|
without migrating files. Fonts are validated but not loaded; the application owns
|
|
176
177
|
font loading and rendering. Build/preview copies resolve references while authored
|
|
177
178
|
XML retains them. No live runtime palette switching is introduced.
|
|
179
|
+
|
|
180
|
+
## Label presets in 3.3.0
|
|
181
|
+
|
|
182
|
+
skin-module-builder.ts reads the entire stylesheet once per build and passes it
|
|
183
|
+
through parseToIR/parseKUISkin. Resolve resource defaults, then Label presets, then colors before
|
|
184
|
+
native emission; retain XML references and local/state precedence. compileKUI
|
|
185
|
+
accepts an optional styleSheet. style.json changes already trigger whole-Skin
|
|
186
|
+
rebuilds. Invalid presets retain the last successful bundle. The dependency and
|
|
187
|
+
lockfile use published ui-document 0.11.0 without a local override. textStyle is
|
|
188
|
+
Default-only; individual named-state fields can still override preset properties.
|
package/docs/architecture.md
CHANGED
|
@@ -39,17 +39,19 @@ 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.3.0 consumes ui-document 0.11.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
|
|
46
46
|
3.1.x and Core 2.1.x or later within their respective majors.
|
|
47
47
|
|
|
48
48
|
Each build also reads optional `resource/config/style.json` through the shared
|
|
49
|
-
parser. Resource nine-slice defaults and named color references
|
|
50
|
-
disposable document before SkinIR conversion;
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
parser. Resource nine-slice defaults, Label presets and named color references
|
|
50
|
+
resolve in that order into a disposable document before SkinIR conversion;
|
|
51
|
+
authored Skin XML is never rewritten. Default-only `@style:labels:<key>` expands
|
|
52
|
+
to native properties, with state fields taking priority over local and preset
|
|
53
|
+
fields. Invalid configurations and unknown preset/color references fail before
|
|
54
|
+
a new Skin bundle is installed.
|
|
53
55
|
|
|
54
56
|
The authored `Skin` root supplies its generated `class` and optional state
|
|
55
57
|
names. State values live on their target nodes as `property.state`. The compiler
|
|
@@ -77,7 +79,7 @@ namespace, paired skin, generated type declaration, and editor catalog, so that
|
|
|
77
79
|
path refreshes all four outputs as one operation. The server preserves the last
|
|
78
80
|
successful output after an invalid edit.
|
|
79
81
|
The resource watcher includes the fixed style.json path, rebuilding skins when
|
|
80
|
-
its palette
|
|
82
|
+
its palette or Label presets change; font loading remains an application responsibility.
|
|
81
83
|
|
|
82
84
|
## Diagnostics
|
|
83
85
|
|
package/docs/game-template.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project styles and languages in the game template
|
|
2
2
|
|
|
3
|
-
CLI 3.2.1
|
|
3
|
+
CLI 3.2.1 is published with this template update. It adds
|
|
4
4
|
project-owned initialization without changing Core/UI APIs or migrating existing
|
|
5
5
|
projects. The empty template stays minimal.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Label text compilation
|
|
2
2
|
|
|
3
|
-
CLI 3.
|
|
3
|
+
CLI 3.3.0 consumes ui-document 0.11.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
|
|
|
@@ -27,6 +27,11 @@ The compiler does not measure fonts or change `size` based on text length,
|
|
|
27
27
|
currency, locale or display bounds. Source XML remains authored data; neither
|
|
28
28
|
derived sizes nor fitting diagnostics are persisted by compilation.
|
|
29
29
|
|
|
30
|
+
Label presets supply baseline appearance before local and state fields are
|
|
31
|
+
applied. They do not own wrapping or fitting policy, and preset expansion never
|
|
32
|
+
introduces build-time text measurement. See the
|
|
33
|
+
[shared style contract](../../ui-document/docs/project-styles.md).
|
|
34
|
+
|
|
30
35
|
## Runtime boundary
|
|
31
36
|
|
|
32
37
|
- The application must install UI `^3.1.0` and Core `^2.1.0` for shrinking.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurot/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.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.11.0",
|
|
32
32
|
"commander": "^13.0.0",
|
|
33
33
|
"esbuild": "^0.25.0"
|
|
34
34
|
},
|
|
@@ -18,7 +18,7 @@ with others.
|
|
|
18
18
|
|
|
19
19
|
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
20
|
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
-
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
22
|
redistributed and/or sold with any software provided that any reserved
|
|
23
23
|
names are not used by derivative works. The fonts and derivatives,
|
|
24
24
|
however, cannot be released under any other type of license. The
|