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(core): add missing migration to npm package #29705

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
6 participants
@filipesilva
Copy link
Member

commented Apr 4, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

While running ng update @angular/core --next, the following error would be displayed:

Cannot find module '....\node_modules\@angular\core\schematics\migrations\template-var-assignment\index'

This happened because the Schematics migration was referenced, but not included.

What is the new behavior?

This commit fixes that bug by including the migration in the Bazel npm package dependencies.

Does this PR introduce a breaking change?

  • Yes
  • No

@filipesilva filipesilva requested a review from angular/fw-core as a code owner Apr 4, 2019

@googlebot googlebot added the cla: yes label Apr 4, 2019

fix(core): add missing migration to npm package
While running `ng update @angular/core --next`, the following error would be displayed:

```
Cannot find module '....\node_modules\@angular\core\schematics\migrations\template-var-assignment\index'
```

This happened because the Schematics migration was referenced, but not included.

This commit fixes that bug by including the migration in the Bazel npm package dependencies.

@filipesilva filipesilva force-pushed the filipesilva:missing-migration branch from 70d407f to 3aa435d Apr 4, 2019

@mary-poppins

This comment has been minimized.

Copy link

commented Apr 4, 2019

@mary-poppins

This comment has been minimized.

Copy link

commented Apr 4, 2019

@devversion

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

How does the schematic actually run right now? We were talking about enabling it for beta/rc, but I was under the impression that it doesn't run right now because the migration targets v8.0.0 and not any beta/rc?

@devversion
Copy link
Member

left a comment

Also LGTM for adding this to the ng_package anyway.

@filipesilva

This comment has been minimized.

Copy link
Member Author

commented Apr 4, 2019

@devversion I was updating angular/angular-cli#14079 to actually try to update to the next angular versions via ng update @angular/core --next and saw the failure.

It runs because it's listed in the core migrations:

"migration-v8-template-local-variables": {
"version": "8",
"description": "Warns developers if values are assigned to template variables",
"factory": "./migrations/template-var-assignment/index"
}

IIRC as long as this package is updated to and the version matches, the migrations will run. @clydin might know more about the specifics.

@devversion

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

@filipesilva Yeah it's clear that these are part of the migrations.json. My understanding was just that they don't run until V8 stable since the Semver criteria here is not satisfied with the migrations targeting 8.0.0. Maybe the update --to option is somehow set by the CLI to 8.0.0 instead of the appropriate beta? e.g.

@alexeagle

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

Even though we don't run the migration, we still require() it so that's why we need this fix

@kara

kara approved these changes Apr 4, 2019

Copy link
Contributor

left a comment

LGTM

@kara kara added the comp: ivy label Apr 4, 2019

@ngbot ngbot bot added this to the needsTriage milestone Apr 4, 2019

@jasonaden jasonaden closed this in 96b76dc Apr 4, 2019

@filipesilva filipesilva deleted the filipesilva:missing-migration branch Apr 8, 2019

DeveloperFromUkraine added a commit to DeveloperFromUkraine/angular that referenced this pull request Apr 11, 2019

fix(core): add missing migration to npm package (angular#29705)
While running `ng update @angular/core --next`, the following error would be displayed:

```
Cannot find module '....\node_modules\@angular\core\schematics\migrations\template-var-assignment\index'
```

This happened because the Schematics migration was referenced, but not included.

This commit fixes that bug by including the migration in the Bazel npm package dependencies.

PR Close angular#29705

wKoza added a commit to wKoza/angular that referenced this pull request Apr 17, 2019

fix(core): add missing migration to npm package (angular#29705)
While running `ng update @angular/core --next`, the following error would be displayed:

```
Cannot find module '....\node_modules\@angular\core\schematics\migrations\template-var-assignment\index'
```

This happened because the Schematics migration was referenced, but not included.

This commit fixes that bug by including the migration in the Bazel npm package dependencies.

PR Close angular#29705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.