< Back
Nov 25, 2017

On publishing a package to Atom

Taken basically verbatim from Atom’s own publishing docs, and put here more for my easy reference so I don’t have to go dig those docs up every time:

  1. Make sure your package.json file has name, description, and repository fields.
  2. Your package.json has a version of 0.0.0.
  3. Your package.json has an "engines": {"atom": ">=1.0.0 <2.0.0"} or whatever, since Atom is probably going to be updated and you want to make sure your package is available to whatever the latest version is.
  4. Your package has a README.md.
  5. The repository in your package.json is the repo on Github that you have pushed your package to (you are using version control, aren’t you?). It’s gotta be Github, since Atom is owned by them.
  6. apm publish major/minor/patch. Not all of them, just one of them. Go read about semantic versioning.

You’ll be prompted to log into Github to let Atom provide you with an API key, if you haven’t done this before. Jam that API key in there and you’ll be in business.

Just remember to update your package.json description field before taking a screenshot to post on your blog.

hokkaido-syntax on atom package manager

How we got to this point, for the record

I’m not a huge fan of a lot of big syntax themes. The Monokais and Cobalts of the text editor world. So I decided to make my own.

I use Atom, and Atom gives you a nice generator for a custom syntax theme. Hit Cmd+Shift+p and type in ’syntax’ and the generator will come up. I think it saves your generated files to ~/github. Navigate over there and open them in Atom—actually, open them in a ‘Developer’ window (View->Developer->Open in Dev Mode…), since you’ll want to see updates as you save your CSS, and since you’ll probably want to use the Dev Tools to inspect elements. Get hacking.

The theme I defined basically pulled colors out of Hokkaido, Japan’s landscape, but I found that it was too heavy on yellow and shades of blue so I removed them and focused instead on earth tones and reds. The only blue left is a deep blue for the comments, because gray comments suck and I’m tired of seeing dark green comments when I edit stuff in cPanel.

I actually moved on to a monochrome theme for a little while before coming back to proper syntax highlighting when I started using the computer at work. I had forgotten about the theme I had made and started using Gruvbox, which I’ve always found to have a little more character and style, if a bit too much green.

And then I remembered. Didn’t I make a sick syntax theme already? And why wasn’t I using it?

Making that syntax theme available wasn’t as easy as just moving the files over, though. Or maybe it was, and I’ve put myself through too much trouble. At any rate, I decided to publish it to Atom’s package manager. Maybe it’ll get some attention there, anyway.