@arcgis/lumina-compiler 5.0.0-next.74 → 5.0.0-next.75
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/dependencies/stencil.d.ts +10 -0
- package/dist/index.js +2 -4
- package/dist/testing/index.js +69 -67
- package/package.json +5 -5
|
@@ -5,3 +5,13 @@ export declare function findCdnFiles(packageDirectory: string): Promise<{
|
|
|
5
5
|
readonly cdnName: string;
|
|
6
6
|
readonly hasCss: boolean;
|
|
7
7
|
} | undefined>;
|
|
8
|
+
export type StencilLazyLoadingData = LazyBundleRuntimeData[];
|
|
9
|
+
type LazyBundleRuntimeData = [string, ComponentRuntimeMetaCompact[]];
|
|
10
|
+
type ComponentRuntimeMetaCompact = [
|
|
11
|
+
number,
|
|
12
|
+
/** tagname */
|
|
13
|
+
string,
|
|
14
|
+
/** members */
|
|
15
|
+
Record<string, [number, string?]>?
|
|
16
|
+
];
|
|
17
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -5874,9 +5874,6 @@ declare module "@arcgis/lumina" {
|
|
|
5874
5874
|
}`, c = i.devDependencies ?? {};
|
|
5875
5875
|
return [
|
|
5876
5876
|
il,
|
|
5877
|
-
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5878
|
-
i.name === "@arcgis/lumina" ? "" : `
|
|
5879
|
-
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5880
5877
|
t ? nl : "",
|
|
5881
5878
|
c.vitest ? `
|
|
5882
5879
|
/// <reference types="vitest/config" />
|
|
@@ -5896,7 +5893,8 @@ const il = `/**
|
|
|
5896
5893
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5897
5894
|
*
|
|
5898
5895
|
* If you need to provide additional typings, create a separate file.
|
|
5899
|
-
|
|
5896
|
+
*/
|
|
5897
|
+
/// <reference types="@arcgis/lumina/typings" />`, nl = `
|
|
5900
5898
|
/// <reference types="@arcgis/core/interfaces" />`, Je = "@arcgis/lumina:dependencySupport", is = (e, t) => e.viteCommand === "serve" && /**
|
|
5901
5899
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5902
5900
|
* However, it is a bit buggy (see
|
package/dist/testing/index.js
CHANGED
|
@@ -1,109 +1,111 @@
|
|
|
1
|
-
import { render as
|
|
2
|
-
import { unsafeStatic as m, html as
|
|
3
|
-
import { devOnly$getLitElementTagNameAndRuntime as
|
|
1
|
+
import { render as w } from "lit";
|
|
2
|
+
import { unsafeStatic as m, html as b } from "lit/static-html.js";
|
|
3
|
+
import { devOnly$getLitElementTagNameAndRuntime as O, LitElement as x } from "@arcgis/lumina";
|
|
4
4
|
import { camelToKebab as S } from "@arcgis/toolkit/string";
|
|
5
|
-
import { onTestFinished as _, beforeEach as R, afterEach as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { onTestFinished as _, beforeEach as R, afterEach as j, expect as D } from "vitest";
|
|
6
|
+
import v from "chalk";
|
|
7
|
+
import M from "js-beautify";
|
|
8
8
|
import { toFunction as z } from "@arcgis/lumina/controllers";
|
|
9
|
-
async function X(e, { parent: t = document.body, afterConnect:
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
let
|
|
9
|
+
async function X(e, { parent: t = document.body, afterConnect: n, dynamicComponents: f, cleanupAfterTest: r = !0 } = {}) {
|
|
10
|
+
const i = document.createElement("div");
|
|
11
|
+
i.style.display = "contents", t.append(i), r && _(() => F(i)), g(e);
|
|
12
|
+
const s = f?.some(g);
|
|
13
|
+
let o;
|
|
14
14
|
if (typeof e == "string")
|
|
15
|
-
|
|
15
|
+
o = b`<${m(e)}></${m(e)}>`;
|
|
16
16
|
else if (typeof e == "function")
|
|
17
|
-
if (
|
|
18
|
-
const a =
|
|
19
|
-
|
|
17
|
+
if (d(e)) {
|
|
18
|
+
const a = O(e).tagName;
|
|
19
|
+
o = b`<${m(a)}></${m(a)}>`;
|
|
20
20
|
} else
|
|
21
|
-
|
|
21
|
+
o = e();
|
|
22
22
|
else {
|
|
23
|
-
if (
|
|
23
|
+
if (s)
|
|
24
24
|
throw new Error(
|
|
25
25
|
'When rendering a dynamically created custom element using Lit\'s html`` function, you must ensure that the custom element class name is unique in the test file, or the class should explicitly have the `static tagName = "some-tag-name";` property with a unique tag name within the test file'
|
|
26
26
|
);
|
|
27
|
-
|
|
27
|
+
o = e;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
|
|
29
|
+
const c = [];
|
|
30
|
+
function u(a) {
|
|
31
|
+
c.push(a.error), a.preventDefault(), a.stopPropagation();
|
|
32
32
|
}
|
|
33
|
-
if (window.addEventListener("error",
|
|
34
|
-
throw
|
|
35
|
-
if (
|
|
36
|
-
throw new AggregateError(
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
typeof
|
|
41
|
-
const
|
|
33
|
+
if (window.addEventListener("error", u), w(o, i), window.removeEventListener("error", u), c.length === 1)
|
|
34
|
+
throw c[0];
|
|
35
|
+
if (c.length > 1)
|
|
36
|
+
throw new AggregateError(c, "Multiple errors occurred while creating the custom element");
|
|
37
|
+
const l = L(i), N = y, C = n?.(l);
|
|
38
|
+
C?.then !== void 0 && await C;
|
|
39
|
+
const h = l;
|
|
40
|
+
typeof h?.componentOnReady == "function" && await h.componentOnReady();
|
|
41
|
+
const p = h?.$component ?? N ?? l;
|
|
42
42
|
return {
|
|
43
|
-
el:
|
|
44
|
-
component:
|
|
43
|
+
el: l,
|
|
44
|
+
component: p,
|
|
45
45
|
async reRender() {
|
|
46
|
-
return typeof e == "function" && !
|
|
46
|
+
return typeof e == "function" && !d(e) && w(e(), t), p.requestUpdate(), await p.updateComplete;
|
|
47
47
|
},
|
|
48
|
-
container:
|
|
48
|
+
container: i
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
let
|
|
51
|
+
let y;
|
|
52
52
|
const A = globalThis;
|
|
53
53
|
A.devOnly$luminaComponentRefCallback = (e) => {
|
|
54
|
-
|
|
54
|
+
y = e;
|
|
55
55
|
};
|
|
56
56
|
function F(e) {
|
|
57
57
|
for (; e.firstChild; )
|
|
58
58
|
e.removeChild(e.firstChild);
|
|
59
59
|
e instanceof HTMLElement && e.remove();
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
if (!
|
|
61
|
+
function g(e) {
|
|
62
|
+
if (!d(e))
|
|
63
63
|
return !1;
|
|
64
|
-
const { runtime: t, tagName:
|
|
64
|
+
const { runtime: t, tagName: n = e.tagName } = O(e);
|
|
65
65
|
if (t !== void 0)
|
|
66
66
|
return !1;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
const r = Object.getPrototypeOf(e);
|
|
68
|
+
r !== x && d(r) && g(r);
|
|
69
|
+
let i = !1, s = n;
|
|
70
|
+
if (s === void 0) {
|
|
71
|
+
const o = S(
|
|
70
72
|
/*
|
|
71
73
|
* If name is a single letter, it was probably minified - thus is not
|
|
72
74
|
* stable, thus don't use it. Example: class produced by wrapController()
|
|
73
75
|
*/
|
|
74
|
-
(e.name.length > 1 ? e.name.replaceAll(
|
|
75
|
-
),
|
|
76
|
-
|
|
77
|
-
for (let
|
|
78
|
-
|
|
76
|
+
(e.name.length > 1 ? e.name.replaceAll(P, "") : "") || "Test"
|
|
77
|
+
), c = o === "test" ? "te-st" : o.includes("-") ? o : `${o}-`;
|
|
78
|
+
s = c;
|
|
79
|
+
for (let u = 2, l = customElements.get(s); l !== e && l !== void 0; u += 1)
|
|
80
|
+
i = !0, s = `${c}-${u}`, l = customElements.get(s);
|
|
79
81
|
}
|
|
80
|
-
return globalThis.devOnly$luminaRuntime?.customElement(
|
|
82
|
+
return globalThis.devOnly$luminaRuntime?.customElement(s, e), Object.defineProperty(e.prototype, "tagName", { value: s.toUpperCase() }), i;
|
|
81
83
|
}
|
|
82
|
-
const
|
|
84
|
+
const d = (e) => typeof e == "function" && "lumina" in e, P = /\d+$/gu;
|
|
83
85
|
function L(e) {
|
|
84
86
|
for (const t of e.children)
|
|
85
87
|
if ("lumina" in t.constructor)
|
|
86
88
|
return t;
|
|
87
89
|
for (const t of e.children) {
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
90
|
+
const n = L(t);
|
|
91
|
+
if (n != null)
|
|
92
|
+
return n;
|
|
91
93
|
}
|
|
92
|
-
return e.firstElementChild ??
|
|
94
|
+
return e.firstElementChild ?? y?.el;
|
|
93
95
|
}
|
|
94
|
-
function
|
|
96
|
+
function q() {
|
|
95
97
|
const e = $("warn"), t = $("error");
|
|
96
98
|
R(() => {
|
|
97
99
|
e.beforeEach(), t.beforeEach();
|
|
98
|
-
}),
|
|
100
|
+
}), j(() => {
|
|
99
101
|
e.afterEach(), t.afterEach();
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
104
|
function $(e) {
|
|
103
105
|
let t = !1;
|
|
104
|
-
const
|
|
106
|
+
const n = console[e];
|
|
105
107
|
function f(...r) {
|
|
106
|
-
|
|
108
|
+
n(...r), t = !0;
|
|
107
109
|
}
|
|
108
110
|
return {
|
|
109
111
|
beforeEach() {
|
|
@@ -111,23 +113,23 @@ function $(e) {
|
|
|
111
113
|
},
|
|
112
114
|
afterEach() {
|
|
113
115
|
if (t)
|
|
114
|
-
throw new Error(`[@arcgis/lumina:failOnConsole] Expected test not to call ${
|
|
116
|
+
throw new Error(`[@arcgis/lumina:failOnConsole] Expected test not to call ${v.bold(`console.${e}()`)}.
|
|
115
117
|
If the ${e} is expected, test for it explicitly by mocking it out using:
|
|
116
|
-
${
|
|
118
|
+
${v.bold(`vi.spyOn(console, '${e}').mockImplementation(() => {}) `)}
|
|
117
119
|
and test that the ${e} occurs.`);
|
|
118
|
-
console[e] =
|
|
120
|
+
console[e] = n;
|
|
119
121
|
}
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
+
function H() {
|
|
125
|
+
D.addSnapshotSerializer({
|
|
124
126
|
// Using duck typing to detect ShadowRoot. Not using instanceof to keep test fast
|
|
125
127
|
test(e) {
|
|
126
128
|
return typeof e == "object" && e !== null && "innerHTML" in e && "onslotchange" in e;
|
|
127
129
|
},
|
|
128
130
|
serialize(e) {
|
|
129
131
|
const t = e.innerHTML.replaceAll(U, "");
|
|
130
|
-
return
|
|
132
|
+
return M.html(t, {
|
|
131
133
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
132
134
|
indent_size: 2,
|
|
133
135
|
indent_char: " ",
|
|
@@ -142,11 +144,11 @@ function P() {
|
|
|
142
144
|
}
|
|
143
145
|
const U = /<!--\??(?:lit\$\d+\$)?-->/gu;
|
|
144
146
|
function Y() {
|
|
145
|
-
T
|
|
147
|
+
E[T] || (E[T] = !0, q(), H());
|
|
146
148
|
}
|
|
147
|
-
const
|
|
149
|
+
const T = Symbol.for("lumina:didSetupTest"), E = globalThis;
|
|
148
150
|
function Z(e, t) {
|
|
149
|
-
class
|
|
151
|
+
class n extends x {
|
|
150
152
|
constructor() {
|
|
151
153
|
super();
|
|
152
154
|
const r = "prototype" in e ? z(e) : e;
|
|
@@ -162,7 +164,7 @@ function Z(e, t) {
|
|
|
162
164
|
);
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
|
-
return
|
|
167
|
+
return n;
|
|
166
168
|
}
|
|
167
169
|
export {
|
|
168
170
|
X as mount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina-compiler",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.75",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcgis/api-extractor": "5.0.0-next.
|
|
22
|
-
"@arcgis/components-build-utils": "5.0.0-next.
|
|
23
|
-
"@arcgis/toolkit": "~5.0.0-next.
|
|
21
|
+
"@arcgis/api-extractor": "5.0.0-next.75",
|
|
22
|
+
"@arcgis/components-build-utils": "5.0.0-next.75",
|
|
23
|
+
"@arcgis/toolkit": "~5.0.0-next.75",
|
|
24
24
|
"chalk": "^5.4.1",
|
|
25
25
|
"esbuild": "^0.25.12",
|
|
26
26
|
"glob": "^11.0.3",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite-plugin-dts": "^4.5.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@arcgis/lumina": "~5.0.0-next.
|
|
33
|
+
"@arcgis/lumina": "~5.0.0-next.75",
|
|
34
34
|
"lit": "^3.3.0",
|
|
35
35
|
"typescript": "~5.9.3",
|
|
36
36
|
"vite": "^7.2.2",
|