同步更改:抑制注释中文档引用识别错误;更新依赖
Some checks are pending
Deploy / deploy (push) Waiting to run

This commit is contained in:
ProjectXero 2024-10-08 13:00:58 +08:00
commit cbf16271ac
No known key found for this signature in database
GPG Key ID: 5B1AA72F4425593E
7 changed files with 566 additions and 1638 deletions

2131
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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"
}
}

View File

@ -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);

View 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);
}
});
}
};

View File

@ -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.
*

View File

@ -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.
*

View File

@ -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}
*