-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Angular: Fix runCompodoc for Windows, local Compodoc, and user specified tsconfig #16728
Angular: Fix runCompodoc for Windows, local Compodoc, and user specified tsconfig #16728
Conversation
☁️ Nx Cloud ReportCI ran the following commands for commit 14718f3. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@storybookjs/angular Could one of y'all take a look at this, please? |
I will see for test on mac ;) |
I switched the implementation to set |
This same error happens on Stackblitz WebContainers, but I haven't tried this fix on there yet. I may be able to use a local Verdaccio repository with this branch published or maybe a script to patch the file in node_modules. I can try to test it on there later. |
@Marklb can you please update from |
Fixed tests. Also, checked that it fixed builders running Compodoc in a StackBlitz WebContainer. I assume those containers are totally sandboxed to where they would not be inheriting this behavior from the OS, but I am not positive. |
Anyone able to take a look at this? On Windows and Stackblitz, at least, I have to disable Compodoc being run by the builder and add the script back to run it before the builder. Should I force push a commit that doesn't have the |
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.
LGTM! Thanks @Marklb 🙏
Hi all, I came across this issue as well today and yesterday,
Ill note I tried running the project in several Pc's and only some had this issue. I would appreciate any help on solving this. **Edit seems Powershell is restricted on the PC having issues. Apologies. P.s. Edit: I tried to manually tweak the code but this failed,I lack the knowledge to make this work right |
Angular: Fix runCompodoc for Windows, local Compodoc, and user specified tsconfig
@shilman is there a builder out there that runs compodoc as a part of the storybook build? Any docs on this? |
What I did
I got an error when the builder tried to call compodoc with
spawn
on Windows. In other apps I have fixed spawning child processes on Windows, by specifying the shell, and that seemed to fix my issue here also.Based on the docs https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options, I should be able to just pass
true
, instead of a specific shell. So, I will do some testing with that tonight and maybe be able to remove the OS check.I don't install compodoc globally, and wouldn't expect the global version to be used over the local version, so I set the
cwd
of the spawned shell to the workspace root and spawnednpx
instead ofcompodoc
.I have run into situations where a compodoc bug caused it to fail when parsing a file that wasn't even necessary for my stories. So, I started using a separate tsconfig to exclude those files. So, I added a check for "-p" in "compodocArgs" and only add the tsconfig from the angular build config if "-p" isn't provided.
How to test