@arcgis/lumina-compiler 4.33.0-next.12 → 4.33.0-next.121

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 (142) 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 -3
  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 -1
  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 +10 -10
  48. package/dist/index.js +6781 -110
  49. package/dist/jsxToLitHtml/autoAddNothing.d.ts +2 -2
  50. package/dist/jsxToLitHtml/comments.d.ts +4 -4
  51. package/dist/jsxToLitHtml/convertProps.d.ts +5 -6
  52. package/dist/jsxToLitHtml/imports.d.ts +2 -2
  53. package/dist/jsxToLitHtml/index.d.ts +1 -1
  54. package/dist/jsxToLitHtml/inferPropType.d.ts +3 -3
  55. package/dist/jsxToLitHtml/insertRepeatCall.d.ts +2 -2
  56. package/dist/jsxToLitHtml/jsxVisitor.d.ts +3 -4
  57. package/dist/jsxToLitHtml/templateParts.d.ts +2 -2
  58. package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +1 -1
  59. package/dist/jsxToLitHtml/types.d.ts +5 -4
  60. package/dist/jsxToLitHtml/utils.d.ts +1 -0
  61. package/dist/loader/hideUntilHydrated.d.ts +1 -1
  62. package/dist/loader/index.d.ts +2 -2
  63. package/dist/loader/lazy.d.ts +3 -3
  64. package/dist/loader/storybookApiJson.d.ts +1 -1
  65. package/dist/logger-KpGU2b3R.js +28 -0
  66. package/dist/plugins/buildCdn.d.ts +56 -6
  67. package/dist/plugins/buildStencilHydrate.d.ts +2 -2
  68. package/dist/plugins/buildWebApp.d.ts +3 -0
  69. package/dist/plugins/buildWrappers.d.ts +2 -2
  70. package/dist/plugins/configureVite.d.ts +5 -5
  71. package/dist/plugins/externalizeDependencies.d.ts +2 -6
  72. package/dist/plugins/handleDynamicAssets.d.ts +2 -2
  73. package/dist/plugins/handleStaticAssets.d.ts +2 -2
  74. package/dist/plugins/loadLitCss.d.ts +2 -6
  75. package/dist/plugins/printTotalBuildSize.d.ts +2 -2
  76. package/dist/plugins/provideAssets.d.ts +3 -20
  77. package/dist/plugins/setAssetsPath.d.ts +2 -2
  78. package/dist/plugins/updatePackageJson.d.ts +4 -4
  79. package/dist/publicTypes.d.ts +77 -30
  80. package/dist/puppeteerTesting/globalSetup.d.ts +2 -2
  81. package/dist/puppeteerTesting/globalSetup.js +105 -2
  82. package/dist/puppeteerTesting/index.d.ts +7 -8
  83. package/dist/puppeteerTesting/index.js +1134 -5
  84. package/dist/puppeteerTesting/injected.d.ts +1 -1
  85. package/dist/puppeteerTesting/puppeteer/browser.d.ts +1 -1
  86. package/dist/puppeteerTesting/puppeteer/element.d.ts +3 -3
  87. package/dist/puppeteerTesting/puppeteer/events.d.ts +2 -2
  88. package/dist/puppeteerTesting/puppeteer/page.d.ts +1 -1
  89. package/dist/puppeteerTesting/puppeteer/types.d.ts +3 -3
  90. package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +1 -1
  91. package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +1 -1
  92. package/dist/puppeteerTesting/vitest/matchers/events.d.ts +1 -1
  93. package/dist/puppeteerTesting/vitest/matchers/index.d.ts +13 -13
  94. package/dist/puppeteerTesting/vitest/matchers/text.d.ts +1 -1
  95. package/dist/puppeteerTesting/vitest/runner.d.ts +3 -3
  96. package/dist/puppeteerTesting/vitest/runner.js +50 -1
  97. package/dist/puppeteerTesting/vitest/types.d.ts +1 -1
  98. package/dist/testing/index.d.ts +4 -4
  99. package/dist/testing/index.js +146 -24
  100. package/dist/testing/mount.d.ts +9 -2
  101. package/dist/testing/wrapController.d.ts +2 -3
  102. package/dist/tests/utils.d.ts +3 -3
  103. package/dist/transformers/index.d.ts +3 -3
  104. package/dist/transformers/injectRuntimeOptions.d.ts +2 -2
  105. package/dist/transformers/internalTypeScriptApis.d.ts +2 -2
  106. package/dist/transformers/liftDecorators.d.ts +1 -1
  107. package/dist/transformers/members.d.ts +2 -2
  108. package/dist/transformers/property.d.ts +4 -4
  109. package/dist/transformers/propertyOptions.d.ts +5 -5
  110. package/dist/transformers/utils.d.ts +3 -3
  111. package/dist/types/astTransformers.d.ts +2 -2
  112. package/dist/types/hideInternalLitElement.d.ts +1 -1
  113. package/dist/types/index.d.ts +2 -2
  114. package/dist/types/liftSetterTypes.d.ts +2 -3
  115. package/dist/types/textTransformers.d.ts +2 -2
  116. package/dist/types/transformComponentMembers.d.ts +1 -1
  117. package/dist/types-C3YmWTVv.js +13 -0
  118. package/dist/useLumina.d.ts +1 -1
  119. package/package.json +14 -13
  120. package/dist/chunk-6XNX5V4L.js +0 -1
  121. package/dist/chunk-JFKSI6I7.js +0 -1
  122. package/dist/context/typeScript.spec.d.ts +0 -1
  123. package/dist/context/utils.spec.d.ts +0 -1
  124. package/dist/defaultAssetsUrl.spec.d.ts +0 -1
  125. package/dist/dependencies/lit.d.ts +0 -2
  126. package/dist/dependencies/updateLumina.spec.d.ts +0 -1
  127. package/dist/docs/steniclDocsJson.test.d.ts +0 -1
  128. package/dist/entrypoints/dtsUtils.spec.d.ts +0 -1
  129. package/dist/entrypoints/findUtils.spec.d.ts +0 -1
  130. package/dist/entrypoints/resolveTagName.spec.d.ts +0 -1
  131. package/dist/extractor/declaration.spec.d.ts +0 -1
  132. package/dist/extractor/helpers/cssDoc.spec.d.ts +0 -1
  133. package/dist/extractor/helpers/jsDoc.d.ts +0 -11
  134. package/dist/extractor/helpers/resolveType.spec.d.ts +0 -1
  135. package/dist/extractor/helpers/typeValue.spec.d.ts +0 -1
  136. package/dist/jsxToLitHtml/utils.spec.d.ts +0 -1
  137. package/dist/loader/lazy.spec.d.ts +0 -1
  138. package/dist/plugins/buildCdn.spec.d.ts +0 -1
  139. package/dist/plugins/externalizeDependencies.spec.d.ts +0 -1
  140. package/dist/plugins/provideAssets.spec.d.ts +0 -1
  141. package/dist/plugins/updatePackageJson.spec.d.ts +0 -1
  142. package/dist/types/failOnJsonImport.d.ts +0 -2
