Code Monkey home page Code Monkey logo

spine.app's Introduction

Spine

Build Status Gitter

Spine is a lightweight MVC library for building JavaScript web applications. Spine gives you structure and then gets out of your way, allowing you to concentrate on the fun stuff: building awesome web applications.

Spine is opinionated in its approach to web application architecture and design. Spine's architecture complements patterns such as de-coupled components and CommonJS modules, markedly helping with code quality and maintainability.

The library is written in CoffeeScript, and though it doesn't necessarily require CoffeeScript to develop applications - you can use whichever language you're most familiar with or prefer - the documentation and some associated tools like Hem and spine.app cater to those who prefer CoffeeScript's syntax.

Learn it

Documentation is often incomplete or just lies waiting to happen. Approachable source code reduces knowledge dependencies. This is an area where Spine really excels compared to other MVC frameworks. Spine is tiny; the core library comes in at less than 700 lines of CoffeeScript code. It is written in such a way to prefer readability over terseness or clever tricks, and it is small enough that within a rather small timeframe you can understand how all the pieces work together. Expertise is achievable within days or weeks rather than months or years. For these reasons, remaining lightweight and simple is fundamental to Spine.

For documentation, usage, and examples, see: spine.github.io

The test suite can also occasionally provide additional useful examples, especially if you are looking for non-coffeescript examples.

Contributing

Reporting issues

To file a bug report, please visit the GitHub issues page. It's great if you can attach code (test cases and fixes for bugs, and test cases and a proposed implementation for features), but reproducible bug reports are also welcome.

For support or help with using spine please use the Spine Google Group and/or StackOverflow rather than opening an issue on Github. If you post in those places you are more likely to get more people to chime in, and others can benefit from it more readily.

Cloning master and running the test suite

To get started contributing to Spine, first clone the repository and make sure you can run the test suite. If you're not familiar with Git, visit the Git homepage to download Git for your platform.

First, clone the repository:

$ git clone git://github.com/spine/spine.git
$ cd spine

Next, You will need node and npm to pull in the testing libraries. Once you're all set with those then from within the Spine repo directory run

$ npm install

This will install CoffeeScript and the Karma test runner.

At this point you can easily run the complete test suite using

$ npm test

But this isn't very practical for development, since it runs the test suite multiple times agains different versions of jQuery.

A better approach is to install the Karma CLI

$ npm install -g karma-cli

Then you can use $ karma start to run the tests using the latest stable version of jQuery. Karma will keep running in the background and re-run tests whenever you change any files. When the Karma server is running, you can debug tests in your browser by visiting http://localhost:9876/debug.html.

It's also possible to test agains a specific version of jQuery if needed: $ JQUERY_VERSION=1.9.1 karma start.

Contributing to the Spine documentation

Perhaps the easiest way to get started with contributing is through the docs. If you find typos, bugs, or omissions in the docs, please submit a pull request to fix. The Spine website, which is the primary documentation, is a very simple Wintersmith app at spine.github.io. Basic markdown familiarity is probably all you need to be able to make changes.

Contributing to the Spine code

This recommended contribution process is based on the Ruby on Rails contribution guide. In general, please include tests with new features or bugfixes, work in a feature branch until you're ready to submit or discuss your code, then fork the repository, push to your fork, and issue a pull request.

CoffeeScript

When submitting a pull request for code, please submit in CoffeeScript. Building the effected js files is required for testing sake, but submitting those js files is optional.

Assuming you have Node.js and npm already installed then proceed by installing local dev dependencies:

$ npm install

Then use the provided build scripts to compile your CoffeeScript files:

$ cake build
$ cake watch

These tasks use a locally installed copy of CoffeeScript to ensure all contributors use the same version of the compiler.

Git

Let's say I'm going to submit a patch to add someFeatureFix:

$ git checkout dev

Feature branches should start from dev not master. If you branch off of, or do builds on the master branch you will get CoffeeScript source map files, which are cool, but tend to ruin automatic merges with git.

$ git checkout -b someFeatureFix
$ vim test/...
  # (...add tests...)
