Skip to content

Angular 14 support? #148

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

Closed
SamuelMarks opened this issue Jun 3, 2022 · 16 comments · Fixed by #149
Closed

Angular 14 support? #148

SamuelMarks opened this issue Jun 3, 2022 · 16 comments · Fixed by #149
Assignees

Comments

@SamuelMarks
Copy link

There's a new version out!

@JohannesHoppe
Copy link
Member

JohannesHoppe commented Jun 3, 2022

Thanks for the reminder, I will bump the versions. But there should be no breaking changes for us. --force should do the trick until then.

@Mijago
Copy link

Mijago commented Jun 10, 2022

I just wanted to note that with Angular 14 I get:

ng add angular-cli-ghpages
[...]
Package "angular-cli-ghpages" was found but does not support schematics.

@fmalcher
Copy link
Member

@Mijago That's because the Angular CLI automatically detects the latest compatible version – and in this case it cannot find one.
Since a few things have changed with v14, there was a tiny bit more to do. PR is ready: #149

@JohannesHoppe
Copy link
Member

Unfortunately this is blocked by: angular/angular-cli#23397
tl;dr: Arguments like noBuild, noSilent, noDotFiles no longer work

Let's wait for a statement of the Angular Team (if this is a bug/breaking change or if we have to adjust)

@fmalcher fmalcher pinned this issue Jun 18, 2022
@fmalcher
Copy link
Member

As long as we cannot release a proper version for Angular 14, you have two options:

  • Use the standalone version (see README_standalone)
  • Install the package manually: npm i angular-cli-ghpages --force and then add the builder config in angular.json manually, under projects.YOURPROJECT.architect, next to the build config:
"deploy": {
  "builder": "angular-cli-ghpages:deploy"
}

Please note that the documented options noBuild, noSilent and noDotFiles don't work with Angular 14 anymore.

@JohannesHoppe
Copy link
Member

JohannesHoppe commented Jun 21, 2022

A fix has been created (angular/angular-cli#23405) and it should be available in the next minor CLI version.

Users will see the following message:

Warning: '${name}' option has been declared with a 'no' prefix in the schema. Please file an issue with the author of this package.

A) Do we want to rely on the fix (users will see the message) and push a fast version out?
B) Or do we want to refactor all arguments with a big breaking change on our side?

@fmalcher
Copy link
Member

With the goal in mind of making our lib fully usable with ng14, we should go with (A) now, as fast as possible. Then consider a breaking change later.
Another option would be to do (B) now but only deprecate the "no" options instead of removing them. This way, people can still use them but new users can directly jump to the newer options.

@alan-agius4
Copy link
Contributor

alan-agius4 commented Jun 21, 2022

Declaring build and noBuild would probably conflict.

Another option would be do the breaking change and create a ng update migration to replace the new options in angular.json If present.

In case the options are passed through the command line, there are no changes there since boolean options get negated with —-no.

@SamuelMarks
Copy link
Author

It also looks like the default project is being removed and ngh doesn't know how to proceed:

No Angular project selected and no default project in the workspace

…maybe if there's only one non-test project in the workspace you auto-treat that as the default project?

@fmalcher
Copy link
Member

angular-eslint has the same problem with the no negation: angular-eslint/angular-eslint#1069

@JohannesHoppe
Copy link
Member

Some great progress here, the CLI will get the old behavior back and there will be no warning anymore:

Therefore, in order to reduce the community changes we remove the deprecation warning for such options and change the interim solution to permanent one.

angular/angular-cli#23536

@JohannesHoppe
Copy link
Member

All tests are green now. ✅
I just pushed v1.0.1 to NPM! Happy coding! 😄

@SamuelMarks
Copy link
Author

@JohannesHoppe Thanks, but getting errors:
See https://github.com/SamuelMarks/SamuelMarks-www/runs/7521268473

Cannot find module 'node_modules/angular-cli-ghpages/ng-add'
Require stack:
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/src/command-builder/utilities/schematic-engine-host.js
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/src/command-builder/schematics-command-module.js
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/src/commands/add/cli.js
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/src/command-builder/command-runner.js
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/lib/cli/index.js
- /opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/@angular/cli/lib/init.js

After running ng add @ https://github.com/SamuelMarks/SamuelMarks-www/actions/runs/2739862339/workflow#L25

@fmalcher
Copy link
Member

fmalcher commented Jul 26, 2022

@SamuelMarks I can confirm! We're working on it. Sorry for the inconvenience …
#156

@JohannesHoppe
Copy link
Member

@SamuelMarks I blame npm for this! The command line arguments of NPM 8 have been changed! 🙈

It's now fixed, thanks for the fast report!
Please try out v1.0.3

@SamuelMarks
Copy link
Author

Great that worked! - Thanks

@fmalcher fmalcher unpinned this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants