From d0cf64491cdadd0485e5c264147fd8d4df0996e6 Mon Sep 17 00:00:00 2001 From: David Disu Date: Wed, 1 Dec 2021 21:01:05 +0100 Subject: [PATCH 1/2] Update entry point for remixd and update origins path --- libs/remixd/package.json | 10 +++++----- libs/remixd/src/bin/remixd.ts | 4 ++-- libs/remixd/src/websocket.ts | 2 +- package.json | 2 +- workspace.json | 10 ---------- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/libs/remixd/package.json b/libs/remixd/package.json index d8bb400a29..65d8286de7 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -1,18 +1,18 @@ { "name": "@remix-project/remixd", - "version": "0.5.3", + "version": "0.5.4", "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" + "remixd": "./src/bin/remixd.js" }, "scripts": { "test": "echo \"Error: no test specified\"", - "start": "./bin/remixd.js", + "start": "./src/bin/remixd.js", "npip": "npip", - "lint": "eslint ./src ./bin --ext .ts", - "build": "tsc -p ./ && chmod +x ./bin/remixd.js", + "lint": "eslint ./src --ext .ts", + "build": "tsc -p ./ && chmod +x ./src/bin/remixd.js", "dev": "nodemon" }, "publishConfig": { diff --git a/libs/remixd/src/bin/remixd.ts b/libs/remixd/src/bin/remixd.ts index 52d2b32629..8440ae0ce7 100644 --- a/libs/remixd/src/bin/remixd.ts +++ b/libs/remixd/src/bin/remixd.ts @@ -151,7 +151,7 @@ function errorHandler (error: any, service: string) { const { data } = (await Axios.get(gistUrl)) as { data: any } try { - await writeJSON(path.resolve(path.join(__dirname, '..', 'origins.json')), { data }) + await writeJSON(path.resolve(path.join(__dirname, '../..', 'origins.json')), { data }) } catch (e) { console.error(e) } @@ -161,7 +161,7 @@ function errorHandler (error: any, service: string) { } catch (e) { try { // eslint-disable-next-line - const origins = require('../origins.json') + const origins = require('../../origins.json') const { data } = origins return data.includes(origin) ? data.includes(origin) : data.includes(domain) diff --git a/libs/remixd/src/websocket.ts b/libs/remixd/src/websocket.ts index 324fa3332b..84a0edb7f8 100644 --- a/libs/remixd/src/websocket.ts +++ b/libs/remixd/src/websocket.ts @@ -66,7 +66,7 @@ function originIsAllowed (origin: string, self: WebSocket): boolean { } else { try { // eslint-disable-next-line - const origins = require('./origins.json') + const origins = require('../origins.json') const domain = getDomain(origin) const { data } = origins diff --git a/package.json b/package.json index edc28b9d12..6cad3d53df 100644 --- a/package.json +++ b/package.json @@ -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_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", - "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-install": "selenium-standalone install", "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js", diff --git a/workspace.json b/workspace.json index cbf1e710f2..217c170d9d 100644 --- a/workspace.json +++ b/workspace.json @@ -456,16 +456,6 @@ "main": "libs/remixd/src/index.ts", "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;" - } - ] - } } } }, From 25bd666a07e1c53d05b4fab7cd6f332b7d937204 Mon Sep 17 00:00:00 2001 From: David Disu Date: Wed, 1 Dec 2021 21:03:34 +0100 Subject: [PATCH 2/2] Bump and publish remixd --- libs/remixd/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 65d8286de7..40c83f345f 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remixd", - "version": "0.5.4", + "version": "0.5.5", "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",