$ cake watch
  # (...this should recompile and changes you make in your CoffeeScript...)

-- figure out what spine module your changes belong in
$ vim src/spine.coffee
or
$ vim src/[otherSpineComponent].coffee
  # (...add the feature/fix...)
$ open test/index.html
  # (...make sure tests run for each component that was changed...)
  # (...test in other browsers with various jquery versions if you feel like there is risk... )
$ git commit -m "Add Some Feature Fix"

Then, fork the Spine repository, and push your branch to your fork:

$ git remote add <your user name> [email protected]:<your user name>/spine.git
$ git push <your user name> someFeatureFix

Finally, issue a pull request from inside the GitHub interface to the dev branch of spine, and your contribution is ready for consideration, discussion, and (hopefully) merging in!

spine.app's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spine.app's Issues

template points to wrong path for application.css

The "my_app/public/index.html" references the following css:

<link rel="stylesheet" href="/css/application.css" type="text/css" charset="utf-8">

Should be:

<link rel="stylesheet" href="/application.css" type="text/css" charset="utf-8">

spine.app apps require Node v0.6.x

After trying for the longest time to get npm install to run for an app generated by spine.app, I realized that one of its dependancies (strata v0.8.1, a dependency of serveup) requires Node v0.6.x (I was using v0.4.8). This practically means that serveup and spine.app require Node v0.6.x as well.

Since npm doesn't recursively resolve the Node version requirement (the error is very cryptic), it might be helpful to specify the minimum required Node engine in package.json so that it won't even install without the proper version.

Jasmine specs

Hi

I was wondering, when you generate a model, say Client, then a spec is generated: Client.coffee. But when I want to use jasmine-node, it finds no specs as it is searching for .spec.coffee files.

Any reason why spine.app doesn't generate Client.spec.coffee ? Or should I run my jasmine-node command differently?

Support Bower for package management

I assume this is probably in the works, but now that bower is out, that would be a fantastic way to handle the client-side library deps in Spine.app. I'm happy to help, but since @maccman wrote bower I have a feeling it might already be underway.

Jquery.tmpl.js can't render variables

Hello,
I am learning spine and node.js (both look really promising) and found this spine.app you had made.
So to start, I generated the application structure with spine.app and incorporated your spine.todo application in the project.
everything was fine except jQuery templating which couldn't render any variable:

  • coffee script in Task.coffee:
        ##this.item being {name:'test',done:false}
        elements = $("#taskTemplate").tmpl this.item 

  • template in index.html:
<script type="text/x-jquery-tmpl" id="taskTemplate">
    <div class="item {{if done}}done{{/if}}">
      <div class="view" title="Double click to edit...">
        <input type="checkbox" {{if done}}checked="checked"{{/if}}> 
        <span>${name}</span> <a class="destroy"></a>
      </div>
    </div>
  </script>

the result was:

<script type="text/x-jquery-tmpl" id="taskTemplate">
    <div class="item">
      <div class="view" title="Double click to edit...">
        <input type="checkbox" {{if done}}checked="checked"{{/if}}> 
        <span>undefined</span> <a class="destroy"></a>
      </div>
    </div>
  </script>

by comparing Jquery.tmpl.js from your spine.app project and the one from your spine.todos project I could spot a difference at the line 341:

.replace( /\$\{([^\}]*)\}/g, "{{= $1}}" )

was replaced in the spine.app by:

.replace( /\$\{([^\}]*)\}/g, "undefined" )

I replaced the file by the one in your spine.todos project and worked fine. It must have interpreted it in some way.
I just wanted to let you know about this issue.
keep it up, you are doing an awesome work.
Cheers

integration with railwayjs

Is it possible to use it with railwayjs? What's the best way to scaffold spine to railwayjs app structure?

stylus 0.15.1 dependency update

spine.app uses outdated stylus 0.13.9 which has a broken dependency on connect that has since been corrected. Please update to the latest version of stylus so "extraneous" and "UNMET DEPENDENCY" errors will go away in our npm tree.

won't install - broken dependency

