@cparra/apexdocs 2.17.2 → 2.19.0-alpha.1
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 +0 -25
- package/apexdocs.config.ts +5 -0
- package/docs/types/Classes/nspc.ChildClass.md +1 -1
- package/docs/types/Main/nspc.SampleClass.md +1 -1
- package/docs/types/Misc-Group/nspc.GrandparentClass.md +1 -1
- package/docs/types/Misc-Group/nspc.ParentClass.md +3 -3
- package/examples/force-app/main/default/classes/ParentClass.cls +1 -1
- package/examples/force-app/main/default/classes/SampleClass.cls +1 -1
- package/lib/application/Apexdocs.js +3 -0
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +114 -105
- package/lib/cli/generate.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +1 -0
- package/lib/model/markdown-type-file.js +11 -1
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/service/file-writer.js +2 -3
- package/lib/service/file-writer.js.map +1 -1
- package/lib/settings.d.ts +2 -0
- package/lib/settings.js +5 -0
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/package.json +3 -2
- package/src/application/Apexdocs.ts +5 -0
- package/src/cli/generate.ts +119 -110
- package/src/model/markdown-generation-util/method-declaration-util.ts +3 -2
- package/src/model/markdown-type-file.ts +11 -1
- package/src/service/file-writer.ts +2 -3
- package/src/settings.ts +7 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -1
package/README.md
CHANGED
|
@@ -25,31 +25,6 @@ There are some key differences between ApexDocs and the Java based ApexDoc tool:
|
|
|
25
25
|
Markdown like Github Pages or Netlify, and use site generators like Jekyll or Gatsby. This gives you the freedom to
|
|
26
26
|
decide how to style your site to match your needs.
|
|
27
27
|
|
|
28
|
-
## Version 2.X
|
|
29
|
-
|
|
30
|
-
Version shares almost* all the same functionality (and more) of 1.X , but is a rewrite from the ground up of the tool,
|
|
31
|
-
so please be aware if migrating from a 1.X version.
|
|
32
|
-
|
|
33
|
-
The Apex code parsing logic for the 1.X codebase was almost a one-to-one translation of the Java based ApexDoc tool to
|
|
34
|
-
Javascript. With 2.X the parsing logic has been improved and extracted out of this codebase, and into its own standalone
|
|
35
|
-
NPM module which is solely focused on Apex code reflection: https://www.npmjs.com/package/@cparra/apex-reflection
|
|
36
|
-
|
|
37
|
-
This allows for an improved code quality of both code bases and an increased ease of introducing future improvements and
|
|
38
|
-
fixing issues.
|
|
39
|
-
|
|
40
|
-
### Differences between the versions
|
|
41
|
-
|
|
42
|
-
When migrating from 1.X please be aware of these changes between the major versions:
|
|
43
|
-
|
|
44
|
-
#### Deprecated features
|
|
45
|
-
|
|
46
|
-
* The `--group` CLI parameter has been deprecated. All files are grouped by default.
|
|
47
|
-
|
|
48
|
-
#### Features from 1.X not supported in 2.X
|
|
49
|
-
|
|
50
|
-
* The `--configPath` CLI parameter has been temporarily deprecated. We are planning on reintroducing it but the config
|
|
51
|
-
file will use a different format.
|
|
52
|
-
|
|
53
28
|
#### New features
|
|
54
29
|
|
|
55
30
|
* All Apex annotations are now supported through the `--scope` CLI parameter, not just `namespaceaccessible`. This means
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# nspc.ParentClass
|
|
1
|
+
# abstract nspc.ParentClass
|
|
2
2
|
|
|
3
3
|
**Inheritance**
|
|
4
4
|
|
|
@@ -32,6 +32,6 @@ This is a protected string, use carefully.
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
## Methods
|
|
35
|
-
### `public String overridableMethod()`
|
|
36
|
-
### `public String overridableMethodOverridden()`
|
|
35
|
+
### `public virtual String overridableMethod()`
|
|
36
|
+
### `public virtual String overridableMethodOverridden()`
|
|
37
37
|
---
|
|
@@ -30,9 +30,12 @@ class Apexdocs {
|
|
|
30
30
|
const processor = factory_1.TypeTranspilerFactory.get(settings_1.Settings.getInstance().targetGenerator);
|
|
31
31
|
transpiler_1.default.generate(filteredTypes, processor);
|
|
32
32
|
const generatedFiles = processor.fileBuilder().files();
|
|
33
|
+
const generatedFilePaths = [];
|
|
33
34
|
file_writer_1.FileWriter.write(generatedFiles, (fileName) => {
|
|
34
35
|
logger_1.Logger.logSingle(`${fileName} processed.`, false, 'green', false);
|
|
36
|
+
generatedFilePaths.push(fileName);
|
|
35
37
|
});
|
|
38
|
+
settings_1.Settings.getInstance().onAfterProcess(generatedFilePaths);
|
|
36
39
|
// Error logging
|
|
37
40
|
error_logger_1.default.logErrors(filteredTypes);
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAA0E;AAC1E,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,uDAA+C;AAG/C,gEAA4D;AAC5D,mDAA8D;AAE9D;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,IAAA,iCAAc,EAAC,IAAI,sBAAa,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC3F,kCAAe,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACpD,kCAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;Q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kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5D,eAAM,CAAC,SAAS,CAAC,8BAA8B,aAAa,CAAC,MAAM,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACtG,OAAO,aAAa,CAAC;IACvB,CAAC;;AAvDH,4BAgEC;AAPQ,8BAAqB,GAAG,CAAC,UAAsB,EAAoB,EAAE;;IAC1E,MAAM,MAAM,GAAG,IAAA,yBAAO,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,eAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,QAAQ,oBAAoB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.js
CHANGED
|
@@ -4,110 +4,119 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const yargs = require("yargs");
|
|
5
5
|
const settings_1 = require("../settings");
|
|
6
6
|
const Apexdocs_1 = require("../application/Apexdocs");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
7
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
8
|
+
const result = (0, cosmiconfig_1.cosmiconfig)('apexdocs').search();
|
|
9
|
+
result.then((config) => {
|
|
10
|
+
var _a;
|
|
11
|
+
let argv = yargs.options({
|
|
12
|
+
sourceDir: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
alias: 's',
|
|
15
|
+
demandOption: true,
|
|
16
|
+
describe: 'The directory location which contains your apex .cls classes.',
|
|
17
|
+
},
|
|
18
|
+
targetDir: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
alias: 't',
|
|
21
|
+
default: './docs/',
|
|
22
|
+
describe: 'The directory location where documentation will be generated to.',
|
|
23
|
+
},
|
|
24
|
+
recursive: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
alias: 'r',
|
|
27
|
+
default: true,
|
|
28
|
+
describe: 'Whether .cls classes will be searched for recursively in the directory provided.',
|
|
29
|
+
},
|
|
30
|
+
scope: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
alias: 'p',
|
|
33
|
+
default: ['global'],
|
|
34
|
+
describe: 'A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. ' +
|
|
35
|
+
'Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. ' +
|
|
36
|
+
'Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource.',
|
|
37
|
+
},
|
|
38
|
+
targetGenerator: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
alias: 'g',
|
|
41
|
+
default: 'jekyll',
|
|
42
|
+
choices: ['jekyll', 'docsify', 'plain-markdown', 'openapi'],
|
|
43
|
+
describe: 'Define the static file generator for which the documents will be created. ' +
|
|
44
|
+
'Currently supports jekyll, docsify, plain markdown, and OpenAPI v3.1.0.',
|
|
45
|
+
},
|
|
46
|
+
indexOnly: {
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
default: false,
|
|
49
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
50
|
+
},
|
|
51
|
+
defaultGroupName: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: 'Miscellaneous',
|
|
54
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
55
|
+
},
|
|
56
|
+
sanitizeHtml: {
|
|
57
|
+
type: 'boolean',
|
|
58
|
+
default: true,
|
|
59
|
+
describe: 'When on, any special character within your ApexDocs is converted into its HTML code representation. ' +
|
|
60
|
+
'This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" ' +
|
|
61
|
+
'because otherwise the content within < and > would be treated as HTML tags and not shown in the output. ' +
|
|
62
|
+
'Content in @example blocks are never sanitized.',
|
|
63
|
+
},
|
|
64
|
+
openApiTitle: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: 'Apex REST Api',
|
|
67
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
|
|
68
|
+
},
|
|
69
|
+
title: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
describe: "If this allows you to specify the title of the generated documentation's home file.",
|
|
72
|
+
default: 'Classes',
|
|
73
|
+
},
|
|
74
|
+
namespace: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
describe: 'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
|
|
77
|
+
"If generating an OpenApi definition, it will be added to the file's Server Url.",
|
|
78
|
+
},
|
|
79
|
+
openApiFileName: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
|
|
82
|
+
default: 'openapi',
|
|
83
|
+
},
|
|
84
|
+
includeMetadata: {
|
|
85
|
+
type: 'boolean',
|
|
86
|
+
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
87
|
+
default: false,
|
|
88
|
+
},
|
|
89
|
+
documentationRootDir: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
describe: 'Allows you to specify the root documentation directory where the files are being generated. This can be helpful when embedding the generated docs into an existing site so that the links are generated correctly.',
|
|
92
|
+
},
|
|
93
|
+
}).argv;
|
|
94
|
+
if (config) {
|
|
95
|
+
argv = Object.assign(Object.assign({}, config.config), argv);
|
|
96
|
+
}
|
|
97
|
+
settings_1.Settings.build({
|
|
98
|
+
sourceDirectory: argv.sourceDir,
|
|
99
|
+
recursive: argv.recursive,
|
|
100
|
+
scope: argv.scope,
|
|
101
|
+
outputDir: argv.targetDir,
|
|
102
|
+
targetGenerator: argv.targetGenerator,
|
|
103
|
+
indexOnly: argv.indexOnly,
|
|
104
|
+
defaultGroupName: argv.defaultGroupName,
|
|
105
|
+
sanitizeHtml: argv.sanitizeHtml,
|
|
106
|
+
openApiTitle: argv.openApiTitle,
|
|
107
|
+
title: argv.title,
|
|
108
|
+
namespace: argv.namespace,
|
|
109
|
+
openApiFileName: argv.openApiFileName,
|
|
110
|
+
includeMetadata: argv.includeMetadata,
|
|
111
|
+
rootDir: argv.documentationRootDir,
|
|
112
|
+
onAfterProcess: (_a = config === null || config === void 0 ? void 0 : config.config) === null || _a === void 0 ? void 0 : _a.onAfterProcess,
|
|
113
|
+
});
|
|
114
|
+
try {
|
|
115
|
+
Apexdocs_1.Apexdocs.generate();
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
console.error(error);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
105
121
|
});
|
|
106
|
-
try {
|
|
107
|
-
Apexdocs_1.Apexdocs.generate();
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
console.error(error);
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
113
122
|
//# sourceMappingURL=generate.js.map
|
package/lib/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAuC;AACvC,sDAAmD;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAuC;AACvC,sDAAmD;AAEnD,6CAA0C;AAE1C,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CAAC;AAChD,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;;IACrB,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,+DAA+D;SAC1E;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,kEAAkE;SAC7E;QACD,SAAS,EAAE;YACT,IAAI,EAAE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YACf,QAAQ,EAAE,kGAAkG;YAC5G,OAAO,EAAE,KAAK;SACf;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,oNAAoN;SACvN;KACF,CAAC,CAAC,IAAI,CAAC;IAER,IAAI,MAAM,EAAE;QACV,IAAI,mCAAQ,MAAM,CAAC,MAAM,GAAK,IAAI,CAAE,CAAC;KACtC;IAED,mBAAQ,CAAC,KAAK,CAAC;QACb,eAAe,EAAE,IAAI,CAAC,SAAS;QAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;QACzD,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,OAAO,EAAE,IAAI,CAAC,oBAAoB;QAClC,cAAc,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,cAAc;KAC/C,CAAC,CAAC;IAEH,IAAI;QACF,mBAAQ,CAAC,QAAQ,EAAE,CAAC;KACrB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/method-declaration-util.ts"],"names":[],"mappings":";;;AAGA,+EAA+E;AAG/E,SAAgB,aAAa,CAC3B,YAA0B,EAC1B,OAA4D,EAC5D,oBAA4B,EAC5B,SAAS,GAAG,EAAE;IAEd,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;;QAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YAC3C,CAAC,CAAC,GAAI,aAA6C,CAAC,aAAa,CAAC,cAAc,IAC3E,aAA6C,CAAC,IACjD,EAAE;YACJ,CAAC,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"method-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/method-declaration-util.ts"],"names":[],"mappings":";;;AAGA,+EAA+E;AAG/E,SAAgB,aAAa,CAC3B,YAA0B,EAC1B,OAA4D,EAC5D,oBAA4B,EAC5B,SAAS,GAAG,EAAE;IAEd,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;;QAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YAC3C,CAAC,CAAC,GAAI,aAA6C,CAAC,aAAa,CAAC,cAAc,IAC3E,aAA6C,CAAC,IACjD,EAAE;YACJ,CAAC,CAAC,SAAS,CAAC;QAEd,YAAY,CAAC,QAAQ,CACnB,KAAK,cAAc,CAAC,aAAa,CAAC,eAAe,EAAE,aAAa,EAAE,aAAa,CAAC,IAAI,EACpF,oBAAoB,GAAG,CAAC,CACzB,CAAC;QAEF,kBAAkB;QAClB,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,aAA4C,CAAC;YACpE,IAAI,cAAc,CAAC,SAAS,EAAE;gBAC5B,YAAY,CAAC,YAAY,EAAE,CAAC;gBAC5B,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;gBACpC,YAAY,CAAC,YAAY,EAAE,CAAC;aAC7B;SACF;QAED,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE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,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvE,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,YAAY,CAAC,YAAY,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,QAAQ,CACf,MAAwE;IAExE,OAAQ,MAAsC,CAAC,aAAa,KAAK,SAAS,CAAC;AAC7E,CAAC"}
|
|
@@ -8,6 +8,7 @@ export declare class MarkdownTypeFile extends MarkdownFile implements WalkerList
|
|
|
8
8
|
private isInner;
|
|
9
9
|
constructor(type: Type, headingLevel?: number, headerContent?: string, isInner?: boolean);
|
|
10
10
|
onTypeDeclaration(typeMirror: Type): void;
|
|
11
|
+
private isClass;
|
|
11
12
|
onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void;
|
|
12
13
|
onFieldsDeclaration(fields: FieldMirrorWithInheritance[]): void;
|
|
13
14
|
onPropertiesDeclaration(properties: PropertyMirrorWithInheritance[]): void;
|
|
@@ -24,11 +24,21 @@ class MarkdownTypeFile extends markdown_file_1.MarkdownFile {
|
|
|
24
24
|
fullTypeName = typeMirror.name;
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
|
|
27
|
+
// If we are dealing with a class, we want to check if it has a class
|
|
28
|
+
// modifier and add it to the name.
|
|
29
|
+
if (this.isClass(typeMirror) && typeMirror.classModifier) {
|
|
30
|
+
fullTypeName = `${typeMirror.classModifier} ${settings_1.Settings.getInstance().getNamespacePrefix()}${typeMirror.name}`;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
fullTypeName = `${settings_1.Settings.getInstance().getNamespacePrefix()}${typeMirror.name}`;
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
this.addTitle(fullTypeName, this.headingLevel);
|
|
30
37
|
(0, markdown_generation_util_1.declareType)(this, typeMirror);
|
|
31
38
|
}
|
|
39
|
+
isClass(typeMirror) {
|
|
40
|
+
return typeMirror.type_name === 'class';
|
|
41
|
+
}
|
|
32
42
|
onConstructorDeclaration(className, constructors) {
|
|
33
43
|
this.addTitle('Constructors', this.headingLevel + 1);
|
|
34
44
|
this.declareMethodWithGroupings(constructors, className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-type-file.js","sourceRoot":"","sources":["../../src/model/markdown-type-file.ts"],"names":[],"mappings":";;;AAQA,sEAAkE;AAElE,mDAA+C;AAC/C,yEAAsF;AACtF,kGAAyF;AAEzF,0CAAuC;AAWvC,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAoB,IAAU,EAAU,eAAuB,CAAC,EAAE,aAAsB,EAAU,UAAU,KAAK;QAC/G,KAAK,CACH,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,EAC5D,oCAAwB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CACjD,CAAC;QAJgB,SAAI,GAAJ,IAAI,CAAM;QAAU,iBAAY,GAAZ,YAAY,CAAY;QAAkC,YAAO,GAAP,OAAO,CAAQ;QAK/G,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7B;QACD,MAAM,MAAM,GAAG,8BAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAEM,iBAAiB,CAAC,UAAgB;QACvC,IAAI,YAAY,CAAC;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;SAChC;aAAM;YACL,YAAY,GAAG,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,kBAAkB,EAAE,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown-type-file.js","sourceRoot":"","sources":["../../src/model/markd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AC,YAAY,CAAC,CAAC;QAC5C,IAAI,gBAAgB,EAAE;YACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;SAChC;IACH,CAAC;IAEO,QAAQ;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IAC5C,CAAC;IAEO,KAAK,CAAC,IAAkB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAgB,EAAE,IAAI,EAAE,EAAE;;YAC5C,MAAM,SAAS,GAAW,MAAA,IAAI,CAAC,KAAK,mCAAI,OAAO,CAAC;YAChD,MAAM,KAAK,GAAiB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF;AAjJD,4CAiJC"}
|
|
@@ -16,9 +16,8 @@ class FileWriter {
|
|
|
16
16
|
fs.mkdirSync(dirPath);
|
|
17
17
|
}
|
|
18
18
|
const filePath = path.join(dirPath, `${file.fileName}${file.fileExtension()}`);
|
|
19
|
-
fs.
|
|
20
|
-
|
|
21
|
-
});
|
|
19
|
+
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
20
|
+
onWriteCallback(filePath);
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,0CAAuC;AAEvC,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,KAAmB,EAAE,eAA2C;QAC3E,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QACnD,IAAI,CAA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AC,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;YAC/E,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9C,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,gCAkBC"}
|
package/lib/settings.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface SettingsConfig {
|
|
|
14
14
|
openApiFileName: string;
|
|
15
15
|
includeMetadata: boolean;
|
|
16
16
|
rootDir?: string;
|
|
17
|
+
onAfterProcess?: (files: string[]) => void;
|
|
17
18
|
}
|
|
18
19
|
export declare class Settings {
|
|
19
20
|
config: SettingsConfig;
|
|
@@ -36,4 +37,5 @@ export declare class Settings {
|
|
|
36
37
|
openApiFileName(): string;
|
|
37
38
|
includeMetadata(): boolean;
|
|
38
39
|
getRootDir(): string | undefined;
|
|
40
|
+
onAfterProcess(files: string[]): void;
|
|
39
41
|
}
|
package/lib/settings.js
CHANGED
|
@@ -63,6 +63,11 @@ class Settings {
|
|
|
63
63
|
getRootDir() {
|
|
64
64
|
return this.config.rootDir;
|
|
65
65
|
}
|
|
66
|
+
onAfterProcess(files) {
|
|
67
|
+
if (this.config.onAfterProcess) {
|
|
68
|
+
this.config.onAfterProcess(files);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
exports.Settings = Settings;
|
|
68
73
|
//# sourceMappingURL=settings.js.map
|
package/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AAoBA,MAAa,QAAQ;IAGnB,YAA2B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE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S,EAAE;YAC1B,OAAO,EAAE,CAAC;SACX;QACD,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC;IACrC,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;IAEM,cAAc,CAAC,KAAe;QACnC,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;SACnC;IACH,CAAC;CACF;AApFD,4BAoFC"}
|
|
@@ -18,7 +18,7 @@ class ClassFileGeneratorHelper {
|
|
|
18
18
|
static getFileLinkByTypeName(typeName) {
|
|
19
19
|
const type = types_repository_1.TypesRepository.getInstance().getFromScopedByName(typeName);
|
|
20
20
|
if (!type) {
|
|
21
|
-
// If the type is not found we return a Markdown hyperlink with whatever we received.
|
|
21
|
+
// If the type is not found, we return a Markdown hyperlink with whatever we received.
|
|
22
22
|
return `[${typeName}](${typeName})`;
|
|
23
23
|
}
|
|
24
24
|
return this.getFileLink(type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAC1C,+CAAwC;AACxC,wCAAmD;AAEnD,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,C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AAe,GAAG,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAC7D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAC1D,CAAC;QACF,OAAO,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAnDD,2CAmDC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cparra/apexdocs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0-alpha.1",
|
|
4
4
|
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex",
|
|
@@ -66,8 +66,9 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@cparra/apex-reflection": "2.
|
|
69
|
+
"@cparra/apex-reflection": "2.5.0",
|
|
70
70
|
"chalk": "^4.1.2",
|
|
71
|
+
"cosmiconfig": "^9.0.0",
|
|
71
72
|
"fast-xml-parser": "^4.0.1",
|
|
72
73
|
"js-yaml": "^4.1.0",
|
|
73
74
|
"log-update": "4.0.0",
|
|
@@ -30,10 +30,15 @@ export class Apexdocs {
|
|
|
30
30
|
const processor = TypeTranspilerFactory.get(Settings.getInstance().targetGenerator);
|
|
31
31
|
Transpiler.generate(filteredTypes, processor);
|
|
32
32
|
const generatedFiles = processor.fileBuilder().files();
|
|
33
|
+
|
|
34
|
+
const generatedFilePaths: string[] = [];
|
|
33
35
|
FileWriter.write(generatedFiles, (fileName: string) => {
|
|
34
36
|
Logger.logSingle(`${fileName} processed.`, false, 'green', false);
|
|
37
|
+
generatedFilePaths.push(fileName);
|
|
35
38
|
});
|
|
36
39
|
|
|
40
|
+
Settings.getInstance().onAfterProcess(generatedFilePaths);
|
|
41
|
+
|
|
37
42
|
// Error logging
|
|
38
43
|
ErrorLogger.logErrors(filteredTypes);
|
|
39
44
|
}
|
package/src/cli/generate.ts
CHANGED
|
@@ -4,116 +4,125 @@ import * as yargs from 'yargs';
|
|
|
4
4
|
import { Settings } from '../settings';
|
|
5
5
|
import { Apexdocs } from '../application/Apexdocs';
|
|
6
6
|
import { GeneratorChoices } from '../transpiler/generator-choices';
|
|
7
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
9
|
+
const result = cosmiconfig('apexdocs').search();
|
|
10
|
+
result.then((config) => {
|
|
11
|
+
let argv = yargs.options({
|
|
12
|
+
sourceDir: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
alias: 's',
|
|
15
|
+
demandOption: true,
|
|
16
|
+
describe: 'The directory location which contains your apex .cls classes.',
|
|
17
|
+
},
|
|
18
|
+
targetDir: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
alias: 't',
|
|
21
|
+
default: './docs/',
|
|
22
|
+
describe: 'The directory location where documentation will be generated to.',
|
|
23
|
+
},
|
|
24
|
+
recursive: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
alias: 'r',
|
|
27
|
+
default: true,
|
|
28
|
+
describe: 'Whether .cls classes will be searched for recursively in the directory provided.',
|
|
29
|
+
},
|
|
30
|
+
scope: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
alias: 'p',
|
|
33
|
+
default: ['global'],
|
|
34
|
+
describe:
|
|
35
|
+
'A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. ' +
|
|
36
|
+
'Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. ' +
|
|
37
|
+
'Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource.',
|
|
38
|
+
},
|
|
39
|
+
targetGenerator: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
alias: 'g',
|
|
42
|
+
default: 'jekyll',
|
|
43
|
+
choices: ['jekyll', 'docsify', 'plain-markdown', 'openapi'],
|
|
44
|
+
describe:
|
|
45
|
+
'Define the static file generator for which the documents will be created. ' +
|
|
46
|
+
'Currently supports jekyll, docsify, plain markdown, and OpenAPI v3.1.0.',
|
|
47
|
+
},
|
|
48
|
+
indexOnly: {
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
default: false,
|
|
51
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
52
|
+
},
|
|
53
|
+
defaultGroupName: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
default: 'Miscellaneous',
|
|
56
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
57
|
+
},
|
|
58
|
+
sanitizeHtml: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
default: true,
|
|
61
|
+
describe:
|
|
62
|
+
'When on, any special character within your ApexDocs is converted into its HTML code representation. ' +
|
|
63
|
+
'This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" ' +
|
|
64
|
+
'because otherwise the content within < and > would be treated as HTML tags and not shown in the output. ' +
|
|
65
|
+
'Content in @example blocks are never sanitized.',
|
|
66
|
+
},
|
|
67
|
+
openApiTitle: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
default: 'Apex REST Api',
|
|
70
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
|
|
71
|
+
},
|
|
72
|
+
title: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
describe: "If this allows you to specify the title of the generated documentation's home file.",
|
|
75
|
+
default: 'Classes',
|
|
76
|
+
},
|
|
77
|
+
namespace: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
describe:
|
|
80
|
+
'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
|
|
81
|
+
"If generating an OpenApi definition, it will be added to the file's Server Url.",
|
|
82
|
+
},
|
|
83
|
+
openApiFileName: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
|
|
86
|
+
default: 'openapi',
|
|
87
|
+
},
|
|
88
|
+
includeMetadata: {
|
|
89
|
+
type: 'boolean',
|
|
90
|
+
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
documentationRootDir: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
describe:
|
|
96
|
+
'Allows you to specify the root documentation directory where the files are being generated. This can be helpful when embedding the generated docs into an existing site so that the links are generated correctly.',
|
|
97
|
+
},
|
|
98
|
+
}).argv;
|
|
96
99
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
if (config) {
|
|
101
|
+
argv = { ...config.config, ...argv };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
Settings.build({
|
|
105
|
+
sourceDirectory: argv.sourceDir,
|
|
106
|
+
recursive: argv.recursive,
|
|
107
|
+
scope: argv.scope,
|
|
108
|
+
outputDir: argv.targetDir,
|
|
109
|
+
targetGenerator: argv.targetGenerator as GeneratorChoices,
|
|
110
|
+
indexOnly: argv.indexOnly,
|
|
111
|
+
defaultGroupName: argv.defaultGroupName,
|
|
112
|
+
sanitizeHtml: argv.sanitizeHtml,
|
|
113
|
+
openApiTitle: argv.openApiTitle,
|
|
114
|
+
title: argv.title,
|
|
115
|
+
namespace: argv.namespace,
|
|
116
|
+
openApiFileName: argv.openApiFileName,
|
|
117
|
+
includeMetadata: argv.includeMetadata,
|
|
118
|
+
rootDir: argv.documentationRootDir,
|
|
119
|
+
onAfterProcess: config?.config?.onAfterProcess,
|
|
120
|
+
});
|
|
113
121
|
|
|
114
|
-
try {
|
|
115
|
-
|
|
116
|
-
} catch (error) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
122
|
+
try {
|
|
123
|
+
Apexdocs.generate();
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error(error);
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConstructorMirror, DocComment } from '@cparra/apex-reflection';
|
|
2
2
|
import { MarkdownFile } from '../markdown-file';
|
|
3
|
-
import { ParameterMirror } from '@cparra/apex-reflection
|
|
3
|
+
import { ParameterMirror } from '@cparra/apex-reflection';
|
|
4
4
|
import { addCustomDocCommentAnnotations } from './doc-comment-annotation-util';
|
|
5
5
|
import { MethodMirrorWithInheritance } from '../inheritance';
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@ export function declareMethod(
|
|
|
16
16
|
(currentMethod as MethodMirrorWithInheritance).name
|
|
17
17
|
}`
|
|
18
18
|
: className;
|
|
19
|
+
|
|
19
20
|
markdownFile.addTitle(
|
|
20
21
|
`\`${buildSignature(currentMethod.access_modifier, signatureName, currentMethod)}\``,
|
|
21
22
|
startingHeadingLevel + 2,
|
|
@@ -158,6 +159,6 @@ function addExample(markdownFile: MarkdownFile, docCommentAware: DocCommentAware
|
|
|
158
159
|
|
|
159
160
|
function isMethod(
|
|
160
161
|
method: MethodMirrorWithInheritance | ConstructorMirror | ParameterAware,
|
|
161
|
-
): method is
|
|
162
|
+
): method is MethodMirrorWithInheritance {
|
|
162
163
|
return (method as MethodMirrorWithInheritance).typeReference !== undefined;
|
|
163
164
|
}
|
|
@@ -41,12 +41,22 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
|
|
|
41
41
|
if (this.isInner) {
|
|
42
42
|
fullTypeName = typeMirror.name;
|
|
43
43
|
} else {
|
|
44
|
-
|
|
44
|
+
// If we are dealing with a class, we want to check if it has a class
|
|
45
|
+
// modifier and add it to the name.
|
|
46
|
+
if (this.isClass(typeMirror) && typeMirror.classModifier) {
|
|
47
|
+
fullTypeName = `${typeMirror.classModifier} ${Settings.getInstance().getNamespacePrefix()}${typeMirror.name}`;
|
|
48
|
+
} else {
|
|
49
|
+
fullTypeName = `${Settings.getInstance().getNamespacePrefix()}${typeMirror.name}`;
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
this.addTitle(fullTypeName, this.headingLevel);
|
|
47
53
|
declareType(this, typeMirror);
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
private isClass(typeMirror: Type): typeMirror is ClassMirror {
|
|
57
|
+
return typeMirror.type_name === 'class';
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
public onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void {
|
|
51
61
|
this.addTitle('Constructors', this.headingLevel + 1);
|
|
52
62
|
this.declareMethodWithGroupings(constructors, className);
|
|
@@ -17,9 +17,8 @@ export class FileWriter {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const filePath = path.join(dirPath, `${file.fileName}${file.fileExtension()}`);
|
|
20
|
-
fs.
|
|
21
|
-
|
|
22
|
-
});
|
|
20
|
+
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
21
|
+
onWriteCallback(filePath);
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
}
|
package/src/settings.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface SettingsConfig {
|
|
|
15
15
|
openApiFileName: string;
|
|
16
16
|
includeMetadata: boolean;
|
|
17
17
|
rootDir?: string;
|
|
18
|
+
onAfterProcess?: (files: string[]) => void;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export class Settings {
|
|
@@ -95,4 +96,10 @@ export class Settings {
|
|
|
95
96
|
public getRootDir(): string | undefined {
|
|
96
97
|
return this.config.rootDir;
|
|
97
98
|
}
|
|
99
|
+
|
|
100
|
+
public onAfterProcess(files: string[]) {
|
|
101
|
+
if (this.config.onAfterProcess) {
|
|
102
|
+
this.config.onAfterProcess(files);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
98
105
|
}
|
|
@@ -19,7 +19,7 @@ export default class ClassFileGeneratorHelper {
|
|
|
19
19
|
public static getFileLinkByTypeName(typeName: string) {
|
|
20
20
|
const type = TypesRepository.getInstance().getFromScopedByName(typeName);
|
|
21
21
|
if (!type) {
|
|
22
|
-
// If the type is not found we return a Markdown hyperlink with whatever we received.
|
|
22
|
+
// If the type is not found, we return a Markdown hyperlink with whatever we received.
|
|
23
23
|
return `[${typeName}](${typeName})`;
|
|
24
24
|
}
|
|
25
25
|
|