-
Notifications
You must be signed in to change notification settings - Fork 27
Update the tutorial to match this repo? #2
Description
I just worked through the tutorial and ran into lots of issues (I believe most of them are because atom has changed how it generates the package template etc), I don't know how to edit the original tutorial (If someone could help with that I would be happy to give that a try). Then I discovered that this repo was quite different, I will list some suggested changes here:
Also I am not sure if it was because I opened the editor in dev mode (atom --dev) from the command line or if it puts you in dev mode when it generates the package but because of this The sections where the instructions say to reload the window that is not needed as it auto updates.
Fix 1
From:
To verify this, toggle the Command Palette (cmd-shift-P) and type "ASCII Art". You'll see a new ASCII Art: Toggle command. When triggered, this command displays a default message.
To:
To verify this, toggle the Command Palette (cmd-shift-P) and type "ASCII Art". You'll see a new ASCII Art: Toggle command. When triggered, this command displays a default message. You can close the message with control - option - 'o'.
(It was not obvious how to get it to go away at first).
Fix 2
From:
Now let's edit the package files to make our ASCII Art package do something interesting. Since this package doesn't need any UI, we can remove all view-related code. Start by opening up lib/ascii-art.coffee. Remove all view code, so the module.exports section looks like this:
module.exports =
activate: ->
To:
Now let's edit the package files to make our ASCII Art package do something interesting. Start by opening up lib/ascii-art.coffee and replacing the content of the file with:
module.exports =
activate: ->
Note: This will mean the ascii-art-view.coffee file wont be used by the plugin. Since this package doesn't need any UI it can be deleted.
I was confused because there was no view data, (This seems to have been split out into a file called ascii-art-view.coffee by the plugin generator).
Fix 3
From:
Now open the command panel and search for the ascii-art:convert command. But it's not there! To fix this, open package.json and find the property called activationEvents. Activation Events speed up load time by allowing Atom to delay a package's activation until it's needed. So remove the existing command and add ascii-art:convert to the activationEvents array:
"activationEvents": ["ascii-art:convert"],
To:
Now open the command panel and search for the ascii-art:convert command. But it's not there! To fix this, open package.json and find the property called activationCommands. Activation Commands speed up load time by allowing Atom to delay a package's activation until it's needed. So you can replace the ascii-art:toggle command with the convert command:
"activationCommands": {
"atom-workspace": "ascii-art:convert"
},
Slight change to the json format. The section after this about re-loading the window is not needed as I said at the beginning.
Fix 4
From:
After saving the file, run the command 'update-package-dependencies:update' from the Command Palette. This will install the package's node module dependencies, only figlet in this case. You will need to run 'update-package-dependencies:update' whenever you update the dependencies field in your package.json file.
To:
After saving the file, run the command 'Update Package Dependencies: Update' from the Command Palette. This will install the package's node module dependencies, only figlet in this case. You will need to run 'update-package-dependencies:update' whenever you update the dependencies field in your package.json file.
The hyphenated version returned no results so typing update- cleared the search.