Installing via npm is broken for me. It's trying to pull in a certain version of Express and it can't find it. I have look at the history of the package.json file for Spine.app and it appears that Express is no longer needed. Please update npm with the latest version when you get a chance. Thanks!

spine mobile my-app does not generate correct slug.json

Generate a new app using spine mobile my-app. The generated slug.json has no routes. Running hem server and GETting / results in "cannot get /". Adding

   "routes": [
       { ""        : "./public" },
       { "/test"    : "./test/public" }
    ],

fixes this.

Octal literal '0775' must be prefixed with '0o'

SyntaxError: In /Users/Paul/git/spine.app/src/template.coffee, octal literal '0775' must be prefixed with '0o' on line 31
SyntaxError: In /Users/Paul/git/spine.app/src/mkdirp.coffee, octal literal '0775' must be prefixed with '0o' on line 4

error running specs - specs is not defined

On a fresh install of spine.app, I create a new app, cd into the directory and run npm install and then hem server

When I visit http://localhost:9294/test the following line

    for(var key in specs.modules) specs(key);

throws the error Uncaught ReferenceError: specs is not defined

The documentation around testing seems to be lacking, am I doing this wrong? I'd love to improve the docs if I can get it running.

Thanks

Uncaught module gfx not found

Hey, love all the work you're doing, can't wait to get familiar with Spine.

I installed spine.app while following along with http://spinejs.com/docs/started I keep getting an "Uncaught module gfx not found". I know it's some dependency I'm missing but I'm still figuring out exactly how all this fits together.

Anyways, just thought I'd give you a heads up

... michael

spine.js within windows environment - problem with spine.app

Hi - I'm running a Windows XP machine and have successfully installed node.js, spine, spine.app and hem. After havin called spine app myApp I have received following error:

D:\workspace>spine app MyInventory
node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: EEXIST, file already exists 'D:\workspace'
    at Object.mkdirSync (fs.js:373:18)
    at C:\Documents and Settings\galdo\Application Data\npm\node_modules\spine.app\src\mkdirp.coffee:16:19
    at Template.write (C:\Documents and Settings\galdo\Application Data\npm\node_modules\spine.app\src\template.coffee:51:7)
    at Object.<anonymous> (C:\Documents and Settings\galdo\Application Data\npm\node_modules\spine.app\bin\spine:45:34)
    at Object.<anonymous> (C:\Documents and Settings\galdo\Application Data\npm\node_modules\spine.app\bin\spine:100:21)
    at Module._compile (module.js:444:26)
    at Object..js (module.js:462:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:482:10)

The same for spine controllers or spine models

Thanks and regards
Galdo

Feedback on testing spine.app with hem

Hi,

Testing spine.app with hem, I had to fix the following reported console errors before getting it work:

  • Uncaught module app not found: I changed the var App = require("app"); into var App = require("index");
  • Uncaught module spine not found: added the "spine" dependency into slug.json

I've installed spine.app and hem from master's tarballs with npm, so it's supposed to be up-to-date.

Is this a mistake, or I may have done something wrong?

Cheers.

Won't Install

npm ERR! cb() never called!

npm version 1.1.9
node version 0.6.13

Anyone else having this problem?

jQuery 1.7

How can I use jQuery 1.7.1 in my Spine app, if Spine depends on your library jqueryify, which is still using 1.6.2?

Do you plan to keep jqueryify up to date?

Bugger

no luck with Spine

  1. spine app myApp
  2. cd myApp
  3. npm install .
  4. hem server

Strata web server version 0.8.2
Listening on 0.0.0.0:9294, CTRL+C to stop

Looks reasonable, but i'm presented with a local version of the whole gihhub spine repo.
Instead of a blank page as described in Getting Started.
Manage to change locally served webpage title in /public/index.html.
But failed to get any result changing index.coffee to call @log("Initialized")

hardly Awsome
seems intriguing
devestatingly frustrating

peewee

Create Mobile controllers in Mobile app

It would be nice if spine.app could sense that it's working within the context of a Spine Mobile project and create mobile controllers; that is, controllers with at least 1 panel as a starting point. This would ease the effort involved when adding a new controller to a Spine Mobile project.

