@arcgis/lumina-compiler 5.0.0-next.12 → 5.0.0-next.14

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.
@@ -1,7 +1,7 @@
1
1
  import { FileTransformer, DeclarationTextTransformer } from '../publicTypes';
2
2
  export declare const removeDeclarationFromDts: DeclarationTextTransformer;
3
3
  export declare const addCustomElementDecoratorTransformer: FileTransformer;
4
- export declare function findDeclaredComponents(code: string): readonly (readonly [string, string])[] | undefined;
4
+ export declare function findDeclaredComponent(code: string): readonly [tagName: string, className: string] | undefined;
5
5
  export declare const exportsForTests: {
6
- findDeclaredComponents: typeof findDeclaredComponents;
6
+ findDeclaredComponent: typeof findDeclaredComponent;
7
7
  };
@@ -6,7 +6,8 @@ export declare class LuminaApiExtractor extends ApiExtractor {
6
6
  protected isPathOnly: boolean;
7
7
  constructor(context: CompilerContext, isPathOnly: boolean);
8
8
  protected localCssImports?: Set<string>;
9
- protected localDeclaredComponents: Map<string, string>;
9
+ protected localTagName: string | undefined;
10
+ protected localClassName: string | undefined;
10
11
  protected indexedComponents: Map<string, ApiCustomElementDeclaration>;
11
12
  protected apiComponent: ApiCustomElementDeclaration;
12
13
  protected pairedSetter: ts.SetAccessorDeclaration | undefined;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { initializeComponentDependencies } from './dependencies/discover';
2
2
  import { updateLuminaTs } from './dependencies/updateLumina';
3
- import { findDeclaredComponents } from './extractor/declaration';
3
+ import { findDeclaredComponent } from './extractor/declaration';
4
4
  export { useLumina } from './useLumina';
5
5
  export type * from './publicTypes';
6
6
  export { inferCdnUrl } from './defaultAssetsUrl';
@@ -18,7 +18,7 @@ export declare const exportsForCodemod: {
18
18
  readonly common: Required<import('./jsxToLitHtml/config').ElementPropertyToAttributeMappings>;
19
19
  readonly perElement: Record<string, import('./jsxToLitHtml/config').ElementPropertyToAttributeMappings | undefined>;
20
20
  };
21
- findDeclaredComponents: typeof findDeclaredComponents;
21
+ findDeclaredComponent: typeof findDeclaredComponent;
22
22
  nativeEvents: Set<string>;
23
23
  svgElements: Set<string>;
24
24
  mathMlElements: Set<string>;
package/dist/index.js CHANGED
@@ -147,7 +147,7 @@ const Ut = "customElement", qs = (e, t) => {
147
147
  function zi(e) {
148
148
  const t = qi(e);
149
149
  return t === void 0 ? void 0 : t.split(`
150
- `).filter((n) => n.includes(":")).map((n) => n.replace(";", "").replaceAll('"', "").replaceAll("'", "").split(":")).map(([n, s]) => [n.trim(), s.trim()]).filter(([n]) => !n.startsWith("/") && !n.startsWith("*"));
150
+ `).filter((n) => n.includes(":")).map((n) => n.replace(";", "").replaceAll('"', "").replaceAll("'", "").split(":")).map(([n, s]) => [n.trim(), s.trim()]).filter(([n]) => !n.startsWith("/") && !n.startsWith("*"))[0];
151
151
  }
152
152
  function qi(e) {
153
153
  const t = e.indexOf("declare global {");
@@ -2437,7 +2437,7 @@ function re(e, t) {
2437
2437
  const At = "@arcgis/lumina-compiler";
2438
2438
  class ze extends fs {
2439
2439
  constructor(t, i) {
2440
- super({ isFullApiExtraction: t.isFullApiExtraction, cwd: t.dir.root }), this.context = t, this.isPathOnly = i, this.localCssImports = void 0, this.localDeclaredComponents = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.apiComponent = void 0, this.pairedSetter = void 0, this.copyDocDefinitions = void 0, this._resolvedInheritance = /* @__PURE__ */ new Map(), this.copyDocDefinitions = t.options.documentation?.copyDefinitions;
2440
+ super({ isFullApiExtraction: t.isFullApiExtraction, cwd: t.dir.root }), this.context = t, this.isPathOnly = i, this.localCssImports = void 0, this.localTagName = void 0, this.localClassName = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.apiComponent = void 0, this.pairedSetter = void 0, this.copyDocDefinitions = void 0, this._resolvedInheritance = /* @__PURE__ */ new Map(), this.copyDocDefinitions = t.options.documentation?.copyDefinitions;
2441
2441
  }
2442
2442
  extract(t) {
2443
2443
  const i = super.extract(t);
@@ -2451,9 +2451,8 @@ class ze extends fs {
2451
2451
  return i;
2452
2452
  }
2453
2453
  extractDeclarations(t) {
2454
- return this.localDeclaredComponents = new Map(
2455
- zi(t.text)?.map(([i, n]) => [n, i]) ?? []
2456
- ), this.localDeclaredComponents.size === 0 ? [] : super.extractDeclarations(t);
2454
+ const i = zi(t.text);
2455
+ return i === void 0 ? [] : (this.localTagName = i[0], this.localClassName = i[1], super.extractDeclarations(t));
2457
2456
  }
2458
2457
  extractDeclaration(t) {
2459
2458
  if (this.context.isFullApiExtraction && o.isImportDeclaration(t)) {
@@ -2471,12 +2470,9 @@ class ze extends fs {
2471
2470
  this.localCssImports ??= /* @__PURE__ */ new Set(), this.localCssImports.add(s);
2472
2471
  }
2473
2472
  extractComponentDeclaration(t) {
2474
- if (t.name === void 0)
2473
+ if (t.name === void 0 || t.name.text !== this.localClassName)
2475
2474
  return;
2476
- const i = t.name.text, n = this.localDeclaredComponents.get(i);
2477
- if (n === void 0)
2478
- return;
2479
- const s = {
2475
+ const i = t.name.text, n = this.localTagName, s = {
2480
2476
  kind: "class",
2481
2477
  customElement: !0,
2482
2478
  name: i,
@@ -7136,7 +7132,7 @@ const Fd = {
7136
7132
  initializeComponentDependencies: Tn,
7137
7133
  updateLuminaTs: rs,
7138
7134
  propertyToAttributeMappings: U,
7139
- findDeclaredComponents: zi,
7135
+ findDeclaredComponent: zi,
7140
7136
  nativeEvents: tn,
7141
7137
  svgElements: xt,
7142
7138
  mathMlElements: It,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina-compiler",
3
- "version": "5.0.0-next.12",
3
+ "version": "5.0.0-next.14",
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": "5.0.0-next.12",
22
- "@arcgis/components-build-utils": "5.0.0-next.12",
23
- "@arcgis/toolkit": "~5.0.0-next.12",
21
+ "@arcgis/api-extractor": "5.0.0-next.14",
22
+ "@arcgis/components-build-utils": "5.0.0-next.14",
23
+ "@arcgis/toolkit": "~5.0.0-next.14",
24
24
  "chalk": "^5.4.1",
25
25
  "esbuild": "^0.25.5",
26
26
  "glob": "^11.0.3",
@@ -30,7 +30,7 @@
30
30
  "vite-plugin-dts": "^4.5.4"
31
31
  },
32
32
  "peerDependencies": {
33
- "@arcgis/lumina": "~5.0.0-next.12",
33
+ "@arcgis/lumina": "~5.0.0-next.14",
34
34
  "lit": "^3.3.0",
35
35
  "typescript": "~5.8.3",
36
36
  "vite": "^7.0.0",