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

use node-ssi #20

Open
kidwm opened this issue Jan 5, 2016 · 7 comments
Open

use node-ssi #20

kidwm opened this issue Jan 5, 2016 · 7 comments

Comments

@kidwm
Copy link
Owner

kidwm commented Jan 5, 2016

Hi, I'm the new maintainer of node-ssi.

https://github.com/kidwm/node-ssi

I can take over this project and make this grunt plugin based on node-ssi.

my npm id is also kidwm, how do you think, would you like to transfer it to me?

@anguspiv
Copy link
Collaborator

anguspiv commented Jan 5, 2016

Yeah, I have no problem with that. I will say I originally tried to use node-ssi, but wanted to also create a caching system, similar to sass. So I found it difficult to integrate with node-ssi. But this is all yours now. I will note that you might want to upgrade the version of grunt it relies on. Let me know if you have any questions.

@kidwm
Copy link
Owner Author

kidwm commented Jan 6, 2016

@anguspiv Thank you, if you were still interested to create a caching system in node-ssi, welcome to contribute!

@taoeffect
Copy link

There's also @yanni4night's node-ssi which I use and can vouch for. What's the difference between these two node-ssi projects?

@taoeffect
Copy link

Oh, one difference that I've found is that ssi's API requires the creation of files whereas @yanni4night's node-ssi does not. That's very convenient for creating middleware using grunt-contrib-connect (something that I'm working on right now).

@taoeffect
Copy link

Yep! 😄

grunt-contrib-connect works great with @yanni4night's node-ssi, no need for any temporary cache files or new grunt plugins, just do:

    connect: { // https://github.com/gruntjs/grunt-contrib-connect
      options: {
        port: 8000,
        base: 'dist',
        livereload: true,
        middleware: (connect, opts, middlewares) => {
          middlewares.unshift((req, res, next) => {
            var f = url.parse(req.url).pathname
            f = path.join('dist', S(f).endsWith('/') ? f + 'index.html' : f)
            if (S(f).endsWith('.html') && fs.existsSync(f)) {
              ssi.compileFile(f, (err, content) => {
                if (err) {
                  console.error(err.stack)
                  throw err
                }
                console.log(`Req: ${req.url} => sending node-ssi parsed file: ${f}`)
                res.end(content)
              })
            } else {
              next()
            }
          })
          return middlewares
        }
      },
      dev: {}
    }

@thany
Copy link

thany commented May 27, 2016

Did this endeavor come through yet? I would very much like the functionality of node-ssi in a grunt task, but I'm not sure that it's possible without it being an actual grunt task module.

@kidwm
Copy link
Owner Author

kidwm commented May 28, 2016

@thany Not yet, thanks for your appreciation.
I'm still busy with my new daily job. Hope to find some time for it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants