-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Integrate JSDoc output into vitepress #1240
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
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
| }, | ||
| "githubSourceBaseUrl": "https://github.com/UI5/cli/blob/main/pacakges/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "githubSourceBaseUrl": "https://github.com/UI5/cli/blob/main/pacakges/" | |
| "githubSourceBaseUrl": "https://github.com/UI5/cli/blob/main/packages/" |
| @@ -1,4 +1,4 @@ | |||
| (function(window) { | |||
| nbpm(function(window) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
CONTRIBUTING.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
d3xter666
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And one general comment:
We shall not modify the content within packages/ folder, nor delete anything from there. That will impact the UI5 CLI functionality, tests and docs
| if (process.argv[2] == "gh-pages") { | ||
| // Read package.json of packages/builder | ||
| const builderJson = JSON.parse(fs.readFileSync("tmp/packages/@ui5/builder/package.json")); | ||
| packageTagName = `https://github.com/UI5/cli/blob/cli-v${builderJson["version"]}/packages/`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is invalid, because the previous versions of UI5 CLI are not within a monorepo, but separate packages and they have separate repositories. There is no packages folder, except for the main branch
| for (const file of fs.readdirSync(outputDirectory)) { | ||
| fs.rmSync(path.join(outputDirectory, file)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the rimraf package and clean the whole dir
| } | ||
|
|
||
| async function checkDeadlinks(link, sourcePath) { | ||
| if ((await fetch(link)).status != 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be within the 4xx range. Please take a look here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status
| @@ -0,0 +1,92 @@ | |||
| ## Modified by SAP | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this package copied here, but not used as dependency to the documentation?
| * <pre> | ||
| * this["name"] = name; | ||
| * </pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how our current JSDoc works. Can we handle this in the transofrmation?
I know that if we leave it like that here, the vitepress build might fail
075a37e to
426458e
Compare
|
There are still some dead links. You can find them by searching for Please continue to create new commits, as that makes reviewing changes easier. We can squash all commits again after all open points have been addressed. |
3ab8984 to
453fa3e
Compare
|
|
||
| // Recursively handle the inner type | ||
| if (isComplexTypeExpression(innerType)) { | ||
| result += linkComplexType(innerType, null, classString.replace(' class="', '').replace('"', '')); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High documentation
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 hours ago
In general, to fix incomplete string escaping/encoding when using replace, we should either (a) use a global regular expression to handle all occurrences, or (b) avoid pattern-based stripping and instead build the desired string from known safe parts. In this code, classString is something like class="SomeClass". The function wants to pass just the class name(s) (without the surrounding class=" and trailing ") into nested calls, so it currently does:
classString.replace(' class="', '').replace('"', '')This only removes the first " it encounters, which may leave additional quotes if classString is unexpected or contains multiple quotes. The minimal change that preserves intent is to (1) safely remove the initial class=" prefix if present, and then (2) remove all remaining double quotes using a global regex. That yields a clean class-name string to pass into the recursive call.
Concretely, in internal/documentation/jsdoc/docdash/publish.js, update line 673 inside linkGenericType so that instead of chaining .replace(' class="', '').replace('"', ''), it first strips the class=" prefix (if it exists) and then uses .replace(/"/g, '') to remove any remaining double quotes. No new imports are needed; we rely only on built-in JavaScript regex support.
-
Copy modified lines R673-R674
| @@ -670,7 +670,8 @@ | ||
|
|
||
| // Recursively handle the inner type | ||
| if (isComplexTypeExpression(innerType)) { | ||
| result += linkComplexType(innerType, null, classString.replace(' class="', '').replace('"', '')); | ||
| const innerClassString = classString.replace(' class="', '').replace(/"/g, ''); | ||
| result += linkComplexType(innerType, null, innerClassString); | ||
| } else { | ||
| let innerUrl = helper.longnameToUrl[innerType]; | ||
| if (innerUrl) { |
f856fae to
2ee1b26
Compare
8fde59f to
64b5efc
Compare
This commit adds a copy of original files from docdash 2.0.2 [1]. [1] https://github.com/clenemt/docdash/tree/bee5d0789068be6a1e01ce02968b23dd021b4fb6
This had the risk of potentially destroying an external link that pointed to an .md file with a line number
64b5efc to
c29381a
Compare
JIRA: CPOUI5FOUNDATION-904