bnolan / capt Goto Github PK
View Code? Open in Web Editor NEWCommand line tool for creating backbone.js applications
Command line tool for creating backbone.js applications
In project.coffee:
replace:
fs.watchFile Path.join(@root, source), {persistent: true, interval: 500}, (curr, prev) =>
*with:
fs.watch Path.join(@root, source), {persistent: true, interval: 500}, (curr, prev) =>
capt generate model user ---> (generates following coffeescript)
class User extends Backbone.Model
initializer: ->
# ...
@user = User
Initialization method for Backbone.js models should be initialize, not initializer.
Can we select the port we want the server to listen to? Rails is using 3000 on my dev environment. Had to hack into the module and alter the main.coffee file to listen to a different port, perhaps that could be overridden by an option?
Hi! I have a problem with capt watch.
I have actual libs:
Ravbook:~ rav$ node -v v0.4.6 Ravbook:~ rav$ coffee -v CoffeeScript version 1.0.1 Ravbook:~ rav$ npm -v 0.3.18
with capt 0.5.0
npm info build Success: [email protected]
New capt project has test dir
Ravbook:~ rav$ capt new captproject * Creating folders * Downloading libraries Ravbook:~ rav$ cd captproject/ Ravbook:captproject rav$ ls app index.html lib test config.yml index.jst public
but capt watch looks for spec/index.jst
Ravbook:captproject rav$ capt watch Rebuilt project... fs.js:221 return binding.open(path, stringToFlags(flags), mode); ^ Error: EBADF, Bad file descriptor '/Users/Rav/captproject/spec/index.jst' at Object.openSync (fs.js:221:18) at Object.readFileSync (fs.js:112:15) at Object._onTimeout (/Users/rav/.node_libraries/.npm/capt/0.5.0/package/src/main.coffee:112:16) at Timer.callback (timers.js:83:39)
This is a great tool, but I'm scratching my head to figure out how to include partials and some other things as well. Definitely could use more documentation.
hi, I am getting a segfault when trying to start capt server or capt watch with the latest version of capt.
"capt new" works just fine.
Why not to use uglify for js compression?
I am following your tutorial but when I try to create the view I get this error. I did create the folder and re-ran the view generation, but then I get another error and the server will not start at all.
What could be the reason?
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ENOENT, No such file or directory '/Users/mydir/notes/app/templates/notes'
at Object.mkdirSync (fs.js:360:18)
at /Users/mdikov/node_modules/capt/src/main.coffee:231:10
at /Users/mdikov/node_modules/capt/src/main.coffee:33:7
at Object. (/Users/mdikov/node_modules/capt/src/main.coffee:208:3)
at Object. (/Users/mdikov/node_modules/capt/src/main.coffee:241:4)
at Module._compile (module.js:402:26)
at Object..coffee (/Users/mydir/node_modules/capt/node_modules/coffee-script/lib/coffee-script.js:11:21)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at require (module.js:346:19)
Seems like UglifyJS is the best JavaScript parser / mangler / compressor / beautifier library on NodeJS.
It will be great if you can add it to the project.
Hey Ben,
I'm interested in using (and hopefully contributing to) capt. I've used backbone a bit, but am pretty new to coffee and node. Can you point me in the right direction?
I looked online for a reference about node loadpaths, but couldn't find anything that seemed to help.
I am on OSX - I installed node via homebrew, and coffeescript via npm. I cloned this repo.
[master][~/dev/capt] uname -a
Darwin Jason-Morrisons-MacBook-Pro.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
[master][~/dev/capt] git st
# On branch master
nothing to commit (working directory clean)
[master][~/dev/capt] brew -v
0.7.1
[master][~/dev/capt] which node
/usr/local/bin/node
[master][~/dev/capt] node -v
v0.2.6
[master][~/dev/capt] which coffee
/usr/local/share/npm/bin/coffee
[master][~/dev/capt] coffee -v
CoffeeScript version 1.0.0
[master][~/dev/capt] bin/capt
node.js:63
throw e;
^
Error: Cannot find module 'coffee-script'
at loadModule (node.js:275:15)
at require (node.js:411:14)
at Object.<anonymous> (/Users/jason/dev/capt/bin/capt:5:1)
at Module._compile (node.js:462:23)
at Module._loadScriptSync (node.js:469:10)
at Module.loadSync (node.js:338:12)
at Object.runMain (node.js:522:24)
at Array.<anonymous> (node.js:756:12)
at EventEmitter._tickCallback (node.js:55:22)
at node.js:773:9
[master][~/dev/capt] which coffee
/usr/local/share/npm/bin/coffee
[master][~/dev/capt] coffee -v
CoffeeScript version 1.0.0
[master][~/dev/capt] coffee src/main.coffee
Error: Cannot find module 'glob'
at loadModule (node.js:275:15)
at require (node.js:411:14)
at Object.<anonymous> (/Users/jason/dev/capt/src/main.coffee:6:10)
at Object.<anonymous> (/Users/jason/dev/capt/src/main.coffee:208:4)
at Module._compile (node.js:462:23)
at Object.run (/usr/local/lib/node/.npm/coffee-script/1.0.0/package/lib/coffee-script.js:57:19)
at /usr/local/lib/node/.npm/coffee-script/1.0.0/package/lib/command.js:120:29
at /usr/local/lib/node/.npm/coffee-script/1.0.0/package/lib/command.js:83:26
at fs:84:13
at node.js:773:9
Thanks for any help!
-Jason
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.