@appium/docutils 0.2.1 → 0.2.2

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 (133) hide show
  1. package/build/lib/builder/reference.d.ts +1 -1
  2. package/build/lib/builder/reference.d.ts.map +1 -1
  3. package/build/lib/cli/command/build.d.ts +174 -176
  4. package/build/lib/cli/command/build.d.ts.map +1 -1
  5. package/build/lib/cli/command/build.js +3 -5
  6. package/build/lib/cli/command/build.js.map +1 -1
  7. package/build/lib/cli/command/init.d.ts +139 -141
  8. package/build/lib/cli/command/init.d.ts.map +1 -1
  9. package/build/lib/cli/command/init.js +3 -5
  10. package/build/lib/cli/command/init.js.map +1 -1
  11. package/build/lib/cli/command/validate.d.ts +63 -65
  12. package/build/lib/cli/command/validate.d.ts.map +1 -1
  13. package/build/lib/cli/command/validate.js +3 -5
  14. package/build/lib/cli/command/validate.js.map +1 -1
  15. package/build/lib/cli/config.js +1 -1
  16. package/build/lib/cli/config.js.map +1 -1
  17. package/build/lib/init.d.ts +13 -22
  18. package/build/lib/init.d.ts.map +1 -1
  19. package/build/lib/logger.js +0 -4
  20. package/build/lib/logger.js.map +1 -1
  21. package/build/lib/model.d.ts +6 -10
  22. package/build/lib/model.d.ts.map +1 -1
  23. package/build/lib/scaffold.d.ts +5 -5
  24. package/build/lib/scaffold.d.ts.map +1 -1
  25. package/build/lib/util.d.ts +2 -2
  26. package/build/lib/util.d.ts.map +1 -1
  27. package/build/lib/validate.d.ts +1 -1
  28. package/build/lib/validate.d.ts.map +1 -1
  29. package/lib/cli/command/build.ts +4 -7
  30. package/lib/cli/command/init.ts +4 -7
  31. package/lib/cli/command/validate.ts +6 -7
  32. package/lib/logger.ts +6 -11
  33. package/lib/model.ts +3 -9
  34. package/package.json +8 -8
  35. package/requirements.txt +1 -1
  36. package/build/lib/build/mkdocs.d.ts +0 -58
  37. package/build/lib/build/mkdocs.d.ts.map +0 -1
  38. package/build/lib/build/mkdocs.js +0 -80
  39. package/build/lib/build/mkdocs.js.map +0 -1
  40. package/build/lib/build/typedoc.d.ts +0 -55
  41. package/build/lib/build/typedoc.d.ts.map +0 -1
  42. package/build/lib/build/typedoc.js +0 -120
  43. package/build/lib/build/typedoc.js.map +0 -1
  44. package/build/lib/build-api.d.ts +0 -18
  45. package/build/lib/build-api.d.ts.map +0 -1
  46. package/build/lib/build-api.js +0 -75
  47. package/build/lib/build-api.js.map +0 -1
  48. package/build/lib/build.d.ts +0 -21
  49. package/build/lib/build.d.ts.map +0 -1
  50. package/build/lib/build.js +0 -71
  51. package/build/lib/build.js.map +0 -1
  52. package/build/lib/cli/command/deploy.d.ts +0 -1
  53. package/build/lib/cli/command/deploy.d.ts.map +0 -1
  54. package/build/lib/cli/command/deploy.js +0 -2
  55. package/build/lib/cli/command/deploy.js.map +0 -1
  56. package/build/lib/cli/command-init.d.ts +0 -143
  57. package/build/lib/cli/command-init.d.ts.map +0 -1
  58. package/build/lib/cli/command-init.js +0 -164
  59. package/build/lib/cli/command-init.js.map +0 -1
  60. package/build/lib/cli/command-validate.d.ts +0 -52
  61. package/build/lib/cli/command-validate.d.ts.map +0 -1
  62. package/build/lib/cli/command-validate.js +0 -66
  63. package/build/lib/cli/command-validate.js.map +0 -1
  64. package/build/lib/cli/init.d.ts +0 -143
  65. package/build/lib/cli/init.d.ts.map +0 -1
  66. package/build/lib/cli/init.js +0 -164
  67. package/build/lib/cli/init.js.map +0 -1
  68. package/build/lib/cli/options.d.ts +0 -1
  69. package/build/lib/cli/options.d.ts.map +0 -1
  70. package/build/lib/cli/options.js +0 -2
  71. package/build/lib/cli/options.js.map +0 -1
  72. package/build/lib/cli/validate.d.ts +0 -1
  73. package/build/lib/cli/validate.d.ts.map +0 -1
  74. package/build/lib/cli/validate.js +0 -2
  75. package/build/lib/cli/validate.js.map +0 -1
  76. package/build/lib/cli.d.ts +0 -10
  77. package/build/lib/cli.d.ts.map +0 -1
  78. package/build/lib/cli.js +0 -328
  79. package/build/lib/cli.js.map +0 -1
  80. package/build/lib/init-task.d.ts +0 -49
  81. package/build/lib/init-task.d.ts.map +0 -1
  82. package/build/lib/init-task.js +0 -95
  83. package/build/lib/init-task.js.map +0 -1
  84. package/build/lib/io.d.ts +0 -1
  85. package/build/lib/io.d.ts.map +0 -1
  86. package/build/lib/io.js +0 -2
  87. package/build/lib/io.js.map +0 -1
  88. package/build/lib/mkdocs.d.ts +0 -58
  89. package/build/lib/mkdocs.d.ts.map +0 -1
  90. package/build/lib/mkdocs.js +0 -77
  91. package/build/lib/mkdocs.js.map +0 -1
  92. package/build/lib/nav.d.ts +0 -47
  93. package/build/lib/nav.d.ts.map +0 -1
  94. package/build/lib/nav.js +0 -132
  95. package/build/lib/nav.js.map +0 -1
  96. package/build/lib/test.d.ts +0 -9
  97. package/build/lib/test.d.ts.map +0 -1
  98. package/build/lib/test.js +0 -2
  99. package/build/lib/test.js.map +0 -1
  100. package/build/lib/typedoc.d.ts +0 -55
  101. package/build/lib/typedoc.d.ts.map +0 -1
  102. package/build/lib/typedoc.js +0 -122
  103. package/build/lib/typedoc.js.map +0 -1
  104. package/build/lib/types.d.ts +0 -52
  105. package/build/lib/types.d.ts.map +0 -1
  106. package/build/lib/types.js +0 -7
  107. package/build/lib/types.js.map +0 -1
  108. package/build/lib/validation/base-validator.d.ts +0 -218
  109. package/build/lib/validation/base-validator.d.ts.map +0 -1
  110. package/build/lib/validation/base-validator.js +0 -453
  111. package/build/lib/validation/base-validator.js.map +0 -1
  112. package/build/lib/validation/mkdocs-validator.d.ts +0 -5
  113. package/build/lib/validation/mkdocs-validator.d.ts.map +0 -1
  114. package/build/lib/validation/mkdocs-validator.js +0 -54
  115. package/build/lib/validation/mkdocs-validator.js.map +0 -1
  116. package/build/lib/validation/python-validator.d.ts +0 -1
  117. package/build/lib/validation/python-validator.d.ts.map +0 -1
  118. package/build/lib/validation/python-validator.js +0 -2
  119. package/build/lib/validation/python-validator.js.map +0 -1
  120. package/build/lib/validation/python.d.ts +0 -1
  121. package/build/lib/validation/python.d.ts.map +0 -1
  122. package/build/lib/validation/python.js +0 -2
  123. package/build/lib/validation/python.js.map +0 -1
  124. package/build/lib/validation/validate.d.ts +0 -221
  125. package/build/lib/validation/validate.d.ts.map +0 -1
  126. package/build/lib/validation/validate.js +0 -508
  127. package/build/lib/validation/validate.js.map +0 -1
  128. package/build/lib/validation/validator.d.ts +0 -220
  129. package/build/lib/validation/validator.d.ts.map +0 -1
  130. package/build/lib/validation/validator.js +0 -470
  131. package/build/lib/validation/validator.js.map +0 -1
  132. package/build/test/unit/mike.spec.js +0 -17
  133. package/build/test/unit/mike.spec.js.map +0 -1
