@kurot/cli 1.1.1 → 1.1.2
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 +34 -0
- package/README.md +40 -9
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +3 -0
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/clean.d.ts +3 -0
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +3 -0
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/create.d.ts +3 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +3 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +5 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/core/components/discover-components.d.ts +16 -0
- package/dist/core/components/discover-components.d.ts.map +1 -0
- package/dist/core/components/discover-components.js +191 -0
- package/dist/core/components/discover-components.js.map +1 -0
- package/dist/core/config.d.ts +45 -17
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +16 -6
- package/dist/core/config.js.map +1 -1
- package/dist/core/dev-server.d.ts +5 -5
- package/dist/core/dev-server.d.ts.map +1 -1
- package/dist/core/dev-server.js +97 -25
- package/dist/core/dev-server.js.map +1 -1
- package/dist/core/diagnostics/output.d.ts +31 -0
- package/dist/core/diagnostics/output.d.ts.map +1 -1
- package/dist/core/diagnostics/output.js +13 -0
- package/dist/core/diagnostics/output.js.map +1 -1
- package/dist/core/diagnostics/types.d.ts +15 -0
- package/dist/core/diagnostics/types.d.ts.map +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/exml/ast.d.ts +27 -0
- package/dist/core/exml/ast.d.ts.map +1 -1
- package/dist/core/exml/codegen.d.ts +6 -7
- package/dist/core/exml/codegen.d.ts.map +1 -1
- package/dist/core/exml/codegen.js +57 -87
- package/dist/core/exml/codegen.js.map +1 -1
- package/dist/core/exml/exml-diagnostics.d.ts +2 -1
- package/dist/core/exml/exml-diagnostics.d.ts.map +1 -1
- package/dist/core/exml/exml-diagnostics.js +2 -2
- package/dist/core/exml/exml-diagnostics.js.map +1 -1
- package/dist/core/exml/exml-parser.d.ts +11 -11
- package/dist/core/exml/exml-parser.d.ts.map +1 -1
- package/dist/core/exml/exml-parser.js +90 -178
- package/dist/core/exml/exml-parser.js.map +1 -1
- package/dist/core/exml/index.d.ts +13 -13
- package/dist/core/exml/index.d.ts.map +1 -1
- package/dist/core/exml/index.js +12 -13
- package/dist/core/exml/index.js.map +1 -1
- package/dist/core/exml/registry.d.ts +39 -33
- package/dist/core/exml/registry.d.ts.map +1 -1
- package/dist/core/exml/registry.js +56 -43
- package/dist/core/exml/registry.js.map +1 -1
- package/dist/core/exml/skin-module-builder.d.ts +14 -0
- package/dist/core/exml/skin-module-builder.d.ts.map +1 -1
- package/dist/core/exml/skin-module-builder.js +8 -2
- package/dist/core/exml/skin-module-builder.js.map +1 -1
- package/dist/core/exml/xml-parser.d.ts +36 -26
- package/dist/core/exml/xml-parser.d.ts.map +1 -1
- package/dist/core/exml/xml-parser.js +133 -144
- package/dist/core/exml/xml-parser.js.map +1 -1
- package/dist/core/namespace-external-plugin.d.ts +5 -5
- package/dist/core/namespace-external-plugin.js +5 -5
- package/dist/core/pipeline.d.ts +59 -39
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +6 -1
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/plugins/clean-output.d.ts +3 -0
- package/dist/core/plugins/clean-output.d.ts.map +1 -1
- package/dist/core/plugins/clean-output.js +3 -1
- package/dist/core/plugins/clean-output.js.map +1 -1
- package/dist/core/plugins/compile-custom-namespaces.d.ts +6 -1
- package/dist/core/plugins/compile-custom-namespaces.d.ts.map +1 -1
- package/dist/core/plugins/compile-custom-namespaces.js +74 -11
- package/dist/core/plugins/compile-custom-namespaces.js.map +1 -1
- package/dist/core/plugins/compile-engine.d.ts +2 -4
- package/dist/core/plugins/compile-engine.d.ts.map +1 -1
- package/dist/core/plugins/compile-engine.js +5 -5
- package/dist/core/plugins/compile-engine.js.map +1 -1
- package/dist/core/plugins/compile-exml.d.ts.map +1 -1
- package/dist/core/plugins/compile-exml.js +18 -3
- package/dist/core/plugins/compile-exml.js.map +1 -1
- package/dist/core/plugins/compile-source.d.ts +1 -1
- package/dist/core/plugins/compile-source.d.ts.map +1 -1
- package/dist/core/plugins/compile-source.js +10 -8
- package/dist/core/plugins/compile-source.js.map +1 -1
- package/dist/core/plugins/component-catalog.d.ts +6 -0
- package/dist/core/plugins/component-catalog.d.ts.map +1 -0
- package/dist/core/plugins/component-catalog.js +30 -0
- package/dist/core/plugins/component-catalog.js.map +1 -0
- package/dist/core/plugins/copy-assets.d.ts +1 -2
- package/dist/core/plugins/copy-assets.d.ts.map +1 -1
- package/dist/core/plugins/copy-assets.js +1 -3
- 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 +1 -1
- package/dist/core/plugins/generate-html.js.map +1 -1
- package/dist/core/plugins/index.d.ts +1 -0
- package/dist/core/plugins/index.d.ts.map +1 -1
- package/dist/core/plugins/index.js +3 -0
- package/dist/core/plugins/index.js.map +1 -1
- package/dist/core/project.d.ts +85 -6
- package/dist/core/project.d.ts.map +1 -1
- package/dist/core/project.js +53 -8
- package/dist/core/project.js.map +1 -1
- package/dist/core/template.d.ts +8 -1
- package/dist/core/template.d.ts.map +1 -1
- package/dist/core/template.js +18 -8
- package/dist/core/template.js.map +1 -1
- package/dist/define.d.ts +1 -1
- package/dist/define.d.ts.map +1 -1
- package/dist/utils/fs.d.ts +15 -0
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +15 -0
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/logger.d.ts +7 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +7 -3
- package/dist/utils/logger.js.map +1 -1
- package/package.json +1 -1
- package/templates/game/kurot.config.ts +4 -2
- package/templates/game/src/game-components.ts +0 -6
- /package/templates/game/resource/skins/{ButtonSkin.exml → eui/ButtonSkin.exml} +0 -0
- /package/templates/game/resource/skins/{CheckBoxSkin.exml → eui/CheckBoxSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ComboBoxSkin.exml → eui/ComboBoxSkin.exml} +0 -0
- /package/templates/game/resource/skins/{GroupSkin.exml → eui/GroupSkin.exml} +0 -0
- /package/templates/game/resource/skins/{HScrollBarSkin.exml → eui/HScrollBarSkin.exml} +0 -0
- /package/templates/game/resource/skins/{HSliderSkin.exml → eui/HSliderSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ImageSkin.exml → eui/ImageSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ItemRendererSkin.exml → eui/ItemRendererSkin.exml} +0 -0
- /package/templates/game/resource/skins/{LabelSkin.exml → eui/LabelSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ListSkin.exml → eui/ListSkin.exml} +0 -0
- /package/templates/game/resource/skins/{PanelSkin.exml → eui/PanelSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ProgressBarSkin.exml → eui/ProgressBarSkin.exml} +0 -0
- /package/templates/game/resource/skins/{RadioButtonSkin.exml → eui/RadioButtonSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ScrollerSkin.exml → eui/ScrollerSkin.exml} +0 -0
- /package/templates/game/resource/skins/{TabBarSkin.exml → eui/TabBarSkin.exml} +0 -0
- /package/templates/game/resource/skins/{TextInputSkin.exml → eui/TextInputSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ToggleButtonSkin.exml → eui/ToggleButtonSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ToggleSwitchSkin.exml → eui/ToggleSwitchSkin.exml} +0 -0
- /package/templates/game/resource/skins/{VScrollBarSkin.exml → eui/VScrollBarSkin.exml} +0 -0
- /package/templates/game/resource/skins/{VSliderSkin.exml → eui/VSliderSkin.exml} +0 -0
- /package/templates/game/resource/skins/{ViewStackSkin.exml → eui/ViewStackSkin.exml} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml-parser.d.ts","sourceRoot":"","sources":["../../../src/core/exml/xml-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"xml-parser.d.ts","sourceRoot":"","sources":["../../../src/core/exml/xml-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,KAAM,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;CAC3B;AAOD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,QAAQ,EAAE,CAErE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAMjD"}
|
|
@@ -1,207 +1,196 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lightweight XML parser for EXML
|
|
2
|
+
* Lightweight XML parser for the subset used by EXML skins.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
* - Namespaced attribute prefixes (we only care about the local name)
|
|
4
|
+
* Supports prefixed elements, quoted attributes, text, CDATA, comments,
|
|
5
|
+
* processing instructions, and self-closing elements. DTD and entity
|
|
6
|
+
* declarations are outside the supported input contract.
|
|
7
|
+
*/
|
|
8
|
+
const RX_OPEN = /^<([a-zA-Z_][\w:.-]*)/;
|
|
9
|
+
const RX_CLOSE = /^<\/([a-zA-Z_][\w:.-]*)\s*>/;
|
|
10
|
+
const RX_ATTR = /^([a-zA-Z_][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/;
|
|
11
|
+
const CDATA_OPEN_LENGTH = '<![CDATA['.length;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the element children from a mixed XML child list.
|
|
15
14
|
*/
|
|
16
|
-
// ── Helpers ──────────────────────────────────────────────────────────
|
|
17
|
-
function isText(node) {
|
|
18
|
-
return node.type === 'text';
|
|
19
|
-
}
|
|
20
15
|
export function filterElements(children) {
|
|
21
|
-
return children.filter((
|
|
16
|
+
return children.filter((node) => node.type === 'element');
|
|
22
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Concatenates the text children from a mixed XML child list.
|
|
20
|
+
*/
|
|
23
21
|
export function getTextContent(children) {
|
|
24
22
|
return children
|
|
25
23
|
.filter(isText)
|
|
26
|
-
.map(
|
|
24
|
+
.map(node => node.text)
|
|
27
25
|
.join('');
|
|
28
26
|
}
|
|
29
|
-
// ── Parser implementation ────────────────────────────────────────────
|
|
30
27
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* Parses EXML source and returns its first root element.
|
|
29
|
+
*
|
|
30
|
+
* Leading text, comments, and processing instructions are ignored.
|
|
31
|
+
*
|
|
32
|
+
* @throws {Error} If no root element exists or element closing tags are invalid.
|
|
33
33
|
*/
|
|
34
34
|
export function parseXML(source) {
|
|
35
|
-
const parser = new
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (n.type === 'element')
|
|
40
|
-
return n;
|
|
35
|
+
const parser = new XmlParser(source);
|
|
36
|
+
for (const node of parser.parse()) {
|
|
37
|
+
if (isElement(node))
|
|
38
|
+
return node;
|
|
41
39
|
}
|
|
42
40
|
throw new Error('EXML: no root element found');
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
src;
|
|
50
|
-
pos = 0;
|
|
42
|
+
class XmlParser {
|
|
43
|
+
// ── Instance fields ───────────────────────────────────────────────
|
|
44
|
+
_source;
|
|
45
|
+
_position = 0;
|
|
46
|
+
// ── Constructor ───────────────────────────────────────────────────
|
|
51
47
|
constructor(source) {
|
|
52
|
-
this.
|
|
48
|
+
this._source = source;
|
|
53
49
|
}
|
|
54
|
-
// ──
|
|
50
|
+
// ── Public methods ────────────────────────────────────────────────
|
|
55
51
|
parse() {
|
|
56
|
-
this.
|
|
57
|
-
return this.
|
|
52
|
+
this._skipWhitespace();
|
|
53
|
+
return this._parseNodes();
|
|
58
54
|
}
|
|
59
|
-
// ──
|
|
60
|
-
|
|
55
|
+
// ── Private methods ───────────────────────────────────────────────
|
|
56
|
+
_parseNodes() {
|
|
61
57
|
const nodes = [];
|
|
62
|
-
while (this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
// Comment
|
|
70
|
-
if (this.src.startsWith('<!--', this.pos)) {
|
|
71
|
-
this.skipComment();
|
|
58
|
+
while (this._position < this._source.length) {
|
|
59
|
+
if (this._source[this._position] === '<') {
|
|
60
|
+
if (this._source.slice(this._position).match(RX_CLOSE)) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
if (this._source.startsWith('<!--', this._position)) {
|
|
64
|
+
this._skipComment();
|
|
72
65
|
continue;
|
|
73
66
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
nodes.push(this.readCDATA());
|
|
67
|
+
if (this._source.startsWith('<![CDATA[', this._position)) {
|
|
68
|
+
nodes.push(this._readCDATA());
|
|
77
69
|
continue;
|
|
78
70
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.skipPI();
|
|
71
|
+
if (this._source.startsWith('<?', this._position)) {
|
|
72
|
+
this._skipProcessingInstruction();
|
|
82
73
|
continue;
|
|
83
74
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
const element = this._parseElement();
|
|
76
|
+
if (element) {
|
|
77
|
+
nodes.push(element);
|
|
78
|
+
}
|
|
88
79
|
continue;
|
|
89
80
|
}
|
|
90
|
-
|
|
91
|
-
nodes.push(this.readText());
|
|
81
|
+
nodes.push(this._readText());
|
|
92
82
|
}
|
|
93
83
|
return nodes;
|
|
94
84
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const rest = this.src.slice(this.pos);
|
|
101
|
-
const tagMatch = rest.match(RX_OPEN);
|
|
85
|
+
_parseElement() {
|
|
86
|
+
const start = this._position;
|
|
87
|
+
if (this._source[this._position] !== '<')
|
|
88
|
+
return undefined;
|
|
89
|
+
const tagMatch = this._source.slice(this._position).match(RX_OPEN);
|
|
102
90
|
if (!tagMatch) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return null;
|
|
91
|
+
this._position++;
|
|
92
|
+
return undefined;
|
|
106
93
|
}
|
|
107
94
|
const tagName = tagMatch[1];
|
|
108
|
-
this.
|
|
109
|
-
|
|
110
|
-
const attrs = [];
|
|
95
|
+
this._position += tagMatch[0].length;
|
|
96
|
+
const attributes = [];
|
|
111
97
|
for (;;) {
|
|
112
|
-
this.
|
|
113
|
-
if (this.
|
|
114
|
-
break;
|
|
115
|
-
// Self-closing />
|
|
116
|
-
if (this.src.startsWith('/>', this.pos)) {
|
|
117
|
-
this.pos += 2;
|
|
118
|
-
return { type: 'element', name: tagName, attributes: attrs, children: [], range: { start, end: this.pos } };
|
|
119
|
-
}
|
|
120
|
-
// Open tag end >
|
|
121
|
-
if (this.src[this.pos] === '>') {
|
|
122
|
-
this.pos++;
|
|
98
|
+
this._skipWhitespace();
|
|
99
|
+
if (this._position >= this._source.length) {
|
|
123
100
|
break;
|
|
124
101
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
});
|
|
102
|
+
if (this._source.startsWith('/>', this._position)) {
|
|
103
|
+
this._position += 2;
|
|
104
|
+
return {
|
|
105
|
+
type: 'element',
|
|
106
|
+
name: tagName,
|
|
107
|
+
attributes,
|
|
108
|
+
children: [],
|
|
109
|
+
range: { start, end: this._position },
|
|
110
|
+
};
|
|
135
111
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
112
|
+
if (this._source[this._position] === '>') {
|
|
113
|
+
this._position++;
|
|
114
|
+
break;
|
|
139
115
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const closeMatch = this.src.slice(this.pos).match(RX_CLOSE);
|
|
145
|
-
if (closeMatch) {
|
|
146
|
-
if (closeMatch[1] !== tagName) {
|
|
147
|
-
throw new Error(`EXML: expected closing tag </${tagName}>, got </${closeMatch[1]}>`);
|
|
116
|
+
const attributeMatch = this._source.slice(this._position).match(RX_ATTR);
|
|
117
|
+
if (!attributeMatch) {
|
|
118
|
+
this._position++;
|
|
119
|
+
continue;
|
|
148
120
|
}
|
|
149
|
-
|
|
121
|
+
const attributeStart = this._position;
|
|
122
|
+
this._position += attributeMatch[0].length;
|
|
123
|
+
attributes.push({
|
|
124
|
+
name: attributeMatch[1],
|
|
125
|
+
value: attributeMatch[2] ?? attributeMatch[3],
|
|
126
|
+
range: { start: attributeStart, end: this._position },
|
|
127
|
+
});
|
|
150
128
|
}
|
|
151
|
-
|
|
129
|
+
const children = this._parseNodes();
|
|
130
|
+
const closeMatch = this._source.slice(this._position).match(RX_CLOSE);
|
|
131
|
+
if (!closeMatch) {
|
|
152
132
|
throw new Error(`EXML: missing closing tag </${tagName}>`);
|
|
153
133
|
}
|
|
154
|
-
|
|
134
|
+
if (closeMatch[1] !== tagName) {
|
|
135
|
+
throw new Error(`EXML: expected closing tag </${tagName}>, got </${closeMatch[1]}>`);
|
|
136
|
+
}
|
|
137
|
+
this._position += closeMatch[0].length;
|
|
138
|
+
return {
|
|
139
|
+
type: 'element',
|
|
140
|
+
name: tagName,
|
|
141
|
+
attributes,
|
|
142
|
+
children,
|
|
143
|
+
range: { start, end: this._position },
|
|
144
|
+
};
|
|
155
145
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const start = this.pos;
|
|
146
|
+
_readText() {
|
|
147
|
+
const start = this._position;
|
|
159
148
|
let text = '';
|
|
160
|
-
while (this.
|
|
161
|
-
text += this.
|
|
149
|
+
while (this._position < this._source.length && this._source[this._position] !== '<') {
|
|
150
|
+
text += this._source[this._position++];
|
|
162
151
|
}
|
|
163
|
-
return { type: 'text', text: unescapeXML(text), range: { start, end: this.
|
|
152
|
+
return { type: 'text', text: unescapeXML(text), range: { start, end: this._position } };
|
|
164
153
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const end = this.src.indexOf(']]>', this.pos);
|
|
154
|
+
_readCDATA() {
|
|
155
|
+
const start = this._position;
|
|
156
|
+
this._position += CDATA_OPEN_LENGTH;
|
|
157
|
+
const end = this._source.indexOf(']]>', this._position);
|
|
170
158
|
if (end === -1) {
|
|
171
|
-
this.
|
|
172
|
-
return { type: 'text', text: this.
|
|
159
|
+
this._position = this._source.length;
|
|
160
|
+
return { type: 'text', text: this._source.slice(start), range: { start, end: this._position } };
|
|
173
161
|
}
|
|
174
|
-
const
|
|
175
|
-
this.
|
|
176
|
-
return { type: 'text', text
|
|
177
|
-
}
|
|
178
|
-
// ── Skip helpers ──────────────────────────────────────────────────
|
|
179
|
-
skipComment() {
|
|
180
|
-
const end = this.src.indexOf('-->', this.pos + 4);
|
|
181
|
-
this.pos = end === -1 ? this.src.length : end + 3;
|
|
162
|
+
const text = this._source.slice(this._position, end);
|
|
163
|
+
this._position = end + 3;
|
|
164
|
+
return { type: 'text', text, range: { start, end: this._position } };
|
|
182
165
|
}
|
|
183
|
-
|
|
184
|
-
const end = this.
|
|
185
|
-
this.
|
|
166
|
+
_skipComment() {
|
|
167
|
+
const end = this._source.indexOf('-->', this._position + 4);
|
|
168
|
+
this._position = end === -1 ? this._source.length : end + 3;
|
|
186
169
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
170
|
+
_skipProcessingInstruction() {
|
|
171
|
+
const end = this._source.indexOf('?>', this._position + 2);
|
|
172
|
+
this._position = end === -1 ? this._source.length : end + 2;
|
|
190
173
|
}
|
|
191
|
-
|
|
192
|
-
this.
|
|
174
|
+
_skipWhitespace() {
|
|
175
|
+
while (this._position < this._source.length && /\s/.test(this._source[this._position])) {
|
|
176
|
+
this._position++;
|
|
177
|
+
}
|
|
193
178
|
}
|
|
194
179
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
180
|
+
function isText(node) {
|
|
181
|
+
return node.type === 'text';
|
|
182
|
+
}
|
|
183
|
+
function isElement(node) {
|
|
184
|
+
return node.type === 'element';
|
|
185
|
+
}
|
|
186
|
+
function unescapeXML(value) {
|
|
187
|
+
const entities = {
|
|
199
188
|
amp: '\x26',
|
|
200
189
|
lt: '\x3C',
|
|
201
190
|
gt: '\x3E',
|
|
202
191
|
quot: '\x22',
|
|
203
192
|
apos: '\x27',
|
|
204
193
|
};
|
|
205
|
-
return
|
|
194
|
+
return value.replace(/&(amp|lt|gt|quot|apos);/g, (match, name) => entities[name] ?? match);
|
|
206
195
|
}
|
|
207
196
|
//# sourceMappingURL=xml-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml-parser.js","sourceRoot":"","sources":["../../../src/core/exml/xml-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"xml-parser.js","sourceRoot":"","sources":["../../../src/core/exml/xml-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqEH,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAC/C,MAAM,OAAO,GAAG,oDAAoD,CAAC;AACrE,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAA0B;IACxD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAC7E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAA0B;IACxD,OAAO,QAAQ;SACb,MAAM,CAAC,MAAM,CAAC;SACd,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAA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CAAC,GAAG,GAAG,CAAC,CAAC;IAC7D,CAAC;IAEO,eAAe;QACtB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACxF,IAAI,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC;IACF,CAAC;CACD;AAED,SAAS,MAAM,CAAC,IAAW;IAC1B,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;AAC7B,CAAC;AAED,SAAS,SAAS,CAAC,IAAW;IAC7B,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IACjC,MAAM,QAAQ,GAA2B;QACxC,GAAG,EAAE,MAAM;QACX,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACZ,CAAC;IACF,OAAO,KAAK,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -12,8 +12,8 @@ import type * as esbuild from 'esbuild';
|
|
|
12
12
|
* `import { HeroNarrowIR } from './ui/index.js'`) match its `HeroNarrowIR.ts`
|
|
13
13
|
* source file (the metafile key).
|
|
14
14
|
*
|
|
15
|
-
* @param absolutePath - Absolute file path to normalize
|
|
16
|
-
* @returns The path with its extension stripped, if any
|
|
15
|
+
* @param absolutePath - Absolute file path to normalize.
|
|
16
|
+
* @returns The path with its extension stripped, if any.
|
|
17
17
|
*/
|
|
18
18
|
export declare function normalizeModuleKey(absolutePath: string): string;
|
|
19
19
|
/**
|
|
@@ -37,9 +37,9 @@ export declare function normalizeModuleKey(absolutePath: string): string;
|
|
|
37
37
|
* `.js`-suffixed import convention (see `normalizeModuleKey`) makes that
|
|
38
38
|
* unnecessary — a plain path + extension-strip is enough to match.
|
|
39
39
|
*
|
|
40
|
-
* @param namespaceModules - Extensionless absolute path
|
|
41
|
-
* populated from esbuild's `metafile.outputs[x].inputs
|
|
42
|
-
* @returns An esbuild plugin implementing the rewrite
|
|
40
|
+
* @param namespaceModules - Extensionless absolute path to virtual specifier,
|
|
41
|
+
* populated from esbuild's `metafile.outputs[x].inputs`.
|
|
42
|
+
* @returns An esbuild plugin implementing the rewrite.
|
|
43
43
|
*/
|
|
44
44
|
export declare function namespaceModuleExternalPlugin(namespaceModules: ReadonlyMap<string, string>): esbuild.Plugin;
|
|
45
45
|
//# sourceMappingURL=namespace-external-plugin.d.ts.map
|
|
@@ -12,8 +12,8 @@ import * as path from 'node:path';
|
|
|
12
12
|
* `import { HeroNarrowIR } from './ui/index.js'`) match its `HeroNarrowIR.ts`
|
|
13
13
|
* source file (the metafile key).
|
|
14
14
|
*
|
|
15
|
-
* @param absolutePath - Absolute file path to normalize
|
|
16
|
-
* @returns The path with its extension stripped, if any
|
|
15
|
+
* @param absolutePath - Absolute file path to normalize.
|
|
16
|
+
* @returns The path with its extension stripped, if any.
|
|
17
17
|
*/
|
|
18
18
|
export function normalizeModuleKey(absolutePath) {
|
|
19
19
|
const ext = path.extname(absolutePath);
|
|
@@ -40,9 +40,9 @@ export function normalizeModuleKey(absolutePath) {
|
|
|
40
40
|
* `.js`-suffixed import convention (see `normalizeModuleKey`) makes that
|
|
41
41
|
* unnecessary — a plain path + extension-strip is enough to match.
|
|
42
42
|
*
|
|
43
|
-
* @param namespaceModules - Extensionless absolute path
|
|
44
|
-
* populated from esbuild's `metafile.outputs[x].inputs
|
|
45
|
-
* @returns An esbuild plugin implementing the rewrite
|
|
43
|
+
* @param namespaceModules - Extensionless absolute path to virtual specifier,
|
|
44
|
+
* populated from esbuild's `metafile.outputs[x].inputs`.
|
|
45
|
+
* @returns An esbuild plugin implementing the rewrite.
|
|
46
46
|
*/
|
|
47
47
|
export function namespaceModuleExternalPlugin(namespaceModules) {
|
|
48
48
|
return {
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -1,16 +1,70 @@
|
|
|
1
1
|
import { DiagnosticCollector } from './diagnostics/index.js';
|
|
2
2
|
import type { Project } from './project.js';
|
|
3
|
+
/**
|
|
4
|
+
* Artifacts and namespace state populated incrementally by build plugins.
|
|
5
|
+
*/
|
|
6
|
+
export interface BuildOutputs {
|
|
7
|
+
/**
|
|
8
|
+
* Entry script path relative to the output directory.
|
|
9
|
+
*/
|
|
10
|
+
entryScript?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Compiled skins module path relative to the output directory.
|
|
13
|
+
*/
|
|
14
|
+
skinsScript?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Component catalog path relative to the development output directory.
|
|
17
|
+
*/
|
|
18
|
+
componentCatalog?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Import-map entries from module specifiers to output-relative chunk paths.
|
|
21
|
+
*/
|
|
22
|
+
engine: Record<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Source modules already owned by namespace bundles.
|
|
25
|
+
*
|
|
26
|
+
* Keys are normalized, extensionless absolute paths. Values are virtual
|
|
27
|
+
* namespace specifiers. Source compilation uses the map to preserve a single
|
|
28
|
+
* class identity when relative imports bypass a namespace entry.
|
|
29
|
+
*/
|
|
30
|
+
namespaceModules: Map<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Generated entry sources for convention-based component namespaces.
|
|
33
|
+
*/
|
|
34
|
+
namespaceEntries: Map<string, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Namespace rebuild callbacks used when component membership changes.
|
|
37
|
+
*/
|
|
38
|
+
namespaceRebuilders: Map<string, () => Promise<void>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options used to create a build context.
|
|
42
|
+
*/
|
|
43
|
+
export interface BuildContextOptions {
|
|
44
|
+
readonly sourcemap?: boolean;
|
|
45
|
+
readonly analyze?: boolean;
|
|
46
|
+
readonly watch?: boolean;
|
|
47
|
+
readonly strict?: boolean;
|
|
48
|
+
}
|
|
3
49
|
/**
|
|
4
50
|
* Shared state threaded through every build plugin.
|
|
5
51
|
*
|
|
6
|
-
* Plugins
|
|
7
|
-
*
|
|
8
|
-
* generated entry script name so the HTML generator can reference it).
|
|
52
|
+
* Plugins treat `project` and build flags as immutable and communicate with
|
|
53
|
+
* later steps through `outputs`.
|
|
9
54
|
*/
|
|
10
55
|
export interface BuildContext {
|
|
11
56
|
readonly project: Project;
|
|
57
|
+
/**
|
|
58
|
+
* Whether application bundles include source maps.
|
|
59
|
+
*/
|
|
12
60
|
readonly sourcemap: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether release compilation prints bundle analysis.
|
|
63
|
+
*/
|
|
13
64
|
readonly analyze: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether long-lived compiler contexts watch for source changes.
|
|
67
|
+
*/
|
|
14
68
|
readonly watch: boolean;
|
|
15
69
|
/**
|
|
16
70
|
* Whether strict policy promotes selected warnings to errors.
|
|
@@ -23,36 +77,7 @@ export interface BuildContext {
|
|
|
23
77
|
/**
|
|
24
78
|
* Artifacts produced during the build, populated incrementally by plugins.
|
|
25
79
|
*/
|
|
26
|
-
readonly outputs:
|
|
27
|
-
/**
|
|
28
|
-
* Entry script path, relative to the output dir (e.g. `Main.js`, `js/main.min_ab12.js`).
|
|
29
|
-
*/
|
|
30
|
-
entryScript?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Compiled skins module path, relative to the output dir (e.g. `js/default.thm.js`).
|
|
33
|
-
*/
|
|
34
|
-
skinsScript?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Engine import-map: package specifier → chunk path relative to output dir.
|
|
37
|
-
*/
|
|
38
|
-
engine: Record<string, string>;
|
|
39
|
-
/**
|
|
40
|
-
* Every source file bundled into a custom-namespace chunk (see
|
|
41
|
-
* `compile-custom-namespaces.ts`), keyed by its extensionless absolute
|
|
42
|
-
* path (see `normalizeModuleKey` in `namespace-external-plugin.ts`) and
|
|
43
|
-
* mapped to that namespace's virtual specifier (e.g. `#ns/game`).
|
|
44
|
-
*
|
|
45
|
-
* Populated from esbuild's `metafile.outputs[x].inputs` — the exact set
|
|
46
|
-
* of files a chunk inlined, not a guess. Two consumers rely on this:
|
|
47
|
-
* `compile-source.ts` excludes these files from its per-file dev output
|
|
48
|
-
* (re-emitting them as separate entry points would bundle a second,
|
|
49
|
-
* distinct copy of the same classes), and `namespaceModuleExternalPlugin`
|
|
50
|
-
* rewrites any import resolving to one of these paths — even a relative
|
|
51
|
-
* import that bypasses the namespace's barrel file — to the matching
|
|
52
|
-
* specifier instead of inlining it.
|
|
53
|
-
*/
|
|
54
|
-
namespaceModules: Map<string, string>;
|
|
55
|
-
};
|
|
80
|
+
readonly outputs: BuildOutputs;
|
|
56
81
|
/**
|
|
57
82
|
* Cleanup callbacks registered by long-lived plugins (watchers, contexts).
|
|
58
83
|
*/
|
|
@@ -68,12 +93,7 @@ export interface BuildPlugin {
|
|
|
68
93
|
/**
|
|
69
94
|
* Creates a fresh build context for a project.
|
|
70
95
|
*/
|
|
71
|
-
export declare function createContext(project: Project, options?:
|
|
72
|
-
sourcemap?: boolean;
|
|
73
|
-
analyze?: boolean;
|
|
74
|
-
watch?: boolean;
|
|
75
|
-
strict?: boolean;
|
|
76
|
-
}): BuildContext;
|
|
96
|
+
export declare function createContext(project: Project, options?: BuildContextOptions): BuildContext;
|
|
77
97
|
/**
|
|
78
98
|
* Runs plugins in order, logging each step.
|
|
79
99
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/core/pipeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file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,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,mBAAwB,GAC/B,YAAY,CAiBd;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASnG;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE"}
|
package/dist/core/pipeline.js
CHANGED
|
@@ -13,7 +13,12 @@ export function createContext(project, options = {}) {
|
|
|
13
13
|
watch: options.watch ?? false,
|
|
14
14
|
strict,
|
|
15
15
|
diagnostics: new DiagnosticCollector({ strict }),
|
|
16
|
-
outputs: {
|
|
16
|
+
outputs: {
|
|
17
|
+
engine: {},
|
|
18
|
+
namespaceModules: new Map(),
|
|
19
|
+
namespaceEntries: new Map(),
|
|
20
|
+
namespaceRebuilders: new Map(),
|
|
21
|
+
},
|
|
17
22
|
disposers: [],
|
|
18
23
|
};
|
|
19
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/core/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAA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E,EAAE,CAAC;YACjC,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM,CAAC;YACjG,MAAM,IAAI,UAAU,CAAC,wBAAwB,MAAM,CAAC,IAAI,UAAU,KAAK,uBAAuB,CAAC,CAAC;QACjG,CAAC;IACF,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAiB;IACrD,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-output.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/clean-output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"clean-output.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/clean-output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAOzC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Removes artifacts from the selected output directory before a build.
|
|
4
|
+
*/
|
|
3
5
|
export function cleanOutput() {
|
|
4
6
|
return {
|
|
5
7
|
name: 'clean output',
|