@arcgis/api-extractor 5.1.0-next.6 → 5.1.0-next.61

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.
@@ -26,8 +26,9 @@ export interface ApiDiffBase {
26
26
  */
27
27
  added?: true;
28
28
  /**
29
- * Whether this declaration is deprecated in the new api.json, regardless of
30
- * whether it was deprecated in the old api.json.
29
+ * Whether this declaration is deprecated in the new api.json. If declaration
30
+ * was removed, but was deprecated in the old api.json, this will show the old
31
+ * deprecation message as it points at the replacement API.
31
32
  * If the value is a string, it's the reason for the deprecation.
32
33
  * Deprecated takes precedence over added.
33
34
  *
@@ -1,8 +1,8 @@
1
- import "../typeScript-CzDhKMio.js";
2
- import "../worker-BumU_fFG.js";
1
+ import "../typeScript-CU8ez5Fg.js";
2
+ import "../worker-5fzUwZzH.js";
3
3
  import "./processing/links.js";
4
4
  import "typescript";
5
- import { A as x } from "../ApiExtractor-a7k258P9.js";
5
+ import { A as x } from "../ApiExtractor-zW-FaUfq.js";
6
6
  import "@arcgis/toolkit/function";
7
7
  export {
8
8
  x as ApiExtractor
@@ -186,7 +186,7 @@ export interface ApiExtractorTypesConfig {
186
186
  * anyway, this option deduplicates work by removing the need for you to run
187
187
  * type checking separately.
188
188
  *
189
- * @default // false if running standalone. true if running in Vite.
189
+ * @default // false if running standalone or in storybook. true if running in Vite.
190
190
  */
191
191
  readonly fullTypeCheck?: boolean;
192
192
  /**
@@ -1,13 +1,13 @@
1
1
  import "@arcgis/components-build-utils";
2
- import "../typeScript-CzDhKMio.js";
3
- import { l as n, m as A, r as C } from "../worker-BumU_fFG.js";
2
+ import "../typeScript-CU8ez5Fg.js";
3
+ import { l as n, m as A, r as C } from "../worker-5fzUwZzH.js";
4
4
  import "./processing/links.js";
5
5
  import "typescript";
6
6
  import "fs/promises";
7
7
  import "chalk";
8
8
  import "util";
9
9
  import "@arcgis/toolkit/string";
10
- import "../apiHelpers-BYzO767m.js";
10
+ import "../apiHelpers-DWMIGwi4.js";
11
11
  import "@arcgis/toolkit/function";
12
12
  import "node:fs";
13
13
  import "node:url";
@@ -1,5 +1,5 @@
1
1
  import C from "chalk";
2
- import { u as a, g as P, v as w } from "../../apiHelpers-BYzO767m.js";
2
+ import { u as a, g as P, v as w } from "../../apiHelpers-DWMIGwi4.js";
3
3
  import { kebabToPascal as I } from "@arcgis/toolkit/string";
4
4
  function R(e, n) {
5
5
  if (typeof e == "string") {
@@ -2,7 +2,7 @@ import { findPath as v, path as C, toSystemPathSeparators as y } from "@arcgis/c
2
2
  import t from "typescript";
3
3
  import E, { supportsColorStderr as S } from "chalk";
4
4
  import { styleText as w } from "util";
5
- const P = "@arcgis/api-extractor", D = "5.1.0-next.6", N = {
5
+ const P = "@arcgis/api-extractor", D = "5.1.0-next.61", N = {
6
6
  name: P,
7
7
  version: D
8
8
  };
@@ -0,0 +1,64 @@
1
+ import { findPath as v, path as C, toSystemPathSeparators as y } from "@arcgis/components-build-utils";
2
+ import t from "typescript";
3
+ import E, { supportsColorStderr as S } from "chalk";
4
+ import { styleText as w } from "util";
5
+ const P = "@arcgis/api-extractor", D = "5.1.0-next.60", N = {
6
+ name: P,
7
+ version: D
8
+ };
9
+ let u;
10
+ function A(o) {
11
+ return u ??= t.createPrinter(), u.printNode(t.EmitHint.Unspecified, o, void 0);
12
+ }
13
+ function F(o, r) {
14
+ return o.pos !== -1 && o.end !== -1 && r !== void 0 ? o.getText(r) : A(o);
15
+ }
16
+ const p = N.name, g = {
17
+ getCurrentDirectory: process.cwd,
18
+ getCanonicalFileName: (o) => o,
19
+ getNewLine: () => t.sys.newLine
20
+ }, W = function(o, { file: r, node: n, scope: s, start: i, length: c }) {
21
+ this.errorCount += 1, process.exitCode = 1, i ??= n === void 0 || n.pos === -1 ? -1 : n.getStart(r, !1);
22
+ const a = n?.end ?? -1;
23
+ c ??= a === -1 ? -1 : Math.max(1, a - i);
24
+ const e = i >= 0 && c >= 0, d = !e && s !== void 0, f = {
25
+ category: t.DiagnosticCategory.Error,
26
+ code: e ? p : x,
27
+ file: d ? void 0 : r,
28
+ start: e ? i : 0,
29
+ length: e ? c : 0,
30
+ messageText: (d ? `${E.cyan(s)}: ` : "") + o + (e || n === void 0 ? "" : `
31
+
32
+ ${F(n, r)}`)
33
+ }, l = t.formatDiagnosticsWithColorAndContext([f], g), m = S ? l : l.replaceAll($, ""), h = e ? m : m.replace(x.toString(), p);
34
+ this.config.context.logger.error(h);
35
+ }, x = 1490, $ = /\x1B\[[0-9;]*m/gu, J = w("cyan", `[${p}] `);
36
+ function U(o = process.cwd(), r, n) {
37
+ const s = r === void 0 ? v("tsconfig.json", o) : C.resolve(o, r);
38
+ if (s === void 0)
39
+ throw Error(
40
+ `Unable to find ${y(String(r))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`
41
+ );
42
+ const i = t.readConfigFile(s, t.sys.readFile);
43
+ if (i.error !== void 0)
44
+ throw Error(t.formatDiagnosticsWithColorAndContext([i.error], g));
45
+ const c = i.config, a = n ? c : {
46
+ ...c,
47
+ include: [],
48
+ files: [],
49
+ exclude: []
50
+ }, e = t.parseJsonConfigFileContent(a, t.sys, C.dirname(s)), d = 18002, f = n ? e.errors : e.errors.filter((l) => l.code !== d);
51
+ if (f.length > 0)
52
+ throw Error(t.formatDiagnosticsWithColorAndContext(f, g));
53
+ return {
54
+ configPath: s,
55
+ config: e
56
+ };
57
+ }
58
+ export {
59
+ g as a,
60
+ U as b,
61
+ W as e,
62
+ J as l,
63
+ N as p
64
+ };
@@ -1,4 +1,4 @@
1
- import { d as s, k as r, j as o, y as i, u as p, h as t, v as m, i as d, e as A, w as c, q as g, x as M, m as b, n as l } from "../apiHelpers-BYzO767m.js";
1
+ import { d as s, k as r, j as o, w as i, u as p, h as t, v as m, i as d, e as A, x as c, q as g, y as M, m as b, n as l } from "../apiHelpers-DWMIGwi4.js";
2
2
  export {
3
3
  s as apiTypeToImportType,
4
4
  r as compareClassMembers,
@@ -7,7 +7,7 @@ export interface IndexedModule {
7
7
  readonly apiModule: ApiModule;
8
8
  readonly classLike?: ApiClassDeclaration | ApiCustomElementDeclaration | ApiMixinDeclaration;
9
9
  /**
10
- * Mixins and superclasses ancestors. Sorted from most immediate to furthest
10
+ * Superclasses ancestors. Sorted from most immediate to furthest
11
11
  * ancestor.
12
12
  *
13
13
  * The type reference may refer to a local module or an external package.
@@ -1,82 +1,83 @@
1
- function y(s) {
2
- const t = g(s.modules);
3
- return k(t), t;
1
+ function y(t) {
2
+ const o = g(t.modules);
3
+ return k(o), o;
4
4
  }
5
- function g(s) {
6
- const t = /* @__PURE__ */ new Map();
7
- for (let o = 0; o < s.length; ++o) {
8
- const n = s[o];
5
+ function g(t) {
6
+ const o = /* @__PURE__ */ new Map();
7
+ for (let s = 0; s < t.length; ++s) {
8
+ const n = t[s];
9
9
  let i;
10
10
  for (let a = 0; a < n.declarations.length; ++a) {
11
- const r = n.declarations[a];
12
- if (r.kind === "class" || r.kind === "mixin") {
13
- i = r;
11
+ const e = n.declarations[a];
12
+ if (e.kind === "class" || e.kind === "mixin") {
13
+ i = e;
14
14
  break;
15
15
  }
16
16
  }
17
- t.set(n.path, {
17
+ o.set(n.path, {
18
18
  apiModule: n,
19
19
  classLike: i,
20
20
  ancestors: void 0,
21
21
  children: void 0
22
22
  });
23
23
  }
24
- return t;
24
+ return o;
25
25
  }
26
- function k(s) {
27
- for (const t of s.values())
28
- p(t, s);
26
+ function k(t) {
27
+ for (const o of t.values())
28
+ p(o, t);
29
29
  }
30
- function p(s, t) {
31
- const o = s.classLike;
32
- if (o === void 0)
30
+ function p(t, o) {
31
+ const s = t.classLike;
32
+ if (s === void 0)
33
33
  return;
34
- const n = o;
35
- if (!(s.ancestors !== void 0 || o.mixins === void 0 && n.superclass === void 0)) {
36
- if (s.ancestors ??= [], o.mixins !== void 0)
37
- for (let a = o.mixins.length - 1; a >= 0; --a)
38
- v(o.mixins[a], s, t);
39
- n.superclass !== void 0 && h(n.superclass, s, t);
34
+ const n = s;
35
+ if (!(t.ancestors !== void 0 || s.mixins === void 0 && n.superclass === void 0)) {
36
+ if (t.ancestors ??= [], s.mixins !== void 0)
37
+ for (let a = s.mixins.length - 1; a >= 0; --a)
38
+ f(s.mixins[a], t, o);
39
+ n.superclass !== void 0 && v(n.superclass, t, o);
40
40
  }
41
41
  }
42
- function v(s, t, o) {
43
- if (s.module !== void 0 && s.package === void 0) {
44
- const n = o.get(s.module);
45
- p(n, o), n.children ??= [], n.children.push(t);
42
+ function f(t, o, s) {
43
+ if (t.module !== void 0 && t.package === void 0) {
44
+ const n = s.get(t.module);
45
+ if (n === void 0)
46
+ return;
47
+ p(n, s), n.children ??= [], n.children.push(o);
46
48
  }
47
- t.ancestors.push(s);
48
49
  }
49
- function h(s, t, o) {
50
- if (!(s.module !== void 0 && s.package === void 0)) {
51
- t.ancestors.push(s);
50
+ function v(t, o, s) {
51
+ if (!(t.module !== void 0 && t.package === void 0)) {
52
+ o.ancestors.push(t);
52
53
  return;
53
54
  }
54
- const i = o.get(s.module);
55
- p(i, o), i.children ??= [], i.children.push(t);
55
+ const i = s.get(t.module);
56
+ p(i, s), i.children ??= [], i.children.push(o);
56
57
  const a = i.classLike;
57
- if (a.kind === "mixin" && a.name !== s.name && s.name !== "default") {
58
+ if (a.kind === "mixin" && a.name !== t.name && t.name !== "default") {
58
59
  const u = i.apiModule.declarations;
59
- for (let e = 0; e < u.length; ++e) {
60
- const f = u[e];
61
- if (f.name === s.name) {
62
- const l = f;
60
+ for (let r = 0; r < u.length; ++r) {
61
+ const d = u[r];
62
+ if (d.name === t.name) {
63
+ const l = d;
63
64
  for (let m = l.supertypes.length - 1; m >= 1; --m) {
64
- const c = l.supertypes[m], d = c.module === void 0 && c.package === void 0 ? {
65
+ const c = l.supertypes[m], h = c.module === void 0 && c.package === void 0 ? {
65
66
  name: c.name,
66
- module: s.module,
67
+ module: t.module,
67
68
  package: void 0,
68
69
  viewUrl: c.viewUrl,
69
70
  typeArguments: c.typeArguments
70
71
  } : c;
71
- v(d, t, o);
72
+ f(h, o, s);
72
73
  }
73
- h(l.supertypes[0], t, o);
74
+ v(l.supertypes[0], o, s);
74
75
  break;
75
76
  }
76
77
  }
77
78
  } else
78
- t.ancestors.push(s);
79
- i.ancestors !== void 0 && t.ancestors.push(...i.ancestors);
79
+ o.ancestors.push(t);
80
+ i.ancestors !== void 0 && o.ancestors.push(...i.ancestors);
80
81
  }
81
82
  export {
82
83
  y as createIndex
@@ -1,28 +1,30 @@
1
- import { l as T, m as J } from "../worker-BumU_fFG.js";
2
- import { A as b, w as S } from "../ApiExtractor-a7k258P9.js";
3
- import { p as k, l as A } from "../typeScript-CzDhKMio.js";
4
- import { writeFile as C } from "node:fs/promises";
1
+ import { l as O, m as J } from "../worker-5fzUwZzH.js";
2
+ import { A as S, w as T } from "../ApiExtractor-zW-FaUfq.js";
3
+ import { p as A, l as C } from "../typeScript-CU8ez5Fg.js";
4
+ import { writeFile as M } from "node:fs/promises";
5
5
  import { path as w } from "@arcgis/components-build-utils";
6
- const M = k.name;
7
- function V(s = {}) {
8
- let t = !1, h = !1, e, i, c, l, E = !0, v = !1, f, m, u, y, p;
9
- async function x(d, r) {
10
- if (r.dtsFiles !== void 0 && u !== "") {
6
+ const N = A.name;
7
+ function $(s = {}) {
8
+ let t = !1, v = !1, e, o, c, l, E = !0, h = !1, f, m, u, y, p;
9
+ async function x(d, n) {
10
+ if (n.dtsFiles !== void 0 && u !== "") {
11
11
  const g = w.join(w.resolve(p, u), "/");
12
- await S(g, !1, d.changedDtsFiles ?? r.dtsFiles);
12
+ await T(g, !1, d.changedDtsFiles ?? n.dtsFiles);
13
13
  }
14
- y !== "" && await C(
14
+ y !== "" && await M(
15
15
  y,
16
- d.config.context.environment === "production" ? JSON.stringify(r.apiJson) : JSON.stringify(r.apiJson, null, 2)
16
+ d.config.context.environment === "production" ? JSON.stringify(n.apiJson) : JSON.stringify(n.apiJson, null, 2)
17
17
  );
18
18
  }
19
19
  return {
20
- name: M,
20
+ name: N,
21
21
  async configResolved(d) {
22
22
  if (e = d, t = e.command === "build", !t && s.serve?.extract !== !0)
23
23
  return;
24
- h = (t ? e.build.watch : e.server.watch) !== null, p = e.configFile === void 0 ? e.root : w.dirname(e.configFile);
25
- const r = {
24
+ v = (t ? e.build.watch : e.server.watch) !== null;
25
+ const n = e.resolve.conditions.includes("storybook");
26
+ p = e.configFile === void 0 ? e.root : w.dirname(e.configFile);
27
+ const g = {
26
28
  context: {
27
29
  // Handled by Vite
28
30
  emptyDtsEmitPath: !1,
@@ -33,11 +35,11 @@ function V(s = {}) {
33
35
  // It is desirable to type-check as part of build. Thus, we can do
34
36
  // typed extraction essentially for free.
35
37
  typeCheckedExtraction: !0,
36
- fullTypeCheck: t,
37
- afterDiagnostic(o) {
38
- if (o.length > 0 && !h) {
39
- const W = new Error("TypeScript errors reported. See error messages above");
40
- throw W.stack = "", W;
38
+ fullTypeCheck: t && !n,
39
+ afterDiagnostic(i) {
40
+ if (i.length > 0 && !v) {
41
+ const b = new Error("TypeScript errors reported. See error messages above");
42
+ throw b.stack = "", b;
41
43
  }
42
44
  }
43
45
  },
@@ -49,35 +51,35 @@ function V(s = {}) {
49
51
  // if desired.
50
52
  clearScreen: !1,
51
53
  skipWritingUnchanged: d.build.emptyOutDir === !1,
52
- onUpdate(o) {
53
- f = o.then((n) => (c = n ?? c, f = void 0, clearTimeout(m), t && !v && n !== void 0 && (n.changedModules.length > 0 || n.removedModules.length > 0) && (m = setTimeout(() => {
54
- x(i, n);
55
- }, 250)), n));
54
+ onUpdate(i) {
55
+ f = i.then((a) => (c = a ?? c, f = void 0, clearTimeout(m), t && !h && a !== void 0 && (a.changedModules.length > 0 || a.removedModules.length > 0) && (m = setTimeout(() => {
56
+ x(o, a);
57
+ }, 250)), a));
56
58
  }
57
59
  }
58
- }, g = s.configFilePath === "" ? void 0 : await T(p, s.configFilePath), P = s.unsafeConfigOverride ?? {}, F = g === void 0 ? r : J(r, g), a = P === void 0 ? F : J(F, P);
59
- u = t ? a.context?.dtsEmitPath ?? e.build.outDir : "", y = t ? a.context?.apiJsonEmitPath ?? "" : "";
60
- const D = a.context?.logger ?? e.logger ?? console, B = {
61
- ...a,
60
+ }, P = s.configFilePath === "" ? void 0 : await O(p, s.configFilePath), F = s.unsafeConfigOverride ?? {}, D = P === void 0 ? g : J(g, P), r = F === void 0 ? D : J(D, F);
61
+ u = t ? r.context?.dtsEmitPath ?? e.build.outDir : "", y = t ? r.context?.apiJsonEmitPath ?? "" : "";
62
+ const W = r.context?.logger ?? e.logger ?? console, k = {
63
+ ...r,
62
64
  context: {
63
- ...a.context,
65
+ ...r.context,
64
66
  dtsEmitPath: "",
65
67
  apiJsonEmitPath: "",
66
68
  logger: {
67
- info(o) {
68
- !t || o.startsWith(`${A}Wrote `) || D.info(o);
69
+ info(i) {
70
+ !t || i.startsWith(`${C}Wrote `) || W.info(i);
69
71
  },
70
- error(o) {
71
- D.error(o);
72
+ error(i) {
73
+ W.error(i);
72
74
  }
73
75
  }
74
76
  },
75
77
  types: {
76
- ...a.types,
77
- forceProduceDts: a.types?.forceProduceDts === !0 || u !== ""
78
+ ...r.types,
79
+ forceProduceDts: r.types?.forceProduceDts === !0 || u !== ""
78
80
  }
79
81
  };
80
- i = new b(B), s.afterExtractorCreated?.(i);
82
+ o = new S(k), s.afterExtractorCreated?.(o);
81
83
  },
82
84
  /**
83
85
  * TypeScript reads files directly from the file system - Vite's
@@ -87,10 +89,10 @@ function V(s = {}) {
87
89
  * match what "npx tsc" would report.
88
90
  */
89
91
  async buildStart() {
90
- v = !0, clearTimeout(m), !(i === void 0 || !E) && (E = !1, h ? l = await i.watch() : c = await i.run());
92
+ h = !0, clearTimeout(m), !(o === void 0 || !E) && (E = !1, v ? l = await o.watch() : c = await o.run());
91
93
  },
92
94
  async writeBundle() {
93
- clearTimeout(m), f !== void 0 && await f, i !== void 0 && c !== void 0 && await x(i, c), v = !1;
95
+ clearTimeout(m), f !== void 0 && await f, o !== void 0 && c !== void 0 && await x(o, c), h = !1;
94
96
  },
95
97
  // Fires if dev server is closed programmatically. Ctrl+C is handled by Node
96
98
  async closeBundle() {
@@ -103,5 +105,5 @@ function V(s = {}) {
103
105
  };
104
106
  }
105
107
  export {
106
- V as useApiExtractor
108
+ $ as useApiExtractor
107
109
  };
@@ -1,6 +1,6 @@
1
1
  import "@arcgis/components-build-utils";
2
2
  import "typescript";
3
- import { b as t } from "../typeScript-CzDhKMio.js";
3
+ import { b as t } from "../typeScript-CU8ez5Fg.js";
4
4
  export {
5
5
  t as loadTypeScriptConfig
6
6
  };