Git Product home page Git Product logo

fusebox-gulp-plugin's Introduction

fusebox-gulp-plugin

Adapt gulp plugins to work with fuse-box.

Usage

const fsbx = require('fuse-box');
const g = require('gulp-load-plugins')();
const { GulpPlugin } = require('fusebox-gulp-plugin');

const fuseBox = fsbx.FuseBox.init({
    homeDir: 'src/',
    outFile: './build/app.js',
    plugins: [
        // Other fusebox plugins...
        GulpPlugin([
        	(file) => g.replace('foo', 'bar'),
        	// Other gulp plugins...
        ])
    ]
});

Note: GulpPlugin is applicable to all files, so you must control type of transform by ChainPlugin (see examples below).

Also, you can use only those plugins which only manipulates contents property of vinyl file.
Applying of some plugins, like gulp-rename, does not make sense, because they do not affect contents, but others - path, dirname, etc.

API

function GulpPlugin(streamFactories: ((file: File) => stream.Transform)[])

Examples

const { GulpPlugin } = require('fusebox-gulp-plugin');
const g = require('gulp-load-plugins')();

Markdown

const plugins = [
    [
        /\.md$/,
        GulpPlugin([
            () => g.markdown(),
        ]),
        RawPlugin({ extensions: ['.md'] }),
    ]
];
var doc = require('./doc.md')

JSON5

const plugins = [
    {
        init: (k) => k.allowExtension('.json5')
    },
    [
        /\.json5$/,
        GulpPlugin([
            () => g.json5(),
        ]),
        JSONPlugin({}),
    ]
];
const data = require('./data.json5');

DEBUG

inspect node_modules/ava/profile.js lib/index.spec.js

fusebox-gulp-plugin's People

Contributors

greenkeeper[bot] avatar unlight avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fusebox-gulp-plugin's Issues

An in-range update of mocha is breaking the build 🚨

Version 3.3.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details - ❌ **continuous-integration/codeship** Build failed [Details](https://app.codeship.com/projects/199199/builds/24561337)

Release Notes coverave

Thanks to all our contributors, maintainers, sponsors, and users! ❀️

As highlights:

  • We've got coverage now!
  • Testing is looking less flaky \o/.
  • No more nitpicking about "mocha.js" build on PRs.

πŸŽ‰ Enhancements

  • #2659: Adds support for loading reporter from an absolute or relative path (@sul4bh)
  • #2769: Support --inspect-brk on command-line (@igwejk)

πŸ› Fixes

  • #2662: Replace unicode chars w/ hex codes in HTML reporter (@rotemdan)

πŸ” Coverage

πŸ”© Other

Commits

The new version differs by 89 commits0.

  • fb1687e :ship: Release v3.3.0
  • 1943e02 Add Changelog for v3.3.0
  • 861e968 Refactor literal play-icon hex code to a var
  • 1d3c5bc Fix typo in karma.conf.js
  • 9bd9389 Fix spec paths in test HTML files
  • 0a93024 Adds tests for loading reporters w/ relative/absolute paths (#2773)
  • 73929ad Comment special treatment of '+' in URL query parsing
  • e2c9514 Merge pull request #2769 from igwejk/support_inspect_break_in_opts
  • 038c636 Support --inspect-brk on command-line
  • b4ebabd Merge pull request #2727 from lamby/reproducible-build
  • 882347b Please make the build reproducible.
  • a2fc76c Merge pull request #2703 from seppevs/cover_utils_some_fn_with_tests
  • ed61cd0 cover .some() function in utils.js with tests
  • f42cbf4 Merge pull request #2701 from craigtaub/landingSpec
  • 6065242 use stubbed symbol

There are 89 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

TypeError: stream.on is not a function

Hi,

I try to use https://github.com/thomas-darling/gulp-translate like this:

const fuse = FuseBox.init({
  homeDir: "app",
  output: "bin-assets/scripts/$name.js",
  plugins: [
    GulpPlugin([
      (file) => {
        if (file.relativePath.substr(-4) !== 'html') {
          return;
        }
        return g.translate(translatePluginConfig).import({
          missingContentHandling: 'warn',
          importFilePath: `languages/import/kapilendo.de-DE.translation.json`
        });
      }
    ]),
    HTMLPlugin()
  ]
});

... and get following error message after the last html file:

TypeError: Cannot read property 'on' of null
    at destroyer (D:\project\node_modules\pump\index.js:24:9)
    at D:\project\node_modules\pump\index.js:68:12
    at Array.map (native)
    at pump (D:\project\node_modules\pump\index.js:65:26)
    at Pumpify.setPipeline (D:\project\node_modules\pumpify\index.js:39:5)
    at new Pumpify (D:\project\node_modules\pumpify\index.js:15:30)
    at Function.Pumpify [as obj] (D:\project\node_modules\pumpify\index.js:13:44)
    at FuseBoxGulpPlugin.transform (D:\project\node_modules\fusebox-gulp-plugin\lib\index.js:25:32)
    at tasks.push (D:\project\node_modules\fuse-box\dist\commonjs\core\File.js:128:59)
    at context.queue.realm_utils_1.each.promise (D:\project\node_modules\fuse-box\dist\commonjs\core\File.js:132:76)

An in-range update of fuse-box is breaking the build 🚨

Version 1.3.130 of fuse-box just got published.

Branch Build failing 🚨
Dependency fuse-box
Current Version 1.3.129
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As fuse-box is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/codeship Build failed Details
Commits

The new version differs by 2 commits .

  • 4331ba1 Release 1.3.130
  • 9506950 little tweak for __generator.js for IE9/10/11 (#448)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

Version 7.0.13 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 7.0.12
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/node is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/codeship Build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.