Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

squid-core

squid-app18MIT0.4.11

Device's shared agnostic code

react, reflux, github api, node-webkit, nw.js, osx, ios

readme

SQUID Core

Device agnostic shared code for OSX and IOS.

Package include

  • Configuration files based on environment
  • Unit tests
  • Backbone's Models
  • Backbone's Collections
  • Reflux Actions
  • Reflux Stores
  • Utils:
    • Github API services wrapper
    • Logger class
    • Storage abstraction class

Dependencies

Squid is build on top of cool open source projects such as:

All data are served by the Github API.


Table of Content

Installation

This package is not intended to be used as a stand alone library but you might need to install it for development purpose with the following command:

$ npm install

Github app configuration

The application client ID and his secret are stored into a JSON file called github.json at the project's root. For obvious security reasons this file is not published. See Unit Tests' section for more details about file content.

Basic usage examples

// New Squid Core instance
var SquidCore = require('squid-core')

// Setup instance with custon settings
SquidCore.setup({
    locale:   {
        logger: false
      , github: {
          credentials: {
              client_id:     GITHUB.client_id
            , client_secret: GITHUB.client_secret
          }
        }
    }
  , envName: 'test'
})

SquidCore._VERSION // return '0.4.0'

// Get config value
SquidCore
  .getConfig('github.pagination') // return '50'

// New User model
var username = 'michael'
  , model    = SquidCore.model('user')
  , user     = new model({ name: username })

user.get('name') // return 'michael'

Unit Tests

First you need to add the ./github.json to the package root with the following content:

{
  "client_id":     "xxxx",
  "client_secret": "xxxx"
  "username":      "a-valid-gitub-username",
  "password":      "a-valid-gitub-password",
  "token":         "a-valid-oauth-token-or-false"
}

Then run the following command to perform unit tests:

$ npm test

Roadmap

See the roadmap future developments.

License

Squid is MIT licensed

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

changelog

Release History

All notable changes to this project will be documented here.

[Unreleased][unreleased]

0.4.11 - 2015-11-26

Changed:

  • add remove, length and clear methods to Storage class
  • update unit test

0.4.10 - 2015-10-10

Changed:

  • fix scope in logger print method
  • set utils/storage as a service provider
  • fix getFile method path && remove useless error message
  • clean options
  • add logger engine to basic logs
  • update unit test

0.4.9 - 2015-10-07

Changed:

  • fix utils/logger illegal invocation

0.4.8 - 2015-10-07

Changed:

  • utils/storage and utils/logger works are service provider now.
  • Move lib/storage/memory.js to lib/abstracts/storage.js
  • Remove first argument from Core.log()
  • Move winston.js from dependencies to dev-dependencies

Added:

  • lib/abstracts/logger as default log service.

0.4.7 - 2015-10-05

Changed:

  • Logger as external dependency

0.4.6 - 2015-10-05

Changed:

  • Update default config file path
  • update README.md and CHANGELOG.md

0.4.5 - 2015-09-30

Changed:

  • update unit test
  • update README.md and CHANGELOG.md

0.4.4 - 2015-09-30

Changed:

  • Implement new Squid Config class

0.4.3 - 2015-09-29

Changed:

  • Move back Core _version variable
  • Make Logger optional
  • Default config file path is an option, configPath (TODO: find better name)

0.4.2 - 2015-09-28

Changed:

  • Resolve package.json path in desktop

0.4.1 - 2015-09-28

Changed:

  • split actions and stores classes into distincts files
  • fix Core Alias typo

0.4.0 - 2015-09-25

Added:

  • Create services folders for data provider like Gihub or Parse
  • Create github.js service, partial unit test
  • Create repositories and issues stores files
  • Create issues and comments collection files
  • Add Error log to transport config

Changed:

  • Update Logger API with formated messages ALA sprintf
  • Rename User credentials to _GHTOKENKEYNAME as it refer to Github token
  • Rename Github credentials keys to be consistent with GH API.
  • Add `bluebird@2.10.0` to dependencies (promise library)
  • Rename isLogin method to isLogged
  • isLogged return promise
  • Update .gitignore file
  • Update unit test

Remove:

  • utils/service.js, remplaced by services/github.js

0.3.1 - 2015-09-13

Changed:

  • get core _VERSION from package.json
  • Move Logger setup to utils/logger.js
  • Move Release History to CHANGELOG.md file

0.3.0 - 2015-09-10

Added:

0.2.0 - 2015-09-08

Added:

Changed:

  • Change core access API
  • Configuration management is delegated to squid-config
  • Update Unit Test
  • Update README.md
  • Remove useless devDependencies from package.js

Remove:

  • Remove config-manager module
  • Remove Xhr class

0.1.0 - 2015-09-03

Added:

  • Package folders structure
  • Core Classes
  • Base unit test
  • README and LICENSE files