Skip to content

Commit

Permalink
fix: update dependencies to support React 16 (#12)
Browse files Browse the repository at this point in the history
* update to support React 16

* updates to support latest Babel presets/plugins
  • Loading branch information
mkimberlin authored and dmatchley committed Dec 18, 2017
1 parent 446e75c commit fce106d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": ["es2015", "react"],
"plugins": ["transform-object-rest-spread"],
"presets": ["@babel/preset-es2015", "@babel/preset-react"],
"plugins": ["@babel/plugin-transform-spread", "@babel/plugin-transform-destructuring", "@babel/plugin-proposal-object-rest-spread"],
"ignore": [
"__mocks__/**/*.js",
"__tests__/**/*.js"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ lib
cov/
coverage/
.vscode/*
.idea/
47 changes: 24 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scale-text",
"version": "1.1.2",
"version": "1.1.3",
"description": "A React component for keeping a component's text sized to fill it's container",
"main": "lib/react-scale-text.js",
"module": "lib/index.js",
Expand All @@ -12,8 +12,8 @@
"lint": "eslint src",
"test": "npm run test:mocha",
"test:cov": "npm run instrument && npm run test:mocha-cov && npm run coverage",
"test:mocha": "electron-mocha ./tests/**/*.spec.js* --renderer --compilers js:babel-core/register --timeout 10000",
"test:mocha-cov": "electron-mocha ./tests/**/*.spec.js* --renderer --compilers js:babel-core/register --timeout 5000 -r ./tests/coverage.js",
"test:mocha": "electron-mocha ./tests/**/*.spec.js* --renderer --compilers js:@babel/register --timeout 10000",
"test:mocha-cov": "electron-mocha ./tests/**/*.spec.js* --renderer --compilers js:@babel/register --timeout 5000 -r ./tests/coverage.js",
"instrument": "babel-istanbul instrument src --output cov --no-compact --complete-copy --es-modules",
"coverage": "babel-istanbul report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"prepublish": "npm run lint && npm run test && npm run clean && npm run build && npm run build:umd",
Expand All @@ -34,27 +34,28 @@
},
"homepage": "https://github.com/datchley/react-scale-text",
"devDependencies": {
"ava": "^0.18.2",
"babel-cli": "^6.4.5",
"babel-core": "^6.4.5",
"babel-eslint": "^7.2.1",
"@babel/cli": "^7.0.0-beta.35",
"@babel/core": "^7.0.0-beta.35",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.35",
"@babel/plugin-transform-destructuring": "^7.0.0-beta.35",
"@babel/plugin-transform-spread": "^7.0.0-beta.35",
"@babel/preset-es2015": "^7.0.0-beta.35",
"@babel/preset-react": "^7.0.0-beta.35",
"@babel/register": "^7.0.0-beta.35",
"babel-eslint": "^8.0.3",
"babel-istanbul": "^0.12.2",
"babel-jest": "^19.0.0",
"babel-loader": "^6.2.1",
"babel-plugin-istanbul": "^4.1.1",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-loader": "^8.0.0-beta.0",
"babel-plugin-istanbul": "^4.1.5",
"chai": "^3.5.0",
"chai-enzyme": "^0.6.1",
"chai-enzyme": "^1.0.0-beta.0",
"chai-jsx": "^1.0.1",
"co-exec": "^1.0",
"codecov": "^2.1.0",
"coveralls": "^2.11.8",
"electron": "^1.6.6",
"electron-mocha": "^3.4.0",
"enzyme": "^2.7.1",
"enzyme-to-json": "^1.4.5",
"electron": "^1.8.0",
"electron-mocha": "^4.0.3",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
Expand All @@ -71,7 +72,6 @@
"jsdom": "^9.12.0",
"nyc": "^10.0.0",
"querystring": "^0.2.0",
"react-addons-test-utils": "^15.4.2",
"rimraf": "^2.5.0",
"serve": "^5.1.5",
"standard": "^9.0.2",
Expand All @@ -82,10 +82,11 @@
"xvfb-maybe": "^0.2.0"
},
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
"lodash": "^4.17.4",
"warning": "^3.0.0",
"shortid": "^2.2.8"
"prop-types": "^15.6.0",
"react": "^15.4.2 || ^16.0.0",
"react-dom": "^15.4.2 || ^16.0.0",
"shortid": "^2.2.8",
"warning": "^3.0.0"
}
}
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import warn from 'warning';
import { generate as shortId } from 'shortid';
import shallowEqual from './shallow-equal';
Expand Down
6 changes: 5 additions & 1 deletion tests/setup.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

/*
* Global setup/hooks for mocha
*/

after(function() {
if (window.__coverage__) {
console.log('Found coverage report, writing to coverage/coverage.json');
Expand Down
4 changes: 1 addition & 3 deletions tests/test.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import chai, { expect } from 'chai';
import { render, mount } from 'enzyme';
import { mount } from 'enzyme';
import chaiEnzyme from 'chai-enzyme';
import chaiJsx from 'chai-jsx';
import ScaleText from '../src/index';

chai.use(chaiEnzyme());
chai.use(chaiJsx);

// Create root node to render to
const root = document.createElement('div');
Expand Down

0 comments on commit fce106d

Please sign in to comment.