JanitorTechnology / c9.ide.janitorconfig

Plugin that reads a janitor.json file and sets up c9 accordingly
0 stars 2 forks source link

Support simplified `scripts` syntax like in NPM's package.json #2

Closed jankeromnes closed 7 years ago

jankeromnes commented 7 years ago

Instead of having to write:

{
  "scripts": {
    "node app": {
      "cmd": "node app"
    },
    "npm run watch": {
      "cmd": "npm run watch"
    },
    "npm run lint": {
      "cmd": "npm run lint"
    },
    "npm test": {
      "cmd": "npm test"
    },
    "Send to code review": {
      "cmd": "hub pull-request"
    }
  }
}

It would be nice to be able to simplify this as:

{
  "scripts": {
    "node app": "node app",
    "npm run watch": "npm run watch",
    "npm run lint": "npm run lint",
    "npm test": "npm test",
    "Send to code review": "hub pull-request"
  }
}
jankeromnes commented 7 years ago

Additionally, maybe we could specify a default proxy type for ports, so that we can simplify:

{
  "ports": {
    "22": {
      "label": "SSH",
      "proxy": "none"
    },
    "8080": {
      "label": "Preview",
      "proxy": "https"
    },
    "8088": {
      "label": "VNC",
      "proxy": "https"
    },
    "8089": {
      "label": "Cloud9",
      "proxy": "https"
    }
  },
}

to:

{
  "ports": {
    "22": {
      "label": "SSH",
      "proxy": "none"
    },
    "8080": "Preview",
    "8088": "VNC",
    "8089": "Cloud9"
  },
}

?

We could even say that by default, we expect ports SSH, VNC and Cloud9 to be 22, 8088 and 8089 respectively, if you don't explicitly specify them? Not sure.