@arcgis/api-extractor 5.0.0-next.14 → 5.0.0-next.141

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 (56) hide show
  1. package/dist/ApiExtractor-DIfug_xm.js +2644 -0
  2. package/dist/apiJson.d.ts +783 -1011
  3. package/dist/cli.js +38 -0
  4. package/dist/compilerHints.d.ts +62 -0
  5. package/dist/diff/diffApiJson.d.ts +26 -3
  6. package/dist/diff/diffApiJson.js +142 -0
  7. package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
  8. package/dist/diff/fetchApiJsonFromNpm.js +9 -0
  9. package/dist/diff/types.d.ts +80 -49
  10. package/dist/diffTypes/index.d.ts +21 -0
  11. package/dist/diffTypes/index.js +71 -0
  12. package/dist/extractor/ApiExtractor.d.ts +74 -0
  13. package/dist/extractor/ApiExtractor.js +9 -0
  14. package/dist/extractor/config.d.ts +452 -0
  15. package/dist/extractor/config.js +17 -0
  16. package/dist/extractor/extractors/copyDoc.d.ts +25 -0
  17. package/dist/extractor/privateContext.d.ts +19 -0
  18. package/dist/extractor/privateContext.js +84 -0
  19. package/dist/extractor/processing/links.d.ts +12 -0
  20. package/dist/extractor/processing/links.js +174 -0
  21. package/dist/extractor/types.d.ts +40 -0
  22. package/dist/extractor/webComponent/findComponents.d.ts +19 -0
  23. package/dist/extractor/webComponent/findComponents.js +36 -0
  24. package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
  25. package/dist/extractor/webComponent/pathMapping.js +44 -0
  26. package/dist/index.d.ts +164 -8
  27. package/dist/index.js +3 -283
  28. package/dist/typeScript-soMJqHns.js +64 -0
  29. package/dist/uiUtils/index.d.ts +12 -0
  30. package/dist/uiUtils/index.js +5 -0
  31. package/dist/utils/apiHelpers.d.ts +43 -17
  32. package/dist/utils/apiHelpers.js +80 -0
  33. package/dist/utils/astHelpers.d.ts +24 -11
  34. package/dist/utils/astHelpers.js +67 -0
  35. package/dist/utils/hydrateApiType.d.ts +26 -0
  36. package/dist/utils/hydrateApiType.js +62 -0
  37. package/dist/utils/inferEntrypoints.d.ts +17 -0
  38. package/dist/utils/inferEntrypoints.js +26 -0
  39. package/dist/utils/internalTypeScriptApis.d.ts +92 -0
  40. package/dist/utils/internalTypeScriptApis.js +58 -0
  41. package/dist/utils/partPrinter.d.ts +29 -0
  42. package/dist/utils/partPrinter.js +82 -0
  43. package/dist/vite/plugin.d.ts +53 -0
  44. package/dist/vite/plugin.js +107 -0
  45. package/dist/vite/typeScript.d.ts +16 -0
  46. package/dist/vite/typeScript.js +6 -0
  47. package/dist/worker-On5v54cw.js +3597 -0
  48. package/package.json +46 -5
  49. package/dist/diff/index.d.ts +0 -3
  50. package/dist/diff.js +0 -147
  51. package/dist/ensureValidType.d.ts +0 -1
  52. package/dist/extractor/index.d.ts +0 -46
  53. package/dist/types.d.ts +0 -25
  54. package/dist/utils/docHelpers.d.ts +0 -9
  55. package/dist/utils/error.d.ts +0 -12
  56. package/dist/utils/print.d.ts +0 -7
