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

gulp plugin to automate build #79

Open
nubunto opened this issue Mar 25, 2015 · 1 comment
Open

gulp plugin to automate build #79

nubunto opened this issue Mar 25, 2015 · 1 comment

Comments

@nubunto
Copy link

nubunto commented Mar 25, 2015

I'm thinking something like:

  • Code in sibilant (from the server all the way to the client)
  • Make gulp compile it to JS
  • Use it!
@dead-claudia
Copy link

You could probably do that yourself in a day or two. Look at the size of the entirety of the gulp-bower plugin. That's just under 100 lines of JavaScript. Sibilant's compiler API is relatively simple, but I think that, because of the (include) feature, the plugin would have to be the source of the stream, like gulp-bower is.

An idea for the API (in JS, ordered by parent API):

  • Notes on Sibilant API:

    • sibilant.file – starting file
    • sibilant.dir – starting current working directory
  • sibilant.translateFile

    sibilant('src/foo.sibilant')

    • sibilant.file – src/foo.sibilant
    • sibilant.dir – src
    sibilant({
      file: 'foo.sibilant',
      cwd: process.cwd(),
    })
    • sibilant.file – foo.sibilant
    • sibilant.dirprocess.cwd()
  • sibilant.translateJson

    sibilant('foo.son')

    • See above.
    sibilant({
      file: 'foo.son',
      cwd: process.cwd(),
    })
    • See above.
  • Multiple files, using minimatch/etc. Use respective conversion method for each matched file.

    sibilant('*.sibilant')
    sibilant('*.son')
    sibilant(['**/*.sibilant', '**/*.son', '!*.sibilant'])

Example usage:

// JavaScript
var mergeStream = require('merge-stream');
var sibilant = require('gulp-sibilant');

gulp.task('build', function () {
  return mergeStream(
      sibilant('src/index.sibilant'),
      sibilant('src/cli.sibilant'))
    .pipe(gulp.dest('dist'));
});

Example in Sibilant

(var merge-stream (require 'merge-stream))
(var sibilant (require 'sibilant))

(gulp.task 'build
  (#> (chain (merge-stream
      (sibilant "src/index.sibilant")
      (sibilant "src/cli.sibilant"))
    (pipe (gulp.dest 'dist))))

If Gulp doesn't support it already, make this your gulpfile.js. I have to use the same workaround until they fix Babel support (ES6 transpiler).

require('sibilant');
require('./gulpfile.sibilant');

I don't personally have a vested interest in Sibilant, but it wouldn't be that hard to create such a plugin.

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

2 participants