Setup build and serve commands

pull/454/head
ioedeveloper 4 years ago
parent 95855a12d3
commit d9526c5b04
  1. 3
      .env
  2. 10
      libs/remixd/package.json
  3. 6
      libs/remixd/src/bin/remixd.ts
  4. 0
      libs/remixd/src/origins.json
  5. 2
      libs/remixd/src/websocket.ts
  6. 43150
      package-lock.json
  7. 6
      tsconfig.json
  8. 12
      workspace.json

@ -1,3 +1,4 @@
gist_token=<token> gist_token=<token>
account_passphrase=<passphrase> account_passphrase=<passphrase>
account_password=<password> account_password=<password>
NODE_OPTIONS=--max-old-space-size=2048

@ -2,17 +2,17 @@
"name": "remixd", "name": "remixd",
"version": "0.2.4-alpha.0", "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)", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "./lib/src/index.js", "main": "./index.js",
"types": "./lib/src/index.d.ts", "types": "./index.d.ts",
"bin": { "bin": {
"remixd": "./lib/bin/remixd.js" "remixd": "./bin/remixd.js"
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\"", "test": "echo \"Error: no test specified\"",
"start": "./lib/bin/remixd.js", "start": "./bin/remixd.js",
"npip": "npip", "npip": "npip",
"lint": "eslint ./src ./bin --ext .ts", "lint": "eslint ./src ./bin --ext .ts",
"build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js", "build": "tsc -p ./ && chmod +x ./bin/remixd.js",
"dev": "nodemon" "dev": "nodemon"
}, },
"repository": { "repository": {

@ -50,6 +50,8 @@ import * as program from 'commander'
} catch(error) { } catch(error) {
throw new Error(error) throw new Error(error)
} }
} else {
console.log('\x1b[31m%s\x1b[0m', '[ERR] No valid shared folder provided.')
} }
// kill // kill
@ -76,7 +78,7 @@ import * as program from 'commander'
const { data } = await Axios.get(gistUrl) const { data } = await Axios.get(gistUrl)
try { try {
await fs.writeJSON(path.resolve(__dirname + '/origins.json'), { data }) await fs.writeJSON(path.resolve(__dirname + '/../origins.json'), { data })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
@ -85,7 +87,7 @@ import * as program from 'commander'
} 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)

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

43150
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -23,10 +23,8 @@
"@remix-project/remix-simulator": ["dist/libs/remix-simulator/index.js"], "@remix-project/remix-simulator": ["dist/libs/remix-simulator/index.js"],
"@remix-project/remix-solidity": ["dist/libs/remix-solidity/index.js"], "@remix-project/remix-solidity": ["dist/libs/remix-solidity/index.js"],
"@remix-project/remix-tests": ["dist/libs/remix-tests/src/index.js"], "@remix-project/remix-tests": ["dist/libs/remix-tests/src/index.js"],
"@remix-project/remix-url-resolver": [ "@remix-project/remix-url-resolver": ["dist/libs/remix-url-resolver/index.js"],
"dist/libs/remix-url-resolver/index.js" "@remix-project/remixd": ["dist/libs/remixd/index.js"]
],
"@remix-project/remixd": ["libs/remixd/src/index.ts"]
} }
}, },
"exclude": ["node_modules", "tmp"] "exclude": ["node_modules", "tmp"]

@ -495,7 +495,17 @@
"tsConfig": "libs/remixd/tsconfig.lib.json", "tsConfig": "libs/remixd/tsconfig.lib.json",
"packageJson": "libs/remixd/package.json", "packageJson": "libs/remixd/package.json",
"main": "libs/remixd/src/index.ts", "main": "libs/remixd/src/index.ts",
"assets": ["libs/remixd/*.md"] "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/bin/remixd.js; dist/libs/remixd/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