Error: Cannot find module '../src/template' with CoffeeScript >=1.7.0

To reproduce the bug:

$ rm -rf node_modules/coffee-script/
$ npm install
$ bin/spine

module.js:340
    throw err;
          ^
Error: Cannot find module '../src/template'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/Users/daniel/dev/spine.app/bin/spine:7:16)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3

Example projects

Hi,

Is there any example projects that actually use spine.app?

Thanks,
Ray

Minimal app

I am trying to setup an app with the minimal amount of dependencies (the default template ends up generating an application.js that weighs some 122KB, which kind of defeats the lightweight philosophy of Spine).

I've modified package.json to only include the following:

{
  "name": "app",
  "version": "0.0.1",
  "dependencies": {
    "serveup":   "~0.0.2",
    "hem":       "~0.1.6",
    "spine":     "~1.0.5",
    "jqueryify": "~0.0.1"
  }
}

And slug.json:

{
  "dependencies": [
    "jqueryify",
    "spine"
  ],
  "libs": []
}

The file app/lib/setup.coffee is left with just:

require('jqueryify')
require('spine')

But now, when I run hem build I get the following error:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
SyntaxError: Unexpected token ]
    at Object.parse (native)
    at Hem.readSlug (/home/daniel/usr/local/lib/node_modules/hem/lib/hem.js:131:19)
    at new Hem (/home/daniel/usr/local/lib/node_modules/hem/lib/hem.js:57:19)
    at Function.exec (/home/daniel/usr/local/lib/node_modules/hem/lib/hem.js:20:15)
    at Object.<anonymous> (/home/daniel/usr/local/lib/node_modules/hem/bin/hem:10:23)
    at Module._compile (module.js:404:26)
    at Object..js (module.js:410:10)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at Array.<anonymous> (module.js:423:10)

Any clues on what I'm doing wrong?

Error when creating new controller

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EBADF, Bad file descriptor '/Users/raywang/spineapps/my_app/app/controllers/users.coffee'
at Object.openSync (fs.js:221:18)
at Object.writeFileSync (fs.js:483:15)
at [object Object]. (/usr/local/lib/node_modules/spine.app/bin/spine:59:10)
at Array.forEach (native)
at [object Object].write (/usr/local/lib/node_modules/spine.app/bin/spine:48:14)
at Object.controller (/usr/local/lib/node_modules/spine.app/bin/spine:102:42)
at Object. (/usr/local/lib/node_modules/spine.app/bin/spine:116:21)
at Module._compile (module.js:407:26)
at Object..js (module.js:413:10)
at Module.load (module.js:339:31)

Any ideas? I tried to install it twice, once with npm install spine.app. Another time with git clone of this project and "npm install ."

Thanks!

Problem starting server

I'm new to node, hem, spine, and spine.app, so this might be a really easy problem to fix. I followed the instructions to generate a new app and I get the following when I try to run "hem server":

$ hem server
Starting server on: 9294

Then open "http://localhost:9294/" (actually "http://localhost:9294/application.js") and I see:
Error: Cannot find module 'es5-shimify'
at /opt/node/current/lib/node_modules/hem/lib/resolve.js:29:13
at new Module (/opt/node/current/lib/node_modules/hem/lib/dependencies.js:65:14)
at Dependencies. (/opt/node/current/lib/node_modules/hem/lib/dependencies.js:32:25)
at Dependencies.resolve (/opt/node/current/lib/node_modules/hem/lib/dependencies.js:35:10)
at Package.compileModules (/opt/node/current/lib/node_modules/hem/lib/hem.js:26:38)
at Package.compile (/opt/node/current/lib/node_modules/hem/lib/hem.js:50:43)
at Package. (/opt/node/current/lib/node_modules/hem/lib/hem.js:59:24)
at /opt/node/current/lib/node_modules/hem/lib/hem.js:3:63
at callbacks (/opt/node/current/lib/node_modules/hem/node_modules/express/lib/router/index.js:272:11)
at param (/opt/node/current/lib/node_modules/hem/node_modules/express/lib/router/index.js:246:11)

Is there a missing step to get that module installed?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.