@appium/docutils 0.2.0 → 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 (142) hide show
  1. package/build/lib/builder/deploy.d.ts +2 -2
  2. package/build/lib/builder/deploy.d.ts.map +1 -1
  3. package/build/lib/builder/deploy.js +6 -3
  4. package/build/lib/builder/deploy.js.map +1 -1
  5. package/build/lib/builder/nav.d.ts.map +1 -1
  6. package/build/lib/builder/nav.js +27 -19
  7. package/build/lib/builder/nav.js.map +1 -1
  8. package/build/lib/builder/reference.d.ts +1 -1
  9. package/build/lib/builder/reference.d.ts.map +1 -1
  10. package/build/lib/cli/command/build.d.ts +174 -176
  11. package/build/lib/cli/command/build.d.ts.map +1 -1
  12. package/build/lib/cli/command/build.js +3 -5
  13. package/build/lib/cli/command/build.js.map +1 -1
  14. package/build/lib/cli/command/init.d.ts +139 -141
  15. package/build/lib/cli/command/init.d.ts.map +1 -1
  16. package/build/lib/cli/command/init.js +3 -5
  17. package/build/lib/cli/command/init.js.map +1 -1
  18. package/build/lib/cli/command/validate.d.ts +63 -65
  19. package/build/lib/cli/command/validate.d.ts.map +1 -1
  20. package/build/lib/cli/command/validate.js +3 -5
  21. package/build/lib/cli/command/validate.js.map +1 -1
  22. package/build/lib/cli/config.js +1 -1
  23. package/build/lib/cli/config.js.map +1 -1
  24. package/build/lib/init.d.ts +13 -22
  25. package/build/lib/init.d.ts.map +1 -1
  26. package/build/lib/logger.js +0 -4
  27. package/build/lib/logger.js.map +1 -1
  28. package/build/lib/model.d.ts +6 -10
  29. package/build/lib/model.d.ts.map +1 -1
  30. package/build/lib/scaffold.d.ts +5 -5
  31. package/build/lib/scaffold.d.ts.map +1 -1
  32. package/build/lib/util.d.ts +2 -2
  33. package/build/lib/util.d.ts.map +1 -1
  34. package/build/lib/validate.d.ts +1 -1
  35. package/build/lib/validate.d.ts.map +1 -1
  36. package/lib/builder/deploy.ts +10 -4
  37. package/lib/builder/nav.ts +28 -22
  38. package/lib/cli/command/build.ts +4 -7
  39. package/lib/cli/command/init.ts +4 -7
  40. package/lib/cli/command/validate.ts +6 -7
  41. package/lib/logger.ts +6 -11
  42. package/lib/model.ts +3 -9
  43. package/package.json +8 -8
  44. package/requirements.txt +1 -1
  45. package/build/lib/build/mkdocs.d.ts +0 -58
  46. package/build/lib/build/mkdocs.d.ts.map +0 -1
  47. package/build/lib/build/mkdocs.js +0 -80
  48. package/build/lib/build/mkdocs.js.map +0 -1
  49. package/build/lib/build/typedoc.d.ts +0 -55
  50. package/build/lib/build/typedoc.d.ts.map +0 -1
  51. package/build/lib/build/typedoc.js +0 -120
  52. package/build/lib/build/typedoc.js.map +0 -1
  53. package/build/lib/build-api.d.ts +0 -18
  54. package/build/lib/build-api.d.ts.map +0 -1
  55. package/build/lib/build-api.js +0 -75
  56. package/build/lib/build-api.js.map +0 -1
  57. package/build/lib/build.d.ts +0 -21
  58. package/build/lib/build.d.ts.map +0 -1
  59. package/build/lib/build.js +0 -71
  60. package/build/lib/build.js.map +0 -1
  61. package/build/lib/cli/command/deploy.d.ts +0 -1
  62. package/build/lib/cli/command/deploy.d.ts.map +0 -1
  63. package/build/lib/cli/command/deploy.js +0 -2
  64. package/build/lib/cli/command/deploy.js.map +0 -1
  65. package/build/lib/cli/command-init.d.ts +0 -143
  66. package/build/lib/cli/command-init.d.ts.map +0 -1
  67. package/build/lib/cli/command-init.js +0 -164
  68. package/build/lib/cli/command-init.js.map +0 -1
  69. package/build/lib/cli/command-validate.d.ts +0 -52
  70. package/build/lib/cli/command-validate.d.ts.map +0 -1
  71. package/build/lib/cli/command-validate.js +0 -66
  72. package/build/lib/cli/command-validate.js.map +0 -1
  73. package/build/lib/cli/init.d.ts +0 -143
  74. package/build/lib/cli/init.d.ts.map +0 -1
  75. package/build/lib/cli/init.js +0 -164
  76. package/build/lib/cli/init.js.map +0 -1
  77. package/build/lib/cli/options.d.ts +0 -1
  78. package/build/lib/cli/options.d.ts.map +0 -1
  79. package/build/lib/cli/options.js +0 -2
  80. package/build/lib/cli/options.js.map +0 -1
  81. package/build/lib/cli/validate.d.ts +0 -1
  82. package/build/lib/cli/validate.d.ts.map +0 -1
  83. package/build/lib/cli/validate.js +0 -2
  84. package/build/lib/cli/validate.js.map +0 -1
  85. package/build/lib/cli.d.ts +0 -10
  86. package/build/lib/cli.d.ts.map +0 -1
  87. package/build/lib/cli.js +0 -328
  88. package/build/lib/cli.js.map +0 -1
  89. package/build/lib/init-task.d.ts +0 -49
  90. package/build/lib/init-task.d.ts.map +0 -1
  91. package/build/lib/init-task.js +0 -95
  92. package/build/lib/init-task.js.map +0 -1
  93. package/build/lib/io.d.ts +0 -1
  94. package/build/lib/io.d.ts.map +0 -1
  95. package/build/lib/io.js +0 -2
  96. package/build/lib/io.js.map +0 -1
  97. package/build/lib/mkdocs.d.ts +0 -58
  98. package/build/lib/mkdocs.d.ts.map +0 -1
  99. package/build/lib/mkdocs.js +0 -77
  100. package/build/lib/mkdocs.js.map +0 -1
  101. package/build/lib/nav.d.ts +0 -47
  102. package/build/lib/nav.d.ts.map +0 -1
  103. package/build/lib/nav.js +0 -132
  104. package/build/lib/nav.js.map +0 -1
  105. package/build/lib/test.d.ts +0 -9
  106. package/build/lib/test.d.ts.map +0 -1
  107. package/build/lib/test.js +0 -2
  108. package/build/lib/test.js.map +0 -1
  109. package/build/lib/typedoc.d.ts +0 -55
  110. package/build/lib/typedoc.d.ts.map +0 -1
  111. package/build/lib/typedoc.js +0 -122
  112. package/build/lib/typedoc.js.map +0 -1
  113. package/build/lib/types.d.ts +0 -52
  114. package/build/lib/types.d.ts.map +0 -1
  115. package/build/lib/types.js +0 -7
  116. package/build/lib/types.js.map +0 -1
  117. package/build/lib/validation/base-validator.d.ts +0 -218
  118. package/build/lib/validation/base-validator.d.ts.map +0 -1
  119. package/build/lib/validation/base-validator.js +0 -453
  120. package/build/lib/validation/base-validator.js.map +0 -1
  121. package/build/lib/validation/mkdocs-validator.d.ts +0 -5
  122. package/build/lib/validation/mkdocs-validator.d.ts.map +0 -1
  123. package/build/lib/validation/mkdocs-validator.js +0 -54
  124. package/build/lib/validation/mkdocs-validator.js.map +0 -1
  125. package/build/lib/validation/python-validator.d.ts +0 -1
  126. package/build/lib/validation/python-validator.d.ts.map +0 -1
  127. package/build/lib/validation/python-validator.js +0 -2
  128. package/build/lib/validation/python-validator.js.map +0 -1
  129. package/build/lib/validation/python.d.ts +0 -1
  130. package/build/lib/validation/python.d.ts.map +0 -1
  131. package/build/lib/validation/python.js +0 -2
  132. package/build/lib/validation/python.js.map +0 -1
  133. package/build/lib/validation/validate.d.ts +0 -221
  134. package/build/lib/validation/validate.d.ts.map +0 -1
  135. package/build/lib/validation/validate.js +0 -508
  136. package/build/lib/validation/validate.js.map +0 -1
  137. package/build/lib/validation/validator.d.ts +0 -220
  138. package/build/lib/validation/validator.d.ts.map +0 -1
  139. package/build/lib/validation/validator.js +0 -470
  140. package/build/lib/validation/validator.js.map +0 -1
  141. package/build/test/unit/mike.spec.js +0 -17
  142. package/build/test/unit/mike.spec.js.map +0 -1
@@ -1,122 +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.buildReference = 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
- * Converts an object of string values to an array of arguments for CLI
36
- */
37
- const argify = lodash_1.default.flow(lodash_1.default.entries, lodash_1.default.flatten, (list) => list.map((v, idx) => (idx % 2 === 0 ? `--${v}` : v)));
38
- /**
39
- * Executes TypeDoc _in the current process_
40
- *
41
- * Monkeypatches TypeDoc's homebrew "glob" implementation because it is broken
42
- * @param pkgRoot - Package root path
43
- * @param opts - TypeDoc options
44
- */
45
- async function runTypedoc(pkgRoot, opts) {
46
- monkeyPatchGlob(pkgRoot);
47
- log.debug('Monkeypatched TypeDoc');
48
- const args = argify(opts);
49
- log.debug('TypeDoc args:', args);
50
- const app = new typedoc_1.Application();
51
- app.options.addReader(new typedoc_1.TypeDocReader());
52
- app.options.addReader(new typedoc_1.ArgumentsReader(100, args));
53
- app.bootstrap();
54
- log.debug('Frozen options as computed by TypeDoc: %O', app.options.getRawValues());
55
- const out = app.options.getValue('out');
56
- const project = app.convert();
57
- if (project) {
58
- return await app.generateDocs(project, out);
59
- }
60
- throw new error_1.DocutilsError('TypeDoc found nothing to document. Is your package empty?');
61
- }
62
- exports.runTypedoc = runTypedoc;
63
- /**
64
- * Mapping of whatever our log level is to whatever TypeDoc's should be.
65
- *
66
- * TypeDoc's "info" is too verbose for our needs, and it's our default, so
67
- * we map it to "warn".
68
- */
69
- const TypeDocLogLevelMap = {
70
- debug: 'Verbose',
71
- info: 'Warn',
72
- warn: 'Warn',
73
- error: 'Error',
74
- };
75
- /**
76
- * Build reference documentation via TypeDoc
77
- * @param opts - Options
78
- */
79
- async function buildReference({ typedocJson: typeDocJsonPath, cwd = process.cwd(), tsconfigJson: tsconfig, logLevel = constants_1.DEFAULT_LOG_LEVEL, title, } = {}) {
80
- const stop = (0, util_1.stopwatch)('buildReference');
81
- typeDocJsonPath = typeDocJsonPath ?? (await (0, fs_1.findTypeDocJsonPath)(cwd));
82
- if (!typeDocJsonPath) {
83
- throw new error_1.DocutilsError(`Could not find ${constants_1.NAME_TYPEDOC_JSON} from ${cwd}; run "${constants_1.NAME_BIN}" to create it`);
84
- }
85
- const pkgRoot = support_1.fs.findRoot(cwd);
86
- const relativePath = (0, util_1.relative)(cwd);
87
- const relativeTypeDocJsonPath = relativePath(typeDocJsonPath);
88
- log.debug(`Using ${relativeTypeDocJsonPath} as typedoc.json`);
89
- let typeDocJson;
90
- // we only need typedoc.json to make sure we have a custom "out" path.
91
- try {
92
- typeDocJson = (0, fs_1.readTypedocJson)(typeDocJsonPath);
93
- log.debug('Contents of %s: %O', relativeTypeDocJsonPath, typeDocJson);
94
- }
95
- catch (err) {
96
- log.error(err);
97
- throw new error_1.DocutilsError(`Could not read ${relativeTypeDocJsonPath}; run "${constants_1.NAME_BIN} init" to create it`);
98
- }
99
- // if for some reason "out" is not in typedoc.json, we want to use our default path.
100
- // otherwise, typedoc's default behavior is to write to the "docs" dir, which is the same dir that
101
- // we use (by default) as a source dir for the mkdocs site--which might contain files under vcs.
102
- let out;
103
- if (!typeDocJson.out) {
104
- 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));
105
- log.debug('Overriding "out" option with %s', out);
106
- }
107
- else {
108
- out = typeDocJson.out;
109
- log.debug(`Found "out" option in ${constants_1.NAME_TYPEDOC_JSON}: ${out}`);
110
- }
111
- const extraTypedocOpts = lodash_1.default.pickBy({ tsconfig, name: title, out, logLevel: TypeDocLogLevelMap[logLevel] }, Boolean);
112
- log.debug('Extra typedoc opts: %O', extraTypedocOpts);
113
- try {
114
- await runTypedoc(pkgRoot, extraTypedocOpts);
115
- log.success('Reference docs built at %s (%dms)', node_path_1.default.isAbsolute(out) ? relativePath(out) : out, stop());
116
- }
117
- catch (err) {
118
- log.error(err);
119
- }
120
- }
121
- exports.buildReference = buildReference;
122
- //# sourceMappingURL=typedoc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typedoc.js","sourceRoot":"","sources":["../../lib/typedoc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,6CAAmC;AACnC,gDAAwB;AACxB,oDAAuB;AACvB,0DAA6B;AAC7B,qCAAoF;AACpF,2CAKqB;AACrB,mCAAsC;AACtC,6BAA0D;AAC1D,sDAA8B;AAC9B,iCAA2C;AAE3C,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;;GAEG;AACH,MAAM,MAAM,GAA8C,gBAAC,CAAC,IAAI,CAAC,gBAAC,CAAC,OAAO,EAAE,gBAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAC9F,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACrD,CAAC;AAEF;;;;;;GAMG;AACI,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,IAA4B;IAC5E,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,GAAG,CAAC,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K,GAAG,EAAE,CAAC,CAAC;KACjE;IAED,MAAM,gBAAgB,GAAG,gBAAC,CAAC,MAAM,CAC/B,EAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,kBAAkB,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;AA9DD,wCA8DC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Utility types
3
- * @module
4
- */
5
- import type { Jsonify, JsonValue, TsConfigJson as TsConfigJsonBase } from 'type-fest';
6
- import type { TypeDocOptions } from 'typedoc';
7
- /**
8
- * A `tsconfig.json` file w/ `$schema` prop
9
- */
10
- export declare type TsConfigJson = Jsonify<TsConfigJsonBase & {
11
- $schema?: string;
12
- }>;
13
- /**
14
- * A `typedoc.json` file w/ `$schema` and `extends` props
15
- */
16
- export declare type TypeDocJson = Jsonify<Partial<TypeDocOptions> & {
17
- $schema?: string;
18
- extends?: string;
19
- }>;
20
- export declare type MkDocsYml = Jsonify<{
21
- copyright?: string;
22
- dev_addr?: string;
23
- docs_dir?: string;
24
- extra_css?: string[];
25
- extra_javascript?: string[];
26
- extra_templates?: string[];
27
- extra?: Record<string, JsonValue>;
28
- hooks?: string[];
29
- INHERIT?: string;
30
- markdown_extensions?: (string | Record<string, JsonValue>)[];
31
- nav?: (string | Record<string, string>)[];
32
- plugins?: (string | Record<string, JsonValue>)[];
33
- repo_name?: string;
34
- repo_url?: string;
35
- site_dir?: string;
36
- /**
37
- * This is _actually_ required by mkdocs
38
- */
39
- site_name?: string;
40
- site_description?: string;
41
- strict?: boolean;
42
- theme?: MkDocsYmlTheme;
43
- use_directory_urls?: boolean;
44
- watch?: string[];
45
- }>;
46
- export declare type MkDocsYmlTheme = string | ({
47
- name: string;
48
- locale?: string;
49
- custom_dir?: string;
50
- static_templates?: string[];
51
- } & Record<string, JsonValue>);
52
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,SAAS,EAAe,YAAY,IAAI,gBAAgB,EAAC,MAAM,WAAW,CAAC;AACjG,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,oBAAY,YAAY,GAAG,OAAO,CAChC,gBAAgB,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF;;GAEG;AACH,oBAAY,WAAW,GAAG,OAAO,CAC/B,OAAO,CAAC,cAAc,CAAC,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF,oBAAY,SAAS,GAAG,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7D,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC,CAAC;AAEH,oBAAY,cAAc,GACtB,MAAM,GACN,CAAC;IACC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * Utility types
4
- * @module
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -1,218 +0,0 @@
1
- /// <reference types="node" />
2
- import 'type-fest';
3
- import { EventEmitter } from 'node:events';
4
- import { NAME_MKDOCS, NAME_NPM, NAME_PYTHON, NAME_TYPEDOC, NAME_TYPESCRIPT } from '../constants';
5
- import { DocutilsError } from '../error';
6
- import { PipPackage } from '../model';
7
- /**
8
- * The "kinds" of validation which were requested to be performed
9
- */
10
- export declare type ValidationKind = typeof NAME_PYTHON | typeof NAME_TYPESCRIPT | typeof NAME_TYPEDOC | typeof NAME_NPM | typeof NAME_MKDOCS;
11
- /**
12
- * This class is designed to run _all_ validation checks (as requested by the user), and emit events for
13
- * each failure encountered.
14
- *
15
- * Whenever a method _rejects or throws_, this is considered an "unexpected" error, and the validation
16
- * will abort.
17
- *
18
- * @todo Use [`strict-event-emitter-types`](https://npm.im/strict-event-emitter-types)
19
- */
20
- export declare abstract class BaseValidator extends EventEmitter {
21
- protected requirementsTxt: PipPackage[] | undefined;
22
- /**
23
- * Current working directory. Defaults to `process.cwd()`
24
- * @todo This cannot yet be overriden by user
25
- */
26
- protected readonly cwd: string;
27
- /**
28
- * Path to `npm` executable.
29
- */
30
- protected readonly npmPath: string | undefined;
31
- /**
32
- * Path to `python` executable.
33
- */
34
- protected readonly pythonPath: string | undefined;
35
- /**
36
- * List of validations to perform
37
- */
38
- protected readonly _validations: Set<ValidationKind>;
39
- /**
40
- * Mapping of error messages to errors.
41
- *
42
- * Used to prevent duplicate emission of errors and track error count; if non-empty, the validation
43
- * process should be considered to have failed.
44
- *
45
- * Reset after {@linkcode BaseValidator.validate validate} completes.
46
- */
47
- protected emittedErrors: Map<string, DocutilsError>;
48
- /**
49
- * Path to `mkdocs.yml`. If not provided, will be lazily resolved.
50
- */
51
- protected mkDocsYmlPath: string | undefined;
52
- /**
53
- * Path to `package.json`. If not provided, will be lazily resolved.
54
- */
55
- protected packageJsonPath: string | undefined;
56
- /**
57
- * Path to the package directory. If not provided, will be lazily resolved.
58
- */
59
- protected pkgDir: string | undefined;
60
- /**
61
- * Path to `tsconfig.json`. If not provided, will be lazily resolved.
62
- */
63
- protected tsconfigJsonPath: string | undefined;
64
- /**
65
- * Path to `typedoc.json`. If not provided, will be lazily resolved.
66
- */
67
- protected typeDocJsonPath: string | undefined;
68
- /**
69
- * Emitted when validation begins with a list of validation kinds to be performed
70
- * @event
71
- */
72
- static readonly BEGIN = "begin";
73
- /**
74
- * Emitted when validation ends with an error count
75
- * @event
76
- */
77
- static readonly END = "end";
78
- /**
79
- * Emitted when a validation fails, with the associated {@linkcode DocutilsError}
80
- * @event
81
- */
82
- static readonly FAILURE = "fail";
83
- /**
84
- * Emitted when a validation succeeds
85
- * @event
86
- */
87
- static readonly SUCCESS = "ok";
88
- readonly opts: DocutilsValidatorOpts;
89
- /**
90
- * Creates a listener to track errors emitted
91
- */
92
- constructor(opts?: Partial<DocutilsValidatorOpts>);
93
- get errorCount(): number;
94
- /**
95
- * Runs the configured validations, then resets internal state upon completion or rejection.
96
- */
97
- validate(): Promise<void>;
98
- /**
99
- * If a thing like `err` has not already been emitted, emit
100
- * {@linkcode BaseValidator.FAILURE}.
101
- * @param err A validation error
102
- * @returns
103
- */
104
- protected fail(err: DocutilsError | string): void;
105
- /**
106
- * Resolves with a the parent directory of `package.json`, if we can find it.
107
- */
108
- protected findPkgDir(): Promise<string | undefined>;
109
- /**
110
- * Emits a {@linkcode BaseValidator.SUCCESS} event
111
- * @param message Success message
112
- */
113
- protected ok(message: string): void;
114
- /**
115
- * Parses a `requirements.txt` file and returns an array of packages
116
- *
117
- * Caches the result.
118
- * @returns List of package data w/ name and version
119
- */
120
- protected parseRequirementsTxt(): Promise<PipPackage[]>;
121
- /**
122
- * Resets the cache of emitted errors
123
- */
124
- protected reset(): void;
125
- /**
126
- * Validates (sort of) an `mkdocs.yml` config file.
127
- *
128
- * It checks if the file exists, if it can be parsed as YAML, and if it has a `site_name` property.
129
- */
130
- protected validateMkDocsConfig(mkDocsYmlPath?: string): Promise<void>;
131
- /**
132
- * Validates that the version of `npm` matches what's described in this package's `engines` field.
133
- *
134
- * This is required because other validators need `npm exec` to work, which is only available in npm 7+.
135
- */
136
- protected validateNpmVersion(): Promise<void>;
137
- /**
138
- * Asserts that the dependencies as listed in `requirements.txt` are installed.
139
- *
140
- * @privateRemarks This lists all installed packages with `pip` and then compares them to the
141
- * contents of our `requirements.txt`. Versions _must_ match exactly.
142
- */
143
- protected validatePythonDeps(): Promise<void>;
144
- /**
145
- * Asserts that the Python version is 3.x
146
- */
147
- protected validatePythonVersion(): Promise<void>;
148
- /**
149
- * Asserts TypeDoc is installed, runnable, the correct version, and that the config file is readable
150
- * and constaints required options
151
- */
152
- protected validateTypeDoc(): Promise<void>;
153
- /**
154
- * Validates the `typedoc.json` file
155
- */
156
- protected validateTypeDocConfig(): Promise<void>;
157
- /**
158
- * Asserts that TypeScript is installed, runnable, the correct version, and a parseable `tsconfig.json` exists.
159
- */
160
- protected validateTypeScript(): Promise<void>;
161
- /**
162
- * Validates a `tsconfig.json` file
163
- */
164
- protected validateTypeScriptConfig(): Promise<void>;
165
- }
166
- /**
167
- * Options for {@linkcode BaseValidator} constructor
168
- */
169
- export interface DocutilsValidatorOpts {
170
- /**
171
- * Current working directory
172
- */
173
- cwd: string;
174
- /**
175
- * If `true`, run MkDocs validation
176
- */
177
- mkdocs?: boolean;
178
- /**
179
- * Path to `mkdocs.yml`
180
- */
181
- mkdocsYml?: string;
182
- /**
183
- * Path to `npm` executable
184
- */
185
- npm?: string;
186
- /**
187
- * Path to `package.json`
188
- */
189
- packageJson?: string;
190
- /**
191
- * If `true`, run Python validation
192
- */
193
- python?: boolean;
194
- /**
195
- * Path to `python` executable
196
- */
197
- pythonPath?: string;
198
- /**
199
- * Path to `tsconfig.json`
200
- */
201
- tsconfigJson?: string;
202
- /**
203
- * If `true`, run TypeDoc validation
204
- */
205
- typedoc?: boolean;
206
- /**
207
- * Path to `typedoc.json`
208
- */
209
- typedocJson?: string;
210
- /**
211
- * If `true`, run TypeScript validation
212
- */
213
- typescript?: boolean;
214
- }
215
- export interface IDocutilsValidator {
216
- validate(): Promise<void>;
217
- }
218
- //# sourceMappingURL=base-validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-validator.d.ts","sourceRoot":"","sources":["../../../lib/validation/base-validator.ts"],"names":[],"mappings":";AAAA,OAAO,WAAW,CAAC;AAUnB,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAKzC,OAAO,EAKL,WAAW,EAEX,QAAQ,EAGR,WAAW,EAGX,YAAY,EAEZ,eAAe,EAEhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAYvC,OAAO,EAAY,UAAU,EAAc,MAAM,UAAU,CAAC;AAoB5D;;GAEG;AACH,oBAAY,cAAc,GACtB,OAAO,WAAW,GAClB,OAAO,eAAe,GACtB,OAAO,YAAY,GACnB,OAAO,QAAQ,GACf,OAAO,WAAW,CAAC;AAEvB;;;;;;;;GAQG;AACH,8BAAsB,aAAc,SAAQ,YAAY;IACtD,SAAS,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IAEpD;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,sBAA6B;IAE5D;;;;;;;OAOG;IACH,SAAS,CAAC,aAAa,6BAAoC;IAC3D;;OAEG;IACH,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C;;OAEG;IACH,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC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