@zeus-js/output-wc 0.1.0-beta.4 → 0.1.0-beta.6
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.js +2 -2
- package/dist/capabilities.cjs.prod.js +2 -2
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.prod.js +1 -1
- package/dist/output-wc.cjs.js +47 -7
- package/dist/output-wc.cjs.prod.js +47 -7
- package/dist/output-wc.esm-bundler.js +47 -7
- package/package.json +35 -30
package/dist/capabilities.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.0-beta.
|
|
2
|
+
* output-wc v0.1.0-beta.6
|
|
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.0-beta.
|
|
12
|
+
version: "0.1.0-beta.6",
|
|
13
13
|
output: {
|
|
14
14
|
webComponent: true,
|
|
15
15
|
customElements: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.0-beta.
|
|
2
|
+
* output-wc v0.1.0-beta.6
|
|
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.0-beta.
|
|
12
|
+
version: "0.1.0-beta.6",
|
|
13
13
|
output: {
|
|
14
14
|
webComponent: true,
|
|
15
15
|
customElements: true,
|
package/dist/capabilities.js
CHANGED
package/dist/output-wc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.0-beta.
|
|
2
|
+
* output-wc v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -322,22 +322,60 @@ function generateLoader() {
|
|
|
322
322
|
return `import { bootstrapLazy } from "@zeus-js/web-c-runtime";
|
|
323
323
|
import { components } from "./components.manifest.js";
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
const componentsByTagName = new Map(
|
|
326
|
+
components.map(component => [component.tagName, component]),
|
|
327
|
+
);
|
|
326
328
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
const definedTagsByRegistry = new WeakMap();
|
|
330
|
+
|
|
331
|
+
function resolveRegistry(options) {
|
|
332
|
+
return options.registry ??
|
|
333
|
+
(typeof customElements === "undefined" ? undefined : customElements);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function getDefinedTags(registry) {
|
|
337
|
+
let definedTags = definedTagsByRegistry.get(registry);
|
|
338
|
+
|
|
339
|
+
if (!definedTags) {
|
|
340
|
+
definedTags = new Set();
|
|
341
|
+
definedTagsByRegistry.set(registry, definedTags);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return definedTags;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export function defineCustomElement(tagName, options = {}) {
|
|
348
|
+
const registry = resolveRegistry(options);
|
|
349
|
+
|
|
350
|
+
if (!registry) {
|
|
329
351
|
return;
|
|
330
352
|
}
|
|
331
353
|
|
|
332
|
-
|
|
354
|
+
const component = componentsByTagName.get(tagName);
|
|
355
|
+
|
|
356
|
+
if (!component) {
|
|
357
|
+
throw new Error(\`[zeus:web-c] Unknown custom element: <\${tagName}>.\`);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const definedTags = getDefinedTags(registry);
|
|
361
|
+
|
|
362
|
+
if (definedTags.has(tagName) || registry.get(tagName)) {
|
|
363
|
+
definedTags.add(tagName);
|
|
333
364
|
return;
|
|
334
365
|
}
|
|
335
366
|
|
|
336
|
-
bootstrapLazy(
|
|
367
|
+
bootstrapLazy([component], { registry });
|
|
368
|
+
|
|
369
|
+
definedTags.add(tagName);
|
|
370
|
+
}
|
|
337
371
|
|
|
338
|
-
|
|
372
|
+
export function defineCustomElements(options = {}) {
|
|
373
|
+
for (const component of components) {
|
|
374
|
+
defineCustomElement(component.tagName, options);
|
|
375
|
+
}
|
|
339
376
|
}
|
|
340
377
|
|
|
378
|
+
export const defineLazyElement = defineCustomElement;
|
|
341
379
|
export const defineLazyElements = defineCustomElements;
|
|
342
380
|
`;
|
|
343
381
|
}
|
|
@@ -351,7 +389,9 @@ export {};
|
|
|
351
389
|
}
|
|
352
390
|
function generateLazyIndex() {
|
|
353
391
|
return `export {
|
|
392
|
+
defineCustomElement,
|
|
354
393
|
defineCustomElements,
|
|
394
|
+
defineLazyElement,
|
|
355
395
|
defineLazyElements,
|
|
356
396
|
} from "./loader.js";
|
|
357
397
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.0-beta.
|
|
2
|
+
* output-wc v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -322,22 +322,60 @@ function generateLoader() {
|
|
|
322
322
|
return `import { bootstrapLazy } from "@zeus-js/web-c-runtime";
|
|
323
323
|
import { components } from "./components.manifest.js";
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
const componentsByTagName = new Map(
|
|
326
|
+
components.map(component => [component.tagName, component]),
|
|
327
|
+
);
|
|
326
328
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
const definedTagsByRegistry = new WeakMap();
|
|
330
|
+
|
|
331
|
+
function resolveRegistry(options) {
|
|
332
|
+
return options.registry ??
|
|
333
|
+
(typeof customElements === "undefined" ? undefined : customElements);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function getDefinedTags(registry) {
|
|
337
|
+
let definedTags = definedTagsByRegistry.get(registry);
|
|
338
|
+
|
|
339
|
+
if (!definedTags) {
|
|
340
|
+
definedTags = new Set();
|
|
341
|
+
definedTagsByRegistry.set(registry, definedTags);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return definedTags;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export function defineCustomElement(tagName, options = {}) {
|
|
348
|
+
const registry = resolveRegistry(options);
|
|
349
|
+
|
|
350
|
+
if (!registry) {
|
|
329
351
|
return;
|
|
330
352
|
}
|
|
331
353
|
|
|
332
|
-
|
|
354
|
+
const component = componentsByTagName.get(tagName);
|
|
355
|
+
|
|
356
|
+
if (!component) {
|
|
357
|
+
throw new Error(\`[zeus:web-c] Unknown custom element: <\${tagName}>.\`);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const definedTags = getDefinedTags(registry);
|
|
361
|
+
|
|
362
|
+
if (definedTags.has(tagName) || registry.get(tagName)) {
|
|
363
|
+
definedTags.add(tagName);
|
|
333
364
|
return;
|
|
334
365
|
}
|
|
335
366
|
|
|
336
|
-
bootstrapLazy(
|
|
367
|
+
bootstrapLazy([component], { registry });
|
|
368
|
+
|
|
369
|
+
definedTags.add(tagName);
|
|
370
|
+
}
|
|
337
371
|
|
|
338
|
-
|
|
372
|
+
export function defineCustomElements(options = {}) {
|
|
373
|
+
for (const component of components) {
|
|
374
|
+
defineCustomElement(component.tagName, options);
|
|
375
|
+
}
|
|
339
376
|
}
|
|
340
377
|
|
|
378
|
+
export const defineLazyElement = defineCustomElement;
|
|
341
379
|
export const defineLazyElements = defineCustomElements;
|
|
342
380
|
`;
|
|
343
381
|
}
|
|
@@ -351,7 +389,9 @@ export {};
|
|
|
351
389
|
}
|
|
352
390
|
function generateLazyIndex() {
|
|
353
391
|
return `export {
|
|
392
|
+
defineCustomElement,
|
|
354
393
|
defineCustomElements,
|
|
394
|
+
defineLazyElement,
|
|
355
395
|
defineLazyElements,
|
|
356
396
|
} from "./loader.js";
|
|
357
397
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-wc v0.1.0-beta.
|
|
2
|
+
* output-wc v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -295,22 +295,60 @@ function generateLoader() {
|
|
|
295
295
|
return `import { bootstrapLazy } from "@zeus-js/web-c-runtime";
|
|
296
296
|
import { components } from "./components.manifest.js";
|
|
297
297
|
|
|
298
|
-
|
|
298
|
+
const componentsByTagName = new Map(
|
|
299
|
+
components.map(component => [component.tagName, component]),
|
|
300
|
+
);
|
|
299
301
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
+
const definedTagsByRegistry = new WeakMap();
|
|
303
|
+
|
|
304
|
+
function resolveRegistry(options) {
|
|
305
|
+
return options.registry ??
|
|
306
|
+
(typeof customElements === "undefined" ? undefined : customElements);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function getDefinedTags(registry) {
|
|
310
|
+
let definedTags = definedTagsByRegistry.get(registry);
|
|
311
|
+
|
|
312
|
+
if (!definedTags) {
|
|
313
|
+
definedTags = new Set();
|
|
314
|
+
definedTagsByRegistry.set(registry, definedTags);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return definedTags;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function defineCustomElement(tagName, options = {}) {
|
|
321
|
+
const registry = resolveRegistry(options);
|
|
322
|
+
|
|
323
|
+
if (!registry) {
|
|
302
324
|
return;
|
|
303
325
|
}
|
|
304
326
|
|
|
305
|
-
|
|
327
|
+
const component = componentsByTagName.get(tagName);
|
|
328
|
+
|
|
329
|
+
if (!component) {
|
|
330
|
+
throw new Error(\`[zeus:web-c] Unknown custom element: <\${tagName}>.\`);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const definedTags = getDefinedTags(registry);
|
|
334
|
+
|
|
335
|
+
if (definedTags.has(tagName) || registry.get(tagName)) {
|
|
336
|
+
definedTags.add(tagName);
|
|
306
337
|
return;
|
|
307
338
|
}
|
|
308
339
|
|
|
309
|
-
bootstrapLazy(
|
|
340
|
+
bootstrapLazy([component], { registry });
|
|
341
|
+
|
|
342
|
+
definedTags.add(tagName);
|
|
343
|
+
}
|
|
310
344
|
|
|
311
|
-
|
|
345
|
+
export function defineCustomElements(options = {}) {
|
|
346
|
+
for (const component of components) {
|
|
347
|
+
defineCustomElement(component.tagName, options);
|
|
348
|
+
}
|
|
312
349
|
}
|
|
313
350
|
|
|
351
|
+
export const defineLazyElement = defineCustomElement;
|
|
314
352
|
export const defineLazyElements = defineCustomElements;
|
|
315
353
|
`;
|
|
316
354
|
}
|
|
@@ -324,7 +362,9 @@ export {};
|
|
|
324
362
|
}
|
|
325
363
|
function generateLazyIndex() {
|
|
326
364
|
return `export {
|
|
365
|
+
defineCustomElement,
|
|
327
366
|
defineCustomElements,
|
|
367
|
+
defineLazyElement,
|
|
328
368
|
defineLazyElements,
|
|
329
369
|
} from "./loader.js";
|
|
330
370
|
`;
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeus-js/output-wc",
|
|
3
|
-
"version": "0.1.0-beta.4",
|
|
4
|
-
"description": "Zeus Web Component output plugin",
|
|
5
3
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
4
|
+
"version": "0.1.0-beta.6",
|
|
5
|
+
"description": "Zeus Web Component output plugin",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/baicie/zeus.git",
|
|
10
|
+
"directory": "packages/web-c/output-wc"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"provenance": true
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
13
17
|
"exports": {
|
|
14
18
|
".": {
|
|
15
19
|
"types": "./dist/output-wc.d.ts",
|
|
@@ -33,11 +37,26 @@
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
+
"files": [
|
|
41
|
+
"index.js",
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"rollup": "^4.0.0"
|
|
40
46
|
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"rollup": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@zeus-js/bundler-plugin": "0.1.0-beta.6",
|
|
54
|
+
"@zeus-js/web-c-runtime": "0.1.0-beta.6",
|
|
55
|
+
"@zeus-js/component-dts": "0.1.0-beta.6",
|
|
56
|
+
"@zeus-js/component-analyzer": "0.1.0-beta.6",
|
|
57
|
+
"@zeus-js/runtime-dom": "0.1.0-beta.6"
|
|
58
|
+
},
|
|
59
|
+
"author": "Baicie",
|
|
41
60
|
"buildOptions": {
|
|
42
61
|
"name": "ZeusOutputWC",
|
|
43
62
|
"formats": [
|
|
@@ -51,26 +70,12 @@
|
|
|
51
70
|
}
|
|
52
71
|
]
|
|
53
72
|
},
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"@zeus-js/bundler-plugin": "0.1.0-beta.4",
|
|
56
|
-
"@zeus-js/component-analyzer": "0.1.0-beta.4",
|
|
57
|
-
"@zeus-js/runtime-dom": "0.1.0-beta.4",
|
|
58
|
-
"@zeus-js/component-dts": "0.1.0-beta.4",
|
|
59
|
-
"@zeus-js/web-c-runtime": "0.2.0"
|
|
60
|
-
},
|
|
61
|
-
"peerDependencies": {
|
|
62
|
-
"rollup": "^4.0.0"
|
|
63
|
-
},
|
|
64
|
-
"peerDependenciesMeta": {
|
|
65
|
-
"rollup": {
|
|
66
|
-
"optional": true
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
73
|
"keywords": [
|
|
70
74
|
"zeus",
|
|
71
75
|
"web-components",
|
|
72
76
|
"custom-elements"
|
|
73
77
|
],
|
|
74
|
-
"
|
|
75
|
-
"
|
|
78
|
+
"main": "index.js",
|
|
79
|
+
"module": "dist/output-wc.esm-bundler.js",
|
|
80
|
+
"types": "dist/output-wc.d.ts"
|
|
76
81
|
}
|