Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
feat(slack-history-export): rewrite
Browse files Browse the repository at this point in the history
Closes: #37 
BREAKING CHANGE: rewrote the module, some old features not working, will be adding it incrementally.
  • Loading branch information
hisabimbola authored Jun 5, 2017
2 parents 6e82279 + b341391 commit 5a0cd28
Show file tree
Hide file tree
Showing 27 changed files with 6,228 additions and 544 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": ["es2015"],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EditorConfig is awesome: https://github.com/editorconfig/editorconfig

# Top-most EditorConfig file
root = true

[*]
# Set default charset to utf-8
charset = utf-8
# Set default indentation to spaces
indent_style = space
# Linux-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
# Remove whitespace characters preceding newline characters
trim_trailing_whitespace = true

# Two space indentation for JavaScript files
[*.{js,json}]
indent_size = 2

# Disable trimming trailing whitespaces so that double space newlines work
[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage/*
dist/*
lib/*
target/*
scripts/*
node_modules/*
**/node_modules/*
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Description
<!-- If you're describing a bug, please let us know the steps to reproduce your problem. -->

```js
var your => (code) => here;
```

### Expected Behavior
<!-- What should happen or how it should work. -->

### Current Behavior
<!-- What happens instead of the expected behavior. -->
<!-- If suggesting a change, explain the difference from current behavior. -->

### Context
<!-- How has this issue affected you? What are you trying to accomplish? -->

### Possible Solution
<!-- Not obligatory, but suggestions or ideas are always welcome. -->
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#### Summary
<!-- Provide a short summary of your changes -->

#### Description
<!-- Describe the changes in this PR here and provide some context -->

#### TODO

- Tests
- [ ] Unit
- [ ] Integration
- [ ] Acceptance
- [ ] Documentation
23 changes: 18 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
lib

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

.DS_Store
lib
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
sudo: false

language: node_js

cache:
directories:
- node_modules

notifications:
email: false

node_js:
- '7'
- '6'
- '4'

branches:
only:
- master

before_script:
- npm prune

script:
- npm run coverage
- npm run check-coverage

after_success:
- npm run codecov
- npm run semantic-release

branches:
except:
- /^v\d+\.\d+\.\d+$/

git:
depth: 1

41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributing
First of all, thank you for contributing. It’s appreciated. This guide details how to use issues and pull requests to improve this project.

## Running
Watch for file changes then lint and test:
`npm start`

Babelify everything in `src` output to `lib`:
`npm run build`

## Making changes
* Create a topic branch from where you want to base your work.
* Make commits of logical units.
* Make sure you have added the necessary tests for your changes.

### Branching
When creating a branch. Use the issue number(without the '#') as the prefix and add a short title, like: `1-commit-message-example`

### Commit message
Make sure your commit messages follow the [Angular's format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines), try `npm run commit`:
````
docs(contributing): make the example in contributing guidelines concrete
The example commit message in the contributing.md document is not a concrete example. This is a problem because the
contributor is left to imagine what the commit message should look like
based on a description rather than an example. Fix the
problem by making the example concrete and imperative.
Closes #1
Breaks having an open issue
````

## Creating an Issue
Before you create a new issue:
* Check the issues on Github to ensure that one doesn't already exist.
* Clearly describe the issue, there is an [ISSUE_TEMPLATE](.github/ISSUE_TEMPLATE.md) to guide you.

## Tests
We use [tape](https://github.com/substack/tape) for unit and integration test. You can use [Cucumber](https://github.com/cucumber/cucumber-js) for acceptance tests.

We try to maintain a code coverage of 100%. Please ensure you do so too 😉
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Abimbola Idowu
Copyright (c) 2016 Abimbola Idowu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Command line module to allow you download your slack history.
Supports IM/DM, channels and private groups now, support for multiparty direct message coming soon.


[![Travis Build Status][travis-icon]][travis]
[![Codecov Coverage Status][codecov-icon]][codecov]
[![David Dependencies Status][david-icon]][david]
[![David devDependencies Status][david-dev-icon]][david-dev]

## Installation
```
npm install slack-history-export -g
Expand All @@ -22,18 +27,32 @@ Supports IM/DM, channels and private groups now, support for multiparty direct m
-g, --group [value] Enter the name of the group you will like to download
-d, --directory [value] Directory to save generated file
-f, --filename [value] Name of generated file. Default is "<current timestamp><username || channel || group>-slack-history" e.g '1443378584156-abimbola-slack-history.json'
-F, --format [value] Format you want to download the data, supported format is [csv, json], default is 'json'
```

You can provide token to the module in several ways
* CLI flag
* Environment variable `SLACK_HISTORY_EXPORT_TOKEN`
* File. File location is `~/.config/slack-history-export/config.json` with key of `SLACK_HISTORY_EXPORT_TOKEN`
```
{
"SLACK_HISTORY_EXPORT_TOKEN": "testingtoken"
}
```
## Usage
```
slack-history-export -t "slack-token-123456abcde" -u abimbola -F csv
```
## Contributing

Fork and submit pull requests to improve this tool

## Issues/Features requests
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to slack-history-export

Yes, there would be bugs or feature requests.

Please open an issue [here](https://github.com/andela-aidowu/slack-history-export/issues/new) and I would try to reply as soon as possible
[travis]: https://travis-ci.org/hisabimbola/slack-history-export
[travis-icon]: https://img.shields.io/travis/hisabimbola/slack-history-export/master.svg?style=flat-square
[codecov]: https://codecov.io/gh/hisabimbola/slack-history-export
[codecov-icon]: https://img.shields.io/codecov/c/github/hisabimbola/slack-history-export.svg?style=flat-square
[david]: https://david-dm.org/hisabimbola/slack-history-export
[david-icon]: https://img.shields.io/david/hisabimbola/slack-history-export.svg?style=flat-square
[david-dev]: https://david-dm.org/hisabimbola/slack-history-export?type=dev
[david-dev-icon]: https://img.shields.io/david/dev/hisabimbola/slack-history-export.svg?style=flat-square
14 changes: 0 additions & 14 deletions bin/cli.js

This file was deleted.

10 changes: 10 additions & 0 deletions bin/slack-history-export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/env node

/* eslint-disable */
/*
This file exists because we use Babel to transpile the JS but when testing
the CLI we need to spawn a process that uses normal JS.
*/
'use strict';

require('../lib/cli.js');
Loading

0 comments on commit 5a0cd28

Please sign in to comment.