@zeus-js/output-wc 0.1.1-beta.17 → 0.1.1-beta.19
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/dist/capabilities.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.1-beta.
|
|
2
|
+
* output-wc v0.1.1-beta.19
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -9,7 +9,7 @@ Object.defineProperties(exports, {
|
|
|
9
9
|
});
|
|
10
10
|
const ZEUS_OUTPUT_WC_CAPABILITIES = {
|
|
11
11
|
packageName: "@zeus-js/output-wc",
|
|
12
|
-
version: "0.1.1-beta.
|
|
12
|
+
version: "0.1.1-beta.19",
|
|
13
13
|
output: {
|
|
14
14
|
webComponent: true,
|
|
15
15
|
customElements: true,
|
package/dist/capabilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.1-beta.
|
|
2
|
+
* output-wc v0.1.1-beta.19
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -9,7 +9,7 @@ Object.defineProperties(exports, {
|
|
|
9
9
|
});
|
|
10
10
|
const ZEUS_OUTPUT_WC_CAPABILITIES = {
|
|
11
11
|
packageName: "@zeus-js/output-wc",
|
|
12
|
-
version: "0.1.1-beta.
|
|
12
|
+
version: "0.1.1-beta.19",
|
|
13
13
|
output: {
|
|
14
14
|
webComponent: true,
|
|
15
15
|
customElements: true,
|
package/dist/output-wc.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.1-beta.
|
|
2
|
+
* output-wc v0.1.1-beta.19
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -65,7 +65,14 @@ function validateComponentManifest(manifest) {
|
|
|
65
65
|
attributes.set(attrName, propName);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {}))
|
|
68
|
+
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {})) {
|
|
69
|
+
if (event.name !== void 0 && typeof event.name !== "string" || event.reactName !== void 0 && typeof event.reactName !== "string" || event.bubbles !== void 0 && typeof event.bubbles !== "boolean" || event.composed !== void 0 && typeof event.composed !== "boolean" || event.cancelable !== void 0 && typeof event.cancelable !== "boolean") throw new Error(`[ZEUS_WC_EVENT_ABI] ${componentPath}.events.${eventKey} contains invalid names or bubbles/composed/cancelable flags.`);
|
|
70
|
+
const eventPath = `${componentPath}.events.${eventKey}`;
|
|
71
|
+
if (event.detail !== void 0) assertJsonSafe(event.detail, `${eventPath}.detail`);
|
|
72
|
+
if (event.detailOptional !== void 0) assertJsonSafe(event.detailOptional, `${eventPath}.detailOptional`);
|
|
73
|
+
if (event.detail !== void 0 && (event.detail === null || typeof event.detail !== "object" || Array.isArray(event.detail) || Object.values(event.detail).some((type) => typeof type !== "string"))) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detail must map field names to type strings.`);
|
|
74
|
+
if (event.detailOptional !== void 0 && (!Array.isArray(event.detailOptional) || !event.detail || [...event.detailOptional].some((name) => typeof name !== "string" || !Object.prototype.hasOwnProperty.call(event.detail, name)) || new Set(event.detailOptional).size !== event.detailOptional.length)) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detailOptional must contain unique names from detail.`);
|
|
75
|
+
}
|
|
69
76
|
for (const [propName, prop] of Object.entries((_component$props2 = component.props) !== null && _component$props2 !== void 0 ? _component$props2 : {})) {
|
|
70
77
|
if (prop.hasDefault !== void 0 && typeof prop.hasDefault !== "boolean") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.hasDefault must be boolean.`);
|
|
71
78
|
if (prop.defaultStrategy !== void 0 && prop.defaultStrategy !== "static" && prop.defaultStrategy !== "factory") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.defaultStrategy is invalid.`);
|
|
@@ -197,7 +204,7 @@ function generateEvents(component) {
|
|
|
197
204
|
return {
|
|
198
205
|
name: (_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key),
|
|
199
206
|
description: event.description,
|
|
200
|
-
type: { text: event.detail ? `CustomEvent<${formatDetailType(event.detail)}>` : "CustomEvent" }
|
|
207
|
+
type: { text: event.detail ? `CustomEvent<${(0, _zeus_js_component_dts.formatDetailType)(event.detail, event.detailOptional)}>` : "CustomEvent" }
|
|
201
208
|
};
|
|
202
209
|
});
|
|
203
210
|
}
|
|
@@ -233,9 +240,6 @@ function formatPropType(prop) {
|
|
|
233
240
|
function isAttributeBackedType$1(type) {
|
|
234
241
|
return type === "string" || type === "number" || type === "boolean";
|
|
235
242
|
}
|
|
236
|
-
function formatDetailType(detail) {
|
|
237
|
-
return `{ ${Object.entries(detail).map(([name, type]) => `${name}: ${type}`).join("; ")} }`;
|
|
238
|
-
}
|
|
239
243
|
function normalizeModulePath(value) {
|
|
240
244
|
return value.replace(/\\/g, "/");
|
|
241
245
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.1-beta.
|
|
2
|
+
* output-wc v0.1.1-beta.19
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { resolvePluginDts } from "@zeus-js/bundler-plugin";
|
|
9
|
-
import { generateLoaderDts, generateWCDtsFiles, generateWCJsxDts } from "@zeus-js/component-dts";
|
|
9
|
+
import { formatDetailType, generateLoaderDts, generateWCDtsFiles, generateWCJsxDts } from "@zeus-js/component-dts";
|
|
10
10
|
//#region packages/web-c/output-wc/src/generateManifest.ts
|
|
11
11
|
function generateZeusComponentsManifest(manifest) {
|
|
12
12
|
validateComponentManifest(manifest);
|
|
@@ -38,7 +38,14 @@ function validateComponentManifest(manifest) {
|
|
|
38
38
|
attributes.set(attrName, propName);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {}))
|
|
41
|
+
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {})) {
|
|
42
|
+
if (event.name !== void 0 && typeof event.name !== "string" || event.reactName !== void 0 && typeof event.reactName !== "string" || event.bubbles !== void 0 && typeof event.bubbles !== "boolean" || event.composed !== void 0 && typeof event.composed !== "boolean" || event.cancelable !== void 0 && typeof event.cancelable !== "boolean") throw new Error(`[ZEUS_WC_EVENT_ABI] ${componentPath}.events.${eventKey} contains invalid names or bubbles/composed/cancelable flags.`);
|
|
43
|
+
const eventPath = `${componentPath}.events.${eventKey}`;
|
|
44
|
+
if (event.detail !== void 0) assertJsonSafe(event.detail, `${eventPath}.detail`);
|
|
45
|
+
if (event.detailOptional !== void 0) assertJsonSafe(event.detailOptional, `${eventPath}.detailOptional`);
|
|
46
|
+
if (event.detail !== void 0 && (event.detail === null || typeof event.detail !== "object" || Array.isArray(event.detail) || Object.values(event.detail).some((type) => typeof type !== "string"))) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detail must map field names to type strings.`);
|
|
47
|
+
if (event.detailOptional !== void 0 && (!Array.isArray(event.detailOptional) || !event.detail || [...event.detailOptional].some((name) => typeof name !== "string" || !Object.prototype.hasOwnProperty.call(event.detail, name)) || new Set(event.detailOptional).size !== event.detailOptional.length)) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detailOptional must contain unique names from detail.`);
|
|
48
|
+
}
|
|
42
49
|
for (const [propName, prop] of Object.entries((_component$props2 = component.props) !== null && _component$props2 !== void 0 ? _component$props2 : {})) {
|
|
43
50
|
if (prop.hasDefault !== void 0 && typeof prop.hasDefault !== "boolean") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.hasDefault must be boolean.`);
|
|
44
51
|
if (prop.defaultStrategy !== void 0 && prop.defaultStrategy !== "static" && prop.defaultStrategy !== "factory") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.defaultStrategy is invalid.`);
|
|
@@ -170,7 +177,7 @@ function generateEvents(component) {
|
|
|
170
177
|
return {
|
|
171
178
|
name: (_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key),
|
|
172
179
|
description: event.description,
|
|
173
|
-
type: { text: event.detail ? `CustomEvent<${formatDetailType(event.detail)}>` : "CustomEvent" }
|
|
180
|
+
type: { text: event.detail ? `CustomEvent<${formatDetailType(event.detail, event.detailOptional)}>` : "CustomEvent" }
|
|
174
181
|
};
|
|
175
182
|
});
|
|
176
183
|
}
|
|
@@ -206,9 +213,6 @@ function formatPropType(prop) {
|
|
|
206
213
|
function isAttributeBackedType$1(type) {
|
|
207
214
|
return type === "string" || type === "number" || type === "boolean";
|
|
208
215
|
}
|
|
209
|
-
function formatDetailType(detail) {
|
|
210
|
-
return `{ ${Object.entries(detail).map(([name, type]) => `${name}: ${type}`).join("; ")} }`;
|
|
211
|
-
}
|
|
212
216
|
function normalizeModulePath(value) {
|
|
213
217
|
return value.replace(/\\/g, "/");
|
|
214
218
|
}
|
package/dist/output-wc.prod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.1-beta.
|
|
2
|
+
* output-wc v0.1.1-beta.19
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -65,7 +65,14 @@ function validateComponentManifest(manifest) {
|
|
|
65
65
|
attributes.set(attrName, propName);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {}))
|
|
68
|
+
for (const [eventKey, event] of Object.entries((_component$events = component.events) !== null && _component$events !== void 0 ? _component$events : {})) {
|
|
69
|
+
if (event.name !== void 0 && typeof event.name !== "string" || event.reactName !== void 0 && typeof event.reactName !== "string" || event.bubbles !== void 0 && typeof event.bubbles !== "boolean" || event.composed !== void 0 && typeof event.composed !== "boolean" || event.cancelable !== void 0 && typeof event.cancelable !== "boolean") throw new Error(`[ZEUS_WC_EVENT_ABI] ${componentPath}.events.${eventKey} contains invalid names or bubbles/composed/cancelable flags.`);
|
|
70
|
+
const eventPath = `${componentPath}.events.${eventKey}`;
|
|
71
|
+
if (event.detail !== void 0) assertJsonSafe(event.detail, `${eventPath}.detail`);
|
|
72
|
+
if (event.detailOptional !== void 0) assertJsonSafe(event.detailOptional, `${eventPath}.detailOptional`);
|
|
73
|
+
if (event.detail !== void 0 && (event.detail === null || typeof event.detail !== "object" || Array.isArray(event.detail) || Object.values(event.detail).some((type) => typeof type !== "string"))) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detail must map field names to type strings.`);
|
|
74
|
+
if (event.detailOptional !== void 0 && (!Array.isArray(event.detailOptional) || !event.detail || [...event.detailOptional].some((name) => typeof name !== "string" || !Object.prototype.hasOwnProperty.call(event.detail, name)) || new Set(event.detailOptional).size !== event.detailOptional.length)) throw new Error(`[ZEUS_WC_EVENT_ABI] ${eventPath}.detailOptional must contain unique names from detail.`);
|
|
75
|
+
}
|
|
69
76
|
for (const [propName, prop] of Object.entries((_component$props2 = component.props) !== null && _component$props2 !== void 0 ? _component$props2 : {})) {
|
|
70
77
|
if (prop.hasDefault !== void 0 && typeof prop.hasDefault !== "boolean") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.hasDefault must be boolean.`);
|
|
71
78
|
if (prop.defaultStrategy !== void 0 && prop.defaultStrategy !== "static" && prop.defaultStrategy !== "factory") throw new Error(`[ZEUS_WC_INVALID_DEFAULT_META] ${componentPath}.props.${propName}.defaultStrategy is invalid.`);
|
|
@@ -197,7 +204,7 @@ function generateEvents(component) {
|
|
|
197
204
|
return {
|
|
198
205
|
name: (_event$name = event.name) !== null && _event$name !== void 0 ? _event$name : toKebabCase$1((_event$key = event.key) !== null && _event$key !== void 0 ? _event$key : key),
|
|
199
206
|
description: event.description,
|
|
200
|
-
type: { text: event.detail ? `CustomEvent<${formatDetailType(event.detail)}>` : "CustomEvent" }
|
|
207
|
+
type: { text: event.detail ? `CustomEvent<${(0, _zeus_js_component_dts.formatDetailType)(event.detail, event.detailOptional)}>` : "CustomEvent" }
|
|
201
208
|
};
|
|
202
209
|
});
|
|
203
210
|
}
|
|
@@ -233,9 +240,6 @@ function formatPropType(prop) {
|
|
|
233
240
|
function isAttributeBackedType$1(type) {
|
|
234
241
|
return type === "string" || type === "number" || type === "boolean";
|
|
235
242
|
}
|
|
236
|
-
function formatDetailType(detail) {
|
|
237
|
-
return `{ ${Object.entries(detail).map(([name, type]) => `${name}: ${type}`).join("; ")} }`;
|
|
238
|
-
}
|
|
239
243
|
function normalizeModulePath(value) {
|
|
240
244
|
return value.replace(/\\/g, "/");
|
|
241
245
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeus-js/output-wc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.1-beta.
|
|
4
|
+
"version": "0.1.1-beta.19",
|
|
5
5
|
"description": "Zeus Web Component output plugin",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@zeus-js/
|
|
52
|
-
"@zeus-js/component-analyzer": "0.1.1-beta.
|
|
53
|
-
"@zeus-js/component-dts": "0.1.1-beta.
|
|
54
|
-
"@zeus-js/web-c-runtime": "0.1.1-beta.
|
|
55
|
-
"@zeus-js/
|
|
51
|
+
"@zeus-js/runtime-dom": "0.1.1-beta.19",
|
|
52
|
+
"@zeus-js/component-analyzer": "0.1.1-beta.19",
|
|
53
|
+
"@zeus-js/component-dts": "0.1.1-beta.19",
|
|
54
|
+
"@zeus-js/web-c-runtime": "0.1.1-beta.19",
|
|
55
|
+
"@zeus-js/bundler-plugin": "0.1.1-beta.19"
|
|
56
56
|
},
|
|
57
57
|
"author": "Baicie",
|
|
58
58
|
"buildOptions": {
|