Skip to content

Commit

Permalink
Update npm modules; add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya committed Apr 15, 2016
1 parent 75257cf commit aa8c10d
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 40 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc

This file was deleted.

4 changes: 1 addition & 3 deletions .gitattributes
Expand Up @@ -7,10 +7,8 @@
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.txt text eol=lf
*.xml text eol=lf
*.yml text eol=lf
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files

coverage
lib
node_modules
npm-debug.log
7 changes: 1 addition & 6 deletions .npmignore
@@ -1,9 +1,4 @@
.idea
.babelrc
.editorconfig
.eslintrc
.gitattributes
.gitignore
.npmignore
.travis.yml
coverage
test
9 changes: 7 additions & 2 deletions .travis.yml
@@ -1,5 +1,10 @@
sudo: false
language: node_js
node_js:
- '4.2'
- '5.1'
- '5'
- '4'
script:
- npm run lint
- npm run test:cover
after_success:
- npm run coveralls
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -3,6 +3,7 @@
[![NPM version](http://img.shields.io/npm/v/isomorphic-style-loader.svg?style=flat-square)](https://www.npmjs.com/package/isomorphic-style-loader)
[![NPM downloads](http://img.shields.io/npm/dm/isomorphic-style-loader.svg?style=flat-square)](https://www.npmjs.com/package/isomorphic-style-loader)
[![Build Status](http://img.shields.io/travis/kriasoft/isomorphic-style-loader/master.svg?style=flat-square)](https://travis-ci.org/kriasoft/isomorphic-style-loader)
[![Coverage Status](https://img.shields.io/coveralls/kriasoft/isomorphic-style-loader.svg?style=flat-square)](https://coveralls.io/github/kriasoft/isomorphic-style-loader)
[![Dependency Status](http://img.shields.io/david/kriasoft/isomorphic-style-loader.svg?style=flat-square)](https://david-dm.org/kriasoft/isomorphic-style-loader)
[![Chat](http://img.shields.io/badge/chat_room-%23react--starter--kit-blue.svg?style=flat-square)](https://gitter.im/kriasoft/react-starter-kit)

Expand Down Expand Up @@ -138,8 +139,11 @@ requested web page, effectively dealing with [FOUC](https://en.wikipedia.org/wik
issue and improving client-side performance. CSS of the unmounted components
will be removed from the DOM.

##### Hot reload
You can activate hot module reload for style by setting the `debug` option to true in your webpack configuration. If you are using webpack 2, you need to supply it though the `LoaderOptionsPlugin` because the [`debug` option has been removed](https://gist.github.com/sokra/27b24881210b56bbaff7#loader-options--minimize)
##### Hot Reload

You can activate hot module reload for style by setting the `debug` option to true in your webpack
configuration. If you are using webpack 2, you need to supply it though the `LoaderOptionsPlugin`
because the [`debug` option has been removed](https://gist.github.com/sokra/27b24881210b56bbaff7#loader-options--minimize).

### Backers

Expand Down
54 changes: 38 additions & 16 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "isomorphic-style-loader",
"version": "0.0.12",
"version": "1.0.0",
"description": "Isomorphic CSS style loader for Webpack",
"repository": "kriasoft/isomorphic-style-loader",
"author": "Kriasoft <support@kriasoft.com> (http://www.kriasoft.com)",
Expand All @@ -11,45 +11,67 @@
"keywords": [
"webpack",
"webpack-loader",
"webpack loader",
"loader",
"css",
"scss",
"style",
"styles",
"style-loader",
"style loader",
"react",
"reactjs",
"isomorphic",
"universal"
],
"license": "MIT",
"main": "lib/index.js",
"babel": {
"presets": [
"react",
"es2015",
"stage-0"
],
"plugins": [
"transform-runtime"
]
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": "airbnb"
},
"dependencies": {
"babel-runtime": "^6.3.19",
"loader-utils": "^0.2.0"
"babel-runtime": "^6.6.1",
"loader-utils": "^0.2.14"
},
"devDependencies": {
"babel": "^6.5.2",
"babel-cli": "^6.5.1",
"babel-core": "^6.5.2",
"babel-eslint": "^5.0.0",
"babel-plugin-transform-runtime": "^6.5.2",
"babel-preset-es2015": "^6.5.0",
"babel-cli": "^6.7.5",
"babel-core": "^6.7.6",
"babel-eslint": "^6.0.2",
"babel-plugin-transform-runtime": "^6.7.5",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.7.2",
"chai": "^3.5.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "5.0.1",
"eslint-plugin-react": "^3.16.1",
"jsdom": "^8.0.3",
"coveralls": "^2.11.9",
"eslint": "^2.7.0",
"eslint-config-airbnb": "7.0.0",
"eslint-plugin-jsx-a11y": "^0.6.2",
"eslint-plugin-react": "^4.3.0",
"istanbul": "^1.0.0-alpha.2",
"jsdom": "^8.3.1",
"mocha": "^2.4.5",
"react": "^0.14.7",
"react": "^15.0.1",
"rimraf": "^2.5.2",
"sinon": "^1.17.3"
"sinon": "^2.0.0-pre"
},
"scripts": {
"lint": "eslint src test",
"test": "eslint src test && mocha test --compilers js:babel-core/register",
"test": "mocha test --compilers js:babel-register",
"test:watch": "mocha --compilers js:babel-register --reporter min --watch",
"test:cover": "babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"build": "rimraf lib && babel src --out-dir lib",
"prepublish": "rimraf lib && babel src --out-dir lib"
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
@@ -1,7 +1,7 @@
/**
* Isomorphic CSS style loader for Webpack
*
* Copyright © 2015 Kriasoft, LLC. All rights reserved.
* Copyright © 2015-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion src/insertCss.js
@@ -1,7 +1,7 @@
/**
* Isomorphic CSS style loader for Webpack
*
* Copyright © 2015 Kriasoft, LLC. All rights reserved.
* Copyright © 2015-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion src/withStyles.js
@@ -1,7 +1,7 @@
/**
* Isomorphic CSS style loader for Webpack
*
* Copyright © 2015 Kriasoft, LLC. All rights reserved.
* Copyright © 2015-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
Expand Down
9 changes: 9 additions & 0 deletions test/insertCssSpec.js
@@ -1,3 +1,12 @@
/**
* Isomorphic CSS style loader for Webpack
*
* Copyright © 2015-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

import jsdom from 'jsdom';
import { describe, it } from 'mocha';
import { expect } from 'chai';
Expand Down
12 changes: 12 additions & 0 deletions test/withStylesSpec.js
@@ -1,8 +1,20 @@
/**
* Isomorphic CSS style loader for Webpack
*
* Copyright © 2015-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

/* eslint-disable react/prefer-stateless-function */

import { describe, it } from 'mocha';
import { expect } from 'chai';
import React, { createClass, Component } from 'react';
import withStyles from '../src/withStyles';


describe('withStyles(ComposedComponent, ...styles)', () => {
class Passthrough extends Component {
render() {
Expand Down

0 comments on commit aa8c10d

Please sign in to comment.