Closed ke-vbe closed 5 months ago
Passing all arguments via the command line is for testing and passing arguments is NOT published in our documentation. Due to the fact that is very finicky and if not done correctly, will cause problems.
If you want to use them (but we are not supporting issues), the last argument is true (without quotes) as that will allow the fetch to happen.
npm run publishAll Demo 01-01-01 N true
Hello @paulgagnon-pega, thank you for your answer.
Would it be possible to support passing arguments ?
It would allow running commands during automated tasks like CI/CD pipelines...
Regarding the following npm run publishAll Demo 01-01-01 N true
, it doesn't work as the last argument true
is not affecting the variable doFetch
which is preventing Pega API call.
FYI, I'm using the latest version 23.1.11.
HI, I will fix in next release as commands/arguments are only used with testing and we don't want a fetch during then, so they work fine for testing. Though commands/arguments will be there, support are not going to be official, there are too many ways it can fail in that scenario. There is no error checking, etc, because the questions restrict and provide the correct input, and command line bypasses that.
Hello @paulgagnon-pega, thank you for your answer. Would it be possible to support passing arguments ? It would allow running commands during automated tasks like CI/CD pipelines... Regarding the following
npm run publishAll Demo 01-01-01 N true
, it doesn't work as the last argumenttrue
is not affecting the variabledoFetch
which is preventing Pega API call. FYI, I'm using the latest version 23.1.11.For now, you can go into publish-all/index.js on line 20, you can set "doFetch" to true and that should allow you to move forward.
closing the issue - next time, please post issue in Pega community - this question is unrelated to this project - it is not recommended to run promoteWebPack - You can also suggest edit to the documentation https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/advanced-webpack-configuration.html
@ricmars I've posted here as there is no github repo for @pega/custom-dx-components. BTW, on npmjs.com, what are the differences between these 2 packages
https://www.npmjs.com/package/@pega/constellation-dx-components-build-utils is a work in progress and should not be used right now - it is not supported by the platform.
it is not recommended to run promoteWebPack
@ricmars I'd like to discuss this point please. Why is it not recommended ?
Is it because of the following note on the documentation page you linked ?
Note: If you modify the internal webpack.config.js file, you are responsible for troubleshooting any build issues and integrating your changes into new versions of Constellation DX Component Builder
If so, I know I have to troubleshoot issues I might have created by playing with the webpack config.
What I mentioned in my first message is that promoteWebPack command is commenting/uncommenting lines of the file node_modules/@pega/custom-dx-components/src/tasks/bundle/builder/index.js
which is in the folder node_modules and this folder is refreshed each time npm update
or npm install
is ran, reverting changes made by promoteWebPack inside node_modules/@pega/custom-dx-components/src/tasks/bundle/builder/index.js
.
yes this is a known issue - in future release, we will change the way promoteWebPack so that the index.js in the node_modules is not updated.
Hello,
I'm currently facing a few issues with the package https://www.npmjs.com/package/@pega/custom-dx-components which is used in this repository constellation-ui-gallery.
When executing the command
npm run promoteWebPack
, it uncomments a line in node_modules/@pega/custom-dx-components/src/tasks/bundle/builder/index.js to point to the new webpack.config.js file placed in the project's root path. However, when installing or updating an npm package, the whole node_modules directory is refreshed and the changes made by promoteWebPack are lostI tried to pass rulesetName, rulesetVersion and dBuild as arguments to
npm run publishAll
but it didn't work. When having a look at the source code of custom-dx-components, I found the condition causing this issue. In node_modules/@pega/custom-dx-components/src/tasks/publish-all/index.js, at line 79, there is a condition checking ifoptions.params.length >= 7
but there is only a total of 6 params including the 3 I'm manually passing. BTW, there is no reference tooptions.params[6]
in this file, which means checking for a length of 7 is not even accurate. I then tried to pass a 4th argument (counting as the 7th) but I encountered another issue. The whole process started without asking any question but nothing was sent to Pega. FYI, when runningnpm run publishAll
and answering questions, the components are sent to Pega and the message "Success : Component successfully created in ruleset Demo:01-01-01" is displayed. Again, I started searching in the source code and found this in node_modules/@pega/custom-dx-components/src/tasks/publish-all/index.js The boolean variabledoFetch
is then passed as an argument to the functionpublishComponentToServer
which is then calling Pega only ifdoFetch
is true So, if I pass only 3 arguments likenpm run publishAll Demo 01-01-01 N
, then I still have to answer the questions if it's a dev build and what is the ruleset name and version. And if I pass 4 arguments likenpm run publishAll Demo 01-01-01 N dummyText
, then I don't have to answer the previous questions but during the task "Publish Component", nothing is sent to Pega.