package/package.json CHANGED
@@ -1,24 +1,65 @@
1
1
  {
2
2
  "name": "@arcgis/api-extractor",
3
- "version": "5.0.0-next.14",
3
+ "version": "5.0.0-next.141",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": "./dist/index.js",
10
- "./diff": "./dist/diff/index.js",
10
+ "./apiJson": {
11
+ "types": "./dist/apiJson.d.ts"
12
+ },
13
+ "./compilerHints": {
14
+ "types": "./dist/compilerHints.d.ts"
15
+ },
16
+ "./diff/diffApiJson": "./dist/diff/diffApiJson.js",
17
+ "./diff/fetchApiJsonFromNpm": "./dist/diff/fetchApiJsonFromNpm.js",
18
+ "./diffTypes": "./dist/diffTypes/index.js",
19
+ "./extractor/ApiExtractor": "./dist/extractor/ApiExtractor.js",
20
+ "./extractor/privateContext": "./dist/extractor/privateContext.js",
21
+ "./extractor/types": {
22
+ "types": "./dist/extractor/types.d.ts"
23
+ },
24
+ "./extractor/config": "./dist/extractor/config.js",
25
+ "./extractor/extractors/copyDoc": {
26
+ "types": "./dist/extractor/extractors/copyDoc.d.ts"
27
+ },
28
+ "./extractor/processing/links": "./dist/extractor/processing/links.js",
29
+ "./extractor/webComponent/findComponents": "./dist/extractor/webComponent/findComponents.js",
30
+ "./extractor/webComponent/pathMapping": "./dist/extractor/webComponent/pathMapping.js",
31
+ "./uiUtils": "./dist/uiUtils/index.js",
32
+ "./utils/apiHelpers": "./dist/utils/apiHelpers.js",
33
+ "./utils/astHelpers": "./dist/utils/astHelpers.js",
34
+ "./utils/hydrateApiType": "./dist/utils/hydrateApiType.js",
35
+ "./utils/inferEntrypoints": "./dist/utils/inferEntrypoints.js",
36
+ "./utils/internalTypeScriptApis": "./dist/utils/internalTypeScriptApis.js",
37
+ "./utils/partPrinter": "./dist/utils/partPrinter.js",
38
+ "./vite/plugin": "./dist/vite/plugin.js",
39
+ "./vite/typeScript": "./dist/vite/typeScript.js",
11
40
  "./package.json": "./package.json"
12
41
  },
13
42
  "files": [
14
43
  "dist/"
15
44
  ],
45
+ "bin": "./dist/cli.js",
16
46
  "license": "SEE LICENSE IN LICENSE.md",
17
47
  "dependencies": {
18
- "@arcgis/components-build-utils": "5.0.0-next.14",
19
- "@arcgis/toolkit": "5.0.0-next.14",
48
+ "@commander-js/extra-typings": "^14.0.0",
20
49
  "chalk": "^5.4.1",
50
+ "commander": "^14.0.0",
21
51
  "tslib": "^2.8.1",
22
- "typescript": "~5.8.3"
52
+ "vite": "^7.2.2",
53
+ "@arcgis/components-build-utils": "5.0.0-next.141",
54
+ "@arcgis/toolkit": "5.0.0-next.141"
55
+ },
56
+ "peerDependencies": {
57
+ "typescript": "~5.9.3",
58
+ "vite": "^7.2.2"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "vite": {
62
+ "optional": true
63
+ }
23
64
  }
24
65
  }