@@ -1,5 +1,5 @@
1
- import type { TemplatePart } from "./templateParts";
2
- import { type JsxContext } from "./types";
1
+ import { TemplatePart } from './templateParts';
2
+ import { JsxContext } from './types';
3
3
  /**
4
4
  * If JSX prop value could possibly be `undefined`, we add `?? nothing` to it.
5
5
  *
@@ -1,10 +1,10 @@
1
- import ts from "typescript";
2
- import type { JsxContext } from "./types";
3
- import type { TemplatePart } from "./templateParts";
1
+ import { default as ts } from 'typescript';
2
+ import { JsxContext } from './types';
3
+ import { TemplatePart } from './templateParts';
4
4
  /**
5
5
  * Extract comments and whitespace from a node (called "trivia" in TypeScript)
6
6
  */
7
- export declare const getNodeTrivia: (node: ts.Node, context: JsxContext) => string;
7
+ export declare const getNodeTrivia: (node: ts.Node, context: Pick<JsxContext, "sourceFile">) => string;
8
8
  /**
9
9
  * Attach trivia comments to a node.
10
10
  *
@@ -1,9 +1,8 @@
1
- import ts from "typescript";
2
- import type { TemplatePart } from "./templateParts";
3
- import type { JsxContext } from "./types";
4
- import type { JsxPropType } from "./inferPropType";
5
- import { dynamicHtmlSymbol } from "./config";
6
- import { type dynamicSvgSymbol } from "./config";
1
+ import { default as ts } from 'typescript';
2
+ import { TemplatePart } from './templateParts';
3
+ import { JsxContext } from './types';
4
+ import { JsxPropType } from './inferPropType';
5
+ import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config';
7
6
  /**
8
7
  * Handle the conversion for each JSX prop type
9
8
  */
@@ -1,5 +1,5 @@
1
- import ts from "typescript";
2
- import { type JsxContext } from "./types";
1
+ import { default as ts } from 'typescript';
2
+ import { JsxContext } from './types';
3
3
  export declare const dynamicallyInsertedImportPaths: Set<string>;
