@arcgis/lumina-compiler 4.33.0-next.13 → 4.33.0-next.133

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.
Files changed (143) hide show
  1. package/dist/context/index.d.ts +23 -25
  2. package/dist/context/logger.d.ts +8 -0
  3. package/dist/context/typeScript.d.ts +2 -2
  4. package/dist/context/utils.d.ts +1 -1
  5. package/dist/dependencies/arcgisCore.d.ts +1 -1
  6. package/dist/dependencies/discover.d.ts +5 -4
  7. package/dist/dependencies/index.d.ts +2 -2
  8. package/dist/dependencies/loaders.d.ts +3 -7
  9. package/dist/dependencies/lumina.d.ts +3 -0
  10. package/dist/dependencies/stencil.d.ts +3 -2
  11. package/dist/dependencies/testSetupFiles.d.ts +1 -9
  12. package/dist/dependencies/updateLumina.d.ts +4 -4
  13. package/dist/dependencies/utils.d.ts +2 -2
  14. package/dist/docs/config.d.ts +1 -1
  15. package/dist/docs/index.d.ts +2 -2
  16. package/dist/docs/stencilDocsJson.d.ts +7 -3
  17. package/dist/docs/vsCodeCustomData/index.d.ts +2 -2
  18. package/dist/docs/vsCodeCustomData/utils.d.ts +2 -2
  19. package/dist/docs/webTypes/description.d.ts +1 -1
  20. package/dist/docs/webTypes/index.d.ts +2 -2
  21. package/dist/docs/webTypes/utils.d.ts +2 -2
  22. package/dist/entrypoints/addNonLazyImports.d.ts +2 -2
  23. package/dist/entrypoints/config.d.ts +1 -0
  24. package/dist/entrypoints/dtsUtils.d.ts +3 -3
  25. package/dist/entrypoints/findUtils.d.ts +1 -1
  26. package/dist/entrypoints/handleComponentImports.d.ts +2 -2
  27. package/dist/entrypoints/pathMapping.d.ts +1 -1
  28. package/dist/entrypoints/resolveTagName.d.ts +3 -3
  29. package/dist/extractor/apiJsonUtils.d.ts +2 -2
  30. package/dist/extractor/declaration.d.ts +1 -38
  31. package/dist/extractor/extractor.d.ts +8 -5
  32. package/dist/extractor/helpers/cssDoc.d.ts +1 -1
  33. package/dist/extractor/helpers/event.d.ts +3 -3
  34. package/dist/extractor/helpers/method.d.ts +3 -3
  35. package/dist/extractor/helpers/property.d.ts +3 -3
  36. package/dist/extractor/helpers/resolveType.d.ts +3 -3
  37. package/dist/extractor/helpers/typeValue.d.ts +2 -2
  38. package/dist/extractor/index.d.ts +3 -3
  39. package/dist/extractor/parseStoryFiles.d.ts +2 -0
  40. package/dist/frameworkTypes/index.d.ts +2 -2
  41. package/dist/frameworkTypes/lumina.d.ts +1 -1
  42. package/dist/frameworkTypes/preact.d.ts +1 -1
  43. package/dist/frameworkTypes/react.d.ts +1 -1
  44. package/dist/frameworkTypes/stencil.d.ts +1 -1
  45. package/dist/frameworkTypes/utils.d.ts +2 -2
  46. package/dist/frameworkTypes/vanilla.d.ts +1 -1
  47. package/dist/index.d.ts +11 -11
  48. package/dist/index.js +6848 -110
  49. package/dist/jsxToLitHtml/autoAddNothing.d.ts +2 -2
  50. package/dist/jsxToLitHtml/comments.d.ts +4 -4
  51. package/dist/jsxToLitHtml/config.d.ts +1 -1
  52. package/dist/jsxToLitHtml/convertProps.d.ts +5 -6
  53. package/dist/jsxToLitHtml/imports.d.ts +2 -2
  54. package/dist/jsxToLitHtml/index.d.ts +1 -1
  55. package/dist/jsxToLitHtml/inferPropType.d.ts +3 -3
  56. package/dist/jsxToLitHtml/insertRepeatCall.d.ts +2 -2
  57. package/dist/jsxToLitHtml/jsxVisitor.d.ts +3 -4
  58. package/dist/jsxToLitHtml/templateParts.d.ts +2 -2
  59. package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +1 -1
  60. package/dist/jsxToLitHtml/types.d.ts +5 -4
  61. package/dist/jsxToLitHtml/utils.d.ts +1 -0
  62. package/dist/loader/hideUntilHydrated.d.ts +1 -1
  63. package/dist/loader/index.d.ts +2 -2
  64. package/dist/loader/lazy.d.ts +3 -3
  65. package/dist/loader/storybookApiJson.d.ts +1 -1
  66. package/dist/logger-KpGU2b3R.js +28 -0
  67. package/dist/plugins/buildCdn.d.ts +60 -6
  68. package/dist/plugins/buildStencilHydrate.d.ts +2 -2
  69. package/dist/plugins/buildWebApp.d.ts +3 -0
  70. package/dist/plugins/buildWrappers.d.ts +2 -2
  71. package/dist/plugins/configureVite.d.ts +5 -5
  72. package/dist/plugins/externalizeDependencies.d.ts +2 -6
  73. package/dist/plugins/handleDynamicAssets.d.ts +2 -2
  74. package/dist/plugins/handleStaticAssets.d.ts +2 -2
  75. package/dist/plugins/loadLitCss.d.ts +2 -6
  76. package/dist/plugins/printTotalBuildSize.d.ts +2 -2
  77. package/dist/plugins/provideAssets.d.ts +3 -20
  78. package/dist/plugins/setAssetsPath.d.ts +2 -2
  79. package/dist/plugins/updatePackageJson.d.ts +4 -4
  80. package/dist/publicTypes.d.ts +77 -30
  81. package/dist/puppeteerTesting/globalSetup.d.ts +2 -2
  82. package/dist/puppeteerTesting/globalSetup.js +105 -2
  83. package/dist/puppeteerTesting/index.d.ts +7 -8
  84. package/dist/puppeteerTesting/index.js +1134 -5
  85. package/dist/puppeteerTesting/injected.d.ts +1 -1
  86. package/dist/puppeteerTesting/puppeteer/browser.d.ts +1 -1
  87. package/dist/puppeteerTesting/puppeteer/element.d.ts +3 -3
  88. package/dist/puppeteerTesting/puppeteer/events.d.ts +2 -2
  89. package/dist/puppeteerTesting/puppeteer/page.d.ts +1 -1
  90. package/dist/puppeteerTesting/puppeteer/types.d.ts +3 -3
  91. package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +1 -1
  92. package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +1 -1
  93. package/dist/puppeteerTesting/vitest/matchers/events.d.ts +1 -1
  94. package/dist/puppeteerTesting/vitest/matchers/index.d.ts +13 -13
  95. package/dist/puppeteerTesting/vitest/matchers/text.d.ts +1 -1
  96. package/dist/puppeteerTesting/vitest/runner.d.ts +3 -3
  97. package/dist/puppeteerTesting/vitest/runner.js +50 -1
  98. package/dist/puppeteerTesting/vitest/types.d.ts +1 -1
  99. package/dist/testing/index.d.ts +4 -4
  100. package/dist/testing/index.js +152 -24
  101. package/dist/testing/mount.d.ts +9 -2
  102. package/dist/testing/wrapController.d.ts +2 -3
  103. package/dist/tests/utils.d.ts +3 -3
  104. package/dist/transformers/index.d.ts +3 -3
  105. package/dist/transformers/injectRuntimeOptions.d.ts +2 -2
  106. package/dist/transformers/internalTypeScriptApis.d.ts +2 -2
  107. package/dist/transformers/liftDecorators.d.ts +1 -1
  108. package/dist/transformers/members.d.ts +2 -2
  109. package/dist/transformers/property.d.ts +4 -4
  110. package/dist/transformers/propertyOptions.d.ts +5 -5
  111. package/dist/transformers/utils.d.ts +3 -3
  112. package/dist/types/astTransformers.d.ts +2 -2
  113. package/dist/types/hideInternalLitElement.d.ts +1 -1
  114. package/dist/types/index.d.ts +2 -2
  115. package/dist/types/liftSetterTypes.d.ts +2 -3
  116. package/dist/types/textTransformers.d.ts +2 -2
  117. package/dist/types/transformComponentMembers.d.ts +1 -1
  118. package/dist/types-C3YmWTVv.js +13 -0
  119. package/dist/useLumina.d.ts +1 -1
  120. package/package.json +14 -13
  121. package/dist/chunk-6XNX5V4L.js +0 -1
  122. package/dist/chunk-JFKSI6I7.js +0 -1
  123. package/dist/context/typeScript.spec.d.ts +0 -1
  124. package/dist/context/utils.spec.d.ts +0 -1
  125. package/dist/defaultAssetsUrl.spec.d.ts +0 -1
  126. package/dist/dependencies/lit.d.ts +0 -2
  127. package/dist/dependencies/updateLumina.spec.d.ts +0 -1
  128. package/dist/docs/steniclDocsJson.test.d.ts +0 -1
  129. package/dist/entrypoints/dtsUtils.spec.d.ts +0 -1
  130. package/dist/entrypoints/findUtils.spec.d.ts +0 -1
  131. package/dist/entrypoints/resolveTagName.spec.d.ts +0 -1
  132. package/dist/extractor/declaration.spec.d.ts +0 -1
  133. package/dist/extractor/helpers/cssDoc.spec.d.ts +0 -1
  134. package/dist/extractor/helpers/jsDoc.d.ts +0 -11
  135. package/dist/extractor/helpers/resolveType.spec.d.ts +0 -1
  136. package/dist/extractor/helpers/typeValue.spec.d.ts +0 -1
  137. package/dist/jsxToLitHtml/utils.spec.d.ts +0 -1
  138. package/dist/loader/lazy.spec.d.ts +0 -1
  139. package/dist/plugins/buildCdn.spec.d.ts +0 -1
  140. package/dist/plugins/externalizeDependencies.spec.d.ts +0 -1
  141. package/dist/plugins/provideAssets.spec.d.ts +0 -1
  142. package/dist/plugins/updatePackageJson.spec.d.ts +0 -1
  143. package/dist/types/failOnJsonImport.d.ts +0 -2
