-
Notifications
You must be signed in to change notification settings - Fork 14
Add assertation for bad links and only log latest version of modules #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6f7b8a0
332ce44
580d025
1157980
73debfd
ec18abf
6529b1f
d5f4ca1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "Asserts if linking is missed", | ||
| "packageName": "@minecraft/api-docs-generator", | ||
| "email": "brandon.chan@skyboxlabs.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ import wrap from 'word-wrap'; | |
|
|
||
| import { FileLoader } from '../FileLoader'; | ||
| import * as log from '../Logger'; | ||
| import { getLatestScriptModules, MinecraftRelease } from '../MinecraftRelease'; | ||
| import { getLatestScriptModules, GetLatestScriptModulesOptions, MinecraftRelease } from '../MinecraftRelease'; | ||
| import { | ||
| getAfterEventsOrderingModuleFrom, | ||
| MinecraftAfterEventsOrderByVersion, | ||
|
|
@@ -310,6 +310,13 @@ function linkSymbols( | |
| } | ||
|
|
||
| result.push(str); | ||
|
|
||
| const hasLinksRemaining = str.includes('@link'); | ||
| if (hasLinksRemaining && linkMatches.length > 0) { | ||
| log.error( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to confirm the behavior here, this will do the whole run still right? Ideally if there are multiple issues the error output shows all of them at once so the dev can fix them all.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it continues and the whole run is still done.
|
||
| `Link(s) not found in ${fromModule.name} version ${fromModule.version}. Please check spelling or if the modules or members are defined: ${JSON.stringify(linkMatches)}` | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| return result; | ||
|
|
@@ -1051,7 +1058,9 @@ function addDescriptionsAndExamples(releases: MinecraftRelease[], fileLoader?: F | |
| } | ||
|
|
||
| for (const release of releases) { | ||
| for (const moduleJson of release.script_modules) { | ||
| for (const moduleJson of release.getLatestScriptModulesByMajorVersion( | ||
| GetLatestScriptModulesOptions.StableAndPrerelease | ||
| )) { | ||
| const dependentModules = getLatestDependentScriptModules(release.script_modules, moduleJson); | ||
|
|
||
| addModuleDescriptions(fileLoader, moduleJson, dependentModules); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.