Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Get stricter about engine #169

Closed

Description

@kevinsawicki

The engines field in the package.json is supported by things like apm upgrade but not by apm install.

apm install currently always installs the latest version not matter what.

apm install changes

  • Install latest compatible version instead of latest version.
  • Require a flag when installing an incompatible version.

Activity

  1. DavidLGoldberg commented on Aug 30, 2014

    @DavidLGoldberg

    @kevinsawicki, I think I have a related issue. Am I correct in concluding that apm upgrade doesn't always upgrade (sounds like it just making sure)? This issue is to add a flag that forces to newest versions? I think part of the issue involved here is not knowing that there are not installed newer versions. What do you think?

  2. kevinsawicki commented on Sep 2, 2014

    @kevinsawicki
    ContributorAuthor

    @DavidLGoldberg apm upgrade should only upgrade when there is a new release available that is compatible with the currently installed version of Atom. This is done by checking the engines field currently,

    apm/src/upgrade.coffee

    Lines 84 to 95 in 3291536

    for version, metadata of body.versions ? {}
    continue unless semver.valid(version)
    continue unless metadata
    engine = metadata.engines?.atom ? '*'
    continue unless semver.validRange(engine)
    continue unless semver.satisfies(atomVersion, engine)
    latestVersion = version if semver.gt(version, latestVersion)
    if latestVersion isnt pack.version and @repositoriesMatch(pack, body)
    callback(null, {pack, latestVersion})

    A force flag could definitely be added but I would assume package breakage if the engine wasn't compatible with the currently installed version of Atom.

    Do you have an example of an upgrade you aren't seeing presented that you think should be?

  3. DavidLGoldberg commented on Sep 2, 2014

    @DavidLGoldberg

    @kevinsawicki
    If you scroll down a few posts in this thread, you'll see the related issue.

    atom-minimap/minimap-find-and-replace#1

    I've seen this earlier with another package 'neon-cursor' but never to either of the packages I myself have published. Hard for me to say how often it occurs on other packages I have installed, as I don't track them as rigorously of course. Any thoughts on reporting tracking on the versions / install / upgrade adoption etc? Disabled package tracking would also be really useful. (I know a bunch of this has of course already been discussed :) )

  4. kevinsawicki commented on Sep 25, 2014

    @kevinsawicki
    ContributorAuthor

    @DavidLGoldberg I looked into that issue, currently apm upgrade only shows upgrades for packages where the installed repository matches the current repository. This is for security reasons to ensure you trust the new publisher of the package, perhaps some message needs to be displayed though to make this obvious.

    This was updated here for that package: atom-minimap/minimap-find-and-replace@7543b19 so pre-1.0.2 versions would not show upgrades.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions