Browse Source

Bump version to v.0.1.0

- Added comments.
- Removed validating OS and nginx to separate module.
- Updated Roadmap.MD
- Added Contributing.MD
pull/1/head
Muthu Kumar 7 years ago
parent
commit
16f862e493
  1. 31
      Contributing.MD
  2. 10
      README.md
  3. 55
      Roadmap.md
  4. 21
      index.js
  5. 2
      package.json
  6. 23
      util/requirements.js

31
Contributing.MD

@ -0,0 +1,31 @@
# How to contribute
First of all, thank you for taking the time to contribute to this project. We've tried to make a stable project and try to fix bugs and add new features continuously. You can help us do more.
## Getting started
### Check out the roadmap
We have some functionalities in mind and we have issued them and there is a milestone label available on the issue. If there is a bug or a feature that is not listed in the issues page or there is no one assigned to the issue, feel free to fix/add it! Although it's better to discuss it in the issue or create a new issue for it so there is no confilcting code.
### Writing some code!
Contributing to a project on Github is pretty straight forward. If this is you're first time, these are the steps you should take.
- Fork this repo.
And that's it! Read the code available and change the part you don't like! You're change should not break the existing code and should pass the tests. We recommend using VS Code while working on this project.
If you're adding a new functionality, start from the branch master. It would be a better practice to create a new branch and work in there.
When you're done, submit a pull request and for one of the maintainers to check it out. We would let you know if there is any problem or any changes that should be considered.
### Tests
We haven't written tests yet and you can manually try commands and assure the stability of the code. If you're adding a new test please write documentation for it by creating Tests.MD.
### Documentation
Every chunk of code that may be hard to understand has some comments above it. If you write some new code or change some part of the existing code in a way that it would not be functional without changing it's usages, it needs to be documented.
**__Overall, just have fun, and make sure nothing breaks. Thanks!__**

10
README.md

