Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flow-status-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-status-webpack-plugin - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

29

index.js

@@ -1,3 +0,3 @@

const colors = require('colors');
const shell = require('shelljs');
const colors = require('colors'),
shell = require('shelljs');

@@ -9,12 +9,15 @@ function FlowStatusWebpackPlugin(options) {

FlowStatusWebpackPlugin.prototype.apply = function(compiler) {
const options = this.options;
const flowArgs = options.flowArgs || '';
const options = this.options,
flowArgs = options.flowArgs || '',
flow = options.binaryPath || 'flow';
var firstRun = true,
waitingForFlow = false;
function startFlow(cb) {
if (options.restartFlow === false) {
shell.exec('flow start ' + flowArgs, () => cb());
}
else {
shell.exec('flow stop', () => {
shell.exec('flow start ' + flowArgs, () => cb());
shell.exec(flow + ' start ' + flowArgs, () => cb());
} else {
shell.exec(flow + ' stop', () => {
shell.exec(flow + ' start ' + flowArgs, () => cb());
});

@@ -24,3 +27,2 @@ }

var firstRun = true;
function startFlowIfFirstRun(compiler, cb) {

@@ -36,8 +38,7 @@ if (firstRun) {

// restart flow if interfacesPath was provided regardless of whether webpack is in normal or watch mode
// restart flow if interfacesPath was provided regardless
// of whether webpack is in normal or watch mode
compiler.plugin('run', startFlowIfFirstRun);
compiler.plugin('watch-run', startFlowIfFirstRun);
var waitingForFlow = false;
function flowStatus() {

@@ -48,3 +49,3 @@ if (!waitingForFlow) {

// this will start a flow server if it was not running
shell.exec('flow status --color always', {silent: true}, (code, stdout, stderr) => {
shell.exec(flow + ' status --color always', {silent: true}, (code, stdout, stderr) => {
const hasErrors = code !== 0;

@@ -51,0 +52,0 @@

{
"name": "flow-status-webpack-plugin",
"version": "0.1.2",
"version": "0.1.3",
"author": "Diego Durli <dgodurli@gmail> (https://github.com/diegodurli)",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -74,5 +74,19 @@ Flow Status Webpack Plugin

If provided a binary path, will run Flow from this path instead of running it from any global installation.
```js
var FlowStatusWebpackPlugin = require('flow-status-webpack-plugin');
module.exports = {
...
plugins: [
new FlowStatusWebpackPlugin({
binaryPath: '/path/to/your/flow/installation'
})
]
}
```
License
-------
This plugin is released under the [MIT License](https://opensource.org/licenses/MIT).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc