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

fis-command-release

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis-command-release - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

vendor/livereload.js

5

package.json
{
"name" : "fis-command-release",
"description" : "fis release command.",
"version" : "0.8.0",
"version" : "0.8.1",
"author" : "FIS Team <fis@baidu.com>",

@@ -20,5 +20,6 @@ "homepage" : "http://fis.baidu.com/",

"dependencies" : {
"chokidar" : "0.6.2"
"chokidar" : "0.6.2",
"livereload-server" : "0.2.3"
},
"devDependencies": {}
}

16

README.md

@@ -11,9 +11,13 @@ # fis-command-release

-d, --dest <names> release output destination
-r, --root <path> set project root
-w, --watch monitor the changes of project
-c, --clean clean cache before releasing
--md5 <level> md5 release option
--domain add domain
--lint with lint
--optimize with optimize
--pack with package
-L, --live automatically reload your browser
-c, --clean clean compile cache
-m, --md5 [level] md5 release option
-D, --domains add domain name
-l, --lint with lint
-t, --test with unit testing
-o, --optimize with optimizing
-p, --pack with package
-u, --unique use unique compile caching
--debug debug mode

@@ -19,2 +19,5 @@ /*

clearTimeout(timer);
if(LRServer){
clearTimeout(LRTimer);
}
timer = setTimeout(function(){

@@ -47,2 +50,3 @@ release(opt);

var LRServer, LRTimer;
var lastModified = {};

@@ -52,2 +56,20 @@ var collection = {};

function reload(){
fis.util.map(LRServer.connections, function(id, connection){
try {
connection.send({
command: 'reload',
path: '*',
liveCSS: true
});
process.stdout.write('\n Ψ'.bold.yellow + '35729');
} catch (e) {
try {
connection.close();
} catch (e) {}
delete LRServer.connections[id];
}
});
}
function release(opt){

@@ -100,2 +122,6 @@ var flag, cost, start = Date.now();

collection = {};
if(LRServer){
clearTimeout(LRTimer);
LRTimer = setTimeout(reload, 500);
}
return;

@@ -121,2 +147,3 @@ }

.option('-w, --watch', 'monitor the changes of project')
.option('-L, --live', 'automatically reload your browser')
.option('-c, --clean', 'clean compile cache', Boolean, false)

@@ -198,2 +225,27 @@ .option('-m, --md5 [level]', 'md5 release option', Number)

if(options.live){
var LiveReloadServer = require('livereload-server');
LRServer = new LiveReloadServer({
id: 'com.baidu.fis',
name: 'fis-reload',
version : fis.cli.info.version,
protocols: {
monitoring: 7
}
});
LRServer.on('livereload.js', function(req, res) {
var script = fis.util.read(__dirname + '/vendor/livereload.js');
res.writeHead(200, {'Content-Length': script.length, 'Content-Type': 'text/javascript'});
res.end(script);
});
LRServer.listen(function(err) {
if (err) {
err.message = 'LiveReload server Listening failed: ' + err.message;
fis.log.error(err);
}
process.stdout.write('\n Ψ'.bold.yellow + '35729');
});
delete options.live;
}
switch (typeof options.md5){

@@ -200,0 +252,0 @@ case 'undefined':

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