@arcgis/lumina-compiler 4.33.0-next.9 → 4.33.0-next.91
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 +2 -2
- 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 +6482 -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 +5 -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/buildWebApp.d.ts +3 -0
- 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 +25 -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 +6 -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
package/dist/context/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ts from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { makeLoaders,
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
import { ConfigEnv, Plugin, ResolvedConfig, ViteDevServer } from 'vite';
|
|
2
|
+
import { default as ts } from 'typescript';
|
|
3
|
+
import { ApiCssCustomProperty, ApiCustomElementDeclaration, ApiJson } from '@arcgis/api-extractor';
|
|
4
|
+
import { LuminaOptions, AssetSpec, AssetTransformer, DeclarationTextTransformer, ProvideAssetsOptions, LintingOptions } from '../publicTypes';
|
|
5
|
+
import { ComponentPathMapping } from '../entrypoints/pathMapping';
|
|
6
|
+
import { DocsType } from '../docs/types';
|
|
7
|
+
import { ContextDirectories } from './types';
|
|
8
|
+
import { makeLoaders, computeServeOnlyDependencies } from '../dependencies/loaders';
|
|
9
|
+
import { CustomElementInterdependencies } from '../entrypoints/config';
|
|
10
|
+
import { getCompilerOptionsForPrinter } from '../transformers';
|
|
11
|
+
import { getPrinter } from '../transformers/internalTypeScriptApis';
|
|
12
|
+
import { getLocalDefinedComponentsFromApiJson } from '../entrypoints/resolveTagName';
|
|
13
|
+
import { Deferred } from '@arcgis/components-utils';
|
|
14
14
|
export declare class CompilerContext {
|
|
15
15
|
/**
|
|
16
16
|
* The path to the resolved TypeScript configuration
|
|
@@ -311,13 +311,6 @@ export declare class CompilerContext {
|
|
|
311
311
|
regex: RegExp;
|
|
312
312
|
replacements: Record<string, string>;
|
|
313
313
|
};
|
|
314
|
-
/**
|
|
315
|
-
* Mapping between component tag name and public properties in that component
|
|
316
|
-
* whose type depends on another property.
|
|
317
|
-
*
|
|
318
|
-
* @private
|
|
319
|
-
*/
|
|
320
|
-
_typeDependencies: Map<string, Set<string>>;
|
|
321
314
|
private _silencedRules;
|
|
322
315
|
/**
|
|
323
316
|
* Promise that resolves once src/lumina.ts is updated
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { CompilerContext } from '.';
|
|
3
3
|
/**
|
|
4
4
|
* In build mode, vite-plugin-dts already parses tsconfig. However, it
|
|
5
5
|
* overwrites the resolved tsconfig.target with ESNext, which is not what we
|
package/dist/context/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function inferPreamble(packageJson?: import(
|
|
1
|
+
export declare function inferPreamble(packageJson?: import('@arcgis/components-build-utils').MiniPackageJson): string;
|
|
2
2
|
export declare const preambleToComment: (preamble: string) => string;
|
|
3
3
|
export declare const throwOnReadBeforeSet: (createdDuring: string) => PropertyDecorator;
|
|
4
4
|
export declare function normalizeDocumentationFileName(fileName: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DependencyInjectionMode, DependencyInjectionResult } from './utils';
|
|
2
2
|
export declare const hasCore: boolean;
|
|
3
3
|
/**
|
|
4
4
|
* Thanks to Vite's dependency pre-bundling, we do not have to use the CDN
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Package } from 'custom-elements-manifest/schema';
|
|
2
|
+
import { ModulePath } from '../extractor/helpers/resolveType';
|
|
3
|
+
import { WebTypes } from '../docs/webTypes/types';
|
|
4
4
|
export type ResolvedDependencyComponents = {
|
|
5
5
|
readonly packageName: string;
|
|
6
6
|
readonly type: "@arcgis/lumina" | "stencil" | "unknown";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { IndexHtmlTransformContext, Plugin } from 'vite';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
export declare const doLoadersApply: (context: CompilerContext, htmlContext?: IndexHtmlTransformContext) => boolean;
|
|
4
4
|
/**
|
|
5
5
|
* In serve mode, augment index.html by adding the necessary script tags for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { CompilerContext } from '../context';
|
|
2
|
+
import { ResolvedDependencyComponents } from './discover';
|
|
3
|
+
import { DependencyInjectionResult } from './utils';
|
|
4
4
|
export declare function makeLoaders(context: CompilerContext): Promise<DependencyInjectionResult[]>;
|
|
5
5
|
export declare const silenceLitWarnings: {
|
|
6
6
|
optimizableImports: never[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DependencyInjectionMode, DependencyInjectionResult } from './utils';
|
|
2
2
|
export declare function makeStencilLoader(baseUrl: string, packageName: string, mode: DependencyInjectionMode, index: number): Promise<DependencyInjectionResult[]>;
|
|
3
3
|
export declare function findCdnFiles(distDirectory: string): Promise<{
|
|
4
4
|
readonly cdnName: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export declare function updateLuminaTs(dependencies: readonly ResolvedDependencyComponents[], srcDir: string, hasCore: boolean, browserProvider?: BrowserConfigOptions["provider"], packageJson?: import(
|
|
4
|
-
declare function produceLuminaTs(dependencies: readonly ResolvedDependencyComponents[], hasCore: boolean, browserProvider?: BrowserConfigOptions["provider"], packageJson?: import(
|
|
1
|
+
import { ResolvedDependencyComponents } from './discover';
|
|
2
|
+
import { BrowserConfigOptions } from 'vitest/node';
|
|
3
|
+
export declare function updateLuminaTs(dependencies: readonly ResolvedDependencyComponents[], srcDir: string, hasCore: boolean, browserProvider?: BrowserConfigOptions["provider"], packageJson?: import('@arcgis/components-build-utils').MiniPackageJson): Promise<boolean>;
|
|
4
|
+
declare function produceLuminaTs(dependencies: readonly ResolvedDependencyComponents[], hasCore: boolean, browserProvider?: BrowserConfigOptions["provider"], packageJson?: import('@arcgis/components-build-utils').MiniPackageJson): string;
|
|
5
5
|
export declare const exportsForTests: {
|
|
6
6
|
produceLuminaTs: typeof produceLuminaTs;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type DependencyInjectionMode = "
|
|
1
|
+
import { HtmlTagDescriptor } from 'vite';
|
|
2
|
+
export type DependencyInjectionMode = "cdn" | "lazyNpm";
|
|
3
3
|
export type DependencyInjectionResult = HtmlTagDescriptor | {
|
|
4
4
|
cssHref: string;
|
|
5
5
|
id?: string;
|
package/dist/docs/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DocsType } from './types';
|
|
2
2
|
export declare const defaultDocsFileNames: Record<DocsType, string>;
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { ComponentCompilerTypeReferences } from '@stencil/core/internal';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
|
+
import { ApiDocsTag } from '@arcgis/api-extractor';
|
|
4
4
|
/**
|
|
5
5
|
* To avoid having a dependency on Stencil, we inline Stencil types rather than
|
|
6
6
|
* importing them.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { VsCodeHtmlDocs, VsCodeCssDocs } from './types.js';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
3
3
|
/**
|
|
4
4
|
* Originally based on
|
|
5
5
|
* https://github.com/break-stuff/cem-tools/tree/main/packages/vs-code-integration
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { VsCodeTag } from './types';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
3
3
|
export declare const getTagList: (components: ApiCustomElementDeclaration[]) => VsCodeTag[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiClassMember, ApiCssCustomProperty, ApiCssPart, ApiCustomElementDeclaration, ApiEvent, ApiSlot } from '@arcgis/api-extractor';
|
|
2
2
|
export declare function getComponentDetailsTemplate(component: ApiCustomElementDeclaration): string;
|
|
3
3
|
export declare const getSlotsTemplate: (slots?: ApiSlot[]) => string;
|
|
4
4
|
export declare const getEventsTemplate: (events?: ApiEvent[]) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { WebTypesOptions, WebTypesElement, WebTypes } from './types';
|
|
2
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
3
3
|
/**
|
|
4
4
|
* Originally based on
|
|
5
5
|
* https://github.com/break-stuff/cem-tools/tree/main/packages/jet-brains-integration
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
|
+
import { WebTypesAttribute, WebTypesCssProperty, WebTypesPseudoElement } from './types';
|
|
3
3
|
export declare const getCssPropertyList: (components: ApiCustomElementDeclaration[]) => WebTypesCssProperty[];
|
|
4
4
|
export declare const getCssPartList: (components: ApiCustomElementDeclaration[]) => WebTypesPseudoElement[];
|
|
5
5
|
export declare const getComponentAttributes: (component: ApiCustomElementDeclaration) => WebTypesAttribute[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
/**
|
|
4
4
|
* When component is imported in a non-lazy-loading way, we need to make sure
|
|
5
5
|
* the component file has explicit import statements for all web component it
|
|
@@ -13,6 +13,7 @@ export type CustomElementInterdependencies = Record<string, {
|
|
|
13
13
|
* will be added to those components instead of this file.
|
|
14
14
|
*/
|
|
15
15
|
referencedTagNames: string[];
|
|
16
|
+
referencedDeferredTagNames: string[];
|
|
16
17
|
readonly referencedBy: string[];
|
|
17
18
|
}>;
|
|
18
19
|
export declare const defaultBrowserTestProvider = "playwright";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { path } from
|
|
3
|
-
import
|
|
1
|
+
import { DeclarationTextTransformer } from '../publicTypes';
|
|
2
|
+
import { path } from '@arcgis/components-build-utils';
|
|
3
|
+
import { CompilerContext } from '../context';
|
|
4
4
|
export declare const rewriteDtsComponentFileNames: DeclarationTextTransformer;
|
|
5
5
|
export declare const rePath: RegExp;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { JsxContext } from '../jsxToLitHtml/types';
|
|
3
3
|
/**
|
|
4
4
|
* Instead of adding imports to the component source file, take note of imports
|
|
5
5
|
* that need to be added and have addNonLazyImports() add them to component's
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ResolvedDependencyComponent } from '../dependencies/discover';
|
|
2
|
+
import { ModulePath } from '../extractor/helpers/resolveType';
|
|
3
|
+
import { CompilerContext } from '../context';
|
|
4
4
|
/**
|
|
5
5
|
* Automatically add imports as appropriate for all referenced internally defined
|
|
6
6
|
* and externally defined custom elements
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiJson, ApiModule } from '@arcgis/api-extractor';
|
|
3
3
|
export declare function findMember(component: Pick<ApiCustomElementDeclaration, "members" | "name">, memberNode: ts.AccessorDeclaration | ts.MethodDeclaration | ts.PropertyDeclaration): ApiClassMethod | ApiCustomElementField | undefined;
|
|
4
4
|
export declare function findApiModule(filePath: string, rootDir: string, apiJson: ApiJson): ApiModule | undefined;
|
|
@@ -1,41 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* In order to have TypeScript be aware of your custom elements, the following
|
|
3
|
-
* needs to be present inside the library:
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* declare global {
|
|
7
|
-
* interface DeclareElements {
|
|
8
|
-
* "arcgis-your-component": ArcgisYourComponent;
|
|
9
|
-
* }
|
|
10
|
-
* }
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* We can't simply add this at build time, as the above needs to be present
|
|
14
|
-
* when your IDE or the CI type-checks the project.
|
|
15
|
-
*
|
|
16
|
-
* While we could add the above in a central components.d.ts file like with
|
|
17
|
-
* Stencil, doing so may cause merge conflicts, would require having a compiler
|
|
18
|
-
* running in the background to regenerate components.d.ts on change, and can
|
|
19
|
-
* accidentally cause stale components.d.ts to be committed (if developer forgot
|
|
20
|
-
* to run the build process before committing)
|
|
21
|
-
*
|
|
22
|
-
* So instead, we will add "declare global" inside of each component file.
|
|
23
|
-
*
|
|
24
|
-
* To minimize boilerplate, we are going to auto-add the `@customElement()`
|
|
25
|
-
* decorator at build time since the "declare global" structure above has
|
|
26
|
-
* the necessary information (the tag name and the class name), and since
|
|
27
|
-
* decorators don't affect the runtime behavior of the component.
|
|
28
|
-
*
|
|
29
|
-
* While "declare global" is helpful for type checking the project itself,
|
|
30
|
-
* for external typings, we remove it and add component declarations in
|
|
31
|
-
* dist/index.d.ts file (along with event types and etc). This is to match
|
|
32
|
-
* Stencil's behavior in order to minimize breaking changes on migration to
|
|
33
|
-
* Lit.
|
|
34
|
-
*
|
|
35
|
-
* FEATURE: for usages in tests, allow `static override tagName = "te-st";` to define a component? and adapt transformers and plugins to look for nested components too when context.isInTest
|
|
36
|
-
*/
|
|
37
|
-
import type { FileTransformer } from "../publicTypes";
|
|
38
|
-
import type { DeclarationTextTransformer } from "../publicTypes";
|
|
1
|
+
import { FileTransformer, DeclarationTextTransformer } from '../publicTypes';
|
|
39
2
|
export declare const removeDeclarationFromDts: DeclarationTextTransformer;
|
|
40
3
|
export declare const addCustomElementDecoratorTransformer: FileTransformer;
|
|
41
4
|
export declare function findDeclaredComponents(code: string): readonly (readonly [string, string])[] | undefined;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import { ApiExtractor } from
|
|
3
|
-
import
|
|
4
|
-
import type { CompilerContext } from "../context";
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ApiExtractor, ApiAttribute, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiCustomElementMember, ApiDeclaration, ApiEvent, ApiExport, ApiJson, ApiModule, ApiReference } from '@arcgis/api-extractor';
|
|
3
|
+
import { CompilerContext } from '../context';
|
|
5
4
|
export declare class LuminaApiExtractor extends ApiExtractor {
|
|
6
5
|
context: CompilerContext;
|
|
7
6
|
protected isPathOnly: boolean;
|
|
8
7
|
constructor(context: CompilerContext, isPathOnly: boolean);
|
|
9
8
|
protected localCssImports?: Set<string>;
|
|
10
9
|
protected localDeclaredComponents: Map<string, string>;
|
|
11
|
-
protected
|
|
10
|
+
protected indexedComponents: Map<string, ApiCustomElementDeclaration>;
|
|
12
11
|
protected apiComponent: ApiCustomElementDeclaration;
|
|
13
12
|
protected pairedSetter: ts.SetAccessorDeclaration | undefined;
|
|
14
13
|
extract(files: readonly ts.SourceFile[]): ApiJson;
|
|
@@ -44,7 +43,7 @@ export declare class LuminaApiExtractor extends ApiExtractor {
|
|
|
44
43
|
* needs to be in a a file named like a component
|
|
45
44
|
* (src/components/name/name.tsx), even if it is not a standalone component.
|
|
46
45
|
*/
|
|
47
|
-
protected inheritMembers(component: ApiCustomElementDeclaration, modules: ApiModule[], existingMembers?: Set<string>, existingAttributes?: Set<string>, existingEvents?: Set<string>): void;
|
|
46
|
+
protected inheritMembers(component: ApiCustomElementDeclaration, modules: ApiModule[], superClass?: ApiReference, existingMembers?: Set<string>, existingAttributes?: Set<string>, existingEvents?: Set<string>): void;
|
|
48
47
|
private _resolvedInheritance;
|
|
49
48
|
/**
|
|
50
49
|
* Based on the superclass name, find the actual declaration in the modules.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ApiEvent } from '@arcgis/api-extractor';
|
|
3
|
+
import { CompilerContext } from '../../context';
|
|
4
4
|
/**
|
|
5
5
|
* If property is an event emitter, extract event payload type and event name.
|
|
6
6
|
* Even name is derived by converting property name to kebab-case.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ApiCustomElementDeclaration, ApiCustomElementField, ApiDocsTag } from '@arcgis/api-extractor';
|
|
3
3
|
export declare function symbolToDocs(checker: ts.TypeChecker, symbol: ts.Signature | ts.Symbol): {
|
|
4
4
|
description: ApiCustomElementField["description"];
|
|
5
5
|
docsTags: ApiDocsTag[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ContextDirectories } from '../../context/types';
|
|
3
|
+
import { ApiClassMethod } from '@arcgis/api-extractor';
|
|
4
4
|
export declare function extractComponentMethodDetails(node: ts.MethodDeclaration, method: ApiClassMethod, checker: ts.TypeChecker, sourceFile: ts.SourceFile, dirs: ContextDirectories): void;
|
|
5
5
|
/**
|
|
6
6
|
* Inspired by https://github.com/bennypowers/cem-plugins/blob/main/plugins/cem-plugin-async-function/index.js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ApiType, ApiTypeReference } from '@arcgis/api-extractor';
|
|
3
|
+
import { CompilerContext } from '../../context';
|
|
4
4
|
export declare const getComplexPropertyType: (context: CompilerContext, typeContainerNode: ts.AccessorDeclaration | ts.PropertyDeclaration, isRequired: boolean, sourceFile: ts.SourceFile) => ApiType;
|
|
5
5
|
/**
|
|
6
6
|
* Associate a start and end index with each type reference. Drop unresolved
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ts from
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { default as ts } from 'typescript';
|
|
2
|
+
import { ContextDirectories } from '../../context/types';
|
|
3
|
+
import { ApiType } from '@arcgis/api-extractor';
|
|
4
4
|
export declare const addPropMetadataPluginName = "@arcgis/lumina:addPropMetadata";
|
|
5
5
|
export declare function resolveType(checker: ts.TypeChecker, type: ts.Type, sourceFile: ts.SourceFile, dirs: ContextDirectories, stripNullish?: boolean): ApiType;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ts from
|
|
1
|
+
import { ApiValue } from '@arcgis/api-extractor';
|
|
2
|
+
import { default as ts } from 'typescript';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a type annotation, using the TypeScript typechecker to convert a
|
|
5
5
|
* {@link ts.Type} record to a string.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { CompilerContext } from '../context';
|
|
2
|
+
import { ApiCustomElementDeclaration, ApiJson } from '@arcgis/api-extractor';
|
|
3
3
|
/**
|
|
4
4
|
* Build the complete api.json, either once during build, or in serve mode if
|
|
5
5
|
* full-reload is needed.
|
|
@@ -9,4 +9,4 @@ export declare function buildApiJson(context: CompilerContext, isFirstGenerate:
|
|
|
9
9
|
* Update the api.json for a single file on hot reload
|
|
10
10
|
*/
|
|
11
11
|
export declare function patchApiJson(context: CompilerContext, fileName: string, code: string): ApiCustomElementDeclaration[] | undefined;
|
|
12
|
-
export declare function postProcessComponent(component: ApiCustomElementDeclaration, context: CompilerContext,
|
|
12
|
+
export declare function postProcessComponent(component: ApiCustomElementDeclaration, context: CompilerContext, indexedComponents: Map<string, ApiCustomElementDeclaration>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
2
|
/**
|
|
3
3
|
* @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
|
|
4
4
|
* @see https://github.com/preactjs/preact/pull/1448/files
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
2
|
/**
|
|
3
3
|
* @see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript
|
|
4
4
|
* @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ApiCustomElementMember } from '@arcgis/api-extractor';
|
|
2
|
+
import { CompilerContext } from '../context';
|
|
3
3
|
/** Generate a string for importing component types */
|
|
4
4
|
export declare const generateComponentTypeImports: (context: CompilerContext) => string;
|
|
5
5
|
export declare const isPropertyEscapeNeeded: (name: string) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
|
|
2
2
|
/** Add component types for HTML */
|
|
3
3
|
export declare const addComponentTypes: (components: ApiCustomElementDeclaration[], indexTsCode: string, typeImports: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { initializeComponentDependencies } from './dependencies/discover';
|
|
2
|
+
import { updateLuminaTs } from './dependencies/updateLumina';
|
|
3
|
+
import { findDeclaredComponents } from './extractor/declaration';
|
|
4
|
+
export { useLumina } from './useLumina';
|
|
5
|
+
export type * from './publicTypes';
|
|
6
|
+
export { inferCdnUrl } from './defaultAssetsUrl';
|
|
7
|
+
export type { CompilerContext } from './context';
|
|
8
|
+
export { LuminaApiExtractor } from './extractor/extractor';
|
|
9
9
|
/**
|
|
10
10
|
* These are exposed only for usage by the @arcgis/stencil-to-lumina codemod
|
|
11
11
|
*
|
|
@@ -15,8 +15,8 @@ export declare const exportsForCodemod: {
|
|
|
15
15
|
initializeComponentDependencies: typeof initializeComponentDependencies;
|
|
16
16
|
updateLuminaTs: typeof updateLuminaTs;
|
|
17
17
|
propertyToAttributeMappings: {
|
|
18
|
-
readonly common: Required<import(
|
|
19
|
-
readonly perElement: Record<string, import(
|
|
18
|
+
readonly common: Required<import('./jsxToLitHtml/config').ElementPropertyToAttributeMappings>;
|
|
19
|
+
readonly perElement: Record<string, import('./jsxToLitHtml/config').ElementPropertyToAttributeMappings | undefined>;
|
|
20
20
|
};
|
|
21
21
|
findDeclaredComponents: typeof findDeclaredComponents;
|
|
22
22
|
nativeEvents: Set<string>;
|