@@ -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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C;SAC9D;QACD,GAAG,CAAC,OAAO,CAAC,yCAAyC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;KAC5E;AACH,CAAC;AArCD,kCAqCC"}
@@ -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,SAAS,CAAC,IAAI,uBAAa,EAAE,CAAC,CAAC;IAC3C,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,yBAAe,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB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AC;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"}
@@ -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"}
@@ -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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AAC,OAAO,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAC,CAAC,EACvC,gBAAC,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAC/B,CAAC;IAEF,IAAI;QACF,UAAU,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"}
@@ -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
@@ -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"}
@@ -1,71 +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 constants_1 = require("./constants");
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 pkgRoot - Package root path
32
- * @param opts - TypeDoc options
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
- let typedocJson;
49
- try {
50
- typedocJson = await (0, util_1.readJson)(typeDocJsonPath);
51
- }
52
- catch (err) {
53
- throw new error_1.DocutilsError(`Could not read ${relativeTypedocJsonPath}; please execute "appium docutils init" to create it`);
54
- }
55
- const out = typedocJson.out ??
56
- node_path_1.default.relative(typeDocJsonPath, node_path_1.default.join(pkgRoot, constants_1.DEFAULT_REL_TYPEDOC_OUT_PATH));
57
- const finalTypedocJson = lodash_1.default.defaultsDeep(lodash_1.default.pickBy({ tsconfig, name: title, out }, (value, key) => value && key !== constants_1.NAME_SCHEMA));
58
- try {
59
- runTypedoc(pkgRoot, finalTypedocJson);
60
- logger_1.default.success(`API docs built at ${relativePath(out)}`);
61
- }
62
- catch (err) {
63
- logger_1.default.error(err);
64
- }
65
- }
66
- exports.buildTypedoc = buildTypedoc;
67
- async function buildReference(opts = {}) {
68
- await buildTypedoc(opts);
69
- }
70
- exports.buildReference = buildReference;
71
- //# sourceMappingURL=build.js.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lib/cli/command/deploy.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=deploy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../lib/cli/command/deploy.ts"],"names":[],"mappings":""}
@@ -1,143 +0,0 @@
1
- import { CommandModule, InferredOptionTypes } from 'yargs';
2
- declare const opts: {
3
- readonly copyright: {
4
- readonly description: "Copyright notice";
5
- readonly group: "MkDocs Config:";
6
- readonly nargs: 1;
7
- readonly requiresArg: true;
8
- readonly type: "string";
9
- };
10
- readonly dir: {
11
- readonly default: ".";
12
- readonly defaultDescription: "(current directory)";
13
- readonly description: "Directory of package";
14
- readonly group: "Paths:";
15
- readonly normalize: true;
16
- readonly type: "string";
17
- };
18
- readonly 'dry-run': {
19
- readonly describe: "Do not write any files; show what would be done";
20
- readonly group: "Initialization Behavior:";
21
- readonly type: "boolean";
22
- };
23
- readonly force: {
24
- readonly alias: "f";
25
- readonly describe: "Overwrite existing configurations";
26
- readonly group: "Initialization Behavior:";
27
- readonly type: "boolean";
28
- };
29
- readonly include: {
30
- readonly alias: "i";
31
- readonly array: true;
32
- readonly coerce: (value: string | string[]) => string[];
33
- readonly description: "Files to include in compilation (globs OK)";
34
- readonly nargs: 1;
35
- readonly requiresArg: true;
36
- readonly type: "string";
37
- };
38
- readonly mkdocs: {
39
- readonly default: true;
40
- readonly description: "Create mkdocs.yml if needed";
41
- readonly group: "Initialization Behavior:";
42
- readonly type: "boolean";
43
- };
44
- readonly 'mkdocs-yml': {
45
- readonly defaultDescription: "./mkdocs.yml";
46
- readonly description: "Path to mkdocs.yml";
47
- readonly group: "Paths:";
48
- readonly nargs: 1;
49
- readonly normalize: true;
50
- readonly requiresArg: true;
51
- readonly type: "string";
52
- };
53
- readonly 'package-json': {
54
- readonly defaultDescription: "./package.json";
55
- readonly describe: "Path to package.json";
56
- readonly group: "Paths:";
57
- readonly nargs: 1;
58
- readonly normalize: true;
59
- readonly requiresArg: true;
60
- readonly type: "string";
61
- };
62
- readonly python: {
63
- readonly default: true;
64
- readonly description: "Install Python dependencies if needed";
65
- readonly group: "Initialization Behavior:";
66
- readonly type: "boolean";
67
- };
68
- readonly 'python-path': {
69
- readonly defaultDescription: "(derived from shell)";
70
- readonly description: "Path to python 3 executable";
71
- readonly group: "Paths:";
72
- readonly nargs: 1;
73
- readonly normalize: true;
74
- readonly requiresArg: true;
75
- readonly type: "string";
76
- };
77
- readonly 'repo-name': {
78
- readonly defaultDescription: "(derived from --repo-url)";
79
- readonly description: "Name of extension repository";
80
- readonly group: "MkDocs Config:";
81
- readonly nargs: 1;
82
- readonly requiresArg: true;
83
- readonly type: "string";
84
- };
85
- readonly 'repo-url': {
86
- readonly defaultDescription: "(from package.json)";
87
- readonly description: "URL of extension repository";
88
- readonly group: "MkDocs Config:";
89
- readonly nargs: 1;
90
- readonly requiresArg: true;
91
- readonly type: "string";
92
- };
93
- readonly 'site-description': {
94
- readonly defaultDescription: "(from package.json)";
95
- readonly description: "Site description";
96
- readonly group: "MkDocs Config:";
97
- readonly nargs: 1;
98
- readonly requiresArg: true;
99
- readonly type: "string";
100
- };
101
- readonly 'site-name': {
102
- readonly defaultDescription: "(extension package name)";
103
- readonly description: "Name of site";
104
- readonly group: "MkDocs Config:";
105
- readonly nargs: 1;
106
- readonly requiresArg: true;
107
- readonly type: "string";
108
- };
109
- readonly 'tsconfig-json': {
110
- readonly defaultDescription: "./tsconfig.json";
111
- readonly describe: "Path to tsconfig.json";
112
- readonly group: "Paths:";
113
- readonly nargs: 1;
114
- readonly normalize: true;
115
- readonly requiresArg: true;
116
- readonly type: "string";
117
- };
118
- readonly typedoc: {
119
- readonly default: true;
120
- readonly description: "Create typedoc.json if needed";
121
- readonly group: "Initialization Behavior:";
122
- readonly type: "boolean";
123
- };
124
- readonly 'typedoc-json': {
125
- readonly defaultDescription: "./typedoc.json";
126
- readonly describe: "Path to typedoc.json";
127
- readonly group: "Paths:";
128
- readonly nargs: 1;
129
- readonly normalize: true;
130
- readonly requiresArg: true;
131
- readonly type: "string";
132
- };
133
- readonly typescript: {
134
- readonly default: true;
135
- readonly description: "Create tsconfig.json if needed";
136
- readonly group: "Initialization Behavior:";
137
- readonly type: "boolean";
138
- };
139
- };
140
- declare type InitOptions = InferredOptionTypes<typeof opts>;
141
- declare const initCommand: CommandModule<{}, InitOptions>;
142
- export default initCommand;
143
- //# sourceMappingURL=command-init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-init.d.ts","sourceRoot":"","sources":["../../../lib/cli/command-init.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAU,MAAM,OAAO,CAAC;AAWlE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA8BU,MAAM,GAAG,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2G3B,CAAC;AAGX,aAAK,WAAW,GAAG,mBAAmB,CAAC,OAAO,IAAI,CAAC,CAAC;AAEpD,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,EAAE,EAAE,WAAW,CAS/C,CAAC;AAEF,eAAe,WAAW,CAAC"}