Skip to content

Commit

Permalink
Merge pull request #14 from jlord/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
Jessica Lord committed Mar 29, 2017
2 parents 577241a + c6f05ad commit dec4def
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
23 changes: 23 additions & 0 deletions LICENSE
@@ -0,0 +1,23 @@
Copyright (c) 2013, Jessica Lord
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 14 additions & 12 deletions README.md
@@ -1,28 +1,26 @@
[![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)



# Sheetsee

** A Node.js command line tool for creating a custom build of the [sheetsee.js](http://jlord.github.io/sheetsee.js) library with just the components you want.** :sparkles:
**A Node.js command line tool for creating a custom build of the [sheetsee.js](http://jlord.github.io/sheetsee.js) library with just the components you want.** :sparkles:

You can customize your sheetsee.js build with just the parts you want to use. If you want to just use the full version, you can grab it here at [github.com/jlord/sheetsee.js](https://github.com/jlord/sheetsee.js/blob/master/js/sheetsee.js).
If you want to just use the full version, you can grab it here at [github.com/jlord/sheetsee.js](https://github.com/jlord/sheetsee.js/blob/master/js/sheetsee.js).

All bundle comes with [mapbox.js]() and [handlebars.js]() (since both are available on [NPM](http://www.npmjs.org)). Additionally you'll need to also include [tabletop.js](https://github.com/jsoma/tabletop) and [jQuery](http://www.jquery.com) in your HTML head like so:
All bundles comes with [mapbox.js](https://www.mapbox.com) and [mustache.js](https://mustache.github.io) (since both are available on [NPM](http://www.npmjs.org)). Additionally, you'll need to also include [tabletop.js](https://github.com/jsoma/tabletop) in your HTML head like so:

```HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.1.0/tabletop.min.js"></script>
```

**To build your Sheetsee you'll need [Node.js](http://www.nodejs.org) and [NPM](http://www.npmjs.org) (the latter comes with the former in most installs) on your computer and a command line.**
**To build your Sheetsee you'll need [Node.js](http://www.nodejs.org) and [npm](http://www.npmjs.org) (the latter comes with the former) on your computer.**

#### Get Node/NPM

Download Node.js from [nodejs.org/download](http://nodejs.org/download). For most users you can just download the Mac _.pkg_ or Windows _.msi_. Follow the install instructions, both include NPM. Once they're installed, proceed:

## Install `sheetsee` from NPM
The `sheetsee` (with no '.js') module is the tool for building custom Sheetsee.js builds. Install `sheetsee` globally and then run it within the folder of your soon-to-be sheetsee.js project.
## To Use

Install `sheetsee` globally and then run it within the folder of your soon-to-be sheetsee.js project.

_Install globally_

Expand All @@ -33,16 +31,20 @@ npm install -g sheetsee
_Run from within a project folder_

```bash
# go into your project's directory
cd my-cool-project
# build sheetsee
sheetsee [options]
```

Here are the options for the different modules. If you want save the generated file as _sheetsee.js_ then add the `--save` option.
### Options

Here are the options for the different modules and an option for saving the file (as `sheetsee.js`).

- `-m` or `-maps` for maps
- `-t` or `-tables` for tables
- `-c` or `-charts` for charts
- `--save` to write out the file*

_* otherwise, defaults to standardout on your console which you can_ `| pbcopy`

So for instance, `sheetsee -m -t --save` will build you a Sheetsee.js with the basic **data** functions, the **map** and **tables** sections built in and save it as a file named **sheetsee.js**. Running `sheetsee -m -t | pbcopy` will save the output to your clipboard.
So for instance, `sheetsee -m -t --save` will build you a Sheetsee.js with the basic **data** functions that are included by default, the **map** and **table** sections and save it as a file named `sheetsee.js`. Running `sheetsee -m -t | pbcopy` will save the same output to your clipboard.
9 changes: 4 additions & 5 deletions bin.js
Expand Up @@ -15,16 +15,15 @@ function makeBuildInstructions (modules, cb) {
function getWantedModules (modules, cb) {
var npmModules = []
var writeFile = false
if (modules === '') console.log('Please include modules -maps/-m, -tables/-t or -charts/-c')
if (modules === '') console.log('Please include modules -maps/-m or -tables/-t')
modules.forEach(function whichModules (module) {
if (module === '-m' || module === '-maps') return npmModules.push('sheetsee-maps')
if (module === '-t' || module === '-tables') return npmModules.push('sheetsee-tables')
if (module === '-c' || module === '-charts') return npmModules.push('sheetsee-charts')
if (module === '--save') {
writeFile = true
return
}
console.error(module + ' does not exist, please use -maps/-m, -tables/-t or -charts/-c')
console.error(module + ' does not exist, please use -maps/-m or -tables/-t')
})
cb(npmModules, writeFile)
}
Expand All @@ -36,8 +35,8 @@ function includeModules (npmModules, writeFile) {
var counter = npmModules.length
npmModules.forEach(function addModules (module) {
counter--
if (counter !== 0) extendString = extendString + "require('' + module + ''), "
if (counter === 0) extendString = extendString + "require('' + module + '')); module.exports = Sheetsee;"
if (counter !== 0) extendString = extendString + "require('" + module + "'), "
if (counter === 0) extendString = extendString + "require('" + module + "')); module.exports = Sheetsee;"
})
runBuild(extendString, writeFile)
}
Expand Down
18 changes: 8 additions & 10 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "sheetsee",
"version": "0.0.3",
"version": "0.1.0",
"description": "module for building out custom sheetsee.js instances",
"main": "bin.js",
"bin": {
Expand All @@ -16,7 +16,7 @@
"author": {
"name": "Jessica Lord"
},
"license": "BSD",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/jlord/sheetsee/issues"
},
Expand All @@ -26,14 +26,12 @@
"google spreadsheet"
],
"dependencies": {
"icanhaz": "~0.10.3",
"lodash.assign": "~2.1.0",
"browserify": "~2.35.2",
"through": "~2.3.4",
"sheetsee-tables": "~0.0.0",
"sheetsee-maps": "~0.0.0",
"sheetsee-charts": "~0.0.0",
"sheetsee-core": "~0.0.0"
"browserify": "^2.35.4",
"lodash.assign": "^2.1.0",
"sheetsee-core": "^0.1.1",
"sheetsee-maps": "^1.0.0",
"sheetsee-tables": "^0.2.0",
"through": "^2.3.8"
},
"devDependencies": {
"standard": "^8.6.0"
Expand Down

0 comments on commit dec4def

Please sign in to comment.