Comparing version 0.2.1-alpha.1 to 0.2.2-alpha.0
@@ -29,2 +29,3 @@ #!/usr/bin/env node | ||
sharedFolderClient_1.setWebSocket(ws); | ||
sharedFolderClient_1.setupNotifications(program.sharedFolder); | ||
sharedFolderClient_1.sharedFolder(program.sharedFolder, program.readOnly || false); | ||
@@ -31,0 +32,0 @@ }); |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var remixdClient_1 = require("./services/remixdClient"); | ||
var websocket_1 = require("./websocket"); | ||
var utils = require("./utils"); | ||
module.exports = { | ||
Router: require('./router'), | ||
utils: require('./utils'), | ||
Websocket: websocket_1.default, | ||
utils: utils, | ||
services: { | ||
sharedFolder: require('./services/sharedFolder') | ||
sharedFolder: remixdClient_1.RemixdClient | ||
} | ||
}; |
@@ -21,2 +21,3 @@ import { PluginClient } from '@remixproject/plugin'; | ||
isFile(args: SharedFolderArgs): boolean; | ||
setupNotifications(path: string): void; | ||
} |
@@ -19,4 +19,5 @@ "use strict"; | ||
var utils = require("../utils"); | ||
var chokidar = require("chokidar"); | ||
var fs = require("fs-extra"); | ||
var isbinaryfile = require('isbinaryfile'); | ||
var fs = require('fs-extra'); | ||
var RemixdClient = /** @class */ (function (_super) { | ||
@@ -214,2 +215,35 @@ __extends(RemixdClient, _super); | ||
}; | ||
RemixdClient.prototype.setupNotifications = function (path) { | ||
var _this = this; | ||
var absPath = utils.absolutePath('./', path); | ||
if (!isRealPath(absPath)) | ||
return; | ||
var watcher = chokidar.watch(path, { depth: 0, ignorePermissionErrors: true }); | ||
console.log('setup notifications for ' + path); | ||
/* we can't listen on created file / folder | ||
watcher.on('add', (f, stat) => { | ||
isbinaryfile(f, (error, isBinary) => { | ||
if (error) console.log(error) | ||
console.log('add', f) | ||
this.emit('created', { path: utils.relativePath(f, this.currentSharedFolder), isReadOnly: isBinary, isFolder: false }) | ||
}) | ||
}) | ||
watcher.on('addDir', (f, stat) => { | ||
this.emit('created', { path: utils.relativePath(f, this.currentSharedFolder), isReadOnly: false, isFolder: true }) | ||
}) | ||
*/ | ||
watcher.on('change', function (f) { | ||
if (_this.trackDownStreamUpdate[f]) { | ||
delete _this.trackDownStreamUpdate[f]; | ||
return; | ||
} | ||
_this.emit('changed', utils.relativePath(f, _this.currentSharedFolder)); | ||
}); | ||
watcher.on('unlink', function (f) { | ||
_this.emit('removed', utils.relativePath(f, _this.currentSharedFolder), false); | ||
}); | ||
watcher.on('unlinkDir', function (f) { | ||
_this.emit('removed', utils.relativePath(f, _this.currentSharedFolder), true); | ||
}); | ||
}; | ||
return RemixdClient; | ||
@@ -216,0 +250,0 @@ }(plugin_1.PluginClient)); |
{ | ||
"name": "remixd", | ||
"version": "0.2.1-alpha.1", | ||
"version": "0.2.2-alpha.0", | ||
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", | ||
@@ -14,3 +14,3 @@ "main": "./lib/src/index.js", | ||
"npip": "npip", | ||
"lint": "eslint ./src --ext .ts", | ||
"lint": "eslint ./src ./bin --ext .ts", | ||
"build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js", | ||
@@ -38,8 +38,7 @@ "dev": "nodemon" | ||
"@remixproject/plugin-ws": "0.3.0-alpha.1", | ||
"chalk": "^4.0.0", | ||
"chokidar": "^2.0.2", | ||
"commander": "^2.20.3", | ||
"fs-extra": "^3.0.1", | ||
"isbinaryfile": "^3.0.2", | ||
"ws": "^7.3.0" | ||
"ws": "^7.3.0", | ||
"chokidar": "^2.1.8", | ||
"fs-extra": "^3.0.1" | ||
}, | ||
@@ -53,2 +52,3 @@ "python": { | ||
"devDependencies": { | ||
"@types/fs-extra": "^9.0.1", | ||
"@types/node": "^14.0.5", | ||
@@ -55,0 +55,0 @@ "@types/ws": "^7.2.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25127
7
545
14
- Removedchalk@^4.0.0
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
Updatedchokidar@^2.1.8