Support LiveScript Jakefiles
bmundt6 opened this issue · 8 comments
Pretty self-explanatory; in addition to Jakefile.js
and Jakefile.coffee
, also allow Jakefile.ls
.
I've reimplemented this in the current refactor branch: https://github.com/jakejs/jake/tree/post-v10-refactor Can you pull it, and verify that it actually works?
The refactor branch is not working for me either. In fact it does not even accept the coffeescript Jakefile. My test setup is this:
{ jake } = require 'jake'
Running just jake
yields:
jake aborted.
Error: No Jakefile. Specify a valid path with -f/--jakefile, or place one in the current directory.
Running jake -f Jakefile.coffee
yields:
jake aborted.
Jakefile.coffee:1
(function (exports, require, module, __filename, __dirname) { { jake } = require 'jake'
Could you provide me with a minimal repo with a CS/LS Jakefile, and the proper dependencies? Ideally we'd have tests for this, but let's start with a repo that ought to work.
Here is a test repo for you: https://github.com/bmundt6/jake_coffee_lsc_test
Thank you. (Sorry, I closed the issue by mistake.)
I was not able to repro your issue for LiveScript, although your repo did help me find a bug in the CoffeeScript implementation. I changed and tweaked somethings, mostly removing the old library names of 'LiveScript' and 'coffee-script', but the fundamental approach is still the same, so I suspect it will not fix your specific issue.
I think it might have something to do with where you're putting the Jake lib and executable — submodules are often problematic, from what I've seen. Here's my basic test, which works as expected:
dargo:work mde$ git clone https://github.com/bmundt6/jake_coffee_lsc_test.git
Cloning into 'jake_coffee_lsc_test'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 10 (delta 2), reused 10 (delta 2), pack-reused 0
Unpacking objects: 100% (10/10), done.
dargo:work mde$ cd jake_coffee_lsc_test/
dargo:jake_coffee_lsc_test mde$ npm install git://github.com/jakejs/jake.git#post-v10-refactor
npm WARN jake_coffee_lsc_test@1.0.0 No repository field.
+ jake@10.3.2
added 28 packages from 56 contributors and audited 38 packages in 4.447s
found 0 vulnerabilities
dargo:jake_coffee_lsc_test mde$ npm install livescript
npm WARN jake_coffee_lsc_test@1.0.0 No repository field.
+ livescript@1.6.0
updated 1 package and audited 38 packages in 2.1s
found 0 vulnerabilities
dargo:jake_coffee_lsc_test mde$ npm install coffeescript
npm WARN jake_coffee_lsc_test@1.0.0 No repository field.
+ coffeescript@2.4.1
updated 1 package and audited 38 packages in 1.435s
found 0 vulnerabilities
dargo:jake_coffee_lsc_test mde$ ./node_modules/.bin/jake -f Jakefile.ls
Starting 'default'...
it works!
Finished 'default' after 1 ms
dargo:jake_coffee_lsc_test mde$ ./node_modules/.bin/jake -f Jakefile.coffee
Starting 'default'...
it works!
Finished 'default' after 0 ms
I'm happy to help you debug, but honestly, Jake is intended primarily as a productivity tool for building real-world applications, and CS/LS are both considerably far afield from any mainstream uses.
Installing jake through npm as you specified made it work - I didn't even know that was possible, nice tip!
Thank you for your time, closing.
Implemented in. 10.4.