Skip to content

Fix deployment for v11 #27

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
mgechev opened this issue Nov 10, 2020 · 8 comments
Closed

Fix deployment for v11 #27

mgechev opened this issue Nov 10, 2020 · 8 comments

Comments

@mgechev
Copy link

mgechev commented Nov 10, 2020

Because we removed some experimental APIs (promoted them as public in v11), the deployment builder no longer works.

It should be relatively easy to migrate. Here's an example from AngularFire angular/angularfire#2643.

@dianjuar
Copy link
Member

@mgechev I found a problem here, hope you can lead me with it.

I was following Angular Fire PR that you brought, I see that they use context.getTargetOptions to get the project's outputPath but for a library that property is not being returned.

Do you know if to get the outputPath for a library we need to use another method different than .getTargetOptions?


I think I have a workaround but I feel it's too nasty 🤮, .getTargetOptions returns the path for the file projects/{MY-LIB-NAME}/ng-package.json and that file has the following structure.

{
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../dist/{MY-LIB-NAME}",
  "lib": {
    "entryFile": "src/public-api.ts"
  }
}

I can read that file, and get the dest property to get the outPath that I need. What do you think about this?

@mgechev
Copy link
Author

mgechev commented Nov 15, 2020

Doesn't sound that terrible to me, if you can always resolve the location of the library package configuration.

The only risky thing here would be if ng-packagr changes their configuration file.

@dianjuar
Copy link
Member

@mgechev I'm going to implement the solution that I mentioned to have V11 support ASAP, I think is the only way to go with this.

I wonder if the BuilderContext.getTargetOptions should give me those options or the function is only limited to get information that is on the angular.json and I'm forced to go with the ng-package.json to get more information about the library that I'm building?

@mgechev
Copy link
Author

mgechev commented Nov 16, 2020

You could open an issue in angular-cli and get more feedback there from the CLI team.

@JohannesHoppe
Copy link

JohannesHoppe commented Nov 17, 2020

It also wasn't my best idea to introduce the --configuration param. 😅
I think we want a deprecation of configuration to get out of this situation. I'm right now trying to correct this for angular-cli-ghpages.

See
angular/angularfire#2063 (comment)
angular-schule#1 (comment)

@dianjuar
Copy link
Member

I am having a good family time 😄.
I will work on this over the weekend

@JohannesHoppe
Copy link

I will port back all changes to the starter, soon.

@dianjuar
Copy link
Member

dianjuar commented Dec 8, 2020

Thank you @mgechev for let me know about this problem so early.

The fix is ready under the version [email protected] 🚀

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

No branches or pull requests

3 participants