api-extractor replacement test - #10233
Conversation
|
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
There was a problem hiding this comment.
Code Review
This pull request migrates the project from a custom api-extractor-me package to the official @microsoft/api-extractor package, updating configuration files and build scripts for the messaging package accordingly. It also updates the documentation generator script to support copying multiple API JSON files. Feedback on these changes includes correcting an invalid and temporarily hardcoded package path in the docgen script, as well as renaming a loop variable to avoid shadowing the imported path module.
| // FIXME: hardcoding a single package while developing | ||
| await spawn('yarn', ['--cwd', 'firebase/messaging', 'api-report'], { |
There was a problem hiding this comment.
The hardcoded path 'firebase/messaging' seems to be incorrect as the package is located in 'packages/messaging'. Additionally, hardcoding a single package breaks the documentation generation for all other packages. This temporary change should be reverted before merging.
await spawn('yarn', ['api-report'], {| for (const path of paths) { | ||
| const fileName = path.split('/').pop(); | ||
| fs.copyFileSync(path, `${tmpDir}/${fileName}`); | ||
| } |
There was a problem hiding this comment.
The loop variable path shadows the imported path module (from import * as path from 'path'). Rename the variable to filePath or apiPath to avoid shadowing and potential confusion.
| for (const path of paths) { | |
| const fileName = path.split('/').pop(); | |
| fs.copyFileSync(path, `${tmpDir}/${fileName}`); | |
| } | |
| for (const apiPath of paths) { | |
| const fileName = apiPath.split('/').pop(); | |
| fs.copyFileSync(apiPath, `${tmpDir}/${fileName}`); | |
| } |
No description provided.