Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livescript support broken #3017

Closed
borestad opened this issue Jun 17, 2015 · 5 comments
Closed

Livescript support broken #3017

borestad opened this issue Jun 17, 2015 · 5 comments
Assignees
Labels

Comments

@borestad
Copy link
Contributor

Hi.
I know that the dirty patch in #2662 I submitted was refactored and enhanced. Great work!

Although, in the latest RC1, it seems broken.

Test case:
Convert ./config/routes.js to ./config/routes.ls

Something like this:

module.exports.routes = 
  '/': 
    view: 'homepage'

When running sails lift this results in:

error: Please run `npm install LiveScript` to use LiveScript!

It seems like the path to the index.js file is wrong:
https://github.com/balderdashy/sails/blob/master/lib/hooks/moduleloader/index.js#L100

From my understanding, node & require should respect the "main" property here in the package.json, but it seems it doesn't.
https://github.com/gkz/LiveScript/blob/master/package.json#L35

My dirty fix right now:
cd node_modules/livescript && ln -s lib/index.js index.js
but maybe sails should change the required file to become require: 'LiveScript/lib/index' instead.

This bug accurs with this setup:

  • OSX Yosemite
  • node 0.12.4
  • npm 2.11.2
  • Livescript 1.3.1 and 1.4.0
@borestad
Copy link
Contributor Author

To clearify even further:
https://github.com/balderdashy/sails/blob/master/lib/hooks/moduleloader/index.js#L149
=>
/Users/username/app/node_modules/LiveScript/index

Should be (or at least it should respect the package.json settings?)
/Users/username/app/node_modules/LiveScript/lib/index

@tjwebb tjwebb added the bug label Jun 28, 2015
@tjwebb
Copy link
Contributor

tjwebb commented Jun 28, 2015

What version of sails?

@borestad
Copy link
Contributor Author

RC1, possible RC2 as well

@sgress454
Copy link
Member

@borestad To clarify, did you see this working before RC1? Looking through the commit history of Livescript, I don't see that there was ever an index.js file in the root folder. I think that path has probably just always been wrong, and we don't have automated tests for the various language variants so it slipped through.

sgress454 added a commit that referenced this issue Jun 29, 2015
@sgress454
Copy link
Member

Closing this, should be fixed by cc39522.

ctartist621 pushed a commit to ctartist621/sails that referenced this issue Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants