Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

fix(@schematics/update): respect caret and tilde ranges - #884

Merged
filipesilva merged 1 commit into
angular:masterfrom
filipesilva:update-ranges
May 10, 2018
Merged

filipesilva merged 1 commit into
angular:masterfrom
filipesilva:update-ranges

Conversation

@filipesilva

Copy link
Copy Markdown
Contributor

@Brocco Brocco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@filipesilva
filipesilva merged commit f61b2be into angular:master May 10, 2018
@filipesilva
filipesilva deleted the update-ranges branch May 10, 2018 14:29
map(tree => {
const packageJson = JSON.parse(tree.readContent('/package.json'));
// This one should not change because 1.1.0 was already satisfied by ^1.0.0.
expect(packageJson['dependencies']['@angular-devkit-tests/update-base']).toBe('^1.0.0');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wouldn't this cause 1.1.0 to not be used due to an existing lock file?

@filipesilva filipesilva May 10, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, that behaviour is intentional:

if (targetVersion && semver.lte(targetVersion, installedVersion)) {
logger.debug(`Package ${name} already satisfied by package.json (${packageJsonRange}).`);
targetVersion = undefined;
}

At this point, the new version is already installed though, and presumably the lockfile is updated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK. Could envision some issue reports in the future regarding the behavior though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants