mirror of
https://github.com/XeroAlpha/sapi-typedoc.git
synced 2024-11-22 17:48:50 +00:00
This commit is contained in:
commit
cbf16271ac
2131
package-lock.json
generated
2131
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -9,16 +9,16 @@
|
||||
"lint-script": "eslint --fix script"
|
||||
},
|
||||
"dependencies": {
|
||||
"ts-morph": "^23.0.0",
|
||||
"typedoc": "^0.26.7",
|
||||
"typedoc-plugin-mdn-links": "^3.2.12",
|
||||
"ts-morph": "^24.0.0",
|
||||
"typedoc": "^0.26.8",
|
||||
"typedoc-plugin-mdn-links": "^3.3.2",
|
||||
"typescript": "^5.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.7.4",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"prettier": "^3.0.3"
|
||||
"@types/node": "^22.7.5",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"prettier": "^3.3.3"
|
||||
}
|
||||
}
|
||||
|
@ -198,6 +198,14 @@ async function build(translated) {
|
||||
},
|
||||
[new TypeDoc.TSConfigReader()]
|
||||
);
|
||||
tsdocApplication.internationalization.addTranslations(
|
||||
'zh',
|
||||
{
|
||||
tag_rc: '预览版',
|
||||
tag_beta: '实验性'
|
||||
},
|
||||
true
|
||||
);
|
||||
rmSync(distPath, { recursive: true, force: true });
|
||||
Object.assign(hookEventContext, { tsdocApplication });
|
||||
await runHooks('beforeConvert', hookEventContext);
|
||||
|
37
script/hooks/1.supress-doc-link-error.js
Normal file
37
script/hooks/1.supress-doc-link-error.js
Normal file
@ -0,0 +1,37 @@
|
||||
/** @type {import('./hook').Hook} */
|
||||
module.exports = {
|
||||
afterLoad({ project }) {
|
||||
const gtSource = project.getSourceFileOrThrow('server-gametest.d.ts');
|
||||
const registerFunc = gtSource.getFunctionOrThrow('register');
|
||||
const registerJsdocs = registerFunc.getJsDocs();
|
||||
const registerRemarkTags = registerJsdocs
|
||||
.flatMap((jsdoc) => jsdoc.getTags())
|
||||
.filter((t) => t.getTagName() === 'remarks');
|
||||
registerRemarkTags.forEach((t) => {
|
||||
const structure = t.getStructure();
|
||||
if (typeof structure.text === 'string') {
|
||||
structure.text = structure.text.replace(
|
||||
'/gametest run\n[testClassName]:[testName]',
|
||||
'`/gametest run\n[testClassName]:[testName]`'
|
||||
);
|
||||
t.set(structure);
|
||||
}
|
||||
});
|
||||
|
||||
const registerAsyncFunc = gtSource.getFunctionOrThrow('registerAsync');
|
||||
const registerAsyncJsdocs = registerAsyncFunc.getJsDocs();
|
||||
const registerAsyncRemarkTags = registerAsyncJsdocs
|
||||
.flatMap((jsdoc) => jsdoc.getTags())
|
||||
.filter((t) => t.getTagName() === 'remarks');
|
||||
registerAsyncRemarkTags.forEach((t) => {
|
||||
const structure = t.getStructure();
|
||||
if (typeof structure.text === 'string') {
|
||||
structure.text = structure.text.replace(
|
||||
'/gametest run [testClassName]:[testName]',
|
||||
'`/gametest run [testClassName]:[testName]`'
|
||||
);
|
||||
t.set(structure);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
@ -3,8 +3,8 @@
|
||||
/**
|
||||
* @remarks
|
||||
* Registers a new GameTest function. This GameTest will become
|
||||
* available in Minecraft via /gametest run
|
||||
* [testClassName]:[testName].
|
||||
* available in Minecraft via `/gametest run
|
||||
* [testClassName]:[testName]`.
|
||||
*
|
||||
* This function can't be called in read-only mode.
|
||||
*
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @remarks
|
||||
* Registers a new GameTest function that is designed for
|
||||
* asynchronous execution. This GameTest will become available
|
||||
* in Minecraft via /gametest run [testClassName]:[testName].
|
||||
* in Minecraft via `/gametest run [testClassName]:[testName]`.
|
||||
*
|
||||
* This function can't be called in read-only mode.
|
||||
*
|
||||
|
6
translated/server-gametest.d.ts
vendored
6
translated/server-gametest.d.ts
vendored
@ -2128,8 +2128,8 @@ export class GameTestError extends Error {
|
||||
/**
|
||||
* @remarks
|
||||
* Registers a new GameTest function. This GameTest will become
|
||||
* available in Minecraft via /gametest run
|
||||
* [testClassName]:[testName].
|
||||
* available in Minecraft via `/gametest run
|
||||
* [testClassName]:[testName]`.
|
||||
*
|
||||
* 无法在只读模式下调用此函数,详见 {@link WorldBeforeEvents}。
|
||||
*
|
||||
@ -2154,7 +2154,7 @@ export function register(
|
||||
* @remarks
|
||||
* Registers a new GameTest function that is designed for
|
||||
* asynchronous execution. This GameTest will become available
|
||||
* in Minecraft via /gametest run [testClassName]:[testName].
|
||||
* in Minecraft via `/gametest run [testClassName]:[testName]`.
|
||||
*
|
||||
* 无法在只读模式下调用此函数,详见 {@link WorldBeforeEvents}。
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user