diff --git a/.gitignore b/.gitignore index 5b83c71..54f970a 100755 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ node_modules .cmd_history .cmd_history/* .cmd_history/cmd_historycash + +# GitHub Pages site +docs/dist diff --git a/docs/assets/footer.css b/docs/assets/footer.css new file mode 100644 index 0000000..c16fc5e --- /dev/null +++ b/docs/assets/footer.css @@ -0,0 +1,7 @@ +/** + * Footer styles + */ + +.mdl-mini-footer { + +} \ No newline at end of file diff --git a/docs/assets/footer.ejs b/docs/assets/footer.ejs new file mode 100644 index 0000000..4834210 --- /dev/null +++ b/docs/assets/footer.ejs @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/docs/assets/header.css b/docs/assets/header.css new file mode 100644 index 0000000..11d8685 --- /dev/null +++ b/docs/assets/header.css @@ -0,0 +1,11 @@ +/** + * Header styles + */ + +.mdl-layout__header-row { + padding-left: 40px; +} + +.mdl-layout-title { + font-family: 'Syncopate', 'Helvetica', sans-serif; +} diff --git a/docs/assets/header.ejs b/docs/assets/header.ejs new file mode 100644 index 0000000..7594bba --- /dev/null +++ b/docs/assets/header.ejs @@ -0,0 +1,19 @@ +
+
+ + CASH + + +
+ + +
+
diff --git a/docs/assets/main.css b/docs/assets/main.css new file mode 100644 index 0000000..1f902b7 --- /dev/null +++ b/docs/assets/main.css @@ -0,0 +1,51 @@ +/** + * Main layout styles + */ + +@import 'header.css'; +@import 'footer.css'; +@import 'stats.css'; + +html, body { + font-family: 'Roboto', 'Helvetica', sans-serif; + margin: 0; + padding: 0; +} + +.hero { + background: rgb(0,130,116); + color: white; + text-align: center; + padding: 4em 40px; +} + +.hero__title { + font-family: 'Syncopate', 'Helvetica', sans-serif; + padding: 0; + margin: 0 0 16px; +} + +.hero__desc { + font-size: 24px; +} + +.page { + padding: 0 40px; +} + +.container { + max-width: 800px; + margin: 0 auto; +} + +@media screen and (max-width: 1024px) { + + .hero { + padding: 1.5em 16px; + } + + .page { + padding: 0 16px; + } + +} \ No newline at end of file diff --git a/docs/assets/main.ejs b/docs/assets/main.ejs new file mode 100644 index 0000000..cdf26c4 --- /dev/null +++ b/docs/assets/main.ejs @@ -0,0 +1,49 @@ + + + + + + <%= title %> + + + + + + + + + +
+ <%- include('header'); %> +
+ <% if (id === 'home') { %>
+

CASH

+

Cross-platform Linux without the suck

+ <%- include('stats'); %> +

+ + Get Started + +   + + link + View on GitHub + +

+
<% } %> +
+
+ <%- content %> +
+
+ <%- include('footer'); %> +
+
+ + + + + diff --git a/docs/assets/main.js b/docs/assets/main.js new file mode 100644 index 0000000..e69de29 diff --git a/docs/assets/stats.css b/docs/assets/stats.css new file mode 100644 index 0000000..dab0d0a --- /dev/null +++ b/docs/assets/stats.css @@ -0,0 +1,19 @@ +/** + * GitHub stats + */ + +.stats__link { + color: rgba(255, 255, 255, .8); + padding-right: 1em; + text-decoration: none; + font-size: 12px; + font-weight: normal; +} + +.stats__link:hover { + color: rgba(255, 255, 255, 1); +} + +.stats__link svg { + margin-right: .5em; +} diff --git a/docs/assets/stats.ejs b/docs/assets/stats.ejs new file mode 100644 index 0000000..bd39517 --- /dev/null +++ b/docs/assets/stats.ejs @@ -0,0 +1,23 @@ +<%# + This stats is taken from: + - https://api.github.com/repos/dthree/cash + - https://registry.npmjs.com/cash +%> +

+ + + <%= github.subscribers_count %> watchers + + + + <%= github.watchers %> stars + + + + <%= github.forks %> forks + + + + <%= github.open_issues_count %> open issues + +

