angular-cli-ghpages
angular-cli-ghpages copied to clipboard
Deploy command fails in an Nx repo
Reproduction steps:
- Create an Nx repo
-
npm i angular-cli-ghpages -D && npx nx g angular-cli-ghpages:ng-add
-
npx nx deploy
Error: Property 'cname' does not match the schema. 'false' should be a 'string'.
Repo: https://github.com/batbrain9392/ng-media-utils/tree/setup-gh-pages
Solved it by adding cname
flag manually as github.com
along with base-href
.
However, npx nx deploy
didn't work in Github Actions. I suppose I'll have to use a dedicated action like GitHub Pages action.
I'm sure that a couple of changes are necessary so that angular-cli-ghpages could also run in a nx workspace. Help would be highly appreciated!
I'm going to track the wrong default value for cname
in a separate issue: https://github.com/angular-schule/angular-cli-ghpages/issues/154
In my experience, making a schematic run in an Nx Workspace is tricky and hacky. You have constantly made changes (maintenance) to have it running without problems.
On the other hand, it is considerably a lot simpler to run an Nx Plugin in an Angular Workspace.
What I would suggest to solve this problem is to migrate the project to a NxPlugin. It will be THE refactor, but I believe it is a good thing if we consider the long term.
I made that jump on ngx-deploy-npm, and it has paid off. The DX (Development Experience) is at sky levels of satisfaction. Also, allowing the project to not only cover Angular projects but the opportunity to support a lot more technologies is encouraging.
Your PR:
So many great plans, so little time in life!
Some files are autogenerated, but it's still a long path.
Here is another project that migrated to be an Nx Plugin with 321 files https://github.com/ngworker/lumberjack/pull/136
The most satisfying thing is the ability to reach other technologies with almost no changes. ngx-deploy-npm
went from supporting only Angular libraries to supporting a broader set of technologies.
https://github.com/bikecoders/ngx-deploy-npm#supported-library-generators
angular-cli-ghpages
could deploy React Apps and Next Apps. I guess the change would be so significant that the name needs to change too 🤣🤣🤣🤣