Replace jsdoc with typedoc

Use TypeDoc instead of JSDoc because it has better support for
documenting TypeScript APIs.
This commit is contained in:
Hornwitser committed 2023-08-03 15:02:31 +02:00
1 parent 3a321b39e1
commit 74e9ed8257
9 files changed
+33 -47

No files matched your search

-25
View File
@@ -1,25 +0,0 @@
{
"plugins": [
"plugins/markdown"
],
"tags": {
"allowUnknownTags": false
},
"opts": {
"destination": "docs/api",
"recurse": true
},
"source": {
"include": [
"packages/controller/src/",
"packages/controller/controller.js",
"packages/host/src/",
"packages/host/host.js",
"packages/ctl/src/",
"packages/ctl/ctl.js",
"packages/lib/",
"plugins/"
],
"excludePattern": "node_modules"
}
}
+3 -3
View File
@@ -9,7 +9,7 @@
"ci-cover": "nyc --reporter=lcovonly pnpm run-script test", "ci-cover": "nyc --reporter=lcovonly pnpm run-script test",
"lint": "eslint \"*.js\" packages plugins test", "lint": "eslint \"*.js\" packages plugins test",
"lint-fix": "eslint --fix \"*.js\" packages plugins test", "lint-fix": "eslint --fix \"*.js\" packages plugins test",
"docs": "jsdoc --configure docs/jsdoc.json", "docs": "typedoc",
"bundle-dependencies": "bundle-dependencies" "bundle-dependencies": "bundle-dependencies"
}, },
"nyc": { "nyc": {
@@ -31,11 +31,11 @@
"express": "^4.18.2", "express": "^4.18.2",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"jsdoc": "^4.0.2",
"jsonwebtoken": "^9.0.1", "jsonwebtoken": "^9.0.1",
"jszip": "^3.10.0", "jszip": "^3.10.0",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"phin": "^3.7.0" "phin": "^3.7.0",
"typedoc": "^0.24.8"
} }
} }
+2 -2
View File
@@ -324,7 +324,7 @@ function readMapSettings(state) {
} }
/** /**
* @typedef {object} module:lib.MapExchangeResult * @typedef {object} MapExchangeResult
* @property {array} version - * @property {array} version -
* Version of Factorio the string was created with. * Version of Factorio the string was created with.
* @property {object} map_gen_settings - * @property {object} map_gen_settings -
@@ -344,7 +344,7 @@ function readMapSettings(state) {
* save to set the map gen settings and the map settings for the save. * save to set the map gen settings and the map settings for the save.
* *
* @param {string} exchangeString - Max Exchange String to parse. * @param {string} exchangeString - Max Exchange String to parse.
* @returns {module:lib.MapExchangeResult} Parsed result. * @returns {MapExchangeResult} Parsed result.
* @memberof module:lib * @memberof module:lib
*/ */
function readMapExchangeString(exchangeString) { function readMapExchangeString(exchangeString) {
+5 -5
View File
@@ -210,18 +210,18 @@ function wordMatches(word, ...texts) {
} }
/** /**
* @typedef {object} module:lib~ParsedTerm * @typedef {object} ParsedTerm
* @property {string} type - Type of term, either attribute or word. * @property {string} type - Type of term, either attribute or word.
* @property {string=} name - attribute only: Name of attribute. * @property {string=} name - attribute only: Name of attribute.
* @property {boolean=} exclude - word only: exclude results with this word. * @property {boolean=} exclude - word only: exclude results with this word.
* @property {string | module:lib.ParsedTerm} value - * @property {string | ParsedTerm} value -
* Parsed value of this term. Is a string if type is word, and a * Parsed value of this term. Is a string if type is word, and a
* ParsedTerm if type is attribute. * ParsedTerm if type is attribute.
*/ */
/** /**
* @typedef {object} module:lib~ParsedSearch * @typedef {object} ParsedSearch
* @property {Array<module:lib~ParsedTerm>} terms - * @property {Array<ParsedTerm>} terms -
* Parsed result of search terms. * Parsed result of search terms.
* @property {Array<string>} issues - * @property {Array<string>} issues -
* Issues detected while parsing the seach string. * Issues detected while parsing the seach string.
@@ -248,7 +248,7 @@ function wordMatches(word, ...texts) {
* @param {Object<string, string>} attributes - * @param {Object<string, string>} attributes -
* Recognized attributes and their format. Currently only word is * Recognized attributes and their format. Currently only word is
* supported. * supported.
* @returns {module:lib~ParsedSearch} parsed terms of the search. * @returns {ParsedSearch} parsed terms of the search.
* @static * @static
*/ */
function parseSearchString(input, attributes = {}) { function parseSearchString(input, attributes = {}) {
+2 -2
View File
@@ -84,7 +84,7 @@ class WebConsoleFormat {
/** /**
* Filter object for logs * Filter object for logs
* @typedef {Object} module:lib~LogFilter * @typedef {Object} LogFilter
* @property {string} [maxLevel] - * @property {string} [maxLevel] -
* Maximum log level to include. Higher levels are more verbose. * Maximum log level to include. Higher levels are more verbose.
* @property {boolean} [all] - * @property {boolean} [all] -
@@ -101,7 +101,7 @@ class WebConsoleFormat {
/** /**
* Create log filter by level and source. * Create log filter by level and source.
* *
* @param {module:lib~LogFilter} filter - * @param {LogFilter} filter -
* Filter to filter log entries by. * Filter to filter log entries by.
* @returns {function(object): boolean} * @returns {function(object): boolean}
* filter returning true for log entries that match it. * filter returning true for log entries that match it.
+3 -3
View File
@@ -275,7 +275,7 @@ class LogIndex {
* *
* @param {string} file - * @param {string} file -
* Name of file in the log directory to check for. * Name of file in the log directory to check for.
* @param {module:lib~LogFilter} filter - * @param {LogFilter} filter -
* Filter to check index if file contains entries for. * Filter to check index if file contains entries for.
* @returns {boolean} * @returns {boolean}
* true if the file may contain entries included by the filter. * true if the file may contain entries included by the filter.
@@ -314,7 +314,7 @@ class LogIndex {
/** /**
* Filter object for querying logs * Filter object for querying logs
* @typedef {Object} module:lib~QueryLogFilter * @typedef {Object} QueryLogFilter
* @property {number} [limit=100] - Maximum number of entries to return. * @property {number} [limit=100] - Maximum number of entries to return.
* @property {string} [order="asc"] - * @property {string} [order="asc"] -
* Return entries in ascending ("asc") date order or desceding ("desc") * Return entries in ascending ("asc") date order or desceding ("desc")
@@ -336,7 +336,7 @@ class LogIndex {
* Query log directory * Query log directory
* *
* @param {string} logDirectory - path to directory with logs. * @param {string} logDirectory - path to directory with logs.
* @param {module:lib~QueryLogFilter} filter - * @param {QueryLogFilter} filter -
* Filter to limit logs by. * Filter to limit logs by.
* @param {module:lib.LogIndex=} index - * @param {module:lib.LogIndex=} index -
* Index to speed up query with. * Index to speed up query with.
+7 -7
View File
@@ -6,13 +6,13 @@
const helpers = require("./helpers"); const helpers = require("./helpers");
/** /* TODO fix when converting to ts
* Conceptual base for controller and instance plugins. * Conceptual base for controller and instance plugins.
* @typedef { * @typedef {
* module:lib.BaseControllerPlugin * BaseControllerPlugin
* |module:lib.BaseInstancePlugin * |BaseInstancePlugin
* |module:lib.BaseControlPlugin * |BaseControlPlugin
* } module:lib.BasePlugin * } BasePlugin
*/ */
/** /**
@@ -612,7 +612,7 @@ class BaseControlPlugin {
/** /**
* Plugin supplied login form * Plugin supplied login form
* @typedef {Object} module:lib~LoginForm * @typedef {Object} LoginForm
* @property {string} name - * @property {string} name -
* Internal name of the login form, this should start with the * Internal name of the login form, this should start with the
* plugin name followed by a dot. * plugin name followed by a dot.
@@ -627,7 +627,7 @@ class BaseControlPlugin {
/** /**
* Plugin supplied pages * Plugin supplied pages
* @typedef {Object} module:lib~Page * @typedef {Object} Page
* @property {string} path - URL path to this page. * @property {string} path - URL path to this page.
* @property {string=} sidebarPath - * @property {string=} sidebarPath -
* If present and this path matches one of the pages in the sidebar it * If present and this path matches one of the pages in the sidebar it
+4
View File
@@ -0,0 +1,4 @@
{
"entryPoints": ["index.ts"],
"includeVersion": true
}
+7
View File
@@ -0,0 +1,7 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["packages/lib/"],
"entryPointStrategy": "packages",
"cleanOutputDir": false,
"out": "docs/api"
}