\ No newline at end of file diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000..1c21203 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,45 @@ +--- +id: faq +title: FAQ | Cash - cross-platform Linux without the suck +--- + +## FAQ + +#### Why Cash? + +In its very essence, Cash replaces the Windows CLI prompt (`>`) with the Unix one (`$`), the dollar symbol. + +Cash was most fitting in this sense: + +> Ask and ye shall receive + +``` +> cash +$ +```` + +Cash is also a play on the word `bash`, and is actually[\[1\]](https://xkcd.com/906) a recursive acronym for Cash Shell. + +Shout out to [@aseemk](https://github.com/aseemk) for donating the name. + + +#### Doesn't ShellJS do this? + +No. + +For those who don't know, [ShellJS](https://github.com/shelljs/shelljs) is an awesome Node package that implements UNIX shell commands programatically in JavaScript. Check it out - really. While ShellJS was tremendously helpful in figuring out how to accomplish Cash, the two do not really conflict. + +ShellJS gives the feel of UNIX commands in a code environment, but aims to implement the commands in a way that makes sense for a JavaScript library. This means that many commands return JavaScript objects, and some of the rougher and more dangerous edges of bash have been softened a bit. + +For example, with cash: +```javascript +$('ls'); // 'node_modules\n' + +$('echo foo > foo.txt'); +``` + +With ShellJS: +```javascript +ls(); // ['node_modules']; + +echo('foo').to('foo.txt'); \ No newline at end of file diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..8bae8ae --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,77 @@ +--- +id: getting-started +title: Getting Started | Cash - cross-platform Linux without the suck +--- + +## Getting Started + +- [Introduction](#introduction) +- [Supported commands](#supported-commands) +- [Configuration (.cashrc)](#configuration) +- [Contributing](#contributing) +- [FAQ](#faq) +- [Team](#team) +- [License](#license) +- [Wiki](https://github.com/dthree/cash/wiki) + +## Introduction + +Cash is a project working on a cross-platform implementation of the most used Unix-based commands in pure JavaScript and with no external dependencies. + +The goal of Cash is to open up these commands to the massive JavaScript community for the first time, and to provide a cleaner, simpler and flexible alternative to applications like Cygwin for those wanting the Linux feel on Windows. + +Cash was built with strict attention to nearly exact implementations and excellent test coverage of over 200 unit tests. + + +## Supported commands + +The following commands are currently implemented: + +- alias +- cat +- clear +- cd +- cp +- echo +- export +- false +- grep +- head +- kill +- less +- ls +- mkdir +- mv +- pwd +- rm +- sort +- source +- tail +- touch +- true +- unalias + +Want more commands? + +- [Vote on the next commands](https://github.com/dthree/cash/wiki/Roadmap) +- [Help spread the word:](http://bit.ly/1LBEJ5s) More knowledge of Cash equals more contributors +- [Contribute](#contributing) + + +## Configuration + +Want to configure things to your heart's content? Just add your configurations in a `.cashrc` file (`_cashrc` also works, for Windows folk) and put that in your home directory. This supports anything you can do inside a cash command prompt (`export`ing environmental variables, aliases, etc.). + +## Contributing + +- [Editing commands](https://github.com/dthree/cash/wiki/Contributing#editing-existing-commands) +- [Adding new commands](https://github.com/dthree/cash/wiki/Contributing) + +We are currently looking for Core Team members who can push forward Cash at a rapid rate. Are you an awesome developer up to the challenge? Send me a ping. + +### Awesome contributors + +- [@nfischer](https://github.com/nfischer): Added `source`, `export`, `true` and `false` commands, among several other contributions. +- [@safinn](https://github.com/safinn): Added `clear` and `tail` commands. +- [@legien](https://github.com/legien): Added `head` command. +- [@cspotcode](https://github.com/cspotcode): Implemented template literal execution. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..f37342d --- /dev/null +++ b/docs/index.md @@ -0,0 +1,100 @@ +--- +id: home +title: Cash - cross-platform Linux without the suck +--- + +### What is Cash? + +Cash is a cross-platform implementation of Unix shell commands written in pure ES6. + +Huh? Okay - think Cygwin, except: + +* No native compiling +* No ugly DLLs +* Works in any terminal +* 1/15th of the size +* Just: + +``` +> npm install cash -g +> cash +$ +``` + +

+ Cash +

+ +### Woah. + +Yeah. But it gets better. + +Let's mix some Windows & Unix commands together: + +```bash +$ ipconfig | grep IPv4 | sort +IPv4 Address. . . . . . . . . . . : 10.10.40.50 +IPv4 Address. . . . . . . . . . . : 192.168.100.11 +$ +``` + +[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Interactive) + + +### But I don't want to type "cash" + +No problem. Let's make all commands global on your system: + +```bash +> npm install cash-global -g +> ls -lah +``` + +[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Global) + + +### Nice, but I only want certain commands + +You're covered! + +```bash +> npm install cash-ls -g +> npm install cash-grep -g +``` + +[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Global#installing-individual-commands) + + +### Wow. But I want this programmatically! + +Again, you're in business: + +```js +const $ = require('cash'); +const out = $.ls('.', {l: true}); +``` + +Not terse enough? How about this: + +```js +const out = $('ls -lah'); +``` + +Not :sunglasses: enough? Try this: + +```js +require('cash') ` + cp -R ./src ./dest + ls | grep *-spec.js | cat + rm ./specResults.html +`; +``` + +*For even better programmatic Unix commands, check out [ShellJS](https://github.com/shelljs/shelljs).* + +[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Programmatic) + + +### Isn't this impossible to do in Node? + +It was, before [Vorpal](https://github.com/dthree/vorpal). diff --git a/package.json b/package.json index b4fb35f..3eaa543 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,12 @@ "scripts": { "test": "gulp builder; ./node_modules/istanbul/lib/cli.js cover --root './dist' -x './dist/lib/sugar.js' _mocha -- -R spec && npm run lint", "test-win": "mocha", - "lint": "xo ./src/*.js ./src/**/*.js ./test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/dthree/cash.git" + "lint": "xo ./src/*.js ./src/**/*.js ./test/*.js", + "docs": "easystatic start docs --repo=dthree/cash", + "docs:build": "easystatic build docs --repo=dthree/cash --domain=cash.js.org", + "docs:deploy": "easystatic deploy docs --repo=dthree/cash --domain=cash.js.org" }, + "repository": "dthree/cash", "keywords": [ "terminal", "emulator",