Need help with Atom development workflow on Windows


#1

I am new to developing for Atom and I am having some difficulties understanding how to make code changes within the Atom source code. I am trying to work on some bugs within the release-notes module and I am following the instructions located in the following documentation:

https://atom.io/docs/v0.138.0/advanced/node-modules

I am working on Windows and I’ve found that the instructions don’t really work for me. What I mean by that is when I build Atom it installs into the Program Files folder. That last step in those instructions wants me to run Atom from the cloned Atom source code repo. There is an atom.sh file and I’ve attempted to run it under Cygwin but it does nothing. I’ve peaked at the code and it appears as though the Windows coverage is not finished.

This leaves me scratching my head as to how to properly make changes and install them into Atom.

What’s more is that I don’t know if there is an implicit step for me to compile the coffeescript myself or if the npm install && apm rebuild will do it for me?

Additionally the last steps are confusing me, after I make my changes where should I execute npm install and apm rebuild? In the node-module repo or in the atom repo?


#2

Part of the problem is that release-notes is an Atom package, not a Node module. Even though I’m not on Windows, I can share with you my general workflow for developing Atom packages. This is my flow for pre-existing packages that I want to modify:

  1. Check out the package that I want to work on to a project directory (ex: ~/Source/release-notes)
  2. Link it as a Developer Mode only package. From within the project directory, execute: apm link --dev
    • This creates a symlink from the project directory to a directory of the same name under ~/.atom/dev/packages. Packages in this directory are only loaded when you start Atom in Developer mode, i.e. atom --dev
  3. Open the package in Atom
  4. Add a test for the functionality I want
  5. Run the tests. From within the project directory execute: apm test
  6. Make a code change
  7. Run the tests
  8. Repeat until done

When I want to test the package within Atom, I launch Atom in Developer mode and test the functionality. Atom compiles the CoffeeScript when it loads the package.


#3

Okay thank you! I’ll try that!

I guess I incorrectly thought it was a node module because it is installed in the node_modules folder on my Atom installation

C:\Program Files (x86)\Atom\resources\app\node_modules\release-notes


#4

You shouldn’t make changes to anything under C:\Program Files (x86)\Atom, that’s the application itself. There isn’t any need to make code changes there because when you install a package in (or link it to) ~/.atom/dev/packages it overrides the package built in to the app.


#5

I wasn’t implying I was doing that. I simply assumed since release-notes was under the node_modules folder that it was a node_module and not an atom module. I was attempting to follow the instructions on working with node modules under Atom. I’ll follow the instructions you gave instead of that and see what happens.

Your instructions are working for me. Thank you!


#7

Are there any special things I need to do in order to modify core Atom code (for instance the auto-updater which plays a roll in how the release notes does it’s business)?


#8

I don’t know, I haven’t looked into the auto-updater and don’t know if the auto-updater is even core Atom code. But if you want to work on Atom itself, the instructions for building Atom on Windows are here:


#9

I am familiar with how to build Atom and I have everything installed and working. The auto updater code is in the Atom src/browser folder in the repo so I am assuming its core. Just wondered if there was some special process to develop for the core. Given the complexity and length of time for the build to finish I can’t imagine I’d need to rebuild Atom for each tiny coffee script change. On Windows it goes through the install process on build so that seems a bit wonky to me. But if that is the process that’s fine.

Thanks for your help Lee, I really appreciate it!!!


#10

Looks like the holes in my n00bness would have been filled in nicely if I would have known about this page beforehand:

https://atom.io/docs/latest/contributing-to-packages

=)