@arcgis/lumina-compiler 5.0.0-next.7 → 5.0.0-next.71
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 +11 -14
- package/dist/context/typeScript.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 +1 -1
- package/dist/dependencies/loaders.d.ts +3 -3
- package/dist/dependencies/lumina.d.ts +2 -2
- package/dist/dependencies/stencil.d.ts +2 -2
- package/dist/dependencies/testSetupFiles.d.ts +1 -1
- package/dist/dependencies/updateLumina.d.ts +5 -4
- package/dist/docs/config.d.ts +1 -1
- package/dist/docs/index.d.ts +1 -1
- package/dist/docs/stencilDocsJson.d.ts +1 -1
- package/dist/docs/vsCodeCustomData/index.d.ts +1 -1
- package/dist/docs/vsCodeCustomData/utils.d.ts +1 -1
- package/dist/docs/webTypes/index.d.ts +1 -1
- package/dist/docs/webTypes/utils.d.ts +1 -1
- package/dist/entrypoints/addNonLazyImports.d.ts +1 -1
- package/dist/entrypoints/config.d.ts +0 -1
- package/dist/entrypoints/dtsUtils.d.ts +2 -2
- package/dist/entrypoints/findUtils.d.ts +1 -1
- package/dist/entrypoints/handleComponentImports.d.ts +1 -1
- package/dist/entrypoints/pathMapping.d.ts +1 -1
- package/dist/entrypoints/resolveTagName.d.ts +3 -3
- package/dist/extractor/LuminaApiExtractor.d.ts +63 -0
- package/dist/extractor/apiJsonUtils.d.ts +2 -1
- package/dist/extractor/declaration.d.ts +3 -3
- package/dist/extractor/helpers/event.d.ts +1 -2
- package/dist/extractor/helpers/method.d.ts +1 -8
- package/dist/extractor/helpers/property.d.ts +2 -7
- package/dist/extractor/helpers/resolveType.d.ts +1 -1
- package/dist/extractor/index.d.ts +4 -2
- package/dist/frameworkTypes/index.d.ts +1 -1
- package/dist/frameworkTypes/utils.d.ts +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1609 -1671
- package/dist/jsxToLitHtml/autoAddNothing.d.ts +2 -2
- package/dist/jsxToLitHtml/comments.d.ts +2 -2
- package/dist/jsxToLitHtml/convertProps.d.ts +4 -4
- package/dist/jsxToLitHtml/imports.d.ts +4 -9
- package/dist/jsxToLitHtml/importsConfig.d.ts +8 -1
- package/dist/jsxToLitHtml/index.d.ts +1 -1
- package/dist/jsxToLitHtml/inferPropType.d.ts +1 -1
- package/dist/jsxToLitHtml/insertRepeatCall.d.ts +1 -1
- package/dist/jsxToLitHtml/jsxVisitor.d.ts +2 -2
- package/dist/jsxToLitHtml/templateParts.d.ts +1 -1
- package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +1 -1
- package/dist/jsxToLitHtml/types.d.ts +2 -2
- package/dist/loader/css.d.ts +3 -3
- package/dist/loader/index.d.ts +1 -1
- package/dist/loader/lazy.d.ts +3 -3
- package/dist/plugins/buildCdn.d.ts +2 -2
- package/dist/plugins/buildWebApp.d.ts +1 -1
- package/dist/plugins/buildWrappers.d.ts +1 -1
- package/dist/plugins/configureVite.d.ts +2 -2
- package/dist/plugins/externalizeDependencies.d.ts +1 -1
- package/dist/plugins/handleDynamicAssets.d.ts +1 -1
- package/dist/plugins/handleStaticAssets.d.ts +1 -1
- package/dist/plugins/loadLitCss.d.ts +1 -1
- package/dist/plugins/printTotalBuildSize.d.ts +1 -1
- package/dist/plugins/provideAssets.d.ts +3 -3
- package/dist/plugins/setAssetsPath.d.ts +1 -1
- package/dist/plugins/updatePackageJson.d.ts +1 -1
- package/dist/publicTypes.d.ts +14 -10
- package/dist/puppeteerTesting/globalSetup.d.ts +2 -2
- package/dist/puppeteerTesting/index.d.ts +7 -7
- package/dist/puppeteerTesting/index.js +11 -11
- package/dist/puppeteerTesting/puppeteer/element.d.ts +4 -4
- 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/types.d.ts +1 -1
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/mount.d.ts +1 -1
- package/dist/tests/utils.d.ts +2 -2
- package/dist/transformers/index.d.ts +1 -1
- package/dist/transformers/injectRuntimeOptions.d.ts +1 -1
- package/dist/transformers/members.d.ts +1 -1
- package/dist/transformers/property.d.ts +2 -2
- package/dist/transformers/propertyOptions.d.ts +2 -2
- package/dist/transformers/utils.d.ts +2 -2
- package/dist/types/astTransformers.d.ts +1 -1
- package/dist/types/hideInternalLitElement.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/liftSetterTypes.d.ts +1 -1
- package/dist/types/textTransformers.d.ts +1 -1
- package/dist/types/transformComponentMembers.d.ts +1 -1
- package/dist/useLumina.d.ts +1 -1
- package/package.json +9 -9
- package/dist/extractor/extractor.d.ts +0 -54
- package/dist/testing/vitestTypes.d.ts +0 -8
- package/dist/transformers/internalTypeScriptApis.d.ts +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TemplatePart } from './templateParts';
|
|
2
|
-
import { JsxContext } from './types';
|
|
1
|
+
import { TemplatePart } from './templateParts.ts';
|
|
2
|
+
import { JsxContext } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* If JSX prop value could possibly be `undefined`, we add `?? nothing` to it.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext } from './types';
|
|
3
|
-
import { TemplatePart } from './templateParts';
|
|
2
|
+
import { JsxContext } from './types.ts';
|
|
3
|
+
import { TemplatePart } from './templateParts.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Extract comments and whitespace from a node (called "trivia" in TypeScript)
|
|
6
6
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { TemplatePart } from './templateParts';
|
|
3
|
-
import { JsxContext } from './types';
|
|
4
|
-
import { JsxPropType } from './inferPropType';
|
|
5
|
-
import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config';
|
|
2
|
+
import { TemplatePart } from './templateParts.ts';
|
|
3
|
+
import { JsxContext } from './types.ts';
|
|
4
|
+
import { JsxPropType } from './inferPropType.ts';
|
|
5
|
+
import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config.ts';
|
|
6
6
|
/**
|
|
7
7
|
* Handle the conversion for each JSX prop type
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext } from './types';
|
|
2
|
+
import { JsxContext } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* This runs before we know what imports will be needed.
|
|
5
5
|
*
|
|
@@ -9,20 +9,15 @@ import { JsxContext } from './types';
|
|
|
9
9
|
* imports, if we see that e.x "html" is not present in the "lit" import, we
|
|
10
10
|
* might import it again and fail to check that it might be imported further
|
|
11
11
|
* down from "lit-html".
|
|
12
|
+
* 3. Drop compiler-only imports that exist as runtime imports only for
|
|
13
|
+
* type checking or as compiler hints.
|
|
12
14
|
*/
|
|
13
|
-
export declare function trackExistingImports(context: JsxContext, importDeclaration: ts.ImportDeclaration): ts.ImportDeclaration;
|
|
15
|
+
export declare function trackExistingImports(context: JsxContext, importDeclaration: ts.ImportDeclaration): ts.ImportDeclaration | undefined;
|
|
14
16
|
/**
|
|
15
17
|
* After we know what imports will be needed, if there already are some imports
|
|
16
18
|
* from the places we are looking for, augment those import declarations.
|
|
17
19
|
*
|
|
18
20
|
* In a step after this, if any imports will still be needed, we will add them.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* We don't bother removing `@arcgis/lumina` "h" and "Fragment" imports as those
|
|
22
|
-
* would be removed by rollup if there are no usages outside of JSX. If
|
|
23
|
-
* those are explicitly called outside of jsx, Rollup will throw a build time
|
|
24
|
-
* error (since `@arcgis/lumina` does not actually define h and Fragment but only
|
|
25
|
-
* declare their typings).
|
|
26
21
|
*/
|
|
27
22
|
export declare function augmentExistingImports(this: JsxContext, node: ts.Statement): ts.Statement;
|
|
28
23
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsxImportName } from './types';
|
|
1
|
+
import { JsxImportName } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Most Lit API's are re-exported from multiple packages. Because only Lit
|
|
4
4
|
* package is declared as an explicit dependency, Lumina's auto-inserted imports
|
|
@@ -8,3 +8,10 @@ import { JsxImportName } from './types';
|
|
|
8
8
|
* that export these APIs (the 2nd+ items in the lists below).
|
|
9
9
|
*/
|
|
10
10
|
export declare const dynamicallyInsertedImportsByName: Record<JsxImportName, string[]>;
|
|
11
|
+
/**
|
|
12
|
+
* These runtime imports exist only for type checking or as compiler hints.
|
|
13
|
+
* The compiler refactors out their usages. Thus, we should also remove out
|
|
14
|
+
* their imports. This does not happen automatically if using TypeScript's
|
|
15
|
+
* strict verbatimModuleSyntax setting.
|
|
16
|
+
*/
|
|
17
|
+
export declare const compilerOnlyLuminaImports: Set<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileTransformer } from '../publicTypes';
|
|
1
|
+
import { FileTransformer } from '../publicTypes.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Let developers author components in JSX for better type checking and developer
|
|
4
4
|
* experience, but convert JSX to lit-html at build time for better performance.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config';
|
|
2
|
+
import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Check if prop initializer has bindProperty(), bindAttribute(),
|
|
5
5
|
* bindBooleanAttribute() or bindEvent() call - these explicitly indicate the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { TemplatePart } from './templateParts';
|
|
3
|
-
import { JsxHost, JsxContext } from './types';
|
|
2
|
+
import { TemplatePart } from './templateParts.ts';
|
|
3
|
+
import { JsxHost, JsxContext } from './types.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Recursively traverse the entire AST top-down, converting JSX to lit-html.
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { JsxContext, LitTag, ambiguousSvgTag } from './types';
|
|
2
|
+
import { JsxContext, LitTag, ambiguousSvgTag } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Template part is a convenient intermediate representation for template
|
|
5
5
|
* literal expressions.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { ResolvedDependencyComponents } from '../dependencies/discover';
|
|
3
|
-
import { CompilerContext } from '../context';
|
|
2
|
+
import { ResolvedDependencyComponents } from '../dependencies/discover.ts';
|
|
3
|
+
import { CompilerContext } from '../context/index.ts';
|
|
4
4
|
export type JsxContext = {
|
|
5
5
|
readonly compiler: CompilerContext;
|
|
6
6
|
/** Source file before the _JSX to lit-html_ transformation */
|
package/dist/loader/css.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CompilerContext } from '../context';
|
|
2
|
-
export declare function addGlobalCss(context: CompilerContext): string;
|
|
1
|
+
import { CompilerContext } from '../context/index.ts';
|
|
2
|
+
export declare function addGlobalCss(context: Pick<CompilerContext, "_globalHydratedCssString" | "apiJsonComponents" | "dir" | "isInStorybook" | "options" | "shouldMinify" | "viteCommand">): string;
|
|
3
3
|
export declare const defaultHydratedAttribute = "hydrated";
|
|
4
4
|
/**
|
|
5
5
|
* Auto-inject the CSS when in dev server or when building for CDN to remove the
|
|
@@ -8,7 +8,7 @@ export declare const defaultHydratedAttribute = "hydrated";
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://discord.com/channels/1012791295170859069/1274527043614150708
|
|
10
10
|
*/
|
|
11
|
-
export declare function getGlobalCssInjectionCode(globalCssString: string | undefined, context: CompilerContext): string;
|
|
11
|
+
export declare function getGlobalCssInjectionCode(globalCssString: string | undefined, context: Pick<CompilerContext, "_globalHydratedCssString" | "shouldMinify">): string;
|
|
12
12
|
/**a
|
|
13
13
|
* Get a CSS string that can be printed into a .css file
|
|
14
14
|
*
|
package/dist/loader/index.d.ts
CHANGED
package/dist/loader/lazy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompilerContext } from '../context';
|
|
1
|
+
import { CompilerContext } from '../context/index.ts';
|
|
2
2
|
import { HmrComponentMeta } from '@arcgis/lumina/hmrSupport';
|
|
3
3
|
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
4
4
|
/**
|
|
@@ -8,8 +8,8 @@ import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
|
8
8
|
* generate a small metadata structure for each component. This will be
|
|
9
9
|
* inserted into the root index.ts file in the package
|
|
10
10
|
*/
|
|
11
|
-
export declare function buildLoaderJs(context: CompilerContext): string;
|
|
12
|
-
export declare const loaderDts = "import \"./index\";\nexport declare const defineCustomElements: import(\"@arcgis/lumina\").DefineCustomElements;";
|
|
11
|
+
export declare function buildLoaderJs(context: Pick<CompilerContext, "_globalHydratedCssString" | "apiJson" | "apiJsonComponents" | "dir" | "hmrEnabled" | "isInStorybook" | "options" | "privateApiJson" | "shouldMinify" | "viteCommand">): string;
|
|
12
|
+
export declare const loaderDts = "import \"./index.js\";\nexport declare const defineCustomElements: import(\"@arcgis/lumina\").DefineCustomElements;";
|
|
13
13
|
/**
|
|
14
14
|
* For each component, build as compact definition as possible of all the public
|
|
15
15
|
* properties, attributes, asynchronous methods and synchronous methods.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
3
|
-
import { CdnChunk } from '../publicTypes';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
|
+
import { CdnChunk } from '../publicTypes.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Restricted due to collisions with Lumina's dist/ folder names or
|
|
6
6
|
* Stencil's dist/ folder names
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
3
|
import { InlineConfig } from 'vitest/node';
|
|
4
|
-
import { PuppeteerTestingOptions } from '../publicTypes';
|
|
4
|
+
import { PuppeteerTestingOptions } from '../publicTypes.ts';
|
|
5
5
|
export type PuppeteerVitestConfigOptions = InlineConfig & {
|
|
6
6
|
puppeteerLaunchOptions?: PuppeteerTestingOptions["launchOptions"];
|
|
7
7
|
puppeteerWaitForChangesDelay?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* This is similar to Stencil's assets hosting, but to improve DX, the assets
|
|
5
5
|
* belonging to each component are moved into a folder named after the component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* CSS extension list taken from https://github.com/vitejs/vite/blob/a8c7083a3d7d7fe2e83e994ff008f39ee4f298f8/packages/vite/src/node/constants.ts#L50
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CompilerContext } from '../context';
|
|
2
|
-
import { AssetSpec, AssetTransformer } from '../publicTypes';
|
|
3
|
-
import { ContextDirectories } from '../context/types';
|
|
1
|
+
import { CompilerContext } from '../context/index.ts';
|
|
2
|
+
import { AssetSpec, AssetTransformer } from '../publicTypes.ts';
|
|
3
|
+
import { ContextDirectories } from '../context/types.ts';
|
|
4
4
|
export declare function serveAssets(context: CompilerContext, assets: AssetSpec[], transformers?: AssetTransformer[]): void;
|
|
5
5
|
export declare function writeAssets(context: CompilerContext, assets: AssetSpec[], transformers?: AssetTransformer[]): Promise<void>;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MiniPackageJson } from '@arcgis/components-build-utils';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
3
|
import { Plugin } from 'vite';
|
|
4
4
|
export declare const updatePackageJson: (context: CompilerContext) => Plugin;
|
|
5
5
|
declare function doPackageJsonUpdate(packageJson: MiniPackageJson, context: Pick<CompilerContext, "_documentationFileNames" | "dir" | "options">): MiniPackageJson | undefined;
|
package/dist/publicTypes.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
2
|
import { Plugin } from 'vite';
|
|
3
3
|
import { build as esbuildBuild } from 'esbuild';
|
|
4
|
-
import { CompilerContext } from './context';
|
|
4
|
+
import { CompilerContext } from './context/index.ts';
|
|
5
5
|
import { PluginOptions as VitePluginDtsOptions } from 'vite-plugin-dts';
|
|
6
|
-
import { WebTypesOptions } from './docs/webTypes/types';
|
|
7
|
-
import { VsCodeDocOptions } from './docs/vsCodeCustomData/types';
|
|
6
|
+
import { WebTypesOptions } from './docs/webTypes/types.ts';
|
|
7
|
+
import { VsCodeDocOptions } from './docs/vsCodeCustomData/types.ts';
|
|
8
8
|
import { DependencyManagementOptions as BaseDependencyManagementOptions } from '@arcgis/components-build-utils';
|
|
9
9
|
import { ApiJson, ApiModule, CopyDocDefinitions } from '@arcgis/api-extractor';
|
|
10
|
-
import { LuminaApiExtractor } from './extractor/
|
|
10
|
+
import { LuminaApiExtractor } from './extractor/LuminaApiExtractor.ts';
|
|
11
11
|
/**
|
|
12
12
|
* `useLumina()` returns an array of Vite plugins. The array additionally
|
|
13
13
|
* has a `context` property for accessing the compiler context.
|
|
@@ -39,7 +39,7 @@ export type LuminaOptions = {
|
|
|
39
39
|
*
|
|
40
40
|
* @deprecated
|
|
41
41
|
* For new projects, use Vitest browser mode instead of Puppeteer.
|
|
42
|
-
* See documentation: https://
|
|
42
|
+
* See documentation: https://webgis.esri.com/references/lumina/testing
|
|
43
43
|
*/
|
|
44
44
|
readonly puppeteerTesting?: PuppeteerTestingOptions;
|
|
45
45
|
/**
|
|
@@ -190,7 +190,7 @@ export type WrappersOptions = React18WrapperOptions;
|
|
|
190
190
|
/**
|
|
191
191
|
* Options for creating React 18 wrapper.
|
|
192
192
|
*
|
|
193
|
-
* Documentation: https://
|
|
193
|
+
* Documentation: https://webgis.esri.com/references/lumina/build#build-wrappers
|
|
194
194
|
*/
|
|
195
195
|
export type React18WrapperOptions = {
|
|
196
196
|
readonly type: "react18";
|
|
@@ -262,14 +262,14 @@ export type DetailedExtraDependency = {
|
|
|
262
262
|
/**
|
|
263
263
|
* @deprecated
|
|
264
264
|
* For new projects, use Vitest browser mode instead of Puppeteer.
|
|
265
|
-
* See documentation: https://
|
|
265
|
+
* See documentation: https://webgis.esri.com/references/lumina/testing
|
|
266
266
|
*/
|
|
267
267
|
export type PuppeteerTestingOptions = {
|
|
268
268
|
/**
|
|
269
269
|
* @default false
|
|
270
270
|
* @deprecated
|
|
271
271
|
* For new projects, use Vitest browser mode instead of Puppeteer.
|
|
272
|
-
* See documentation: https://
|
|
272
|
+
* See documentation: https://webgis.esri.com/references/lumina/testing
|
|
273
273
|
*/
|
|
274
274
|
readonly enabled?: boolean;
|
|
275
275
|
/**
|
|
@@ -318,7 +318,7 @@ export type GenerateDocumentationOptions = {
|
|
|
318
318
|
* Set this to "https://developers.arcgis.com/javascript/latest/storybook/map-components/".
|
|
319
319
|
* This will produce URLs like
|
|
320
320
|
* "https://developers.arcgis.com/javascript/latest/storybook/map-components/?path=/story/arcgis-area-measurement-2d--demo&singleStory=true"
|
|
321
|
-
* @see https://
|
|
321
|
+
* @see https://webgis.esri.com/references/support-packages/storybook
|
|
322
322
|
*/
|
|
323
323
|
readonly publicStoryUrlPrefix?: string;
|
|
324
324
|
/**
|
|
@@ -486,6 +486,10 @@ export type CssHandlingOptions = {
|
|
|
486
486
|
* do not need a separate `<link>` tag. In the NPM build, users will need to
|
|
487
487
|
* manually apply these styles as appropriate in their bundler (either via
|
|
488
488
|
* import statement, or via `<link>` tag or etc).
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* // If relative path is provided, it is relative to the root directory.
|
|
492
|
+
* "./src/styles/global.css"
|
|
489
493
|
*/
|
|
490
494
|
globalStylesPath?: string;
|
|
491
495
|
/**
|
|
@@ -687,7 +691,7 @@ export type LintingOptions = {
|
|
|
687
691
|
* technical limitations. Instead, this rule exists to enforce them at
|
|
688
692
|
* build-time.
|
|
689
693
|
*
|
|
690
|
-
* [Documentation](https://
|
|
694
|
+
* [Documentation](https://webgis.esri.com/references/lumina/properties#string-properties)
|
|
691
695
|
*/
|
|
692
696
|
mustIncludeAllRequiredProperties?: string[];
|
|
693
697
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TestProject } from 'vitest/node';
|
|
2
2
|
import { ConnectOptions } from 'puppeteer';
|
|
3
3
|
declare module "vitest" {
|
|
4
4
|
interface ProvidedContext {
|
|
@@ -60,7 +60,7 @@ declare module "vitest" {
|
|
|
60
60
|
* to provide Puppeteer integration only temporary to ease the Stencil
|
|
61
61
|
* migration, so optimizing it too much is not a goal.
|
|
62
62
|
*/
|
|
63
|
-
export declare function setup(context:
|
|
63
|
+
export declare function setup(context: TestProject): Promise<() => Promise<void>>;
|
|
64
64
|
export type PuppeteerViteGlobals = {
|
|
65
65
|
/**
|
|
66
66
|
* Helps lumina-compiler dev server know that is it running for Puppeteer
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PuppeteerMatchers } from './vitest/matchers';
|
|
2
|
-
export type * from './puppeteer/types';
|
|
3
|
-
export type { NewE2EPageOptions } from './puppeteer/page';
|
|
4
|
-
export { newE2EPage } from './puppeteer/page';
|
|
5
|
-
export type { E2EElement } from './puppeteer/element';
|
|
6
|
-
export type { EventSpy } from './puppeteer/events';
|
|
7
|
-
export { setupPuppeteerTest } from './vitest/setupFile';
|
|
1
|
+
import { PuppeteerMatchers } from './vitest/matchers/index.ts';
|
|
2
|
+
export type * from './puppeteer/types.ts';
|
|
3
|
+
export type { NewE2EPageOptions } from './puppeteer/page.ts';
|
|
4
|
+
export { newE2EPage } from './puppeteer/page.ts';
|
|
5
|
+
export type { E2EElement } from './puppeteer/element.ts';
|
|
6
|
+
export type { EventSpy } from './puppeteer/events.ts';
|
|
7
|
+
export { setupPuppeteerTest } from './vitest/setupFile.ts';
|
|
8
8
|
declare module "vitest" {
|
|
9
9
|
interface Assertion<T = any> extends PuppeteerMatchers<T> {
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { expect as p, afterEach as
|
|
2
|
-
import { toSystemPathSeparators as
|
|
1
|
+
import { expect as p, afterEach as S } from "vitest";
|
|
2
|
+
import { toSystemPathSeparators as V, isPosix as L } from "@arcgis/components-build-utils";
|
|
3
3
|
import { p as T, i as h } from "../types-C3YmWTVv.js";
|
|
4
4
|
import { l as y } from "../logger-hJvg0JOj.js";
|
|
5
5
|
async function D(s) {
|
|
@@ -35,7 +35,7 @@ async function $(s, e, t) {
|
|
|
35
35
|
}
|
|
36
36
|
class C {
|
|
37
37
|
constructor(e) {
|
|
38
|
-
this.
|
|
38
|
+
this.events = [], this._cursor = 0, this._queuedHandler = [], this.eventName = e;
|
|
39
39
|
}
|
|
40
40
|
get length() {
|
|
41
41
|
return this.events.length;
|
|
@@ -135,7 +135,7 @@ const M = globalThis.HTMLElement ?? function() {
|
|
|
135
135
|
};
|
|
136
136
|
class d extends M {
|
|
137
137
|
constructor(e = d._page, t = d._handle) {
|
|
138
|
-
super(), this.
|
|
138
|
+
super(), this._queuedActions = [], this._temporaryDisableValidation = !1, this._page = e, this.handle = t, e._e2eElements.push(this);
|
|
139
139
|
const n = this.classList.add, a = this.classList.remove, i = this.classList.toggle;
|
|
140
140
|
this.classList.add = (...r) => {
|
|
141
141
|
this._temporaryDisableValidation = !0;
|
|
@@ -810,8 +810,8 @@ async function k(s, e) {
|
|
|
810
810
|
}), a.on("pageerror", (o) => {
|
|
811
811
|
if (t.push({
|
|
812
812
|
type: "pageerror",
|
|
813
|
-
message: o
|
|
814
|
-
location: o.stack
|
|
813
|
+
message: String(o),
|
|
814
|
+
location: typeof o == "object" && o !== null && "stack" in o ? String(o.stack) : ""
|
|
815
815
|
}), a._isWaitingForAllReady) {
|
|
816
816
|
a._unhandledError = o;
|
|
817
817
|
return;
|
|
@@ -975,12 +975,12 @@ function K(s) {
|
|
|
975
975
|
if (s?.url) {
|
|
976
976
|
const t = s.url.indexOf(_);
|
|
977
977
|
e = ` ${decodeURIComponent(
|
|
978
|
-
t === -1 ? s.url :
|
|
978
|
+
t === -1 ? s.url : V(s.url.slice(t + _.length))
|
|
979
979
|
)}`, s.lineNumber && (e += `:${s.lineNumber}`), s.columnNumber && (e += `:${s.columnNumber}`);
|
|
980
980
|
}
|
|
981
981
|
return e;
|
|
982
982
|
}
|
|
983
|
-
const _ =
|
|
983
|
+
const _ = L ? "/@fs" : "/@fs/";
|
|
984
984
|
function f(s, e) {
|
|
985
985
|
if (typeof s != "object" || s === null)
|
|
986
986
|
throw new Error(`${e} expect called with non-element value`);
|
|
@@ -1022,14 +1022,14 @@ const Q = (s, e, t) => {
|
|
|
1022
1022
|
message: () => `expected to ${t ? "not " : ""}have css class "${e}"`,
|
|
1023
1023
|
pass: t
|
|
1024
1024
|
};
|
|
1025
|
-
}, F = (s, e) => {
|
|
1025
|
+
}, F = ((s, e) => {
|
|
1026
1026
|
f(s, "toHaveClasses");
|
|
1027
1027
|
const t = e.every((n) => s.classList.contains(n));
|
|
1028
1028
|
return {
|
|
1029
1029
|
message: () => `expected to ${t ? "not " : ""}have css classes "${e.join(" ")}", but className is "${s.className}"`,
|
|
1030
1030
|
pass: t
|
|
1031
1031
|
};
|
|
1032
|
-
}, te = (s, e) => {
|
|
1032
|
+
}), te = (s, e) => {
|
|
1033
1033
|
f(s, "toMatchClasses");
|
|
1034
1034
|
let { pass: t } = F(s, e);
|
|
1035
1035
|
return t && (t = e.length === s.classList.length), {
|
|
@@ -1122,7 +1122,7 @@ const ne = (s, e) => {
|
|
|
1122
1122
|
toHaveNthReceivedEventDetail: oe
|
|
1123
1123
|
};
|
|
1124
1124
|
function pe() {
|
|
1125
|
-
p.extend(ce),
|
|
1125
|
+
p.extend(ce), S(() => {
|
|
1126
1126
|
document.body.childNodes.forEach(R);
|
|
1127
1127
|
});
|
|
1128
1128
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClickOptions, ElementHandle, KeyInput } from 'puppeteer';
|
|
2
|
-
import { EventSpy } from './events';
|
|
3
|
-
import { E2EPage, FindSelector, SerializedEvent } from './types';
|
|
2
|
+
import { EventSpy } from './events.ts';
|
|
3
|
+
import { E2EPage, FindSelector, SerializedEvent } from './types.ts';
|
|
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.
|
|
@@ -10,8 +10,6 @@ declare const Superclass: {
|
|
|
10
10
|
prototype: HTMLElement;
|
|
11
11
|
};
|
|
12
12
|
export declare class E2EElement extends Superclass {
|
|
13
|
-
private _page;
|
|
14
|
-
handle: ElementHandle;
|
|
15
13
|
/**
|
|
16
14
|
* The '2500' value that we default to is the value of `jasmine.DEFAULT_TIMEOUT_INTERVAL` (5000) divided by 2.
|
|
17
15
|
*/
|
|
@@ -26,6 +24,8 @@ export declare class E2EElement extends Superclass {
|
|
|
26
24
|
static create(page: E2EPage, handle: ElementHandle): E2EElement;
|
|
27
25
|
private _queuedActions;
|
|
28
26
|
private _temporaryDisableValidation;
|
|
27
|
+
private _page;
|
|
28
|
+
handle: ElementHandle;
|
|
29
29
|
constructor(_page?: E2EPage, handle?: ElementHandle);
|
|
30
30
|
/**
|
|
31
31
|
* Find a child element that matches the selector, which is the same as
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ElementHandle, JSHandle } from 'puppeteer';
|
|
2
|
-
import { E2EPage, SerializedEvent } from './types';
|
|
2
|
+
import { E2EPage, SerializedEvent } from './types.ts';
|
|
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>>;
|
|
6
6
|
export declare class EventSpy<Detail = unknown> {
|
|
7
|
-
eventName: string;
|
|
8
7
|
events: SerializedEvent<Detail>[];
|
|
9
8
|
private _cursor;
|
|
10
9
|
private _queuedHandler;
|
|
10
|
+
eventName: string;
|
|
11
11
|
constructor(eventName: string);
|
|
12
12
|
get length(): number;
|
|
13
13
|
get firstEvent(): SerializedEvent<Detail> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTTPResponse, Page, WaitForOptions } from 'puppeteer';
|
|
2
|
-
import { EventSpy } from './events';
|
|
3
|
-
import { E2EElement } from './element';
|
|
2
|
+
import { EventSpy } from './events.ts';
|
|
3
|
+
import { E2EElement } from './element.ts';
|
|
4
4
|
export interface PageDiagnostic {
|
|
5
5
|
type: "error" | "pageerror" | "requestfailed";
|
|
6
6
|
message?: string;
|
|
@@ -105,7 +105,7 @@ export interface E2EPage extends Page {
|
|
|
105
105
|
/** @private */
|
|
106
106
|
_isWaitingForAllReady: boolean;
|
|
107
107
|
/** @private */
|
|
108
|
-
_unhandledError:
|
|
108
|
+
_unhandledError: unknown;
|
|
109
109
|
}
|
|
110
110
|
export interface SerializedEvent<Detail = unknown> {
|
|
111
111
|
bubbles: boolean;
|
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 './mount';
|
|
9
|
-
export { mount } from './mount';
|
|
10
|
-
export { setupLuminaTest } from './setupFile';
|
|
11
|
-
export { wrapController } from './wrapController';
|
|
8
|
+
export type { RenderOptions, RenderResult } from './mount.ts';
|
|
9
|
+
export { mount } from './mount.ts';
|
|
10
|
+
export { setupLuminaTest } from './setupFile.ts';
|
|
11
|
+
export { wrapController } from './wrapController.ts';
|
package/dist/testing/mount.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export type RenderOptions<Component extends HTMLElement = HTMLElement> = {
|
|
|
82
82
|
* Render Lit Element in a test environment.
|
|
83
83
|
*
|
|
84
84
|
* See documentation:
|
|
85
|
-
* https://
|
|
85
|
+
* https://webgis.esri.com/references/lumina/testing
|
|
86
86
|
*
|
|
87
87
|
* @example
|
|
88
88
|
* ```tsx
|
package/dist/tests/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextDirectories } from '../context/types';
|
|
2
|
-
import { CompilerContext } from '../context';
|
|
1
|
+
import { ContextDirectories } from '../context/types.ts';
|
|
2
|
+
import { CompilerContext } from '../context/index.ts';
|
|
3
3
|
export declare const testDir: ContextDirectories;
|
|
4
4
|
export declare const testContext: Pick<CompilerContext, "_documentationFileNames" | "dir" | "options">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { FileTransformContext, FileTransformer } from '../publicTypes';
|
|
2
|
+
import { FileTransformContext, FileTransformer } from '../publicTypes.ts';
|
|
3
3
|
/**
|
|
4
4
|
* - Remove `@Method()` decorators from the code. `@Method()` decorators are
|
|
5
5
|
* only needed for the docs extraction.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as ts } from 'typescript';
|
|
2
|
-
import { FileTransformContext } from '../publicTypes';
|
|
3
|
-
import { LiftedDecorators } from './liftDecorators';
|
|
2
|
+
import { FileTransformContext } from '../publicTypes.ts';
|
|
3
|
+
import { LiftedDecorators } from './liftDecorators.ts';
|
|
4
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;
|