@ -8,12 +8,18 @@
# up
> Current version: `up v.0.1.0 (Pre-Alpha)`
> Notes: `up` has landed in pre-alpha! 🎉 Changelog will be added from `up v.0.2.0` [(Alpha/MVP)](Roadmap.md)\
> ⚠️ ❌ `up` is still not ready for use yet! Do not attempt to use this in development or production until alpha!
**`up`** is a command line application that creates nginx server blocks quickly with a single command.
> ⚠️ ❌ `up` is not ready for use yet! Do not attempt to use this!
## Installation
As of now, `up` only supports Debian and Ubuntu based distros. Support for more distros will come soon. Add an issue to bump this process.
You will need to have [_node JS_](https://nodejs.org) and [_nginx_](https://nginx.org) installed.
> ⚠️ ❌ `up` is not published on npm because it's still in development. If you intend to install it for development, follow these instructions:
@ -38,7 +44,7 @@ You will need to have [_node JS_](https://nodejs.org) and [_nginx_](https://ngin
`up kill <domain>` - Kill the server for this domain.
## Examples:
## Examples
`up static example.com` will serve a static website from current folder.

55
Roadmap.md

@ -1,21 +1,34 @@
# Roadmap
This living document details our plans for `up`. If you would like to request features or move something up the roadmap, raise an issue!
> The words `MUST`, `MUST NOT`, `SHOULD`, `SHOULD NOT`, and `MAY` are used in accordance with [RFC 2119](https://tools.ietf.org/html/rfc2119)
- [ ] MVP - Minimum Viable Product.
- `up static` and `up proxy` MUST work.
- `up kill` MUST work.
- [ ] List servers option.
- `up list` MUST provide list of servers running by parsing nginx's `sites-available` and `sites-enabled` folders.
- [ ] Option for HTTPS.
- MUST add a `-s` flag to enable HTTPS config.
- MAY add a `-c` flag to use `certbot` to automatically generate certificates using letsencrypt.
- [ ] MAY make `up` work on Windows.
Want more features? Raise an [issue!](https://github.com/codefeathers/up-serve/issues)
## Stretch goals
### ♦ Create an `up` client to deploy from anywhere
# Roadmap
This living document details our plans for `up`. If you would like to request features or move something up the roadmap, raise an issue!
> ⚠️ ❌ Disclaimers: There is NO guarantee that these will be executed in this order, or if at all. If they are executed, there is NO guarantee that they will follow the same syntax as shown in examples below. For the right syntax, check [README.md](README.md)
> The words `MUST`, `MUST NOT`, `SHOULD`, `SHOULD NOT`, and `MAY` are used in accordance with [RFC 2119](https://tools.ietf.org/html/rfc2119)
## The Roadmap
- [ ] MVP - Minimum Viable Product.
- [x] `up static` and `up proxy` MUST work.
- [ ] `up kill` MUST work.
- [ ]List servers option.
- [ ] `up list` MUST provide list of servers running by parsing nginx's `sites-available` and `sites-enabled` folders.
- [ ] `up static` MUST have an option to specify path to root. Example: `up static example.com ./public`.
- [ ] `up static` and `up proxy` MAY take a Git URL to deploy. Example:
1. `up static example.com --git https://github.com/h5bp/html5-boilerplate /html`
2. `up proxy example.com 5000 --git https://github.com/heroku/node-js-sample`
- [ ] Option for HTTPS.
- [ ] MUST add a `-s` or `--secure` flag to enable automatic HTTPS config with HTTP/2 enabled by default.
- [ ] HSTS MAY be enabled with a `-s -h`, `-sh`, `-secure -hsts` or `--secure-hsts` flag. Will warn user to be sure of what they are doing.
- [ ] MAY add a `-c` flag to use `certbot` to automatically generate certificates using letsencrypt.
- [ ] SHOULD work on a way to make `up` work on distros other than Deb/Ubuntu based.
- [ ] MAY make `up` work on Windows.
Want more features or prioritize something? Raise an [issue!](https://github.com/codefeathers/up-serve/issues)
## Stretch goals
- ♦ Create an `up` client to deploy from anywhere
- ♦ Make `up` an initialization tool that combines `git init`, `npm init`, `vue init`, etc. in a neat package. Examples:
1. `up new git`
2. `up new vue proxy 4000`

21
index.js

@ -8,29 +8,14 @@ var chalk = require('chalk');
// Requiring utils
var validate = require('./util/validate');
var requirements = require('./util/requirements')
// Requiring Actions
var createProxyServer = require('./actions/createProxyServer');
var createStaticServer = require('./actions/createStaticServer');
/* Uncomment in Production!
// Detect Linux or BSD
var isLin = /^linux|^bsd/.test(process.platform);
// Throw if OS is not Linux or BSD. This should be changed to throw if not Debian based distro. Eventually, we can add more exceptions as `up` handles more cases.
if(!isLin) {
shell.echo("\nThis is not a Linux or freeBSD distribution. I'm not written for this distro. Please raise an issue at " + chalk.cyan("https://github.com/codefeathers/up-serve") + " if you want `up` to be ported for your distro");
shell.exit(1);
}
// Throw if Nginx is not found
if (!shell.which('nginx')) {
shell.echo('I need nginx to work. Install nginx first. https://nginx.org/');
shell.exit(1);
}
*/
// Check for requirements such as OS version and nginx install. Throw and exit if requirements not found. #Roadmap: Add ability to satisfy any possible requirements.
requirements(); // Comment in development and uncomment this line in production. This should check whether the OS is compatible with this version of `up`
program
.version('0.0.1')

2
package.json

@ -1,6 +1,6 @@
{
"name": "up-serve",
"version": "0.0.1",
"version": "0.1.0",
"description": "A cli tool to quickly create and manage nginx server blocks.",
"main": "index.js",
"scripts": {

23
util/requirements.js

@ -0,0 +1,23 @@
var shell = require('shelljs');
var chalk = require('chalk');
function requirements() {
// Detect Linux or BSD
var isLin = /^linux|^bsd/.test(process.platform);
// Throw if OS is not Linux or BSD. This should be changed to throw if not Debian based distro. Eventually, we can add more exceptions as `up` handles more cases.
if(!isLin) {
shell.echo("\nThis is not a Linux or freeBSD distribution. This tool not written for this distro. Please raise an issue at " + chalk.cyan("https://github.com/codefeathers/up-serve") + " if you want `up` to be ported for your distro");
shell.exit(1);
}
// Throw if Nginx is not found
if (!shell.which('nginx')) {
shell.echo('I need nginx to work. Install nginx first. https://nginx.org/');
shell.exit(1);
}
}
module.exports = requirements;
Loading…
Cancel
Save