@arcgis/api-extractor 5.2.0-next.123 → 5.2.0-next.125

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,5 +1,5 @@
1
1
  import { writeFile as r, readFile as d } from "node:fs/promises";
2
- import { diffApiJson as m } from "./diff/diffApiJson.js";
2
+ import { diffApiJson as m } from "../diff/diffApiJson.js";
3
3
  async function k({
4
4
  oldPath: t,
5
5
  newPath: i,
@@ -9,12 +9,12 @@ async function k({
9
9
  const c = f(t), w = f(i), p = await c, l = await w, n = m(p, l);
10
10
  if (typeof o == "string")
11
11
  if (o.endsWith(".md")) {
12
- const { apiDiffToMarkdown: s } = await import("./diff/apiDiffToMarkdown.js"), a = s(n, e);
12
+ const { apiDiffToMarkdown: s } = await import("../diff/apiDiffToMarkdown.js"), a = s(n, e);
13
13
  await r(o, a, "utf-8");
14
14
  } else
15
15
  await r(o, JSON.stringify(n, null, 2), "utf-8");
16
16
  else {
17
- const { apiDiffToMarkdown: s } = await import("./diff/apiDiffToMarkdown.js"), a = s(n, e);
17
+ const { apiDiffToMarkdown: s } = await import("../diff/apiDiffToMarkdown.js"), a = s(n, e);
18
18
  console.log(a);
19
19
  }
20
20
  }
@@ -4,18 +4,18 @@ import { retrievePackageJson as U } from "@arcgis/node-toolkit/packageJson";
4
4
  import { loadTypeScriptConfig as b } from "@arcgis/node-toolkit/vite/typeScript";
5
5
  import { identity as d } from "@arcgis/toolkit/function";
6
6
  import { pathToFileURL as I } from "node:url";
7
- import { getDefaultBasePath as J } from "./extractor/processing/links.js";
8
- const w = "@arcgis/api-extractor", L = "1.0.0-0", A = {
9
- name: w,
10
- version: L
11
- }, T = "developers.arcgis.com", k = "next.gha.afd.arcgis.com";
7
+ import { getDefaultBasePath as J } from "../extractor/processing/links.js";
8
+ const L = "@arcgis/api-extractor", w = "1.0.0-0", A = {
9
+ name: L,
10
+ version: w
11
+ }, C = "developers.arcgis.com", k = "next.gha.afd.arcgis.com";
12
12
  function N(e) {
13
13
  if (e.isResolvedConfig === !0)
14
14
  return e;
15
- const t = e.context, o = e.types, n = e.documentation, r = `${t?.cwd === void 0 ? E() : y.resolve(t?.cwd)}/`, s = t?.packageJson ?? U(r);
16
- let c = t?.basePath ?? "src/";
17
- c.endsWith("/") || (c += "/");
18
- const m = "customElements" in s && "@arcgis/lumina" in (s.dependencies ?? {}), l = o?.typeCheckedExtraction ?? m, p = o?.fullTypeCheck ?? !1, a = o?.typeScriptConfig ?? (l || p ? b(r, o?.typeScriptConfigPath, !0) : {
15
+ const t = e.context, n = e.types, o = e.documentation, r = `${t?.cwd === void 0 ? E() : y.resolve(t?.cwd)}/`, c = t?.packageJson ?? U(r);
16
+ let s = t?.basePath ?? "src/";
17
+ s.endsWith("/") || (s += "/");
18
+ const m = "customElements" in c && "@arcgis/lumina" in (c.dependencies ?? {}), p = n?.typeCheckedExtraction ?? m, l = n?.fullTypeCheck ?? !1, a = n?.typeScriptConfig ?? (p || l ? b(r, n?.typeScriptConfigPath, !0) : {
19
19
  configPath: "",
20
20
  config: {
21
21
  options: {},
@@ -23,7 +23,7 @@ function N(e) {
23
23
  errors: []
24
24
  }
25
25
  });
26
- if (o?.typeScriptConfig?.config.fileNames.length === 0)
26
+ if (n?.typeScriptConfig?.config.fileNames.length === 0)
27
27
  throw Error(
28
28
  `${A.name}: Provided types.typeScriptConfig has no included files. If you used loadTypeScriptConfig, make sure to set resolveIncludedFiles to true.`
29
29
  );
@@ -32,12 +32,12 @@ function N(e) {
32
32
  ...a.config,
33
33
  options: {
34
34
  ...a.config.options,
35
- ...o?.compilerOptions
35
+ ...n?.compilerOptions
36
36
  }
37
37
  },
38
38
  configPath: a.configPath
39
- }, g = t?.dtsEmitPath === void 0 || t?.dtsEmitPath === "" ? "" : `${y.resolve(r, t.dtsEmitPath)}/`, x = g !== "", P = t?.environment ?? "production", u = P === "development", v = t?.emptyDtsEmitPath ?? (!u && x), D = n?.omitInternal ?? !1, C = o?.forceProduceDts ?? !1;
40
- if (D && (x || C))
39
+ }, g = t?.dtsEmitPath === void 0 || t?.dtsEmitPath === "" ? "" : `${y.resolve(r, t.dtsEmitPath)}/`, x = g !== "", P = t?.environment ?? "production", u = P === "development", v = t?.emptyDtsEmitPath ?? (!u && x), D = o?.omitInternal ?? !1, T = n?.forceProduceDts ?? !1;
40
+ if (D && (x || T))
41
41
  throw Error(
42
42
  "omitInternal must be false if emitting .d.ts files in order to produce functional types for internal APIs."
43
43
  );
@@ -49,8 +49,8 @@ function N(e) {
49
49
  apiJsonEmitPath: t?.apiJsonEmitPath ?? "",
50
50
  environment: P,
51
51
  cwd: r,
52
- basePath: c,
53
- packageJson: s,
52
+ basePath: s,
53
+ packageJson: c,
54
54
  logger: t?.logger ?? {
55
55
  // We namespace manually
56
56
  // eslint-disable-next-line webgis/consistent-logging
@@ -64,31 +64,32 @@ function N(e) {
64
64
  supportApplyMixinsSyntax: t?.supportApplyMixinsSyntax ?? !1
65
65
  },
66
66
  types: {
67
- typeCheckedExtraction: l,
68
- fullTypeCheck: p,
69
- afterDiagnostic: o?.afterDiagnostic ?? d,
70
- typeScriptInstanceCreated: o?.typeScriptInstanceCreated ?? d,
67
+ typeCheckedExtraction: p,
68
+ fullTypeCheck: l,
69
+ afterDiagnostic: n?.afterDiagnostic ?? d,
70
+ typeScriptInstanceCreated: n?.typeScriptInstanceCreated ?? d,
71
71
  typeScriptConfigPath: a.configPath,
72
72
  typeScriptConfig: h,
73
73
  compilerOptions: h.config.options,
74
- declarationTextTransformers: o?.declarationTextTransformers ?? [],
75
- typeReplacements: o?.typeReplacements ?? {},
76
- forceProduceDts: C
74
+ declarationTextTransformers: n?.declarationTextTransformers ?? [],
75
+ typeReplacements: n?.typeReplacements ?? {},
76
+ forceProduceDts: T
77
77
  },
78
78
  documentation: {
79
- copyDocDefinitions: n?.copyDocDefinitions ?? {},
80
- noInheritMembers: n?.noInheritMembers ?? {},
79
+ copyDocDefinitions: o?.copyDocDefinitions ?? {},
80
+ noInheritMembers: o?.noInheritMembers ?? {},
81
81
  omitInternal: D,
82
- publicStoryUrlPrefix: n?.publicStoryUrlPrefix ?? !1,
83
- getComponentDocsUrl: n?.getComponentDocsUrl ?? !1,
84
- getComponentDemoUrl: n?.getComponentDemoUrl ?? !1,
85
- host: n?.host ?? (u ? k : T),
86
- alternativeHost: n?.alternativeHost ?? (u ? T : k),
87
- basePath: n?.basePath ?? J(s.name.split("/").at(-1))
82
+ publicStoryUrlPrefix: o?.publicStoryUrlPrefix ?? !1,
83
+ getComponentDocsUrl: o?.getComponentDocsUrl ?? !1,
84
+ getComponentDemoUrl: o?.getComponentDemoUrl ?? !1,
85
+ host: o?.host ?? (u ? k : C),
86
+ alternativeHost: o?.alternativeHost ?? (u ? C : k),
87
+ basePath: o?.basePath ?? J(c.name.split("/").at(-1))
88
88
  },
89
89
  verify: {
90
90
  typeCheckTypes: e.verify?.typeCheckTypes ?? !1,
91
91
  filterTypeCheckDiagnostic: e.verify?.filterTypeCheckDiagnostic ?? (() => !0),
92
+ filterUnreferencedType: e.verify?.filterUnreferencedType ?? (() => !0),
92
93
  detectBrokenLinks: e.verify?.detectBrokenLinks ?? !0
93
94
  },
94
95
  watch: {
@@ -97,7 +98,7 @@ function N(e) {
97
98
  // Shorter than TypeScript's default of 250ms as we are blocked until this
98
99
  // timeout is complete. Short timeout for unchecked extraction as it is fast,
99
100
  // so doesn't need long debounce.
100
- debounceTime: e.watch?.debounceTime ?? (l || p ? 50 : 20),
101
+ debounceTime: e.watch?.debounceTime ?? (p || l ? 50 : 20),
101
102
  clearScreen: e.watch?.clearScreen ?? !1,
102
103
  skipWritingUnchanged: v ? !1 : e.watch?.skipWritingUnchanged ?? !0
103
104
  },
@@ -106,37 +107,37 @@ function N(e) {
106
107
  };
107
108
  }
108
109
  async function V(e, t) {
109
- const o = t !== void 0, n = e ?? process.cwd(), i = y.resolve(n, t ?? "api-extractor.config.ts"), r = await S(i);
110
- if (o && !r)
110
+ const n = t !== void 0, o = e ?? process.cwd(), i = y.resolve(o, t ?? "api-extractor.config.ts"), r = await S(i);
111
+ if (n && !r)
111
112
  throw Error(`The provided config file at ${i} does not exist.`);
112
113
  if (!r)
113
114
  return e === void 0 ? {} : { context: { cwd: e } };
114
- const s = (await import(I(i).href)).config;
115
+ const c = (await import(I(i).href)).config;
115
116
  return {
116
- ...s,
117
+ ...c,
117
118
  context: {
118
- ...s.context,
119
- cwd: s.context?.cwd ?? y.dirname(i)
119
+ ...c.context,
120
+ cwd: c.context?.cwd ?? y.dirname(i)
120
121
  }
121
122
  };
122
123
  }
123
124
  function j(e, t) {
124
- const o = e.context, n = t.context, i = e.types, r = t.types, s = e.documentation, c = t.documentation, m = e.verify, l = t.verify, p = e.watch, a = t.watch;
125
+ const n = e.context, o = t.context, i = e.types, r = t.types, c = e.documentation, s = t.documentation, m = e.verify, p = t.verify, l = e.watch, a = t.watch;
125
126
  return {
126
127
  isResolvedConfig: e.isResolvedConfig || t.isResolvedConfig || void 0,
127
128
  context: {
128
- dtsEmitPath: n?.dtsEmitPath ?? o?.dtsEmitPath,
129
- emptyDtsEmitPath: n?.emptyDtsEmitPath ?? o?.emptyDtsEmitPath,
130
- apiJsonEmitPath: n?.apiJsonEmitPath ?? o?.apiJsonEmitPath,
131
- environment: n?.environment ?? o?.environment,
132
- cwd: n?.cwd ?? o?.cwd,
133
- basePath: n?.basePath ?? o?.basePath,
134
- packageJson: n?.packageJson ?? o?.packageJson,
135
- logger: n?.logger ?? o?.logger,
136
- excludedDirectories: n?.excludedDirectories ?? o?.excludedDirectories,
137
- isLuminaMinimalExtraction: n?.isLuminaMinimalExtraction ?? o?.isLuminaMinimalExtraction,
138
- includeLuminaPrivateComponents: n?.includeLuminaPrivateComponents ?? o?.includeLuminaPrivateComponents,
139
- supportApplyMixinsSyntax: n?.supportApplyMixinsSyntax ?? o?.supportApplyMixinsSyntax ?? !1
129
+ dtsEmitPath: o?.dtsEmitPath ?? n?.dtsEmitPath,
130
+ emptyDtsEmitPath: o?.emptyDtsEmitPath ?? n?.emptyDtsEmitPath,
131
+ apiJsonEmitPath: o?.apiJsonEmitPath ?? n?.apiJsonEmitPath,
132
+ environment: o?.environment ?? n?.environment,
133
+ cwd: o?.cwd ?? n?.cwd,
134
+ basePath: o?.basePath ?? n?.basePath,
135
+ packageJson: o?.packageJson ?? n?.packageJson,
136
+ logger: o?.logger ?? n?.logger,
137
+ excludedDirectories: o?.excludedDirectories ?? n?.excludedDirectories,
138
+ isLuminaMinimalExtraction: o?.isLuminaMinimalExtraction ?? n?.isLuminaMinimalExtraction,
139
+ includeLuminaPrivateComponents: o?.includeLuminaPrivateComponents ?? n?.includeLuminaPrivateComponents,
140
+ supportApplyMixinsSyntax: o?.supportApplyMixinsSyntax ?? n?.supportApplyMixinsSyntax ?? !1
140
141
  },
141
142
  types: {
142
143
  typeCheckedExtraction: r?.typeCheckedExtraction ?? i?.typeCheckedExtraction,
@@ -154,34 +155,35 @@ function j(e, t) {
154
155
  forceProduceDts: r?.forceProduceDts ?? i?.forceProduceDts
155
156
  },
156
157
  documentation: {
157
- copyDocDefinitions: c?.copyDocDefinitions ?? s?.copyDocDefinitions,
158
- noInheritMembers: c?.noInheritMembers ?? s?.noInheritMembers,
159
- omitInternal: c?.omitInternal ?? s?.omitInternal,
160
- publicStoryUrlPrefix: c?.publicStoryUrlPrefix ?? s?.publicStoryUrlPrefix,
161
- getComponentDocsUrl: c?.getComponentDocsUrl ?? s?.getComponentDocsUrl,
162
- getComponentDemoUrl: c?.getComponentDemoUrl ?? s?.getComponentDemoUrl,
163
- host: c?.host ?? s?.host,
164
- alternativeHost: c?.alternativeHost ?? s?.alternativeHost,
165
- basePath: c?.basePath ?? s?.basePath
158
+ copyDocDefinitions: s?.copyDocDefinitions ?? c?.copyDocDefinitions,
159
+ noInheritMembers: s?.noInheritMembers ?? c?.noInheritMembers,
160
+ omitInternal: s?.omitInternal ?? c?.omitInternal,
161
+ publicStoryUrlPrefix: s?.publicStoryUrlPrefix ?? c?.publicStoryUrlPrefix,
162
+ getComponentDocsUrl: s?.getComponentDocsUrl ?? c?.getComponentDocsUrl,
163
+ getComponentDemoUrl: s?.getComponentDemoUrl ?? c?.getComponentDemoUrl,
164
+ host: s?.host ?? c?.host,
165
+ alternativeHost: s?.alternativeHost ?? c?.alternativeHost,
166
+ basePath: s?.basePath ?? c?.basePath
166
167
  },
167
168
  verify: {
168
- typeCheckTypes: l?.typeCheckTypes ?? m?.typeCheckTypes,
169
- filterTypeCheckDiagnostic: l?.filterTypeCheckDiagnostic ?? m?.filterTypeCheckDiagnostic,
170
- detectBrokenLinks: l?.detectBrokenLinks ?? m?.detectBrokenLinks
169
+ typeCheckTypes: p?.typeCheckTypes ?? m?.typeCheckTypes,
170
+ filterTypeCheckDiagnostic: p?.filterTypeCheckDiagnostic ?? m?.filterTypeCheckDiagnostic,
171
+ filterUnreferencedType: p?.filterUnreferencedType ?? m?.filterUnreferencedType,
172
+ detectBrokenLinks: p?.detectBrokenLinks ?? m?.detectBrokenLinks
171
173
  },
172
174
  watch: {
173
- onUpdate: f(a?.onUpdate, p?.onUpdate),
174
- debounceTime: a?.debounceTime ?? p?.debounceTime,
175
- clearScreen: a?.clearScreen ?? p?.clearScreen,
176
- skipWritingUnchanged: a?.skipWritingUnchanged ?? p?.skipWritingUnchanged
175
+ onUpdate: f(a?.onUpdate, l?.onUpdate),
176
+ debounceTime: a?.debounceTime ?? l?.debounceTime,
177
+ clearScreen: a?.clearScreen ?? l?.clearScreen,
178
+ skipWritingUnchanged: a?.skipWritingUnchanged ?? l?.skipWritingUnchanged
177
179
  },
178
180
  strict: t.strict ?? e.strict,
179
181
  afterApiJsonCreate: f(t.afterApiJsonCreate, e.afterApiJsonCreate)
180
182
  };
181
183
  }
182
184
  function f(e, t) {
183
- const o = t === d ? void 0 : t, n = e === d ? void 0 : e;
184
- return o !== void 0 && n !== void 0 ? ((...i) => (o(...i), n(...i))) : n ?? o;
185
+ const n = t === d ? void 0 : t, o = e === d ? void 0 : e;
186
+ return n !== void 0 && o !== void 0 ? ((...i) => (n(...i), o(...i))) : o ?? n;
185
187
  }
186
188
  export {
187
189
  V as l,
package/dist/cli.js CHANGED
@@ -36,7 +36,7 @@ o.command("diff").description("Produce a diff of two api.json files").requiredOp
36
36
  "Base URL for documentation links. Used only if output format is Markdown",
37
37
  "https://developers.arcgis.com/javascript/latest/references/core/"
38
38
  ).action(async (t) => {
39
- const { diffApiCli: e } = await import("./cli-7PX_wNxb.js");
39
+ const { diffApiCli: e } = await import("./chunks/cli.js");
40
40
  await e({
41
41
  oldPath: t.old,
42
42
  newPath: t.new,
@@ -1,7 +1,7 @@
1
- import "../config-C9uAPo7G.js";
1
+ import "../chunks/config.js";
2
2
  import "./processing/links.js";
3
3
  import "typescript";
4
- import { A as x } from "../ApiExtractor-CvENLVIq.js";
4
+ import { A as x } from "../chunks/ApiExtractor.js";
5
5
  import "@arcgis/toolkit/function";
6
6
  import "@arcgis/node-toolkit/workspace";
7
7
  export {
@@ -3,7 +3,7 @@ import type { PackageJson } from "@arcgis/node-toolkit/packageJson";
3
3
  import type { CopyDocDefinitions } from "./extractors/copyDoc.js";
4
4
  import type { ApiExtractor } from "./ApiExtractor.js";
5
5
  import type { TypeScriptConfigResult } from "@arcgis/node-toolkit/vite/typeScript";
6
- import type { ApiModule } from "../apiJson.js";
6
+ import type { ApiInterfaceDeclaration, ApiModule } from "../apiJson.js";
7
7
  import type { ApiExtractorResult } from "./types.js";
8
8
 
9
9
  export interface ApiExtractorConfig {
@@ -379,6 +379,23 @@ export interface ApiExtractorVerifyConfig {
379
379
  * ```
380
380
  */
381
381
  filterTypeCheckDiagnostic?(diagnostic: ts.Diagnostic): boolean;
382
+ /**
383
+ * Return false to suppress an unreferenced exported type error when
384
+ * [ApiExtractorVerifyConfig](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/config/#ApiExtractorVerifyConfig-typeCheckTypes) is enabled.
385
+ *
386
+ * Usually, types that are not referenced by any runtime API are a mistake.
387
+ * Use this option to suppress intentional cases or backwards compatibility
388
+ * cases.
389
+ *
390
+ * @param declaration - The unreferenced interface or type alias.
391
+ * @param module - The module containing the declaration.
392
+ * @example
393
+ * ```ts
394
+ * filterUnreferencedType: (declaration, module) =>
395
+ * !(module.path === "types" && declaration.name === "StandaloneType"),
396
+ * ```
397
+ */
398
+ filterUnreferencedType?(declaration: ApiInterfaceDeclaration, module: ApiModule): boolean;
382
399
  /**
383
400
  * @deprecated REFACTOR: Drop this flag in 5.1
384
401
  * @default false
@@ -3,7 +3,7 @@ import "@arcgis/node-toolkit/path";
3
3
  import "@arcgis/node-toolkit/packageJson";
4
4
  import "@arcgis/node-toolkit/vite/typeScript";
5
5
  import "@arcgis/toolkit/function";
6
- import { l as f, m as g, r as x } from "../config-C9uAPo7G.js";
6
+ import { l as f, m as g, r as x } from "../chunks/config.js";
7
7
  import "node:url";
8
8
  import "./processing/links.js";
9
9
  export {
@@ -1,6 +1,6 @@
1
1
  import { styleText as C } from "node:util";
2
2
  import { emitJsDocError as a, getApiNodeLabel as h } from "../../utils/apiHelpers.js";
3
- import { c as y } from "../../privateContext-DR6YTcm2.js";
3
+ import { c as y } from "../../chunks/privateContext.js";
4
4
  import { kebabToPascal as I } from "@arcgis/toolkit/string";
5
5
  function W(e, n) {
6
6
  if (typeof e == "string") {
@@ -1,4 +1,4 @@
1
- import { c as f } from "../privateContext-DR6YTcm2.js";
1
+ import { c as f } from "../chunks/privateContext.js";
2
2
  const g = (e) => e.kind === "method", v = (e) => e.kind === "field";
3
3
  function h(e, n) {
4
4
  const o = e.sourcePath, i = n.sourcePath;
@@ -1,4 +1,4 @@
1
- import { f as l } from "../privateContext-DR6YTcm2.js";
1
+ import { f as l } from "../chunks/privateContext.js";
2
2
  function m(t, r, i, e, n, o) {
3
3
  return `${`${r ? "export default " : "export "}${t ? "abstract " : ""}`}class ${i}${c(e)}${n === void 0 ? "" : ` extends ${n}`} {${o}}`;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { p as O, l as S, m as J } from "../config-C9uAPo7G.js";
2
- import { A as T, l as A, w as C } from "../ApiExtractor-CvENLVIq.js";
1
+ import { p as O, l as S, m as J } from "../chunks/config.js";
2
+ import { A as T, l as A, w as C } from "../chunks/ApiExtractor.js";
3
3
  import { writeFile as M } from "node:fs/promises";
4
4
  import { path as w } from "@arcgis/node-toolkit/path";
5
5
  const N = O.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/api-extractor",
3
- "version": "5.2.0-next.123",
3
+ "version": "5.2.0-next.125",
4
4
  "description": "Documentation engine for WebGIS SDK packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -48,8 +48,8 @@
48
48
  ],
49
49
  "license": "SEE LICENSE IN LICENSE.md",
50
50
  "dependencies": {
51
- "@arcgis/node-toolkit": "5.2.0-next.123",
52
- "@arcgis/toolkit": "5.2.0-next.123",
51
+ "@arcgis/node-toolkit": "5.2.0-next.125",
52
+ "@arcgis/toolkit": "5.2.0-next.125",
53
53
  "@commander-js/extra-typings": "^15.0.0",
54
54
  "commander": "^15.0.0",
55
55
  "tslib": "^2.8.1"