@@ -1,16 +1,17 @@
1
- import type { ConfigEnv, Plugin, ResolvedConfig, ViteDevServer } from "vite";
2
- import ts from "typescript";
3
- import type { ApiCssCustomProperty, ApiCustomElementDeclaration, ApiJson } from "@arcgis/api-extractor";
4
- import type { LuminaOptions, AssetSpec, AssetTransformer, DeclarationTextTransformer, ProvideAssetsOptions, LintingOptions } from "../publicTypes";
5
- import type { ComponentPathMapping } from "../entrypoints/pathMapping";
6
- import type { DocsType } from "../docs/types";
7
- import type { ContextDirectories } from "./types";
8
- import { makeLoaders, type computeServeOnlyDependencies } from "../dependencies/loaders";
9
- import type { CustomElementInterdependencies } from "../entrypoints/config";
10
- import type { getCompilerOptionsForPrinter } from "../transformers";
11
- import type { getPrinter } from "../transformers/internalTypeScriptApis";
12
- import type { getLocalDefinedComponentsFromApiJson } from "../entrypoints/resolveTagName";
13
- import type { Deferred } from "@arcgis/components-utils";
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<string[]>;
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,13 +315,6 @@ 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
@@ -360,5 +357,6 @@ export declare class CompilerContext {
360
357
  * ```
361
358
  */
362
359
  provideAssets(assets: AssetSpec[], transformers?: AssetTransformer[], apply?: CompilerContext["viteCommand"]): void;
360
+ logLintWarning(error: string): void;
363
361
  logLintError(rule: keyof LintingOptions["silence"], absoluteFilePath: string, error: string): void;
364
362
  }
@@ -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 "typescript";
2
- import type { CompilerContext } from ".";
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
@@ -1,4 +1,4 @@
1
- export declare function inferPreamble(packageJson?: import("@arcgis/components-build-utils").MiniPackageJson): string;
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 { type DependencyInjectionMode, type DependencyInjectionResult } from "./utils";
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 type { Package } from "custom-elements-manifest/schema";
2
- import type { ModulePath } from "../extractor/helpers/resolveType";
3
- import type { WebTypes } from "../docs/webTypes/types";
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: Package, dependency: Omit<ModulePath, "moduleName"> & {
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 type { IndexHtmlTransformContext, Plugin } from "vite";
2
- import type { CompilerContext } from "../context";
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 type { CompilerContext } from "../context";
2
- import { type ResolvedDependencyComponents } from "./discover";
3
- import type { DependencyInjectionResult } from "./utils";
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 { type DependencyInjectionMode, type DependencyInjectionResult } from "./utils";
2
- export declare function makeStencilLoader(baseUrl: string, packageName: string, mode: DependencyInjectionMode, index: number): Promise<DependencyInjectionResult[]>;
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 type { CompilerContext } from "../context";
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 type { ResolvedDependencyComponents } from "./discover";
2
- import type { 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;
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 type { HtmlTagDescriptor } from "vite";
2
- export type DependencyInjectionMode = "lazy" | "storybookBuild";
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;
@@ -1,2 +1,2 @@
1
- import type { DocsType } from "./types";
1
+ import { DocsType } from './types';
2
2
  export declare const defaultDocsFileNames: Record<DocsType, string>;
@@ -1,5 +1,5 @@
1
- import type { CompilerContext } from "../context";
2
- import type { Plugin } from "vite";
1
+ import { CompilerContext } from '../context';
2
+ import { Plugin } from 'vite';
3
3
  /**
4
4
  * Generate JSON component metadata in 4 formats ()
5
5
  * - community standard
@@ -1,6 +1,5 @@
1
- import type { ComponentCompilerTypeReferences } from "@stencil/core/internal";
2
- import type { CompilerContext } from "../context";
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 type { VsCodeHtmlDocs, VsCodeCssDocs } from "./types.js";
2
- import type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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 type { VsCodeTag } from "./types";
2
- import { type ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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 { type ApiClassMember, type ApiCssCustomProperty, type ApiCssPart, type ApiCustomElementDeclaration, type ApiEvent, type ApiSlot } from "@arcgis/api-extractor";
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 type { WebTypesOptions, WebTypesElement, WebTypes } from "./types";
2
- import { type ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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 type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
2
- import type { WebTypesAttribute, WebTypesCssProperty, WebTypesPseudoElement } from "./types";
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 type { Plugin } from "vite";
2
- import type { CompilerContext } from "../context";
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 type { DeclarationTextTransformer } from "../publicTypes";
2
- import { path } from "@arcgis/components-build-utils";
3
- import type { CompilerContext } from "../context";
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,4 +1,4 @@
1
- import type { CompilerContext } from "../context";
1
+ import { CompilerContext } from '../context';
2
2
  /**
3
3
  * Create a separate entrypoint for each component to allow consuming
4
4
  * applications to only load the necessary code.
@@ -1,5 +1,5 @@
1
- import type ts from "typescript";
2
- import type { JsxContext } from "../jsxToLitHtml/types";
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,4 +1,4 @@
1
- import type { CompilerContext } from "../context";
1
+ import { CompilerContext } from '../context';
2
2
  /**
3
3
  * A mapping between a path to a component folder in src/components and it's
4
4
  * tag name.
@@ -1,6 +1,6 @@
1
- import type { ResolvedDependencyComponent } from "../dependencies/discover";
2
- import type { ModulePath } from "../extractor/helpers/resolveType";
3
- import type { CompilerContext } from "../context";
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 type ts from "typescript";
2
- import type { ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiJson, ApiModule } from "@arcgis/api-extractor";
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,18 @@
1
- import ts from "typescript";
2
- import { ApiExtractor } from "@arcgis/api-extractor";
3
- import type { ApiAttribute, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiCustomElementMember, ApiDeclaration, ApiEvent, ApiExport, ApiJson, ApiModule, ApiReference } from "@arcgis/api-extractor";
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 componentHtmlTypes: Map<string, string>;
10
+ protected indexedComponents: Map<string, ApiCustomElementDeclaration>;
12
11
  protected apiComponent: ApiCustomElementDeclaration;
13
12
  protected pairedSetter: ts.SetAccessorDeclaration | undefined;
13
+ protected copyDocDefinitions: CopyDocDefinitions | undefined;
14
+ protected normalizedDocumentationUrl: string;
15
+ protected alternativeDocumentationUrl: string;
14
16
  extract(files: readonly ts.SourceFile[]): ApiJson;
15
17
  protected extractModules(files: readonly ts.SourceFile[]): ApiModule[];
16
18
  protected extractDeclarations(module: ts.SourceFile): ApiDeclaration[];
@@ -28,6 +30,7 @@ export declare class LuminaApiExtractor extends ApiExtractor {
28
30
  * When doing full API extraction, extract additional details for a field.
29
31
  */
30
32
  protected extractComponentFieldDetails(node: ts.AccessorDeclaration | ts.PropertyDeclaration, property: ApiCustomElementField): void;
33
+ static loggedBooleanWarning: boolean;
31
34
  /**
32
35
  * Find the properties given to the `@property()` decorator.
33
36
  */
@@ -1,4 +1,4 @@
1
- import type { ApiCssCustomProperty } from "@arcgis/api-extractor";
1
+ import { ApiCssCustomProperty } from '@arcgis/api-extractor';
2
2
  /**
3
3
  * Extract `@prop` doc tags from CSS text using the syntax matching Stencil.
4
4
  *
@@ -1,6 +1,6 @@
1
- import ts from "typescript";
2
- import type { ApiEvent } from "@arcgis/api-extractor";
3
- import type { CompilerContext } from "../../context";
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 "typescript";
2
- import type { ContextDirectories } from "../../context/types";
3
- import type { ApiClassMethod } from "@arcgis/api-extractor";
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 "typescript";
2
- import type { ApiType, ApiTypeReference } from "@arcgis/api-extractor";
3
- import type { CompilerContext } from "../../context";
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 "typescript";
2
- import type { ContextDirectories } from "../../context/types";
3
- import { type ApiType } from "@arcgis/api-extractor";
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 type { ApiValue } from "@arcgis/api-extractor";
2
- import ts from "typescript";
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 type { CompilerContext } from "../context";
2
- import type { ApiCustomElementDeclaration, ApiJson } from "@arcgis/api-extractor";
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, htmlTypeReplacements: Map<string, string>): void;
12
+ export declare function postProcessComponent(component: ApiCustomElementDeclaration, context: CompilerContext, indexedComponents: Map<string, ApiCustomElementDeclaration>, alternativeDocumentationUrl: string, normalizedDocumentationUrl: string): void;
@@ -0,0 +1,2 @@
1
+ import { ApiDemo } from '@arcgis/api-extractor';
2
+ export declare function parseStoryFiles(files: string[], publicStoryUrlPrefix: string): Promise<Map<string, ApiDemo[]>>;
@@ -1,5 +1,5 @@
1
- import type { CompilerContext } from "../context";
2
- import type { Plugin } from "vite";
1
+ import { CompilerContext } from '../context';
2
+ import { Plugin } from 'vite';
3
3
  /**
4
4
  * Generate component typings for vanilla JavaScript and JSX frameworks.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
1
+ import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
2
2
  /**
3
3
  * @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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 type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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,4 +1,4 @@
1
- import type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
1
+ import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
2
2
  /**
3
3
  * @see https://github.com/preactjs/preact/issues/1180#issuecomment-643681851
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { ApiCustomElementMember } from "@arcgis/api-extractor";
2
- import type { CompilerContext } from "../context";
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 type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
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;