SE7ENSKY / jade2php

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered.
43 stars 10 forks source link

Gulp integration (gulp-jade2php) #13

Closed OnkelTem closed 9 years ago

OnkelTem commented 9 years ago

When using gulp-jade2php:

Error: Cannot find module 'jade2php'
    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> (/var/www/sites/mclinic/node_modules/gulp-jade2php/index.js:11:14)
    at Object.<anonymous> (/var/www/sites/mclinic/node_modules/gulp-jade2php/index.js:48:4)
    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)

Also, it's not clear what do you mean under "temporary" solution here https://www.npmjs.com/package/gulp-jade2php and why do you suggest using gulp-accord which doesn't support jade2php or it does?

OnkelTem commented 9 years ago

Oh, just noticed - there is no index.js, so it doesn't provide anything, right? No wonder it doesn't work with gulp-jade2php which tries to require() it. So what was the idea behind gulp-jade2php?

ivankravchenko commented 9 years ago

latest version of jade2php must require()-able without problem, please check

OnkelTem commented 9 years ago

A moment

OnkelTem commented 9 years ago

Ok, got the version from git (latest commit is 98d02c45) Then I've replaced the contents of gulp-jade2php/node_modules/jade2php directory with the version I got. Still watching error :(

ivankravchenko commented 9 years ago

package.json:

{
  "dependencies": {
    "jade2php": "^1.1.7"
  }
}

index.js:

var jade2php = require("jade2php");
if (jade2php) {
        console.log("jade2php require() success");
} else {
        console.log("jade2php require() failure");
}
$ npm install
$ node index.js 
jade2php require() success

Not sure what's problem with gulp-jade2php.

@FranzSkuffka , could you mind to assist with that?

janwirth commented 9 years ago

The gulp-jade2php module is just crap tbh. I am going to unpublish it. I lacked some experience and understanding when i wrote this. Creating an adapter for https://github.com/jenius/accord is the way to go imho.

OnkelTem commented 9 years ago

jade2php require() success

странно, так у меня тоже получилось

OnkelTem commented 9 years ago

Creating an adapter for https://github.com/jenius/accord is the way to go imho.

Can't wait!

ivankravchenko commented 9 years ago

@OnkelTem, cloned git repo isn't same as fetching NPM module. Git repo maintain sources (coffee, tests), while NPM module contain compiled output (js, no tests, no coffee). To make your-way git-cloned repo work as an NPM module, do npm install ; npm run prepublish in repo directory.

ivankravchenko commented 9 years ago

Does this issue actual yet?

janwirth commented 9 years ago

There is a solution available: https://www.npmjs.com/package/gulp-jade2php