@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.
Files changed (150) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +40 -9
  3. package/dist/commands/build.d.ts +3 -0
  4. package/dist/commands/build.d.ts.map +1 -1
  5. package/dist/commands/build.js +3 -0
  6. package/dist/commands/build.js.map +1 -1
  7. package/dist/commands/clean.d.ts +3 -0
  8. package/dist/commands/clean.d.ts.map +1 -1
  9. package/dist/commands/clean.js +3 -0
  10. package/dist/commands/clean.js.map +1 -1
  11. package/dist/commands/create.d.ts +3 -0
  12. package/dist/commands/create.d.ts.map +1 -1
  13. package/dist/commands/create.js +3 -0
  14. package/dist/commands/create.js.map +1 -1
  15. package/dist/commands/dev.d.ts +3 -0
  16. package/dist/commands/dev.d.ts.map +1 -1
  17. package/dist/commands/dev.js +5 -1
  18. package/dist/commands/dev.js.map +1 -1
  19. package/dist/core/components/discover-components.d.ts +16 -0
  20. package/dist/core/components/discover-components.d.ts.map +1 -0
  21. package/dist/core/components/discover-components.js +191 -0
  22. package/dist/core/components/discover-components.js.map +1 -0
  23. package/dist/core/config.d.ts +45 -17
  24. package/dist/core/config.d.ts.map +1 -1
  25. package/dist/core/config.js +16 -6
  26. package/dist/core/config.js.map +1 -1
  27. package/dist/core/dev-server.d.ts +5 -5
  28. package/dist/core/dev-server.d.ts.map +1 -1
  29. package/dist/core/dev-server.js +97 -25
  30. package/dist/core/dev-server.js.map +1 -1
  31. package/dist/core/diagnostics/output.d.ts +31 -0
  32. package/dist/core/diagnostics/output.d.ts.map +1 -1
  33. package/dist/core/diagnostics/output.js +13 -0
  34. package/dist/core/diagnostics/output.js.map +1 -1
  35. package/dist/core/diagnostics/types.d.ts +15 -0
  36. package/dist/core/diagnostics/types.d.ts.map +1 -1
  37. package/dist/core/errors.d.ts.map +1 -1
  38. package/dist/core/errors.js.map +1 -1
  39. package/dist/core/exml/ast.d.ts +27 -0
  40. package/dist/core/exml/ast.d.ts.map +1 -1
  41. package/dist/core/exml/codegen.d.ts +6 -7
  42. package/dist/core/exml/codegen.d.ts.map +1 -1
  43. package/dist/core/exml/codegen.js +57 -87
  44. package/dist/core/exml/codegen.js.map +1 -1
  45. package/dist/core/exml/exml-diagnostics.d.ts +2 -1
  46. package/dist/core/exml/exml-diagnostics.d.ts.map +1 -1
  47. package/dist/core/exml/exml-diagnostics.js +2 -2
  48. package/dist/core/exml/exml-diagnostics.js.map +1 -1
  49. package/dist/core/exml/exml-parser.d.ts +11 -11
  50. package/dist/core/exml/exml-parser.d.ts.map +1 -1
  51. package/dist/core/exml/exml-parser.js +90 -178
  52. package/dist/core/exml/exml-parser.js.map +1 -1
  53. package/dist/core/exml/index.d.ts +13 -13
  54. package/dist/core/exml/index.d.ts.map +1 -1
  55. package/dist/core/exml/index.js +12 -13
  56. package/dist/core/exml/index.js.map +1 -1
  57. package/dist/core/exml/registry.d.ts +39 -33
  58. package/dist/core/exml/registry.d.ts.map +1 -1
  59. package/dist/core/exml/registry.js +56 -43
  60. package/dist/core/exml/registry.js.map +1 -1
  61. package/dist/core/exml/skin-module-builder.d.ts +14 -0
  62. package/dist/core/exml/skin-module-builder.d.ts.map +1 -1
  63. package/dist/core/exml/skin-module-builder.js +8 -2
  64. package/dist/core/exml/skin-module-builder.js.map +1 -1
  65. package/dist/core/exml/xml-parser.d.ts +36 -26
  66. package/dist/core/exml/xml-parser.d.ts.map +1 -1
  67. package/dist/core/exml/xml-parser.js +133 -144
  68. package/dist/core/exml/xml-parser.js.map +1 -1
  69. package/dist/core/namespace-external-plugin.d.ts +5 -5
  70. package/dist/core/namespace-external-plugin.js +5 -5
  71. package/dist/core/pipeline.d.ts +59 -39
  72. package/dist/core/pipeline.d.ts.map +1 -1
  73. package/dist/core/pipeline.js +6 -1
  74. package/dist/core/pipeline.js.map +1 -1
  75. package/dist/core/plugins/clean-output.d.ts +3 -0
  76. package/dist/core/plugins/clean-output.d.ts.map +1 -1
  77. package/dist/core/plugins/clean-output.js +3 -1
  78. package/dist/core/plugins/clean-output.js.map +1 -1
  79. package/dist/core/plugins/compile-custom-namespaces.d.ts +6 -1
  80. package/dist/core/plugins/compile-custom-namespaces.d.ts.map +1 -1
  81. package/dist/core/plugins/compile-custom-namespaces.js +74 -11
  82. package/dist/core/plugins/compile-custom-namespaces.js.map +1 -1
  83. package/dist/core/plugins/compile-engine.d.ts +2 -4
  84. package/dist/core/plugins/compile-engine.d.ts.map +1 -1
  85. package/dist/core/plugins/compile-engine.js +5 -5
  86. package/dist/core/plugins/compile-engine.js.map +1 -1
  87. package/dist/core/plugins/compile-exml.d.ts.map +1 -1
  88. package/dist/core/plugins/compile-exml.js +18 -3
  89. package/dist/core/plugins/compile-exml.js.map +1 -1
  90. package/dist/core/plugins/compile-source.d.ts +1 -1
  91. package/dist/core/plugins/compile-source.d.ts.map +1 -1
  92. package/dist/core/plugins/compile-source.js +10 -8
  93. package/dist/core/plugins/compile-source.js.map +1 -1
  94. package/dist/core/plugins/component-catalog.d.ts +6 -0
  95. package/dist/core/plugins/component-catalog.d.ts.map +1 -0
  96. package/dist/core/plugins/component-catalog.js +30 -0
  97. package/dist/core/plugins/component-catalog.js.map +1 -0
  98. package/dist/core/plugins/copy-assets.d.ts +1 -2
  99. package/dist/core/plugins/copy-assets.d.ts.map +1 -1
  100. package/dist/core/plugins/copy-assets.js +1 -3
  101. package/dist/core/plugins/copy-assets.js.map +1 -1
  102. package/dist/core/plugins/generate-html.d.ts.map +1 -1
  103. package/dist/core/plugins/generate-html.js +1 -1
  104. package/dist/core/plugins/generate-html.js.map +1 -1
  105. package/dist/core/plugins/index.d.ts +1 -0
  106. package/dist/core/plugins/index.d.ts.map +1 -1
  107. package/dist/core/plugins/index.js +3 -0
  108. package/dist/core/plugins/index.js.map +1 -1
  109. package/dist/core/project.d.ts +85 -6
  110. package/dist/core/project.d.ts.map +1 -1
  111. package/dist/core/project.js +53 -8
  112. package/dist/core/project.js.map +1 -1
  113. package/dist/core/template.d.ts +8 -1
  114. package/dist/core/template.d.ts.map +1 -1
  115. package/dist/core/template.js +18 -8
  116. package/dist/core/template.js.map +1 -1
  117. package/dist/define.d.ts +1 -1
  118. package/dist/define.d.ts.map +1 -1
  119. package/dist/utils/fs.d.ts +15 -0
  120. package/dist/utils/fs.d.ts.map +1 -1
  121. package/dist/utils/fs.js +15 -0
  122. package/dist/utils/fs.js.map +1 -1
  123. package/dist/utils/logger.d.ts +7 -3
  124. package/dist/utils/logger.d.ts.map +1 -1
  125. package/dist/utils/logger.js +7 -3
  126. package/dist/utils/logger.js.map +1 -1
  127. package/package.json +1 -1
  128. package/templates/game/kurot.config.ts +4 -2
  129. package/templates/game/src/game-components.ts +0 -6
  130. /package/templates/game/resource/skins/{ButtonSkin.exml → eui/ButtonSkin.exml} +0 -0
  131. /package/templates/game/resource/skins/{CheckBoxSkin.exml → eui/CheckBoxSkin.exml} +0 -0
  132. /package/templates/game/resource/skins/{ComboBoxSkin.exml → eui/ComboBoxSkin.exml} +0 -0
  133. /package/templates/game/resource/skins/{GroupSkin.exml → eui/GroupSkin.exml} +0 -0
  134. /package/templates/game/resource/skins/{HScrollBarSkin.exml → eui/HScrollBarSkin.exml} +0 -0
  135. /package/templates/game/resource/skins/{HSliderSkin.exml → eui/HSliderSkin.exml} +0 -0
  136. /package/templates/game/resource/skins/{ImageSkin.exml → eui/ImageSkin.exml} +0 -0
  137. /package/templates/game/resource/skins/{ItemRendererSkin.exml → eui/ItemRendererSkin.exml} +0 -0
  138. /package/templates/game/resource/skins/{LabelSkin.exml → eui/LabelSkin.exml} +0 -0
  139. /package/templates/game/resource/skins/{ListSkin.exml → eui/ListSkin.exml} +0 -0
  140. /package/templates/game/resource/skins/{PanelSkin.exml → eui/PanelSkin.exml} +0 -0
  141. /package/templates/game/resource/skins/{ProgressBarSkin.exml → eui/ProgressBarSkin.exml} +0 -0
  142. /package/templates/game/resource/skins/{RadioButtonSkin.exml → eui/RadioButtonSkin.exml} +0 -0
  143. /package/templates/game/resource/skins/{ScrollerSkin.exml → eui/ScrollerSkin.exml} +0 -0
  144. /package/templates/game/resource/skins/{TabBarSkin.exml → eui/TabBarSkin.exml} +0 -0
  145. /package/templates/game/resource/skins/{TextInputSkin.exml → eui/TextInputSkin.exml} +0 -0
  146. /package/templates/game/resource/skins/{ToggleButtonSkin.exml → eui/ToggleButtonSkin.exml} +0 -0
  147. /package/templates/game/resource/skins/{ToggleSwitchSkin.exml → eui/ToggleSwitchSkin.exml} +0 -0
  148. /package/templates/game/resource/skins/{VScrollBarSkin.exml → eui/VScrollBarSkin.exml} +0 -0
  149. /package/templates/game/resource/skins/{VSliderSkin.exml → eui/VSliderSkin.exml} +0 -0
  150. /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;;;;;;;;;;;;;;GAcG;AAIH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,KAAK;IACrB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,KAAM,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,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,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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 files.
2
+ * Lightweight XML parser for the subset used by EXML skins.
3
3
  *
4
- * Designed to handle the subset of XML used by EXML skin definitions:
5
- * - Element nodes with namespace-prefixed tags
6
- * - Text nodes (including whitespace)
7
- * - Attribute values (quoted)
8
- * - Self-closing elements
9
- * - CDATA sections
10
- * - XML comments and processing instructions (skipped)
11
- *
12
- * Does NOT support:
13
- * - DTD / ENTITY declarations
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((n) => n.type === 'element');
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(t => t.text)
24
+ .map(node => node.text)
27
25
  .join('');
28
26
  }
29
- // ── Parser implementation ────────────────────────────────────────────
30
27
  /**
31
- * Parse an EXML string into an XML element tree.
32
- * Returns the root element (the `<eui:Skin>` or equivalent).
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 _Parser(source);
36
- const nodes = parser.parse();
37
- // Find the first element node (skip whitespace text, comments, PI)
38
- for (const n of nodes) {
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
- // ── Internal parser ──────────────────────────────────────────────────
45
- const RX_OPEN = /^<([a-zA-Z_][\w:.-]*)/;
46
- const RX_CLOSE = /^<\/([a-zA-Z_][\w:.-]*)\s*>/;
47
- const RX_ATTR = /^([a-zA-Z_][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/;
48
- class _Parser {
49
- src;
50
- pos = 0;
42
+ class XmlParser {
43
+ // ── Instance fields ───────────────────────────────────────────────
44
+ _source;
45
+ _position = 0;
46
+ // ── Constructor ───────────────────────────────────────────────────
51
47
  constructor(source) {
52
- this.src = source;
48
+ this._source = source;
53
49
  }
54
- // ── Main entry ────────────────────────────────────────────────────
50
+ // ── Public methods ────────────────────────────────────────────────
55
51
  parse() {
56
- this.skipWhitespace();
57
- return this.parseNodes();
52
+ this._skipWhitespace();
53
+ return this._parseNodes();
58
54
  }
59
- // ── Node list ─────────────────────────────────────────────────────
60
- parseNodes() {
55
+ // ── Private methods ───────────────────────────────────────────────
56
+ _parseNodes() {
61
57
  const nodes = [];
62
- while (this.pos < this.src.length) {
63
- // End of parent element?
64
- if (this.src[this.pos] === '<') {
65
- // Closing tag?
66
- const m = this.src.slice(this.pos).match(RX_CLOSE);
67
- if (m)
68
- break; // let parent handle it
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
- // CDATA
75
- if (this.src.startsWith('<![CDATA[', this.pos)) {
76
- nodes.push(this.readCDATA());
67
+ if (this._source.startsWith('<![CDATA[', this._position)) {
68
+ nodes.push(this._readCDATA());
77
69
  continue;
78
70
  }
79
- // Processing instruction <?...?>
80
- if (this.src.startsWith('<?', this.pos)) {
81
- this.skipPI();
71
+ if (this._source.startsWith('<?', this._position)) {
72
+ this._skipProcessingInstruction();
82
73
  continue;
83
74
  }
84
- // Element
85
- const el = this.parseElement();
86
- if (el)
87
- nodes.push(el);
75
+ const element = this._parseElement();
76
+ if (element) {
77
+ nodes.push(element);
78
+ }
88
79
  continue;
89
80
  }
90
- // Text content
91
- nodes.push(this.readText());
81
+ nodes.push(this._readText());
92
82
  }
93
83
  return nodes;
94
84
  }
95
- // ── Element ───────────────────────────────────────────────────────
96
- parseElement() {
97
- const start = this.pos;
98
- if (this.src[this.pos] !== '<')
99
- return null;
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
- // Malformed — skip the '<' and continue
104
- this.pos++;
105
- return null;
91
+ this._position++;
92
+ return undefined;
106
93
  }
107
94
  const tagName = tagMatch[1];
108
- this.pos += tagMatch[0].length;
109
- // Parse attributes
110
- const attrs = [];
95
+ this._position += tagMatch[0].length;
96
+ const attributes = [];
111
97
  for (;;) {
112
- this.skipWS();
113
- if (this.pos >= this.src.length)
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
- // Attribute
126
- const am = this.src.slice(this.pos).match(RX_ATTR);
127
- if (am) {
128
- const attributeStart = this.pos;
129
- this.pos += am[0].length;
130
- attrs.push({
131
- name: am[1],
132
- value: am[2] ?? am[3],
133
- range: { start: attributeStart, end: this.pos },
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
- else {
137
- // Unexpected character — skip
138
- this.pos++;
112
+ if (this._source[this._position] === '>') {
113
+ this._position++;
114
+ break;
139
115
  }
140
- }
141
- // Children
142
- const children = this.parseNodes();
143
- // Consume closing tag
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
- this.pos += closeMatch[0].length;
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
- else {
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
- return { type: 'element', name: tagName, attributes: attrs, children, range: { start, end: this.pos } };
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
- // ── Text ──────────────────────────────────────────────────────────
157
- readText() {
158
- const start = this.pos;
146
+ _readText() {
147
+ const start = this._position;
159
148
  let text = '';
160
- while (this.pos < this.src.length && this.src[this.pos] !== '<') {
161
- text += this.src[this.pos++];
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.pos } };
152
+ return { type: 'text', text: unescapeXML(text), range: { start, end: this._position } };
164
153
  }
165
- // ── CDATA ─────────────────────────────────────────────────────────
166
- readCDATA() {
167
- const start = this.pos;
168
- this.pos += 9; // skip '<![CDATA['
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.pos = this.src.length;
172
- return { type: 'text', text: this.src.slice(start), range: { start, end: this.pos } };
159
+ this._position = this._source.length;
160
+ return { type: 'text', text: this._source.slice(start), range: { start, end: this._position } };
173
161
  }
174
- const content = this.src.slice(this.pos, end);
175
- this.pos = end + 3;
176
- return { type: 'text', text: content, range: { start, end: this.pos } };
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
- skipPI() {
184
- const end = this.src.indexOf('?>', this.pos + 2);
185
- this.pos = end === -1 ? this.src.length : end + 2;
166
+ _skipComment() {
167
+ const end = this._source.indexOf('-->', this._position + 4);
168
+ this._position = end === -1 ? this._source.length : end + 3;
186
169
  }
187
- skipWS() {
188
- while (this.pos < this.src.length && /\s/.test(this.src[this.pos]))
189
- this.pos++;
170
+ _skipProcessingInstruction() {
171
+ const end = this._source.indexOf('?>', this._position + 2);
172
+ this._position = end === -1 ? this._source.length : end + 2;
190
173
  }
191
- skipWhitespace() {
192
- this.skipWS();
174
+ _skipWhitespace() {
175
+ while (this._position < this._source.length && /\s/.test(this._source[this._position])) {
176
+ this._position++;
177
+ }
193
178
  }
194
179
  }
195
- // ── Unescape XML entities ────────────────────────────────────────────
196
- function unescapeXML(s) {
197
- // Use hex char codes to avoid auto-formatter converting XML entities
198
- const ENTITIES = {
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 s.replace(/&(amp|lt|gt|quot|apos);/g, (m, name) => ENTITIES[name] ?? m);
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;;;;;;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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 → virtual specifier,
41
- * populated from esbuild's `metafile.outputs[x].inputs` (see `compile-custom-namespaces.ts`)
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 → virtual specifier,
44
- * populated from esbuild's `metafile.outputs[x].inputs` (see `compile-custom-namespaces.ts`)
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 {
@@ -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 read the immutable `project` and `options`, and communicate results
7
- * to later plugins through `outputs` (e.g. the source compiler reports the
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;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC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,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"}
@@ -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: { engine: {}, namespaceModules: new Map() },
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,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAsEzC;;GAEG;AACH,MAAM,UAAU,aAAa,CAC5B,OAAgB,EAChB,UAAyF,EAAE;IAE3F,MAAM,MAAM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C,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,3 +1,6 @@
1
1
  import type { BuildPlugin } from '../pipeline.js';
2
+ /**
3
+ * Removes artifacts from the selected output directory before a build.
4
+ */
2
5
  export declare function cleanOutput(): BuildPlugin;
3
6
  //# sourceMappingURL=clean-output.d.ts.map
@@ -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;AAGlD,wBAAgB,WAAW,IAAI,WAAW,CAOzC"}
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
- // Removes artifacts from previous builds before writing the new output.
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',