@arcgis/lumina-compiler 4.33.0-next.15 → 4.33.0-next.151
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 +25 -25
- package/dist/context/logger.d.ts +8 -0
- 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 +5 -4
- package/dist/dependencies/index.d.ts +2 -2
- package/dist/dependencies/loaders.d.ts +3 -7
- package/dist/dependencies/lumina.d.ts +3 -0
- package/dist/dependencies/stencil.d.ts +3 -2
- package/dist/dependencies/testSetupFiles.d.ts +1 -9
- 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 +7 -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 +6 -5
- package/dist/extractor/helpers/cssDoc.d.ts +1 -1
- package/dist/extractor/helpers/event.d.ts +3 -3
- 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/extractor/parseStoryFiles.d.ts +2 -0
- 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 +11 -11
- package/dist/index.js +6889 -110
- package/dist/jsxToLitHtml/autoAddNothing.d.ts +2 -2
- package/dist/jsxToLitHtml/comments.d.ts +4 -4
- package/dist/jsxToLitHtml/config.d.ts +1 -1
- package/dist/jsxToLitHtml/convertProps.d.ts +5 -6
- package/dist/jsxToLitHtml/imports.d.ts +2 -3
- 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/logger-KpGU2b3R.js +28 -0
- package/dist/plugins/buildCdn.d.ts +56 -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 +5 -5
- 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 +4 -4
- package/dist/publicTypes.d.ts +89 -30
- 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 +1134 -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 +152 -24
- package/dist/testing/mount.d.ts +9 -2
- package/dist/testing/wrapController.d.ts +2 -3
- package/dist/tests/utils.d.ts +3 -3
- 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/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 +14 -13
- 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/jsDoc.d.ts +0 -11
- 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/types/failOnJsonImport.d.ts +0 -2
package/dist/context/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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 { parseStoryFiles } from '../extractor/parseStoryFiles';
|
|
10
|
+
import { CustomElementInterdependencies } from '../entrypoints/config';
|
|
11
|
+
import { getCompilerOptionsForPrinter } from '../transformers';
|
|
12
|
+
import { getPrinter } from '../transformers/internalTypeScriptApis';
|
|
13
|
+
import { getLocalDefinedComponentsFromApiJson } from '../entrypoints/resolveTagName';
|
|
14
|
+
import { Deferred } from '@arcgis/components-utils';
|
|
14
15
|
export declare class CompilerContext {
|
|
15
16
|
/**
|
|
16
17
|
* The path to the resolved TypeScript configuration
|
|
@@ -250,7 +251,14 @@ export declare class CompilerContext {
|
|
|
250
251
|
* A promise that resolves to list of file names that declare one or more
|
|
251
252
|
* components
|
|
252
253
|
*/
|
|
253
|
-
componentFilesPromise: Promise<
|
|
254
|
+
componentFilesPromise: Promise<typeof this.componentFiles>;
|
|
255
|
+
/**
|
|
256
|
+
* A list of file names that declare one or more components
|
|
257
|
+
*/
|
|
258
|
+
componentFiles: string[];
|
|
259
|
+
componentStoryFiles: string[];
|
|
260
|
+
componentStoriesPromise?: Promise<void>;
|
|
261
|
+
componentStories?: Awaited<ReturnType<typeof parseStoryFiles>>;
|
|
254
262
|
/**
|
|
255
263
|
* Style for hiding custom elements before they are loaded. This is appended
|
|
256
264
|
* to the global stylesheet.
|
|
@@ -264,10 +272,6 @@ export declare class CompilerContext {
|
|
|
264
272
|
* @private
|
|
265
273
|
*/
|
|
266
274
|
_globalCssString?: string;
|
|
267
|
-
/**
|
|
268
|
-
* A list of file names that declare one or more components
|
|
269
|
-
*/
|
|
270
|
-
componentFiles: string[];
|
|
271
275
|
/**
|
|
272
276
|
* Cached result of makeLoaders() call
|
|
273
277
|
*
|
|
@@ -311,19 +315,14 @@ export declare class CompilerContext {
|
|
|
311
315
|
regex: RegExp;
|
|
312
316
|
replacements: Record<string, string>;
|
|
313
317
|
};
|
|
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
318
|
private _silencedRules;
|
|
322
319
|
/**
|
|
323
320
|
* Promise that resolves once src/lumina.ts is updated
|
|
324
321
|
* @private
|
|
325
322
|
*/
|
|
326
323
|
_updateLuminaTsPromise?: Promise<void>;
|
|
324
|
+
normalizedDocumentationUrl: string;
|
|
325
|
+
alternativeDocumentationUrl: string;
|
|
327
326
|
constructor(options: LuminaOptions);
|
|
328
327
|
private _inferBuildSetup;
|
|
329
328
|
/**
|
|
@@ -360,5 +359,6 @@ export declare class CompilerContext {
|
|
|
360
359
|
* ```
|
|
361
360
|
*/
|
|
362
361
|
provideAssets(assets: AssetSpec[], transformers?: AssetTransformer[], apply?: CompilerContext["viteCommand"]): void;
|
|
362
|
+
logLintWarning(error: string): void;
|
|
363
363
|
logLintError(rule: keyof LintingOptions["silence"], absoluteFilePath: string, error: string): void;
|
|
364
364
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createLogger } from 'vite';
|
|
2
|
+
export declare const logger: {
|
|
3
|
+
initialize(logger: ReturnType<typeof createLogger>, root: string): void;
|
|
4
|
+
info(scope: string, message: string, file?: string): void;
|
|
5
|
+
warn(scope: string, message: string, file?: string): void;
|
|
6
|
+
error(scope: string, message: string, file?: string): void;
|
|
7
|
+
};
|
|
8
|
+
export declare function formatError<T extends Error | string>(scope: string, messageOrError: T, file?: string): T;
|
|
@@ -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,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ModulePath } from '../extractor/helpers/resolveType';
|
|
2
|
+
import { WebTypes } from '../docs/webTypes/types';
|
|
3
|
+
import { ApiJson } from '@arcgis/api-extractor';
|
|
4
4
|
export type ResolvedDependencyComponents = {
|
|
5
5
|
readonly packageName: string;
|
|
6
6
|
readonly type: "@arcgis/lumina" | "stencil" | "unknown";
|
|
7
7
|
readonly components: Readonly<Record<string, ResolvedDependencyComponent>>;
|
|
8
|
+
readonly cdnUrl?: string;
|
|
8
9
|
};
|
|
9
10
|
export type ResolvedDependencyComponent = ModulePath & {
|
|
10
11
|
/**
|
|
@@ -52,7 +53,7 @@ export declare function findPackageComponents(packageName: string, cwd?: string)
|
|
|
52
53
|
/**
|
|
53
54
|
* Given the custom element manifest, find custom elements defined in it
|
|
54
55
|
*/
|
|
55
|
-
export declare function manifestToDependencyComponents(manifest:
|
|
56
|
+
export declare function manifestToDependencyComponents(manifest: Partial<ApiJson>, dependency: Omit<ModulePath, "moduleName"> & {
|
|
56
57
|
readonly getImportPath: (tagName: string) => string;
|
|
57
58
|
}): ResolvedDependencyComponents["components"];
|
|
58
59
|
export declare const webTypesToDependencyComponents: (webTypes: Partial<WebTypes>, dependency: Omit<ModulePath, "moduleName"> & {
|
|
@@ -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,9 +1,5 @@
|
|
|
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
|
-
export declare const silenceLitWarnings: {
|
|
6
|
-
optimizableImports: never[];
|
|
7
|
-
javascriptCode: string[];
|
|
8
|
-
};
|
|
9
5
|
export declare function computeServeOnlyDependencies(context: CompilerContext): Promise<readonly ResolvedDependencyComponents[]>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DependencyInjectionMode, DependencyInjectionResult } from './utils';
|
|
2
|
+
import { ResolvedDependencyComponents } from './discover';
|
|
3
|
+
export declare function makeLuminaLoader(baseUrl: string, dependency: ResolvedDependencyComponents, mode: DependencyInjectionMode, index: number): Promise<DependencyInjectionResult>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DependencyInjectionMode, DependencyInjectionResult } from './utils';
|
|
2
|
+
import { ResolvedDependencyComponents } from './discover';
|
|
3
|
+
export declare function makeStencilLoader(baseUrl: string, dependency: ResolvedDependencyComponents, mode: DependencyInjectionMode, index: number): Promise<DependencyInjectionResult[]>;
|
|
3
4
|
export declare function findCdnFiles(distDirectory: string): Promise<{
|
|
4
5
|
readonly cdnName: string;
|
|
5
6
|
readonly hasCss: boolean;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const testLitSetupFileName = "/@arcgis/lumina-compiler/testLitSetupFile";
|
|
3
|
-
/**
|
|
4
|
-
* For browser tests, this file lazy-loads all dependencies, and then the
|
|
5
|
-
* current package itself.
|
|
6
|
-
* It also does misc test setup logic (mocking console, setting timeouts,
|
|
7
|
-
* etc).
|
|
8
|
-
*/
|
|
1
|
+
import { CompilerContext } from '../context';
|
|
9
2
|
export declare const testSetupFileName = "/@arcgis/lumina-compiler/testSetupFile";
|
|
10
3
|
export declare const testSetupFileNames: string[];
|
|
11
|
-
export declare const litTestSetupFileContent: string;
|
|
12
4
|
/**
|
|
13
5
|
* Get the entrypoint code for lazy-loading all components and their
|
|
14
6
|
* dependencies when running a web component test in the browser.
|
|
@@ -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,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { type ApiDocsTag } from "@arcgis/api-extractor";
|
|
1
|
+
import { CompilerContext } from '../context';
|
|
2
|
+
import { ApiDocsTag } from '@arcgis/api-extractor';
|
|
4
3
|
/**
|
|
5
4
|
* To avoid having a dependency on Stencil, we inline Stencil types rather than
|
|
6
5
|
* importing them.
|
|
@@ -68,6 +67,11 @@ interface ComponentCompilerMethodComplexType {
|
|
|
68
67
|
references: ComponentCompilerTypeReferences;
|
|
69
68
|
return: string;
|
|
70
69
|
}
|
|
70
|
+
type ComponentCompilerTypeReferences = Record<string, {
|
|
71
|
+
location: "global" | "import" | "local";
|
|
72
|
+
path?: string;
|
|
73
|
+
id: string;
|
|
74
|
+
}>;
|
|
71
75
|
interface JsonDocsMethod {
|
|
72
76
|
name: string;
|
|
73
77
|
docs: string;
|
|
@@ -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,16 +1,16 @@
|
|
|
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, CopyDocDefinitions } 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;
|
|
13
|
+
protected copyDocDefinitions: CopyDocDefinitions | undefined;
|
|
14
14
|
extract(files: readonly ts.SourceFile[]): ApiJson;
|
|
15
15
|
protected extractModules(files: readonly ts.SourceFile[]): ApiModule[];
|
|
16
16
|
protected extractDeclarations(module: ts.SourceFile): ApiDeclaration[];
|
|
@@ -28,6 +28,7 @@ export declare class LuminaApiExtractor extends ApiExtractor {
|
|
|
28
28
|
* When doing full API extraction, extract additional details for a field.
|
|
29
29
|
*/
|
|
30
30
|
protected extractComponentFieldDetails(node: ts.AccessorDeclaration | ts.PropertyDeclaration, property: ApiCustomElementField): void;
|
|
31
|
+
static loggedBooleanWarning: boolean;
|
|
31
32
|
/**
|
|
32
33
|
* Find the properties given to the `@property()` decorator.
|
|
33
34
|
*/
|
|
@@ -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,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;
|