@arcgis/lumina-compiler 4.34.0-next.112 → 4.34.0-next.113

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 (2) hide show
  1. package/dist/index.js +125 -122
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { externalizeDependencies as cs, path as u, toSystemPathSeparators as te, retrievePackageJson as R, fetchPackageLocation as Ni, asyncRetrievePackageJson as Di, existsAsync as _, findPath as ls, toPosixPathSeparators as je, isPosix as ji, getCwd as Ri } from "@arcgis/components-build-utils";
2
2
  import ds from "vite-plugin-dts";
3
3
  import o from "typescript";
4
- import { f as T, l as E } from "./logger-KpGU2b3R.js";
4
+ import { f as w, l as E } from "./logger-KpGU2b3R.js";
5
5
  import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as Mi, setApiDocFromJsDoc as ge, ApiExtractor as ps, hasIgnoredModifier as us, symbolToDocs as Kt, setDefaultFromInitializer as Bt, multipleJsDocTags as ms, findDecorator as Wt, isApiMethod as fs, isApiProperty as gs } from "@arcgis/api-extractor";
6
6
  import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
7
7
  import { camelToKebab as Tt, kebabToPascal as ys, uncapitalize as ut, getPreamble as hs, capitalize as vs } from "@arcgis/toolkit/string";
@@ -207,7 +207,7 @@ ${e.content}`
207
207
  const t = e.content.match(er)?.[1] ?? e.content.match(tr)?.[1];
208
208
  if (t !== void 0)
209
209
  throw Error(
210
- T(
210
+ w(
211
211
  "@arcgis/lumina:failOnJsonImport",
212
212
  `Found a .json import (${t}). This can cause TypeScript errors for consumers of your package. See alternative options: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2047
213
213
  File content:
@@ -564,7 +564,7 @@ function Sr(e) {
564
564
  return [];
565
565
  const s = e.typeScriptProgram.getSourceFile(n);
566
566
  if (s === void 0)
567
- throw Error(T(Vt, `Could not find source file: ${te(n)}`));
567
+ throw Error(w(Vt, `Could not find source file: ${te(n)}`));
568
568
  const r = [];
569
569
  return e.typeScriptProgram.emit(
570
570
  s,
@@ -1827,7 +1827,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
1827
1827
  const i = t.plugins.find(({ name: r }) => r === "vite:css-post");
1828
1828
  if (i === void 0)
1829
1829
  throw Error(
1830
- T(
1830
+ w(
1831
1831
  pe,
1832
1832
  "Unable to find the vite's built-in vite:css-post plugin. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use `npm list vite`/`yarn why vite` to check the Vite version you are using."
1833
1833
  )
@@ -1835,7 +1835,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
1835
1835
  const n = i.transform;
1836
1836
  if (typeof n != "object" || typeof n.handler != "function")
1837
1837
  throw Error(
1838
- T(
1838
+ w(
1839
1839
  pe,
1840
1840
  "Expected vite:css-post to declare a transform:{handler()} property. This may indicate you are trying to use Vite 6 with Lumina version that is designed for Vite 7. Use `npm list vite`/`yarn why vite` to check the Vite version you are using."
1841
1841
  )
@@ -1843,7 +1843,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
1843
1843
  const s = Object.keys(n).filter((r) => r !== "filter");
1844
1844
  if (s.length !== 1)
1845
1845
  throw Error(
1846
- T(
1846
+ w(
1847
1847
  pe,
1848
1848
  `Expected vite:css-post's transform handler to have only a single property: handler. Found: ${s.join(",")}. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use \`npm list vite\`/\`yarn why vite\` to check the Vite version you are using.`
1849
1849
  )
@@ -1880,10 +1880,10 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
1880
1880
  if (h.cssProperties === void 0)
1881
1881
  h.cssProperties = Array.from(g);
1882
1882
  else {
1883
- const b = new Set(h.cssProperties.map((S) => S.name));
1883
+ const b = new Set(h.cssProperties.map((T) => T.name));
1884
1884
  h.cssProperties = [
1885
1885
  ...h.cssProperties,
1886
- ...g.filter((S) => !b.has(S.name))
1886
+ ...g.filter((T) => !b.has(T.name))
1887
1887
  ];
1888
1888
  }
1889
1889
  }
@@ -2399,14 +2399,14 @@ function Bo(e, t, i) {
2399
2399
  if (s !== void 0) {
2400
2400
  if (!o.isObjectLiteralExpression(s))
2401
2401
  throw Error(
2402
- T(
2402
+ w(
2403
2403
  "@arcgis/lumina:extractEventMeta",
2404
2404
  `Expected object literal expression as first argument of ${Fe}(). Found ${t.name} = createEvent(${s.getText(i)})`
2405
2405
  )
2406
2406
  );
2407
2407
  if (s.properties.some((r) => o.isSpreadAssignment(r)))
2408
2408
  throw Error(
2409
- T(
2409
+ w(
2410
2410
  "@arcgis/lumina:extractEventMeta",
2411
2411
  `Unexpected spread syntax in ${Fe}() argument. ${Fe}() arguments must be statically parsable at compile time`
2412
2412
  )
@@ -2421,7 +2421,7 @@ function re(e, t) {
2421
2421
  if (e.kind === o.SyntaxKind.FalseKeyword)
2422
2422
  return !1;
2423
2423
  throw Error(
2424
- T(
2424
+ w(
2425
2425
  "@arcgis/lumina:extractBooleanInitializer",
2426
2426
  `Expected boolean literal. Instead found ${e?.getText(t)}`
2427
2427
  )
@@ -2500,7 +2500,7 @@ class We extends ps {
2500
2500
  }, r = t.heritageClauses?.find((a) => a.token === o.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;
2501
2501
  if (r === void 0)
2502
2502
  throw Error(
2503
- T(
2503
+ w(
2504
2504
  "@arcgis/lumina:extractComponentDeclaration",
2505
2505
  `Lumina component must extend LitElement class. Found ${i} in ${this.apiModule.path} that does not extend any class.`
2506
2506
  )
@@ -2649,27 +2649,27 @@ console.log("${s.tagName} is ready to go!");
2649
2649
  } : Eo(this.context, l, f, this.file);
2650
2650
  const y = o.isPropertyDeclaration(t) && t.type !== void 0 && t.initializer !== void 0 && o.isPropertyAccessExpression(t.initializer) && o.isPropertyAccessExpression(t.initializer.expression) && t.initializer.expression.expression.kind === o.SyntaxKind.ThisKeyword && o.isIdentifier(t.initializer.expression.name) && o.isIdentifier(t.initializer.name);
2651
2651
  if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
2652
- const v = t.initializer, h = s.getSymbolAtLocation(v), b = h !== void 0 && ((h.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(h) : h, S = b?.getDeclarations() ?? [];
2652
+ const v = t.initializer, h = s.getSymbolAtLocation(v), b = h !== void 0 && ((h.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(h) : h, T = b?.getDeclarations() ?? [];
2653
2653
  if (b !== void 0) {
2654
- const P = Kt(s, b);
2655
- if (P.docsTags.length > 0) {
2656
- P.docsTags = P.docsTags.filter(
2654
+ const $ = Kt(s, b);
2655
+ if ($.docsTags.length > 0) {
2656
+ $.docsTags = $.docsTags.filter(
2657
2657
  (C) => !c.has(C.name) || ms.has(C.name)
2658
2658
  );
2659
- const w = i.description;
2660
- ge(t.name, s, i, P), P.docsTags.forEach((C) => {
2659
+ const S = i.description;
2660
+ ge(t.name, s, i, $), $.docsTags.forEach((C) => {
2661
2661
  c.add(C.name);
2662
- }), i.description = w ?? i.description;
2662
+ }), i.description = S ?? i.description;
2663
2663
  } else
2664
- i.description ||= P.description;
2664
+ i.description ||= $.description;
2665
2665
  }
2666
- let $, A;
2667
- S.forEach((P) => {
2668
- if ($ ??= o.isGetAccessor(P) ? P : void 0, A ??= o.isSetAccessor(P) ? P : void 0, !("initializer" in P))
2666
+ let P, A;
2667
+ T.forEach(($) => {
2668
+ if (P ??= o.isGetAccessor($) ? $ : void 0, A ??= o.isSetAccessor($) ? $ : void 0, !("initializer" in $))
2669
2669
  return;
2670
- const w = P;
2671
- d ||= w.modifiers?.some((C) => C.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, Bt(w, i, w.getSourceFile());
2672
- }), y && $ !== void 0 && A !== void 0 && $.type?.getText() !== A.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${v.getText(this.file)}` });
2670
+ const S = $;
2671
+ d ||= S.modifiers?.some((C) => C.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, Bt(S, i, S.getSourceFile());
2672
+ }), y && P !== void 0 && A !== void 0 && P.type?.getText() !== A.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${v.getText(this.file)}` });
2673
2673
  }
2674
2674
  if (d && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((v) => v.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && (We.loggedBooleanWarning || this.context.logLintWarning(
2675
2675
  `Boolean properties should default to "false". Found default value "true" in ${this.apiComponent.name}.${i.name}. See https://qawebgis.esri.com/components/lumina/properties#boolean-properties`
@@ -2973,7 +2973,7 @@ async function vn(e, t) {
2973
2973
  function Yo() {
2974
2974
  if (_e === void 0)
2975
2975
  throw Error(
2976
- T(
2976
+ w(
2977
2977
  "@arcgis/lumina:retrieveComponentDependencies",
2978
2978
  "Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
2979
2979
  )
@@ -2983,7 +2983,7 @@ function Yo() {
2983
2983
  function bn() {
2984
2984
  if (ht === void 0)
2985
2985
  throw Error(
2986
- T(
2986
+ w(
2987
2987
  "@arcgis/lumina:retrieveFlatComponentDependencies",
2988
2988
  "Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
2989
2989
  )
@@ -3042,11 +3042,11 @@ async function Sn(e, t) {
3042
3042
  if (a ? await _(c) : !1) {
3043
3043
  const y = await J(c, "utf8"), g = ia(y, "bootstrapLazy("), v = y.indexOf(", options", g), h = y.slice(g, v), b = h.startsWith('JSON.parse("') ? h.slice(12, -2).replaceAll('\\"', '"') : h;
3044
3044
  try {
3045
- const S = JSON.parse(b), $ = ra(S, { packageName: e, getImportPath: r });
3046
- return { packageName: e, type: "stencil", components: $, packageLocation: i, packageJson: n };
3047
- } catch (S) {
3045
+ const T = JSON.parse(b), P = ra(T, { packageName: e, getImportPath: r });
3046
+ return { packageName: e, type: "stencil", components: P, packageLocation: i, packageJson: n };
3047
+ } catch (T) {
3048
3048
  E.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
3049
- Error: ${String(S)}`);
3049
+ Error: ${String(T)}`);
3050
3050
  }
3051
3051
  }
3052
3052
  const l = li(n.customElements);
@@ -3592,13 +3592,13 @@ function Pa(e, t) {
3592
3592
  const h = c.statements.at(-1);
3593
3593
  if (!(h && o.isReturnStatement(h) && h.expression))
3594
3594
  return t;
3595
- const S = Ee(h.expression);
3596
- if (!fi(S))
3595
+ const T = Ee(h.expression);
3596
+ if (!fi(T))
3597
3597
  return t;
3598
- const $ = c.statements.slice(0, -1);
3599
- if ($.some($n))
3598
+ const P = c.statements.slice(0, -1);
3599
+ if (P.some($n))
3600
3600
  return t;
3601
- d = $.length === 0, l = S;
3601
+ d = P.length === 0, l = T;
3602
3602
  }
3603
3603
  const p = o.isJsxElement(l) ? l.openingElement : l, m = An(p);
3604
3604
  if (m === -1)
@@ -3790,14 +3790,14 @@ function In(e, t) {
3790
3790
  if (o.isJsxNamespacedName(r))
3791
3791
  throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
3792
3792
  if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== tt && r.text !== it) {
3793
- const P = o.isIdentifier(r) && r.text === Pr ? Me(i, e) : {
3793
+ const $ = o.isIdentifier(r) && r.text === Pr ? Me(i, e) : {
3794
3794
  // No need to wrap the function call in a lit-html tag
3795
3795
  litTag: void 0,
3796
3796
  parts: [Ra(e, t, r, i)]
3797
3797
  };
3798
3798
  return {
3799
3799
  key: ja(s, e),
3800
- ...P
3800
+ ...$
3801
3801
  };
3802
3802
  }
3803
3803
  const c = r.text === tt ? Je : r.text === it ? ft : r.text, d = r.text === tt ? le : r.text === it ? Z : kr.has(c) ? Yi : $t.has(c) ? oe : de, l = xt(c);
@@ -3812,16 +3812,16 @@ function In(e, t) {
3812
3812
  `JSX spread attribute syntax is not supported. See alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes
3813
3813
  Found ${A.getText(e.sourceFile)}`
3814
3814
  );
3815
- const { name: P, initializer: w } = A;
3816
- if (o.isJsxNamespacedName(P))
3817
- throw Error(`JSX namespaced attributes are not supported. Found ${P.getText(e.sourceFile)}`);
3818
- const C = P.text, L = ha(w), F = L?.propType ?? va(C, w, c);
3815
+ const { name: $, initializer: S } = A;
3816
+ if (o.isJsxNamespacedName($))
3817
+ throw Error(`JSX namespaced attributes are not supported. Found ${$.getText(e.sourceFile)}`);
3818
+ const C = $.text, L = ha(S), F = L?.propType ?? va(C, S, c);
3819
3819
  p?.delete(C);
3820
- const N = ma[F](e, L?.initializer ?? w, C, c);
3820
+ const N = ma[F](e, L?.initializer ?? S, C, c);
3821
3821
  if (N.length === 0)
3822
3822
  return [];
3823
- const M = e.compiler.shouldMinifyJsx ? [" "] : Ca(Tn(P, e));
3824
- return F === "key" ? (m = typeof N[0] == "object" && !xn(P, e) ? N[0] : void 0, M.some(wa) ? M : []) : F === "directives" || F === "ref" || C === "deferLoad" ? (y ||= F === "deferLoad", f.push(
3823
+ const M = e.compiler.shouldMinifyJsx ? [" "] : Ca(Tn($, e));
3824
+ return F === "key" ? (m = typeof N[0] == "object" && !xn($, e) ? N[0] : void 0, M.some(wa) ? M : []) : F === "directives" || F === "ref" || C === "deferLoad" ? (y ||= F === "deferLoad", f.push(
3825
3825
  ...M,
3826
3826
  ...N.flatMap(
3827
3827
  (z, K) => typeof z == "string" || K === 0 || typeof N[K - 1] == "string" ? z : [" ", z]
@@ -3842,13 +3842,13 @@ Found ${A.getText(e.sourceFile)}`
3842
3842
  throw Error(
3843
3843
  `Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
3844
3844
  );
3845
- const b = (d === oe || d === Z) && h.parts.length === 0, S = [
3845
+ const b = (d === oe || d === Z) && h.parts.length === 0, T = [
3846
3846
  "<",
3847
3847
  typeof c == "string" ? c : r,
3848
3848
  ...g,
3849
3849
  b ? `${g.length === 0 ? "" : " "}/>` : ">"
3850
- ], $ = v || b ? S : [
3851
- ...S,
3850
+ ], P = v || b ? T : [
3851
+ ...T,
3852
3852
  /**
3853
3853
  * If parent was an HTML element (e.g. `<svg>`), but children are SVG
3854
3854
  * fragments (e.g. `<circle />`, then wrap the children in their own
@@ -3859,7 +3859,7 @@ Found ${A.getText(e.sourceFile)}`
3859
3859
  typeof c == "string" ? c : r,
3860
3860
  ">"
3861
3861
  ];
3862
- return { key: m, parts: $, litTag: d };
3862
+ return { key: m, parts: P, litTag: d };
3863
3863
  }
3864
3864
  function ja(e, t) {
3865
3865
  const i = e.attributes.properties[An(e)];
@@ -4120,7 +4120,7 @@ function za(e, t, i) {
4120
4120
  return;
4121
4121
  const s = te(i);
4122
4122
  throw Error(
4123
- T(
4123
+ w(
4124
4124
  "@arcgis/lumina:resolveTagName",
4125
4125
  `Unable to resolve the definition of the "${t}" custom element. Used in ${s}. If this is coming from an external package, make sure that package is installed as a peerDependency or a dependency. If in development-only you wish to use a component package that is defined as a devDependency, then provide serve.extraDependencies option to useLumina()`
4126
4126
  )
@@ -4640,7 +4640,7 @@ function yc(e) {
4640
4640
  const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : ls(t ?? "tsconfig.json");
4641
4641
  if (i === void 0)
4642
4642
  throw Error(
4643
- T(
4643
+ w(
4644
4644
  "@arcgis/lumina:loadTypeScriptConfig",
4645
4645
  `Unable to find ${te(String(t))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`,
4646
4646
  process.cwd()
@@ -4667,7 +4667,7 @@ function On(e) {
4667
4667
  const t = e.target;
4668
4668
  if (t === void 0)
4669
4669
  throw Error(
4670
- T(
4670
+ w(
4671
4671
  "@arcgis/lumina:resolveTargetVersion",
4672
4672
  'TypeScript config must have a "target" property specified (or any parent tsconfig.json file if this config is extending another tsconfig.json)'
4673
4673
  )
@@ -4719,7 +4719,7 @@ async function vc(e, t, i) {
4719
4719
  if (typeof p == "string")
4720
4720
  return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${l.tag}>`;
4721
4721
  }
4722
- throw Error(T("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(l)}`));
4722
+ throw Error(w("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(l)}`));
4723
4723
  }).join(`
4724
4724
  `);
4725
4725
  await Promise.all(
@@ -4727,11 +4727,14 @@ async function vc(e, t, i) {
4727
4727
  const f = p === 0 ? l : u.join(r, l), y = u.join(e.dir.root, f), g = u.join(n, f);
4728
4728
  await Q(u.dirname(g), { recursive: !0 });
4729
4729
  const v = await J(y, "utf-8"), h = ce(u.dirname(f), `build/${i}`), b = `${d}<script type="module" src="${h}"><\/script>
4730
- `;
4731
- let S = v.indexOf("<style>");
4732
- if (S === -1 && (S = v.indexOf("</head>")), S === -1)
4733
- throw Error(T("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
4734
- const $ = v.slice(0, S) + b + v.slice(S), A = e.options?.build?.webApp?.transformFile?.($, g, e) ?? $;
4730
+ `, T = Math.min(
4731
+ ...[v.indexOf("<style>"), v.indexOf("<script"), v.indexOf("</head>")].filter(
4732
+ ($) => $ !== -1
4733
+ )
4734
+ );
4735
+ if (T === Number.POSITIVE_INFINITY)
4736
+ throw Error(w("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
4737
+ const P = v.slice(0, T) + b + v.slice(T), A = e.options?.build?.webApp?.transformFile?.(P, g, e) ?? P;
4735
4738
  await D(g, A, "utf-8");
4736
4739
  })
4737
4740
  ), await e.options.build?.webApp?.afterBuildEnd?.(e);
@@ -4793,14 +4796,14 @@ async function Sc(e, t, i, n, s) {
4793
4796
  const r = e.environment;
4794
4797
  if (i.minify && s)
4795
4798
  throw Error(
4796
- T(
4799
+ w(
4797
4800
  H,
4798
4801
  "Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
4799
4802
  )
4800
4803
  );
4801
4804
  if (i.sourcemap && s)
4802
4805
  throw Error(
4803
- T(
4806
+ w(
4804
4807
  H,
4805
4808
  "Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
4806
4809
  )
@@ -4940,7 +4943,7 @@ function Ec(e, t) {
4940
4943
  continue;
4941
4944
  }
4942
4945
  if (r.out.startsWith(".") || r.out.startsWith("/"))
4943
- throw Error(T(H, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
4946
+ throw Error(w(H, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
4944
4947
  s.push(r.out);
4945
4948
  }
4946
4949
  i += `"${s.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
@@ -4969,14 +4972,14 @@ function Bn(e, t) {
4969
4972
  const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
4970
4973
  let c = 0;
4971
4974
  const d = e.code.matchAll(Cc);
4972
- for (const w of d) {
4973
- const [C, L, F, N, M] = w, z = M.startsWith(He);
4974
- if (c !== 0 && c !== w.index) {
4975
- const K = e.code.slice(c, w.index);
4975
+ for (const S of d) {
4976
+ const [C, L, F, N, M] = S, z = M.startsWith(He);
4977
+ if (c !== 0 && c !== S.index) {
4978
+ const K = e.code.slice(c, S.index);
4976
4979
  s.push(K), a.push([c, K.length, 0, ""]);
4977
4980
  }
4978
- if (c = w.index + C.length, z)
4979
- a.push([w.index, C.length, 0, ""]), n.push(`"${_n(M.slice(He.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? F ?? N ?? "");
4981
+ if (c = S.index + C.length, z)
4982
+ a.push([S.index, C.length, 0, ""]), n.push(`"${_n(M.slice(He.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? F ?? N ?? "");
4980
4983
  else {
4981
4984
  const K = Wn(M, t), G = K?.isAsync === !0;
4982
4985
  if (L !== void 0) {
@@ -4987,14 +4990,14 @@ function Bn(e, t) {
4987
4990
  }
4988
4991
  if (G) {
4989
4992
  const Ye = K.oldSingleExportName === void 0 ? `{${Ae.join(",")}}` : Ae[0].split(":")[1];
4990
- a.push([w.index + 6, 0, L.length, Ye]);
4993
+ a.push([S.index + 6, 0, L.length, Ye]);
4991
4994
  }
4992
4995
  } else if (F === void 0 && N === void 0)
4993
- G && a.push([w.index + 6, 0, 0, ""]);
4996
+ G && a.push([S.index + 6, 0, 0, ""]);
4994
4997
  else {
4995
4998
  if (G)
4996
4999
  throw Error(
4997
- T(
5000
+ w(
4998
5001
  H,
4999
5002
  `Expected local import specifiers to use only named or side-effect import syntax. Found ${C} in a chunk:
5000
5003
  ${K.code}`
@@ -5010,8 +5013,8 @@ ${K.code}`
5010
5013
  }
5011
5014
  const l = xc(r);
5012
5015
  let p = e.code.slice(0, c);
5013
- for (let w = a.length - 1; w >= 0; w--) {
5014
- const [C, L, F, N] = a[w];
5016
+ for (let S = a.length - 1; S >= 0; S--) {
5017
+ const [C, L, F, N] = a[S];
5015
5018
  let M = L, z = "";
5016
5019
  if (L === 0) {
5017
5020
  const G = l();
@@ -5022,22 +5025,22 @@ ${K.code}`
5022
5025
  const m = $c.exec(e.code), f = m?.index ?? e.code.length;
5023
5026
  let y = "";
5024
5027
  if (m !== null) {
5025
- const w = m[1].split(",");
5026
- if (w.length > 1)
5027
- y = `return{${w.map((C) => {
5028
+ const S = m[1].split(",");
5029
+ if (S.length > 1)
5030
+ y = `return{${S.map((C) => {
5028
5031
  const [L, F = L] = C.split(" as ");
5029
5032
  return `${F}:${L}`;
5030
5033
  }).join(",")}}`;
5031
5034
  else {
5032
- const [C, L = C] = w[0].split(" as ");
5035
+ const [C, L = C] = S[0].split(" as ");
5033
5036
  e.oldSingleExportName = L, y = `return ${C}`;
5034
5037
  }
5035
5038
  }
5036
- const g = i.findLastIndex((w) => w.length > 0), v = i.slice(0, g + 1).join(","), b = `export default $arcgis.t(${i.length === 0 ? "_" : `([${v}])`}=>{`, S = n.join(","), $ = `${y}},${S})`;
5039
+ const g = i.findLastIndex((S) => S.length > 0), v = i.slice(0, g + 1).join(","), b = `export default $arcgis.t(${i.length === 0 ? "_" : `([${v}])`}=>{`, T = n.join(","), P = `${y}},${T})`;
5037
5040
  let A = e.code.slice(c, f);
5038
5041
  A = `${s.join("")}${A}`, A = wi(A, t);
5039
- const P = `${p}${b}${A}${$}`;
5040
- e.code = P;
5042
+ const $ = `${p}${b}${A}${P}`;
5043
+ e.code = $;
5041
5044
  }
5042
5045
  const Cc = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, $c = /export\{([^}]+)\};\n$/u, He = "@arcgis/core/";
5043
5046
  function Wn(e, t) {
@@ -5045,9 +5048,9 @@ function Wn(e, t) {
5045
5048
  return;
5046
5049
  const i = e.slice(2), n = t.get(i);
5047
5050
  if (n === void 0)
5048
- throw Error(T(H, `Failed to find the ${e} module`));
5051
+ throw Error(w(H, `Failed to find the ${e} module`));
5049
5052
  if (n.isAsync === void 0 && Bn(n, t), n.isAsync === void 0)
5050
- throw Error(T(H, `Failed to infer whether the ${e} module has top-level await`));
5053
+ throw Error(w(H, `Failed to infer whether the ${e} module has top-level await`));
5051
5054
  return n;
5052
5055
  }
5053
5056
  function wi(e, t) {
@@ -5236,7 +5239,7 @@ async function zn(e) {
5236
5239
  const n = typeof i == "string" ? void 0 : i, s = typeof i == "string" ? i : i.name, r = await Sn(s);
5237
5240
  if (r === void 0)
5238
5241
  throw Error(
5239
- T(
5242
+ w(
5240
5243
  "@arcgis/lumina:computeServeOnlyDependencies",
5241
5244
  `Unable to resolve extra dependency "${s}". Make sure it is a valid Stencil or Lumina package.`
5242
5245
  )
@@ -5267,7 +5270,7 @@ async function Rc(e) {
5267
5270
  ].join(`
5268
5271
  `);
5269
5272
  throw Error(
5270
- T(
5273
+ w(
5271
5274
  "@arcgis/lumina:buildTestSetupFile",
5272
5275
  `Unexpected loader type for the browser test environment: ${JSON.stringify(n)}`
5273
5276
  )
@@ -5328,7 +5331,7 @@ function Jc(e) {
5328
5331
  (b) => b.length > 0 ? m() : void 0
5329
5332
  ) : void 0
5330
5333
  ), g.watcher.on("unlinkDir", (h) => {
5331
- e.componentFiles.some((S) => S.startsWith(h)) && m();
5334
+ e.componentFiles.some((T) => T.startsWith(h)) && m();
5332
5335
  });
5333
5336
  function v(h) {
5334
5337
  we(h, e.dir.srcComponents) && m();
@@ -5349,10 +5352,10 @@ function Jc(e) {
5349
5352
  let h;
5350
5353
  if (e.isInStorybook) {
5351
5354
  h = await v();
5352
- const $ = e.typeScriptProgram.getSourceFile(g);
5353
- if ($ === void 0)
5355
+ const P = e.typeScriptProgram.getSourceFile(g);
5356
+ if (P === void 0)
5354
5357
  return;
5355
- if (!($.text === h)) {
5358
+ if (!(P.text === h)) {
5356
5359
  let C;
5357
5360
  await Promise.race([
5358
5361
  e._typeScriptReload.promise,
@@ -5370,11 +5373,11 @@ function Jc(e) {
5370
5373
  if (!we(g, e.dir.srcComponents))
5371
5374
  return;
5372
5375
  h ??= await v();
5373
- const S = _o(e, g, h);
5374
- if (S === void 0)
5376
+ const T = _o(e, g, h);
5377
+ if (T === void 0)
5375
5378
  return !1;
5376
- for (const $ of S) {
5377
- const A = ln($);
5379
+ for (const P of T) {
5380
+ const A = ln(P);
5378
5381
  e.server.ws.send({ type: "custom", event: "component-meta-update", data: A });
5379
5382
  }
5380
5383
  return f(), !0;
@@ -5395,7 +5398,7 @@ function Jc(e) {
5395
5398
  const St = "@arcgis/lumina:provideAssets";
5396
5399
  function he(e, t, i = Rt) {
5397
5400
  if (e.viteCommand !== "serve")
5398
- throw Error(T(St, "serveAssets() is only available when Vite is running in serve mode"));
5401
+ throw Error(w(St, "serveAssets() is only available when Vite is running in serve mode"));
5399
5402
  const n = e._serverConfigured, s = e.server.middlewares.stack.length;
5400
5403
  if (t.forEach((r) => {
5401
5404
  const a = Vn(r), c = Qn(e.dir, Xn(a)), d = Bc(e.viteConfig.base, c, e.dir.distCdn);
@@ -5463,7 +5466,7 @@ function Xn(e) {
5463
5466
  if (e.source.endsWith(u.sep)) {
5464
5467
  if (e.type === "file")
5465
5468
  throw Error(
5466
- T(
5469
+ w(
5467
5470
  St,
5468
5471
  `Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${te(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
5469
5472
  )
@@ -5547,7 +5550,7 @@ const es = (e, t) => ({
5547
5550
  }
5548
5551
  const n = i.writeBundle;
5549
5552
  if (typeof n != "function")
5550
- throw Error(T(pt, "Expected vite:reporter to declare a writeBundle() function"));
5553
+ throw Error(w(pt, "Expected vite:reporter to declare a writeBundle() function"));
5551
5554
  i.writeBundle = async function(r, a) {
5552
5555
  let c = 0, d = 0, l = 0, p = 0;
5553
5556
  const m = console.log;
@@ -5606,7 +5609,7 @@ const es = (e, t) => ({
5606
5609
  ...await uo(e)
5607
5610
  }, { loader: g, ...v } = y, h = e.environment === "development" || e.isInTest ? {
5608
5611
  "process.env.ESRI_INTERNAL": "true"
5609
- } : void 0, b = !import.meta.url.includes("node_modules"), S = {
5612
+ } : void 0, b = !import.meta.url.includes("node_modules"), T = {
5610
5613
  /**
5611
5614
  * Dependency pre-bundling by default scouts all index.html files to find
5612
5615
  * what dependencies are used. Since Lumina adds imports to index.html
@@ -5693,7 +5696,7 @@ const es = (e, t) => ({
5693
5696
  if (typeof d.setupFiles == "string" ? d.setupFiles = [...dt, d.setupFiles] : Array.isArray(d.setupFiles) ? d.setupFiles = [...dt, ...d.setupFiles] : d.setupFiles = [...dt], e.isInPuppeteerTestBackEnd) {
5694
5697
  if (p?.enabled === !0)
5695
5698
  throw Error(
5696
- T(ki, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
5699
+ w(ki, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
5697
5700
  );
5698
5701
  return {
5699
5702
  test: {
@@ -5715,7 +5718,7 @@ const es = (e, t) => ({
5715
5718
  */
5716
5719
  forceRerunTriggers: f === void 0 ? ["**/*.{ts,tsx}"] : void 0
5717
5720
  },
5718
- optimizeDeps: S,
5721
+ optimizeDeps: T,
5719
5722
  define: h
5720
5723
  };
5721
5724
  }
@@ -5745,7 +5748,7 @@ const es = (e, t) => ({
5745
5748
  }
5746
5749
  }
5747
5750
  },
5748
- optimizeDeps: S,
5751
+ optimizeDeps: T,
5749
5752
  define: h,
5750
5753
  test: {
5751
5754
  /*
@@ -5776,7 +5779,7 @@ const el = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
5776
5779
  Object.defineProperty(t, i, {
5777
5780
  get() {
5778
5781
  throw Error(
5779
- T(
5782
+ w(
5780
5783
  "@arcgis/lumina:context",
5781
5784
  `Tried to access '${String(i)}' before it was set. You can't access this property in global scope. However, it will be accessible by the time the following Vite plugin hook is called: ${e}`
5782
5785
  )
@@ -5797,7 +5800,7 @@ const el = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
5797
5800
  function me(e) {
5798
5801
  if (u.isAbsolute(e))
5799
5802
  throw Error(
5800
- T(
5803
+ w(
5801
5804
  "@arcgis/lumina:context",
5802
5805
  `Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
5803
5806
  )
@@ -5819,7 +5822,7 @@ async function is(e, t, i, n, s = R()) {
5819
5822
  return !1;
5820
5823
  if (process.env.CI)
5821
5824
  throw Error(
5822
- T(
5825
+ w(
5823
5826
  "@arcgis/lumina:updateLuminaTs",
5824
5827
  `lumina.ts is out of date. Start the vite dev server or build locally at least once to update lumina.ts and commit the updated file. Tried to write the following content:
5825
5828
 
@@ -5928,7 +5931,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
5928
5931
  return n.optimizableImports;
5929
5932
  if ("cssHref" in n)
5930
5933
  return [];
5931
- throw Error(T(Oe, `Unexpected loader type: ${JSON.stringify(n)}`));
5934
+ throw Error(w(Oe, `Unexpected loader type: ${JSON.stringify(n)}`));
5932
5935
  });
5933
5936
  e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
5934
5937
  },
@@ -5978,8 +5981,8 @@ async function al(e, t) {
5978
5981
  const p = l[1], m = ml(p), f = r.indexOf("{", l.index), y = r.indexOf("}", f), g = r.slice(0, l.index).trimEnd();
5979
5982
  let v = "";
5980
5983
  if (g.endsWith("*/")) {
5981
- const S = g.lastIndexOf("/**");
5982
- v = g.slice(S + 3, -2).trim().replaceAll(pl, "");
5984
+ const T = g.lastIndexOf("/**");
5985
+ v = g.slice(T + 3, -2).trim().replaceAll(pl, "");
5983
5986
  }
5984
5987
  const h = r.slice(f, y).match(dl)?.[1] || m, b = ul(m);
5985
5988
  d.push({
@@ -6038,7 +6041,7 @@ class x {
6038
6041
  distCdnAssets: v
6039
6042
  }, E.initialize(a.logger, d), a.root !== Ri())
6040
6043
  throw Error(
6041
- T(
6044
+ w(
6042
6045
  W,
6043
6046
  "Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2126 or contact Lumina maintainers."
6044
6047
  )
@@ -6116,7 +6119,7 @@ class x {
6116
6119
  return n;
6117
6120
  } else {
6118
6121
  if (this.viteCommand === "build" || this.isInStorybook)
6119
- throw Error(T(W, t, "Unable to find the TypeScript source file"));
6122
+ throw Error(w(W, t, "Unable to find the TypeScript source file"));
6120
6123
  {
6121
6124
  const r = this._typeScriptSourceFiles.get(t);
6122
6125
  r !== void 0 && r.text === i && (n = r);
@@ -6164,7 +6167,7 @@ class x {
6164
6167
  n === "serve" && he(this, t, i);
6165
6168
  else
6166
6169
  throw Error(
6167
- T(
6170
+ w(
6168
6171
  W,
6169
6172
  "It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
6170
6173
  )
@@ -6265,7 +6268,7 @@ const De = "@arcgis/lumina:addNonLazyImports", gl = (e) => ({
6265
6268
  l = Wi(l, e, d, c), !e.isInStorybook && a === "chunks/runtime.js" && (n = !0, l = uc(e) + l), r.code = l;
6266
6269
  }
6267
6270
  }), !n && !e.isInStorybook)
6268
- throw Error(T(De, "Expected to find a chunks/runtime.js file in the Vite's build output."));
6271
+ throw Error(w(De, "Expected to find a chunks/runtime.js file in the Vite's build output."));
6269
6272
  },
6270
6273
  async writeBundle() {
6271
6274
  if (e.isInStorybook)
@@ -6282,7 +6285,7 @@ const De = "@arcgis/lumina:addNonLazyImports", gl = (e) => ({
6282
6285
  }), (a.length > 0 || c.length > 0) && l.length === 0) {
6283
6286
  const p = te(r);
6284
6287
  throw Error(
6285
- T(
6288
+ w(
6286
6289
  De,
6287
6290
  `Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...c].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.
6288
6291
 
@@ -6298,33 +6301,33 @@ Possible causes:
6298
6301
  if (!n.has(r))
6299
6302
  return [];
6300
6303
  const d = u.dirname(r), l = be(d, e.dir.srcComponents, e), p = u.relative(e.dir.src, l);
6301
- function m(w) {
6302
- const C = za(e, w, r);
6304
+ function m(S) {
6305
+ const C = za(e, S, r);
6303
6306
  if (C === void 0)
6304
6307
  return;
6305
6308
  const L = qa(C, p);
6306
6309
  if (L !== `./${p}`)
6307
6310
  return L.startsWith(".") ? `${L}/${Ii}` : L;
6308
6311
  }
6309
- const f = new Set(a), y = new Set(c), g = Array.from(f, m).filter(j), v = (w) => `import "${w}";
6310
- `, h = g.map(v).join(""), b = /* @__PURE__ */ new Set(), S = Array.from(y, (w) => {
6311
- const C = m(w);
6312
+ const f = new Set(a), y = new Set(c), g = Array.from(f, m).filter(j), v = (S) => `import "${S}";
6313
+ `, h = g.map(v).join(""), b = /* @__PURE__ */ new Set(), T = Array.from(y, (S) => {
6314
+ const C = m(S);
6312
6315
  if (C !== void 0) {
6313
- if (f.has(w)) {
6316
+ if (f.has(S)) {
6314
6317
  E.warn(
6315
6318
  De,
6316
- `"${w}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
6319
+ `"${S}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
6317
6320
  );
6318
6321
  return;
6319
6322
  }
6320
- return b.add(v(C)), `.set("${w}", () => import("${C}"))
6323
+ return b.add(v(C)), `.set("${S}", () => import("${C}"))
6321
6324
  `;
6322
6325
  }
6323
- }).filter(j), $ = `${h}export * from "./${Et}";`, A = Array.from(b).join("") + $, P = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
6324
- ${$}
6325
- deferredLoaders${S.join("")};` : $;
6326
+ }).filter(j), P = `${h}export * from "./${Et}";`, A = Array.from(b).join("") + P, $ = T.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
6327
+ ${P}
6328
+ deferredLoaders${T.join("")};` : P;
6326
6329
  return [
6327
- D(u.join(e.dir.dist, p, Ii), P),
6330
+ D(u.join(e.dir.dist, p, Ii), $),
6328
6331
  D(u.join(e.dir.dist, p, yl), A)
6329
6332
  ];
6330
6333
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina-compiler",
3
- "version": "4.34.0-next.112",
3
+ "version": "4.34.0-next.113",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -18,9 +18,9 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
- "@arcgis/api-extractor": "4.34.0-next.112",
22
- "@arcgis/components-build-utils": "4.34.0-next.112",
23
- "@arcgis/toolkit": "4.34.0-next.112",
21
+ "@arcgis/api-extractor": "4.34.0-next.113",
22
+ "@arcgis/components-build-utils": "4.34.0-next.113",
23
+ "@arcgis/toolkit": "4.34.0-next.113",
24
24
  "chalk": "^5.4.1",
25
25
  "esbuild": "^0.25.5",
26
26
  "glob": "^11.0.3",
@@ -31,7 +31,7 @@
31
31
  "vitest-fail-on-console": "^0.7.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@arcgis/lumina": "~4.34.0-next.112",
34
+ "@arcgis/lumina": "~4.34.0-next.113",
35
35
  "lit": "^3.3.0",
36
36
  "typescript": "~5.8.3",
37
37
  "vite": "^7.0.0",