4
4
  /**
5
5
  * This runs before we know what imports will be needed.
@@ -1,4 +1,4 @@
1
- import type { FileTransformer } from "../publicTypes";
1
+ import { FileTransformer } from '../publicTypes';
2
2
  /**
3
3
  * Let developers author components in JSX for better type checking and developer
4
4
  * experience, but convert JSX to lit-html at build time for better performance.
@@ -1,5 +1,5 @@
1
- import ts from "typescript";
2
- import { dynamicHtmlSymbol, dynamicSvgSymbol } from "./config";
1
+ import { default as ts } from 'typescript';
2
+ import { dynamicHtmlSymbol, dynamicSvgSymbol } from './config';
3
3
  /**
4
4
  * Check if prop initializer has bindProperty(), bindAttribute(),
5
5
  * bindBooleanAttribute() or bindEvent() call - these explicitly indicate the
@@ -34,7 +34,7 @@ export declare function checkExplicitPropType(initializer: ts.JsxAttributeValue
34
34
  * explicitly want to overwrite the below prop type inference logic.
35
35
  */
36
36
  export declare function inferPropType(propName: string, initializer: ts.JsxAttributeValue | undefined, tagName: string | typeof dynamicHtmlSymbol | typeof dynamicSvgSymbol): JsxPropType;
37
- declare const specialPropsArray: readonly ["class", "style", "ref", "directives", "key"];
37
+ declare const specialPropsArray: readonly ["class", "style", "ref", "directives", "key", "deferLoad"];
38
38
  type SpecialProp = (typeof specialPropsArray)[number];
39
39
  export type JsxPropType = SpecialProp | "attribute" | "booleanAttribute" | "event" | "property";
40
40
  export {};
@@ -1,5 +1,5 @@
1
- import ts from "typescript";
2
- import type { JsxContext } from "./types";
1
+ import { default as ts } from 'typescript';
2
+ import { JsxContext } from './types';
3
3
  /**
4
4
  * By default, when we see a `key=""` prop, we convert it like this:
5
5
  * ```tsx
@@ -1,7 +1,6 @@
1
- import ts from "typescript";
2
- import type { TemplatePart } from "./templateParts";
3
- import type { JsxHost } from "./types";
4
- import { type JsxContext } from "./types";
1
+ import { default as ts } from 'typescript';
2
+ import { TemplatePart } from './templateParts';
3
+ import { JsxHost, JsxContext } from './types';
5
4
  /**
6
5
  * Recursively traverse the entire AST top-down, converting JSX to lit-html.
7
6
  */
@@ -1,5 +1,5 @@
1
- import ts from "typescript";
2
- import { type JsxContext, type LitTag, type ambiguousSvgTag } from "./types";
1
+ import { default as ts } from 'typescript';
2
+ import { JsxContext, LitTag, ambiguousSvgTag } from './types';
3
3
  /**
4
4
  * Template part is a convenient intermediate representation for template
5
5
  * literal expressions.
@@ -1,4 +1,4 @@
1
- import type { JsxContext } from "./types";
1
+ import { JsxContext } from './types';
2
2
  /**
3
3
  * Throw if encountered an explicit non-type-only import for a Calcite component
4
4
  * or some `@arcgis/*` component package - such packages should be externalized,
@@ -1,6 +1,6 @@
1
- import ts from "typescript";
2
- import type { ResolvedDependencyComponents } from "../dependencies/discover";
3
- import type { CompilerContext } from "../context";
1
+ import { default as ts } from 'typescript';
2
+ import { ResolvedDependencyComponents } from '../dependencies/discover';
3
+ import { CompilerContext } from '../context';
4
4
  export type JsxContext = {
5
5
  readonly compiler: CompilerContext;
6
6
  /** Source file before the _JSX to lit-html_ transformation */
