{"action":"created","issue":{"url":"https://api.github.com/repos/superscriptjs/superscript/issues/295","repository_url":"https://api.github.com/repos/superscriptjs/superscript","labels_url":"https://api.github.com/repos/superscriptjs/superscript/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/superscriptjs/superscript/issues/295/comments","events_url":"https://api.github.com/repos/superscriptjs/superscript/issues/295/events","html_url":"https://github.com/superscriptjs/superscript/pull/295","id":183310095,"number":295,"title":"Huge clean-up and fixing of tests","user":{"login":"benhjames","id":5571753,"avatar_url":"https://avatars.githubusercontent.com/u/5571753?v=3","gravatar_id":"","url":"https://api.github.com/users/benhjames","html_url":"https://github.com/benhjames","followers_url":"https://api.github.com/users/benhjames/followers","following_url":"https://api.github.com/users/benhjames/following{/other_user}","gists_url":"https://api.github.com/users/benhjames/gists{/gist_id}","starred_url":"https://api.github.com/users/benhjames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benhjames/subscriptions","organizations_url":"https://api.github.com/users/benhjames/orgs","repos_url":"https://api.github.com/users/benhjames/repos","events_url":"https://api.github.com/users/benhjames/events{/privacy}","received_events_url":"https://api.github.com/users/benhjames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-17T02:03:47Z","updated_at":"2016-10-31T18:51:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/superscriptjs/superscript/pulls/295","html_url":"https://github.com/superscriptjs/superscript/pull/295","diff_url":"https://github.com/superscriptjs/superscript/pull/295.diff","patch_url":"https://github.com/superscriptjs/superscript/pull/295.patch"},"body":"This PR aims to clean up a lot of SuperScript code, and now uses Babel to get the nice features of ES6 (+imports).\n## Description\n- Babel is used to compile ES6 => vanilla JS. No pun intended with the arrow. IMHO this is more readable and has helped me countless times in detecting bugs (some already existing in code) with variable scoping. Syntax is now more compact and followable.\n- The API exposed to the user is now just a SuperScript class. All you need to do in client code is:\n\n```\nbot = new SuperScript(options);\nbot.importFile(file, (err) => {...});\n```\n\nI think this is nicer than creating your database, fact system and so on yourself - the bot will do all this for you. You can still configure the database name and fact system name if you so desire with the options passed into the constructor.\n- Unit tests are all now running and passing (with the exception of those that were being passed pre-cleanup).\n- The topicSystem is now called the chatSystem. I found it very confusing as a new user, since I expected it just to deal with topics, but it actually deals with everything. The DB interface now makes a bit more sense, with the models in a new 'models' folder, and helpers in the 'DB' folder.\n- Tried to enforce a consistent options-passing and naming structure. I found several cases of things being renamed as they passed through superscript - that should no longer be the case as it caused a lot of confusion for me. Generally, the things passed through are a system object, a user object, and any local options for that specific message.\n- You should now be able to run two SuperScript instances at a time (if you want!), since the global Mongoose dependency has been eliminated and replaced with instanced connections. I haven't tried this out yet though. I wanted to do this so I can run two (or more) bots on a single server that speak to each other.\n- Generally, everything runs a little faster compared to the original repo. Some of this may be down to the cleanups of qtypes and node-normalizer.\n- Linter is now an extension of Airbnb's linter, which is one of the most popular linters (if not THE most popular - 4 times as popular as 'standard'!). I liked its strictness, which encourages re-thinking about how you're writing code (e.g. not modifying parameters).\n## Motivation and Context\n\nI've mainly outlined the motivation within the bullet points above. Hopefully this will be a big QoL improvement for SS maintenance in general.\n## How Has This Been Tested?\n\nUnit tests that existed beforehand are all running. Trying to get npm packages linking locally was a pain, so I haven't been able to extensively check if client generation via the bin script works, however my hacky attempt did work, so fingers crossed.\n## Types of changes\n\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\n- [x] Bug fix (non-breaking change which fixes an issue)\n- [x] New feature (non-breaking change which adds functionality)\n- [x] Breaking change (fix or feature that would cause existing functionality to change)\n## Checklist:\n\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\n\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\n- [x] My code follows the code style of this project.\n- [x] My change requires a change to the documentation.\n- [ ] I have updated the documentation accordingly. (I can do this when PR is close to being accepted) :)\n- [ ] I have added tests to cover my changes.\n- [x] All new and existing tests passed.\n"},"comment":{"url":"https://api.github.com/repos/superscriptjs/superscript/issues/comments/257385212","html_url":"https://github.com/superscriptjs/superscript/pull/295#issuecomment-257385212","issue_url":"https://api.github.com/repos/superscriptjs/superscript/issues/295","id":257385212,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T18:51:14Z","updated_at":"2016-10-31T18:51:14Z","body":"\n[![Coverage Status](https://coveralls.io/builds/8591910/badge)](https://coveralls.io/builds/8591910)\n\nChanges Unknown when pulling **56ccde47423d974727ed0f85f1f3ed47cc1640a4 on benhjames:master** into ** on superscriptjs:master**.\n"}}
{"actor":{"display_login":"coveralls"}}