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

Improve compiler options migration error reporting #18467

Merged

Conversation

clydin
Copy link
Member

@clydin clydin commented Aug 6, 2020

This change provides more fine-grained warnings during the update-module-and-target-compiler-options migration for V10.0 in the event a TypeScript configuration file could not be updated. This can help prevent update issues where, for instance, a tsconfig path was misspelled prior to the update. The JSONFile utility class was also augmented to directly throw when creating to ensure that the content property is always initialized.

…porting

This change provides more fine-grained warnings during the `update-module-and-target-compiler-options` migration for V10.0 in the event a TypeScript configuration file could not be updated.  The `JSONFile` utility class was also augmented to directly throw when created to ensure that the `content` property is always initialized.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Aug 6, 2020
@clydin clydin force-pushed the improve-tsconfig-migration-errors branch from 8f8ceef to 0c59b90 Compare August 6, 2020 20:50
@clydin clydin requested a review from alan-agius4 August 7, 2020 11:43
@@ -26,7 +25,7 @@ export class JSONFile {
if (buffer) {
this.content = buffer.toString();
} else {
this.error = new Error(`Could not read ${path}.`);
throw new Error(`Could not read '${path}'.`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Much better. :)

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Aug 7, 2020
@alan-agius4
Copy link
Collaborator

Changed to target to master only as the JSONFile implementation doesn't exist in the patch branch.

@filipesilva filipesilva merged commit 196b3b9 into angular:master Aug 10, 2020
@clydin clydin deleted the improve-tsconfig-migration-errors branch August 10, 2020 10:57
@ChaitanyaBabar
Copy link

ChaitanyaBabar commented Aug 13, 2020

Hi @filipesilva , @clydin

Thanks for the above changes in update-module-and-target-compiler-options.ts.

Actually my angular migration from 9 to 10 halted as due to error on in switch case for Builders.NgPackagr in file update-module-and-target-compiler-options.ts.

Can you please let me know when would be the master branch containing these above changes done here
would be published in npm registry, because as of now the above changes are not present in @angular/cli version 10.0.5 in npm registry.

Thanks,
Chaitanya

@alan-agius4
Copy link
Collaborator

Hi @ChaitanyaBabar, this will available in 10.1.0, which will be released as stable some time around end of this month.

You can already try this by running ng update @angular/cli --next.

@ChaitanyaBabar
Copy link

@alan-agius4

Thanks for the update.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants