Skip to content
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

feat: add support for Angular v11 #118

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

beeman
Copy link
Contributor

@beeman beeman commented Nov 12, 2020

With the release of Angular 11, the experimental API to access the workspace has become stable.

This package depends on the experimental API and breaks.

This PR is a work-in-progress that updates the latest packages, and fixes ng-add.ts. I did not get to deploy/builder.ts as it does not seem to be a trivial change.

I hope to pick it up later this week. If someone else wants to take a shot: here's a start.

As a reference, this and this will be useful.

deploy/builder.ts:22:42 - error TS2339: Property 'workspace' does not exist on type 'typeof import("~/oss/angular-cli-ghpages/src/node_modules/@angular-devkit/core/src/experimental")'.

22       const workspace = new experimental.workspace.Workspace(
                                            ~~~~~~~~~

ng-add.ts:10:44 - error TS2694: Namespace '"~/oss/angular-cli-ghpages/src/node_modules/@angular-devkit/core/src/experimental"' has no exported member 'workspace'.

10 ): { path: string; workspace: experimental.workspace.WorkspaceSchema } {
                                              ~~~~~~~~~

ng-add.ts:20:31 - error TS2694: Namespace '"~/oss/angular-cli-ghpages/src/node_modules/@angular-devkit/core/src/experimental"' has no exported member 'workspace'.

20   let workspace: experimental.workspace.WorkspaceSchema;
                                 ~~~~~~~~~

ng-add.ts:25:30 - error TS2694: Namespace '"~/oss/angular-cli-ghpages/src/node_modules/@angular-devkit/core/src/experimental"' has no exported member 'workspace'.

25     ) as {}) as experimental.workspace.WorkspaceSchema;
                                ~~~~~~~~~

@JohannesHoppe
Copy link
Member

👍

@JohannesHoppe
Copy link
Member

Thank you very much. Your help is very much appreciated.

@Clashsoft
Copy link

Any estimate on when this will be released? I'd be happy with a v0.7.0-alpha or -beta, too :)

@beeman
Copy link
Contributor Author

beeman commented Nov 13, 2020

@Clashsoft I hope to find some time tonight to look at it, I can't guarantee it though.

@JohannesHoppe
Copy link
Member

@Clashsoft If this is blocker for you, you want to look at the standalone CLI version of angular-cli-ghpages. This version works without any dependencies to Angular:

https://www.github.com/angular-schule/angular-cli-ghpages/tree/master/docs%2FREADME_standalone.md

@beeman beeman marked this pull request as ready for review November 14, 2020 05:59
@beeman
Copy link
Contributor Author

beeman commented Nov 14, 2020

@JohannesHoppe I just made some updates, influenced by the @angular/fire example and from a quick local test it seems to work.

However, I'm not sure if I removed any existing use cases or added regressions. Could you take a look at it?

@JohannesHoppe
Copy link
Member

@beeman I really appreciate your immediate help. I will hurry up to merge this and to test it intensively. But it's Saturday (familyday), so I can only start in the evening! 😉

@JohannesHoppe
Copy link
Member

@beeman I just did a quick look. Some minor formating were changed. Did you run prettier?

https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_contributors.md#usage-of-prettier-formatter

@beeman beeman force-pushed the beeman/angular-11 branch 2 times, most recently from ca1977d to 3f8c3d8 Compare November 14, 2020 06:28
@beeman
Copy link
Contributor Author

beeman commented Nov 14, 2020

@beeman I really appreciate your immediate help. I will hurry up to merge this and to test it intensively. But it's Saturday (familyday), so I can only start in the evening! 😉

I totally agree, family time is always a priority!

@beeman I just did a quick look. Some minor formating were changed. Did you run prettier?

https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_contributors.md#usage-of-prettier-formatter

It looks like prettier is running on pre-commit.

image

Not sure why it keeps on adding the trailing commas. When I edit the files on save they're not there, but after the commit they are 🤔

@JohannesHoppe
Copy link
Member

Yeah, prettier has some strange opinions. 😇 But it's still very useful to keep a consistent code-style. I will just run it again, to be sure.

"husky": "^4.3.0",
"jest": "^26.6.3",
"json-schema-to-typescript": "^9.1.1",
"prettier": "2.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the explanation! There must have been changes in the rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah Yeah. That might be related!

@Clashsoft
Copy link

@Clashsoft If this is blocker for you, you want to look at the standalone CLI version of angular-cli-ghpages. This version works without any dependencies to Angular:

https://www.github.com/angular-schule/angular-cli-ghpages/tree/master/docs%2FREADME_standalone.md

@JohannesHoppe thanks for the hint, the standalone version worked without problems!

@splincode
Copy link

@beeman @JohannesHoppe any news, when it will be released?

@JohannesHoppe
Copy link
Member

@splincode Definitely at the beginning of the week. Please use the standalone CLI in the meanwhile.

splincode added a commit to Angular-RU/angular-ru-sdk that referenced this pull request Nov 16, 2020
splincode added a commit to Angular-RU/angular-ru-sdk that referenced this pull request Nov 16, 2020
@VinnyPutty
Copy link

Will this fix be dependent on anything likely to be changed in the near future? An experimental API, etc.? I am trying to decide whether I should switch to the standalone version and stick with it, or wait until the release with this fix.

@fmalcher
Copy link
Member

Will this fix be dependent on anything likely to be changed in the near future? An experimental API, etc.? I am trying to decide whether I should switch to the standalone version and stick with it, or wait until the release with this fix.

@VinnyPutty The experimental Builders API has moved to stable with Angular 11. Thus we should be able to use it without breaking changes for the next years, so my recommendation would be:

  • use the standalone version until this fix is released
  • use the new version of this builder once it's released

@VinnyPutty
Copy link

@fmalcher Thank you. I'll do just that.

@JohannesHoppe JohannesHoppe merged commit 61ded87 into angular-schule:master Nov 17, 2020
@beeman beeman deleted the beeman/angular-11 branch November 17, 2020 22:29
? workspace.root
: asWindowsPath(workspace.root);
const buildTarget = {
name: `${context.target.project}:build:production`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will extend this to

const buildTarget = { name: options.buildTarget || `${context.target.project}:build:production` };

as seen here: angular/angularfire@7e1918a#diff-77ce940ab1bf28b9fd490f028b74d4a439968ace1f095f72216d64f51bed7c59R25

@JohannesHoppe
Copy link
Member

JohannesHoppe commented Nov 18, 2020

Hello friends. We have a some small challenges here. However, we are working on a solution but it will take a few more days. Please use the standalone CLI until we have a working version.

see #120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants