Merge pull request #1821 from ethereum/fix-remixd

Fix Remixd Entry Point.
pull/1825/head
David Disu 3 years ago committed by GitHub
commit be779f2646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      libs/remixd/package.json
  2. 4
      libs/remixd/src/bin/remixd.ts
  3. 2
      libs/remixd/src/websocket.ts
  4. 2
      package.json
  5. 10
      workspace.json

@ -1,18 +1,18 @@
{ {
"name": "@remix-project/remixd", "name": "@remix-project/remixd",
"version": "0.5.3", "version": "0.5.5",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",
"bin": { "bin": {
"remixd": "./bin/remixd.js" "remixd": "./src/bin/remixd.js"
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\"", "test": "echo \"Error: no test specified\"",
"start": "./bin/remixd.js", "start": "./src/bin/remixd.js",
"npip": "npip", "npip": "npip",
"lint": "eslint ./src ./bin --ext .ts", "lint": "eslint ./src --ext .ts",
"build": "tsc -p ./ && chmod +x ./bin/remixd.js", "build": "tsc -p ./ && chmod +x ./src/bin/remixd.js",
"dev": "nodemon" "dev": "nodemon"
}, },
"publishConfig": { "publishConfig": {

@ -151,7 +151,7 @@ function errorHandler (error: any, service: string) {
const { data } = (await Axios.get(gistUrl)) as { data: any } const { data } = (await Axios.get(gistUrl)) as { data: any }
try { try {
await writeJSON(path.resolve(path.join(__dirname, '..', 'origins.json')), { data }) await writeJSON(path.resolve(path.join(__dirname, '../..', 'origins.json')), { data })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
@ -161,7 +161,7 @@ function errorHandler (error: any, service: string) {
} catch (e) { } catch (e) {
try { try {
// eslint-disable-next-line // eslint-disable-next-line
const origins = require('../origins.json') const origins = require('../../origins.json')
const { data } = origins const { data } = origins
return data.includes(origin) ? data.includes(origin) : data.includes(domain) return data.includes(origin) ? data.includes(origin) : data.includes(domain)

@ -66,7 +66,7 @@ function originIsAllowed (origin: string, self: WebSocket): boolean {
} else { } else {
try { try {
// eslint-disable-next-line // eslint-disable-next-line
const origins = require('./origins.json') const origins = require('../origins.json')
const domain = getDomain(origin) const domain = getDomain(origin)
const { data } = origins const { data } = origins

@ -95,7 +95,7 @@
"nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome", "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome",
"nightwatch_local_pluginApi": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api_*.js --env=chrome", "nightwatch_local_pluginApi": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api_*.js --env=chrome",
"onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint",
"remixd": "nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080", "remixd": "nx build remixd && chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js -s ./apps/remix-ide/contracts --remix-ide http://127.0.0.1:8080",
"selenium": "selenium-standalone start", "selenium": "selenium-standalone start",
"selenium-install": "selenium-standalone install", "selenium-install": "selenium-standalone install",
"sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js", "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js",

@ -456,16 +456,6 @@
"main": "libs/remixd/src/index.ts", "main": "libs/remixd/src/index.ts",
"assets": ["libs/remixd/*.md", "libs/remixd/src/origins.json"] "assets": ["libs/remixd/*.md", "libs/remixd/src/origins.json"]
} }
},
"serve": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "SERVE_SCRIPT='chmod +x dist/libs/remixd/src/bin/remixd.js; dist/libs/remixd/src/bin/remixd.js '; if [ {args.folder} != undefined ]; then SERVE_SCRIPT=${SERVE_SCRIPT}' -s {args.folder}'; fi; if [ {args.remixide} != undefined ]; then SERVE_SCRIPT=${SERVE_SCRIPT}' --remix-ide {args.remixide}'; fi; eval $SERVE_SCRIPT;"
}
]
}
} }
} }
}, },

Loading…
Cancel
Save