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

fix: for angular v17, detect publish directory from angular.json #5373

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Nov 8, 2023

With Angular v17, the publish directory changes based on contents of angular.json. It's hard to know this from build-info, but thankfully the build plugin deals with all of that! This PR updates the publish directory to "", which gives precedence to the value that's defined by the build plugin.

@Skn0tt Skn0tt requested review from a team as code owners November 8, 2023 16:39
@Skn0tt Skn0tt self-assigned this Nov 8, 2023
@Skn0tt
Copy link
Contributor Author

Skn0tt commented Nov 8, 2023

Ooops, looked at the problem the wrong way. This will never work. Sad!

@Skn0tt Skn0tt marked this pull request as draft November 8, 2023 16:40
@Skn0tt Skn0tt marked this pull request as ready for review November 8, 2023 17:28
@Skn0tt
Copy link
Contributor Author

Skn0tt commented Nov 8, 2023

a322cfe contains an alternative fix!

@Skn0tt Skn0tt changed the title fix: for angular v17, defer publish directory to plugin fix: for angular v17, detect publish directory from angular.json Nov 8, 2023
const angularJson = await this.project.fs.gracefullyReadFile('angular.json')
if (angularJson) {
const { projects, defaultProject } = JSON.parse(angularJson)
const project = projects[defaultProject ?? Object.keys(projects)[0]]
Copy link

Choose a reason for hiding this comment

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

I guess this might go slightly wrong if there's more than one project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally! Maybe we should add a warning in case there's multiple projects.

@Skn0tt Skn0tt merged commit 5cf6370 into main Nov 9, 2023
35 checks passed
@Skn0tt Skn0tt deleted the fix-ng-17-defer-publish branch November 9, 2023 09:20
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

Successfully merging this pull request may close these issues.

3 participants