@@ -1,3 +0,0 @@
1
- export { fetchApiJsonFromNpm } from './fetchApiJsonFromNpm';
2
- export { diffApiJson } from './diffApiJson';
3
- export type * from './types';
package/dist/diff.js DELETED
@@ -1,147 +0,0 @@
1
- async function b(d, i) {
2
- const o = await fetch(`https://unpkg.com/${d}@${i}/dist/docs/api.json`);
3
- if (!o.ok)
4
- throw new Error(`Failed to fetch api.json: ${o.statusText}`);
5
- return await o.json();
6
- }
7
- function M(d, i) {
8
- const o = new Map(d.modules.map((e) => [e.path, e])), t = [];
9
- for (const e of i.modules) {
10
- const a = o.get(e.path), s = D(a, e, !0);
11
- s !== void 0 && t.push(s), o.delete(e.path);
12
- }
13
- for (const e of o.values()) {
14
- const a = D(void 0, e, !1);
15
- a !== void 0 && t.push(a);
16
- }
17
- return { modules: t };
18
- }
19
- function D(d, i, o) {
20
- const t = [], e = p(d?.declarations ?? []), a = p(i.declarations ?? []);
21
- for (const s of a.values()) {
22
- const n = s.at(-1), l = "tagName" in n ? n.tagName : void 0, v = l ?? n.name, u = e.get(v);
23
- e.delete(v);
24
- const h = u === void 0 && !o ? !0 : void 0, m = o && // Only mark as deprecated if all overloads are deprecated
25
- (s.length === 1 || s.every((r) => r.deprecated !== void 0)) ? n.deprecated : void 0, g = !m && u === void 0 && o ? !0 : void 0;
26
- if (h || g) {
27
- t.push({
28
- kind: n.kind,
29
- name: n.name,
30
- tagName: l,
31
- members: void 0,
32
- removed: h,
33
- added: g,
34
- deprecated: m
35
- });
36
- continue;
37
- } else if (!o)
38
- continue;
39
- if ("tagName" in n) {
40
- const r = u?.[0], c = {
41
- kind: n.kind,
42
- name: n.name,
43
- tagName: n.tagName,
44
- deprecated: m,
45
- added: void 0,
46
- removed: void 0,
47
- members: k(r?.members, n.members),
48
- events: f(r?.events, n.events),
49
- slots: f(r?.slots, n.slots),
50
- cssParts: f(r?.cssParts, n.cssParts),
51
- cssProperties: f(r?.cssProperties, n.cssProperties),
52
- cssStates: f(r?.cssStates, n.cssStates)
53
- };
54
- (m !== void 0 || c.members !== void 0 || c.events !== void 0 || c.slots !== void 0 || c.cssParts !== void 0 || c.cssProperties !== void 0 || c.cssStates !== void 0) && t.push(c);
55
- } else if (n.kind === "class") {
56
- const r = u?.[0], c = {
57
- kind: n.kind,
58
- name: n.name,
59
- deprecated: m,
60
- added: void 0,
61
- removed: void 0,
62
- members: k(r?.members, n.members),
63
- events: f(r?.events, n.events)
64
- };
65
- (m !== void 0 || c.members !== void 0 || c.events !== void 0) && t.push(c);
66
- } else m !== void 0 && t.push({
67
- kind: n.kind,
68
- name: n.name,
69
- deprecated: m,
70
- added: void 0,
71
- removed: void 0
72
- });
73
- }
74
- if (o)
75
- for (const [s] of e.values())
76
- t.push({
77
- kind: s.kind,
78
- name: s.name,
79
- tagName: "tagName" in s ? s.tagName : void 0,
80
- members: void 0,
81
- removed: !0,
82
- added: void 0,
83
- deprecated: void 0
84
- });
85
- if (t.length !== 0)
86
- return {
87
- path: i.path,
88
- declarations: t
89
- };
90
- }
91
- function p(d) {
92
- const i = /* @__PURE__ */ new Map();
93
- for (let o = 0; o < d.length; o++) {
94
- const t = d[o], e = "tagName" in t ? t.tagName : t.name, a = i.get(e);
95
- a === void 0 ? i.set(e, [t]) : a.push(t);
96
- }
97
- return i;
98
- }
99
- function f(d, i) {
100
- const o = p(d ?? []), t = [];
101
- if (i !== void 0)
102
- for (const e of i)
103
- o.get(e.name) === void 0 ? t.push({
104
- name: e.name,
105
- added: !0
106
- }) : e.deprecated && t.push({
107
- name: e.name,
108
- deprecated: e.deprecated
109
- }), o.delete(e.name);
110
- for (const [e] of o.values())
111
- t.push({
112
- name: e.name,
113
- removed: !0
114
- });
115
- return t.length ? t : void 0;
116
- }
117
- function k(d, i) {
118
- const o = p(d ?? []), t = p(i ?? []), e = [];
119
- for (const a of t.values()) {
120
- const s = a.at(-1), n = o.get(s.name);
121
- o.delete(s.name);
122
- const l = (
123
- // Only mark as deprecated if all overloads are deprecated
124
- a.length === 1 || a.every((v) => v.deprecated !== void 0) ? s.deprecated : void 0
125
- );
126
- l ? e.push({
127
- kind: s.kind,
128
- name: s.name,
129
- deprecated: l
130
- }) : n === void 0 && e.push({
131
- kind: s.kind,
132
- name: s.name,
133
- added: !0
134
- });
135
- }
136
- for (const [a] of o.values())
137
- e.push({
138
- kind: a.kind,
139
- name: a.name,
140
- removed: !0
141
- });
142
- return e.length ? e : void 0;
143
- }
144
- export {
145
- M as diffApiJson,
146
- b as fetchApiJsonFromNpm
147
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- import { ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiDeclaration, ApiEvent, ApiExport, ApiJson, ApiModule } from '../apiJson';
2
- import { default as ts } from 'typescript';
3
- import { CopyPropertyDoc, CopyMethodDoc, CopyEventDoc } from '../types';
4
- export type ApiExtractorOptions = {
5
- /**
6
- * Whether to extract full API information, with type-checking. This should be
7
- * the case during build or when running under Storybook. Otherwise, the dev
8
- * server should keep API extraction to bare minimum to reduce needless
9
- * overhead. Only the information necessary for the dev server is extracted.
10
- */
11
- isFullApiExtraction: boolean;
12
- cwd: string;
13
- };
14
- /**
15
- * This is a base abstract class. It should be subclassed to implement the
16
- * specific extraction logic.
17
- */
18
- export declare abstract class ApiExtractor {
19
- options: ApiExtractorOptions;
20
- constructor(options: ApiExtractorOptions);
21
- protected file: ts.SourceFile;
22
- protected apiModule: ApiModule;
23
- /** Given an array of TypeScript source files, generate an api.json file */
24
- extract(files: readonly ts.SourceFile[]): ApiJson;
25
- protected extractModules(files: readonly ts.SourceFile[]): ApiModule[];
26
- protected extractModule(module: ts.SourceFile): ApiModule;
27
- /**
28
- * For a given module, extract all public declarations.
29
- */
30
- protected extractDeclarations(module: ts.SourceFile): ApiDeclaration[];
31
- /**
32
- * For each statement in a module, extract a declaration if it is a public API
33
- */
34
- protected abstract extractDeclaration(statement: ts.Statement): ApiDeclaration | undefined;
35
- /**
36
- * Infer ApiModule.exports based on ApiModule.declarations.
37
- */
38
- protected inferExports(declarations: ApiDeclaration[]): ApiExport[];
39
- /**
40
- * Infer ApiExport based on ApiDeclaration
41
- */
42
- protected abstract inferExport(declaration: ApiDeclaration): ApiExport | undefined;
43
- copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyPropertyDoc | undefined, property: ApiCustomElementField, component: ApiCustomElementDeclaration): void;
44
- copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyMethodDoc | undefined, method: ApiClassMethod, component: ApiCustomElementDeclaration): void;
45
- copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyEventDoc | undefined, event: ApiEvent, component: ApiCustomElementDeclaration): void;
46
- }
package/dist/types.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { ApiCustomElementField, ApiCustomElementDeclaration, ApiClassMethod, ApiEvent } from './apiJson';
2
- /**
3
- * @example
4
- * ```ts
5
- * {
6
- * properties: {
7
- * // You only need to return the fields you wish to modify.
8
- * autoDestroyDisabled: () => ({
9
- * description: `If true, the component will not be destroyed automatically when it is
10
- * disconnected from the document. This is useful when you want to move the
11
- * component to a different place on the page, or temporarily hide it. If this
12
- * is set, make sure to call the {@link #destroy} method when you are done to
13
- * prevent memory leaks.`,
14
- * }),
15
- * },
16
- * }
17
- */
18
- export type CopyDocDefinitions = {
19
- properties?: Record<string, CopyPropertyDoc | undefined>;
20
- methods?: Record<string, CopyMethodDoc | undefined>;
21
- events?: Record<string, CopyEventDoc | undefined>;
22
- };
23
- export type CopyPropertyDoc = (property: ApiCustomElementField, component: ApiCustomElementDeclaration) => Partial<ApiCustomElementField> | undefined;
24
- export type CopyMethodDoc = (method: ApiClassMethod, component: ApiCustomElementDeclaration) => Partial<ApiClassMethod> | undefined;
25
- export type CopyEventDoc = (event: ApiEvent, component: ApiCustomElementDeclaration) => Partial<ApiEvent> | undefined;
@@ -1,9 +0,0 @@
1
- import { default as ts } from 'typescript';
2
- import { ApiCustomElementField, ApiCustomElementDeclaration, ApiEvent, ApiDocsTag, ApiCustomElementMember } from '../apiJson';
3
- export declare function symbolToDocs(checker: ts.TypeChecker, symbol: ts.Signature | ts.Symbol): {
4
- description: ApiCustomElementField["description"];
5
- docsTags: ApiDocsTag[];
6
- };
7
- export declare const internalJsDocTag = "internal";
8
- export declare function apiMemberToSynthesizedComments(apiMember: ApiCustomElementDeclaration | ApiCustomElementMember | ApiEvent): ts.SynthesizedComment[];
9
- export declare function setApiDocFromJsDoc(node: ts.PropertyName, checker: ts.TypeChecker, api: Partial<Pick<ApiCustomElementDeclaration, "cssParts" | "cssProperties" | "cssStates" | "slots"> & Pick<ApiCustomElementField, "default" | "deprecated" | "description" | "docsTags" | "privacy" | "readonly">>, docs?: ReturnType<typeof symbolToDocs>): void;
@@ -1,12 +0,0 @@
1
- import { default as ts } from 'typescript';
2
- export declare let apiExtractorErrorCount: number;
3
- export declare const apiExtractorErrorFiles: Set<string>;
4
- export declare function setApiExtractorErrorLogger(logger: (msg: string) => void): void;
5
- export interface ApiExtractorErrorContext {
6
- file: ts.SourceFile | undefined;
7
- node: ts.Node | undefined;
8
- scope?: string;
9
- start?: number;
10
- length?: number;
11
- }
12
- export declare function apiExtractorError(message: string, { file, node, scope, start, length }: ApiExtractorErrorContext): void;
@@ -1,7 +0,0 @@
1
- import { default as ts } from 'typescript';
2
- export declare function printNode(node: ts.Node): string;
3
- /**
4
- * For usage in error messages. Print original node text if available. Otherwise,
5
- * print the AST.
6
- */
7
- export declare function debugPrintNode(node: ts.Node, sourceFile: ts.SourceFile | undefined): string;