Skip to content

Commit

Permalink
fix(@angular/cli): keep relative migration paths during update analysis
Browse files Browse the repository at this point in the history
The original update analysis would prepend the package name to all migration collection files. This was required at the time to ensure the migration collection files would be found. The existing update logic, however, no longer requires this change but the change previously had no negative effects as both the relative and module specifier methods would successfully resolve the migrations. But with the conversion to ESM-based packages that use the package.json `exports` field, deep imports into a package are no longer possible unless the migration collection files are explicitly exported. Relative migration collection paths are now preferred since they are based off of the location of the package's `package.json` and do not require additional `exports` field entries. The original update analysis logic, unfortunately, prevent the relative paths from working as intended. Since this original logic is no longer required by the update process, it has been removed allowing the relative paths to be kept and used directly.
  • Loading branch information
clydin authored and filipesilva committed Oct 5, 2021
1 parent ccb5f3f commit e1b954d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/angular/cli/src/commands/update/schematic/index.ts
Expand Up @@ -325,13 +325,9 @@ function _performUpdate(
return;
}

const collection =
(target.updateMetadata.migrations.match(/^[./]/) ? name + '/' : '') +
target.updateMetadata.migrations;

externalMigrations.push({
package: name,
collection,
collection: target.updateMetadata.migrations,
from: installed.version,
to: target.version,
});
Expand Down

0 comments on commit e1b954d

Please sign in to comment.