Support JS package generation #36
Conversation
|
The code is pretty simple here and all specs pass, but I had problems using my version of |
|
Update on actual testing of this feature: since |
| @@ -89,6 +97,9 @@ class PackageGeneratorView extends View | |||
|
|
|||
| @runCommand(atom.packages.getApmPath(), args, callback) | |||
|
|
|||
| isInPackageMode: -> | |||
50Wliu
Nov 22, 2015
Member
Is this necessary? if @mode is 'package' seems fine to me, and it's also similar to what vim-mode does.
Is this necessary? if @mode is 'package' seems fine to me, and it's also similar to what vim-mode does.
stevenhauser
Nov 22, 2015
Author
Contributor
Yeah that's what it was here but since we're doing the same check in two places now, a method for the check seems better than a constant or string duplication to me.
Yeah that's what it was here but since we're doing the same check in two places now, a method for the check seems better than a constant or string duplication to me.
| expect(apmExecute.argsForCall[0][1]).toEqual packageInitCommandFor "#{packagePath}", 'coffeescript' | ||
|
|
||
| describe "when the package is a javascript package", -> | ||
| it "calls `apm init` with the correct syntax option", -> |
50Wliu
Nov 22, 2015
Member
extra space after apm init
extra space after apm init
stevenhauser
Nov 22, 2015
Author
Contributor
Good 👀
Good
|
|
||
| describe 'when creating a package', -> | ||
|
|
50Wliu
Nov 22, 2015
Member
This newline isn't needed
This newline isn't needed
|
@50Wliu Is there a preference for separate commits for fixing things like spacing issues vs squashing and force pushing? I tend to do the latter but know that can be a PITA for collaboration. |
|
@stevenhauser I don't think the Atom team has a definitive preference, but maybe a slight lean towards not squashing. |
|
|
|
Hey it's been a few months—is there still interest in this? There was some conversation in #14 about different ways to approach this, but I think it'd be nice to go this simple route to at least have something available and we could enhance it later? Happy to update this and fix any conflicts. |
|
@stevenhauser I am still interested in having this available |
Source changes: - Add `isInPackageMode` method to minimize string comparisons of `@mode` - Add `getInitOptions` method to facilitate differentiating options between modes and to keep `initPackage` simple. Add `--syntax` option here, too. Spec changes: - Add `packageInitCommand` helper to clean up init command test argument duplication and to prevent it from getting even longer with the new `--syntax` addition. - Move `generateOutside` into more generic `generatePackage` to clean up duplication b/w the inside/outside specs, and leverage `_.partial` to create more readable helper functions. This is also to prevent further duplication in the new syntax specs. - Write specs to check `--syntax` option.
|
@lee-dohm I've resolved the merge conflicts here. The problem was that the configuration was moved out of However I'm having problems actually getting this to load into Atom that I didn't have before. Here are the steps I've taken:
When I first opened this PR, I believe that step 4 loaded my dev version of |
|
No, you shouldn't need to do another step, though I would recommend revising your steps to this:
|
|
Thanks for the tip @lee-dohm but that didn't work either. I think something might be messed up on my machine due to multiple user accounts or something because I'm still stuck on Atom 1.3.3 and updates won't install. Regardless, I still think this PR is good to review because it was fine before and the only real change I made recently was to move config to |
|
I've added it to the queue for review. We're still trying to catch up on the backlog, so I can't give you an ETA. Just know that we're working on it |
|
Coolio, I'm in no rush. Thanks! |
| @@ -28,6 +28,12 @@ | |||
| "default": false, | |||
| "type": "boolean", | |||
| "description": "When disabled, generated packages are linked into Atom in both normal mode and dev mode. When enabled, generated packages are linked into Atom only in dev mode." | |||
| }, | |||
| "packageSyntax": { | |||
| "default": "coffeescript", | |||
joshaber
Mar 14, 2016
Contributor
I think we should default to JavaScript since it's the future.
I think we should default to JavaScript since it's the future.
stevenhauser
Mar 15, 2016
Author
Contributor
Hey that's great, I defaulted to CS purely for the sake of "backwards compatibility." Changing.
Hey that's great, I defaulted to CS purely for the sake of "backwards compatibility." Changing.
joshaber
Mar 15, 2016
Contributor
That's almost always the right choice, but if we can push people away from CS and to JS... 😄
That's almost always the right choice, but if we can push people away from CS and to JS...
|
@stevenhauser This looks good! Just one comment. |
|
Updated @joshaber. Thanks for the review! |
|
Awesome, thanks @stevenhauser! |
Support JS package generation

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Addresses #14
Now that atom/apm#417 has been merged, JS package generation can be done from the UI, so that's what happens here. I ran with the third idea I mentioned in #14 because it made the most sense to me.