@cparra/apexdocs 3.5.1 โ 3.7.2-alpha.0
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.
- package/README.md +33 -5
- package/dist/cli/generate.js +1 -1
- package/dist/index.d.ts +60 -8
- package/dist/index.js +1 -1
- package/dist/{logger-C1IFVWQ7.js โ logger-DC5HNMQO.js} +739 -456
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -335,9 +335,11 @@ of different hooks that will be called at different stages of the documentation
|
|
|
335
335
|
|
|
336
336
|
All hooks can be async functions, allowing you to make asynchronous operations, like calling an external API.
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
There are hooks for both Markdown and Changelog operations (but not for OpenApi).
|
|
339
339
|
|
|
340
|
-
####
|
|
340
|
+
#### Markdown Hooks
|
|
341
|
+
|
|
342
|
+
##### **transformReferenceGuide**
|
|
341
343
|
|
|
342
344
|
Allows changing the Allows changing the frontmatter and content of the reference guide, or even if creating a reference
|
|
343
345
|
guide page should be skipped.
|
|
@@ -374,7 +376,7 @@ export default defineMarkdownConfig({
|
|
|
374
376
|
});
|
|
375
377
|
```
|
|
376
378
|
|
|
377
|
-
|
|
379
|
+
##### **transformDocs**
|
|
378
380
|
|
|
379
381
|
The main purpose of this hook is to allow you to skip the generation of specific pages,
|
|
380
382
|
by returning a filtered array of `DocPageData` objects.
|
|
@@ -397,7 +399,7 @@ export default {
|
|
|
397
399
|
};
|
|
398
400
|
```
|
|
399
401
|
|
|
400
|
-
|
|
402
|
+
##### **transformDocPage**
|
|
401
403
|
|
|
402
404
|
Allows changing the frontmatter and content of the doc page.
|
|
403
405
|
|
|
@@ -421,7 +423,7 @@ export default {
|
|
|
421
423
|
};
|
|
422
424
|
```
|
|
423
425
|
|
|
424
|
-
|
|
426
|
+
##### **transformReference**
|
|
425
427
|
|
|
426
428
|
Allows changing where the files are written to and how files are linked to each other.
|
|
427
429
|
|
|
@@ -449,6 +451,32 @@ export default {
|
|
|
449
451
|
};
|
|
450
452
|
```
|
|
451
453
|
|
|
454
|
+
#### Changelog Hooks
|
|
455
|
+
|
|
456
|
+
##### **transformChangeLogPage**
|
|
457
|
+
|
|
458
|
+
Allows changing the frontmatter and content of the changelog page.
|
|
459
|
+
|
|
460
|
+
**Type**
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
type TransformChangeLogPage = (
|
|
464
|
+
changelog: ChangeLogPageData,
|
|
465
|
+
) => Partial<ChangeLogPageData> | Promise<Partial<ChangeLogPageData>>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Example
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
export default {
|
|
472
|
+
transformChangeLogPage: (changelog) => {
|
|
473
|
+
return {
|
|
474
|
+
frontmatter: { example: 'example' }
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
```
|
|
479
|
+
|
|
452
480
|
## โคต๏ธ Importing to your project
|
|
453
481
|
|
|
454
482
|
### Reflection
|
package/dist/cli/generate.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ type UserDefinedMarkdownConfig = {
|
|
|
29
29
|
excludeTags: string[];
|
|
30
30
|
exclude: string[];
|
|
31
31
|
} & CliConfigurableMarkdownConfig &
|
|
32
|
-
Partial<
|
|
32
|
+
Partial<MarkdownConfigurableHooks>;
|
|
33
33
|
|
|
34
34
|
type UserDefinedOpenApiConfig = {
|
|
35
35
|
targetGenerator: 'openapi';
|
|
@@ -51,18 +51,31 @@ type UserDefinedChangelogConfig = {
|
|
|
51
51
|
scope: string[];
|
|
52
52
|
exclude: string[];
|
|
53
53
|
skipIfNoChanges: boolean;
|
|
54
|
-
}
|
|
54
|
+
} & Partial<ChangelogConfigurableHooks>;
|
|
55
55
|
|
|
56
56
|
type UserDefinedConfig = UserDefinedMarkdownConfig | UserDefinedOpenApiConfig | UserDefinedChangelogConfig;
|
|
57
57
|
|
|
58
|
+
type MetadataTypes = 'interface' | 'class' | 'enum' | 'customobject' | 'customfield';
|
|
59
|
+
|
|
58
60
|
type SourceFileMetadata = {
|
|
59
61
|
filePath: string;
|
|
60
62
|
name: string;
|
|
61
|
-
type:
|
|
63
|
+
type: MetadataTypes;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// External metadata is metadata that does not live directly in the source code, and thus we don't
|
|
67
|
+
// have a file path for it.
|
|
68
|
+
// This is metadata derived from other information.
|
|
69
|
+
// For example, for an "extension"
|
|
70
|
+
// field that extends a Salesforce object or object in a different package, we want to capture the parent
|
|
71
|
+
// object, even if the file for that object was not parsed.
|
|
72
|
+
type ExternalMetadata = {
|
|
73
|
+
name: string;
|
|
74
|
+
type: MetadataTypes;
|
|
62
75
|
};
|
|
63
76
|
|
|
64
77
|
type DocPageReference = {
|
|
65
|
-
source: SourceFileMetadata;
|
|
78
|
+
source: SourceFileMetadata | ExternalMetadata;
|
|
66
79
|
// The name under which the type should be displayed in the documentation.
|
|
67
80
|
// By default, this will match the source.name, but it can be configured by the user.
|
|
68
81
|
displayName: string;
|
|
@@ -84,7 +97,7 @@ type ReferenceGuidePageData = {
|
|
|
84
97
|
};
|
|
85
98
|
|
|
86
99
|
type DocPageData = {
|
|
87
|
-
source: SourceFileMetadata;
|
|
100
|
+
source: SourceFileMetadata | ExternalMetadata;
|
|
88
101
|
group: string | null;
|
|
89
102
|
outputDocPath: string;
|
|
90
103
|
frontmatter: Frontmatter;
|
|
@@ -92,6 +105,37 @@ type DocPageData = {
|
|
|
92
105
|
type: 'class' | 'interface' | 'enum' | 'customobject';
|
|
93
106
|
};
|
|
94
107
|
|
|
108
|
+
type FileChange = {
|
|
109
|
+
name: string;
|
|
110
|
+
fileType: 'apex' | 'customobject';
|
|
111
|
+
changeType: 'added' | 'removed' | 'changed';
|
|
112
|
+
changes?: {
|
|
113
|
+
addedMethods?: string[];
|
|
114
|
+
removedMethods?: string[];
|
|
115
|
+
addedFields?: string[];
|
|
116
|
+
removedFields?: string[];
|
|
117
|
+
addedProperties?: string[];
|
|
118
|
+
removedProperties?: string[];
|
|
119
|
+
addedCustomFields?: string[];
|
|
120
|
+
removedCustomFields?: string[];
|
|
121
|
+
addedSubtypes?: string[];
|
|
122
|
+
removedSubtypes?: string[];
|
|
123
|
+
addedEnumValues?: string[];
|
|
124
|
+
removedEnumValues?: string[];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type SourceChangelog = {
|
|
129
|
+
fileChanges: FileChange[];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type ChangeLogPageData = {
|
|
133
|
+
source: SourceChangelog;
|
|
134
|
+
frontmatter: Frontmatter;
|
|
135
|
+
content: string;
|
|
136
|
+
outputDocPath: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
95
139
|
/**
|
|
96
140
|
* Represents a file to be skipped.
|
|
97
141
|
*/
|
|
@@ -102,9 +146,9 @@ type Skip = {
|
|
|
102
146
|
// CONFIGURABLE HOOKS
|
|
103
147
|
|
|
104
148
|
/**
|
|
105
|
-
* The configurable hooks that can be used to modify the output of the generator.
|
|
149
|
+
* The configurable hooks that can be used to modify the output of the Markdown generator.
|
|
106
150
|
*/
|
|
107
|
-
type
|
|
151
|
+
type MarkdownConfigurableHooks = {
|
|
108
152
|
transformReferenceGuide: TransformReferenceGuide;
|
|
109
153
|
transformDocs: TransformDocs;
|
|
110
154
|
transformDocPage: TransformDocPage;
|
|
@@ -143,6 +187,14 @@ type TransformDocPage = (
|
|
|
143
187
|
doc: DocPageData,
|
|
144
188
|
) => Partial<ConfigurableDocPageData> | Promise<Partial<ConfigurableDocPageData>>;
|
|
145
189
|
|
|
190
|
+
type ChangelogConfigurableHooks = {
|
|
191
|
+
transformChangeLogPage: TransformChangelogPage;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
type TransformChangelogPage = (
|
|
195
|
+
page: ChangeLogPageData,
|
|
196
|
+
) => Partial<ChangeLogPageData> | Promise<Partial<ChangeLogPageData>>;
|
|
197
|
+
|
|
146
198
|
/**
|
|
147
199
|
* Represents a file to be skipped.
|
|
148
200
|
*/
|
|
@@ -177,4 +229,4 @@ type ConfigurableChangelogConfig = Omit<Partial<UserDefinedChangelogConfig>, 'ta
|
|
|
177
229
|
*/
|
|
178
230
|
declare function defineChangelogConfig(config: ConfigurableChangelogConfig): Partial<UserDefinedChangelogConfig>;
|
|
179
231
|
|
|
180
|
-
export { type
|
|
232
|
+
export { type ChangeLogPageData, type ChangelogConfigurableHooks, type ConfigurableChangelogConfig, type ConfigurableDocPageData, type ConfigurableDocPageReference, type ConfigurableMarkdownConfig, type ConfigurableOpenApiConfig, type DocPageData, type DocPageReference, type MarkdownConfigurableHooks, type ReferenceGuidePageData, type Skip, type SourceChangelog, type TransformChangelogPage, type TransformDocPage, type TransformDocs, type TransformReference, type TransformReferenceGuide, defineChangelogConfig, defineMarkdownConfig, defineOpenApiConfig, process, skip };
|