How do you spin up a new spine app using the spine.app cli?

23 views
Skip to first unread message

Ramiro Franco

unread,
Mar 27, 2014, 5:17:40 PM3/27/14
to spi...@googlegroups.com
So, I'm attempting to use spine for the first time, and I'm attempting to do so using hem as the start up guide suggests on the site, but I'm running into errors. To avoid repeating myself I'm going to link to the stack over flow page here:


But long story short, it seems like the defaults might be wrong, and I probably just need a little more nudging to make this work but I don't want to go down a rabbit hole if it turns out the solution is simple, so I'm asking around :-)

Any tips would be great!

Thanks!
Ramiro

Richard Flosi

unread,
Mar 28, 2014, 2:25:34 PM3/28/14
to spi...@googlegroups.com
Hey Ramiro,

What you report is true, I just went through this myself setting up a new Spine app.

You'll need to edit the package.json that Spine.app provides.
See my pull request here for changes: https://github.com/spine/spine.app/pull/43/files

Additionally, I needed this change to jqueryify for it to work:

The above is the minimal you'll need to get things working.

----

But I ended up not liking that solution and ended up doing the following...

package.json dependences:
    "dependencies": {
        "spine": "~1.3.0",
        "hem": "~0.3.6"
    }
Here I reduced the npm module dependencies.
If you need to support browsers older than IE9 you'll want to keep es5-shimify, json2ify as dependencies here.

bower.json dependencies:
  "dependencies": {
    "jquery": "~2.1.0"
  }
Here I moved the jquery dependency to be managed by bower b/c the jqueryify module wasn't exporting jQuery correctly.

slug.json packages.appName.libs packages.appName.modules:
  "packages": {
    "appName": {
      "libs"    : [
        "lib/runtime.js",
        "bower_components/jquery/dist/jquery.min.js"
      ],
      "modules" : [
        "spine",
        "spine/lib/local",
        "spine/lib/ajax",
        "spine/lib/route",
        "spine/lib/manager"
      ]
And here I updated libs to include jquery from my bower_components.
I included modules here as well as you probably want to add local (LocalStorage), ajax (Ajax server communication), and manager (for Stack) here.

You'll need to update app/lib/setup.coffee to reflect the modules in slug.json:
I found having app/lib/setup.coffee a bit odd and ended up moving the require statements from setup.coffee to my main app/index.js (which I renamed app/app.js).

----

NOTE: while this is my current setup I plan to try replacing hem with gulp and browserify and only use npm to manage packages removing the need for bower.

----

Hope this helps. Let me know how it goes. The Spine.app templates should get updated at least to something to works out of the box. Luckily I used Spine before and knew my way around a bit. ;)

-r.

Aaron Eischeid

unread,
Mar 28, 2014, 5:09:35 PM3/28/14
to spi...@googlegroups.com
I updated spine.app to try to address a couple things that Richard brought up. I haven't tested it out because of issues with moving back to the older versions of Hem that it expects. Let me know if things settings are still off for you. 
Reply all
Reply to author
Forward
0 new messages