Merge pull request #102 from ethereum/filemanager-api

Added isFile and isDirectory to shared folder api
remixd
yann300 5 years ago committed by GitHub
commit 520c6bf043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      .circleci/config.yml
  2. 20
      .eslintrc.json
  3. 1253
      package-lock.json
  4. 13
      package.json
  5. 1
      src/router.js
  6. 15
      src/services/sharedFolder.js
  7. 2
      src/websocket.js

@ -0,0 +1,32 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
remixd:
docker:
# specify the version you desire here
- image: circleci/node:9.11.2
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "package.json"
working_directory: ~/remixd
steps:
- checkout
- run: npm install
- run: npm run lint
- run: npm run test
workflows:
version: 2
build_all:
jobs:
- remixd

@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": [
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"standard/no-callback-literal": 0
}
}

1253
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -7,11 +7,10 @@
"remixd": "./bin/remixd"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Error: no test specified\"",
"start": "./bin/remixd",
"npip": "npip",
"install-python-deps": "npip install",
"prepublish": "npm run install-python-deps"
"lint": "eslint ./src"
},
"repository": {
"type": "git",
@ -46,5 +45,13 @@
"dependencies": {
"vyper": ">=0.1.0b3"
}
},
"devDependencies": {
"eslint": "6.8.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1"
}
}

@ -7,6 +7,7 @@ class Router {
this.service = service
this.initCallback = initCallback
}
start () {
var websocket = new Websocket(this.port, this.opt)
this.websocket = websocket

@ -63,7 +63,8 @@ module.exports = {
},
exists: function (args, cb) {
var path = utils.absolutePath(args.path, this.currentSharedFolder)
const path = utils.absolutePath(args.path, this.currentSharedFolder)
cb(null, fs.existsSync(path))
},
@ -116,6 +117,18 @@ module.exports = {
})
},
isDirectory: function (args, cb) {
const path = utils.absolutePath(args.path, this.currentSharedFolder)
cb(null, fs.statSync(path).isDirectory())
},
isFile: function (args, cb) {
const path = utils.absolutePath(args.path, this.currentSharedFolder)
cb(null, fs.statSync(path).isFile())
},
setupNotifications: function (path) {
if (!isRealPath(path)) return
var watcher = chokidar.watch(path, { depth: 0, ignorePermissionErrors: true })

@ -24,7 +24,7 @@ class WebSocket {
httpServer: this.server,
autoAcceptConnections: false,
maxReceivedFrameSize: 131072,
maxReceivedMessageSize: 10 * 1024 * 1024,
maxReceivedMessageSize: 10 * 1024 * 1024
})
this.wsServer.on('request', (request) => {

Loading…
Cancel
Save