@appium/docutils 0.2.1 → 0.3.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/LICENSE +1 -1
- package/build/lib/builder/deploy.d.ts.map +1 -1
- package/build/lib/builder/deploy.js +6 -2
- package/build/lib/builder/deploy.js.map +1 -1
- package/build/lib/builder/index.d.ts +4 -0
- package/build/lib/builder/index.d.ts.map +1 -1
- package/build/lib/builder/index.js +4 -0
- package/build/lib/builder/index.js.map +1 -1
- package/build/lib/builder/nav.d.ts +1 -1
- package/build/lib/builder/nav.d.ts.map +1 -1
- package/build/lib/builder/nav.js +3 -3
- package/build/lib/builder/nav.js.map +1 -1
- package/build/lib/builder/reference.d.ts +1 -1
- package/build/lib/builder/reference.d.ts.map +1 -1
- package/build/lib/builder/reference.js +1 -19
- package/build/lib/builder/reference.js.map +1 -1
- package/build/lib/builder/site.d.ts.map +1 -1
- package/build/lib/builder/site.js +4 -3
- package/build/lib/builder/site.js.map +1 -1
- package/build/lib/cli/check.d.ts +19 -0
- package/build/lib/cli/check.d.ts.map +1 -0
- package/build/lib/cli/check.js +58 -0
- package/build/lib/cli/check.js.map +1 -0
- package/build/lib/cli/command/build.d.ts +42 -29
- package/build/lib/cli/command/build.d.ts.map +1 -1
- package/build/lib/cli/command/build.js +55 -39
- package/build/lib/cli/command/build.js.map +1 -1
- package/build/lib/cli/command/index.d.ts +4 -0
- package/build/lib/cli/command/index.d.ts.map +1 -1
- package/build/lib/cli/command/index.js +4 -0
- package/build/lib/cli/command/index.js.map +1 -1
- package/build/lib/cli/command/init.d.ts +42 -27
- package/build/lib/cli/command/init.d.ts.map +1 -1
- package/build/lib/cli/command/init.js +51 -28
- package/build/lib/cli/command/init.js.map +1 -1
- package/build/lib/cli/command/validate.d.ts +21 -15
- package/build/lib/cli/command/validate.d.ts.map +1 -1
- package/build/lib/cli/command/validate.js +30 -21
- package/build/lib/cli/command/validate.js.map +1 -1
- package/build/lib/cli/config.js +1 -1
- package/build/lib/cli/config.js.map +1 -1
- package/build/lib/cli/index.d.ts.map +1 -1
- package/build/lib/cli/index.js +29 -12
- package/build/lib/cli/index.js.map +1 -1
- package/build/lib/constants.d.ts +4 -0
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +5 -1
- package/build/lib/constants.js.map +1 -1
- package/build/lib/error.d.ts +5 -0
- package/build/lib/error.d.ts.map +1 -1
- package/build/lib/error.js +5 -0
- package/build/lib/error.js.map +1 -1
- package/build/lib/fs.d.ts +1 -1
- package/build/lib/fs.d.ts.map +1 -1
- package/build/lib/fs.js +2 -2
- package/build/lib/fs.js.map +1 -1
- package/build/lib/index.d.ts +4 -0
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +4 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/init.d.ts +24 -26
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +12 -7
- package/build/lib/init.js.map +1 -1
- package/build/lib/logger.js +0 -4
- package/build/lib/logger.js.map +1 -1
- package/build/lib/mike.d.ts.map +1 -1
- package/build/lib/mike.js +4 -0
- package/build/lib/mike.js.map +1 -1
- package/build/lib/model.d.ts +6 -10
- package/build/lib/model.d.ts.map +1 -1
- package/build/lib/scaffold.d.ts +5 -5
- package/build/lib/scaffold.d.ts.map +1 -1
- package/build/lib/util.d.ts +6 -3
- package/build/lib/util.d.ts.map +1 -1
- package/build/lib/util.js.map +1 -1
- package/build/lib/validate.d.ts +5 -2
- package/build/lib/validate.d.ts.map +1 -1
- package/build/lib/validate.js +9 -7
- package/build/lib/validate.js.map +1 -1
- package/lib/builder/deploy.ts +9 -3
- package/lib/builder/index.ts +5 -0
- package/lib/builder/nav.ts +2 -3
- package/lib/builder/reference.ts +2 -22
- package/lib/builder/site.ts +6 -5
- package/lib/cli/check.ts +87 -0
- package/lib/cli/command/build.ts +61 -46
- package/lib/cli/command/index.ts +5 -0
- package/lib/cli/command/init.ts +54 -32
- package/lib/cli/command/validate.ts +35 -28
- package/lib/cli/index.ts +23 -4
- package/lib/constants.ts +5 -0
- package/lib/error.ts +6 -0
- package/lib/fs.ts +6 -3
- package/lib/index.ts +5 -0
- package/lib/init.ts +23 -6
- package/lib/logger.ts +6 -11
- package/lib/mike.js +5 -0
- package/lib/model.ts +3 -9
- package/lib/util.ts +4 -1
- package/lib/validate.ts +10 -9
- package/package.json +10 -12
- package/requirements.txt +1 -1
- package/build/lib/build/mkdocs.d.ts +0 -58
- package/build/lib/build/mkdocs.d.ts.map +0 -1
- package/build/lib/build/mkdocs.js +0 -80
- package/build/lib/build/mkdocs.js.map +0 -1
- package/build/lib/build/typedoc.d.ts +0 -55
- package/build/lib/build/typedoc.d.ts.map +0 -1
- package/build/lib/build/typedoc.js +0 -120
- package/build/lib/build/typedoc.js.map +0 -1
- package/build/lib/build-api.d.ts +0 -18
- package/build/lib/build-api.d.ts.map +0 -1
- package/build/lib/build-api.js +0 -75
- package/build/lib/build-api.js.map +0 -1
- package/build/lib/build.d.ts +0 -21
- package/build/lib/build.d.ts.map +0 -1
- package/build/lib/build.js +0 -71
- package/build/lib/build.js.map +0 -1
- package/build/lib/cli/command/deploy.d.ts +0 -1
- package/build/lib/cli/command/deploy.d.ts.map +0 -1
- package/build/lib/cli/command/deploy.js +0 -2
- package/build/lib/cli/command/deploy.js.map +0 -1
- package/build/lib/cli/command-init.d.ts +0 -143
- package/build/lib/cli/command-init.d.ts.map +0 -1
- package/build/lib/cli/command-init.js +0 -164
- package/build/lib/cli/command-init.js.map +0 -1
- package/build/lib/cli/command-validate.d.ts +0 -52
- package/build/lib/cli/command-validate.d.ts.map +0 -1
- package/build/lib/cli/command-validate.js +0 -66
- package/build/lib/cli/command-validate.js.map +0 -1
- package/build/lib/cli/init.d.ts +0 -143
- package/build/lib/cli/init.d.ts.map +0 -1
- package/build/lib/cli/init.js +0 -164
- package/build/lib/cli/init.js.map +0 -1
- package/build/lib/cli/options.d.ts +0 -1
- package/build/lib/cli/options.d.ts.map +0 -1
- package/build/lib/cli/options.js +0 -2
- package/build/lib/cli/options.js.map +0 -1
- package/build/lib/cli/validate.d.ts +0 -1
- package/build/lib/cli/validate.d.ts.map +0 -1
- package/build/lib/cli/validate.js +0 -2
- package/build/lib/cli/validate.js.map +0 -1
- package/build/lib/cli.d.ts +0 -10
- package/build/lib/cli.d.ts.map +0 -1
- package/build/lib/cli.js +0 -328
- package/build/lib/cli.js.map +0 -1
- package/build/lib/init-task.d.ts +0 -49
- package/build/lib/init-task.d.ts.map +0 -1
- package/build/lib/init-task.js +0 -95
- package/build/lib/init-task.js.map +0 -1
- package/build/lib/io.d.ts +0 -1
- package/build/lib/io.d.ts.map +0 -1
- package/build/lib/io.js +0 -2
- package/build/lib/io.js.map +0 -1
- package/build/lib/mkdocs.d.ts +0 -58
- package/build/lib/mkdocs.d.ts.map +0 -1
- package/build/lib/mkdocs.js +0 -77
- package/build/lib/mkdocs.js.map +0 -1
- package/build/lib/nav.d.ts +0 -47
- package/build/lib/nav.d.ts.map +0 -1
- package/build/lib/nav.js +0 -132
- package/build/lib/nav.js.map +0 -1
- package/build/lib/test.d.ts +0 -9
- package/build/lib/test.d.ts.map +0 -1
- package/build/lib/test.js +0 -2
- package/build/lib/test.js.map +0 -1
- package/build/lib/typedoc.d.ts +0 -55
- package/build/lib/typedoc.d.ts.map +0 -1
- package/build/lib/typedoc.js +0 -122
- package/build/lib/typedoc.js.map +0 -1
- package/build/lib/types.d.ts +0 -52
- package/build/lib/types.d.ts.map +0 -1
- package/build/lib/types.js +0 -7
- package/build/lib/types.js.map +0 -1
- package/build/lib/validation/base-validator.d.ts +0 -218
- package/build/lib/validation/base-validator.d.ts.map +0 -1
- package/build/lib/validation/base-validator.js +0 -453
- package/build/lib/validation/base-validator.js.map +0 -1
- package/build/lib/validation/mkdocs-validator.d.ts +0 -5
- package/build/lib/validation/mkdocs-validator.d.ts.map +0 -1
- package/build/lib/validation/mkdocs-validator.js +0 -54
- package/build/lib/validation/mkdocs-validator.js.map +0 -1
- package/build/lib/validation/python-validator.d.ts +0 -1
- package/build/lib/validation/python-validator.d.ts.map +0 -1
- package/build/lib/validation/python-validator.js +0 -2
- package/build/lib/validation/python-validator.js.map +0 -1
- package/build/lib/validation/python.d.ts +0 -1
- package/build/lib/validation/python.d.ts.map +0 -1
- package/build/lib/validation/python.js +0 -2
- package/build/lib/validation/python.js.map +0 -1
- package/build/lib/validation/validate.d.ts +0 -221
- package/build/lib/validation/validate.d.ts.map +0 -1
- package/build/lib/validation/validate.js +0 -508
- package/build/lib/validation/validate.js.map +0 -1
- package/build/lib/validation/validator.d.ts +0 -220
- package/build/lib/validation/validator.d.ts.map +0 -1
- package/build/lib/validation/validator.js +0 -470
- package/build/lib/validation/validator.js.map +0 -1
- package/build/test/unit/mike.spec.js +0 -17
- package/build/test/unit/mike.spec.js.map +0 -1
package/lib/validate.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validates an environment for building documentation
|
|
2
|
+
* Validates an environment for building documentation; used by `validate` command
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {fs} from '@appium/support';
|
|
7
|
+
import {fs, util} from '@appium/support';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import _ from 'lodash';
|
|
10
10
|
import {EventEmitter} from 'node:events';
|
|
11
11
|
import path from 'node:path';
|
|
12
|
-
import pluralize from 'pluralize';
|
|
13
12
|
import {satisfies} from 'semver';
|
|
14
13
|
import {exec} from 'teen_process';
|
|
15
14
|
import {
|
|
@@ -36,7 +35,6 @@ import {
|
|
|
36
35
|
findMkDocsYml,
|
|
37
36
|
readJson5,
|
|
38
37
|
readTypedocJson,
|
|
39
|
-
readYaml,
|
|
40
38
|
whichMkDocs,
|
|
41
39
|
whichNpm,
|
|
42
40
|
whichPython,
|
|
@@ -287,7 +285,7 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
287
285
|
return this.requirementsTxt;
|
|
288
286
|
}
|
|
289
287
|
|
|
290
|
-
|
|
288
|
+
const requiredPackages: PipPackage[] = [];
|
|
291
289
|
|
|
292
290
|
try {
|
|
293
291
|
let requirementsTxt = await fs.readFile(REQUIREMENTS_TXT_PATH, 'utf8');
|
|
@@ -312,6 +310,9 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
312
310
|
this.emittedErrors.clear();
|
|
313
311
|
}
|
|
314
312
|
|
|
313
|
+
/**
|
|
314
|
+
* Validates that the correct version of `mkdocs` is installed
|
|
315
|
+
*/
|
|
315
316
|
protected async validateMkDocs() {
|
|
316
317
|
let mkDocsPath: string | undefined;
|
|
317
318
|
try {
|
|
@@ -466,7 +467,7 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
466
467
|
const msgParts = [];
|
|
467
468
|
if (missingPackages.length) {
|
|
468
469
|
msgParts.push(
|
|
469
|
-
`The following required ${pluralize(
|
|
470
|
+
`The following required ${util.pluralize(
|
|
470
471
|
'package',
|
|
471
472
|
missingPackages.length
|
|
472
473
|
)} could not be found:\n${missingPackages
|
|
@@ -476,7 +477,7 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
476
477
|
}
|
|
477
478
|
if (invalidVersionPackages.length) {
|
|
478
479
|
msgParts.push(
|
|
479
|
-
`The following required ${pluralize(
|
|
480
|
+
`The following required ${util.pluralize(
|
|
480
481
|
'package',
|
|
481
482
|
invalidVersionPackages.length
|
|
482
483
|
)} are installed, but at the wrong version:\n${invalidVersionPackages
|
|
@@ -533,7 +534,7 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
533
534
|
}
|
|
534
535
|
|
|
535
536
|
if (rawTypeDocVersion) {
|
|
536
|
-
|
|
537
|
+
const match = rawTypeDocVersion.match(TYPEDOC_VERSION_REGEX);
|
|
537
538
|
if (match) {
|
|
538
539
|
typeDocVersion = match[1];
|
|
539
540
|
} else {
|
|
@@ -621,7 +622,7 @@ export class DocutilsValidator extends EventEmitter {
|
|
|
621
622
|
return this.fail(`Could not find TypeScript compiler ("tsc") from ${pkgDir}`);
|
|
622
623
|
}
|
|
623
624
|
|
|
624
|
-
|
|
625
|
+
const match = rawTypeScriptVersion.match(TYPESCRIPT_VERSION_REGEX);
|
|
625
626
|
if (match) {
|
|
626
627
|
typeScriptVersion = match[1];
|
|
627
628
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/docutils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Documentation generation utilities for Appium and related projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -46,36 +46,34 @@
|
|
|
46
46
|
"test:e2e": "echo \"No e2e tests for this package\"",
|
|
47
47
|
"test:smoke": "node ./index.js",
|
|
48
48
|
"test:unit": "mocha \"./test/unit/**/*.spec.js\"",
|
|
49
|
-
"start": "node ./build/lib/cli.js"
|
|
49
|
+
"start": "node ./build/lib/cli/index.js"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@appium/support": "^3.1.
|
|
52
|
+
"@appium/support": "^3.1.7",
|
|
53
53
|
"@appium/tsconfig": "^0.2.4",
|
|
54
|
-
"@appium/typedoc-plugin-appium": "^0.
|
|
54
|
+
"@appium/typedoc-plugin-appium": "^0.5.1",
|
|
55
55
|
"@sliphua/lilconfig-ts-loader": "3.2.2",
|
|
56
56
|
"chalk": "4.1.2",
|
|
57
57
|
"consola": "2.15.3",
|
|
58
58
|
"diff": "5.1.0",
|
|
59
59
|
"figures": "3.2.0",
|
|
60
60
|
"find-up": "5.0.0",
|
|
61
|
-
"glob": "8.1.0",
|
|
62
61
|
"json5": "2.2.3",
|
|
63
|
-
"lilconfig": "2.0
|
|
62
|
+
"lilconfig": "2.1.0",
|
|
64
63
|
"lodash": "4.17.21",
|
|
65
64
|
"log-symbols": "4.1.0",
|
|
66
65
|
"pkg-dir": "5.0.0",
|
|
67
|
-
"pluralize": "8.0.0",
|
|
68
66
|
"read-pkg": "5.2.0",
|
|
69
67
|
"semver": "7.3.8",
|
|
70
68
|
"source-map-support": "0.5.21",
|
|
71
69
|
"teen_process": "2.0.2",
|
|
72
|
-
"type-fest": "3.
|
|
73
|
-
"typedoc": "0.23.
|
|
70
|
+
"type-fest": "3.6.1",
|
|
71
|
+
"typedoc": "0.23.26",
|
|
74
72
|
"typedoc-plugin-markdown": "3.14.0",
|
|
75
73
|
"typedoc-plugin-resolve-crossmodule-references": "0.3.3",
|
|
76
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "4.9.5",
|
|
77
75
|
"yaml": "2.2.1",
|
|
78
|
-
"yargs": "17.
|
|
76
|
+
"yargs": "17.7.1",
|
|
79
77
|
"yargs-parser": "21.1.1"
|
|
80
78
|
},
|
|
81
79
|
"engines": {
|
|
@@ -85,5 +83,5 @@
|
|
|
85
83
|
"publishConfig": {
|
|
86
84
|
"access": "public"
|
|
87
85
|
},
|
|
88
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "872b924a97c13142bdb8bf4218a4db324f309ce4"
|
|
89
87
|
}
|
package/requirements.txt
CHANGED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Functions for running `mkdocs`
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { SubProcess, TeenProcessExecOptions } from 'teen_process';
|
|
7
|
-
import { TupleToObject } from '../util';
|
|
8
|
-
/**
|
|
9
|
-
* Runs `mkdocs build` or `mkdocs serve`
|
|
10
|
-
* @param opts
|
|
11
|
-
*/
|
|
12
|
-
export declare function buildMkDocs({ mkdocsYml: mkDocsYmlPath, siteDir, theme, cwd, serve, serveOpts, execOpts, }?: BuildMkDocsOpts): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Options for {@linkcode buildMkDocs}.
|
|
15
|
-
*/
|
|
16
|
-
export interface BuildMkDocsOpts {
|
|
17
|
-
/**
|
|
18
|
-
* Path to `mkdocs.yml`
|
|
19
|
-
*/
|
|
20
|
-
mkdocsYml?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Path to output directory
|
|
23
|
-
*/
|
|
24
|
-
siteDir?: string;
|
|
25
|
-
/**
|
|
26
|
-
* MkDocs theme to use
|
|
27
|
-
* @defaultValue 'mkdocs'
|
|
28
|
-
*/
|
|
29
|
-
theme?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Current working directory
|
|
32
|
-
* @defaultValue `process.cwd()`
|
|
33
|
-
*/
|
|
34
|
-
cwd?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Path to `package.json`
|
|
37
|
-
*
|
|
38
|
-
* Used to find `mkdocs.yml` if unspecified.
|
|
39
|
-
*/
|
|
40
|
-
packageJson?: string;
|
|
41
|
-
/**
|
|
42
|
-
* If `true`, run `mkdocs serve` instead of `mkdocs build`
|
|
43
|
-
*/
|
|
44
|
-
serve?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Extra options for {@linkcode teen_process.exec}
|
|
47
|
-
*/
|
|
48
|
-
execOpts?: TeenProcessExecOptions;
|
|
49
|
-
/**
|
|
50
|
-
* Extra options for {@linkcode teen_process.Subprocess.start}
|
|
51
|
-
*/
|
|
52
|
-
serveOpts?: TeenProcessSubprocessStartOpts;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Conversion of the parameters of {@linkcode Subprocess.start} to an object.
|
|
56
|
-
*/
|
|
57
|
-
export declare type TeenProcessSubprocessStartOpts = Partial<TupleToObject<Parameters<SubProcess['start']>, ['startDetector', 'detach', 'timeoutMs']>>;
|
|
58
|
-
//# sourceMappingURL=mkdocs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mkdocs.d.ts","sourceRoot":"","sources":["../../../lib/build/mkdocs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAO,UAAU,EAAE,sBAAsB,EAAC,MAAM,cAAc,CAAC;AAItE,OAAO,EAAsB,aAAa,EAAC,MAAM,SAAS,CAAC;AAyC3D;;;GAGG;AACH,wBAAsB,WAAW,CAAC,EAChC,SAAS,EAAE,aAAa,EACxB,OAAO,EACP,KAAmB,EACnB,GAAmB,EACnB,KAAa,EACb,SAAS,EACT,QAAQ,GACT,GAAE,eAAoB,iBA6BtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED;;GAEG;AACH,oBAAY,8BAA8B,GAAG,OAAO,CAClD,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,eAAe,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CACzF,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Functions for running `mkdocs`
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.buildMkDocs = void 0;
|
|
12
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
const teen_process_1 = require("teen_process");
|
|
14
|
-
const constants_1 = require("../constants");
|
|
15
|
-
const fs_1 = require("../fs");
|
|
16
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
17
|
-
const util_1 = require("../util");
|
|
18
|
-
const error_1 = require("../error");
|
|
19
|
-
const log = logger_1.default.withTag('mkdocs');
|
|
20
|
-
/**
|
|
21
|
-
* Runs `mkdocs serve`
|
|
22
|
-
* @param args Extra args to `mkdocs build`
|
|
23
|
-
* @param opts Extra options for `teen_process.Subprocess.start`
|
|
24
|
-
* @param mkDocsPath Path to `mkdocs` executable
|
|
25
|
-
*/
|
|
26
|
-
async function doServe(args = [], { startDetector, detach, timeoutMs } = {}, mkDocsPath) {
|
|
27
|
-
mkDocsPath = mkDocsPath ?? (await (0, fs_1.whichMkDocs)());
|
|
28
|
-
const finalArgs = ['serve', ...args];
|
|
29
|
-
log.debug('Launching %s with args: %O', mkDocsPath, finalArgs);
|
|
30
|
-
const proc = new teen_process_1.SubProcess(mkDocsPath, finalArgs);
|
|
31
|
-
return await proc.start(startDetector, detach, timeoutMs);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Runs `mkdocs build`
|
|
35
|
-
* @param args Extra args to `mkdocs build`
|
|
36
|
-
* @param opts Extra options to `teen_process.exec`
|
|
37
|
-
* @param mkDocsPath Path to `mkdocs` executable
|
|
38
|
-
*/
|
|
39
|
-
async function doBuild(args = [], opts = {}, mkDocsPath) {
|
|
40
|
-
mkDocsPath = mkDocsPath ?? (await (0, fs_1.whichMkDocs)());
|
|
41
|
-
const finalArgs = ['build', ...args];
|
|
42
|
-
log.debug('Launching %s with args: %O', mkDocsPath, finalArgs);
|
|
43
|
-
return await (0, teen_process_1.exec)(mkDocsPath, finalArgs, opts);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Runs `mkdocs build` or `mkdocs serve`
|
|
47
|
-
* @param opts
|
|
48
|
-
*/
|
|
49
|
-
async function buildMkDocs({ mkdocsYml: mkDocsYmlPath, siteDir, theme = constants_1.NAME_MKDOCS, cwd = process.cwd(), serve = false, serveOpts, execOpts, } = {}) {
|
|
50
|
-
const stop = (0, util_1.stopwatch)('build-mkdocs');
|
|
51
|
-
mkDocsYmlPath = mkDocsYmlPath
|
|
52
|
-
? node_path_1.default.resolve(process.cwd(), mkDocsYmlPath)
|
|
53
|
-
: await (0, fs_1.findMkDocsYml)(cwd);
|
|
54
|
-
if (!mkDocsYmlPath) {
|
|
55
|
-
throw new error_1.DocutilsError(`Could not find ${constants_1.NAME_MKDOCS_YML} from ${cwd}; run "${constants_1.NAME_BIN} init" to create it`);
|
|
56
|
-
}
|
|
57
|
-
const mkdocsArgs = ['-f', mkDocsYmlPath, '-t', theme];
|
|
58
|
-
if (siteDir) {
|
|
59
|
-
mkdocsArgs.push('-d', siteDir);
|
|
60
|
-
}
|
|
61
|
-
if (serve) {
|
|
62
|
-
// unsure about how SIGHUP is handled here
|
|
63
|
-
await doServe(mkdocsArgs, serveOpts);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
await doBuild(mkdocsArgs, execOpts);
|
|
67
|
-
let relSiteDir;
|
|
68
|
-
if (siteDir) {
|
|
69
|
-
relSiteDir = (0, util_1.relative)(cwd, siteDir);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
({ site_dir: siteDir } = await (0, fs_1.readMkDocsYml)(mkDocsYmlPath));
|
|
73
|
-
log.debug('Found site_dir %s', siteDir);
|
|
74
|
-
relSiteDir = (0, util_1.relative)(node_path_1.default.dirname(mkDocsYmlPath), siteDir);
|
|
75
|
-
}
|
|
76
|
-
log.success('MkDocs finished building into %s (%dms)', relSiteDir, stop());
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.buildMkDocs = buildMkDocs;
|
|
80
|
-
//# sourceMappingURL=mkdocs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mkdocs.js","sourceRoot":"","sources":["../../../lib/build/mkdocs.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,0DAA6B;AAC7B,+CA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}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runs TypeDoc
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Executes TypeDoc _in the current process_
|
|
8
|
-
*
|
|
9
|
-
* Monkeypatches TypeDoc's homebrew "glob" implementation because it is broken
|
|
10
|
-
* @param pkgRoot - Package root path
|
|
11
|
-
* @param opts - TypeDoc options
|
|
12
|
-
*/
|
|
13
|
-
export declare function runTypedoc(pkgRoot: string, opts: Record<string, string>): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Options for {@linkcode buildReferenceDocs}
|
|
16
|
-
*/
|
|
17
|
-
export interface BuildReferenceOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Path to `typedoc.json`
|
|
20
|
-
*/
|
|
21
|
-
typedocJson?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Current working directory
|
|
24
|
-
*/
|
|
25
|
-
cwd?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Path to `package.json`
|
|
28
|
-
*/
|
|
29
|
-
packageJson?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Path to `tsconfig.json`
|
|
32
|
-
*/
|
|
33
|
-
tsconfigJson?: string;
|
|
34
|
-
/**
|
|
35
|
-
* "Title" for generated docs; this corresponds to {@linkcode typedoc.TypeDocOptionMap.name}
|
|
36
|
-
*/
|
|
37
|
-
title?: string;
|
|
38
|
-
/**
|
|
39
|
-
* This is here because we pass it thru to TypeDoc
|
|
40
|
-
*/
|
|
41
|
-
logLevel?: LogLevelName;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Log level names as supported by this package
|
|
45
|
-
*
|
|
46
|
-
* Used to convert our log level to TypeDoc's
|
|
47
|
-
*/
|
|
48
|
-
declare type LogLevelName = 'debug' | 'info' | 'error' | 'warn';
|
|
49
|
-
/**
|
|
50
|
-
* Build reference documentation via TypeDoc
|
|
51
|
-
* @param opts - Options
|
|
52
|
-
*/
|
|
53
|
-
export declare function buildReferenceDocs({ typedocJson: typeDocJsonPath, cwd, tsconfigJson: tsconfig, logLevel, title, }?: BuildReferenceOptions): Promise<void>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=typedoc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.d.ts","sourceRoot":"","sources":["../../../lib/build/typedoc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwCH;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAkB7E;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED;;;;GAIG;AACH,aAAK,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAexD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,WAAW,EAAE,eAAe,EAC5B,GAAmB,EACnB,YAAY,EAAE,QAAQ,EACtB,QAA4B,EAC5B,KAAK,GACN,GAAE,qBAA0B,iBA0D5B"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Runs TypeDoc
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.buildReferenceDocs = exports.runTypedoc = void 0;
|
|
12
|
-
const support_1 = require("@appium/support");
|
|
13
|
-
const glob_1 = __importDefault(require("glob"));
|
|
14
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
15
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
-
const typedoc_1 = require("typedoc");
|
|
17
|
-
const constants_1 = require("../constants");
|
|
18
|
-
const error_1 = require("../error");
|
|
19
|
-
const fs_1 = require("../fs");
|
|
20
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
21
|
-
const util_1 = require("../util");
|
|
22
|
-
const log = logger_1.default.withTag('typedoc');
|
|
23
|
-
/**
|
|
24
|
-
* Replaces TypeDoc's homebrew "glob" implementation with a real one
|
|
25
|
-
*
|
|
26
|
-
* This cannot be done via `require('typedoc')` or `import` due to the file being excluded
|
|
27
|
-
* from the export map in its `package.json`.
|
|
28
|
-
* @see https://github.com/TypeStrong/typedoc/issues/2151
|
|
29
|
-
*/
|
|
30
|
-
const monkeyPatchGlob = lodash_1.default.once((pkgRoot) => {
|
|
31
|
-
const tdFs = require(node_path_1.default.join(pkgRoot, 'node_modules', 'typedoc', 'dist', 'lib', 'utils', 'fs.js'));
|
|
32
|
-
tdFs.glob = glob_1.default.sync;
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* Executes TypeDoc _in the current process_
|
|
36
|
-
*
|
|
37
|
-
* Monkeypatches TypeDoc's homebrew "glob" implementation because it is broken
|
|
38
|
-
* @param pkgRoot - Package root path
|
|
39
|
-
* @param opts - TypeDoc options
|
|
40
|
-
*/
|
|
41
|
-
async function runTypedoc(pkgRoot, opts) {
|
|
42
|
-
monkeyPatchGlob(pkgRoot);
|
|
43
|
-
log.debug('Monkeypatched TypeDoc');
|
|
44
|
-
const args = (0, util_1.argify)(opts);
|
|
45
|
-
log.debug('TypeDoc args:', args);
|
|
46
|
-
const app = new typedoc_1.Application();
|
|
47
|
-
app.options.addReader(new typedoc_1.TypeDocReader());
|
|
48
|
-
app.options.addReader(new typedoc_1.ArgumentsReader(100, args));
|
|
49
|
-
app.bootstrap();
|
|
50
|
-
log.debug('Frozen options as computed by TypeDoc: %O', app.options.getRawValues());
|
|
51
|
-
const out = app.options.getValue('out');
|
|
52
|
-
const project = app.convert();
|
|
53
|
-
if (project) {
|
|
54
|
-
return await app.generateDocs(project, out);
|
|
55
|
-
}
|
|
56
|
-
throw new error_1.DocutilsError('TypeDoc found nothing to document. Is your package empty?');
|
|
57
|
-
}
|
|
58
|
-
exports.runTypedoc = runTypedoc;
|
|
59
|
-
/**
|
|
60
|
-
* Mapping of whatever our log level is to whatever TypeDoc's should be.
|
|
61
|
-
*
|
|
62
|
-
* TypeDoc's "info" is too verbose for our needs, and it's our default, so
|
|
63
|
-
* we map it to "warn".
|
|
64
|
-
*/
|
|
65
|
-
const TypeDocLogLevelMap = {
|
|
66
|
-
debug: 'Verbose',
|
|
67
|
-
info: 'Warn',
|
|
68
|
-
warn: 'Warn',
|
|
69
|
-
error: 'Error',
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Build reference documentation via TypeDoc
|
|
73
|
-
* @param opts - Options
|
|
74
|
-
*/
|
|
75
|
-
async function buildReferenceDocs({ typedocJson: typeDocJsonPath, cwd = process.cwd(), tsconfigJson: tsconfig, logLevel = constants_1.DEFAULT_LOG_LEVEL, title, } = {}) {
|
|
76
|
-
const stop = (0, util_1.stopwatch)('buildReferenceDocs');
|
|
77
|
-
typeDocJsonPath = typeDocJsonPath
|
|
78
|
-
? node_path_1.default.resolve(cwd, typeDocJsonPath)
|
|
79
|
-
: await (0, fs_1.findTypeDocJsonPath)(cwd);
|
|
80
|
-
if (!typeDocJsonPath) {
|
|
81
|
-
throw new error_1.DocutilsError(`Could not find ${constants_1.NAME_TYPEDOC_JSON} from ${cwd}; run "${constants_1.NAME_BIN}" to create it`);
|
|
82
|
-
}
|
|
83
|
-
const pkgRoot = support_1.fs.findRoot(cwd);
|
|
84
|
-
const relativePath = (0, util_1.relative)(cwd);
|
|
85
|
-
const relativeTypeDocJsonPath = relativePath(typeDocJsonPath);
|
|
86
|
-
log.debug(`Using ${relativeTypeDocJsonPath} as typedoc.json`);
|
|
87
|
-
let typeDocJson;
|
|
88
|
-
// we only need typedoc.json to make sure we have a custom "out" path.
|
|
89
|
-
try {
|
|
90
|
-
typeDocJson = (0, fs_1.readTypedocJson)(typeDocJsonPath);
|
|
91
|
-
log.debug('Contents of %s: %O', relativeTypeDocJsonPath, typeDocJson);
|
|
92
|
-
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
log.error(err);
|
|
95
|
-
throw new error_1.DocutilsError(`Could not read ${relativeTypeDocJsonPath}; run "${constants_1.NAME_BIN} init" to create it`);
|
|
96
|
-
}
|
|
97
|
-
// if for some reason "out" is not in typedoc.json, we want to use our default path.
|
|
98
|
-
// otherwise, typedoc's default behavior is to write to the "docs" dir, which is the same dir that
|
|
99
|
-
// we use (by default) as a source dir for the mkdocs site--which might contain files under vcs.
|
|
100
|
-
let out;
|
|
101
|
-
if (!typeDocJson.out) {
|
|
102
|
-
out = node_path_1.default.relative(node_path_1.default.dirname(typeDocJsonPath), node_path_1.default.join(pkgRoot, constants_1.DEFAULT_REL_TYPEDOC_OUT_PATH));
|
|
103
|
-
log.debug('Overriding "out" option with %s', out);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
out = typeDocJson.out;
|
|
107
|
-
log.debug(`Found "out" option in ${constants_1.NAME_TYPEDOC_JSON}: ${out}`);
|
|
108
|
-
}
|
|
109
|
-
const extraTypedocOpts = lodash_1.default.pickBy({ tsconfig, name: title, out, logLevel: TypeDocLogLevelMap[logLevel] }, Boolean);
|
|
110
|
-
log.debug('Extra typedoc opts: %O', extraTypedocOpts);
|
|
111
|
-
try {
|
|
112
|
-
await runTypedoc(pkgRoot, extraTypedocOpts);
|
|
113
|
-
log.success('Reference docs built at %s (%dms)', node_path_1.default.isAbsolute(out) ? relativePath(out) : out, stop());
|
|
114
|
-
}
|
|
115
|
-
catch (err) {
|
|
116
|
-
log.error(err);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.buildReferenceDocs = buildReferenceDocs;
|
|
120
|
-
//# sourceMappingURL=typedoc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.js","sourceRoot":"","sources":["../../../lib/build/typedoc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,6CAAmC;AACnC,gDAAwB;AACxB,oDAAuB;AACvB,0DAA6B;AAC7B,qCAAoF;AACpF,4CAKsB;AACtB,oCAAuC;AACvC,8BAA2D;AAC3D,uDAA+B;AAC/B,kCAAoD;AAEpD,MAAM,GAAG,GAAG,gBAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,gBAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAI,CAAC,IAAI,CAC5B,OAAO,EACP,cAAc,EACd,SAAS,EACT,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACI,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,IAA4B;IAC5E,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAEnC,MAAM,IAAI,GAAG,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC;IAC1B,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,qBAAW,EAAE,CAAC;IAC9B,GAAG,CAAC,OAAO,CAAC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AkB,CAAC,QAAQ,CAAC,EAAC,EACpE,OAAO,CACkB,CAAC;IAE5B,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;IACtD,IAAI;QACF,MAAM,UAAU,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAC5C,GAAG,CAAC,OAAO,CACT,mCAAmC,EACnC,mBAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAC9C,IAAI,EAAE,CACP,CAAC;KACH;IAAC,OAAO,GAAG,EAAE;QACZ,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAChB;AACH,CAAC;AAhED,gDAgEC"}
|
package/build/lib/build-api.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Executes TypeDoc in the current process
|
|
3
|
-
*
|
|
4
|
-
* Monkeypatch's TypeDoc's homebrew "glob" implementation because it is broken
|
|
5
|
-
* @param {string} pkgRoot
|
|
6
|
-
* @param {import('typedoc').TypeDocOptions} opts
|
|
7
|
-
*/
|
|
8
|
-
export function runTypedoc(pkgRoot: string, opts: import('typedoc').TypeDocOptions): import("typedoc").ProjectReflection | undefined;
|
|
9
|
-
export function buildTypedoc({ typedocJson: typedocJsonPath, cwd, packageJson: packageJsonPath, tsconfigJson: tsconfig, title, }?: {
|
|
10
|
-
typedocJson: any;
|
|
11
|
-
cwd?: string | undefined;
|
|
12
|
-
packageJson: any;
|
|
13
|
-
tsconfigJson: any;
|
|
14
|
-
title: any;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
export function buildReference(opts: any): Promise<void>;
|
|
17
|
-
export type TypedocJson = import('./types').TypedocJson;
|
|
18
|
-
//# sourceMappingURL=build-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-api.d.ts","sourceRoot":"","sources":["../../lib/build-api.js"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH,oCAHW,MAAM,QACN,OAAO,SAAS,EAAE,cAAc,mDAQ1C;AAED;;;;;;kBAoCC;AAED,yDAEC;0BAGY,OAAO,SAAS,EAAE,WAAW"}
|
package/build/lib/build-api.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.buildReference = exports.buildTypedoc = exports.runTypedoc = void 0;
|
|
7
|
-
const logger_1 = __importDefault(require("./logger"));
|
|
8
|
-
const support_1 = require("@appium/support");
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
-
const typedoc_1 = require("typedoc");
|
|
12
|
-
const error_1 = require("./error");
|
|
13
|
-
const util_1 = require("./util");
|
|
14
|
-
const glob_1 = __importDefault(require("glob"));
|
|
15
|
-
const LANGS = ['en', 'ja', 'zh'];
|
|
16
|
-
/**
|
|
17
|
-
* Replaces TypeDoc's homebrew "glob" implementation with a real one
|
|
18
|
-
*
|
|
19
|
-
* This cannot be done via `require('typedoc')` or `import` due to the file being excluded
|
|
20
|
-
* from the export map in its `package.json`.
|
|
21
|
-
* @see https://github.com/TypeStrong/typedoc/issues/2151
|
|
22
|
-
*/
|
|
23
|
-
const monkeyPatchGlob = lodash_1.default.once((pkgRoot) => {
|
|
24
|
-
const tdFs = require(node_path_1.default.join(pkgRoot, 'node_modules', 'typedoc', 'dist', 'lib', 'utils', 'fs.js'));
|
|
25
|
-
tdFs.glob = glob_1.default.sync;
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* Executes TypeDoc in the current process
|
|
29
|
-
*
|
|
30
|
-
* Monkeypatch's TypeDoc's homebrew "glob" implementation because it is broken
|
|
31
|
-
* @param {string} pkgRoot
|
|
32
|
-
* @param {import('typedoc').TypeDocOptions} opts
|
|
33
|
-
*/
|
|
34
|
-
function runTypedoc(pkgRoot, opts) {
|
|
35
|
-
monkeyPatchGlob(pkgRoot);
|
|
36
|
-
const app = new typedoc_1.Application();
|
|
37
|
-
app.options.addReader(new typedoc_1.TSConfigReader());
|
|
38
|
-
app.bootstrap(opts);
|
|
39
|
-
return app.convert();
|
|
40
|
-
}
|
|
41
|
-
exports.runTypedoc = runTypedoc;
|
|
42
|
-
async function buildTypedoc({ typedocJson: typedocJsonPath, cwd = process.cwd(), packageJson: packageJsonPath, tsconfigJson: tsconfig, title, } = {}) {
|
|
43
|
-
typedocJsonPath = typedocJsonPath ?? (await (0, util_1.getTypedocJsonPath)(cwd, packageJsonPath));
|
|
44
|
-
const pkgRoot = support_1.fs.findRoot(cwd);
|
|
45
|
-
const relativePath = (0, util_1.relative)(cwd);
|
|
46
|
-
const relativeTypedocJsonPath = relativePath(typedocJsonPath);
|
|
47
|
-
logger_1.default.debug(`Using ${relativeTypedocJsonPath} as typedoc.json`);
|
|
48
|
-
/** @type {TypedocJson} */
|
|
49
|
-
let typedocJson;
|
|
50
|
-
try {
|
|
51
|
-
typedocJson = /** @type {TypedocJson} */ (await (0, util_1.readJson)(typedocJsonPath));
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
throw new error_1.DocutilsError(`Could not read ${relativeTypedocJsonPath}; please execute "appium docutils init" to create it`);
|
|
55
|
-
}
|
|
56
|
-
const out = typedocJson.out ??
|
|
57
|
-
node_path_1.default.relative(typedocJsonPath, node_path_1.default.join(pkgRoot, util_1.DEFAULT_REL_TYPEDOC_OUT_PATH));
|
|
58
|
-
const finalTypedocJson = lodash_1.default.defaultsDeep(lodash_1.default.compact({ tsconfig, name: title, out }), lodash_1.default.omit(typedocJson, '$schema'));
|
|
59
|
-
try {
|
|
60
|
-
runTypedoc(pkgRoot, finalTypedocJson);
|
|
61
|
-
logger_1.default.success(`API docs built at ${relativePath(out)}`);
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
logger_1.default.error(err);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.buildTypedoc = buildTypedoc;
|
|
68
|
-
async function buildReference(opts) {
|
|
69
|
-
await buildTypedoc(opts);
|
|
70
|
-
}
|
|
71
|
-
exports.buildReference = buildReference;
|
|
72
|
-
/**
|
|
73
|
-
* @typedef {import('./types').TypedocJson} TypedocJson
|
|
74
|
-
*/
|
|
75
|
-
//# sourceMappingURL=build-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-api.js","sourceRoot":"","sources":["../../lib/build-api.js"],"names":[],"mappings":";;;;;;AAAA,sDAA2B;AAC3B,6CAAmC;AACnC,oDAAuB;AACvB,0DAA6B;AAC7B,qCAAoD;AACpD,mCAAsC;AACtC,iCAA4F;AAC5F,gDAAwB;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,gBAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAI,CAAC,IAAI,CAC5B,OAAO,EACP,cAAc,EACd,SAAS,EACT,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAAO,EAAE,IAAI;IACtC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,GAAG,GAAG,IAAI,qBAAW,EAAE,CAAC;IAC9B,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,wBAAc,EAAE,CAAC,CAAC;IAC5C,GAAG,CAAC,SAAS,CAAC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U,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACtC,gBAAG,CAAC,OAAO,CAAC,qBAAqB,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KACvD;IAAC,OAAO,GAAG,EAAE;QACZ,gBAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAChB;AACH,CAAC;AApCD,oCAoCC;AAEM,KAAK,UAAU,cAAc,CAAC,IAAI;IACvC,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAFD,wCAEC;AAED;;GAEG"}
|
package/build/lib/build.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TypeDocOptions } from 'typedoc';
|
|
2
|
-
/**
|
|
3
|
-
* Executes TypeDoc in the current process
|
|
4
|
-
*
|
|
5
|
-
* Monkeypatch's TypeDoc's homebrew "glob" implementation because it is broken
|
|
6
|
-
* @param pkgRoot - Package root path
|
|
7
|
-
* @param opts - TypeDoc options
|
|
8
|
-
*/
|
|
9
|
-
export declare function runTypedoc(pkgRoot: string, opts: TypeDocOptions): import("typedoc").ProjectReflection | undefined;
|
|
10
|
-
export interface BuildTypedocOptions {
|
|
11
|
-
typedocJson?: string;
|
|
12
|
-
cwd?: string;
|
|
13
|
-
packageJson?: string;
|
|
14
|
-
tsconfigJson?: string;
|
|
15
|
-
title?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function buildTypedoc({ typedocJson: typeDocJsonPath, cwd, packageJson: packageJsonPath, tsconfigJson: tsconfig, title, }?: BuildTypedocOptions): Promise<void>;
|
|
18
|
-
export declare function buildReference(opts?: BuildReferenceOptions): Promise<void>;
|
|
19
|
-
export interface BuildReferenceOptions extends BuildTypedocOptions {
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=build.d.ts.map
|
package/build/lib/build.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/build.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,cAAc,EAAC,MAAM,SAAS,CAAC;AA2BpE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,mDAM/D;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,EACjC,WAAW,EAAE,eAAe,EAC5B,GAAmB,EACnB,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,QAAQ,EACtB,KAAK,GACN,GAAE,mBAAwB,iBA4B1B;AAED,wBAAsB,cAAc,CAAC,IAAI,GAAE,qBAA0B,iBAEpE;AAED,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;CAAG"}
|