-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Move Remixd To Monorepo #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
244 commits
Select commit
Hold shift + click to select a range
597bdda
add package.json
yann300 4f38c81
websocket + router + filesytem_service
yann300 1e7dec2
version
yann300 b5a333e
fix help
yann300 d64aa20
change repo url scheme
yann300 39d2294
console.log
yann300 95a8402
version
yann300 a9d193c
loopback
yann300 e9c1759
warn message
yann300 89bb8da
do not forward symbolic link
yann300 7118fec
version
yann300 1c9ace3
readme
yann300 4b231d0
add more functionnalities:
yann300 1f4ca7b
standard
yann300 40ebee6
remove local path
yann300 8c8f8e3
close listening to 65520
yann300 2bb8af1
options to open rpc server
yann300 8719ce8
Merge pull request #9 from ethereum/startnode
yann300 095bbbf
add resolveDirectory
yann300 4cbe4c1
change sharedfolder `get` return value
yann300 4419de2
Merge pull request #11 from ethereum/startnode
yann300 71eeccb
add exists
yann300 6e8a374
Merge pull request #12 from ethereum/startnode
yann300 331d80f
move stdout to dependencies
yann300 737be30
Merge pull request #13 from ethereum/startnode
yann300 8d3535c
Move serve and web3 to dependencies
yann300 35d08d5
Merge pull request #14 from ethereum/startnode
yann300 59a978d
Update package.json
yann300 9afa147
fis rename
yann300 18f43db
Merge pull request #17 from ethereum/fixRename
yann300 ae2fa15
check if file already exist
yann300 78de88f
Merge pull request #18 from ethereum/fixSharedFolderSetFile
yann300 67fc597
bump version & add desc
yann300 bb49089
Merge pull request #19 from ethereum/version013
yann300 a761f32
Update README.md
yann300 433c76c
Update main.js
yann300 e11cd15
Merge pull request #21 from ethereum/yann300-patch-2
yann300 7fb0d12
Update README.md
yann300 54a6e7b
Merge pull request #20 from ethereum/yann300-patch-1
yann300 db31196
Update README.md
yann300 f01bc34
version 0.1.4
yann300 3ce3197
Merge pull request #22 from ethereum/version014
yann300 c950c2a
check file existing
yann300 b533d23
wrap call with try catch
yann300 cc10dee
Merge pull request #24 from ethereum/feedback
yann300 e955474
bump versioin
yann300 b799d60
Merge pull request #25 from ethereum/bumpVersion015
yann300 9f5118c
Update README.md
yann300 9e2d4f2
Merge pull request #26 from ethereum/yann300-patch-3
yann300 c0f15b7
Fix typo
tanevanwifferen 4896738
Merge pull request #28 from tanevanwifferen/patch-1
yann300 b6dd52e
fix web3 version
yann300 8f98313
Merge pull request #29 from ethereum/fixWeb3Bug
yann300 5c57387
add personal mode to test node
yann300 da5193d
Merge pull request #30 from ethereum/fixWeb3Bug
yann300 ce5b07b
Fix README.md typos
faustogut 8e95ed4
used web3 version
yann300 fbc9175
Merge pull request #34 from ethereum/yann300-patch-1
yann300 2400828
update web3
yann300 abea260
update web3 && add lerna dep
yann300 6fa383f
add binary && index.js
yann300 ae26732
standard
yann300 eafcb82
add bin declaration
yann300 252f235
Merge pull request #35 from ethereum/addAPI
yann300 a584d3e
make remixd binary
yann300 ade0e9d
bump version
yann300 923864a
Merge pull request #36 from ethereum/addAPI
yann300 0c994d2
fix typo
yann300 4e3104e
add util to index.js
yann300 c40d7d5
Merge pull request #37 from ethereum/addAPI
yann300 0dd443b
use chokidar for notification
yann300 97e53d7
Merge pull request #38 from ethereum/changeNotifierLib
yann300 1cfeec7
use tagged version of web3
yann300 45b8ca4
Merge pull request #43 from ethereum/changeNotifierLib
yann300 48681a8
use binary
yann300 7e61c9b
comment listening 'add', 'addDir'
yann300 014271d
fix get return value if readonly
yann300 b522bcc
don't overwrite content with junk
yann300 a75754e
bump version
yann300 c9bea2d
Merge pull request #44 from ethereum/changeNotifierLib
yann300 c694ce4
refactor router to open multiple ones
yann300 7711dec
remove package-lock.json
yann300 2dce934
Merge pull request #50 from ethereum/refactorRemixd
yann300 ea85668
bump version
yann300 a0823a3
Merge pull request #51 from ethereum/refactorRemixd
yann300 40c8a8b
add --read-only flag which prevents all writes
tjanson 7ed178b
move usage example into --help text
tjanson 6c63bc3
do not always output the help text
tjanson 2ea09a9
Merge pull request #54 from tjanson/help-example
yann300 8b0eeb7
Merge pull request #53 from tjanson/read-only-mode
yann300 23b0e3f
reqiure to specify the remix IDE instance to connect to
yann300 8dc3993
Merge pull request #55 from ethereum/requireToSpecifyRemixIDEInstance
yann300 8abe312
Update package.json
yann300 21f9fe0
Merge pull request #56 from ethereum/yann300-patch-1
yann300 4b216ea
Update package.json
yann300 e1cd972
add folderIsReadOnly
yann300 02c8466
Merge pull request #57 from ethereum/AddfolderIsReadOnly
yann300 c6a60bb
Update startFrontend.js
yann300 0111fbd
vyper compiler
yann300 7853663
Update vyper.js
yann300 10e9d27
Update vyper.js
yann300 3612a88
Merge pull request #58 from ethereum/vyperPackaging
yann300 885e423
Merge pull request #32 from faustogut/fix-readme-typos
yann300 0bd1b40
Update package.json
yann300 24f3e29
Merge pull request #61 from ethereum/yann300-patch-3
yann300 45d9e9e
Two-way connection, English correction
fulldecent 4c8fea7
two-way
fulldecent 05ca2b0
Merge pull request #62 from fulldecent/patch-1
yann300 bae3873
bump
yann300 1a9ec32
Merge pull request #63 from ethereum/bump
yann300 6af4735
Update README.md
LianaHus 0c98399
Merge pull request #66 from LianaHus/patch-1
yann300 47ede42
Update remixd
yann300 8a2a303
Update README.md
yann300 b204da5
Update README.md
LianaHus 8a68ebf
Update README.md
LianaHus 5a480a0
Merge pull request #67 from ethereum/yann300-patch-4
yann300 00d4010
Update README.md
yann300 fbfe18d
Merge pull request #69 from ethereum/yann300-patch-5
yann300 69d89a7
Fix Symbolinc links -> Symbolic links
Alonski 59a5149
set max size
yann300 4c7c1cf
Merge pull request #80 from ethereum/yann300-patch-6
yann300 3fe9439
bump version
yann300 d15e205
Merge pull request #81 from ethereum/bumpVersion
yann300 aa7d4a2
warn that the sharedFolder changed
yann300 2596169
Merge pull request #82 from ethereum/yann300-patch-7
yann300 30bbfdc
make sure websocket is defined
yann300 bcfddea
fix(websocket): [connection] Ensure WebSocket Connection Not Null
47c781d
Merge pull request #85 from danforbes/fix/websocket/connection
yann300 f781cff
remove deprecated options
yann300 3a255fb
fix set folder / files
yann300 420392a
Merge pull request #87 from ethereum/fix_adding_removing_folder
yann300 f3c5654
bump
yann300 e6c71df
Merge pull request #88 from ethereum/bumpVersion1
yann300 b4db7e1
typo: rename shareFolder => currentSharedFolder
yann300 fea3c68
Merge pull request #89 from ethereum/yann300-patch-8
yann300 e8e77d9
bump version
yann300 90ee236
Merge pull request #90 from ethereum/bumpVersio
yann300 eb3d850
Merge pull request #70 from Alonski/patch-1
LianaHus daea355
Added isFile and isDirectory to sharedFolder api
ioedeveloper fbe6ba6
Added circleci config and eslint
ioedeveloper 70bf7c3
Remove old dependencies
ioedeveloper 520c6bf
Merge pull request #102 from ethereum/filemanager-api
yann300 1140864
Return true on file/directory remove success
ioedeveloper ace74ef
Return callback with error on fail
ioedeveloper a981a19
bump version
yann300 a0b8438
Merge pull request #105 from ethereum/yann300-patch-9
yann300 9e1eff9
Merge pull request #104 from ethereum/filemanager-api
yann300 49ee3ed
bump version
yann300 db4e5cd
Merge pull request #106 from ethereum/bumpVersion.16
yann300 6ccf999
Changed sharedFolder into ES6 class
ioedeveloper ea9783d
Setup typescript for remixd
ioedeveloper 1780f57
Changed codebase to typescript
ioedeveloper 30e3d7f
Make file executable
ioedeveloper aaae27f
Setup plugin client
ioedeveloper 9113c83
Kill server process
ioedeveloper 8b4cc0c
Untracked files issue resolved to fix .gitignore
ioedeveloper 44855af
Ignore libs
ioedeveloper 3102f2e
Expose methods
ioedeveloper 9e95d6b
Modified app bootstrap and types
ioedeveloper fc08022
Made sharedFolder generic and fix broken changes
ioedeveloper c9203f5
Modified exposed apis
ioedeveloper 473c9e8
Clean up exposed methods and added return types
ioedeveloper 5b7f9a2
list and isDirectory methods
ioedeveloper 7dc8360
Fixed linting error
ioedeveloper dc91150
Removed flags from start command
ioedeveloper cbb8e6f
Merge pull request #109 from ethereum/remixd-websocket
yann300 f1ef62b
publish lib folder
yann300 80ab352
Merge pull request #111 from ethereum/publish_lib_folder
yann300 ec9c474
Emit folder added event from plugin
ioedeveloper 0354e21
Trigger fileAdded, fileChanged and fileRemoved event
ioedeveloper 3c965c9
Emit fileRenamed event
ioedeveloper 80c800e
Set start command
ioedeveloper 1a17fbd
Merge pull request #112 from ethereum/remixd-websocket
yann300 0966a57
bump version
ioedeveloper 9bcc15c
Ignore types dir
ioedeveloper a229bc4
Modified bumped version
ioedeveloper 9116649
Merge pull request #113 from ethereum/remixd-websocket
ioedeveloper 85eaa9c
Set specific versions for @remixproject dependencies
ioedeveloper e376b2e
bump version
ioedeveloper 853e4a2
Merge pull request #114 from ethereum/remixd-websocket
ioedeveloper 202198a
Restored setupNotifications for remixd
ioedeveloper 1502cd9
Modify emitted event parameters
ioedeveloper ed177e8
Check if notification absolute path exists
ioedeveloper 91e2f23
Expose websocket and shared folder api for external services
ioedeveloper 5c74bc3
Merge pull request #115 from ethereum/remixd-websocket
yann300 3f2917d
bump remixd version
ioedeveloper 1c92105
Merge pull request #116 from ethereum/remixd-websocket
ioedeveloper a8bb29b
log and continue instead of throwing
yann300 b40a8ef
Merge pull request #117 from ethereum/dontThrowError
yann300 d96d7db
Bump remixd version
ioedeveloper b891595
Merge pull request #118 from ethereum/bump-remixd
ioedeveloper 5273f51
Bump remixd version
ioedeveloper 9538073
Merge pull request #119 from ethereum/bump-remixd
ioedeveloper 4f97b99
bump remix-plugin version
yann300 b32ee39
Merge pull request #121 from ethereum/bumpVersion-remixplugin
yann300 d1936c6
use 0.3.0-beta.5 remix-plugin
yann300 4aa3125
Merge pull request #125 from ethereum/latestRemixPlugin
ioedeveloper 1b46e80
Bump version to 0.2.3-alpha.5
ioedeveloper e7e938a
Merge pull request #126 from ethereum/bump-version
ioedeveloper fc573bf
Revert "Bump version to 0.2.3-alpha.5"
yann300 17143af
Merge pull request #127 from ethereum/revert-126-bump-version
yann300 dec0a7e
Bump version to 0.2.3-alpha.5
ioedeveloper 1e69ffb
Merge pull request #128 from ethereum/bump-version
ioedeveloper 0b4ecb3
Added tslib dependency
ioedeveloper 632d9cd
Merge pull request #129 from ethereum/bump-version
ioedeveloper 077223a
bump remixd version 0.2.3-alpha.6
ioedeveloper bee4b88
Merge pull request #130 from ethereum/bump-version
ioedeveloper a342b78
Moved tslib from dev dependency to main dependency
ioedeveloper 9b3f6f5
Merge pull request #131 from ethereum/bump-version
ioedeveloper adab5a7
Bump remixd version
ioedeveloper d7de137
Merge pull request #132 from ethereum/bump-version
ioedeveloper 59d88b4
Update plugin-ws version
ioedeveloper 4da76d5
Merge pull request #133 from ethereum/bump-version
ioedeveloper 9a5c0c9
Display warning for unsupported origins
ioedeveloper 907d3c5
Remove console logs
ioedeveloper 1d277cf
Specify gist url and removed additional start command in package.json
ioedeveloper 681de1d
Ensure origin is provided before checking if origin is valid
ioedeveloper 456283e
Added comments for unsupported origins
ioedeveloper 4341f0a
Included local origins.json
ioedeveloper 051808f
Made --remix-ide flag optional
ioedeveloper cfd5e78
Merge pull request #134 from ethereum/fix-origin
ioedeveloper 08df378
Bump remixd version
ioedeveloper d050861
Merge pull request #136 from ethereum/fix-origin
ioedeveloper 7f28e46
Initial commit
ioedeveloper daedd1d
Merge remote-tracking branch 'remixd/master'
ioedeveloper 5edb5fd
Moved remixd into libs directory
ioedeveloper aa88a3e
Merged remixd into remix-project
ioedeveloper f304be0
Setup remixd build
ioedeveloper cd470fa
Exclude node_modules from linting
ioedeveloper 68b8e21
Use scaffolded template for remixd
ioedeveloper 1c7637c
Merge branch 'master' of https://github.com/ethereum/remix-project in…
ioedeveloper 95855a1
Fix failing linting
ioedeveloper 2b419e4
typo
Aniket-Engg d9526c5
Setup build and serve commands
ioedeveloper 53342f2
Merge branch 'remixd' of https://github.com/ethereum/remix-project in…
ioedeveloper 3cc58f5
Changed remixd command in circleci
ioedeveloper fa578e7
Modified shared folder command
ioedeveloper 2929b70
Use npm run remixd command
ioedeveloper 4239318
Removed setup remixd function
ioedeveloper 55ce0df
Specify full path of shared folder
ioedeveloper 7619a0a
Format path
ioedeveloper 2362fda
Updated urls and package name
ioedeveloper c027b39
Merge branch 'master' of https://github.com/ethereum/remix-project in…
ioedeveloper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| gist_token=<token> | ||
| account_passphrase=<passphrase> | ||
| account_password=<password> | ||
| account_password=<password> | ||
| NODE_OPTIONS=--max-old-space-size=2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| { | ||
| "extends": "../../.eslintrc", | ||
| "rules": { | ||
| "@typescript-eslint/no-explicit-any": "off" | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/prefer-namespace-keyword": "off" | ||
| }, | ||
| "ignorePatterns": ["!**/*"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule remixd
deleted from
1a9ec3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Remixd | ||
|
|
||
| `remixd` is a tool that intend to be used with [Remix IDE](https://github.com/ethereum/remix-project) (aka. Browser-Solidity). It allows a websocket connection between | ||
| `Remix IDE` (web application) and the local computer. | ||
|
|
||
| Practically Remix IDE makes available a folder shared by `remixd`. | ||
|
|
||
| More details are explained in this [tutorial](https://remix-ide.readthedocs.io/en/latest/remixd.html). | ||
|
|
||
| Alternatively `remixd` can be used to setup a development environment that can be used with other popular frameworks like Embark, Truffle, Ganache, etc.. | ||
|
|
||
| `remixd` needs `npm` and `node` | ||
|
|
||
| ## INSTALLATION | ||
|
|
||
| `npm install -g @remix-project/remixd` | ||
|
|
||
| ## HELP SECTION | ||
|
|
||
| ``` | ||
| Usage: remixd -s <shared folder> --remix-ide https://remix.ethereum.org | ||
|
|
||
| Provide a two-way connection between the local computer and Remix IDE. | ||
|
|
||
|
|
||
| Options: | ||
|
|
||
| --remix-ide <url> URL of remix instance allowed to connect to this | ||
| web sockect connection | ||
| -s, --shared-folder <path> Folder to share with Remix IDE | ||
| --read-only Treat shared folder as read-only (experimental) | ||
| -h, --help output usage information | ||
|
|
||
| ``` | ||
|
|
||
| ## SHARE A FOLDER | ||
|
|
||
| `remixd -s <absolute-path> --remix-ide https://remix.ethereum.org` | ||
|
|
||
| The current user should have `read/write` access to the folder (at least `read` access). | ||
|
|
||
| It is important to notice that changes made to the current file in `Remix IDE` are automatically saved to the local computer every 5000 ms. There is no `Save` action. But the `Ctrl-Z` (undo) can be used. | ||
|
|
||
| Furthermore : | ||
| - No copy of the shared folder are kept in the browser storage. | ||
| - It is not possible to create a file from `Remix IDE` (that might change). | ||
| - If a folder does not contain any file, the folder will not be displayed in the explorer (that might change). | ||
| - Symbolic links are not forwarded to Remix IDE. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* eslint-disable */ | ||
| module.exports = { | ||
| name: 'remixd', | ||
| preset: '../../jest.config.js', | ||
| globals: { | ||
| 'ts-jest': { | ||
| tsConfig: '<rootDir>/tsconfig.spec.json' | ||
| } | ||
| }, | ||
| transform: { | ||
| '^.+\\.[tj]sx?$': 'ts-jest' | ||
| }, | ||
| moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], | ||
| coverageDirectory: '../../coverage/libs/remixd' | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "watch": ["./src", "./bin"], | ||
| "ext": "ts", | ||
| "exec": "npm run build && npm run start" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| { | ||
| "name": "@remix-project/remixd", | ||
| "version": "0.2.4-alpha.0", | ||
| "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", | ||
| "main": "./index.js", | ||
| "types": "./index.d.ts", | ||
| "bin": { | ||
| "remixd": "./bin/remixd.js" | ||
| }, | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\"", | ||
| "start": "./bin/remixd.js", | ||
| "npip": "npip", | ||
| "lint": "eslint ./src ./bin --ext .ts", | ||
| "build": "tsc -p ./ && chmod +x ./bin/remixd.js", | ||
| "dev": "nodemon" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/ethereum/remix-project.git" | ||
| }, | ||
| "keywords": [ | ||
| "remix", | ||
| "ide", | ||
| "ethereum", | ||
| "solidity" | ||
| ], | ||
| "author": "Remix Team", | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://github.com/ethereum/remix-project/issues" | ||
| }, | ||
| "homepage": "https://github.com/ethereum/remix-project#readme", | ||
| "dependencies": { | ||
| "@remixproject/plugin": "0.3.0-beta.5", | ||
| "@remixproject/plugin-api": "0.3.0-beta.5", | ||
| "@remixproject/plugin-utils": "0.3.0-beta.5", | ||
| "@remixproject/plugin-ws": "^0.3.0-beta.8", | ||
| "axios": "^0.20.0", | ||
| "chokidar": "^2.1.8", | ||
| "commander": "^2.20.3", | ||
| "fs-extra": "^3.0.1", | ||
| "isbinaryfile": "^3.0.2", | ||
| "ws": "^7.3.0" | ||
| }, | ||
| "python": { | ||
| "execPath": "python3", | ||
| "dependencies": { | ||
| "vyper": ">=0.1.0b3" | ||
| } | ||
| }, | ||
| "devDependencies": { | ||
| "@types/axios": "^0.14.0", | ||
| "@types/fs-extra": "^9.0.1", | ||
| "@types/node": "^14.0.5", | ||
| "@types/ws": "^7.2.4", | ||
| "@typescript-eslint/eslint-plugin": "^3.2.0", | ||
| "@typescript-eslint/parser": "^3.2.0", | ||
| "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", | ||
| "nodemon": "^2.0.4", | ||
| "ts-node": "^8.10.1", | ||
| "typescript": "^3.9.3" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #!/usr/bin/env node | ||
| import WebSocket from '../websocket' | ||
| import * as servicesList from '../serviceList' | ||
| import * as WS from 'ws' | ||
| import { getDomain } from '../utils' | ||
| import Axios from 'axios' | ||
| import * as fs from 'fs-extra' | ||
| import * as path from 'path' | ||
| import * as program from 'commander' | ||
|
|
||
| (async () => { | ||
| program | ||
| .usage('-s <shared folder>') | ||
| .description('Provide a two-way connection between the local computer and Remix IDE') | ||
| .option('--remix-ide <url>', 'URL of remix instance allowed to connect to this web sockect connection') | ||
| .option('-s, --shared-folder <path>', 'Folder to share with Remix IDE') | ||
| .option('--read-only', 'Treat shared folder as read-only (experimental)') | ||
| .on('--help', function(){ | ||
| console.log('\nExample:\n\n remixd -s ./ --remix-ide http://localhost:8080') | ||
| }).parse(process.argv) | ||
| // eslint-disable-next-line | ||
| const killCallBack: Array<Function> = [] | ||
|
|
||
| if (!program.remixIde) { | ||
| console.log('\x1b[33m%s\x1b[0m', '[WARN] You can only connect to remixd from one of the supported origins.') | ||
| } else { | ||
| const isValid = await isValidOrigin(program.remixIde) | ||
| /* Allow unsupported origins and display warning. */ | ||
| if (!isValid) { | ||
| console.log('\x1b[33m%s\x1b[0m', '[WARN] You are using IDE from an unsupported origin.') | ||
| console.log('\x1b[33m%s\x1b[0m', 'Check https://gist.github.com/EthereumRemix/091ccc57986452bbb33f57abfb13d173 for list of all supported origins.\n') | ||
| // return | ||
| } | ||
| console.log('\x1b[33m%s\x1b[0m', '[WARN] You may now only use IDE at ' + program.remixIde + ' to connect to that instance') | ||
| } | ||
|
|
||
| if (program.sharedFolder) { | ||
| console.log('\x1b[33m%s\x1b[0m', '[WARN] Any application that runs on your computer can potentially read from and write to all files in the directory.') | ||
| console.log('\x1b[33m%s\x1b[0m', '[WARN] Symbolic links are not forwarded to Remix IDE\n') | ||
| try { | ||
| const sharedFolderClient = new servicesList['sharedfolder']() | ||
| const websocketHandler = new WebSocket(65520, { remixIdeUrl: program.remixIde }, sharedFolderClient) | ||
|
|
||
| websocketHandler.start((ws: WS) => { | ||
| sharedFolderClient.setWebSocket(ws) | ||
| sharedFolderClient.setupNotifications(program.sharedFolder) | ||
| sharedFolderClient.sharedFolder(program.sharedFolder, program.readOnly || false) | ||
| }) | ||
| killCallBack.push(websocketHandler.close.bind(websocketHandler)) | ||
| } catch(error) { | ||
| throw new Error(error) | ||
| } | ||
| } else { | ||
| console.log('\x1b[31m%s\x1b[0m', '[ERR] No valid shared folder provided.') | ||
| } | ||
|
|
||
| // kill | ||
| function kill () { | ||
| for (const k in killCallBack) { | ||
| try { | ||
| killCallBack[k]() | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| process.on('SIGINT', kill) // catch ctrl-c | ||
| process.on('SIGTERM', kill) // catch kill | ||
| process.on('exit', kill) | ||
|
|
||
| async function isValidOrigin (origin: string): Promise<any> { | ||
| if (!origin) return false | ||
| const domain = getDomain(origin) | ||
| const gistUrl = 'https://gist.githubusercontent.com/EthereumRemix/091ccc57986452bbb33f57abfb13d173/raw/3367e019335746b73288e3710af2922d4c8ef5a3/origins.json' | ||
|
|
||
| try { | ||
| const { data } = await Axios.get(gistUrl) | ||
|
|
||
| try { | ||
| await fs.writeJSON(path.resolve(__dirname + '/../origins.json'), { data }) | ||
| } catch (e) { | ||
| console.error(e) | ||
| } | ||
|
|
||
| return data.includes(origin) ? data.includes(origin) : data.includes(domain) | ||
| } catch (e) { | ||
| try { | ||
| // eslint-disable-next-line | ||
| const origins = require('../origins.json') | ||
| const { data } = origins | ||
|
|
||
| return data.includes(origin) ? data.includes(origin) : data.includes(domain) | ||
| } catch (e) { | ||
| return false | ||
| } | ||
| } | ||
| } | ||
| })() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| 'use strict' | ||
| import { RemixdClient as sharedFolder } from './services/remixdClient' | ||
| import Websocket from './websocket' | ||
| import * as utils from './utils' | ||
|
|
||
| module.exports = { | ||
| Websocket, | ||
| utils, | ||
| services: { | ||
| sharedFolder | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "data":[ | ||
| "http://remix-alpha.ethereum.org", | ||
| "http://remix.ethereum.org", | ||
| "https://remix-alpha.ethereum.org", | ||
| "https://remix.ethereum.org", | ||
| "package://a7df6d3c223593f3550b35e90d7b0b1f.mod", | ||
| "package://6fd22d6fe5549ad4c4d8fd3ca0b7816b.mod", | ||
| "https://ipfsgw.komputing.org" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { RemixdClient as sharedfolder } from './services/remixdClient' | ||
|
|
||
| export { sharedfolder } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be you can use
export { RemixdClient as sharedfolder } from './services/remixdClient'Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this. Making a change to this will break remix-desktop.