@arcgis/lumina-compiler 4.33.0-next.8 → 4.33.0-next.80
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 +13 -20
- package/dist/context/typeScript.d.ts +2 -2
- package/dist/context/utils.d.ts +1 -1
- package/dist/dependencies/arcgisCore.d.ts +1 -1
- package/dist/dependencies/discover.d.ts +3 -3
- package/dist/dependencies/index.d.ts +2 -2
- package/dist/dependencies/loaders.d.ts +3 -3
- package/dist/dependencies/lumina.d.ts +2 -0
- package/dist/dependencies/stencil.d.ts +1 -1
- package/dist/dependencies/testSetupFiles.d.ts +1 -1
- package/dist/dependencies/updateLumina.d.ts +4 -4
- package/dist/dependencies/utils.d.ts +1 -1
- package/dist/docs/config.d.ts +1 -1
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/stencilDocsJson.d.ts +3 -3
- package/dist/docs/vsCodeCustomData/index.d.ts +2 -2
- package/dist/docs/vsCodeCustomData/utils.d.ts +2 -2
- package/dist/docs/webTypes/description.d.ts +1 -1
- package/dist/docs/webTypes/index.d.ts +2 -2
- package/dist/docs/webTypes/utils.d.ts +2 -2
- package/dist/entrypoints/addNonLazyImports.d.ts +2 -2
- package/dist/entrypoints/config.d.ts +1 -0
- package/dist/entrypoints/dtsUtils.d.ts +3 -3
- package/dist/entrypoints/findUtils.d.ts +1 -1
- package/dist/entrypoints/handleComponentImports.d.ts +2 -2
- package/dist/entrypoints/pathMapping.d.ts +1 -1
- package/dist/entrypoints/resolveTagName.d.ts +3 -3
- package/dist/extractor/apiJsonUtils.d.ts +2 -2
- package/dist/extractor/declaration.d.ts +1 -38
- package/dist/extractor/extractor.d.ts +5 -6
- package/dist/extractor/helpers/cssDoc.d.ts +1 -1
- package/dist/extractor/helpers/event.d.ts +3 -3
- package/dist/extractor/helpers/jsDoc.d.ts +2 -2
- package/dist/extractor/helpers/method.d.ts +3 -3
- package/dist/extractor/helpers/property.d.ts +3 -3
- package/dist/extractor/helpers/resolveType.d.ts +3 -3
- package/dist/extractor/helpers/typeValue.d.ts +2 -2
- package/dist/extractor/index.d.ts +3 -3
- package/dist/frameworkTypes/index.d.ts +2 -2
- package/dist/frameworkTypes/lumina.d.ts +1 -1
- package/dist/frameworkTypes/preact.d.ts +1 -1
- package/dist/frameworkTypes/react.d.ts +1 -1
- package/dist/frameworkTypes/stencil.d.ts +1 -1
- package/dist/frameworkTypes/utils.d.ts +2 -2
- package/dist/frameworkTypes/vanilla.d.ts +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +6443 -106
- package/dist/jsxToLitHtml/autoAddNothing.d.ts +2 -2
- package/dist/jsxToLitHtml/comments.d.ts +4 -4
- package/dist/jsxToLitHtml/convertProps.d.ts +5 -6
- package/dist/jsxToLitHtml/imports.d.ts +2 -2
- package/dist/jsxToLitHtml/index.d.ts +1 -1
- package/dist/jsxToLitHtml/inferPropType.d.ts +3 -3
- package/dist/jsxToLitHtml/insertRepeatCall.d.ts +2 -2
- package/dist/jsxToLitHtml/jsxVisitor.d.ts +3 -4
- package/dist/jsxToLitHtml/templateParts.d.ts +2 -2
- package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +1 -1
- package/dist/jsxToLitHtml/types.d.ts +6 -4
- package/dist/jsxToLitHtml/utils.d.ts +1 -0
- package/dist/loader/hideUntilHydrated.d.ts +1 -1
- package/dist/loader/index.d.ts +2 -2
- package/dist/loader/lazy.d.ts +3 -3
- package/dist/loader/storybookApiJson.d.ts +1 -1
- package/dist/plugins/buildCdn.d.ts +72 -6
- package/dist/plugins/buildStencilHydrate.d.ts +2 -2
- package/dist/plugins/buildWrappers.d.ts +2 -2
- package/dist/plugins/configureVite.d.ts +4 -4
- package/dist/plugins/externalizeDependencies.d.ts +2 -6
- package/dist/plugins/handleDynamicAssets.d.ts +2 -2
- package/dist/plugins/handleStaticAssets.d.ts +2 -2
- package/dist/plugins/loadLitCss.d.ts +2 -6
- package/dist/plugins/printTotalBuildSize.d.ts +2 -2
- package/dist/plugins/provideAssets.d.ts +3 -20
- package/dist/plugins/setAssetsPath.d.ts +2 -2
- package/dist/plugins/updatePackageJson.d.ts +3 -3
- package/dist/publicTypes.d.ts +13 -13
- package/dist/puppeteerTesting/globalSetup.d.ts +2 -2
- package/dist/puppeteerTesting/globalSetup.js +105 -2
- package/dist/puppeteerTesting/index.d.ts +7 -8
- package/dist/puppeteerTesting/index.js +1129 -5
- package/dist/puppeteerTesting/injected.d.ts +1 -1
- package/dist/puppeteerTesting/puppeteer/browser.d.ts +1 -1
- package/dist/puppeteerTesting/puppeteer/element.d.ts +3 -3
- package/dist/puppeteerTesting/puppeteer/events.d.ts +2 -2
- package/dist/puppeteerTesting/puppeteer/page.d.ts +1 -1
- package/dist/puppeteerTesting/puppeteer/types.d.ts +3 -3
- package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +1 -1
- package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +1 -1
- package/dist/puppeteerTesting/vitest/matchers/events.d.ts +1 -1
- package/dist/puppeteerTesting/vitest/matchers/index.d.ts +13 -13
- package/dist/puppeteerTesting/vitest/matchers/text.d.ts +1 -1
- package/dist/puppeteerTesting/vitest/runner.d.ts +3 -3
- package/dist/puppeteerTesting/vitest/runner.js +50 -1
- package/dist/puppeteerTesting/vitest/types.d.ts +1 -1
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +181 -24
- package/dist/testing/mount.d.ts +2 -2
- package/dist/testing/wrapController.d.ts +2 -2
- package/dist/tests/utils.d.ts +2 -2
- package/dist/transformers/index.d.ts +3 -3
- package/dist/transformers/injectRuntimeOptions.d.ts +2 -2
- package/dist/transformers/internalTypeScriptApis.d.ts +2 -2
- package/dist/transformers/liftDecorators.d.ts +1 -1
- package/dist/transformers/members.d.ts +2 -2
- package/dist/transformers/property.d.ts +4 -4
- package/dist/transformers/propertyOptions.d.ts +5 -5
- package/dist/transformers/utils.d.ts +3 -3
- package/dist/types/astTransformers.d.ts +2 -2
- package/dist/types/failOnJsonImport.d.ts +1 -1
- package/dist/types/hideInternalLitElement.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/liftSetterTypes.d.ts +2 -3
- package/dist/types/textTransformers.d.ts +2 -2
- package/dist/types/transformComponentMembers.d.ts +1 -1
- package/dist/types-C3YmWTVv.js +13 -0
- package/dist/useLumina.d.ts +1 -1
- package/package.json +5 -5
- package/dist/chunk-6XNX5V4L.js +0 -1
- package/dist/chunk-JFKSI6I7.js +0 -1
- package/dist/context/typeScript.spec.d.ts +0 -1
- package/dist/context/utils.spec.d.ts +0 -1
- package/dist/defaultAssetsUrl.spec.d.ts +0 -1
- package/dist/dependencies/lit.d.ts +0 -2
- package/dist/dependencies/updateLumina.spec.d.ts +0 -1
- package/dist/docs/steniclDocsJson.test.d.ts +0 -1
- package/dist/entrypoints/dtsUtils.spec.d.ts +0 -1
- package/dist/entrypoints/findUtils.spec.d.ts +0 -1
- package/dist/entrypoints/resolveTagName.spec.d.ts +0 -1
- package/dist/extractor/declaration.spec.d.ts +0 -1
- package/dist/extractor/helpers/cssDoc.spec.d.ts +0 -1
- package/dist/extractor/helpers/resolveType.spec.d.ts +0 -1
- package/dist/extractor/helpers/typeValue.spec.d.ts +0 -1
- package/dist/jsxToLitHtml/utils.spec.d.ts +0 -1
- package/dist/loader/lazy.spec.d.ts +0 -1
- package/dist/plugins/buildCdn.spec.d.ts +0 -1
- package/dist/plugins/externalizeDependencies.spec.d.ts +0 -1
- package/dist/plugins/provideAssets.spec.d.ts +0 -1
- package/dist/plugins/updatePackageJson.spec.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EventSpy } from
|
|
3
|
-
import
|
|
1
|
+
import { ClickOptions, ElementHandle, KeyInput } from 'puppeteer';
|
|
2
|
+
import { EventSpy } from './events';
|
|
3
|
+
import { E2EPage, FindSelector, SerializedEvent } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* This file is part of the puppeteerTesting bundle. That bundle may be
|
|
6
6
|
* imported even before happy-dom is setup.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ElementHandle, JSHandle } from 'puppeteer';
|
|
2
|
+
import { E2EPage, SerializedEvent } from './types';
|
|
3
3
|
export declare function initPageEvents(page: E2EPage): Promise<void>;
|
|
4
4
|
export declare function pageSpyOnEvent(page: E2EPage, eventName: string, selector?: "document" | "window"): Promise<EventSpy>;
|
|
5
5
|
export declare function waitForEvent<Detail = unknown>(page: E2EPage, eventName: string, elementHandle: ElementHandle): Promise<SerializedEvent<Detail>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { HTTPResponse, Page, WaitForOptions } from 'puppeteer';
|
|
2
|
+
import { EventSpy } from './events';
|
|
3
|
+
import { E2EElement } from './element';
|
|
4
4
|
export interface PageDiagnostic {
|
|
5
5
|
type: "error" | "pageerror" | "requestfailed";
|
|
6
6
|
message?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RawMatcherFn, SyncExpectationResult } from '@vitest/expect';
|
|
2
2
|
export declare const toHaveClass: RawMatcherFn;
|
|
3
3
|
export declare const toHaveClasses: (element: unknown, expectClassNames: string[]) => SyncExpectationResult;
|
|
4
4
|
export declare const toMatchClasses: RawMatcherFn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RawMatcherFn } from '@vitest/expect';
|
|
2
2
|
export declare const toHaveReceivedEvent: RawMatcherFn;
|
|
3
3
|
export declare const toHaveReceivedEventTimes: RawMatcherFn;
|
|
4
4
|
export declare const toHaveReceivedEventDetail: RawMatcherFn;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare const expectExtend: {
|
|
2
|
-
toEqualAttribute: import(
|
|
3
|
-
toEqualAttributes: import(
|
|
4
|
-
toEqualText: import(
|
|
5
|
-
toHaveAttribute: import(
|
|
6
|
-
toHaveClass: import(
|
|
7
|
-
toHaveClasses: (element: unknown, expectClassNames: string[]) => import(
|
|
8
|
-
toMatchClasses: import(
|
|
9
|
-
toHaveReceivedEvent: import(
|
|
10
|
-
toHaveReceivedEventTimes: import(
|
|
11
|
-
toHaveReceivedEventDetail: import(
|
|
12
|
-
toHaveFirstReceivedEventDetail: import(
|
|
13
|
-
toHaveLastReceivedEventDetail: import(
|
|
14
|
-
toHaveNthReceivedEventDetail: import(
|
|
2
|
+
toEqualAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
3
|
+
toEqualAttributes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
4
|
+
toEqualText: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
5
|
+
toHaveAttribute: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
6
|
+
toHaveClass: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
7
|
+
toHaveClasses: (element: unknown, expectClassNames: string[]) => import('@vitest/expect').SyncExpectationResult;
|
|
8
|
+
toMatchClasses: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
9
|
+
toHaveReceivedEvent: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
10
|
+
toHaveReceivedEventTimes: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
11
|
+
toHaveReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
12
|
+
toHaveFirstReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
13
|
+
toHaveLastReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
14
|
+
toHaveNthReceivedEventDetail: import('@vitest/expect').RawMatcherFn<import('@vitest/expect').MatcherState>;
|
|
15
15
|
};
|
|
16
16
|
export interface PuppeteerMatchers<R = unknown> {
|
|
17
17
|
toEqualAttribute: (expectedAttribute: string, expectedValue: unknown) => R;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RawMatcherFn } from '@vitest/expect';
|
|
2
2
|
export declare const toEqualText: RawMatcherFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VitestTestRunner } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { VitestTestRunner } from 'vitest/runners';
|
|
2
|
+
import { Page } from 'puppeteer';
|
|
3
|
+
import { Suite } from '@vitest/runner';
|
|
4
4
|
/**
|
|
5
5
|
* This has to be default export for Vitest to discover it
|
|
6
6
|
*
|
|
@@ -1 +1,50 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { VitestTestRunner as n } from "vitest/runners";
|
|
2
|
+
import { i as t, p as a } from "../../types-C3YmWTVv.js";
|
|
3
|
+
import { connect as c } from "puppeteer";
|
|
4
|
+
async function w() {
|
|
5
|
+
return await c(t.puppeteerConnectOptions);
|
|
6
|
+
}
|
|
7
|
+
class f extends n {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this._browser = void 0, this._pages = [], this._pageCloseExpected = !1, this._browserClosePromise = void 0, a.runner = this;
|
|
10
|
+
const s = 5e3;
|
|
11
|
+
if ((this.config.testTimeout ?? s) === s) {
|
|
12
|
+
const i = this.config.inspector.enabled === !0 || t.isDevToolsEnabled ? 36e5 : 3e4;
|
|
13
|
+
this.config.testTimeout = i;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async createNewPage() {
|
|
17
|
+
if (this._browserClosePromise !== void 0)
|
|
18
|
+
throw new Error(
|
|
19
|
+
'newE2EPage was called after teardown has begun. Check if you forgot an "await" somewhere in your test'
|
|
20
|
+
);
|
|
21
|
+
if (this._pageCloseExpected)
|
|
22
|
+
throw new Error(
|
|
23
|
+
'newE2EPage was called while other pages where being closed. This means you either run two newE2EPage at the same time, or your called newE2EPage after teardown has begun. Check if you forgot an "await" somewhere in your test'
|
|
24
|
+
);
|
|
25
|
+
if (this._browser ??= await this._connectBrowser(), this._pages.length > 0 && await this._closeOpenPages(), !this._browser.connected)
|
|
26
|
+
throw new Error("Trying to create a new E2E page on a disconnected browser.");
|
|
27
|
+
const e = await this._browser.newPage();
|
|
28
|
+
return e.once("close", () => {
|
|
29
|
+
if (!this._pageCloseExpected)
|
|
30
|
+
throw new Error("Page was closed unexpectedly");
|
|
31
|
+
}), this._pages.push(e), e;
|
|
32
|
+
}
|
|
33
|
+
async _connectBrowser() {
|
|
34
|
+
const e = await w();
|
|
35
|
+
return e.once("disconnected", () => {
|
|
36
|
+
if (this._browser = void 0, this._browserClosePromise === void 0)
|
|
37
|
+
throw new Error("Browser was disconnected unexpectedly");
|
|
38
|
+
}), e;
|
|
39
|
+
}
|
|
40
|
+
async _closeOpenPages() {
|
|
41
|
+
this._pageCloseExpected = !0, await Promise.all(this._pages.filter((e) => !e.isClosed()).map(async (e) => await e.close())), this._pages.length = 0, this._pageCloseExpected = !1;
|
|
42
|
+
}
|
|
43
|
+
async onAfterRunSuite(e) {
|
|
44
|
+
const s = super.onAfterRunSuite(e);
|
|
45
|
+
e.file === e ? (this._browserClosePromise = this._closeOpenPages().then(async () => await this._browser?.disconnect()), await Promise.all([s, this._browserClosePromise]), this._browserClosePromise = void 0) : await s;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
f as default
|
|
50
|
+
};
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Thus, make sure to not import anything from the rest of the lumina-compiler
|
|
6
6
|
* in this bundle.
|
|
7
7
|
*/
|
|
8
|
-
export type { RenderOptions, RenderResult } from
|
|
9
|
-
export { mount } from
|
|
10
|
-
export { setupLuminaTest } from
|
|
11
|
-
export { wrapController } from
|
|
8
|
+
export type { RenderOptions, RenderResult } from './mount';
|
|
9
|
+
export { mount } from './mount';
|
|
10
|
+
export { setupLuminaTest } from './setupFile';
|
|
11
|
+
export { wrapController } from './wrapController';
|
package/dist/testing/index.js
CHANGED
|
@@ -1,24 +1,181 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`,"makeController(async (component, controller)=>{ await controller.use(someOtherController); });"].join(""):void 0;function Fe(e){if(process.env.NODE_ENV!=="production"&&P()){if("addController"in e)return e;throw new Error("Component does not implement ControllerHost. This might be because you forgot to add 'manager: Controller<this> = useControllerManager(this);' in your component, or you tried to use some controller before that line")}else return e}function fe(e,t,n){let o=Object.keys(e),s=o.length;C===void 0&&queueMicrotask(B),C??(C=new Map);let r=C.get(e);return r===void 0&&(r={callbacks:[],keyCount:s},C.set(e,r)),r.keyCount!==s&&(r.callbacks.forEach(a=>a(o)),r.callbacks=[],r.keyCount=s),r.callbacks.push(a=>{let i=d=>qe(t,null,d),l=a[s];l===void 0?i(void 0):e[l]===n?i(l):i(void 0)}),n}var C=void 0;function B(){Array.from(C?.entries()??[]).forEach(([e,{callbacks:t}])=>{let n=Object.keys(e);t.forEach(o=>o(n))}),C=void 0}function K(e,t,n){var o;let s=t;if(process.env.NODE_ENV!=="production"&&Je()&&W(e,s)===void 0)throw new Error(e.manager.isLit?`Trying to watch a non-@property, non-@state property "${s}". Either convert it into a @state() to be able to use watch() on it, or use the get/set syntax`:`Trying to watch a non-@Prop, non-@State property "${s}". Convert it into a @State() or @Prop property if you need to use watch() on it`);let r=e.manager.internals;(o=r.allWatchers)[s]??(o[s]=[]);let a=r.allWatchers[s],i=n,l=(d,c,p)=>Be(i,null,d,c,p);return a.push(l),()=>{let d=a.indexOf(l);d!==-1&&a.splice(d,1)}}var ye=class{constructor(e){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;let t=this.component.manager.internals;Object.entries(t.members).forEach(([n,[o]])=>{var s;o&2048&&((s=t.setters)[n]??(s[n]=[]),t.setters[n].push(t.readonlySetter))})},this.trackedValue=G,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this._exports=new WeakMap,this.readonlySetter=(t,n,o)=>{if(T.readOnly)return t;throw new Error(`Cannot assign to read-only property "${o}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},process.env.NODE_ENV!=="production"?Object.defineProperty(this,"component",{writable:!1,enumerable:!1,configurable:!0,value:e}):this.component=e}firePropTrackers(e,t){let n=this.keyTrackers;this.trackedValue=G,this.keyTrackers=[],n.forEach(o=>o(e,t))}getSetProxy(e){let t=this.component,n=t.constructor.prototype;if(this._getSetProxy(n,e,"class"),t.manager.isLit)return;let o=t.el.constructor.prototype;n!==o&&this._getSetProxy(o,e,"html")}_getSetProxy(e,t,n){let o=this.component,s=W(o,t),r;do r=Object.getOwnPropertyDescriptor(e,t);while(!r&&(e=Object.getPrototypeOf(e)));if(process.env.NODE_ENV!=="production"&&ze()){let g=n==="html";if(r?.set===void 0||r.get===void 0){if(r!==void 0&&"value"in r)throw new Error(`getSet() should only be used on @Prop/@property/@State/@state properties. For internal component properties, use regular get/set syntax. Tried to use it on "${t}" in ${o.el.tagName}`);if(g)return;throw new Error(`Unable to find "${t}" property on the ${o.el.tagName} component`)}if(s===void 0)throw new Error("Unable to retrieve prop type")}else if(!r)return;let a=r.get,i=r.set,l=S in a,d=S in i;if(l&&d)return;let c=!l,p=!d,k=c?function(){let h=a.call(this),f=N.get(this);if(T.getter||f===void 0)return h;let w=f.manager.internals;h=w.accessorGetter[t](h,t);let m=w.getters[t]??H;for(let y=0;y<m.length;y++)h=m[y](h,t);return h}:a,_=p?function(h){let f=a.call(this),w=N.get(this);if(w===void 0){i.call(this,h);return}let m=w.manager.isLit?h??void 0:se(h,s),y=w.manager.internals;if(m===f)i.call(this,m);else{let Y=T.setter?H:y.setters[t]??H;for(let O=0;O<Y.length&&(m=Y[O](m,f,t),m!==f);O++);m=y.accessorSetter[t](m,f,t),i.call(this,m),m!==f&&y.enabledWatchers[t]?.forEach(O=>O(m,f,t))}y.keyTrackers.length>0&&y?.firePropTrackers(t,h)}:i;c&&(k[S]=!0),p&&(_[S]=!0),Object.defineProperty(e,t,{...r,get:k,set:_})}markExports(e,t){(typeof t=="object"&&t!==null||typeof t=="function")&&this._exports.set(t,e)}resolveExports(e){if(typeof e=="object"&&e!==null||typeof e=="function")return this._exports.get(e)}},H=[],S=Symbol(),G=process.env.NODE_ENV!=="production"?Symbol.for(`${F}: nothing`):Symbol();function ge(e,t,n){let o=e.manager.internals;return o.trackedValue!==G&&o.trackedValue!==n&&o.firePropTrackers(void 0,void 0),o.keyTrackers.length===0&&queueMicrotask(()=>o.firePropTrackers(void 0,void 0)),o.trackedValue=n,o.keyTrackers.push((s,r)=>Ke(t,void 0,n===r?s:void 0)),n}function ve(e=[M(),...I()],t,n){let o=Array.isArray(e)?e:[e],s=o.length+1,r=i=>{s-=1,i!==void 0&&(s=Math.min(s,0)),s===0&&t(i)};o.forEach(i=>fe(i,l=>r(l===void 0?void 0:{key:l,host:i,isReactive:!1}),n));let a=o.find(i=>"manager"in i&&typeof i.manager=="object"&&i.manager.component===i);return a&&ge(a,i=>r(i===void 0?void 0:{key:i,host:a,isReactive:!0}),n),n}function Ce(e){T.readOnly=!0;try{return e()}finally{T.readOnly=!1}}var Ee=e=>(...t)=>{let n=I(),o=new e(...t),s=o.exports;j(n.at(-1));let r=o.component.manager.internals;r.markExports(o,s),o.watchExports(i=>r.markExports(o,i)),Ie(o);let a=[o.component,...n].reverse();return ve(a,i=>i===void 0?void 0:Ye(o,i,s),s)};function Ye(e,{host:t,key:n,isReactive:o},s){let r=t,a=r[n]!==e.exports,i=r[n]!==s,l=s!==e.exports;if(a&&!i&&l&&(r[n]=e.exports),t===e.component){if(o){let c=e.component.manager.internals;i&&c.markExports(e,r[n]),K(e.component,n,p=>{p!==e.exports&&c.markExports(e,p)})}e.assignedProperty=o?void 0:n}e.watchExports(()=>{if(r[n]===e.exports)return;let c=e.component.manager;c.internals.setters[n]?.includes(c.internals.readonlySetter)?Ce(()=>{r[n]=e.exports}):r[n]=e.exports})}import{Deferred as be,isEsriInternalEnv as b,safeAsyncCall as Qe,safeCall as D}from"@arcgis/components-utils";import{devToolsAwareTimeout as Xe}from"@arcgis/components-utils";import{getElementAttribute as zt,isEsriInternalEnv as Yt,observeAncestorsMutation as Qt}from"@arcgis/components-utils";import{getElementLocales as Zt,startLocaleObserver as eo}from"@arcgis/components-utils";import{isEsriInternalEnv as oo}from"@arcgis/components-utils";var Ze=class extends me{constructor(e,t){let n="addController"in e;process.env.NODE_ENV!=="production"&&b()&&!n&&Object.defineProperty(e.el,"__component",{value:e});let o=new Set;function s(l){o.add(l),!($ in l)&&e.renderRoot&&e.el.isConnected&&l.hostConnected?.()}function r(l){o.delete(l),l.controllerRemoved?.()}let a=e;if(a.addController=s,a.removeController=r,!n){let l=t??e.constructor.__forceUpdate;a.requestUpdate=()=>l(e)}if(process.env.NODE_ENV!=="production"&&b()&&(Object.entries({componentDidLoad:"loaded",componentDidRender:"updated",componentDidUpdate:"updated",componentShouldUpdate:"shouldUpdate",componentWillLoad:"load",componentWillRender:"willUpdate",componentWillUpdate:"willUpdate"}).forEach(([d,c])=>{if(n&&d in e)throw new Error(`Unexpected ${d}() in a Lit component ${e.el.tagName.toLowerCase()}. In Lit, you should use ${c}() instead`);if(!n&&c in e)throw new Error(`Unexpected ${c}() in a Stencil component ${e.el.tagName.toLowerCase()}. In Stencil, you should use ${c}() instead`)}),n)){let d=0,c=!1;for(let p=e;!c;d++){if(p===null)throw new Error("Expected controllers to be used in a LitElement class");if(Object.hasOwn(p,"_load")){c=!0;break}p=Object.getPrototypeOf(p)}if(d<1)throw new Error("It looks like you are trying to call useControllerManager in a component that uses LitElement imported from 'lit'. useControllerManager should only be used in the LitElement coming from `@arcgis/lumina`")}super(e),this.internals=new ye(this.component),this.destroyed=!1,this._updatePromise=new be,this._originalLifecycles={},this.isLit=n,this.component.manager=this,re(e,n),this._controllers=o,this.exports=void 0,this.hasDestroy=A in this.component&&typeof this.component.destroy=="function",this._bindLifecycleMethods();let i=this.internals;Object.keys(i.members).forEach(l=>{i.accessorGetter[l]=_e,i.accessorSetter[l]=_e,i.getSetProxy(l)}),n?this.internals.enabledWatchers=this.internals.allWatchers:Object.defineProperty(e,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(i.enableReadonly),E(e),N.set(e.el,e),N.set(e,e)}_bindLifecycleMethods(){let e=this.component,t=this.isLit,n=e.el===e;this._originalLifecycles={_connectedCallback:t||n?void 0:e.connectedCallback,_disconnectedCallback:t||n?void 0:e.disconnectedCallback,_load:t?e.load:e.componentWillLoad,_loaded:t?e.loaded:e.componentDidLoad,_willUpdate:t?void 0:e.componentWillUpdate,_updated:t?void 0:e.componentDidUpdate,_destroy:e.destroy};let o=this._connectedCallback.bind(this),s=this._disconnectedCallback.bind(this),r=this._update.bind(this),a=this._updated.bind(this);t?e.constructor.prototype.addController.call(e,{hostConnected:o,hostDisconnected:s,hostUpdate:r,hostUpdated:a}):(e.connectedCallback=o,e.disconnectedCallback=s,e.componentWillLoad=this._load.bind(this),e.componentDidLoad=this._loaded.bind(this),e.componentWillUpdate=r,e.componentDidUpdate=a),this.hasDestroy&&(e.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){let t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${A} prop.`)}this._autoDestroyTimeout!==void 0&&clearTimeout(this._autoDestroyTimeout);let e=this.internals;e.enabledWatchers=e.allWatchers,B(),e.enableReadonly?.(),this._controllers.forEach(et),this._originalLifecycles._connectedCallback?.call(this.component),process.env.NODE_ENV!=="production"&&b()&&he?.(this,!0)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(tt),this._originalLifecycles._disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){await Promise.allSettled(Array.from(this._controllers,ot)),await this._originalLifecycles._load?.call(this.component),this.hasDestroy&&K(this.component,A,()=>this._setAutoDestroyTimeout())}_loaded(){this._controllers.forEach(nt),this._originalLifecycles._loaded?.call(this.component)}_update(){let e=this.component;return this._controllers.forEach(rt,e.$changes),this._originalLifecycles._willUpdate?.call(this.component)}_updated(){let e=this.component;if(this._controllers.forEach(st,e.$changes),this._originalLifecycles._updated?.call(this.component),this.isLit)e.$changes=new Map;else{let t=this._updatePromise;this._updatePromise=new be,t.resolve(!0)}}async destroy(){if(process.env.NODE_ENV!=="production"&&b()&&this.ensureHasDestroy?.(),!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(it),this._controllers.clear(),await this._originalLifecycles._destroy?.call(this.component)}}_setAutoDestroyTimeout(){if(this._autoDestroyTimeout!==void 0&&clearTimeout(this._autoDestroyTimeout),!this.component.el.isConnected&&!this.component.autoDestroyDisabled){let e=()=>void this.destroy().catch(console.error);process.env.NODE_ENV!=="production"&&b()&&z===0?queueMicrotask(e):this._autoDestroyTimeout=Xe(e,z)}}};process.env.NODE_ENV!=="production"&&b()&&(Ze.prototype.ensureHasDestroy=function(){if(!this.hasDestroy)throw new Error(`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { render as w } from "lit-html";
|
|
2
|
+
import { unsafeStatic as d, html as b } from "lit-html/static.js";
|
|
3
|
+
import { camelToKebab as x, isEsriInternalEnv as a } from "@arcgis/components-utils";
|
|
4
|
+
import { onTestFinished as $, expect as D } from "vitest";
|
|
5
|
+
import S from "vitest-fail-on-console";
|
|
6
|
+
import L from "js-beautify";
|
|
7
|
+
import { LitElement as M } from "@arcgis/lumina";
|
|
8
|
+
async function J(e, { parent: n = document.body, afterConnect: o, dynamicComponents: t, cleanupAfterTest: i = !0 } = {}) {
|
|
9
|
+
const r = document.createElement("div");
|
|
10
|
+
r.style.display = "contents", n.append(r), i && $(() => V(r)), E(e);
|
|
11
|
+
const s = t?.some(E);
|
|
12
|
+
let u;
|
|
13
|
+
if (typeof e == "string")
|
|
14
|
+
u = b`<${d(e)}></${d(e)}>`;
|
|
15
|
+
else if (typeof e == "function")
|
|
16
|
+
u = "tagName" in e ? b`<${d(e.tagName)}></${d(e.tagName)}>` : e();
|
|
17
|
+
else {
|
|
18
|
+
if (s)
|
|
19
|
+
throw new Error(
|
|
20
|
+
'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 override tagName = "some-tag-name";` property with a unique tag name within the test file'
|
|
21
|
+
);
|
|
22
|
+
u = e;
|
|
23
|
+
}
|
|
24
|
+
const c = [];
|
|
25
|
+
function y(h) {
|
|
26
|
+
c.push(h.error), h.preventDefault(), h.stopPropagation();
|
|
27
|
+
}
|
|
28
|
+
if (window.addEventListener("error", y), w(u, r), window.removeEventListener("error", y), c.length === 1)
|
|
29
|
+
throw c[0];
|
|
30
|
+
if (c.length > 1)
|
|
31
|
+
throw new AggregateError(c, "Multiple errors occurred while creating the custom element");
|
|
32
|
+
const m = _(r), T = g, C = o?.(m);
|
|
33
|
+
C?.then !== void 0 && await C;
|
|
34
|
+
const f = m;
|
|
35
|
+
typeof f?.componentOnReady == "function" && await f.componentOnReady();
|
|
36
|
+
const p = f?._litElement ?? T ?? m;
|
|
37
|
+
return {
|
|
38
|
+
el: m,
|
|
39
|
+
component: p,
|
|
40
|
+
async reRender() {
|
|
41
|
+
return typeof e == "function" && !("tagName" in e) && w(e(), n), p.requestUpdate(), await p.updateComplete;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
let g;
|
|
46
|
+
const R = globalThis;
|
|
47
|
+
R.devOnly$luminaComponentRefCallback = (e) => {
|
|
48
|
+
g = e;
|
|
49
|
+
};
|
|
50
|
+
function V(e) {
|
|
51
|
+
for (; e.firstChild; )
|
|
52
|
+
e.removeChild(e.firstChild);
|
|
53
|
+
e instanceof HTMLElement && e.remove();
|
|
54
|
+
}
|
|
55
|
+
function E(e) {
|
|
56
|
+
if (!j(e) || e.runtime !== void 0)
|
|
57
|
+
return !1;
|
|
58
|
+
let n = !1, o = e.tagName;
|
|
59
|
+
if (!o) {
|
|
60
|
+
n = !1;
|
|
61
|
+
const t = x(
|
|
62
|
+
/*
|
|
63
|
+
* If name is a single letter, it was probably minified - thus is not
|
|
64
|
+
* stable, thus don't use it. Example: class produced by wrapController()
|
|
65
|
+
*/
|
|
66
|
+
(e.name.length > 1 ? e.name.replaceAll(k, "") : "") || "Test"
|
|
67
|
+
), i = t === "test" ? "te-st" : t.includes("-") ? t : `${t}-`;
|
|
68
|
+
o = i;
|
|
69
|
+
for (let r = 2, s = customElements.get(o); s !== e && s !== void 0; r += 1)
|
|
70
|
+
n = !0, o = `${i}-${r}`, s = customElements.get(o);
|
|
71
|
+
}
|
|
72
|
+
return globalThis.devOnly$luminaRuntime?.customElement(o, e), Object.defineProperty(e.prototype, "tagName", { value: o.toUpperCase() }), n;
|
|
73
|
+
}
|
|
74
|
+
const j = (e) => typeof e == "function" && "lumina" in e, k = /\d+$/gu;
|
|
75
|
+
function _(e) {
|
|
76
|
+
for (const n of e.children)
|
|
77
|
+
if ("lumina" in n.constructor)
|
|
78
|
+
return n;
|
|
79
|
+
for (const n of e.children) {
|
|
80
|
+
const o = _(n);
|
|
81
|
+
if (o != null)
|
|
82
|
+
return o;
|
|
83
|
+
}
|
|
84
|
+
return e.firstElementChild ?? g?.el;
|
|
85
|
+
}
|
|
86
|
+
function A() {
|
|
87
|
+
D.addSnapshotSerializer({
|
|
88
|
+
// Using duck typing to detect ShadowRoot. Not using instanceof to keep test fast
|
|
89
|
+
test(e) {
|
|
90
|
+
return typeof e == "object" && e !== null && "innerHTML" in e && "onslotchange" in e;
|
|
91
|
+
},
|
|
92
|
+
serialize(e) {
|
|
93
|
+
const n = e.innerHTML.replaceAll(P, "");
|
|
94
|
+
return L.html(n, {
|
|
95
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
96
|
+
indent_size: 2,
|
|
97
|
+
indent_char: " ",
|
|
98
|
+
preserve_newlines: !1,
|
|
99
|
+
wrap_line_length: 70,
|
|
100
|
+
indent_inner_html: !1,
|
|
101
|
+
indent_empty_lines: !1
|
|
102
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
const P = /<!--\??(?:lit\$\d+\$)?-->/gu;
|
|
108
|
+
function Q() {
|
|
109
|
+
if (O[N])
|
|
110
|
+
return;
|
|
111
|
+
O[N] = !0;
|
|
112
|
+
const e = { ...console };
|
|
113
|
+
S({
|
|
114
|
+
// Workaround for https://github.com/thomasbrodusch/vitest-fail-on-console/issues/61
|
|
115
|
+
silenceMessage(n, o) {
|
|
116
|
+
return e[o](n), !1;
|
|
117
|
+
}
|
|
118
|
+
}), A();
|
|
119
|
+
}
|
|
120
|
+
const N = Symbol.for("lumina:didSetupTest"), O = globalThis, v = "@arcgis/components-controllers";
|
|
121
|
+
process.env.NODE_ENV !== "production" && a();
|
|
122
|
+
process.env.NODE_ENV !== "production" && a();
|
|
123
|
+
let l = [];
|
|
124
|
+
function q(e) {
|
|
125
|
+
if (e === void 0) {
|
|
126
|
+
l = [];
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const n = l.indexOf(e);
|
|
130
|
+
l = n === -1 ? [...l, e] : l.slice(0, n + 1), queueMicrotask(() => {
|
|
131
|
+
l = [];
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function z() {
|
|
135
|
+
return l;
|
|
136
|
+
}
|
|
137
|
+
process.env.NODE_ENV !== "production" && a() && [
|
|
138
|
+
"This might be the case if you are trying to access an async controller in ",
|
|
139
|
+
"connectedCallback(). Or, if you are using it inside of ",
|
|
140
|
+
"componentWillLoad()/another controller without controller.use. Example correct ",
|
|
141
|
+
`usage:
|
|
142
|
+
`,
|
|
143
|
+
"makeController(async (component, controller)=>{ await controller.use(someOtherController); });"
|
|
144
|
+
].join("");
|
|
145
|
+
process.env.NODE_ENV !== "production" ? Symbol.for(
|
|
146
|
+
// Use Symbol.for in dev mode to make it easier to maintain state when doing HMR.
|
|
147
|
+
`${v}: nothing`
|
|
148
|
+
) : (
|
|
149
|
+
// eslint-disable-next-line symbol-description
|
|
150
|
+
Symbol()
|
|
151
|
+
);
|
|
152
|
+
process.env.NODE_ENV !== "production" && a();
|
|
153
|
+
process.env.NODE_ENV !== "production" && a();
|
|
154
|
+
const F = (e) => (...n) => {
|
|
155
|
+
const o = z(), t = new e(...n);
|
|
156
|
+
return q(o.at(-1)), t;
|
|
157
|
+
};
|
|
158
|
+
function X(e, n) {
|
|
159
|
+
class o extends M {
|
|
160
|
+
constructor() {
|
|
161
|
+
super();
|
|
162
|
+
const i = "prototype" in e ? F(e) : e;
|
|
163
|
+
this.controller = i(this), Promise.resolve(n?.(this)).catch(console.error);
|
|
164
|
+
}
|
|
165
|
+
/*
|
|
166
|
+
* Emitting controller's exports here is useful to let controller tests
|
|
167
|
+
* verify that re-render was triggered when necessary
|
|
168
|
+
*/
|
|
169
|
+
render() {
|
|
170
|
+
return String(
|
|
171
|
+
typeof this.controller == "object" && this.controller !== null && "exports" in this.controller ? this.controller.exports : this.controller
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return o;
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
J as mount,
|
|
179
|
+
Q as setupLuminaTest,
|
|
180
|
+
X as wrapController
|
|
181
|
+
};
|
package/dist/testing/mount.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
import { JsxNode, LitElement, ToElement } from '@arcgis/lumina';
|
|
3
3
|
export type RenderResult<Component extends HTMLElement> = {
|
|
4
4
|
/**
|
|
5
5
|
* The custom element proxy that is attached to the DOM.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LitElement } from
|
|
1
|
+
import { BaseComponent, ControllerHost } from '@arcgis/components-controllers';
|
|
2
|
+
import { LitElement } from '@arcgis/lumina';
|
|
3
3
|
/**
|
|
4
4
|
* Wrap a controller in a small component - useful when you are interested in
|
|
5
5
|
* only testing the controller behavior.
|
package/dist/tests/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ContextDirectories } from '../context/types';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
export declare const testDir: ContextDirectories;
|
|
4
4
|
export declare const testContext: Pick<CompilerContext, "_documentationFileNames" | "dir">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import ts from
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
|
+
import { default as ts } from 'typescript';
|
|
4
4
|
/**
|
|
5
5
|
* A pipeline of transformers for .tsx files.
|
|
6
6
|
* Only .tsx files are touched as all transformations deal with components and
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { SourceDescription } from 'rollup';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
export declare function injectRuntimeOptions(runtimeTsCode: string, context: CompilerContext): SourceDescription;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ts from
|
|
1
|
+
import { SourceMap } from 'rollup';
|
|
2
|
+
import { default as ts } from 'typescript';
|
|
3
3
|
export type UndocumentedTypeScript = {
|
|
4
4
|
readonly createSourceMapGenerator?: (host: ts.CompilerHost, basename: string, sourceRoot: string, dirname: string, compilerOptions: ts.CompilerOptions) => SourceMapGenerator;
|
|
5
5
|
readonly createTextWriter?: (newLine: string) => EmitTextWriter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { FileTransformContext, FileTransformer } from '../publicTypes';
|
|
3
3
|
/**
|
|
4
4
|
* - Remove `@Method()` decorators from the code. `@Method()` decorators are
|
|
5
5
|
* only needed for the docs extraction.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
export declare function transformProperty(context: FileTransformContext, property: ts.AccessorDeclaration | ts.PropertyDeclaration, className: string | undefined, sourceFile: ts.SourceFile, liftedDecorators
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { FileTransformContext } from '../publicTypes';
|
|
3
|
+
import { LiftedDecorators } from './liftDecorators';
|
|
4
|
+
export declare function transformProperty(context: FileTransformContext, property: ts.AccessorDeclaration | ts.PropertyDeclaration, className: string | undefined, sourceFile: ts.SourceFile, liftedDecorators: LiftedDecorators): ts.ClassElement;
|
|
5
5
|
export type ParsedPropertyDecorator = {
|
|
6
6
|
decorator: ts.Decorator;
|
|
7
7
|
callExpression: ts.CallExpression;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { FileTransformContext } from '../publicTypes';
|
|
3
|
+
import { ParsedPropertyDecorator } from './property';
|
|
4
|
+
import { ApiCustomElementField } from '@arcgis/api-extractor';
|
|
5
5
|
/**
|
|
6
6
|
* In Stencil, the compiler uses type checking to determine if the inferred
|
|
7
7
|
* property type is number or boolean, and if so, would make sure to cast the
|
|
@@ -108,4 +108,4 @@ import type { ApiCustomElementField } from "@arcgis/api-extractor";
|
|
|
108
108
|
*
|
|
109
109
|
* See also https://github.com/runem/lit-analyzer/blob/master/packages/lit-analyzer/src/lib/rules/no-incompatible-property-type.ts
|
|
110
110
|
*/
|
|
111
|
-
export declare function transformPropertyOptions(property: ts.AccessorDeclaration | ts.PropertyDeclaration, decorator: ParsedPropertyDecorator, context: FileTransformContext, sourceFile: ts.SourceFile, apiProperty: ApiCustomElementField
|
|
111
|
+
export declare function transformPropertyOptions(property: ts.AccessorDeclaration | ts.PropertyDeclaration, decorator: ParsedPropertyDecorator, context: FileTransformContext, sourceFile: ts.SourceFile, apiProperty: ApiCustomElementField): ts.ObjectLiteralExpression | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { FileTransformer } from '../publicTypes';
|
|
3
|
+
import { CompilerContext } from '../context';
|
|
4
4
|
/**
|
|
5
5
|
* Run a chain of transformers on a TypeScript .tsx or .d.ts file and return
|
|
6
6
|
* the resulting source file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { CompilerContext } from '../context';
|
|
2
|
+
import { PluginOptions } from 'vite-plugin-dts';
|
|
3
3
|
export declare function runAstDtsTransformers(context: CompilerContext): NonNullable<PluginOptions["resolvers"]>[number];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FileTransformer } from '../publicTypes';
|
|
2
2
|
export declare const failOnJsonImport: FileTransformer;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
/**
|
|
4
4
|
* Generate TypeScript definition files for the files in the project.
|
|
5
5
|
* There is a corresponding .d.ts file emitted for each source .ts and .tsx file.
|