@arcgis/lumina-compiler 4.33.0-next.98 → 4.34.0-next.0
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/context/index.d.ts +12 -5
- package/dist/context/logger.d.ts +8 -0
- package/dist/dependencies/discover.d.ts +2 -2
- package/dist/dependencies/loaders.d.ts +0 -4
- package/dist/dependencies/testSetupFiles.d.ts +0 -8
- package/dist/docs/stencilDocsJson.d.ts +5 -1
- package/dist/extractor/extractor.d.ts +3 -1
- package/dist/extractor/parseStoryFiles.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2950 -2565
- package/dist/jsxToLitHtml/config.d.ts +1 -1
- package/dist/jsxToLitHtml/imports.d.ts +0 -1
- package/dist/logger-KpGU2b3R.js +28 -0
- package/dist/plugins/buildCdn.d.ts +25 -41
- package/dist/plugins/configureVite.d.ts +2 -2
- package/dist/plugins/updatePackageJson.d.ts +1 -1
- package/dist/publicTypes.d.ts +61 -20
- package/dist/puppeteerTesting/index.js +106 -101
- package/dist/testing/index.js +84 -77
- package/dist/testing/mount.d.ts +7 -0
- package/dist/tests/utils.d.ts +1 -1
- package/package.json +13 -13
- package/dist/extractor/helpers/jsDoc.d.ts +0 -11
- package/dist/types/failOnJsonImport.d.ts +0 -2
package/dist/testing/index.js
CHANGED
|
@@ -1,98 +1,105 @@
|
|
|
1
|
-
import { render as
|
|
2
|
-
import { unsafeStatic as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { toFunction as
|
|
9
|
-
async function
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
let
|
|
1
|
+
import { render as C } from "lit-html";
|
|
2
|
+
import { unsafeStatic as m, html as w } from "lit-html/static.js";
|
|
3
|
+
import { devOnly$getLitElementTagNameAndRuntime as $, LitElement as S } from "@arcgis/lumina";
|
|
4
|
+
import { camelToKebab as _ } from "@arcgis/components-utils";
|
|
5
|
+
import { onTestFinished as x, expect as E } from "vitest";
|
|
6
|
+
import O from "vitest-fail-on-console";
|
|
7
|
+
import R from "js-beautify";
|
|
8
|
+
import { toFunction as D } from "@arcgis/lumina/controllers";
|
|
9
|
+
async function G(e, { parent: t = document.body, afterConnect: o, dynamicComponents: f, cleanupAfterTest: s = !0 } = {}) {
|
|
10
|
+
const n = document.createElement("div");
|
|
11
|
+
n.style.display = "contents", t.append(n), s && x(() => j(n)), v(e);
|
|
12
|
+
const l = f?.some(v);
|
|
13
|
+
let r;
|
|
14
14
|
if (typeof e == "string")
|
|
15
|
-
|
|
15
|
+
r = w`<${m(e)}></${m(e)}>`;
|
|
16
16
|
else if (typeof e == "function")
|
|
17
|
-
|
|
17
|
+
if (p(e)) {
|
|
18
|
+
const c = $(e).tagName;
|
|
19
|
+
r = w`<${m(c)}></${m(c)}>`;
|
|
20
|
+
} else
|
|
21
|
+
r = e();
|
|
18
22
|
else {
|
|
19
|
-
if (
|
|
23
|
+
if (l)
|
|
20
24
|
throw new Error(
|
|
21
|
-
'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
|
|
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'
|
|
22
26
|
);
|
|
23
|
-
|
|
27
|
+
r = e;
|
|
24
28
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
|
|
29
|
+
const i = [];
|
|
30
|
+
function a(c) {
|
|
31
|
+
i.push(c.error), c.preventDefault(), c.stopPropagation();
|
|
28
32
|
}
|
|
29
|
-
if (window.addEventListener("error",
|
|
30
|
-
throw
|
|
31
|
-
if (
|
|
32
|
-
throw new AggregateError(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
typeof
|
|
37
|
-
const
|
|
33
|
+
if (window.addEventListener("error", a), C(r, n), window.removeEventListener("error", a), i.length === 1)
|
|
34
|
+
throw i[0];
|
|
35
|
+
if (i.length > 1)
|
|
36
|
+
throw new AggregateError(i, "Multiple errors occurred while creating the custom element");
|
|
37
|
+
const u = L(n), N = g, y = o?.(u);
|
|
38
|
+
y?.then !== void 0 && await y;
|
|
39
|
+
const d = u;
|
|
40
|
+
typeof d?.componentOnReady == "function" && await d.componentOnReady();
|
|
41
|
+
const h = d?.$component ?? N ?? u;
|
|
38
42
|
return {
|
|
39
|
-
el:
|
|
40
|
-
component:
|
|
43
|
+
el: u,
|
|
44
|
+
component: h,
|
|
41
45
|
async reRender() {
|
|
42
|
-
return typeof e == "function" && !(
|
|
43
|
-
}
|
|
46
|
+
return typeof e == "function" && !p(e) && C(e(), t), h.requestUpdate(), await h.updateComplete;
|
|
47
|
+
},
|
|
48
|
+
container: n
|
|
44
49
|
};
|
|
45
50
|
}
|
|
46
|
-
let
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
let g;
|
|
52
|
+
const M = globalThis;
|
|
53
|
+
M.devOnly$luminaComponentRefCallback = (e) => {
|
|
54
|
+
g = e;
|
|
50
55
|
};
|
|
51
|
-
function
|
|
56
|
+
function j(e) {
|
|
52
57
|
for (; e.firstChild; )
|
|
53
58
|
e.removeChild(e.firstChild);
|
|
54
59
|
e instanceof HTMLElement && e.remove();
|
|
55
60
|
}
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
61
|
+
function v(e) {
|
|
62
|
+
if (!p(e))
|
|
63
|
+
return !1;
|
|
64
|
+
const { runtime: t, tagName: o = e.tagName } = $(e);
|
|
65
|
+
if (t !== void 0)
|
|
58
66
|
return !1;
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
const r = N(
|
|
67
|
+
let s = !1, n = o;
|
|
68
|
+
if (n === void 0) {
|
|
69
|
+
const l = _(
|
|
63
70
|
/*
|
|
64
71
|
* If name is a single letter, it was probably minified - thus is not
|
|
65
72
|
* stable, thus don't use it. Example: class produced by wrapController()
|
|
66
73
|
*/
|
|
67
74
|
(e.name.length > 1 ? e.name.replaceAll(z, "") : "") || "Test"
|
|
68
|
-
),
|
|
69
|
-
n =
|
|
70
|
-
for (let
|
|
71
|
-
|
|
75
|
+
), r = l === "test" ? "te-st" : l.includes("-") ? l : `${l}-`;
|
|
76
|
+
n = r;
|
|
77
|
+
for (let i = 2, a = customElements.get(n); a !== e && a !== void 0; i += 1)
|
|
78
|
+
s = !0, n = `${r}-${i}`, a = customElements.get(n);
|
|
72
79
|
}
|
|
73
|
-
return globalThis.devOnly$luminaRuntime?.customElement(n, e), Object.defineProperty(e.prototype, "tagName", { value: n.toUpperCase() }),
|
|
80
|
+
return globalThis.devOnly$luminaRuntime?.customElement(n, e), Object.defineProperty(e.prototype, "tagName", { value: n.toUpperCase() }), s;
|
|
74
81
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
82
|
+
const p = (e) => typeof e == "function" && "lumina" in e, z = /\d+$/gu;
|
|
83
|
+
function L(e) {
|
|
77
84
|
for (const t of e.children)
|
|
78
85
|
if ("lumina" in t.constructor)
|
|
79
86
|
return t;
|
|
80
87
|
for (const t of e.children) {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
88
|
+
const o = L(t);
|
|
89
|
+
if (o != null)
|
|
90
|
+
return o;
|
|
84
91
|
}
|
|
85
|
-
return e.firstElementChild ??
|
|
92
|
+
return e.firstElementChild ?? g?.el;
|
|
86
93
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
94
|
+
function A() {
|
|
95
|
+
E.addSnapshotSerializer({
|
|
89
96
|
// Using duck typing to detect ShadowRoot. Not using instanceof to keep test fast
|
|
90
97
|
test(e) {
|
|
91
98
|
return typeof e == "object" && e !== null && "innerHTML" in e && "onslotchange" in e;
|
|
92
99
|
},
|
|
93
100
|
serialize(e) {
|
|
94
|
-
const t = e.innerHTML.replaceAll(
|
|
95
|
-
return
|
|
101
|
+
const t = e.innerHTML.replaceAll(F, "");
|
|
102
|
+
return R.html(t, {
|
|
96
103
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
97
104
|
indent_size: 2,
|
|
98
105
|
indent_char: " ",
|
|
@@ -105,26 +112,26 @@ function F() {
|
|
|
105
112
|
}
|
|
106
113
|
});
|
|
107
114
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
110
|
-
if (T
|
|
115
|
+
const F = /<!--\??(?:lit\$\d+\$)?-->/gu;
|
|
116
|
+
function I() {
|
|
117
|
+
if (b[T])
|
|
111
118
|
return;
|
|
112
|
-
T
|
|
119
|
+
b[T] = !0;
|
|
113
120
|
const e = { ...console };
|
|
114
|
-
|
|
121
|
+
O({
|
|
115
122
|
// Workaround for https://github.com/thomasbrodusch/vitest-fail-on-console/issues/61
|
|
116
|
-
silenceMessage(t,
|
|
117
|
-
return e[
|
|
123
|
+
silenceMessage(t, o) {
|
|
124
|
+
return e[o](t), !1;
|
|
118
125
|
}
|
|
119
|
-
}),
|
|
126
|
+
}), A();
|
|
120
127
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
123
|
-
class
|
|
128
|
+
const T = Symbol.for("lumina:didSetupTest"), b = globalThis;
|
|
129
|
+
function J(e, t) {
|
|
130
|
+
class o extends S {
|
|
124
131
|
constructor() {
|
|
125
132
|
super();
|
|
126
|
-
const
|
|
127
|
-
this.controller =
|
|
133
|
+
const s = "prototype" in e ? D(e) : e;
|
|
134
|
+
this.controller = s(this), Promise.resolve(t?.(this)).catch(console.error);
|
|
128
135
|
}
|
|
129
136
|
/*
|
|
130
137
|
* Emitting controller's exports here is useful to let controller tests
|
|
@@ -136,10 +143,10 @@ function I(e, t) {
|
|
|
136
143
|
);
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
|
-
return
|
|
146
|
+
return o;
|
|
140
147
|
}
|
|
141
148
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
G as mount,
|
|
150
|
+
I as setupLuminaTest,
|
|
151
|
+
J as wrapController
|
|
145
152
|
};
|
package/dist/testing/mount.d.ts
CHANGED
|
@@ -19,6 +19,13 @@ export type RenderResult<Component extends HTMLElement> = {
|
|
|
19
19
|
* All public and private members of your custom element are available here.
|
|
20
20
|
*/
|
|
21
21
|
readonly component: Component;
|
|
22
|
+
/**
|
|
23
|
+
* The container element that was used to render the component.
|
|
24
|
+
*
|
|
25
|
+
* This element is useful to inspect for functional components and components
|
|
26
|
+
* that do not use shadow DOM.
|
|
27
|
+
*/
|
|
28
|
+
readonly container: HTMLElement;
|
|
22
29
|
/**
|
|
23
30
|
* A callback for triggering component re-render. Optionally, if the first
|
|
24
31
|
* argument to `mount()` was a function, that function will be called
|
package/dist/tests/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ContextDirectories } from '../context/types';
|
|
2
2
|
import { CompilerContext } from '../context';
|
|
3
3
|
export declare const testDir: ContextDirectories;
|
|
4
|
-
export declare const testContext: Pick<CompilerContext, "_documentationFileNames" | "dir">;
|
|
4
|
+
export declare const testContext: Pick<CompilerContext, "_documentationFileNames" | "dir" | "options">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina-compiler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.34.0-next.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcgis/api-extractor": "4.
|
|
22
|
-
"@arcgis/components-build-utils": "4.
|
|
23
|
-
"@arcgis/components-utils": "4.
|
|
21
|
+
"@arcgis/api-extractor": "4.34.0-next.0",
|
|
22
|
+
"@arcgis/components-build-utils": "4.34.0-next.0",
|
|
23
|
+
"@arcgis/components-utils": "4.34.0-next.0",
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
|
-
"esbuild": "^0.
|
|
25
|
+
"esbuild": "^0.25.4",
|
|
26
26
|
"glob": "^11.0.0",
|
|
27
27
|
"js-beautify": "^1.15.1",
|
|
28
28
|
"mime-types": "^2.1.35",
|
|
29
|
-
"rollup": "^4.
|
|
30
|
-
"rollup-plugin-node-externals": "^
|
|
29
|
+
"rollup": "^4.40.2",
|
|
30
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
31
31
|
"sass-embedded": "^1.79.3",
|
|
32
|
-
"tslib": "^2.
|
|
33
|
-
"typescript": "~5.
|
|
34
|
-
"vite": "^
|
|
35
|
-
"vite-plugin-dts": "^4.3
|
|
36
|
-
"vitest": "^
|
|
32
|
+
"tslib": "^2.8.1",
|
|
33
|
+
"typescript": "~5.8.3",
|
|
34
|
+
"vite": "^6.3.4",
|
|
35
|
+
"vite-plugin-dts": "^4.5.3",
|
|
36
|
+
"vitest": "^3.1.3",
|
|
37
37
|
"vitest-fail-on-console": "^0.7.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@arcgis/lumina": "~4.
|
|
40
|
+
"@arcgis/lumina": "~4.34.0-next.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as ts } from 'typescript';
|
|
2
|
-
import { ApiCustomElementDeclaration, ApiCustomElementField, ApiDocsTag } from '@arcgis/api-extractor';
|
|
3
|
-
export declare function symbolToDocs(checker: ts.TypeChecker, symbol: ts.Signature | ts.Symbol): {
|
|
4
|
-
description: ApiCustomElementField["description"];
|
|
5
|
-
docsTags: ApiDocsTag[];
|
|
6
|
-
};
|
|
7
|
-
export declare const internalJsDocTag = "internal";
|
|
8
|
-
export declare const findDecorator: ({ modifiers }: {
|
|
9
|
-
modifiers?: readonly ts.ModifierLike[];
|
|
10
|
-
}, name: string) => ts.CallExpression | undefined;
|
|
11
|
-
export declare function setJsDocFields(node: ts.PropertyName, checker: ts.TypeChecker, api: Partial<Pick<ApiCustomElementField, "default" | "deprecated" | "description" | "docsTags" | "privacy" | "readonly" | "summary"> & Pick<ApiCustomElementDeclaration, "cssParts" | "cssProperties" | "cssStates" | "slots">>, docs?: ReturnType<typeof symbolToDocs>): void;
|