@@ -16,6 +16,7 @@ export type JsxContext = {
16
16
  * remove it from the map to not confuse any following resolvers.
17
17
  */
18
18
  readonly customElementsToImport: Set<string>;
19
+ readonly customElementsToImportDeferred: Set<string>;
19
20
  /**
20
21
  * Existing imported modules.
21
22
  *
@@ -64,7 +65,7 @@ export declare const mathMlTag = "mathml";
64
65
  declare const litTagsArray: readonly ["css", "html", "mathml", "staticHtml", "staticSvg", "svg"];
65
66
  export declare const litTags: Set<"html" | "css" | "mathml" | "staticHtml" | "staticSvg" | "svg">;
66
67
  export type LitTag = (typeof litTagsArray)[number];
67
- export declare const jsxImportNames: readonly ["keyed", "ref", "repeat", "live", "css", "html", "mathml", "staticHtml", "staticSvg", "svg", "safeClassMap", "safeStyleMap", "nothing"];
68
+ export declare const jsxImportNames: readonly ["keyed", "ref", "repeat", "live", "css", "html", "mathml", "staticHtml", "staticSvg", "svg", "safeClassMap", "safeStyleMap", "deferLoad", "nothing"];
68
69
  export type JsxImportName = (typeof jsxImportNames)[number];
69
70
  export type JsxHost = ts.JsxElement | ts.JsxFragment | ts.JsxSelfClosingElement;
70
71
  export declare const isJsxHost: (node: ts.Node) => node is JsxHost;
@@ -11,3 +11,4 @@ export declare function safeTrimText(text: string): string;
11
11
  export declare const escapeForTemplateLiteral: (string: string) => string;
12
12
  export declare const shouldQuoteAttributeValue: (value: string) => boolean;
13
13
  export declare const escapeForHtml: (string: string) => string;
14
+ export declare const isCustomElement: (tagName: string | symbol) => tagName is string;
@@ -1,4 +1,4 @@
1
- import type { CompilerContext } from "../context";
1
+ import { CompilerContext } from '../context';
2
2
  export declare function addGlobalCss(context: CompilerContext): string;
3
3
  export declare const defaultHydratedAttribute = "hydrated";
4
4
  /**
@@ -1,5 +1,5 @@
1
- import type { Plugin as VitePlugin } from "vite";
2
- import type { CompilerContext } from "../context";
1
+ import { Plugin as VitePlugin } from 'vite';
2
+ import { CompilerContext } from '../context';
3
3
  /**
4
4
  * Generate virtual files:
5
5
  * - loader.ts (for lazy loading components)
@@ -1,6 +1,6 @@
1
- import type { CompilerContext } from "../context";
2
- import type { HmrComponentMeta } from "@arcgis/lumina/hmrSupport";
3
- import type { ApiCustomElementDeclaration } from "@arcgis/api-extractor";
1
+ import { CompilerContext } from '../context';
2
+ import { HmrComponentMeta } from '@arcgis/lumina/hmrSupport';
3
+ import { ApiCustomElementDeclaration } from '@arcgis/api-extractor';
4
4
  /**
5
5
  * To power bundle splitting for lazy loadable components, as well as to support
6
6
  * calling async methods before the component loaded, and to ensure frameworks
@@ -1,4 +1,4 @@
1
- import type { ApiJson } from "@arcgis/api-extractor";
1
+ import { ApiJson } from '@arcgis/api-extractor';
2
2
  /**
3
3
  * Providing api.json to Storybook.
4
4
  * See https://github.com/storybookjs/storybook/tree/next/code/addons/docs/web-components
@@ -0,0 +1,28 @@
1
+ import { toSystemPathSeparators as i, path as c } from "@arcgis/components-build-utils";
2
+ import a from "chalk";
3
+ import { createLogger as g } from "vite";
4
+ let n = g(), s = process.cwd();
5
+ function e(r, o, t) {
6
+ return typeof t == "string" ? (t = t.startsWith(s) ? i(c.relative(s, t)) : t, t = `${t}: `) : t = "", `${r} ${t}${o}`;
7
+ }
8
+ const f = {
9
+ initialize(r, o) {
10
+ n = r, s = o;
11
+ },
12
+ info(r, o, t) {
13
+ n.info(e(a.cyan(`[${r}]`), o, t));
14
+ },
15
+ warn(r, o, t) {
16
+ n.warn(e(a.yellow(`[${r}]`), o, t));
17
+ },
18
+ error(r, o, t) {
19
+ n.error(e(a.red(`[${r}]`), o, t)), process.exitCode = 1;
20
+ }
21
+ };
22
+ function u(r, o, t) {
23
+ return o instanceof Error ? (o.message = e(r, o.message, t), o) : e(a.red(`[${r}]`), o, t);
24
+ }
25
+ export {
26
+ u as f,
27
+ f as l
28
+ };
@@ -1,21 +1,71 @@
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
  * Restricted due to collisions with Lumina's dist/ folder names or
5
5
  * Stencil's dist/ folder names
6
6
  */
7
7
  export declare const restrictedNamespaceNames: Set<string>;
8
8
  export declare const defaultNamespace = "cdn";
9
+ export declare const defaultEntryJsName = "index";
10
+ export declare const globalCssName = "main";
9
11
  /**
10
12
  * CDN build works by reading the lazy NPM build and bundling-in all used
11
13
  * dependencies (except for imports of web components from dependencies - those
12
14
  * are assumed to be defined in the environment separately)
13
15
  */
14
16
  export declare function buildCdn(context: CompilerContext): Plugin | undefined;
15
- declare function transformAsyncCoreImports(code: string): string;
16
- declare function transformSyncCoreImports(code: string): string;
17
+ type Chunk = {
18
+ code: string;
19
+ isAsync: boolean | undefined;
20
+ oldSingleExportName: string | undefined;
21
+ };
22
+ /**
23
+ * Transform each core-importing chunk to use $arcgis.t for loading core in
24
+ * order to be both ESM and AMD CDN compatible.
25
+ *
26
+ * Previous solution
27
+ * (https://devtopia.esri.com/WebGIS/arcgis-web-components/pull/2995) relied on
28
+ * top-level await. However, due to a Safari bug
29
+ * (see https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/3933
30
+ * and https://bugs.webkit.org/show_bug.cgi?id=242740), we are no longer using
31
+ * top-level await.
32
+ *
33
+ * Instead, we insert a top-level await polyfill - any module that imports core
34
+ * directly or indirectly is transformed to have a promise as a default export -
35
+ * such promise, once awaited, yields the actual exports of the module.
36
+ *
37
+ * List of other solutions considered:
38
+ * https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/3999
39
+ *
40
+ * @example
41
+ * ```js
42
+ * /// BEFORE
43
+ * import { b } from "./U7MU7PMX.js";
44
+ * import { when as M } from "@arcgis/core/core/reactiveUtils.js";
45
+ * var s = class extends v {
46
+ * // ...
47
+ * };
48
+ * export { s as ArcgisNavigationToggle };
49
+ *
50
+ * /// AFTER
51
+ * import a from "./U7MU7PMX.js";
52
+ * export default $arcgis.t(
53
+ * ([{ when: M }, { b }]) => {
54
+ * // The "meat" of the file is kept unchanged by the transform
55
+ * // (we only touch the imports, and the very last export line)
56
+ * s = class extends v {
57
+ * // ...
58
+ * };
59
+ * // Resolve the promise by returning the exported class
60
+ * return s;
61
+ * },
62
+ * "core/reactiveUtils",
63
+ * a,
64
+ * );
65
+ * ```
66
+ */
67
+ declare function transformChunk(chunk: Chunk, chunks: Map<string, Chunk>): void;
17
68
  export declare const exportsForTests: {
18
- transformAsyncCoreImports: typeof transformAsyncCoreImports;
19
- transformSyncCoreImports: typeof transformSyncCoreImports;
69
+ transformChunk: typeof transformChunk;
20
70
  };
21
71
  export {};
@@ -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
  * Emit output compatible with Stencil's dist-hydrate-script build.
5
5
  *
@@ -0,0 +1,3 @@
1
+ import { CompilerContext } from '../context';
2
+ /** @deprecated */
3
+ export declare function buildWebApp(context: CompilerContext, rawDestination: string, cdnEntryName: string): Promise<void>;
@@ -1,3 +1,3 @@
1
- import type { Plugin } from "vite";
2
- import type { CompilerContext } from "../context";
1
+ import { Plugin } from 'vite';
2
+ import { CompilerContext } from '../context';
3
3
  export declare function buildWrappers(context: CompilerContext): Plugin;
@@ -1,9 +1,9 @@
1
- import type { Plugin } from "vite";
2
- import type { CompilerContext } from "../context";
3
- import type { PuppeteerLaunchOptions } from "puppeteer";
4
- import type { InlineConfig } from "vitest/node";
1
+ import { Plugin } from 'vite';
2
+ import { CompilerContext } from '../context';
3
+ import { InlineConfig } from 'vitest/node';
4
+ import { PuppeteerTestingOptions } from '../publicTypes';
5
5
  export type PuppeteerVitestConfigOptions = InlineConfig & {
6
- puppeteerLaunchOptions?: PuppeteerLaunchOptions;
6
+ puppeteerLaunchOptions?: PuppeteerTestingOptions["launchOptions"];
7
7
  puppeteerWaitForChangesDelay?: number;
8
8
  };
9
9
  /**
@@ -1,6 +1,5 @@
1
- import type { Plugin } from "vite";
2
- import type { Nil } from "@arcgis/components-utils";
3
- import type { CompilerContext } from "../context";
1
+ import { Plugin } from 'vite';
2
+ import { CompilerContext } from '../context';
4
3
  /**
5
4
  * By default, Rollup will bundle-in all dependencies.
6
5
  *
@@ -29,6 +28,3 @@ import type { CompilerContext } from "../context";
29
28
  * be externalized (because all peerDependencies are externalized).
30
29
  */
31
30
  export declare function externalizeDependencies(context: CompilerContext): Plugin;
32
- export declare const exportsForTests: {
33
- normalizeGlobs: (option: Nil | RegExp | string | false) => RegExp | undefined;
34
- };
@@ -1,3 +1,3 @@
1
- import type { Plugin } from "vite";
2
- import type { CompilerContext } from "../context";
1
+ import { Plugin } from 'vite';
2
+ import { CompilerContext } from '../context';
3
3
  export declare const handleDynamicAssets: (context: CompilerContext) => Plugin;
@@ -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
  * This is similar to Stencil's assets hosting, but to improve DX, the assets
5
5
  * belonging to each component are moved into a folder named after the component
@@ -1,9 +1,5 @@
1
- /**
2
- * This file has a companion `@arcgis/lumina/typings/loadLitCss.d.ts`. Edits
3
- * to this file may need to be reflected there too
4
- */
5
- import type { Plugin } from "vite";
6
- import type { CompilerContext } from "../context";
1
+ import { Plugin } from 'vite';
2
+ import { CompilerContext } from '../context';
7
3
  export declare const cssLangsRe: RegExp;
8
4
  /**
9
5
  * The `.adoptedStyleSheets` API is very convenient, but it has one issue: it
@@ -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
  * Augmenting vite's default reporter to not just report bundle sizes, but to
5
5
  * also print the total size
@@ -1,23 +1,6 @@
1
- /**
2
- * Utilities for making Vite copy assets to the output folder during build or
3
- * serve them when in serve mode
4
- *
5
- * This is similar to Vite's public directory, except that you can provide
6
- * multiple directories and re-map the path at which the files are served.
7
- *
8
- * @remarks
9
- * The functionality is similar to
10
- * https://github.com/nguyenbatranvan/vite-multiple-assets/blob/main/packages/libs/index.ts
11
- *
12
- * But with improvements:
13
- * - support scoping assets
14
- * - copy files in parallel rather than sequentially
15
- * - greater type safety and uses modern Node.js features
16
- * - transform the assets (i.e minify JSON)
17
- */
18
- import type { CompilerContext } from "../context";
19
- import type { AssetSpec, AssetTransformer } from "../publicTypes";
20
- import type { ContextDirectories } from "../context/types";
1
+ import { CompilerContext } from '../context';
2
+ import { AssetSpec, AssetTransformer } from '../publicTypes';
3
+ import { ContextDirectories } from '../context/types';
21
4
  export declare function serveAssets(context: CompilerContext, assets: AssetSpec[], transformers?: AssetTransformer[]): void;
22
5
  export declare function writeAssets(context: CompilerContext, assets: AssetSpec[], transformers?: AssetTransformer[]): Promise<void>;
23
6
  /**
@@ -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
  * Plugin to set the base URL for assets in the package
5
5
  *
@@ -1,8 +1,8 @@
1
- import type { MiniPackageJson } from "@arcgis/components-build-utils";
2
- import type { CompilerContext } from "../context";
3
- import type { Plugin } from "vite";
1
+ import { MiniPackageJson } from '@arcgis/components-build-utils';
2
+ import { CompilerContext } from '../context';
3
+ import { Plugin } from 'vite';
4
4
  export declare const updatePackageJson: (context: CompilerContext) => Plugin;
5
- declare function doPackageJsonUpdate(packageJson: MiniPackageJson, context: Pick<CompilerContext, "_documentationFileNames" | "dir">): MiniPackageJson | undefined;
5
+ declare function doPackageJsonUpdate(packageJson: MiniPackageJson, context: Pick<CompilerContext, "_documentationFileNames" | "dir" | "options">): MiniPackageJson | undefined;
6
6
  export declare const exportsForTests: {
7
7
  doPackageJsonUpdate: typeof doPackageJsonUpdate;
8
8
  };
@@ -1,14 +1,13 @@
1
- import type ts from "typescript";
2
- import type { Plugin } from "vite";
3
- import type { build as esbuildBuild } from "esbuild";
4
- import type { CompilerContext } from "./context";
5
- import type { PluginOptions as VitePluginDtsOptions } from "vite-plugin-dts";
6
- import type { ExternalsOptions as RollupPluginNodeExternalsOptions } from "rollup-plugin-node-externals";
7
- import type { PuppeteerLaunchOptions } from "puppeteer";
8
- import type { WebTypesOptions } from "./docs/webTypes/types";
9
- import type { VsCodeDocOptions } from "./docs/vsCodeCustomData/types";
10
- import type { ApiJson, ApiModule } from "@arcgis/api-extractor";
11
- import type { LuminaApiExtractor } from "./extractor/extractor";
1
+ import { default as ts } from 'typescript';
2
+ import { Plugin } from 'vite';
3
+ import { build as esbuildBuild } from 'esbuild';
4
+ import { CompilerContext } from './context';
5
+ import { PluginOptions as VitePluginDtsOptions } from 'vite-plugin-dts';
6
+ import { ExternalsOptions as RollupPluginNodeExternalsOptions } from 'rollup-plugin-node-externals';
7
+ import { WebTypesOptions } from './docs/webTypes/types';
8
+ import { VsCodeDocOptions } from './docs/vsCodeCustomData/types';
9
+ import { ApiJson, ApiModule, CopyDocDefinitions } from '@arcgis/api-extractor';
10
+ import { LuminaApiExtractor } from './extractor/extractor';
12
11
  /**
13
12
  * `useLumina()` returns an array of Vite plugins. The array additionally
14
13
  * has a `context` property for accessing the compiler context.
@@ -71,6 +70,19 @@ export type BuildOptions = {
71
70
  * Configuration for CDN build.
72
71
  */
73
72
  readonly cdn?: BuildCdnOptions;
73
+ /** @deprecated Use Storybook build or separate test app package. */
74
+ readonly webApp?: {
75
+ /**
76
+ * If set, will produce a web app build, based on index.html files and
77
+ * cdn build.
78
+ *
79
+ * @default undefined
80
+ * @example "www"
81
+ * @see [Based on Stencil's www build](https://stenciljs.com/docs/www)
82
+ * @deprecated Use Storybook build or separate test app package.
83
+ */
84
+ readonly destination?: string;
85
+ };
74
86
  /**
75
87
  * Options for externalizing or bundling in dependencies.
76
88
  */
@@ -115,15 +127,23 @@ export type BuildCdnOptions = {
115
127
  */
116
128
  readonly skip?: boolean;
117
129
  /**
130
+ * @deprecated To improve CDN experience and simplify redirect handling,
131
+ * deprecated namespace to use consistent CDN folder and file names.
132
+ *
133
+ * Reference: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/5051#issuecomment-5482327
134
+ *
118
135
  * Determines the CDN folder name and the name of the entrypoint file inside.
119
136
  *
120
137
  * @default "cdn"
121
138
  */
122
139
  readonly namespace?: string;
123
140
  /**
124
- * To produce the CDN build, Lumina takes the lazy-loading build of your
125
- * package, and post-processes it with ESBuild. You can customize the options
126
- * passed to ESBuild.
141
+ * To produce the CDN build, Lumina takes the dist/loader.js file and
142
+ * and post-processes it with ESBuild to make it ready for consumption in the
143
+ * browser.
144
+ *
145
+ * You can customize the options passed to ESBuild. Note, some options may
146
+ * conflict with the Lumina build process.
127
147
  *
128
148
  * @see https://esbuild.github.io/api/#overview
129
149
  */
@@ -237,7 +257,13 @@ export type ServeEnvironmentOptions = {
237
257
  * `index.html`.
238
258
  * In such case, you can set `extraDependencies: ["@arcgis/map-components"]`
239
259
  */
240
- readonly extraDependencies?: string[];
260
+ readonly extraDependencies?: (DetailedExtraDependency | string)[];
261
+ };
262
+ export type DetailedExtraDependency = {
263
+ /** @example "@arcgis/map-config-components" */
264
+ name: string;
265
+ /** @example ():string => `https://example.com/arcgis-components/builds/main/cdn/map-config-components/` */
266
+ getCdnUrl: (context: CompilerContext) => string;
241
267
  };
242
268
  export type PuppeteerTestingOptions = {
243
269
  /**
@@ -252,9 +278,20 @@ export type PuppeteerTestingOptions = {
252
278
  * @default 0
253
279
  */
254
280
  readonly waitForChangesDelay?: number;
255
- readonly launchOptions?: PuppeteerLaunchOptions;
281
+ /**
282
+ * @example
283
+ * ```ts
284
+ * import type { LaunchOptions } from "puppeteer";
285
+ * // ...
286
+ * launchOptions: {
287
+ * args: ["--no-sandbox", "--disable-setuid-sandbox"],
288
+ * } satisfies LaunchOptions;
289
+ * ```
290
+ */
291
+ readonly launchOptions?: Record<string, unknown>;
256
292
  };
257
293
  export type GenerateDocumentationOptions = {
294
+ readonly copyDefinitions?: CopyDocDefinitions;
258
295
  /**
259
296
  * The name of the file to write the api.json to. api.json is a file format
260
297
  * based on custom-elements-manifest that describes all the components in the
@@ -267,22 +304,39 @@ export type GenerateDocumentationOptions = {
267
304
  * The name of the file to write the Stencil-like docs JSON to.
268
305
  * For backwards compatibility.
269
306
  *
307
+ * @deprecated Use api.json instead.
270
308
  * @default "docs/docs.json"
271
309
  * @see https://stenciljs.com/docs/docs-json
272
310
  */
273
311
  readonly stencilLikeDocsJsonFileName?: string | false;
312
+ /**
313
+ * Get a prefix for a public-facing URL for each component story.
314
+ *
315
+ * @example
316
+ * Set this to "https://developers.arcgis.com/javascript/latest/storybook/map-components/".
317
+ * This will produce URLs like
318
+ * "https://developers.arcgis.com/javascript/latest/storybook/map-components/?path=/story/arcgis-area-measurement-2d--demo&singleStory=true"
319
+ * @see https://qawebgis.esri.com/components/lumina/storybook
320
+ */
321
+ readonly publicStoryUrlPrefix?: string;
274
322
  /**
275
323
  * Provide a URL to a page that documents the component.
276
324
  * This URL will be visible in VS Code and IntelliJ when hovering over a
277
325
  * component tag in an .html file
326
+ *
327
+ * @example (tagName) => `https://developers.arcgis.com/javascript/latest/references/map-components/${tagName}/`
278
328
  */
279
- readonly getComponentDocsUrl?: (tag: string, name: string) => string | undefined;
329
+ readonly getComponentDocsUrl?: (tagName: string, className: string) => string | undefined;
280
330
  /**
281
331
  * Provide a URL to a page that documents the component.
282
332
  * This URL will be visible in VS Code and IntelliJ when hovering over a
283
333
  * component tag in an .html file
334
+ *
335
+ * If you wish to provide multiple URLs, use "getPublicStoryUrl" instead.
336
+ *
337
+ * @example (tagName) => `https://developers.arcgis.com/javascript/latest/storybook/map-components/?path=/story/${tagName}--demo&singleStory=true`
284
338
  */
285
- readonly getComponentDemoUrl?: (tag: string, name: string) => string | undefined;
339
+ readonly getComponentDemoUrl?: (tagName: string, className: string) => string | undefined;
286
340
  /**
287
341
  * Additional options for web component documentation for VS Code. This
288
342
  * documentation provides intellisense when editing .html and .css files.
@@ -328,7 +382,7 @@ export type GenerateTypesOptions = Omit<VitePluginDtsOptions, "beforeWriteFile"
328
382
  * This transformer is used only on .d.ts files of your components. Any
329
383
  * .d.ts files for utility files or other non-entrypoint files are not
330
384
  * affected by this transformer. For those, you can use the
331
- * `declarationAstTransformers` option.
385
+ * `declarationTextTransformers` option.
332
386
  */
333
387
  readonly declarationAstTransformers?: FileTransformer[];
334
388
  /**
@@ -407,7 +461,7 @@ export type ApiJsonOptions = {
407
461
  *
408
462
  * @default LuminaApiExtractor
409
463
  */
410
- readonly Extractor: typeof LuminaApiExtractor;
464
+ readonly Extractor?: typeof LuminaApiExtractor;
411
465
  /**
412
466
  * This function will be called after the api.json is created but before it is
413
467
  * used to generate any output files.
@@ -645,14 +699,14 @@ export type AssetTransformer = {
645
699
  };
646
700
  export type LintingOptions = {
647
701
  /**
648
- * Lumina emits build-time errors for common issues and possible bugs.
702
+ * Lumina includes build-time checks for common issues and possible bugs.
649
703
  * Most of those should be immediately addressable. However, some (like
650
704
  * updating default value for boolean properties) may require a breaking
651
705
  * change.
652
706
  *
653
- * This option exists to temporary turn these errors into warnings.
707
+ * This option exists to temporarily turn these errors into warnings.
654
708
  * @example
655
- * To silence an error in a file, add an entry like thw following with the
709
+ * To silence an error in a file, add an entry like the following with the
656
710
  * relative path to the file:
657
711
  *
658
712
  * ```ts
@@ -660,13 +714,6 @@ export type LintingOptions = {
660
714
  * ```
661
715
  */
662
716
  silence: {
663
- /**
664
- * Default values for boolean properties must default to false (or
665
- * undefined), never to true.
666
- *
667
- * [Documentation](https://qawebgis.esri.com/components/lumina/properties#boolean-properties)
668
- */
669
- booleanMustDefaultFalse?: string[];
670
717
  /**
671
718
  * Lumina components may declare required properties using `@required` JSDoc
672
719
  * tag.