How to update core packages


#1

If there is a new feature or bug fix in a core package it is usually months before it gets released with a new version of Atom. But there is a way to install the latest core packages with a little bit of work.

DISCLAIMER: Rarely there will be an update to a core package that requires an updated version of Atom.

  1. Fork the core package on GitHub
  2. Change the name property in package.json (I usually just append -temp to the name)
  3. Disable the core package in Atom
  4. Install the forked package with it’s GitHub url

Once Atom is updated with the new core package:

  1. Uninstall the forked package
  2. Enable the core package

This method will provide a temporary fix until a new version of Atom is released with the updated core package. Remember to uninstall the temporary package when Atom is updated.

You can also merge any new changes from upstream and Atom will alert you that there is an update to the forked package.

I wish Atom would make an easier way to update core packages that don’t require updates to Atom. I’m pretty sure Internet Explorer has taught a lesson on why it is not a good idea to keep fast updating packages included with slow updating software.


#2

I have created a few git aliases to help with keeping core packages up to date.

#.gitconfig
[alias]
  up = !"f() {\
           if [ $# -lt 1 ];\
             then remote=upstream;\
             else remote=$1;\
           fi;\
					 git fetch $remote &&\
           git rebase $remote/master;\
         }; f"

  upf = !"f() {\
            git up $1 &&\
            git push -f;\
          }; f"

  atom = !"git apm"
  apm = !"git upf upstream &&\
          npm i &&\
          apm i &&\
          git reset --hard"

Put the above script in your .gitconfig file then run git atom or git apm in the package folder

This script will:

  1. Rebase your fork with the latest changes
  2. Install any new dependencies
  3. Rebuild any dependencies for your version of Atom
  4. Reset the local repo so there are no errors next time